summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/test-phpunit.yml119
-rw-r--r--.gitignore16
-rw-r--r--.gitmodules12
-rw-r--r--COPYING661
-rw-r--r--DCO.txt25
-rw-r--r--Dockerfile38
-rw-r--r--INSTALL27
-rw-r--r--NEWS235
-rw-r--r--README.md56
-rw-r--r--application/config/.gitignore3
-rw-r--r--application/config/autoload.php4
-rw-r--r--application/config/config.php144
-rw-r--r--application/config/constants.php2
-rw-r--r--application/config/example/.gitignore1
-rw-r--r--application/config/example/config-local.php19
-rw-r--r--application/config/example/database.php (renamed from application/config/database.php)18
-rw-r--r--application/config/example/index.html10
-rw-r--r--application/config/example/memcached.php17
-rw-r--r--application/config/migration.php7
-rw-r--r--application/config/routes.php8
-rw-r--r--application/controllers/Api.php93
-rw-r--r--application/controllers/Main.php943
-rw-r--r--application/controllers/Tools.php122
-rw-r--r--application/controllers/User.php717
-rw-r--r--application/controllers/Welcome.php25
-rw-r--r--application/controllers/api/api_controller.php18
-rw-r--r--application/controllers/api/v2/api_info.php16
-rw-r--r--application/controllers/api/v2/file.php112
-rw-r--r--application/controllers/api/v2/user.php75
-rw-r--r--application/controllers/file/Multipaste.php113
-rw-r--r--application/core/MY_Controller.php128
-rw-r--r--application/core/MY_Input.php40
-rw-r--r--application/core/MY_Output.php16
-rw-r--r--application/exceptions/ApiException.php35
-rw-r--r--application/exceptions/FileUploadVerifyException.php23
-rw-r--r--application/exceptions/InsufficientPermissionsException.php14
-rw-r--r--application/exceptions/NotAuthenticatedException.php14
-rw-r--r--application/exceptions/NotFoundException.php14
-rw-r--r--application/exceptions/PublicApiException.php14
-rw-r--r--application/exceptions/RequestTooBigException.php14
-rw-r--r--application/exceptions/UserInputException.php14
-rw-r--r--application/exceptions/VerifyException.php23
-rw-r--r--application/helpers/filebin_helper.php325
-rw-r--r--application/libraries/Customautoloader.php42
-rw-r--r--application/libraries/Ddownload/Ddownload.php34
-rw-r--r--application/libraries/Ddownload/drivers/Ddownload_lighttpd.php26
-rw-r--r--application/libraries/Ddownload/drivers/Ddownload_nginx.php29
-rw-r--r--application/libraries/Ddownload/drivers/Ddownload_php.php111
-rw-r--r--application/libraries/Duser/Duser.php124
-rw-r--r--application/libraries/Duser/drivers/Duser_db.php79
-rw-r--r--application/libraries/Duser/drivers/Duser_fluxbb.php53
-rw-r--r--application/libraries/Duser/drivers/Duser_ldap.php79
-rw-r--r--application/libraries/ExceptionHandler.php154
-rw-r--r--application/libraries/Exif.php37
-rw-r--r--application/libraries/Image.php236
-rw-r--r--application/libraries/Image/Drivers/GD.php217
-rw-r--r--application/libraries/Image/Drivers/imagemagick.php120
-rw-r--r--application/libraries/MY_Session.php38
-rw-r--r--application/libraries/Output_cache.php82
-rw-r--r--application/libraries/ProcRunner.php129
-rw-r--r--application/libraries/Pygments.php254
-rw-r--r--application/libraries/Tempfile.php31
-rw-r--r--application/migrations/001_add_files.php45
-rw-r--r--application/migrations/002_add_users.php79
-rw-r--r--application/migrations/003_add_referrers.php61
-rw-r--r--application/migrations/004_add_filesize.php37
-rw-r--r--application/migrations/005_drop_file_password.php33
-rw-r--r--application/migrations/006_add_username_index.php35
-rw-r--r--application/migrations/007_repurpose_invitations.php68
-rw-r--r--application/migrations/008_add_profiles.php61
-rw-r--r--application/migrations/009_add_apikeys.php41
-rw-r--r--application/migrations/010_files_innodb.php20
-rw-r--r--application/migrations/011_apikeys_add_access_level.php35
-rw-r--r--application/migrations/012_add_constraints.php36
-rw-r--r--application/migrations/013_add_multipaste.php62
-rw-r--r--application/migrations/014_deduplicate_file_storage.php137
-rw-r--r--application/migrations/015_actually_deduplicate_file_storage.php56
-rw-r--r--application/migrations/016_allow_ipv6_storage.php27
-rw-r--r--application/migrations/017_increase_password_length.php27
-rw-r--r--application/migrations/018_allow_null_values_userinfo.php31
-rw-r--r--application/migrations/019_change_filesize_type.php51
-rw-r--r--application/migrations/020_update_session_table.php45
-rw-r--r--application/migrations/021_change_charset.php28
-rw-r--r--application/models/Mfile.php275
-rw-r--r--application/models/Mmultipaste.php184
-rw-r--r--application/models/Muser.php406
-rw-r--r--application/service/files.php553
-rw-r--r--application/service/multipaste_queue.php96
-rw-r--r--application/service/renderer.php187
-rw-r--r--application/service/storage.php160
-rw-r--r--application/service/user.php128
-rw-r--r--application/test/Test.php186
-rw-r--r--application/test/tests/api_v2/common.php60
-rw-r--r--application/test/tests/api_v2/test_api_permissions.php108
-rw-r--r--application/test/tests/api_v2/test_create_apikey.php66
-rw-r--r--application/test/tests/api_v2/test_file_create_multipaste.php148
-rw-r--r--application/test/tests/api_v2/test_file_delete.php82
-rw-r--r--application/test/tests/api_v2/test_file_upload.php112
-rw-r--r--application/test/tests/api_v2/test_history.php137
-rw-r--r--application/test/tests/api_v2/test_misc.php48
-rw-r--r--application/test/tests/api_v2/test_user_delete_apikey.php49
-rw-r--r--application/test/tests/test_database_schema.php38
-rw-r--r--application/test/tests/test_filebin_helper.php108
-rw-r--r--application/test/tests/test_libraries_exif.php48
-rw-r--r--application/test/tests/test_libraries_image.php110
-rw-r--r--application/test/tests/test_libraries_output_cache.php82
-rw-r--r--application/test/tests/test_libraries_procrunner.php122
-rw-r--r--application/test/tests/test_libraries_pygments.php115
-rw-r--r--application/test/tests/test_libraries_tempfile.php46
-rw-r--r--application/test/tests/test_models_muser.php113
-rw-r--r--application/test/tests/test_service_files.php121
-rw-r--r--application/test/tests/test_service_files_valid_id.php115
-rw-r--r--application/test/tests/test_service_multipaste_queue.php93
-rw-r--r--application/test/tests/test_service_storage.php172
-rw-r--r--application/test/tests/test_service_user.php65
m---------application/third_party/QrCode0
m---------application/third_party/mockery0
m---------application/third_party/parsedown0
-rwxr-xr-xapplication/third_party/test-more-php/Test-More-OO.php455
-rwxr-xr-xapplication/third_party/test-more-php/Test-More.php41
-rwxr-xr-xapplication/third_party/test-more-php/Test-Simple-OO.php237
-rwxr-xr-xapplication/third_party/test-more-php/Test-Simple.php18
-rwxr-xr-xapplication/third_party/test-more-php/t/PHProvable.pl35
-rwxr-xr-xapplication/third_party/test-more-php/t/badlib.php5
-rwxr-xr-xapplication/third_party/test-more-php/t/borklib.php5
-rwxr-xr-xapplication/third_party/test-more-php/t/goodlib.php5
-rwxr-xr-xapplication/third_party/test-more-php/t/goodpage.php5
-rwxr-xr-xapplication/third_party/test-more-php/t/testertests_bail_badplan_negative.php9
-rwxr-xr-xapplication/third_party/test-more-php/t/testertests_bail_badplan_noninteger.php9
-rwxr-xr-xapplication/third_party/test-more-php/t/testertests_bundle.php42
-rwxr-xr-xapplication/third_party/test-more-php/t/testertests_deprecated_comparisons.php27
-rwxr-xr-xapplication/third_party/test-more-php/t/testertests_deprecated_comparisons.pl25
-rwxr-xr-xapplication/third_party/test-more-php/t/testertests_exit_0.php8
-rwxr-xr-xapplication/third_party/test-more-php/t/testertests_exit_fail_260.php14
-rwxr-xr-xapplication/third_party/test-more-php/t/testertests_exit_fail_5.php14
-rwxr-xr-xapplication/third_party/test-more-php/t/testertests_func_ok.php24
-rwxr-xr-xapplication/third_party/test-more-php/t/testertests_func_ok.php_Test-More.out24
-rwxr-xr-xapplication/third_party/test-more-php/t/testertests_func_ok.php_Test-Simple.out16
-rwxr-xr-xapplication/third_party/test-more-php/t/testertests_func_ok.pl24
-rwxr-xr-xapplication/third_party/test-more-php/t/testertests_func_ok.pl_Test-More.out24
-rwxr-xr-xapplication/third_party/test-more-php/t/testertests_func_ok.pl_Test-Simple.out24
-rwxr-xr-xapplication/third_party/test-more-php/t/testertests_func_skip.php11
-rwxr-xr-xapplication/third_party/test-more-php/t/testertests_func_skip.pl9
-rwxr-xr-xapplication/third_party/test-more-php/t/testertests_include_ok_badlib.php21
-rwxr-xr-xapplication/third_party/test-more-php/t/testertests_include_ok_fatal.php17
-rwxr-xr-xapplication/third_party/test-more-php/t/testertests_interp.php10
-rwxr-xr-xapplication/third_party/test-more-php/t/testertests_interp_env.php19
-rwxr-xr-xapplication/third_party/test-more-php/t/testertests_interp_set.php18
-rwxr-xr-xapplication/third_party/test-more-php/t/testertests_is_deeply.php31
-rwxr-xr-xapplication/third_party/test-more-php/t/testertests_require_ok_badlib.php12
-rwxr-xr-xapplication/third_party/test-more-php/t/testertests_require_ok_borklib.php12
-rwxr-xr-xapplication/third_party/test-more-php/t/testertests_require_ok_missing.php12
-rwxr-xr-xapplication/third_party/test-more-php/t/try.php7
-rw-r--r--application/views/contact.php1
-rw-r--r--application/views/errors/html/error_404.php65
-rw-r--r--application/views/errors/html/error_db.php65
-rw-r--r--application/views/errors/html/error_general.php44
-rw-r--r--application/views/file/deleted.php11
-rw-r--r--application/views/file/file_info.php36
-rw-r--r--application/views/file/fragments/alert-wide.php3
-rw-r--r--application/views/file/fragments/asciinema-player.php8
-rw-r--r--application/views/file/fragments/audio-player.php8
-rw-r--r--application/views/file/fragments/thumbnail.php35
-rw-r--r--application/views/file/fragments/uploads_table.php25
-rw-r--r--application/views/file/fragments/video-player.php12
-rw-r--r--application/views/file/html_footer.php3
-rw-r--r--application/views/file/html_header.php13
-rw-r--r--application/views/file/html_paste_footer.php2
-rw-r--r--application/views/file/html_paste_header.php87
-rw-r--r--application/views/file/multipaste/queue.php32
-rw-r--r--application/views/file/multipaste_info.php26
-rw-r--r--application/views/file/nav_history.php18
-rw-r--r--application/views/file/non_existent.php3
-rw-r--r--application/views/file/show_url.php8
-rw-r--r--application/views/file/upload_form.php175
-rw-r--r--application/views/file/upload_history.php39
-rw-r--r--application/views/file/upload_history_thumbnails.php26
-rw-r--r--application/views/footer.php23
-rw-r--r--application/views/header.php121
-rw-r--r--application/views/tests/echo-fragment.php5
-rw-r--r--application/views/user/apikeys.php60
-rw-r--r--application/views/user/delete_account_form.php27
-rw-r--r--application/views/user/delete_account_success.php8
-rw-r--r--application/views/user/hash_password.php38
-rw-r--r--application/views/user/index.php3
-rw-r--r--application/views/user/invite.php45
-rw-r--r--application/views/user/login.php26
-rw-r--r--application/views/user/nav.php11
-rw-r--r--application/views/user/profile.php48
-rw-r--r--application/views/user/register.php52
-rw-r--r--application/views/user/registered.php3
-rw-r--r--application/views/user/reset_password_form.php33
-rw-r--r--application/views/user/reset_password_link_sent.php3
-rw-r--r--application/views/user/reset_password_success.php3
-rw-r--r--application/views/user/reset_password_username_form.php19
-rw-r--r--application/views/welcome_message.php100
-rwxr-xr-xbuild-release.sh84
-rwxr-xr-xcheck_deps.php88
-rw-r--r--composer.json37
-rw-r--r--composer.lock615
-rw-r--r--crontab2
-rw-r--r--data/.htaccess13
l---------data/client1
l---------data/css1
l---------data/fonts1
l---------data/img1
l---------data/js1
-rw-r--r--data/local/.gitignore5
-rw-r--r--data/local/examples/.gitignore3
-rw-r--r--data/local/examples/contact-info.php4
-rw-r--r--data/local/examples/favicon.png0
-rw-r--r--data/local/examples/header.inc.php4
-rw-r--r--data/local/examples/logo.svg0
-rw-r--r--data/local/examples/style.css4
-rw-r--r--data/tests/black_white.pngbin0 -> 238 bytes
m---------data/tests/exif-orientation-examples0
-rw-r--r--data/tests/message1.binbin0 -> 64 bytes
-rw-r--r--data/tests/message2.bin1
-rw-r--r--data/tests/simple.pdfbin0 -> 9505 bytes
-rw-r--r--data/tests/small-file3
-rw-r--r--data/tests/{elapsed_time}.txt1
-rw-r--r--data/uploads/.htaccess1
-rw-r--r--doc/api.md161
-rw-r--r--doc/api/file.md307
-rw-r--r--doc/api/user.md123
-rw-r--r--doc/setup.md28
-rw-r--r--docker/README.md43
-rwxr-xr-xdocker/add_user.sh5
-rw-r--r--docker/docker-compose.yml30
-rwxr-xr-xdocker/filebin_starter.sh83
-rw-r--r--extras/munin/filebin_stats25
-rwxr-xr-xgit-hooks/post-merge39
-rw-r--r--htaccess.txt7
-rw-r--r--index.php313
-rw-r--r--phpdoc.dist.xml21
-rw-r--r--public_html/data/css/asciinema-player.css2563
-rw-r--r--public_html/data/css/bootstrap-theme.css596
-rw-r--r--public_html/data/css/bootstrap-theme.min.css14
-rw-r--r--public_html/data/css/bootstrap.css6762
-rw-r--r--public_html/data/css/bootstrap.min.css14
-rw-r--r--public_html/data/css/colorbox.css73
-rw-r--r--public_html/data/css/style.css1114
-rw-r--r--public_html/data/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.pngbin0 -> 418 bytes
-rw-r--r--public_html/data/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.pngbin0 -> 312 bytes
-rw-r--r--public_html/data/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.pngbin0 -> 262 bytes
-rw-r--r--public_html/data/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.pngbin0 -> 348 bytes
-rw-r--r--public_html/data/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.pngbin0 -> 207 bytes
-rw-r--r--public_html/data/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.pngbin0 -> 5815 bytes
-rw-r--r--public_html/data/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.pngbin0 -> 278 bytes
-rw-r--r--public_html/data/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.pngbin0 -> 328 bytes
-rw-r--r--public_html/data/css/ui-lightness/images/ui-icons_222222_256x240.pngbin0 -> 6922 bytes
-rw-r--r--public_html/data/css/ui-lightness/images/ui-icons_228ef1_256x240.pngbin0 -> 4549 bytes
-rw-r--r--public_html/data/css/ui-lightness/images/ui-icons_ef8c08_256x240.pngbin0 -> 4549 bytes
-rw-r--r--public_html/data/css/ui-lightness/images/ui-icons_ffd27a_256x240.pngbin0 -> 4549 bytes
-rw-r--r--public_html/data/css/ui-lightness/images/ui-icons_ffffff_256x240.pngbin0 -> 6299 bytes
-rw-r--r--public_html/data/css/ui-lightness/jquery-ui.css586
-rw-r--r--public_html/data/css/ui-lightness/jquery-ui.min.css7
-rw-r--r--public_html/data/css/ui-lightness/jquery-ui.structure.css160
-rw-r--r--public_html/data/css/ui-lightness/jquery-ui.structure.min.css5
-rw-r--r--public_html/data/css/ui-lightness/jquery-ui.theme.css443
-rw-r--r--public_html/data/css/ui-lightness/jquery-ui.theme.min.css5
-rw-r--r--public_html/data/fonts/glyphicons-halflings-regular.eotbin0 -> 20127 bytes
-rw-r--r--public_html/data/fonts/glyphicons-halflings-regular.svg288
-rw-r--r--public_html/data/fonts/glyphicons-halflings-regular.ttfbin0 -> 45404 bytes
-rw-r--r--public_html/data/fonts/glyphicons-halflings-regular.woffbin0 -> 23424 bytes
-rw-r--r--public_html/data/fonts/glyphicons-halflings-regular.woff2bin0 -> 18028 bytes
-rw-r--r--public_html/data/img/asc.gifbin0 -> 54 bytes
-rw-r--r--public_html/data/img/bg.gifbin0 -> 64 bytes
-rw-r--r--public_html/data/img/colorbox/loading.gifbin0 -> 6244 bytes
-rw-r--r--public_html/data/img/desc.gifbin0 -> 54 bytes
-rw-r--r--public_html/data/img/glyphicons-halflings-white.pngbin0 -> 8777 bytes
-rw-r--r--public_html/data/img/glyphicons-halflings.pngbin0 -> 12799 bytes
-rw-r--r--public_html/data/js/application.js130
-rw-r--r--public_html/data/js/lexer-input.js48
-rw-r--r--public_html/data/js/main.js30
-rw-r--r--public_html/data/js/multipaste.js86
-rw-r--r--public_html/data/js/tablesorter.js82
-rw-r--r--public_html/data/js/tabwidth-input.js37
-rw-r--r--public_html/data/js/thumbnail-view.js148
-rw-r--r--public_html/data/js/uploader.js133
-rw-r--r--public_html/data/js/util.js60
-rw-r--r--public_html/data/js/vendor/asciinema-player.js1213
-rw-r--r--public_html/data/js/vendor/bootstrap.js2366
-rw-r--r--public_html/data/js/vendor/bootstrap.min.js12
-rw-r--r--public_html/data/js/vendor/jquery-2.0.3.js8829
-rw-r--r--public_html/data/js/vendor/jquery-2.0.3.min.js6
-rw-r--r--public_html/data/js/vendor/jquery-2.0.3.min.map1
-rw-r--r--public_html/data/js/vendor/jquery-ui-1.10.3.custom.min.js6
-rw-r--r--public_html/data/js/vendor/jquery-ui.js4825
-rw-r--r--public_html/data/js/vendor/jquery-ui.min.js7
-rw-r--r--public_html/data/js/vendor/jquery.checkboxes-1.0.6.min.js1
-rw-r--r--public_html/data/js/vendor/jquery.colorbox.js1183
-rw-r--r--public_html/data/js/vendor/jquery.lazyload.js242
-rw-r--r--public_html/data/js/vendor/jquery.metadata.js120
-rw-r--r--public_html/data/js/vendor/jquery.tablesorter.min.js4
-rw-r--r--public_html/data/js/vendor/jquery.wheelzoom.js162
-rw-r--r--public_html/data/js/vendor/require.js36
-rw-r--r--public_html/data/js/vendor/underscore.js1548
l---------public_html/data/local1
-rw-r--r--public_html/index.php392
-rw-r--r--public_html/robots.txt2
-rw-r--r--readme.rst71
l---------robots.txt1
-rwxr-xr-xrun-tests.sh59
-rwxr-xr-xscripts/get_lexer_list.py18
-rwxr-xr-xscripts/hooks-wrapper.sh12
-rwxr-xr-xscripts/install-git-hooks.sh18
-rwxr-xr-xscripts/optimize_js.sh6
-rw-r--r--scripts/r.js29002
-rw-r--r--system/libraries/javascript/index.html10
-rw-r--r--tests/Bootstrap.php83
-rw-r--r--tests/README.md226
-rw-r--r--tests/codeigniter/Setup_test.php13
-rw-r--r--tests/codeigniter/core/Benchmark_test.php67
-rw-r--r--tests/codeigniter/core/Common_test.php69
-rw-r--r--tests/codeigniter/core/Config_test.php240
-rw-r--r--tests/codeigniter/core/Input_test.php289
-rw-r--r--tests/codeigniter/core/Lang_test.php101
-rw-r--r--tests/codeigniter/core/Loader_test.php594
-rw-r--r--tests/codeigniter/core/Log_test.php63
-rw-r--r--tests/codeigniter/core/Model_test.php37
-rw-r--r--tests/codeigniter/core/Output_test.php63
-rw-r--r--tests/codeigniter/core/Security_test.php356
-rw-r--r--tests/codeigniter/core/URI_test.php254
-rw-r--r--tests/codeigniter/core/Utf8_test.php91
-rw-r--r--tests/codeigniter/core/compat/hash_test.php77
-rw-r--r--tests/codeigniter/core/compat/mbstring_test.php54
-rw-r--r--tests/codeigniter/core/compat/password_test.php159
-rw-r--r--tests/codeigniter/core/compat/standard_test.php378
-rw-r--r--tests/codeigniter/database/DB_driver_test.php39
-rw-r--r--tests/codeigniter/database/DB_test.php61
-rw-r--r--tests/codeigniter/database/query_builder/count_test.php48
-rw-r--r--tests/codeigniter/database/query_builder/delete_test.php64
-rw-r--r--tests/codeigniter/database/query_builder/distinct_test.php33
-rw-r--r--tests/codeigniter/database/query_builder/empty_test.php39
-rw-r--r--tests/codeigniter/database/query_builder/escape_test.php68
-rw-r--r--tests/codeigniter/database/query_builder/from_test.php49
-rw-r--r--tests/codeigniter/database/query_builder/get_test.php53
-rw-r--r--tests/codeigniter/database/query_builder/group_test.php50
-rw-r--r--tests/codeigniter/database/query_builder/insert_test.php66
-rw-r--r--tests/codeigniter/database/query_builder/join_test.php101
-rw-r--r--tests/codeigniter/database/query_builder/like_test.php129
-rw-r--r--tests/codeigniter/database/query_builder/limit_test.php48
-rw-r--r--tests/codeigniter/database/query_builder/order_test.php55
-rw-r--r--tests/codeigniter/database/query_builder/select_test.php95
-rw-r--r--tests/codeigniter/database/query_builder/truncate_test.php56
-rw-r--r--tests/codeigniter/database/query_builder/update_test.php57
-rw-r--r--tests/codeigniter/database/query_builder/where_test.php134
-rw-r--r--tests/codeigniter/helpers/array_helper_test.php45
-rw-r--r--tests/codeigniter/helpers/captcha_helper_test.php10
-rw-r--r--tests/codeigniter/helpers/cookie_helper_test.php59
-rw-r--r--tests/codeigniter/helpers/date_helper_test.php325
-rw-r--r--tests/codeigniter/helpers/directory_helper_test.php59
-rw-r--r--tests/codeigniter/helpers/download_helper_test.php10
-rw-r--r--tests/codeigniter/helpers/email_helper_test.php24
-rw-r--r--tests/codeigniter/helpers/file_helper_test.php144
-rw-r--r--tests/codeigniter/helpers/form_helper_test.php290
-rw-r--r--tests/codeigniter/helpers/html_helper_test.php106
-rw-r--r--tests/codeigniter/helpers/inflector_helper_test.php96
-rw-r--r--tests/codeigniter/helpers/language_helper_test.php16
-rw-r--r--tests/codeigniter/helpers/number_helper_test.php63
-rw-r--r--tests/codeigniter/helpers/path_helper_test.php30
-rw-r--r--tests/codeigniter/helpers/security_helper_test.php64
-rw-r--r--tests/codeigniter/helpers/string_helper_test.php148
-rw-r--r--tests/codeigniter/helpers/text_helper_test.php179
-rw-r--r--tests/codeigniter/helpers/url_helper_test.php89
-rw-r--r--tests/codeigniter/helpers/xml_helper_test.php15
-rw-r--r--tests/codeigniter/libraries/Calendar_test.php222
-rw-r--r--tests/codeigniter/libraries/Driver_test.php180
-rw-r--r--tests/codeigniter/libraries/Encrypt_test.php79
-rw-r--r--tests/codeigniter/libraries/Encryption_test.php400
-rw-r--r--tests/codeigniter/libraries/Form_validation_test.php629
-rw-r--r--tests/codeigniter/libraries/Parser_test.php95
-rw-r--r--tests/codeigniter/libraries/Session_test.php440
-rw-r--r--tests/codeigniter/libraries/Table_test.php300
-rw-r--r--tests/codeigniter/libraries/Typography_test.php182
-rw-r--r--tests/codeigniter/libraries/Upload_test.php299
-rw-r--r--tests/codeigniter/libraries/Useragent_test.php125
-rw-r--r--tests/mocks/autoloader.php119
-rw-r--r--tests/mocks/ci_testcase.php398
-rw-r--r--tests/mocks/ci_testconfig.php20
-rw-r--r--tests/mocks/core/common.php153
-rw-r--r--tests/mocks/core/input.php49
-rw-r--r--tests/mocks/core/security.php35
-rw-r--r--tests/mocks/core/uri.php32
-rw-r--r--tests/mocks/core/utf8.php19
-rw-r--r--tests/mocks/database/config/mysql.php34
-rw-r--r--tests/mocks/database/config/mysqli.php34
-rw-r--r--tests/mocks/database/config/pdo/mysql.php37
-rw-r--r--tests/mocks/database/config/pdo/pgsql.php37
-rw-r--r--tests/mocks/database/config/pdo/sqlite.php37
-rw-r--r--tests/mocks/database/config/pgsql.php34
-rw-r--r--tests/mocks/database/config/sqlite.php34
-rw-r--r--tests/mocks/database/db.php142
-rw-r--r--tests/mocks/database/db/driver.php40
-rw-r--r--tests/mocks/database/drivers/mysql.php16
-rw-r--r--tests/mocks/database/drivers/mysqli.php16
-rw-r--r--tests/mocks/database/drivers/pdo.php15
-rw-r--r--tests/mocks/database/drivers/postgre.php16
-rw-r--r--tests/mocks/database/drivers/sqlite.php16
-rw-r--r--tests/mocks/database/schema/skeleton.php155
-rw-r--r--tests/mocks/libraries/driver.php27
-rw-r--r--tests/mocks/libraries/encrypt.php16
-rw-r--r--tests/mocks/libraries/encryption.php39
-rw-r--r--tests/mocks/libraries/session.php38
-rw-r--r--tests/mocks/libraries/table.php16
-rw-r--r--tests/mocks/uploads/ci_logo.gifbin3270 -> 0 bytes
-rw-r--r--tests/phpunit.xml25
-rw-r--r--tests/travis/mysql.phpunit.xml26
-rw-r--r--tests/travis/mysqli.phpunit.xml26
-rw-r--r--tests/travis/pdo/mysql.phpunit.xml26
-rw-r--r--tests/travis/pdo/pgsql.phpunit.xml26
-rw-r--r--tests/travis/pdo/sqlite.phpunit.xml26
-rw-r--r--tests/travis/pgsql.phpunit.xml26
-rw-r--r--tests/travis/sqlite.phpunit.xml27
-rw-r--r--user_guide_src/Makefile130
-rw-r--r--user_guide_src/README.rst65
-rw-r--r--user_guide_src/cilexer/README22
-rw-r--r--user_guide_src/cilexer/cilexer/__init__.py1
-rw-r--r--user_guide_src/cilexer/cilexer/cilexer.py56
-rw-r--r--user_guide_src/cilexer/setup.py23
-rw-r--r--user_guide_src/source/DCO.rst27
-rw-r--r--user_guide_src/source/_themes/sphinx_rtd_theme/LICENSE20
-rw-r--r--user_guide_src/source/_themes/sphinx_rtd_theme/__init__.py17
-rw-r--r--user_guide_src/source/_themes/sphinx_rtd_theme/breadcrumbs.html22
-rw-r--r--user_guide_src/source/_themes/sphinx_rtd_theme/footer.html33
-rw-r--r--user_guide_src/source/_themes/sphinx_rtd_theme/layout.html166
-rw-r--r--user_guide_src/source/_themes/sphinx_rtd_theme/layout_old.html205
-rw-r--r--user_guide_src/source/_themes/sphinx_rtd_theme/pulldown.html17
-rw-r--r--user_guide_src/source/_themes/sphinx_rtd_theme/search.html50
-rw-r--r--user_guide_src/source/_themes/sphinx_rtd_theme/searchbox.html9
-rw-r--r--user_guide_src/source/_themes/sphinx_rtd_theme/static/css/badge_only.css2
-rw-r--r--user_guide_src/source/_themes/sphinx_rtd_theme/static/css/citheme.css88
-rw-r--r--user_guide_src/source/_themes/sphinx_rtd_theme/static/css/theme.css5
-rw-r--r--user_guide_src/source/_themes/sphinx_rtd_theme/static/fonts/FontAwesome.otfbin62856 -> 0 bytes
-rw-r--r--user_guide_src/source/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.eotbin38205 -> 0 bytes
-rw-r--r--user_guide_src/source/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.svg414
-rw-r--r--user_guide_src/source/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.ttfbin80652 -> 0 bytes
-rw-r--r--user_guide_src/source/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.woffbin44432 -> 0 bytes
-rw-r--r--user_guide_src/source/_themes/sphinx_rtd_theme/static/images/ci-icon.icobin1150 -> 0 bytes
-rw-r--r--user_guide_src/source/_themes/sphinx_rtd_theme/static/js/oldtheme.js47
-rw-r--r--user_guide_src/source/_themes/sphinx_rtd_theme/static/js/theme.js134
-rw-r--r--user_guide_src/source/_themes/sphinx_rtd_theme/theme.conf8
-rw-r--r--user_guide_src/source/_themes/sphinx_rtd_theme/versions.html37
-rw-r--r--user_guide_src/source/changelog.rst3747
-rw-r--r--user_guide_src/source/conf.py263
-rw-r--r--user_guide_src/source/contributing/index.rst159
-rw-r--r--user_guide_src/source/database/caching.rst162
-rw-r--r--user_guide_src/source/database/call_function.rst39
-rw-r--r--user_guide_src/source/database/configuration.rst207
-rw-r--r--user_guide_src/source/database/connecting.rst155
-rw-r--r--user_guide_src/source/database/db_driver_reference.rst446
-rw-r--r--user_guide_src/source/database/examples.rst119
-rw-r--r--user_guide_src/source/database/forge.rst412
-rw-r--r--user_guide_src/source/database/helpers.rst100
-rw-r--r--user_guide_src/source/database/index.rst25
-rw-r--r--user_guide_src/source/database/metadata.rst130
-rw-r--r--user_guide_src/source/database/queries.rst176
-rw-r--r--user_guide_src/source/database/query_builder.rst1571
-rw-r--r--user_guide_src/source/database/results.rst507
-rw-r--r--user_guide_src/source/database/transactions.rst127
-rw-r--r--user_guide_src/source/database/utilities.rst316
-rw-r--r--user_guide_src/source/documentation/ELDocs.tmbundle.zipbin3932 -> 0 bytes
-rw-r--r--user_guide_src/source/documentation/index.rst202
-rw-r--r--user_guide_src/source/general/alternative_php.rst75
-rw-r--r--user_guide_src/source/general/ancillary_classes.rst80
-rw-r--r--user_guide_src/source/general/autoloader.rst27
-rw-r--r--user_guide_src/source/general/caching.rst71
-rw-r--r--user_guide_src/source/general/cli.rst78
-rw-r--r--user_guide_src/source/general/common_functions.rst188
-rw-r--r--user_guide_src/source/general/compatibility_functions.rst232
-rw-r--r--user_guide_src/source/general/controllers.rst340
-rw-r--r--user_guide_src/source/general/core_classes.rst117
-rw-r--r--user_guide_src/source/general/creating_drivers.rst25
-rw-r--r--user_guide_src/source/general/creating_libraries.rst260
-rw-r--r--user_guide_src/source/general/credits.rst22
-rw-r--r--user_guide_src/source/general/drivers.rst40
-rw-r--r--user_guide_src/source/general/environments.rst52
-rw-r--r--user_guide_src/source/general/errors.rst120
-rw-r--r--user_guide_src/source/general/helpers.rst145
-rw-r--r--user_guide_src/source/general/hooks.rst127
-rw-r--r--user_guide_src/source/general/index.rst33
-rw-r--r--user_guide_src/source/general/libraries.rst32
-rw-r--r--user_guide_src/source/general/managing_apps.rst61
-rw-r--r--user_guide_src/source/general/models.rst167
-rw-r--r--user_guide_src/source/general/profiling.rst90
-rw-r--r--user_guide_src/source/general/requirements.rst21
-rw-r--r--user_guide_src/source/general/reserved_names.rst88
-rw-r--r--user_guide_src/source/general/routing.rst207
-rw-r--r--user_guide_src/source/general/security.rst200
-rw-r--r--user_guide_src/source/general/styleguide.rst636
-rw-r--r--user_guide_src/source/general/urls.rst100
-rw-r--r--user_guide_src/source/general/views.rst213
-rw-r--r--user_guide_src/source/general/welcome.rst32
-rw-r--r--user_guide_src/source/helpers/array_helper.rst133
-rw-r--r--user_guide_src/source/helpers/captcha_helper.rst168
-rw-r--r--user_guide_src/source/helpers/cookie_helper.rst79
-rw-r--r--user_guide_src/source/helpers/date_helper.rst440
-rw-r--r--user_guide_src/source/helpers/directory_helper.rst83
-rw-r--r--user_guide_src/source/helpers/download_helper.rst56
-rw-r--r--user_guide_src/source/helpers/email_helper.rst75
-rw-r--r--user_guide_src/source/helpers/file_helper.rst202
-rw-r--r--user_guide_src/source/helpers/form_helper.rst743
-rw-r--r--user_guide_src/source/helpers/html_helper.rst407
-rw-r--r--user_guide_src/source/helpers/index.rst9
-rw-r--r--user_guide_src/source/helpers/inflector_helper.rst99
-rw-r--r--user_guide_src/source/helpers/language_helper.rst46
-rw-r--r--user_guide_src/source/helpers/number_helper.rst52
-rw-r--r--user_guide_src/source/helpers/path_helper.rst53
-rw-r--r--user_guide_src/source/helpers/security_helper.rst106
-rw-r--r--user_guide_src/source/helpers/smiley_helper.rst169
-rw-r--r--user_guide_src/source/helpers/string_helper.rst226
-rw-r--r--user_guide_src/source/helpers/text_helper.rst230
-rw-r--r--user_guide_src/source/helpers/typography_helper.rst75
-rw-r--r--user_guide_src/source/helpers/url_helper.rst373
-rw-r--r--user_guide_src/source/helpers/xml_helper.rst55
-rw-r--r--user_guide_src/source/images/appflowchart.gifbin25276 -> 0 bytes
-rw-r--r--user_guide_src/source/images/arrow.gifbin123 -> 0 bytes
-rw-r--r--user_guide_src/source/images/ci-icon.icobin5430 -> 0 bytes
-rw-r--r--user_guide_src/source/images/ci_logo.jpgbin5602 -> 0 bytes
-rw-r--r--user_guide_src/source/images/ci_logo_flame.jpgbin8589 -> 0 bytes
-rw-r--r--user_guide_src/source/images/file.gifbin370 -> 0 bytes
-rw-r--r--user_guide_src/source/images/folder.gifbin570 -> 0 bytes
-rw-r--r--user_guide_src/source/images/smile.gifbin1156 -> 0 bytes
-rw-r--r--user_guide_src/source/index.rst122
-rw-r--r--user_guide_src/source/installation/downloads.rst50
-rw-r--r--user_guide_src/source/installation/index.rst57
-rw-r--r--user_guide_src/source/installation/troubleshooting.rst18
-rw-r--r--user_guide_src/source/installation/upgrade_120.rst20
-rw-r--r--user_guide_src/source/installation/upgrade_130.rst125
-rw-r--r--user_guide_src/source/installation/upgrade_131.rst30
-rw-r--r--user_guide_src/source/installation/upgrade_132.rst28
-rw-r--r--user_guide_src/source/installation/upgrade_133.rst44
-rw-r--r--user_guide_src/source/installation/upgrade_140.rst72
-rw-r--r--user_guide_src/source/installation/upgrade_141.rst71
-rw-r--r--user_guide_src/source/installation/upgrade_150.rst100
-rw-r--r--user_guide_src/source/installation/upgrade_152.rst39
-rw-r--r--user_guide_src/source/installation/upgrade_153.rst28
-rw-r--r--user_guide_src/source/installation/upgrade_154.rst56
-rw-r--r--user_guide_src/source/installation/upgrade_160.rst87
-rw-r--r--user_guide_src/source/installation/upgrade_161.rst27
-rw-r--r--user_guide_src/source/installation/upgrade_162.rst45
-rw-r--r--user_guide_src/source/installation/upgrade_163.rst27
-rw-r--r--user_guide_src/source/installation/upgrade_170.rst56
-rw-r--r--user_guide_src/source/installation/upgrade_171.rst27
-rw-r--r--user_guide_src/source/installation/upgrade_172.rst48
-rw-r--r--user_guide_src/source/installation/upgrade_200.rst148
-rw-r--r--user_guide_src/source/installation/upgrade_201.rst39
-rw-r--r--user_guide_src/source/installation/upgrade_202.rst33
-rw-r--r--user_guide_src/source/installation/upgrade_203.rst63
-rw-r--r--user_guide_src/source/installation/upgrade_210.rst26
-rw-r--r--user_guide_src/source/installation/upgrade_211.rst31
-rw-r--r--user_guide_src/source/installation/upgrade_212.rst20
-rw-r--r--user_guide_src/source/installation/upgrade_213.rst20
-rw-r--r--user_guide_src/source/installation/upgrade_214.rst14
-rw-r--r--user_guide_src/source/installation/upgrade_220.rst21
-rw-r--r--user_guide_src/source/installation/upgrade_221.rst14
-rw-r--r--user_guide_src/source/installation/upgrade_222.rst14
-rw-r--r--user_guide_src/source/installation/upgrade_223.rst14
-rw-r--r--user_guide_src/source/installation/upgrade_300.rst891
-rw-r--r--user_guide_src/source/installation/upgrade_301.rst19
-rw-r--r--user_guide_src/source/installation/upgrade_302.rst24
-rw-r--r--user_guide_src/source/installation/upgrade_303.rst55
-rw-r--r--user_guide_src/source/installation/upgrade_304.rst14
-rw-r--r--user_guide_src/source/installation/upgrade_305.rst14
-rw-r--r--user_guide_src/source/installation/upgrade_306.rst48
-rw-r--r--user_guide_src/source/installation/upgrade_310.rst38
-rw-r--r--user_guide_src/source/installation/upgrade_311.rst14
-rw-r--r--user_guide_src/source/installation/upgrade_3110.rst25
-rw-r--r--user_guide_src/source/installation/upgrade_3111.rst20
-rw-r--r--user_guide_src/source/installation/upgrade_3112.rst26
-rw-r--r--user_guide_src/source/installation/upgrade_3113.rst14
-rw-r--r--user_guide_src/source/installation/upgrade_312.rst40
-rw-r--r--user_guide_src/source/installation/upgrade_313.rst46
-rw-r--r--user_guide_src/source/installation/upgrade_314.rst14
-rw-r--r--user_guide_src/source/installation/upgrade_315.rst14
-rw-r--r--user_guide_src/source/installation/upgrade_316.rst28
-rw-r--r--user_guide_src/source/installation/upgrade_317.rst27
-rw-r--r--user_guide_src/source/installation/upgrade_318.rst14
-rw-r--r--user_guide_src/source/installation/upgrade_319.rst21
-rw-r--r--user_guide_src/source/installation/upgrade_b11.rst78
-rw-r--r--user_guide_src/source/installation/upgrading.rst63
-rw-r--r--user_guide_src/source/libraries/benchmark.rst168
-rw-r--r--user_guide_src/source/libraries/caching.rst279
-rw-r--r--user_guide_src/source/libraries/calendar.rst307
-rw-r--r--user_guide_src/source/libraries/cart.rst398
-rw-r--r--user_guide_src/source/libraries/config.rst252
-rw-r--r--user_guide_src/source/libraries/email.rst405
-rw-r--r--user_guide_src/source/libraries/encrypt.rst198
-rw-r--r--user_guide_src/source/libraries/encryption.rst585
-rw-r--r--user_guide_src/source/libraries/file_uploading.rst355
-rw-r--r--user_guide_src/source/libraries/form_validation.rst1143
-rw-r--r--user_guide_src/source/libraries/ftp.rst306
-rw-r--r--user_guide_src/source/libraries/image_lib.rst475
-rw-r--r--user_guide_src/source/libraries/index.rst9
-rw-r--r--user_guide_src/source/libraries/input.rst477
-rw-r--r--user_guide_src/source/libraries/javascript.rst322
-rw-r--r--user_guide_src/source/libraries/language.rst210
-rw-r--r--user_guide_src/source/libraries/loader.rst461
-rw-r--r--user_guide_src/source/libraries/migration.rst184
-rw-r--r--user_guide_src/source/libraries/output.rst233
-rw-r--r--user_guide_src/source/libraries/pagination.rst314
-rw-r--r--user_guide_src/source/libraries/parser.rst309
-rw-r--r--user_guide_src/source/libraries/security.rst172
-rw-r--r--user_guide_src/source/libraries/sessions.rst1064
-rw-r--r--user_guide_src/source/libraries/table.rst297
-rw-r--r--user_guide_src/source/libraries/trackback.rst339
-rw-r--r--user_guide_src/source/libraries/typography.rst107
-rw-r--r--user_guide_src/source/libraries/unit_testing.rst245
-rw-r--r--user_guide_src/source/libraries/uri.rst233
-rw-r--r--user_guide_src/source/libraries/user_agent.rst248
-rw-r--r--user_guide_src/source/libraries/xmlrpc.rst582
-rw-r--r--user_guide_src/source/libraries/zip.rst243
-rw-r--r--user_guide_src/source/license.rst23
-rw-r--r--user_guide_src/source/overview/appflow.rst23
-rw-r--r--user_guide_src/source/overview/at_a_glance.rst114
-rw-r--r--user_guide_src/source/overview/features.rst46
-rw-r--r--user_guide_src/source/overview/getting_started.rst24
-rw-r--r--user_guide_src/source/overview/goals.rst32
-rw-r--r--user_guide_src/source/overview/index.rst15
-rw-r--r--user_guide_src/source/overview/mvc.rst27
-rw-r--r--user_guide_src/source/tutorial/conclusion.rst26
-rw-r--r--user_guide_src/source/tutorial/create_news_items.rst153
-rw-r--r--user_guide_src/source/tutorial/index.rst46
-rw-r--r--user_guide_src/source/tutorial/news_section.rst218
-rw-r--r--user_guide_src/source/tutorial/static_pages.rst170
626 files changed, 78864 insertions, 45174 deletions
diff --git a/.github/workflows/test-phpunit.yml b/.github/workflows/test-phpunit.yml
deleted file mode 100644
index 59fdfc2df..000000000
--- a/.github/workflows/test-phpunit.yml
+++ /dev/null
@@ -1,119 +0,0 @@
-name: PHPUnit
-
-on: [push, pull_request]
-
-jobs:
- tests:
- runs-on: ubuntu-18.04
- if: "!contains(github.event.head_commit.message, '[ci skip]')"
- env:
- PHP_INI_VALUES: assert.exception=1, zend.assertions=1
-
- strategy:
- fail-fast: false
- matrix:
- php: [ '8.1', '8.0', '7.4', '7.3', '7.2', '7.1', '7.0', '5.6', '5.5', '5.4' ]
- DB: [ 'pdo/mysql', 'pdo/pgsql', 'pdo/sqlite', 'mysqli', 'pgsql', 'sqlite' ]
- compiler: [ default ]
- include:
- - php: '8.1'
- DB: 'pdo/mysql'
- compiler: jit
- - php: '8.1'
- DB: 'pdo/pgsql'
- compiler: jit
- - php: '8.1'
- DB: 'pdo/sqlite'
- compiler: jit
- - php: '8.1'
- DB: 'mysqli'
- compiler: jit
- - php: '8.1'
- DB: 'pgsql'
- compiler: jit
- - php: '8.1'
- DB: 'sqlite'
- compiler: jit
- - php: '8.0'
- DB: 'pdo/mysql'
- compiler: jit
- - php: '8.0'
- DB: 'pdo/pgsql'
- compiler: jit
- - php: '8.0'
- DB: 'pdo/sqlite'
- compiler: jit
- - php: '8.0'
- DB: 'mysqli'
- compiler: jit
- - php: '8.0'
- DB: 'pgsql'
- compiler: jit
- - php: '8.0'
- DB: 'sqlite'
- compiler: jit
- - php: '5.6'
- DB: 'mysql'
- compiler: default
- - php: '5.5'
- DB: 'mysql'
- compiler: default
- - php: '5.4'
- DB: 'mysql'
- compiler: default
-
- services:
- postgres:
- image: postgres:12
- env:
- POSTGRES_USER: postgres
- POSTGRES_PASSWORD: postgres
- POSTGRES_DB: ci_test
- ports:
- - 5432:5432
- options: --health-cmd=pg_isready --health-interval=10s --health-timeout=5s --health-retries=3
-
- mysql:
- image: mysql:5.7
- env:
- MYSQL_ALLOW_EMPTY_PASSWORD: true
- MYSQL_USER: travis
- MYSQL_PASSWORD: travis
- MYSQL_DATABASE: ci_test
- ports:
- - 3306:3306
- options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
-
- steps:
- - name: Checkout
- uses: actions/checkout@v2
- - name: Override PHP ini values for JIT compiler
- if: matrix.compiler == 'jit'
- run: echo "PHP_INI_VALUES::assert.exception=1, zend.assertions=1, opcache.enable=1, opcache.enable_cli=1, opcache.optimization_level=-1, opcache.jit=1255, opcache.jit_buffer_size=64M" >> $GITHUB_ENV
-
- - name: Install PHP${{ matrix.php }} - DB ${{ matrix.DB }}
- uses: shivammathur/setup-php@v2
- with:
- php-version: ${{ matrix.php }}
- tools: composer, pecl
- extensions: imagick, sqlite3, pgsql, mysqli, pdo, pdo_mysql, pdo_pgsql, pdo_sqlite, mbstring
- ini-values: ${{ env.PHP_INI_VALUES }}
- coverage: xdebug
-
- - name: Get composer cache directory
- id: composer-cache
- run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- - name: Cache composer dependencies
- uses: actions/cache@v2
- with:
- path: ${{ steps.composer-cache.outputs.dir }}
- key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
- restore-keys: ${{ runner.os }}-composer-
- - name: Install composer dependencies
- run: composer install --no-progress --prefer-dist --optimize-autoloader
-
- - name: PHPUnit Test
- run: |
- php -d error_reporting=E_ALL -d zend.enable_gc=0 -d date.timezone=UTC -d mbstring.func_overload=7 -d mbstring.internal_encoding=UTF-8 vendor/bin/phpunit --coverage-text --configuration tests/travis/${{ matrix.DB }}.phpunit.xml
- env:
- XDEBUG_MODE: coverage
diff --git a/.gitignore b/.gitignore
index 323f06468..95eba43c1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,14 @@
+data/uploads/*
+data/client/
+.*
+is_installed
+!.highlight
+!data/uploads/.htaccess
+!data/.htaccess
+!.gitignore
+!system/.htaccess
+!application/.htaccess
+
.DS_Store
application/cache/*
@@ -8,6 +19,11 @@ application/logs/*
!application/*/.htaccess
+public_html/data/js/main.min.js
+/vendor
+code-coverage-report.xml
+code-coverage-report/
+
composer.lock
tests/mocks/database/ci_test.sqlite
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 000000000..8648cbbb7
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,12 @@
+[submodule "application/third_party/mockery"]
+ path = application/third_party/mockery
+ url = https://github.com/padraic/mockery.git
+[submodule "application/third_party/QrCode"]
+ path = application/third_party/QrCode
+ url = https://github.com/endroid/QrCode.git
+[submodule "application/third_party/parsedown"]
+ path = application/third_party/parsedown
+ url = https://github.com/erusev/parsedown.git
+[submodule "data/tests/exif-orientation-examples"]
+ path = data/tests/exif-orientation-examples
+ url = https://github.com/recurser/exif-orientation-examples.git
diff --git a/COPYING b/COPYING
new file mode 100644
index 000000000..dba13ed2d
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,661 @@
+ GNU AFFERO GENERAL PUBLIC LICENSE
+ Version 3, 19 November 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU Affero General Public License is a free, copyleft license for
+software and other kinds of works, specifically designed to ensure
+cooperation with the community in the case of network server software.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+our General Public Licenses are intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ Developers that use our General Public Licenses protect your rights
+with two steps: (1) assert copyright on the software, and (2) offer
+you this License which gives you legal permission to copy, distribute
+and/or modify the software.
+
+ A secondary benefit of defending all users' freedom is that
+improvements made in alternate versions of the program, if they
+receive widespread use, become available for other developers to
+incorporate. Many developers of free software are heartened and
+encouraged by the resulting cooperation. However, in the case of
+software used on network servers, this result may fail to come about.
+The GNU General Public License permits making a modified version and
+letting the public access it on a server without ever releasing its
+source code to the public.
+
+ The GNU Affero General Public License is designed specifically to
+ensure that, in such cases, the modified source code becomes available
+to the community. It requires the operator of a network server to
+provide the source code of the modified version running there to the
+users of that server. Therefore, public use of a modified version, on
+a publicly accessible server, gives the public access to the source
+code of the modified version.
+
+ An older license, called the Affero General Public License and
+published by Affero, was designed to accomplish similar goals. This is
+a different license, not a version of the Affero GPL, but Affero has
+released a new version of the Affero GPL which permits relicensing under
+this license.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU Affero General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Remote Network Interaction; Use with the GNU General Public License.
+
+ Notwithstanding any other provision of this License, if you modify the
+Program, your modified version must prominently offer all users
+interacting with it remotely through a computer network (if your version
+supports such interaction) an opportunity to receive the Corresponding
+Source of your version by providing access to the Corresponding Source
+from a network server at no charge, through some standard or customary
+means of facilitating copying of software. This Corresponding Source
+shall include the Corresponding Source for any work covered by version 3
+of the GNU General Public License that is incorporated pursuant to the
+following paragraph.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the work with which it is combined will remain governed by version
+3 of the GNU General Public License.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU Affero General Public License from time to time. Such new versions
+will be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU Affero General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU Affero General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU Affero General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If your software can interact with users remotely through a computer
+network, you should also make sure that it provides a way for users to
+get its source. For example, if your program is a web application, its
+interface could display a "Source" link that leads users to an archive
+of the code. There are many ways you could offer source, and different
+solutions will be better for different programs; see section 13 for the
+specific requirements.
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU AGPL, see
+<http://www.gnu.org/licenses/>.
diff --git a/DCO.txt b/DCO.txt
deleted file mode 100644
index a404c0d38..000000000
--- a/DCO.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-Developer's Certificate of Origin 1.1
-
-By making a contribution to this project, I certify that:
-
-(1) The contribution was created in whole or in part by me and I
- have the right to submit it under the open source license
- indicated in the file; or
-
-(2) The contribution is based upon previous work that, to the best
- of my knowledge, is covered under an appropriate open source
- license and I have the right under that license to submit that
- work with modifications, whether created in whole or in part
- by me, under the same open source license (unless I am
- permitted to submit under a different license), as indicated
- in the file; or
-
-(3) The contribution was provided directly to me by some other
- person who certified (1), (2) or (3) and I have not modified
- it.
-
-(4) I understand and agree that this project and the contribution
- are public and that a record of the contribution (including all
- personal information I submit with it, including my sign-off) is
- maintained indefinitely and may be redistributed consistent with
- this project or the open source license(s) involved.
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 000000000..b0b3dfc05
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,38 @@
+FROM alpine:edge
+LABEL maintainer="sebastian@devunit.eu"
+
+RUN apk add --no-cache bash php7 py-pygments py-pip imagemagick php7-gd nodejs composer php7-pdo_mysql php7-exif php7-ctype php7-session git php7-fileinfo msmtp
+RUN ln -sf /usr/bin/python3 /usr/bin/python
+
+ENV FILEBIN_HOME_DIR /var/lib/filebin
+ENV FILEBIN_DIR $FILEBIN_HOME_DIR/filebin
+
+ADD . $FILEBIN_DIR
+
+RUN adduser -S -h $FILEBIN_HOME_DIR filebin
+RUN chown filebin: -R $FILEBIN_HOME_DIR
+
+RUN pip install ansi2html
+
+RUN sed -i 's+.*sendmail_path =.*+sendmail_path = "/usr/bin/msmtp -C ${FILEBIN_HOME_DIR}/msmtprc --logfile ${FILEBIN_HOME_DIR}/msmtp.log -a filebinmail -t"+' /etc/php7/php.ini
+
+USER filebin
+
+ADD docker/filebin_starter.sh $FILEBIN_HOME_DIR
+ADD docker/add_user.sh $FILEBIN_HOME_DIR
+
+WORKDIR $FILEBIN_DIR
+
+RUN cp ./application/config/example/* ./application/config/
+RUN rm ./application/config/config-local.php
+
+RUN php ./check_deps.php
+
+WORKDIR $FILEBIN_HOME_DIR
+
+EXPOSE 8080
+
+VOLUME ["$FILEBIN_DIR/application/config", "$FILEBIN_DIR/data/uploads"]
+
+ENTRYPOINT ["bash", "-c"]
+CMD ["./filebin_starter.sh"]
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 000000000..5df257eed
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,27 @@
+# Configuration
+
+* run check_deps.php to make sure all dependencies are installed
+ - if you are only creating a basic development installation you will only need:
+ pygmentize (part of pygments)
+
+* Copy all files from ./application/config/example to ./application/config
+* Change them to fit your needs
+ - don't change config.php, use config-local.php to override it when needed
+
+* Copy htaccess.txt to .htaccess if you want shorter URLs
+ (also set "$config['index_page'] = '';" in config-local.php)
+
+* Add ./crontab or something similar to the user's crontab.
+ If you don't want files to expire, set upload_max_age in the config. Don't
+ skip the cronjob.
+
+* Copy ./data/local/examples/contact-info.php to ./data/local/ and edit it
+
+* run `php index.php user add_user` to add your first user
+
+* run `./scripts/install-git-hooks.sh` to install githooks.
+ This will install hooks to run database migrations and optimize javascript
+ when necessary on every git pull
+
+* run `./git-hooks/post-merge` to trigger the hook manually once in order to
+ initialize your database and optimize javascript
diff --git a/NEWS b/NEWS
new file mode 100644
index 000000000..78b0f070a
--- /dev/null
+++ b/NEWS
@@ -0,0 +1,235 @@
+This file lists major, incompatible or otherwise important changes, you should look at it after every update.
+
+NEXT
+
+3.6.2 2022-01-09
+ - Use python3 instead of python for Ubuntu 20.04 and Debian 11 compatibility.
+ If you do not have python 3, you will have to change shebang in
+ `scripts/get_lexer_list.py`. The script is still compatible with python 2.
+ - Update CodeIgniter to latest master for some additional PHP 8.0 and 8.1 fixes
+
+3.6.1 2021-04-11
+ - Copy filename when repasting file
+ - Add link to new android client
+
+3.6.0 2021-02-21
+ - PHP 8.0 comptibility fixes
+ - Add json and crystal filename extensions for highlighting
+
+3.5.0 2020-10-07
+ - API 2.2.0: Add `minimum-id-length` post parameter to
+ `file/create_multipaste` and `file/upload` endpoints
+
+3.4.5 2020-06-12
+ - Fix image orientation/rotation when viewing images with the
+ colorbox/lightbox in Firefox 76/Chromium 83.
+
+3.4.4 2020-04-19
+ - Log PublicApiException to error log
+ - Reclassify various user input/insufficient permission exceptions
+
+3.4.3 2019-12-07
+ - PHP 7.4 compatibility fixes
+
+3.4.2 2019-12-06
+ - PHP 7.4 compatibility fixes
+
+3.4.1 2019-09-27
+ - Update CodeIgniter to 3.1.11,
+ https://codeigniter.com/userguide3/changelog.html#version-3-1-11
+ - Remove (broken) thumbnails for PDF files from upload_history_thumbnails page
+ - Update composer files
+
+3.4.0 2019-05-21
+ - Allow data: URLs in Content-Security-Policy header for images and fonts
+
+3.3.2 2019-05-15
+ - Fix compatability with Pygments 2.4.0
+
+3.3.1 2019-01-28
+ - Fix CSRF issue breaking multipaste creation page
+ - Update codeigniter to 3.1.10
+ - Remove imagemagick PDF thumbnail support due to Arch Linux disabling it in
+ imagemagick due to repeated security concerns.
+
+3.3.0 2018-09-19
+ - LDAP: Allow optional binding/authentication
+ - LDAP: Allow optional filtering of allowed users
+ - Various Dockerfile fixes to make it work again
+ - Document finfo dependency
+
+3.2.0 2018-07-04
+ - Add `php index.php user delete_user` command for admin user deletion
+ - Document add_user admin command
+ - Update codeigniter to 3.1.9
+ - Document mbstring dependency
+
+3.1.1 2018-06-01
+ - Fix call to undefined method clean_multipaste_tarballs in cronjob
+
+3.1.0 2018-06-01
+ - Update asciinema player to support new cast format
+ - Allow users to delete invitation keys
+ - Add support to remove database entries without files to `php index.php file clean_stale_files`
+
+3.0.3 2018-03-23
+ - Update codeiginiter to 3.1.8
+
+3.0.2 2018-02-06
+ - Ensure newly uploaded files do not exist before adding them to the DB
+ - Update file modification time instead of overwriting it with it's own data
+ when a file is uploaded multiple times
+ - Minor changes:
+ + Support values that are not multiples of one day for upload_max_age
+ + Add config settings for testsuite to example configs
+ + Include most php extension dependencies in composer.json
+ + Use dedicated, temporary upload directory for testsuite
+
+3.0.1 2017-12-02
+ - Document different database settings for postgres in example config
+
+3.0.0 2017-12-02
+
+ - This version ensures PHP 7.2 support by updating the underlying framework
+
+ - INCOMPATIBLE: You need to perform the following actions for this update:
+ - Changes in application/config/database.php
+ + Change "$active_record = TRUE" to "$query_builder = TRUE"
+ + Change the pconnect setting to FALSE
+ + Change the stricton setting to TRUE
+ + If you use mysql: (NOT for postgres installations)
+ MYSQL Change the char_set setting to "utf8mb4"
+ MYSQL Change the dbcollat setting to "utf8mb4_bin"
+ - Changes in application/config/config-local.php
+ + Set base_url to your domain and, if used, installation directory.
+ Example: $config['base_url'] = "https://paste.xinu.at/"
+
+2.1.3 2017-07-04
+ - API 2.1.1: Fix incorrect types of empty objects returned by file/history and file/delete
+
+2.1.2 2017-06-17
+ - Fix broken lineendings when rendering ascii colors
+
+2.1.1 2017-05-22
+ - Bugfixes
+
+2.1.0 2017-05-14
+ - Autoformat single-line JSON file when rendering
+ - Improved error checking
+
+2.0.0 2017-03-03
+ - INCOMPATIBLE: Remove API v1 support
+ - INCOMPATIBLE: Remove plain text API
+ - Misc bug fixes and code improvements
+
+1.1.1 2016-11-05
+ - Fix bug in install-git-hooks.sh
+
+1.1.0 2016-11-05
+ - Add support for creating multipastes via the web interface
+ - Misc bug fixes
+
+1.0.0 2016-09-19
+ - Code refactoring and various small bugfixes
+
+2016-08-23 DEPRECATION: The old plain text API used by fb-client <2.0 is now
+ deprecated. A warning will be shown for every file uploaded via
+ the old API.
+2016-08-23 IMPORTANT: Fix an issue with git hooks not working when the installation is
+ moved. install-git-hooks.sh now creates relative symlinks. If you have moved
+ your installation and `git pull` does not display the content of the NEWS file,
+ you have to run `scripts/install-git-hooks.sh` manually once. Working
+ installations are upgraded automatically.
+2016-08-23 NEW DEPENDENCY: composer. Currently only used for the test suite, but it will
+ likely be used more widely in the future.
+2016-08-23 Allow users to delete their own account via a link on the profile page.
+2016-08-23 Add code coverage output to test suite and lots of new tests.
+
+2016-07-21 Add asciinema support for files called *.asciinema.json
+
+2016-07-13 Fix incorrect content in clipboard when copying paste content from
+ the HTML render with firefox
+2016-07-13 Add asciinema support for files called asciinema.json
+
+2016-07-10 API: Fix error when trying to use v2.1 saying that that version is
+ not supported even though it is
+2016-07-10 Add docker-compose file to easily spin up a demo instance
+2016-07-10 Update to current Bootstrap CSS framework version
+
+2016-06-16 Automatically update submodules in post-merge hook
+
+2016-06-16 Replace qrencode and markdown with PHP libraries (managed via git submodules)
+2016-06-16 Include all documentation from the wiki in ./doc
+
+2016-06-05 PHP COMPATIBILITY NOTE: This software now requires PHP >= 5.5
+2016-06-05 Switch to PHP's password_hash function. Allow changing password
+ hashing settings (see config.php)
+2016-05-05 Add Dockerfile
+
+2015-10-06 Postgres support has been updated and everything should work now.
+2015-10-06 API 2.1: Add thumbnail link to file/history
+
+2015-09-18 API v2.0: Add and remove some information in from file/history
+ API v1 is hereby deprecated and will be removed in a future update
+2015-09-18 API v1.4: Add more information to file/get_config
+2015-09-18 Add robots.txt to './public_html'. It got lost during the move to the subdir.
+
+2015-07-18 Public files moved to public_html. Old setups will continue to work
+ though it is encouraged to change the document root of the web server
+ to ./public_html.
+2015-07-18 Users can now change their account's email address if the `db` user
+ backend is used.
+
+2015-05-21 Restructure file storage to prevent issues with different
+ files that have the same md5 hash. This also needs a new munin
+ plugin if used which can be found in ./extras/munin/.
+2015-05-21 Testsuite now supports running in parallel to normal operation
+ although doing that is not suggested on production systems.
+ This requires changes to ./application/config/database.php, look
+ at the example file if you use the testsuite. Also note that the
+ arguments accepted by ./run-tests.sh are now passed to prove and
+ testing against a local web server is no longer supported.
+
+2015-05-05 JS code has been refactored a lot and can now also be minified
+2015-05-05 IMPORTANT:
+ Run `./scripts/install-git-hooks.sh` to set up automatic
+ updates after merges (git pull). Currently the hook updates the
+ database and minified js file if necessary.
+ Also run `./git-hooks/post-merge` manually once for the initial update.
+
+ Future updates will rely on you having done this and may not work
+ correctly if the hook is not executed.
+
+ The hook will also output change to this NEWS file for convenience.
+
+2015-04-09 Improve performance by caching more. If you have not yet set
+ cache_backend in config-local.php now is the time. Look in
+ config.php for details.
+2015-04-09 Get supported mimetypes from pygments itself
+
+2015-03-25 API v1.2: add user/delete_apikey endpoint
+2015-03-08 API v1.1: return full URL in api/file/create_multipaste
+2015-03-08 Rework file/cron and mfile->valid_id
+ This pulls in mockery for testing, make sure you clone submodules.
+2015-03-02 Add imagemagick support (needs convert executable in PATH)
+2015-03-02 Clarify comment for upload_max_age (you should set this to 0 if you
+ want to keep files forever and you should run the cronjob!)
+2015-02-14 JSON API + rather extensive refactoring
+2014-11-02 Multipastes can now be downloaded as tarballs. The tarballs are
+ cached and you have to run `php index.php file cron` to clean them up. Calling
+ it more often than once a day is recommended (the example changed to every ten
+ minutes). Also note that the default maximum tarball size is rather low (50MiB),
+ you might want to increase it. Also make sure the phar.so extension is loaded..
+2014-10-29 The sender for emails now has to be configured (config key is "email_from")
+2014-10-19 Postgresl support
+2014-09-20 All PHP errors are now converted to exceptions and execution
+ terminates if they are not caught. This also works properly
+ with display_errors Off/stderr.
+2014-08-29 Multipaste support
+2014-08-29 Database migrations are no longer done automatically. You now have to run
+ `php index.php tools update_database`
+2013-09-25 New download driver allowing to switch between php echoing chunks
+ (old behaviour and default) and X-Sendfile (635b0717931df907ee8015a42ad0ed1fcdf967c4)
+2013-09-25 Switch to bootstrap 3 (9538bea0908c8a3758b41967d977455af731c344)
+2013-08-15 Use CI's caching class. The default disables caching, adjust the config (cache_backend) if you want it back.
+2013-08-14 Use python-ansi2html instead of HTML::FromANSI
diff --git a/README.md b/README.md
new file mode 100644
index 000000000..7a3793424
--- /dev/null
+++ b/README.md
@@ -0,0 +1,56 @@
+# FileBin
+
+A pastebin software running on [https://paste.xinu.at](https://paste.xinu.at).
+In addition to uploading text and code it also supports binary files.
+
+Additional documentation can be found in [`./doc`](doc/).
+
+## Installation/Development
+
+Git is used for tracking changes and updating installations. The repository is
+located at [https://git.server-speed.net/users/flo/filebin/](https://git.server-speed.net/users/flo/filebin/).
+Clone the repository and follow the instructions in `./INSTALL`. Do not
+install using tarballs as this is not supported.
+
+`dev` is the development branch and should not be used in production. All
+stable changes go to `master` and will be tagged regularly following [semver
+guidelines](http://semver.org/).
+
+### Mailing List
+
+Currently there is only [one mailing
+list](https://lists.server-speed.net/listinfo/filebin-general) for everything
+(general discussion, patches, announcements, ...). If need be more lists will be
+created at a later date.
+
+### IRC
+
+The official IRC channel is [irc.freenode.net/#filebin](irc://irc.freenode.net/#filebin).
+
+### Patches
+
+Please submit patches (preferably git send-email) to the [filebin-general
+mailing list](https://lists.server-speed.net/listinfo/filebin-general). You do
+not need to register to be allowed to post.
+
+You can also open a pull request on [GitHub](https://github.com/Bluewind/filebin).
+
+
+## Dependencies
+
+* PHP >=5.5 with the following modules
+ * gd for thumbnail generation
+ * exif for thumbnail generation
+ * phar for tarball creation
+ * mysql, mysqli, pgsql, pdo_mysql (any of those) for database access
+ * mbstring for multibyte support
+ * finfo for mimetype detection
+ * xdebug for tests (not required on production)
+
+* [composer](https://getcomposer.org/) for dependency management
+* [pygmentize](http://pygments.org/) for code highlighting
+* [ansi2html](http://pypi.python.org/pypi/ansi2html) for shell output rendering (ANSI color codes)
+* [imagemagick](http://www.imagemagick.org/) for additional thumbnail generation
+ * ghostscript for PDF thumbnail creation via imagemagick
+* [node.js](https://nodejs.org/) for javascript minification
+
diff --git a/application/config/.gitignore b/application/config/.gitignore
new file mode 100644
index 000000000..45e1c5158
--- /dev/null
+++ b/application/config/.gitignore
@@ -0,0 +1,3 @@
+config-local.php
+database.php
+memcached.php
diff --git a/application/config/autoload.php b/application/config/autoload.php
index 7cdc9013c..a95dc038a 100644
--- a/application/config/autoload.php
+++ b/application/config/autoload.php
@@ -58,7 +58,7 @@ $autoload['packages'] = array();
|
| $autoload['libraries'] = array('user_agent' => 'ua');
*/
-$autoload['libraries'] = array();
+$autoload['libraries'] = array('database');
/*
| -------------------------------------------------------------------
@@ -89,7 +89,7 @@ $autoload['drivers'] = array();
|
| $autoload['helper'] = array('url', 'file');
*/
-$autoload['helper'] = array();
+$autoload['helper'] = array('url');
/*
| -------------------------------------------------------------------
diff --git a/application/config/config.php b/application/config/config.php
index 35ace5cc9..845e6b55c 100644
--- a/application/config/config.php
+++ b/application/config/config.php
@@ -160,7 +160,11 @@ $config['composer_autoload'] = FALSE;
| DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!!
|
*/
-$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';
+if (php_sapi_name() == "cli") {
+ $config['permitted_uri_chars'] = '';
+} else {
+ $config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';
+}
/*
|--------------------------------------------------------------------------
@@ -383,11 +387,11 @@ $config['encryption_key'] = '';
| except for 'cookie_prefix' and 'cookie_httponly', which are ignored here.
|
*/
-$config['sess_driver'] = 'files';
+$config['sess_driver'] = 'database';
$config['sess_cookie_name'] = 'ci_session';
$config['sess_samesite'] = 'Lax';
$config['sess_expiration'] = 7200;
-$config['sess_save_path'] = NULL;
+$config['sess_save_path'] = "ci_sessions";
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;
@@ -457,7 +461,7 @@ $config['global_xss_filtering'] = FALSE;
| 'csrf_regenerate' = Regenerate token on every submission
| 'csrf_exclude_uris' = Array of URIs which ignore CSRF checks
*/
-$config['csrf_protection'] = FALSE;
+$config['csrf_protection'] = FALSE; // our controller enables this later
$config['csrf_token_name'] = 'csrf_test_name';
$config['csrf_cookie_name'] = 'csrf_cookie_name';
$config['csrf_expire'] = 7200;
@@ -530,3 +534,135 @@ $config['rewrite_short_tags'] = FALSE;
| Array: array('10.0.1.200', '192.168.5.0/24')
*/
$config['proxy_ips'] = '';
+
+/*
+|--------------------------------------------------------------------------
+| FileBin
+|--------------------------------------------------------------------------
+ */
+
+// This address will be used as the sender for emails (like password recovery mails).
+$config['email_from'] = "webmaster@example.invalid";
+
+// upload_path should NOT be readable/served by the server, but only by the script
+$config['upload_path'] = FCPATH.'data/uploads';
+
+// Make sure to adjust PHP's limits (post_max_size, upload_max_filesize) if necessary
+$config['upload_max_size'] = 256*1024*1024; // 256MiB
+
+// Files smaller than this will be highlit, larger ones will simply be downloaded
+// even if requested to be highlit.
+$config['upload_max_text_size'] = 2*1024*1024; // 2MiB
+
+// Files older than this will be deleted by the cron job or when accessed.
+// 0 disables deletion.
+$config['upload_max_age'] = 60*60*24*5; // 5 days
+
+// Action keys (invitions, password resets) will be deleted after this time by
+// the cron job.
+$config['actions_max_age'] = 60*60*24*5; // 5 days
+
+// Files smaller than this won't be deleted (even if they are old enough)
+$config['small_upload_size'] = 1024*10; // 10KiB
+
+// Maximum size for multipaste tarballs. 0 disables the feature
+$config['tarball_max_size'] = 1024*1024*50; // 50MiB
+
+// Multipaste tarballs older than this will be deleted by the cron job
+// Changing this is not recommended
+$config['tarball_cache_time'] = 60*5; // 5 minutes
+
+// The maximum number of active invitation keys per account.
+$config['max_invitation_keys'] = 3; //3 keys
+
+
+// Possible values:
+// - apc: needs the apc module and is only useful on long running php processes
+// - file: you will have to clean up the cache directory yourself (./application/cache/)
+// example cronjob:
+// */15 * * * * find ./application/cache/ -mtime +0.5 -not \( -name .htaccess -or -name index.html \) -delete
+// - memcached: config in application/config/memcached.php; you need the memcached module (with the D)
+// - dummy: disables caching
+//
+// It is highly suggested to enable the cache.
+$config['cache_backend'] = "dummy";
+
+
+// For possible drivers look into ./application/libraries/Duser/drivers/
+$config['authentication_driver'] = 'db';
+
+// This is only used it the driver is set to ldap
+if (extension_loaded("ldap")) {
+ $config['auth_ldap'] = array(
+ "host" => 'ldaps://ldap.example.com',
+ "port" => 636,
+ "basedn" => "dc=example,dc=com",
+ "scope" => "one", // possible values: base, one, subtree
+ "options" => array(
+ // key/values pairs for ldap_set_option
+ // http://php.net/manual/en/function.ldap-set-option.php
+ LDAP_OPT_PROTOCOL_VERSION => 3
+ ),
+ // Please note that php-ldap converts attributes to lowercase
+ "userid_field" => "uidnumber", // This has to be a unique integer
+ "username_field" => "uid", // This is the value the user supplies on the login form
+ // Optional parameters
+ // "bind_rdn" => "uid=search-user,cn=users,dc=example,dc=com", // This is the user used to authenticate for searches
+ // "bind_password" => "***", // This is the password for the search user
+ // You can optionally filter the LDAP users who are allowed to log in using any valid LDAP filter. %s will be replaced
+ // by the user name.
+ // "filter" => "(&(uid=%s)(memberOf=cn=FileBinUsers,cn=groups,dc=example,dc=com))",
+ );
+}
+
+// This is only used if the driver is set to fluxbb
+$config['auth_fluxbb'] = array(
+ 'database' => 'fluxbb'
+);
+
+// This is only used if the driver is set to db. Changes to these settings will be
+// applied when users sucessfully log in with their password.
+// For information about these values refer to https://secure.php.net/manual/en/function.password-hash.php
+$config['auth_db'] = array(
+ 'hashing_options' => array(
+ 'cost' => 10,
+ ),
+ 'hashing_algorithm' => PASSWORD_DEFAULT,
+);
+
+
+// Possible values: production, development
+// "development" enables features like profiling and display of SQL queries.
+$config['environment'] = "production";
+
+
+// This sets the download implementation. Possible values are php, nginx and lighttpd.
+// The nginx and lighttpd drivers make use of the server's sendfile feature.
+//
+// The lighttpd driver requires the following directive to be set in your fastcgi.server configuration:
+// "allow-x-send-file" => "enable"
+// See http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_ModFastCGI#X-Sendfile
+//
+// When using the nginx download driver you need to define an internal location
+// from which nginx will serve your uploads:
+// location ^~ /protected-uploads/ {
+// internal;
+// alias <upload_path>/;
+// }
+// See http://wiki.nginx.org/X-accel
+$config['download_driver'] = 'php';
+
+$config['download_nginx_location'] = '/protected-uploads';
+
+if (file_exists(APPPATH.'config/config-local.php')) {
+ include APPPATH.'config/config-local.php';
+}
+
+if (getenv("ENVIRONMENT") === "testsuite" && isset($_SERVER['SERVER_PORT'])) {
+ $config['base_url'] = 'http://127.0.0.1:'.$_SERVER['SERVER_PORT'].'/';
+}
+
+if (getenv("ENVIRONMENT") === "testsuite") {
+ $config['upload_path'] = FCPATH.'testsuite-tmp';
+ $config['auth_db']['hashing_options']['cost'] = 5;
+}
diff --git a/application/config/constants.php b/application/config/constants.php
index 18d3b4b76..5743ee8e5 100644
--- a/application/config/constants.php
+++ b/application/config/constants.php
@@ -13,6 +13,8 @@ defined('BASEPATH') OR exit('No direct script access allowed');
*/
defined('SHOW_DEBUG_BACKTRACE') OR define('SHOW_DEBUG_BACKTRACE', TRUE);
+putenv('HOME='.FCPATH);
+
/*
|--------------------------------------------------------------------------
| File and Directory Modes
diff --git a/application/config/example/.gitignore b/application/config/example/.gitignore
new file mode 100644
index 000000000..f9be8dfe0
--- /dev/null
+++ b/application/config/example/.gitignore
@@ -0,0 +1 @@
+!*
diff --git a/application/config/example/config-local.php b/application/config/example/config-local.php
new file mode 100644
index 000000000..172f0e1cc
--- /dev/null
+++ b/application/config/example/config-local.php
@@ -0,0 +1,19 @@
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+
+/*
+ * Use this file to override any settings from config.php
+ *
+ * For descriptions of the options please refer to config.php.
+ */
+
+# URL to the application
+$config['base_url'] = '';
+
+// set this to a 32char random string
+$config['encryption_key'] = '';
+
+$config['upload_path'] = FCPATH.'data/uploads';
+
+$config['index_page'] = 'index.php';
+
+$config['cache_backend'] = "dummy";
diff --git a/application/config/database.php b/application/config/example/database.php
index 0088ef140..a5083d0eb 100644
--- a/application/config/database.php
+++ b/application/config/example/database.php
@@ -27,8 +27,6 @@ defined('BASEPATH') OR exit('No direct script access allowed');
| to the table name when using the Query Builder class
| ['pconnect'] TRUE/FALSE - Whether to use a persistent connection
| ['db_debug'] TRUE/FALSE - Whether database errors should be displayed.
-| ['cache_on'] TRUE/FALSE - Enables/disables query caching
-| ['cachedir'] The path to the folder where cache files should be stored
| ['char_set'] The character set used in communicating with the database
| ['dbcollat'] The character collation used in communicating with the database
| NOTE: For MySQL and MySQLi databases, this setting is only used
@@ -76,21 +74,25 @@ $query_builder = TRUE;
$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost',
+ 'port' => 3306,
'username' => '',
'password' => '',
'database' => '',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => FALSE,
- 'db_debug' => (ENVIRONMENT !== 'production'),
- 'cache_on' => FALSE,
- 'cachedir' => '',
- 'char_set' => 'utf8',
- 'dbcollat' => 'utf8_general_ci',
+ 'db_debug' => TRUE,
+ 'char_set' => 'utf8mb4', // if you use postgres, set this to utf8
+ 'dbcollat' => 'utf8mb4_bin', // if you use postgres, set this to utf8_bin
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
- 'stricton' => FALSE,
+ 'stricton' => TRUE,
'failover' => array(),
'save_queries' => TRUE
);
+
+if (getenv("ENVIRONMENT") === "testsuite") {
+ $db['default']['database'] = "filebin_testsuite";
+ $db['default']['dbprefix'] = "testsuite_prefix_";
+}
diff --git a/application/config/example/index.html b/application/config/example/index.html
new file mode 100644
index 000000000..c942a79ce
--- /dev/null
+++ b/application/config/example/index.html
@@ -0,0 +1,10 @@
+<html>
+<head>
+ <title>403 Forbidden</title>
+</head>
+<body>
+
+<p>Directory access is forbidden.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/application/config/example/memcached.php b/application/config/example/memcached.php
new file mode 100644
index 000000000..29b145ec8
--- /dev/null
+++ b/application/config/example/memcached.php
@@ -0,0 +1,17 @@
+<?php
+
+$config = array(
+ "default" => array(
+ "hostname" => "127.0.0.1",
+ "port" => 11211,
+ "weight" => 1,
+ ),
+ "socket" => array(
+ "hostname" => FCPATH.'/memcached.sock',
+ "port" => 0,
+ "weight" => 2,
+ ),
+);
+
+
+?>
diff --git a/application/config/migration.php b/application/config/migration.php
index 4b585a65c..ffddae2ac 100644
--- a/application/config/migration.php
+++ b/application/config/migration.php
@@ -11,7 +11,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
| and disable it back when you're done.
|
*/
-$config['migration_enabled'] = FALSE;
+$config['migration_enabled'] = true;
/*
|--------------------------------------------------------------------------
@@ -29,7 +29,7 @@ $config['migration_enabled'] = FALSE;
| defaults to 'sequential' for backward compatibility with CI2.
|
*/
-$config['migration_type'] = 'timestamp';
+$config['migration_type'] = 'sequential';
/*
|--------------------------------------------------------------------------
@@ -69,7 +69,7 @@ $config['migration_auto_latest'] = FALSE;
| be upgraded / downgraded to.
|
*/
-$config['migration_version'] = 0;
+$config['migration_version'] = 21;
/*
|--------------------------------------------------------------------------
@@ -82,3 +82,4 @@ $config['migration_version'] = 0;
|
*/
$config['migration_path'] = APPPATH.'migrations/';
+
diff --git a/application/config/routes.php b/application/config/routes.php
index e8e2296f0..d6bbfc953 100644
--- a/application/config/routes.php
+++ b/application/config/routes.php
@@ -49,6 +49,12 @@ defined('BASEPATH') OR exit('No direct script access allowed');
| Examples: my-controller/index -> my_controller/index
| my-controller/my-method -> my_controller/my_method
*/
-$route['default_controller'] = 'welcome';
+$route['default_controller'] = "main";
+$route['user/(.+)'] = "user/$1";
+$route['file/multipaste/(.+)'] = "file/multipaste/$1";
+$route['file/(.+)'] = "main/$1";
+$route['tools/(.+)'] = "tools/$1";
+$route['api/(.+)'] = "api/route/$1";
+$route['(.+)'] = "main/index/$1";
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;
diff --git a/application/controllers/Api.php b/application/controllers/Api.php
new file mode 100644
index 000000000..b41f090dd
--- /dev/null
+++ b/application/controllers/Api.php
@@ -0,0 +1,93 @@
+<?php
+/*
+ * Copyright 2014 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+class Api extends MY_Controller {
+
+ public function __construct()
+ {
+ parent::__construct();
+
+ $this->load->model('mfile');
+ $this->load->model('mmultipaste');
+ }
+
+ public function route() {
+ try {
+ $requested_version = $this->uri->segment(2);
+ $controller = $this->uri->segment(3);
+ $function = $this->uri->segment(4);
+
+ if (!preg_match("/^v([0-9]+)(.[0-9]+){0,2}$/", $requested_version)) {
+ throw new \exceptions\UserInputException("api/invalid-version", "Invalid API version requested");
+ }
+
+ $requested_version = substr($requested_version, 1);
+
+ $major = intval(explode(".", $requested_version)[0]);
+
+ if (!preg_match("/^[a-zA-Z-_]+$/", $controller)) {
+ throw new \exceptions\UserInputException("api/invalid-endpoint", "Invalid endpoint requested");
+ }
+
+ if (!preg_match("/^[a-zA-Z-_]+$/", $function)) {
+ throw new \exceptions\UserInputException("api/invalid-endpoint", "Invalid endpoint requested");
+ }
+
+ $namespace = "controllers\\api\\v".$major;
+ $class = $namespace."\\".$controller;
+ $class_info = $namespace."\\api_info";
+
+ if (!class_exists($class_info) || version_compare($class_info::get_version(), $requested_version, "<")) {
+ throw new \exceptions\UserInputException("api/version-not-supported", "Requested API version is not supported");
+ }
+
+ if (!class_exists($class)) {
+ throw new \exceptions\UserInputException("api/unknown-endpoint", "Unknown endpoint requested");
+ }
+
+ $c= new $class;
+ if (!method_exists($c, $function) || !is_callable([$c, $function])) {
+ throw new \exceptions\UserInputException("api/unknown-endpoint", "Unknown endpoint requested");
+ }
+ return $this->send_json_reply($c->$function());
+ } catch (\exceptions\PublicApiException $e) {
+ return $this->send_json_error_reply($e->get_error_id(), $e->getMessage(), $e->get_data());
+ } catch (\Exception $e) {
+ \libraries\ExceptionHandler::log_exception($e);
+ return $this->send_json_error_reply("internal-error", "An unhandled internal server error occured");
+ }
+ }
+
+ private function send_json_reply($array, $status = "success") {
+ $reply = array();
+ $reply["status"] = $status;
+ $reply["data"] = $array;
+
+ $CI =& get_instance();
+ $CI->output->set_content_type('application/json');
+ $CI->output->set_output(json_encode($reply));
+ }
+
+ private function send_json_error_reply($error_id, $message, $array = null, $status_code = 400) {
+ $reply = array();
+ $reply["status"] = "error";
+ $reply["error_id"] = $error_id;
+ $reply["message"] = $message;
+
+ if ($array !== null) {
+ $reply["data"] = $array;
+ }
+
+ $CI =& get_instance();
+ $CI->output->set_status_header($status_code);
+ $CI->output->set_content_type('application/json');
+ $CI->output->set_output(json_encode($reply));
+ }
+
+}
diff --git a/application/controllers/Main.php b/application/controllers/Main.php
new file mode 100644
index 000000000..df3e8ad78
--- /dev/null
+++ b/application/controllers/Main.php
@@ -0,0 +1,943 @@
+<?php
+/*
+ * Copyright 2009-2013 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+class Main extends MY_Controller {
+
+ function __construct()
+ {
+ parent::__construct();
+
+ $this->load->model('mfile');
+ $this->load->model('mmultipaste');
+ }
+
+ function index()
+ {
+ if (is_cli()) {
+ output_cli_usage();
+ exit;
+ }
+
+ // Try to guess what the user would like to do.
+ $id = $this->uri->segment(1);
+ if (strpos($id, "m-") === 0 && $this->mmultipaste->id_exists($id)) {
+ $this->_download();
+ } elseif ($id != "file" && $this->mfile->id_exists($id)) {
+ $this->_download();
+ } elseif ($id && $id != "file") {
+ $this->_non_existent();
+ } else {
+ $this->upload_form();
+ }
+ }
+
+ private function _handle_etag($etag)
+ {
+ $etag = strtolower($etag);
+ $modified = true;
+
+ if(isset($_SERVER['HTTP_IF_NONE_MATCH'])) {
+ $oldtag = trim(strtolower($_SERVER['HTTP_IF_NONE_MATCH']), '"');
+ if($oldtag == $etag) {
+ $modified = false;
+ } else {
+ $modified = true;
+ }
+ }
+
+ header('Etag: "'.$etag.'"');
+
+ if (!$modified) {
+ header("HTTP/1.1 304 Not Modified");
+ exit();
+ }
+ }
+
+ /**
+ * Generate a page title of the format "Multipaste - $filename, $filename, … (N more)".
+ * This mainly helps in IRC channels to quickly determine what is in a multipaste.
+ *
+ * @param files array of filedata
+ * @return title to be used
+ */
+ private function _multipaste_page_title(array $files)
+ {
+ $filecount = count($files);
+ $title = "Multipaste ($filecount files) - ";
+ $titlenames = array();
+ $len = strlen($title);
+ $delimiter = ', ';
+ $maxlen = 100;
+
+ foreach ($files as $file) {
+ if ($len > $maxlen) break;
+
+ $filename = $file['filename'];
+ $titlenames[] = htmlspecialchars($filename);
+ $len += strlen($filename) + strlen($delimiter);
+ }
+
+ $title .= implode($delimiter, $titlenames);
+
+ $leftover_count = $filecount - count($titlenames);
+
+ if ($leftover_count > 0) {
+ $title .= $delimiter.'… ('.$leftover_count.' more)';
+ }
+
+ return $title;
+ }
+
+ function _download()
+ {
+ session_write_close();
+ $id = $this->uri->segment(1);
+ $lexer = urldecode($this->uri->segment(2));
+
+ $is_multipaste = false;
+ if ($this->mmultipaste->id_exists($id)) {
+ $is_multipaste = true;
+
+ if(!$this->mmultipaste->valid_id($id)) {
+ $this->mmultipaste->delete_id($id);
+ return $this->_non_existent();
+ }
+ $files = $this->mmultipaste->get_files($id);
+ $this->data["title"] = $this->_multipaste_page_title($files);
+ } elseif ($this->mfile->id_exists($id)) {
+ if (!$this->mfile->valid_id($id)) {
+ return $this->_non_existent();
+ }
+
+ $files = array($this->mfile->get_filedata($id));
+ $this->data["title"] = htmlspecialchars($files[0]["filename"]);
+ } else {
+ assert(0);
+ }
+
+ assert($files !== false);
+ assert(is_array($files));
+ assert(count($files) >= 1);
+
+ // don't allow unowned files to be downloaded
+ foreach ($files as $filedata) {
+ if ($filedata["user"] == 0) {
+ return $this->_non_existent();
+ }
+ }
+
+ $etag = "";
+ foreach ($files as $filedata) {
+ $etag = sha1($etag.$filedata["data_id"]);
+ }
+
+ // handle some common "lexers" here
+ switch ($lexer) {
+ case "":
+ break;
+
+ case "qr":
+ $this->_handle_etag($etag);
+ header("Content-disposition: inline; filename=\"".$id."_qr.png\"\n");
+ header("Content-Type: image/png\n");
+ $qr = new \Endroid\QrCode\QrCode();
+ $qr->setText(site_url($id).'/')
+ ->setSize(350)
+ ->setErrorCorrection('low')
+ ->render();
+ exit();
+
+ case "info":
+ return $this->_display_info($id);
+
+ case "tar":
+ if ($is_multipaste) {
+ return $this->_tarball($id);
+ }
+
+ case "pls":
+ if ($is_multipaste) {
+ return $this->_generate_playlist($id);
+ }
+
+ default:
+ if ($is_multipaste) {
+ throw new \exceptions\UserInputException("file/download/invalid-action", "Invalid action \"".htmlspecialchars($lexer)."\"");
+ }
+ break;
+ }
+
+ $this->load->driver("ddownload");
+
+ // user wants the plain file
+ if ($lexer == 'plain') {
+ assert(count($files) == 1);
+ $this->_handle_etag($etag);
+
+ $filedata = $files[0];
+ $filepath = $this->mfile->file($filedata["data_id"]);
+ $this->ddownload->serveFile($filepath, $filedata["filename"], "text/plain");
+ exit();
+ }
+
+ $output_cache = new \libraries\Output_cache();
+
+ foreach ($files as $key => $filedata) {
+ $file = $this->mfile->file($filedata['data_id']);
+ $pygments = new \libraries\Pygments($file, $filedata["mimetype"], $filedata["filename"]);
+
+ // autodetect the lexer for highlighting if the URL contains a / after the ID (/ID/)
+ // /ID/lexer disables autodetection
+ $autodetect_lexer = !$lexer && preg_match('/^[^?]*\/(\?.*)?$/', $_SERVER['REQUEST_URI']);
+ $autodetect_lexer = $is_multipaste ? true : $autodetect_lexer;
+ if ($autodetect_lexer) {
+ $lexer = $pygments->autodetect_lexer();
+ }
+
+ // resolve aliases
+ // this is mainly used for compatibility
+ $lexer = $pygments->resolve_lexer_alias($lexer);
+
+ // if there is no mimetype mapping we can't highlight it
+ $can_highlight = $pygments->can_highlight();
+
+ $filesize_too_big = filesize($file) > $this->config->item('upload_max_text_size');
+
+ if ($lexer == "asciinema") {
+ $output_cache->add(array("filedata" => $filedata), "file/fragments/asciinema-player");
+ continue;
+ }
+
+ if (!$can_highlight || $filesize_too_big || !$lexer) {
+ if (!$is_multipaste) {
+ // prevent javascript from being executed and forbid frames
+ // this should allow us to serve user submitted HTML content without huge security risks
+ foreach (array("X-WebKit-CSP", "X-Content-Security-Policy", "Content-Security-Policy") as $header_name) {
+ header("$header_name: default-src 'none'; img-src data: *; media-src *; font-src data: *; style-src 'unsafe-inline' *; script-src 'none'; object-src *; frame-src 'none'; ");
+ }
+ $this->_handle_etag($etag);
+ $this->ddownload->serveFile($file, $filedata["filename"], $filedata["mimetype"]);
+ exit();
+ } else {
+ $mimetype = $filedata["mimetype"];
+ $base = explode("/", $filedata["mimetype"])[0];
+
+ if (\libraries\Image::type_supported($mimetype)) {
+ $filedata["tooltip"] = \service\files::tooltip($filedata);
+ $filedata["orientation"] = libraries\Image::get_exif_orientation($file);
+ $output_cache->add_merge(
+ array("items" => array($filedata)),
+ 'file/fragments/thumbnail'
+ );
+ } else if ($base == "audio") {
+ $output_cache->add(array("filedata" => $filedata), "file/fragments/audio-player");
+ } else if ($base == "video") {
+ $output_cache->add(array("filedata" => $filedata), "file/fragments/video-player");
+ } else {
+ $output_cache->add_merge(
+ array("items" => array($filedata)),
+ 'file/fragments/uploads_table'
+ );
+ }
+ continue;
+ }
+ }
+
+ $output_cache->add_function(function() use ($output_cache, $filedata, $lexer, $is_multipaste) {
+ $renderer = new \service\renderer($output_cache, $this->mfile, $this->data);
+ $renderer->highlight_file($filedata, $lexer, $is_multipaste);
+ });
+ }
+
+ // TODO: move lexers json to dedicated URL
+ $this->data['lexers'] = \libraries\Pygments::get_lexers();
+
+ // Output everything
+ // Don't use the output class/append_output because it does too
+ // much magic ({elapsed_time} and {memory_usage}).
+ // Direct echo puts us on the safe side.
+ echo $this->load->view('file/html_header', $this->data, true);
+ $output_cache->render();
+ echo $this->load->view('file/html_footer', $this->data, true);
+ }
+
+ private function _display_info($id)
+ {
+ if ($this->mmultipaste->id_exists($id)) {
+ $files = $this->mmultipaste->get_files($id);
+
+ $this->data["title"] .= " - Info $id";
+
+ $multipaste = $this->mmultipaste->get_multipaste($id);
+ $total_size = 0;
+ $timeout = -1;
+ foreach($files as $filedata) {
+ $total_size += $filedata["filesize"];
+ $file_timeout = $this->mfile->get_timeout($filedata["id"]);
+ if ($timeout == -1 || ($timeout > $file_timeout && $file_timeout >= 0)) {
+ $timeout = $file_timeout;
+ }
+ }
+
+ $data = array_merge($this->data, array(
+ 'timeout_string' => $timeout >= 0 ? date("r", $timeout) : "Never",
+ 'upload_date' => $multipaste["date"],
+ 'id' => $id,
+ 'size' => $total_size,
+ 'file_count' => count($files),
+ ));
+
+ $this->load->view('header', $this->data);
+ $this->load->view('file/multipaste_info', $data);
+ $this->load->view('footer', $this->data);
+ return;
+ } elseif ($this->mfile->id_exists($id)) {
+ $this->data["title"] .= " - Info $id";
+ $this->data["filedata"] = $this->mfile->get_filedata($id);
+ $this->data["id"] = $id;
+ $this->data['timeout'] = $this->mfile->get_timeout_string($id);
+
+ $this->load->view('header', $this->data);
+ $this->load->view('file/file_info', $this->data);
+ $this->load->view('footer', $this->data);
+ }
+ }
+
+ private function _tarball($id)
+ {
+ if ($this->mmultipaste->id_exists($id)) {
+ $seen = array();
+ $path = $this->mmultipaste->get_tarball_path($id);
+ $archive = new \service\storage($path);
+
+ if (!$archive->exists()) {
+ $files = $this->mmultipaste->get_files($id);
+
+ $total_size = 0;
+ foreach ($files as $filedata) {
+ $total_size += $filedata["filesize"];
+ }
+
+ if ($total_size > $this->config->item("tarball_max_size")) {
+ throw new \exceptions\PublicApiException("file/tarball/tarball-filesize-limit", "Tarball too large, refusing to create.");
+ }
+
+ $tmpfile = $archive->begin();
+ // create empty tar archive so PharData has something to open
+ file_put_contents($tmpfile, str_repeat("\0", 1024*10));
+ $a = new PharData($tmpfile);
+
+ foreach ($files as $filedata) {
+ $filename = $filedata["filename"];
+ if (isset($seen[$filename]) && $seen[$filename]) {
+ $filename = $filedata["id"]."-".$filedata["filename"];
+ }
+ assert(!isset($seen[$filename]));
+ $a->addFile($this->mfile->file($filedata["data_id"]), $filename);
+ $seen[$filename] = true;
+ }
+ $archive->gzip_compress();
+ $archive->commit();
+ }
+
+ // update mtime so the cronjob will keep the file for longer
+ $lock = fopen($archive->get_file(), "r+");
+ flock($lock, LOCK_SH);
+ touch($archive->get_file());
+ flock($lock, LOCK_UN);
+
+ assert(filesize($archive->get_file()) > 0);
+
+ $this->load->driver("ddownload");
+ $this->ddownload->serveFile($archive->get_file(), "$id.tar.gz", "application/x-gzip");
+ }
+ }
+
+ /**
+ * Generate a PLS v2 playlist
+ */
+ private function _generate_playlist($id)
+ {
+ $files = $this->mmultipaste->get_files($id);
+ $counter = 1;
+
+ $playlist = "[playlist]\n";
+ foreach ($files as $file) {
+ // only add audio/video files
+ $base = explode("/", $file['mimetype'])[0];
+ if (!($base === "audio" || $base === "video")) {
+ continue;
+ }
+
+ $url = site_url($file["id"]);
+ $playlist .= sprintf("File%d=%s\n", $counter++, $url);
+ }
+ $playlist .= sprintf("NumberOfEntries=%d\n", $counter - 1);
+ $playlist .= "Version=2\n";
+
+ $this->output->set_content_type('audio/x-scpls');
+ $this->output->set_output($playlist);
+ }
+
+ function _non_existent()
+ {
+ $this->data["title"] .= " - Not Found";
+ $this->output->set_status_header(404);
+ $this->load->view('header', $this->data);
+ $this->load->view('file/non_existent', $this->data);
+ $this->load->view('footer', $this->data);
+ }
+
+ private function _prepare_claim($ids, $lexer)
+ {
+ if (!$this->muser->logged_in()) {
+ $this->muser->require_session();
+ // keep the upload but require the user to login
+ $last_upload = $this->session->userdata("last_upload");
+ if ($last_upload === NULL) {
+ $last_upload = array(
+ "ids" => [],
+ "lexer" => "",
+ );
+ }
+ $last_upload = array(
+ "ids" => array_merge($last_upload['ids'], $ids),
+ "lexer" => "",
+ );
+ $this->session->set_userdata("last_upload", $last_upload);
+ $this->data["redirect_uri"] = "file/claim_id";
+ $this->muser->require_access("basic");
+ }
+
+ }
+
+ function _show_url($ids, $lexer)
+ {
+ $redirect = false;
+ $this->_prepare_claim($ids, $lexer);
+
+ foreach ($ids as $id) {
+ if ($lexer) {
+ $this->data['urls'][] = site_url($id).'/'.$lexer;
+ } else {
+ $this->data['urls'][] = site_url($id).'/';
+
+ if (count($ids) == 1) {
+ $filedata = $this->mfile->get_filedata($id);
+ $file = $this->mfile->file($filedata['data_id']);
+ $pygments = new \libraries\Pygments($file, $filedata["mimetype"], $filedata["filename"]);
+ $lexer = $pygments->should_highlight();
+
+ // If we detected a highlightable file redirect,
+ // otherwise show the URL because browsers would just show a DL dialog
+ if ($lexer) {
+ $redirect = true;
+ }
+ }
+ }
+ }
+
+ if ($redirect && count($ids) == 1) {
+ redirect($this->data['urls'][0], "location", 303);
+ } else {
+ $this->load->view('header', $this->data);
+ $this->load->view('file/show_url', $this->data);
+ $this->load->view('footer', $this->data);
+ }
+ }
+
+ function upload_form()
+ {
+ $this->data['title'] .= ' - Upload';
+ $this->data['small_upload_size'] = $this->config->item('small_upload_size');
+ $this->data['max_upload_size'] = $this->config->item('upload_max_size');
+ $this->data['upload_max_age'] = $this->config->item('upload_max_age');
+
+ $this->data['username'] = $this->muser->get_username();
+
+ $repaste_id = $this->input->get("repaste");
+
+ if ($repaste_id) {
+ $filedata = $this->mfile->get_filedata($repaste_id);
+ if ($filedata !== false) {
+ $pygments = new \libraries\Pygments($this->mfile->file($filedata["data_id"]), $filedata["mimetype"], $filedata["filename"]);
+ if ($pygments->can_highlight()) {
+ $this->data["textarea_filename"] = $filedata["filename"];
+ $this->data["textarea_content"] = file_get_contents($this->mfile->file($filedata["data_id"]));
+ }
+ }
+ }
+
+ if (file_exists(FCPATH.'data/client/latest')) {
+ $this->var->latest_client = trim(file_get_contents(FCPATH.'data/client/latest'));
+ $this->data['client_link'] = base_url().'data/client/fb-'.$this->var->latest_client.'.tar.gz';
+ } else {
+ $this->data['client_link'] = false;
+ }
+
+ $this->load->view('header', $this->data);
+ $this->load->view('file/upload_form', $this->data);
+ $this->load->view('footer', $this->data);
+ }
+
+ function thumbnail()
+ {
+ session_write_close();
+ $id = $this->uri->segment(3);
+
+ if (!$this->mfile->valid_id($id)) {
+ return $this->_non_existent();
+ }
+
+ $etag = "$id-thumb";
+ $this->_handle_etag($etag);
+
+ $thumb_size = 150;
+ $cache_timeout = 60*60*24*30; # 1 month
+
+ $filedata = $this->mfile->get_filedata($id);
+ if (!$filedata) {
+ throw new \exceptions\ApiException("file/thumbnail/filedata-unavailable", "Failed to get file data");
+ }
+
+ $cache_key = $filedata['data_id'].'_thumb_'.$thumb_size;
+
+ $thumb = cache_function($cache_key, $cache_timeout, function() use ($filedata, $thumb_size){
+ $CI =& get_instance();
+ $img = new libraries\Image($this->mfile->file($filedata["data_id"]));
+ $img->makeThumb($thumb_size, $thumb_size);
+ $thumb = $img->get(IMAGETYPE_JPEG);
+ return $thumb;
+ });
+
+ $this->output->set_header("Cache-Control:max-age=31536000, public");
+ $this->output->set_header("Expires: ".date("r", time() + 365 * 24 * 60 * 60));
+ $this->output->set_content_type("image/jpeg");
+ $this->output->set_output($thumb);
+ }
+
+ function upload_history_thumbnails()
+ {
+ $this->muser->require_access();
+
+ $user = $this->muser->get_userid();
+
+ // TODO: move to \service\files and possibly use \s\f::history()
+ $query = $this->db
+ ->select('files.id, filename, mimetype, files.date, hash, file_storage.id storage_id, filesize, user')
+ ->from('files')
+ ->join('file_storage', 'file_storage.id = files.file_storage_id')
+ ->where('
+ (files.user = '.$this->db->escape($user).')
+ AND (
+ mimetype LIKE \'image%\'
+ )', null, false)
+ ->order_by('date', 'desc')
+ ->get()->result_array();
+
+ foreach($query as $key => $item) {
+ assert($item["user"] === $user);
+ $item["data_id"] = $item['hash']."-".$item['storage_id'];
+ $query[$key]["data_id"] = $item["data_id"];
+ if (!$this->mfile->valid_filedata($item)) {
+ unset($query[$key]);
+ continue;
+ }
+ $query[$key]["tooltip"] = \service\files::tooltip($item);
+ $query[$key]["orientation"] = libraries\Image::get_exif_orientation($this->mfile->file($item["data_id"]));
+ }
+
+ $this->data["items"] = $query;
+
+ $this->load->view('header', $this->data);
+ $this->load->view('file/upload_history_thumbnails', $this->data);
+ $this->load->view('footer', $this->data);
+ }
+
+ public function handle_history_submit()
+ {
+ $this->muser->require_access("apikey");
+
+ $process = $this->input->post("process");
+
+ $dispatcher = [
+ "delete" => function() {
+ return $this->do_delete();
+ },
+ "multipaste" => function() {
+ return $this->_append_multipaste_queue();
+ },
+ ];
+
+ if (isset($dispatcher[$process])) {
+ $dispatcher[$process]();
+ } else {
+ throw new \exceptions\UserInputException("file/handle_history_submit/invalid-process-value", "Value in process field not found in dispatch table");
+ }
+ }
+
+ private function _append_multipaste_queue()
+ {
+ $ids = $this->input->post_array("ids");
+ if ($ids === null) {
+ $ids = [];
+ }
+
+ $m = new \service\multipaste_queue();
+ $m->append($ids);
+ redirect("file/multipaste/queue");
+ }
+
+ function upload_history()
+ {
+ $this->muser->require_access("apikey");
+
+ $history = service\files::history($this->muser->get_userid());
+
+ // key: database field name; value: display name
+ $fields = array(
+ "id" => "ID",
+ "filename" => "Filename",
+ "mimetype" => "Mimetype",
+ "date" => "Date",
+ "hash" => "Hash",
+ "filesize" => "Size"
+ );
+
+ $this->data['title'] .= ' - Upload history';
+
+ foreach ($history["multipaste_items"] as $key => $item) {
+ $size = 0;
+ $filenames = array();
+ $files = array();
+ $max_filenames = 10;
+
+ foreach ($item["items"] as $i) {
+ $size += $history["items"][$i["id"]]["filesize"];
+ $files[] = array(
+ "filename" => $history["items"][$i["id"]]['filename'],
+ "sort_order" => $i["sort_order"],
+ );
+ }
+
+ uasort($files, function ($a, $b) {
+ return $a['sort_order'] - $b['sort_order'];
+ });
+
+ $filenames = array_map(function ($a) {return $a['filename'];}, $files);
+
+ if (count($filenames) > $max_filenames) {
+ $filenames = array_slice($filenames, 0, $max_filenames);
+ $filenames[] = "...";
+ }
+
+ $history["items"][] = array(
+ "id" => $item["url_id"],
+ "filename" => count($item["items"])." file(s)",
+ "mimetype" => "",
+ "date" => $item["date"],
+ "hash" => "",
+ "filesize" => $size,
+ "preview_text" => implode("\n", $filenames),
+ );
+ }
+
+ uasort($history["items"], function($a, $b) {
+ return $b["date"] - $a["date"];
+ });
+
+ foreach($history["items"] as $key => $item) {
+ $history["items"][$key]["filesize"] = format_bytes($item["filesize"]);
+
+ if (isset($item['preview_text'])) {
+ $history["items"][$key]["preview_text"] = htmlentities($item['preview_text']);
+ }
+ }
+
+ $this->data["items"] = $history["items"];
+ $this->data["fields"] = $fields;
+ $this->data["total_size"] = format_bytes($history["total_size"]);
+
+ $this->load->view('header', $this->data);
+ $this->load->view('file/upload_history', $this->data);
+ $this->load->view('footer', $this->data);
+ }
+
+ function do_delete()
+ {
+ $this->muser->require_access("apikey");
+
+ $ids = $this->input->post_array("ids");
+
+ $ret = \service\files::delete($ids);
+
+ $this->data["errors"] = $ret["errors"];
+ $this->data["deleted_count"] = $ret["deleted_count"];
+ $this->data["total_count"] = $ret["total_count"];
+
+ $this->load->view('header', $this->data);
+ $this->load->view('file/deleted', $this->data);
+ $this->load->view('footer', $this->data);
+ }
+
+ function do_multipaste()
+ {
+ $this->muser->require_access("basic");
+
+ $ids = $this->input->post_array("ids");
+ $userid = $this->muser->get_userid();
+ $limits = $this->muser->get_upload_id_limits();
+
+ $ret = \service\files::create_multipaste($ids, $userid, $limits);
+
+ return $this->_show_url(array($ret["url_id"]), false);
+ }
+
+ /**
+ * Handle submissions from the web form (files and textareas).
+ */
+ public function do_websubmit()
+ {
+ $files = getNormalizedFILES();
+ $contents = $this->input->post_array("content");
+ $filenames = $this->input->post_array("filename");
+
+ if (!is_array($filenames) || !is_array($contents)) {
+ throw new \exceptions\UserInputException('file/websubmit/invalid-form', 'The submitted POST form is invalid');
+ }
+
+ $ids = array();
+ $ids = array_merge($ids, $this->_handle_textarea($contents, $filenames));
+ $ids = array_merge($ids, $this->_handle_files($files));
+
+
+ if (empty($ids)) {
+ throw new \exceptions\UserInputException("file/websubmit/no-input", "You didn't enter any text or upload any files");
+ }
+
+ if (count($ids) > 1) {
+ $userid = $this->muser->get_userid();
+ $limits = $this->muser->get_upload_id_limits();
+ $multipaste_id = \service\files::create_multipaste($ids, $userid, $limits)["url_id"];
+
+ $ids[] = $multipaste_id;
+ $this->_prepare_claim($ids, false);
+
+ redirect(site_url($multipaste_id)."/");
+ }
+
+ $this->_show_url($ids, false);
+ }
+
+ private function _handle_files($files)
+ {
+ $ids = array();
+
+ if (!empty($files)) {
+ $limits = $this->muser->get_upload_id_limits();
+ $userid = $this->muser->get_userid();
+ service\files::verify_uploaded_files($files);
+
+ foreach ($files as $key => $file) {
+ $id = $this->mfile->new_id($limits[0], $limits[1]);
+ service\files::add_uploaded_file($userid, $id, $file["tmp_name"], $file["name"]);
+ $ids[] = $id;
+ }
+ }
+
+ return $ids;
+ }
+
+ private function _handle_textarea($contents, $filenames)
+ {
+ $ids = array();
+
+ foreach ($contents as $key => $content) {
+ $filesize = strlen($content);
+
+ if ($filesize == 0) {
+ unset($contents[$key]);
+ }
+
+ if ($filesize > $this->config->item('upload_max_size')) {
+ throw new \exceptions\RequestTooBigException("file/websubmit/request-too-big", "Error while uploading: Paste too big");
+ }
+ }
+
+ $limits = $this->muser->get_upload_id_limits();
+ $userid = $this->muser->get_userid();
+
+ foreach ($contents as $key => $content) {
+ $filename = "stdin";
+ if (isset($filenames[$key]) && $filenames[$key] != "") {
+ $filename = $filenames[$key];
+ }
+
+ $id = $this->mfile->new_id($limits[0], $limits[1]);
+ service\files::add_file_data($userid, $id, $content, $filename);
+ $ids[] = $id;
+ }
+
+ return $ids;
+ }
+
+ function claim_id()
+ {
+ $this->muser->require_access();
+
+ $last_upload = $this->session->userdata("last_upload");
+
+ if ($last_upload === NULL) {
+ throw new \exceptions\PublicApiException("file/claim_id/last_upload-failed", "Failed to get last upload data, unable to claim uploads");
+ }
+
+ $ids = $last_upload["ids"];
+ $errors = array();
+
+ assert(is_array($ids));
+
+ foreach ($ids as $key => $id) {
+ $affected = 0;
+ $affected += $this->mfile->adopt($id);
+ $affected += $this->mmultipaste->adopt($id);
+
+ if ($affected == 0) {
+ $errors[] = $id;
+ }
+ }
+
+ if (!empty($errors)) {
+ throw new \exceptions\PublicApiException("file/claim_id/failed", "Failed to claim ".implode(", ", $errors)."");
+ }
+
+ $this->session->unset_userdata("last_upload");
+
+ $this->_show_url($ids, $last_upload["lexer"]);
+ }
+
+ function contact()
+ {
+ $file = FCPATH."data/local/contact-info.php";
+ if (file_exists($file)) {
+ $this->data["contact_info"] = file_get_contents($file);
+ } else {
+ $this->data["contact_info"] = '<p>Contact info not available.</p>';
+ }
+
+ $this->load->view('header', $this->data);
+ $this->load->view('contact', $this->data);
+ $this->load->view('footer', $this->data);
+ }
+
+ /* Functions below this comment can only be run via the CLI
+ * `php index.php file <function name>`
+ */
+
+ // Removes old files
+ function cron()
+ {
+ $this->_require_cli_request();
+
+ \service\files::clean_multipaste_tarballs();
+
+ $oldest_time = (time() - $this->config->item('upload_max_age'));
+ $oldest_session_time = (time() - $this->config->item("sess_expiration"));
+ $config = array(
+ "upload_max_age" => $this->config->item("upload_max_age"),
+ "small_upload_size" => $this->config->item("small_upload_size"),
+ "sess_expiration" => $this->config->item("sess_expiration"),
+ );
+
+ $query = $this->db->select('file_storage_id storage_id, files.id, user, files.date, hash')
+ ->from('files')
+ ->join('file_storage', "file_storage.id = files.file_storage_id")
+ ->where("user", 0)
+ ->where("files.date <", $oldest_session_time)
+ ->get()->result_array();
+
+ foreach($query as $row) {
+ $row['data_id'] = $row['hash'].'-'.$row['storage_id'];
+ \service\files::valid_id($row, $config, $this->mfile, time());
+ }
+
+ // 0 age disables age checks
+ if ($this->config->item('upload_max_age') == 0) return;
+
+ $query = $this->db->select('hash, files.id, user, files.date, file_storage.id storage_id')
+ ->from('files')
+ ->join('file_storage', "file_storage.id = files.file_storage_id")
+ ->where('files.date <', $oldest_time)
+ ->get()->result_array();
+
+ foreach($query as $row) {
+ $row['data_id'] = $row['hash'].'-'.$row['storage_id'];
+ \service\files::valid_id($row, $config, $this->mfile, time());
+ }
+ }
+
+ /* remove files without database entries */
+ function clean_stale_files()
+ {
+ $this->_require_cli_request();
+
+ \service\files::remove_files_missing_in_db();
+ \service\files::remove_files_missing_on_disk();
+ \service\files::clean_multipaste_tarballs();
+ }
+
+ function nuke_id()
+ {
+ $this->_require_cli_request();
+
+ $id = $this->uri->segment(3);
+
+ $file_data = $this->mfile->get_filedata($id);
+
+ if (empty($file_data)) {
+ echo "unknown id \"$id\"\n";
+ return;
+ }
+
+ $data_id = $file_data["data_id"];
+ $this->mfile->delete_data_id($data_id);
+ echo "removed data_id \"$data_id\"\n";
+ }
+
+ function update_file_metadata()
+ {
+ $this->_require_cli_request();
+
+ $chunk = 500;
+
+ $total = $this->db->count_all("file_storage");
+
+ for ($limit = 0; $limit < $total; $limit += $chunk) {
+ $query = $this->db->select('hash, id')
+ ->from('file_storage')
+ ->limit($chunk, $limit)
+ ->get()->result_array();
+
+ foreach ($query as $key => $item) {
+ $data_id = $item["hash"].'-'.$item['id'];
+ $filepath = $this->mfile->file($data_id);
+ $mimetype = mimetype($filepath);
+ $filesize = filesize($filepath);
+
+ $this->db->where('id', $item['id'])
+ ->set(array(
+ 'mimetype' => $mimetype,
+ 'filesize' => $filesize,
+ ))
+ ->update('file_storage');
+ }
+ }
+ }
+}
+
+# vim: set noet:
diff --git a/application/controllers/Tools.php b/application/controllers/Tools.php
new file mode 100644
index 000000000..040f0c711
--- /dev/null
+++ b/application/controllers/Tools.php
@@ -0,0 +1,122 @@
+<?php
+/*
+ * Copyright 2014 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+class Tools extends MY_Controller {
+
+ function __construct()
+ {
+ parent::__construct();
+
+ $this->load->model('mfile');
+ $this->_require_cli_request();
+ }
+
+ function index()
+ {
+ output_cli_usage();
+ exit;
+ }
+
+ function update_database()
+ {
+ $this->load->library('migration');
+ $upgraded = $this->migration->current();
+ if ( ! $upgraded) {
+ throw new \exceptions\ApiException("tools/update_database/migration-error", $this->migration->error_string());
+ }
+
+ if ($upgraded === true) {
+ echo "Already at latest database version. No upgrade performed\n";
+ return;
+ }
+
+ echo "Database upgraded sucessfully to version: $upgraded\n";
+ }
+
+ function drop_all_tables()
+ {
+ $tables = $this->db->list_tables();
+ $prefix = $this->db->dbprefix;
+ $tables_to_drop = array();
+
+ foreach ($tables as $table) {
+ if ($prefix === "" || strpos($table, $prefix) === 0) {
+ $tables_to_drop[] = $this->db->protect_identifiers($table);
+ }
+ }
+
+ if (empty($tables_to_drop)) {
+ return;
+ }
+
+
+ if ($this->db->dbdriver !== 'postgre') {
+ $this->db->query('SET FOREIGN_KEY_CHECKS = 0');
+ }
+ $this->db->query('DROP TABLE '.implode(", ", $tables_to_drop));
+ if ($this->db->dbdriver !== 'postgre') {
+ $this->db->query('SET FOREIGN_KEY_CHECKS = 1');
+ }
+ }
+
+ function test()
+ {
+ global $argv;
+ $testcase = $argv[3];
+
+ $testcase = str_replace("application/", "", $testcase);
+ $testcase = str_replace("/", "\\", $testcase);
+ $testcase = str_replace(".php", "", $testcase);
+
+ $test = new $testcase();
+
+ $exitcode = 0;
+
+ $refl = new ReflectionClass($test);
+ foreach ($refl->getMethods() as $method) {
+ if (strpos($method->name, "test_") === 0) {
+ try {
+ $test->setTestNamePrefix($method->name." - ");
+ $test->init();
+ $test->setTestID("{$testcase}->{$method->name}");
+ $test->{$method->name}();
+ $test->cleanup();
+ } catch (\Exception $e) {
+ echo "not ok - uncaught exception in {$testcase}->{$method->name}\n";
+ \libraries\ExceptionHandler::exception_handler($e);
+ $exitcode = 255;
+ }
+ }
+ }
+
+ if ($exitcode == 0) {
+ $test->done_testing();
+ } else {
+ exit($exitcode);
+ }
+ }
+
+ function generate_coverage_report()
+ {
+ include APPPATH."../vendor/autoload.php";
+ $filter = new \SebastianBergmann\CodeCoverage\Filter;
+ $coverage = new \SebastianBergmann\CodeCoverage\CodeCoverage(
+ (new \SebastianBergmann\CodeCoverage\Driver\Selector)->forLineCoverage($filter),
+ $filter);
+ foreach (glob(FCPATH."/test-coverage-data/*") as $file) {
+ $coverage->merge(unserialize(file_get_contents($file)));
+ }
+
+ $writer = new \SebastianBergmann\CodeCoverage\Report\Clover();
+ $writer->process($coverage, 'code-coverage-report.xml');
+ $writer = new \SebastianBergmann\CodeCoverage\Report\Html\Facade();
+ $writer->process($coverage, 'code-coverage-report');
+ print "Report saved to ./code-coverage-report/index.html\n";
+ }
+}
diff --git a/application/controllers/User.php b/application/controllers/User.php
new file mode 100644
index 000000000..00d348240
--- /dev/null
+++ b/application/controllers/User.php
@@ -0,0 +1,717 @@
+<?php
+/*
+ * Copyright 2012-2013 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+class User extends MY_Controller {
+
+ function __construct()
+ {
+ parent::__construct();
+ }
+
+ function index()
+ {
+ if (is_cli()) {
+ $this->load->library("../controllers/tools");
+ return $this->tools->index();
+ }
+
+ $this->data["username"] = $this->muser->get_username();
+
+ $this->load->view('header', $this->data);
+ $this->load->view('user/index', $this->data);
+ $this->load->view('footer', $this->data);
+ }
+
+ function test_login()
+ {
+ $username = $this->input->post('username');
+ $password = $this->input->post('password');
+
+ if ($this->muser->login($username, $password)) {
+ $this->output->set_status_header(204);
+ } else {
+ $this->output->set_status_header(403);
+ }
+ }
+
+ function login()
+ {
+ $redirect_uri = $this->input->get("redirect_uri");
+ $this->muser->require_session();
+
+ if (!preg_match('/^[0-9a-zA-Z\/_-]*$/', $redirect_uri)) {
+ $redirect_uri = '/';
+ }
+
+ if ($this->muser->logged_in()) {
+ redirect($redirect_uri);
+ }
+
+ $this->data['redirect_uri'] = $redirect_uri;
+
+ if ($this->input->post('process') !== null) {
+ $username = $this->input->post('username');
+ $password = $this->input->post('password');
+
+ $result = $this->muser->login($username, $password);
+
+ if ($result !== true) {
+ $this->data['login_error'] = true;
+ $this->load->view('header', $this->data);
+ $this->load->view('user/login', $this->data);
+ $this->load->view('footer', $this->data);
+ } else {
+ redirect($redirect_uri);
+ }
+ } else {
+ $this->load->view('header', $this->data);
+ $this->load->view('user/login', $this->data);
+ $this->load->view('footer', $this->data);
+ }
+ }
+
+ function create_apikey()
+ {
+ $this->muser->require_access();
+
+ $userid = $this->muser->get_userid();
+ $comment = $this->input->post("comment");
+ $comment = $comment === null ? "" : $comment;
+ $access_level = $this->input->post("access_level");
+
+ if ($access_level === null) {
+ $access_level = "apikey";
+ }
+
+ $key = \service\user::create_apikey($userid, $comment, $access_level);
+
+ redirect("user/apikeys");
+ }
+
+ function delete_apikey()
+ {
+ $this->muser->require_access();
+
+ $userid = $this->muser->get_userid();
+ $key = $this->input->post("key");
+
+ $this->db->where('user', $userid)
+ ->where('key', $key)
+ ->delete('apikeys');
+
+ redirect("user/apikeys");
+ }
+
+ function apikeys()
+ {
+ $this->muser->require_access();
+
+ $userid = $this->muser->get_userid();
+ $apikeys = \service\user::apikeys($userid);
+ $this->data["query"] = $apikeys["apikeys"];
+
+ $this->load->view('header', $this->data);
+ $this->load->view('user/apikeys', $this->data);
+ $this->load->view('footer', $this->data);
+ }
+
+ function create_invitation_key()
+ {
+ $this->duser->require_implemented("can_register_new_users");
+ $this->muser->require_access();
+
+ $userid = $this->muser->get_userid();
+
+ \service\user::create_invitation_key($userid);
+
+ redirect("user/invite");
+ }
+
+ function delete_invitation_key()
+ {
+ $this->duser->require_implemented("can_register_new_users");
+ $this->muser->require_access();
+
+ $userid = $this->muser->get_userid();
+ $key = $this->input->post("key");
+
+ \service\user::delete_invitation_key($userid, $key);
+ redirect("user/invite");
+ }
+
+ function invite()
+ {
+ $this->duser->require_implemented("can_register_new_users");
+ $this->muser->require_access();
+
+ $userid = $this->muser->get_userid();
+
+ $query = $this->db->select('key, date')
+ ->from('actions')
+ ->where('user', $userid)
+ ->where('action', 'invitation')
+ ->get()->result_array();
+
+ $this->data["query"] = $query;
+
+ $this->load->view('header', $this->data);
+ $this->load->view('user/invite', $this->data);
+ $this->load->view('footer', $this->data);
+ }
+
+ function register()
+ {
+ $this->duser->require_implemented("can_register_new_users");
+ $key = $this->uri->segment(3);
+ $process = $this->input->post("process");
+ $values = array(
+ "username" => "",
+ "email" => ""
+ );
+ $error = array();
+
+ $query = $this->muser->get_action("invitation", $key);
+
+ $referrer = $query["user"];
+
+ $this->data['redirect_uri'] = "/";
+
+ if ($process !== null) {
+ $username = $this->input->post("username");
+ $email = $this->input->post("email");
+ $password = $this->input->post("password");
+ $password_confirm = $this->input->post("password_confirm");
+
+ if (!$this->muser->valid_username($username)) {
+ $error[]= "Invalid username (only up to 32 chars of a-z0-9 are allowed).";
+ } else {
+ if ($this->muser->username_exists($username)) {
+ $error[] = "Username already exists.";
+ }
+ }
+
+ if (!$this->muser->valid_email($email)) {
+ $error[]= "Invalid email.";
+ }
+
+ if (!$password || $password !== $password_confirm) {
+ $error[]= "No password or passwords don't match.";
+ }
+
+ if (empty($error)) {
+ $this->muser->add_user($username, $password, $email, $referrer);
+
+ $this->db->where('key', $key)
+ ->delete('actions');
+
+ $this->load->view('header', $this->data);
+ $this->load->view('user/registered', $this->data);
+ $this->load->view('footer', $this->data);
+ return;
+ } else {
+ $values["username"] = $username;
+ $values["email"] = $email;
+ }
+ }
+
+ $this->data["key"] = $key;
+ $this->data["values"] = $values;
+ $this->data["error"] = $error;
+
+ $this->load->view('header', $this->data);
+ $this->load->view('user/register', $this->data);
+ $this->load->view('footer', $this->data);
+ }
+
+ public function delete_account()
+ {
+ $this->muser->require_access();
+ $this->duser->require_implemented("can_delete_account");
+
+ if ($_SERVER["REQUEST_METHOD"] == "GET") {
+ return $this->_delete_account_form();
+ } elseif ($_SERVER["REQUEST_METHOD"] == "POST") {
+ return $this->_delete_account_process();
+ }
+ }
+
+ public function _delete_account_form()
+ {
+ $this->data['username'] = $this->muser->get_username();
+
+ $this->load->view('header', $this->data);
+ $this->load->view('user/delete_account_form', $this->data);
+ $this->load->view('footer', $this->data);
+ }
+
+ public function _delete_account_process()
+ {
+ $username = $this->muser->get_username();
+ $password = $this->input->post("password");
+
+ $useremail = $this->muser->get_email($this->muser->get_userid());
+
+ if ($this->muser->delete_user($username, $password)) {
+ $this->muser->logout();
+
+ $this->load->library("email");
+ $this->email->from($this->config->item("email_from"));
+ $this->email->to($useremail);
+ $this->email->subject("FileBin account deleted");
+ $this->email->message(""
+ ."Your FileBin account '${username}' at ".site_url()."\n"
+ ."has been permemently deleted.\n"
+ ."\n"
+ ."The request has been sent from the IP address '${_SERVER["REMOTE_ADDR"]}'\n"
+ ."and was confirmed with your password.\n"
+ ."\n"
+ ."Thank you for using FileBin!\n"
+ );
+ $this->email->send();
+ unset($this->data['username']);
+ unset($this->data['user_logged_in']);
+
+ $this->load->view('header', $this->data);
+ $this->load->view('user/delete_account_success', $this->data);
+ $this->load->view('footer', $this->data);
+ return;
+ } else {
+ $this->data['alerts'][] = array(
+ "type" => "danger",
+ "message" => "Your password was incorrect",
+ );
+ return $this->_delete_account_form();
+ }
+ }
+
+ // This routes the different steps of a password reset
+ function reset_password()
+ {
+ $this->duser->require_implemented("can_reset_password");
+ $key = $this->uri->segment(3);
+
+ if ($_SERVER["REQUEST_METHOD"] == "GET" && $key === null) {
+ return $this->_reset_password_username_form();
+ }
+
+ if ($key === null) {
+ return $this->_reset_password_send_mail();
+ }
+
+ if ($key !== null) {
+ return $this->_reset_password_form();
+ }
+ }
+
+ // This simply queries the username
+ function _reset_password_username_form()
+ {
+ $this->data['username'] = $this->muser->get_username();
+
+ $this->load->view('header', $this->data);
+ $this->load->view('user/reset_password_username_form', $this->data);
+ $this->load->view('footer', $this->data);
+ }
+
+ // This sends a mail to the user containing the reset link
+ function _reset_password_send_mail()
+ {
+ $key = random_alphanum(12, 16);
+ $username = $this->input->post("username");
+
+ if (!$this->muser->username_exists($username)) {
+ throw new \exceptions\UserInputException("user/reset_password/invalid-username", "Invalid username");
+ }
+
+ $userinfo = $this->db->select('id, email, username')
+ ->from('users')
+ ->where('username', $username)
+ ->get()->row_array();
+
+ $this->load->library("email");
+
+ $this->db->set(array(
+ 'key' => $key,
+ 'user' => $userinfo['id'],
+ 'date' => time(),
+ 'action' => 'passwordreset'
+ ))
+ ->insert('actions');
+
+ $this->email->from($this->config->item("email_from"));
+ $this->email->to($userinfo["email"]);
+ $this->email->subject("FileBin password reset");
+ $this->email->message(""
+ ."Someone requested a password reset for the account '${userinfo["username"]}'\n"
+ ."from the IP address '${_SERVER["REMOTE_ADDR"]}'.\n"
+ ."\n"
+ ."Please follow this link to reset your password:\n"
+ .site_url("user/reset_password/$key")
+ );
+ $this->email->send();
+
+ // don't disclose full email addresses
+ $this->data["email_domain"] = substr($userinfo["email"], strpos($userinfo["email"], "@") + 1);
+
+ $this->load->view('header', $this->data);
+ $this->load->view('user/reset_password_link_sent', $this->data);
+ $this->load->view('footer', $this->data);
+ }
+
+ // This displays a form and handles the reset if the form has been filled out correctly
+ function _reset_password_form()
+ {
+ $process = $this->input->post("process");
+ $key = $this->uri->segment(3);
+ $error = array();
+
+ $query = $this->muser->get_action("passwordreset", $key);
+
+ $userid = $query["user"];
+
+ if ($process !== null) {
+ $password = $this->input->post("password");
+ $password_confirm = $this->input->post("password_confirm");
+
+ if (!$password || $password !== $password_confirm) {
+ $error[]= "No password or passwords don't match.";
+ }
+
+ if (empty($error)) {
+ $this->muser->set_password($userid, $password);
+
+ $this->db->where('key', $key)
+ ->delete('actions');
+
+ $this->load->view('header', $this->data);
+ $this->load->view('user/reset_password_success', $this->data);
+ $this->load->view('footer', $this->data);
+ return;
+ }
+ }
+
+ $this->data["key"] = $key;
+ $this->data["error"] = $error;
+
+ $this->load->view('header', $this->data);
+ $this->load->view('user/reset_password_form', $this->data);
+ $this->load->view('footer', $this->data);
+ }
+
+ public function change_email()
+ {
+ $this->duser->require_implemented("can_change_email");
+ $key = $this->uri->segment(3);
+ $action = $this->uri->segment(4);
+
+ $alerts = array();
+
+ $query = $this->muser->get_action("change_email", $key);
+
+ $userid = $query["user"];
+ $data = json_decode($query['data'], true);
+
+ switch ($action) {
+ case 'confirm':
+ $this->db->where('id', $userid)
+ ->update('users', array(
+ "email" => $data['new_email'],
+ ));
+ $alerts[] = array(
+ "type" => "success",
+ "message" => "Your email address has been updated",
+ );
+ break;
+ case 'reject':
+ $this->db->where('id', $userid)
+ ->update('users', array(
+ "email" => $data['old_email'],
+ ));
+ foreach ($data['keys'] as $k) {
+ $this->db->where('key', $k)
+ ->delete('actions');
+ }
+ $alerts[] = array(
+ "type" => "success",
+ "message" => "Your email change request has been canceled and/or your old email address has been restored",
+ );
+ break;
+ default:
+ assert(false);
+ break;
+ }
+
+ $this->data["alerts"] = $alerts;
+
+ return $this->profile();
+ }
+
+ function profile()
+ {
+ $this->muser->require_access();
+
+ if ($this->input->post("process") !== null) {
+ $this->_save_profile();
+ }
+
+ $this->data["profile_data"] = $this->muser->get_profile_data();
+
+ $this->load->view('header', $this->data);
+ $this->load->view('user/profile', $this->data);
+ $this->load->view('footer', $this->data);
+ }
+
+ private function _save_profile()
+ {
+ $this->muser->require_access();
+
+ $old = $this->muser->get_profile_data();
+
+ /*
+ * Key = name of the form field
+ * Value = function that sanatizes the value and returns it
+ * TODO: some kind of error handling that doesn't loose correctly filled out fields
+ */
+ $value_processor = array();
+ $alerts = array();
+
+ $value_processor["upload_id_limits"] = function($value) {
+ $values = explode("-", $value);
+
+ if (!is_array($values) || count($values) != 2) {
+ throw new \exceptions\UserInputException("user/profile/invalid-upload-id-limit", "Invalid upload id limit value");
+ }
+
+ $lower = intval($values[0]);
+ $upper = intval($values[1]);
+
+ if ($lower > $upper) {
+ throw new \exceptions\UserInputException("user/profile/lower-bigger-than-upper", "lower limit > upper limit");
+ }
+
+ if ($lower < 3 || $upper > 64) {
+ throw new \exceptions\UserInputException("user/profile/limit-out-of-bounds", "upper or lower limit out of bounds (3-64)");
+ }
+
+ return $lower."-".$upper;
+ };
+
+ $value_processor["email"] = function($value) use ($old, &$alerts) {
+ if (!$this->duser->is_implemented("can_change_email")) {
+ return null;
+ }
+
+ if ($value === $old["email"]) {
+ return null;
+ }
+
+ if (!$this->muser->valid_email($value)) {
+ throw new \exceptions\UserInputException("user/profile/invalid-email", "Invalid email");
+ }
+
+ $this->load->library("email");
+ $keys = array(
+ "old" => random_alphanum(12,16),
+ "new" => random_alphanum(12,16),
+ );
+ $emails = array(
+ array(
+ "key" => $keys['old'],
+ "email" => $old['email'],
+ "user" => $this->muser->get_userid(),
+ ),
+ array(
+ "key" => $keys['new'],
+ "email" => $value,
+ "user" => $this->muser->get_userid(),
+ ),
+ );
+
+ foreach ($emails as $email) {
+ $key = $email['key'];
+
+ $this->db->set(array(
+ 'key' => $key,
+ 'user' => $this->muser->get_userid(),
+ 'date' => time(),
+ 'action' => 'change_email',
+ 'data' => json_encode(array(
+ 'old_email' => $old['email'],
+ 'new_email' => $value,
+ 'keys' => $keys,
+ )),
+ ))
+ ->insert('actions');
+
+ $this->email->from($this->config->item("email_from"));
+ $this->email->to($email['email']);
+ $this->email->subject("FileBin email change confirmation");
+ $this->email->message(""
+ ."A request has been sent to change the email address of account '${old["username"]}'\n"
+ ."from ".$old['email']." to $value.\n"
+ ."\n"
+ ."Please follow this link to CONFIRM the change:\n"
+ .site_url("user/change_email/$key/confirm")."\n\n"
+ ."Please follow this link to REJECT the change:\n"
+ .site_url("user/change_email/$key/reject")."\n\n"
+ );
+ $this->email->send();
+ $this->email->clear();
+ }
+
+ $alerts[] = array(
+ "type" => "info",
+ "message" => "Reset and confirmation emails have been sent to your new and old address. Until your new address is confirmed the old one will be displayed and used.",
+ );
+
+ return null;
+ };
+
+
+ $data = array();
+ foreach (array_keys($value_processor) as $field) {
+ $value = $this->input->post($field);
+
+ if ($value !== null) {
+ $new_value = $value_processor[$field]($value);
+ if ($new_value !== null) {
+ $data[$field] = $new_value;
+ }
+ }
+ }
+
+ if (!empty($data)) {
+ $this->muser->update_profile($data);
+ }
+
+ $alerts[] = array(
+ "type" => "success",
+ "message" => "Changes saved",
+ );
+ $this->data["alerts"] = $alerts;
+
+ return true;
+ }
+
+ function logout()
+ {
+ $this->muser->logout();
+ redirect('/');
+ }
+
+ function hash_password()
+ {
+ $process = $this->input->post("process");
+ $password = $this->input->post("password");
+ $password_confirm = $this->input->post("password_confirm");
+ $this->data["hash"] = false;
+ $this->data["password"] = $password;
+
+ if ($process !== null) {
+ if (!$password || $password !== $password_confirm) {
+ $error[]= "No password or passwords don't match.";
+ } else {
+ $this->data["hash"] = $this->muser->hash_password($password);
+ }
+ }
+
+ $this->load->view('header', $this->data);
+ $this->load->view('user/hash_password', $this->data);
+ $this->load->view('footer', $this->data);
+ }
+
+ function cron()
+ {
+ $this->_require_cli_request();
+
+ if ($this->config->item('actions_max_age') == 0) return;
+
+ $oldest_time = (time() - $this->config->item('actions_max_age'));
+
+ $this->db->where('date <', $oldest_time)
+ ->delete('actions');
+ }
+
+ private function _get_line_cli($message, $verification_func = NULL)
+ {
+ echo "$message: ";
+
+ while ($line = fgets(STDIN)) {
+ $line = trim($line);
+ if ($verification_func === NULL) {
+ return $line;
+ }
+
+ if ($verification_func($line)) {
+ return $line;
+ } else {
+ echo "$message: ";
+ }
+ }
+ }
+
+ function add_user()
+ {
+ $this->_require_cli_request();
+ $this->duser->require_implemented("can_register_new_users");
+
+ $error = array();
+
+ $username = $this->_get_line_cli("Username", function($username) {
+ if (!$this->muser->valid_username($username)) {
+ echo "Invalid username (only up to 32 chars of a-z0-9 are allowed).\n";
+ return false;
+ } else {
+ if (get_instance()->muser->username_exists($username)) {
+ echo "Username already exists.\n";
+ return false;
+ }
+ }
+ return true;
+ });
+
+ $email = $this->_get_line_cli("Email", function($email) {
+ if (!$this->muser->valid_email($email)) {
+ echo "Invalid email.\n";
+ return false;
+ }
+ return true;
+ });
+
+ $password = $this->_get_line_cli("Password", function($password) {
+ if (!$password || $password === "") {
+ echo "No password supplied.\n";
+ return false;
+ }
+ return true;
+ });
+
+ $this->muser->add_user($username, $password, $email, NULL);
+
+ echo "User added\n";
+ }
+
+ function delete_user()
+ {
+ $this->_require_cli_request();
+ $this->duser->require_implemented("can_delete_account");
+
+ echo "\nWARNING: Deleting a user will delete ALL their data permanently.\n\n";
+
+ $username = $this->_get_line_cli("Username", function($username) {
+ if (get_instance()->muser->username_exists($username)) {
+ return true;
+ }
+ return false;
+ });
+ $this->muser->delete_user_real($username);
+ echo "User removed\n";
+ }
+
+}
diff --git a/application/controllers/Welcome.php b/application/controllers/Welcome.php
deleted file mode 100644
index 5f82771b6..000000000
--- a/application/controllers/Welcome.php
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-defined('BASEPATH') OR exit('No direct script access allowed');
-
-class Welcome extends CI_Controller {
-
- /**
- * Index Page for this controller.
- *
- * Maps to the following URL
- * http://example.com/index.php/welcome
- * - or -
- * http://example.com/index.php/welcome/index
- * - or -
- * Since this controller is set as the default controller in
- * config/routes.php, it's displayed at http://example.com/
- *
- * So any other public methods not prefixed with an underscore will
- * map to /index.php/welcome/<method_name>
- * @see https://codeigniter.com/userguide3/general/urls.html
- */
- public function index()
- {
- $this->load->view('welcome_message');
- }
-}
diff --git a/application/controllers/api/api_controller.php b/application/controllers/api/api_controller.php
new file mode 100644
index 000000000..d615d6cec
--- /dev/null
+++ b/application/controllers/api/api_controller.php
@@ -0,0 +1,18 @@
+<?php
+/*
+ * Copyright 2014 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+namespace controllers\api;
+
+abstract class api_controller {
+ public function __construct() {
+ $this->CI =& get_instance();
+ }
+
+}
+
diff --git a/application/controllers/api/v2/api_info.php b/application/controllers/api/v2/api_info.php
new file mode 100644
index 000000000..bd1d63590
--- /dev/null
+++ b/application/controllers/api/v2/api_info.php
@@ -0,0 +1,16 @@
+<?php
+/*
+ * Copyright 2014-2015 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+namespace controllers\api\v2;
+
+class api_info extends \controllers\api\api_controller {
+ static public function get_version()
+ {
+ return "2.2.0";
+ }
+}
diff --git a/application/controllers/api/v2/file.php b/application/controllers/api/v2/file.php
new file mode 100644
index 000000000..2e792e577
--- /dev/null
+++ b/application/controllers/api/v2/file.php
@@ -0,0 +1,112 @@
+<?php
+/*
+ * Copyright 2014-2015 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+namespace controllers\api\v2;
+
+class file extends \controllers\api\api_controller {
+ public function __construct()
+ {
+ parent::__construct();
+
+ $this->CI->load->model('mfile');
+ $this->CI->load->model('mmultipaste');
+ }
+
+ public function upload()
+ {
+ $this->CI->muser->require_access("basic");
+
+ $files = getNormalizedFILES();
+
+ if (empty($files)) {
+ throw new \exceptions\UserInputException("file/no-file", "No file was uploaded or unknown error occurred.");
+ }
+
+ \service\files::verify_uploaded_files($files);
+
+ $limits = $this->determine_id_limits();
+ $userid = $this->CI->muser->get_userid();
+ $urls = array();
+
+ foreach ($files as $file) {
+ $id = $this->CI->mfile->new_id($limits[0], $limits[1]);
+ \service\files::add_uploaded_file($userid, $id, $file["tmp_name"], $file["name"]);
+ $ids[] = $id;
+ $urls[] = site_url($id).'/';
+ }
+
+ return array(
+ "ids" => $ids,
+ "urls" => $urls,
+ );
+ }
+
+ public function get_config()
+ {
+ return array(
+ "upload_max_size" => $this->CI->config->item("upload_max_size"),
+ "max_files_per_request" => intval(ini_get("max_file_uploads")),
+ "max_input_vars" => intval(ini_get("max_input_vars")),
+ "request_max_size" => return_bytes(ini_get("post_max_size")),
+ );
+ }
+
+ public function history()
+ {
+ $this->CI->muser->require_access("apikey");
+ $history = \service\files::history($this->CI->muser->get_userid());
+ foreach ($history['multipaste_items'] as $key => $item) {
+ foreach ($item['items'] as $inner_key => $item) {
+ unset($history['multipaste_items'][$key]['items'][$inner_key]['sort_order']);
+ }
+ }
+
+ $history = ensure_json_keys_contain_objects($history, array("items", "multipaste_items"));
+
+ return $history;
+ }
+
+ public function delete()
+ {
+ $this->CI->muser->require_access("apikey");
+ $ids = $this->CI->input->post_array("ids");
+ $ret = \service\files::delete($ids);
+
+ $ret = ensure_json_keys_contain_objects($ret, array("errors", "deleted"));
+
+ return $ret;
+ }
+
+ public function create_multipaste()
+ {
+ $this->CI->muser->require_access("basic");
+ $ids = $this->CI->input->post_array("ids");
+ $userid = $this->CI->muser->get_userid();
+ $limits = $this->determine_id_limits();
+
+ return \service\files::create_multipaste($ids, $userid, $limits);
+ }
+
+
+ private function determine_id_limits()
+ {
+ $posted_minlength = $this->CI->input->post('minimum-id-length');
+ if (is_null($posted_minlength)) {
+ $limits = $this->CI->muser->get_upload_id_limits();
+ } else {
+ if ((!preg_match("/^\d+$/", $posted_minlength)) || intval($posted_minlength) <= 1 ) {
+ throw new \exceptions\UserInputException("file/bad-minimum-id-length", "Passed parameter 'minimum-id-length' is not a valid integer or too small (min value: 2)");
+ }
+
+ $limits = [$posted_minlength, null];
+ }
+
+ return $limits;
+ }
+}
+# vim: set noet:
diff --git a/application/controllers/api/v2/user.php b/application/controllers/api/v2/user.php
new file mode 100644
index 000000000..677a870c4
--- /dev/null
+++ b/application/controllers/api/v2/user.php
@@ -0,0 +1,75 @@
+<?php
+/*
+ * Copyright 2014-2016 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+namespace controllers\api\v2;
+
+class user extends \controllers\api\api_controller {
+ public function __construct()
+ {
+ parent::__construct();
+
+ $this->CI->load->model('muser');
+ }
+
+ public function apikeys()
+ {
+ $this->CI->muser->require_access("full");
+ return \service\user::apikeys($this->CI->muser->get_userid());
+ }
+
+ public function create_apikey()
+ {
+ $username = $this->CI->input->post("username");
+ $password = $this->CI->input->post("password");
+ if ($username && $password) {
+ if (!$this->CI->muser->login($username, $password)) {
+ throw new \exceptions\NotAuthenticatedException("user/login-failed", "Login failed");
+ }
+ }
+
+ $this->CI->muser->require_access("full");
+
+ $userid = $this->CI->muser->get_userid();
+ $comment = $this->CI->input->post("comment");
+ $comment = $comment === null ? "" : $comment;
+ $access_level = $this->CI->input->post("access_level");
+
+ $key = \service\user::create_apikey($userid, $comment, $access_level);
+
+ return array(
+ "new_key" => $key,
+ );
+ }
+
+ public function delete_apikey()
+ {
+ $this->CI->muser->require_access("full");
+
+ $userid = $this->CI->muser->get_userid();
+ $key = $this->CI->input->post("delete_key");
+
+ $this->CI->db->where('user', $userid)
+ ->where('key', $key)
+ ->delete('apikeys');
+
+ $affected = $this->CI->db->affected_rows();
+
+ assert($affected >= 0 && $affected <= 1);
+ if ($affected == 1) {
+ return array(
+ "deleted_keys" => array(
+ $key => array (
+ "key" => $key,
+ ),
+ ),
+ );
+ } else {
+ throw new \exceptions\PublicApiException('user/delete_apikey/failed', 'Apikey deletion failed. Possibly wrong owner.');
+ }
+ }
+}
diff --git a/application/controllers/file/Multipaste.php b/application/controllers/file/Multipaste.php
new file mode 100644
index 000000000..cc8ab8819
--- /dev/null
+++ b/application/controllers/file/Multipaste.php
@@ -0,0 +1,113 @@
+<?php
+/*
+ * Copyright 2016 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+class Multipaste extends MY_Controller {
+
+ function __construct() {
+ parent::__construct();
+
+ $this->load->model('mfile');
+ $this->load->model('mmultipaste');
+ }
+
+ public function append_multipaste_queue() {
+ $this->muser->require_access("basic");
+
+ $ids = $this->input->post_array("ids");
+ if ($ids === null) {
+ $ids = [];
+ }
+
+ $m = new \service\multipaste_queue();
+ $m->append($ids);
+
+ redirect("file/multipaste/queue");
+ }
+
+ public function review_multipaste() {
+ $this->muser->require_access("basic");
+
+ $this->load->view('header', $this->data);
+ $this->load->view('file/review_multipaste', $this->data);
+ $this->load->view('footer', $this->data);
+ }
+
+ public function queue() {
+ $this->muser->require_access("basic");
+
+ $m = new \service\multipaste_queue();
+ $ids = $m->get();
+
+ $this->data['ids'] = $ids;
+ $this->data['items'] = array_map(function($id) {return $this->_get_multipaste_item($id);}, $ids);
+
+ $this->load->view('header', $this->data);
+ $this->load->view('file/multipaste/queue', $this->data);
+ $this->load->view('footer', $this->data);
+ }
+
+ public function form_submit() {
+ $this->muser->require_access("basic");
+
+ $ids = $this->input->post_array('ids');
+ $process = $this->input->post('process');
+
+ if ($ids === null) {
+ $ids = [];
+ }
+
+ $m = new \service\multipaste_queue();
+ $m->set($ids);
+
+ $dispatcher = [
+ 'save' => function() use ($ids, $m) {
+ redirect("file/multipaste/queue");
+ },
+ 'create' => function() use ($ids, $m) {
+ $userid = $this->muser->get_userid();
+ $limits = $this->muser->get_upload_id_limits();
+ $ret = \service\files::create_multipaste($ids, $userid, $limits);
+ $m->set([]);
+ redirect($ret['url_id'].'/');
+ },
+ ];
+
+ if (isset($dispatcher[$process])) {
+ $dispatcher[$process]();
+ } else {
+ throw new \exceptions\UserInputException("file/multipaste/form_submit/invalid-process-value", "Value in process field not found in dispatch table");
+ }
+ }
+
+ public function ajax_submit() {
+ $this->muser->require_access("basic");
+ $ids = $this->input->post_array('ids');
+
+ if ($ids === null) {
+ $ids = [];
+ }
+
+ $m = new \service\multipaste_queue();
+ $m->set($ids);
+ }
+
+ private function _get_multipaste_item($id) {
+ $filedata = $this->mfile->get_filedata($id);
+ $item = [];
+ $item['id'] = $filedata['id'];
+ $item['tooltip'] = \service\files::tooltip($filedata);
+ $item['title'] = $filedata['filename'];
+ if (\libraries\Image::type_supported($filedata["mimetype"])) {
+ $item['thumbnail'] = site_url("file/thumbnail/".$filedata['id']);
+ }
+
+ return $item;
+ }
+
+}
diff --git a/application/core/MY_Controller.php b/application/core/MY_Controller.php
new file mode 100644
index 000000000..f33dedbb3
--- /dev/null
+++ b/application/core/MY_Controller.php
@@ -0,0 +1,128 @@
+<?php
+/*
+ * Copyright 2009-2013 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+class MY_Controller extends CI_Controller {
+ public $data = array();
+ public $var;
+
+ function __construct()
+ {
+ parent::__construct();
+
+ $this->var = new StdClass();
+
+ $this->load->library('customautoloader');
+
+ // check if DB is up to date
+ if (!(is_cli() && $this->uri->segment(1) === "tools")) {
+ $this->_ensure_database_schema_up_to_date();
+ }
+
+ $old_path = getenv("PATH");
+ putenv("PATH=$old_path:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin");
+
+ $this->load->helper(array('form', 'filebin'));
+
+ if ($this->uri->segment(1) == "api") {
+ is_api_client(true);
+ }
+
+ if ($this->_check_csrf_protection_required()) {
+ $this->_setup_csrf_protection();
+ }
+
+ if ($this->config->item("environment") == "development") {
+ $this->output->enable_profiler(true);
+ }
+
+ $this->data['title'] = "FileBin";
+
+ $this->load->model("muser");
+ $this->data["user_logged_in"] = $this->muser->logged_in();
+ $this->data['redirect_uri'] = $this->uri->uri_string();
+ if ($this->muser->has_session()) {
+ $this->data['show_multipaste_queue'] = !empty((new \service\multipaste_queue)->get());
+ }
+ }
+
+ protected function _require_cli_request()
+ {
+ if (!is_cli()) {
+ throw new \exceptions\InsufficientPermissionsException("api/cli-only", "This function can only be accessed via the CLI interface");
+ }
+ }
+
+ private function _ensure_database_schema_up_to_date()
+ {
+ if (!$this->db->table_exists('migrations')){
+ throw new \exceptions\PublicApiException("general/db/not-initialized", "Database not initialized. Can't find migrations table. Please run the migration script. (php index.php tools update_database)");
+ } else {
+ $this->config->load("migration", true);
+ $target_version = $this->config->item("migration_version", "migration");
+
+ // TODO: wait 20 seconds for an update so requests don't get lost for short updates?
+ $row = $this->db->get('migrations')->row();
+
+ $current_version = $row ? $row->version : 0;
+ if ($current_version != $target_version) {
+ throw new \exceptions\PublicApiException("general/db/wrong-version", "Database version is $current_version, we want $target_version. Please run the migration script. (php index.php tools update_database)");
+ }
+ }
+ }
+
+ private function _check_csrf_protection_required()
+ {
+ if ($this->input->post("apikey") !== null || is_api_client()) {
+ /* This relies on the authentication code always verifying the supplied
+ * apikey. If the key is not verified/logged in an attacker could simply
+ * add an empty "apikey" field to the CSRF form to circumvent the
+ * protection. If we always log in if a key is supplied we can ensure
+ * that an attacker (and the victim since they get a cookie) can only
+ * access the attacker's account.
+ */
+ // TODO: perform the apikey login here to make sure this works as expected?
+ return false;
+ }
+
+ $uri_start = $this->uri->rsegment(1)."/".$this->uri->rsegment(2);
+ $csrf_whitelisted_handlers = array(
+ "always" => array(
+ /* Whitelist the upload pages because they don't cause harm and a user
+ * might keep the upload page open for more than csrf_expire seconds
+ * and we don't want to annoy them when they upload a big file and the
+ * CSRF check fails.
+ */
+ "file/do_websubmit",
+ ),
+ );
+ if (in_array($uri_start, $csrf_whitelisted_handlers["always"])) {
+ return false;
+ }
+
+ if (is_cli()) {
+ return false;
+ }
+
+ return true;
+ }
+
+ private function _setup_csrf_protection()
+ {
+ // 2 functions for accessing config options, really?
+ $this->config->set_item('csrf_protection', true);
+ config_item("csrf_protection", true);
+
+ if ($this->uri->uri_string() == "file/multipaste/ajax_submit") {
+ $this->config->set_item('csrf_regenerate', false);
+ }
+
+ $this->security->__construct();
+ $this->security->csrf_verify();
+ }
+}
diff --git a/application/core/MY_Input.php b/application/core/MY_Input.php
new file mode 100644
index 000000000..5a08ea4bb
--- /dev/null
+++ b/application/core/MY_Input.php
@@ -0,0 +1,40 @@
+<?php
+/*
+ * Copyright 2017 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+class MY_Input extends CI_Input {
+ public function post($key = null, $xss_clean = false) {
+ $ret = parent::post($key, $xss_clean);
+ if (is_array($ret) || is_object($ret)) {
+ $data = [
+ "key" => $key,
+ "ret" => $ret
+ ];
+ if (preg_match("/^[a-zA-Z0-9_\.-]+$/", $key)) {
+ throw new \exceptions\UserInputException("input/invalid-form-field", "Invalid input in field $key", $data);
+ } else {
+ throw new \exceptions\UserInputException("input/invalid-form-field", "Invalid input", $data);
+ }
+ }
+ return $ret;
+ }
+
+ public function post_array($key) {
+ $ret = parent::post($key);
+ if ($ret === null) {
+ return null;
+ } elseif (!is_array($ret)) {
+ $data = [
+ "key" => $key,
+ "ret" => $ret
+ ];
+ throw new \exceptions\UserInputException("input/invalid-form-field", "Invalid input", $data);
+ }
+ return $ret;
+ }
+}
diff --git a/application/core/MY_Output.php b/application/core/MY_Output.php
new file mode 100644
index 000000000..402e46c80
--- /dev/null
+++ b/application/core/MY_Output.php
@@ -0,0 +1,16 @@
+<?php
+/*
+ * Copyright 2016 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+class MY_Output extends CI_Output {
+ public function __construct()
+ {
+ parent::__construct();
+ $this->parse_exec_vars = false;
+ }
+}
diff --git a/application/exceptions/ApiException.php b/application/exceptions/ApiException.php
new file mode 100644
index 000000000..b1ec96117
--- /dev/null
+++ b/application/exceptions/ApiException.php
@@ -0,0 +1,35 @@
+<?php
+/*
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+namespace exceptions;
+
+class ApiException extends \Exception {
+ private $error_id;
+ private $data;
+
+ public function __construct($error_id, $message, $data = null, $previous = null)
+ {
+ parent::__construct($message, 0, $previous);
+
+ $this->error_id = $error_id;
+ $this->data = $data;
+ }
+
+ public function get_error_id()
+ {
+ return $this->error_id;
+ }
+
+ public function get_data()
+ {
+ return $this->data;
+ }
+
+ public function get_http_error_code()
+ {
+ return 500;
+ }
+}
diff --git a/application/exceptions/FileUploadVerifyException.php b/application/exceptions/FileUploadVerifyException.php
new file mode 100644
index 000000000..5125e4822
--- /dev/null
+++ b/application/exceptions/FileUploadVerifyException.php
@@ -0,0 +1,23 @@
+<?php
+/*
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+namespace exceptions;
+
+class FileUploadVerifyException extends VerifyException {
+ public function __toString()
+ {
+ $ret = $this->getMessage()."\n";
+ $data = $this->get_data();
+ $errors = array();
+
+ foreach ($data as $error) {
+ $errors[] = sprintf("%s: %s", $error["filename"], $error["message"]);
+ }
+
+ $ret .= implode("\n", $errors);
+ return $ret;
+ }
+}
diff --git a/application/exceptions/InsufficientPermissionsException.php b/application/exceptions/InsufficientPermissionsException.php
new file mode 100644
index 000000000..a036edf9d
--- /dev/null
+++ b/application/exceptions/InsufficientPermissionsException.php
@@ -0,0 +1,14 @@
+<?php
+/*
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+namespace exceptions;
+
+class InsufficientPermissionsException extends UserInputException {
+ public function get_http_error_code()
+ {
+ return 403;
+ }
+}
diff --git a/application/exceptions/NotAuthenticatedException.php b/application/exceptions/NotAuthenticatedException.php
new file mode 100644
index 000000000..99ddd82fc
--- /dev/null
+++ b/application/exceptions/NotAuthenticatedException.php
@@ -0,0 +1,14 @@
+<?php
+/*
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+namespace exceptions;
+
+class NotAuthenticatedException extends UserInputException {
+ public function get_http_error_code()
+ {
+ return 403;
+ }
+}
diff --git a/application/exceptions/NotFoundException.php b/application/exceptions/NotFoundException.php
new file mode 100644
index 000000000..c4b9d1537
--- /dev/null
+++ b/application/exceptions/NotFoundException.php
@@ -0,0 +1,14 @@
+<?php
+/*
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+namespace exceptions;
+
+class NotFoundException extends UserInputException {
+ public function get_http_error_code()
+ {
+ return 404;
+ }
+}
diff --git a/application/exceptions/PublicApiException.php b/application/exceptions/PublicApiException.php
new file mode 100644
index 000000000..d22309478
--- /dev/null
+++ b/application/exceptions/PublicApiException.php
@@ -0,0 +1,14 @@
+<?php
+/*
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+namespace exceptions;
+
+class PublicApiException extends ApiException {
+ public function __toString()
+ {
+ return $this->getMessage();
+ }
+}
diff --git a/application/exceptions/RequestTooBigException.php b/application/exceptions/RequestTooBigException.php
new file mode 100644
index 000000000..ae2ab4d22
--- /dev/null
+++ b/application/exceptions/RequestTooBigException.php
@@ -0,0 +1,14 @@
+<?php
+/*
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+namespace exceptions;
+
+class RequestTooBigException extends UserInputException {
+ public function get_http_error_code()
+ {
+ return 413;
+ }
+}
diff --git a/application/exceptions/UserInputException.php b/application/exceptions/UserInputException.php
new file mode 100644
index 000000000..d4c327315
--- /dev/null
+++ b/application/exceptions/UserInputException.php
@@ -0,0 +1,14 @@
+<?php
+/*
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+namespace exceptions;
+
+class UserInputException extends PublicApiException {
+ public function get_http_error_code()
+ {
+ return 400;
+ }
+}
diff --git a/application/exceptions/VerifyException.php b/application/exceptions/VerifyException.php
new file mode 100644
index 000000000..0e9d8b93a
--- /dev/null
+++ b/application/exceptions/VerifyException.php
@@ -0,0 +1,23 @@
+<?php
+/*
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+namespace exceptions;
+
+class VerifyException extends UserInputException {
+ public function __toString()
+ {
+ $ret = $this->getMessage()."\n";
+ $data = $this->get_data();
+ $errors = array();
+
+ foreach ($data as $error) {
+ $errors[] = sprintf("%s: %s", $error["id"], $error["reason"]);
+ }
+
+ $ret .= implode("\n", $errors);
+ return $ret;
+ }
+}
diff --git a/application/helpers/filebin_helper.php b/application/helpers/filebin_helper.php
new file mode 100644
index 000000000..0fa986225
--- /dev/null
+++ b/application/helpers/filebin_helper.php
@@ -0,0 +1,325 @@
+<?php
+
+function expiration_duration($duration)
+{
+ $total = $duration;
+ $days = floor($total / 86400);
+ $total -= $days * 86400;
+ $hours = floor($total / 3600);
+ $total -= $hours * 3600;
+ $minutes = floor($total / 60);
+ $seconds = $total - $minutes * 60;
+ $times = array($days, $hours, $minutes, $seconds);
+ $suffixes = array(' day', ' hour', ' minute', ' second');
+ $expiration = array();
+
+ for ($i = 0; $i < count($suffixes); $i++) {
+ if ($times[$i] != 0) {
+ $duration = $times[$i].$suffixes[$i];
+ if ($times[$i] > 1) {
+ $duration .= "s";
+ }
+ array_push($expiration, $duration);
+ }
+ }
+
+ return join(", ", $expiration);
+}
+
+function format_bytes($size)
+{
+ $suffixes = array('B', 'KiB', 'MiB', 'GiB', 'TiB' , 'PiB' , 'EiB', 'ZiB', 'YiB');
+ $boundary = 2048.0;
+
+ for ($suffix_pos = 0; $suffix_pos + 1 < count($suffixes); $suffix_pos++) {
+ if ($size <= $boundary && $size >= -$boundary) {
+ break;
+ }
+ $size /= 1024.0;
+ }
+
+ # don't print decimals for bytes
+ if ($suffix_pos != 0) {
+ return sprintf("%.2f%s", $size, $suffixes[$suffix_pos]);
+ } else {
+ return sprintf("%.0f%s", $size, $suffixes[$suffix_pos]);
+ }
+}
+
+function is_api_client($override = null)
+{
+ static $is_api = null;
+
+ if ($override !== null) {
+ $is_api = $override;
+ }
+
+ if ($is_api === null) {
+ $is_api = false;
+ }
+ return $is_api;
+}
+
+function random_alphanum($min_length, $max_length = null)
+{
+ $random = '';
+ $char_list = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ $char_list .= "abcdefghijklmnopqrstuvwxyz";
+ $char_list .= "1234567890";
+
+ if ($max_length === null) {
+ $max_length = $min_length;
+ }
+ $length = mt_rand($min_length, $max_length);
+
+ for($i = 0; $i < $max_length; $i++) {
+ if (strlen($random) == $length) break;
+ $random .= substr($char_list, mt_rand(0, strlen($char_list) - 1), 1);
+ }
+ return $random;
+}
+
+function link_with_mtime($file)
+{
+ $link = base_url($file);
+
+ if (file_exists(FCPATH.$file)) {
+ $link .= "?".filemtime(FCPATH.$file);
+ }
+
+ return $link;
+}
+
+function js_cache_buster()
+{
+ $jsdir = FCPATH.'/data/js';
+ $minified_main = $jsdir.'/main.min.js';
+ if (file_exists($minified_main)) {
+ return filemtime($minified_main);
+ }
+
+ $ret = 0;
+
+ $it = new RecursiveIteratorIterator(
+ new RecursiveDirectoryIterator($jsdir), RecursiveIteratorIterator::SELF_FIRST);
+
+ foreach ($it as $file) {
+ $mtime = $file->getMTime();
+ if ($file->isFile()) {
+ if ($mtime > $ret) {
+ $ret = $mtime;
+ }
+ }
+ }
+ return $ret;
+}
+
+// Reference: http://php.net/manual/en/features.file-upload.multiple.php#109437
+// This is a little different because we don't care about the fieldname
+function getNormalizedFILES()
+{
+ $newfiles = array();
+ $ret = array();
+
+ foreach($_FILES as $fieldname => $fieldvalue)
+ foreach($fieldvalue as $paramname => $paramvalue)
+ foreach((array)$paramvalue as $index => $value)
+ $newfiles[$fieldname][$index][$paramname] = $value;
+
+ $i = 0;
+ foreach ($newfiles as $fieldname => $field) {
+ foreach ($field as $file) {
+ // skip empty fields
+ if ($file["error"] === 4) {
+ continue;
+ }
+ $ret[$i] = $file;
+ $ret[$i]["formfield"] = $fieldname;
+ $i++;
+ }
+ }
+
+ return $ret;
+}
+
+// Allow simple checking inside views
+function auth_driver_function_implemented($function)
+{
+ static $result = array();
+ if (isset($result[$function])) {
+ return $result[$function];
+ }
+
+ $CI =& get_instance();
+ $CI->load->driver("duser");
+ $result[$function] = $CI->duser->is_implemented($function);;
+
+ return $result[$function];
+}
+
+function static_storage($key, $value = null)
+{
+ static $storage = array();
+
+ if ($value !== null) {
+ $storage[$key] = $value;
+ }
+
+ if (!isset($storage[$key])) {
+ $storage[$key] = null;
+ }
+
+ return $storage[$key];
+}
+
+function stateful_client()
+{
+ $CI =& get_instance();
+
+ if ($CI->input->post("apikey")) {
+ return false;
+ }
+
+ if (is_api_client()) {
+ return false;
+ }
+
+ return true;
+}
+
+function init_cache()
+{
+ static $done = false;
+ if ($done) {return;}
+
+ $CI =& get_instance();
+ $CI->load->driver('cache', array('adapter' => $CI->config->item("cache_backend")));
+ $done = true;
+}
+
+function delete_cache($key)
+{
+ init_cache();
+ $CI =& get_instance();
+ $CI->cache->delete($key);
+}
+
+/**
+ * Cache the result of the function call in the cache backend.
+ * @param key cache key to use
+ * @param ttl time to live for the cache entry
+ * @param function function to call
+ * @return return value of function (will be cached)
+ */
+function cache_function($key, $ttl, $function)
+{
+ init_cache();
+ $CI =& get_instance();
+ if (! $content = $CI->cache->get($key)) {
+ $content = $function();
+ $CI->cache->save($key, $content, $ttl);
+ }
+ return $content;
+}
+
+/**
+ * Cache the result of a function call in the cache backend and in the memory of this process.
+ * @param key cache key to use
+ * @param ttl time to live for the cache entry
+ * @param function function to call
+ * @return return value of function (will be cached)
+ */
+function cache_function_full($key, $ttl, $function) {
+ $local_key = 'cache_function-'.$key;
+ if (static_storage($local_key) !== null) {
+ return static_storage($local_key);
+ }
+ $ret = cache_function($key, $ttl, $function);
+ static_storage($local_key, $ret);
+ return $ret;
+}
+
+// Return mimetype of file
+function mimetype($file) {
+ $fileinfo = new finfo(FILEINFO_MIME_TYPE);
+
+ // XXX: Workaround for PHP#71434 https://bugs.php.net/bug.php?id=71434
+ $old = error_reporting();
+ error_reporting($old &~ E_NOTICE);
+ $mimetype = $fileinfo->file($file);
+ error_reporting($old);
+
+ return $mimetype;
+}
+
+function files_are_equal($a, $b)
+{
+ $chunk_size = 8*1024;
+
+ // Check if filesize is different
+ if (filesize($a) !== filesize($b)) {
+ return false;
+ }
+
+ // Check if content is different
+ $ah = fopen($a, 'rb');
+ $bh = fopen($b, 'rb');
+
+ $result = true;
+ while (!feof($ah) && !feof($bh)) {
+ if (fread($ah, $chunk_size) !== fread($bh, $chunk_size)) {
+ $result = false;
+ break;
+ }
+ }
+
+ fclose($ah);
+ fclose($bh);
+
+ return $result;
+}
+
+# Source: http://php.net/manual/en/function.ini-get.php#96996
+function return_bytes($size_str)
+{
+ switch (substr ($size_str, -1))
+ {
+ case 'K': case 'k': return (int)$size_str * 1024;
+ case 'M': case 'm': return (int)$size_str * 1048576;
+ case 'G': case 'g': return (int)$size_str * 1073741824;
+ default:
+ if (strlen($size_str) === strlen(intval($size_str))) {
+ return (int)$size_str;
+ }
+ throw new \exceptions\ApiException('filebin-helper/invalid-input-unit', "Input has invalid unit");
+ }
+}
+
+function ensure_json_keys_contain_objects($data, $keys) {
+ foreach ($keys as $key) {
+ if (empty($data[$key])) {
+ $data[$key] = (object) array();
+ }
+ }
+ return $data;
+}
+
+function output_cli_usage() {
+ echo "php index.php <controller> <function> [arguments]\n";
+ echo "\n";
+ echo "Functions:\n";
+ echo " file cron Cronjob\n";
+ echo " file nuke_id <ID> Nukes all IDs sharing the same hash\n";
+ echo " user cron Cronjob\n";
+ echo " user add_user Add a user\n";
+ echo " user delete_user Delete a user including all their data\n";
+ echo " tools update_database Update/Initialise the database\n";
+ echo "\n";
+ echo "Functions that shouldn't have to be run:\n";
+ echo " file clean_stale_files Remove files without database entries,\n";
+ echo " database entries without files and multipaste\n";
+ echo " tarballs that are no longer needed\n";
+ echo " file update_file_metadata Update filesize and mimetype in database\n";
+}
+
+# vim: set noet:
diff --git a/application/libraries/Customautoloader.php b/application/libraries/Customautoloader.php
new file mode 100644
index 000000000..eb14c5624
--- /dev/null
+++ b/application/libraries/Customautoloader.php
@@ -0,0 +1,42 @@
+<?php
+/*
+ * Copyright 2014 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+// Original source: http://stackoverflow.com/a/9526005/953022
+class Customautoloader {
+ public function __construct()
+ {
+ spl_autoload_register(array($this, 'loader'));
+ }
+
+ public function loader($className)
+ {
+ $namespaces = array(
+ 'Endroid\QrCode' => [
+ ["path" => APPPATH."/third_party/QrCode/src/"],
+ ],
+ '' => [
+ ["path" => APPPATH],
+ ["path" => APPPATH."/third_party/mockery/library/"]
+ ],
+ );
+
+ foreach ($namespaces as $namespace => $search_items) {
+ if ($namespace === '' || strpos($className, $namespace) === 0) {
+ foreach ($search_items as $search_item) {
+ $nameToLoad = str_replace($namespace, '', $className);
+ $path = $search_item['path'].str_replace('\\', DIRECTORY_SEPARATOR, $nameToLoad).'.php';
+ if (file_exists($path)) {
+ require $path;
+ return;
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/application/libraries/Ddownload/Ddownload.php b/application/libraries/Ddownload/Ddownload.php
new file mode 100644
index 000000000..3a98d4154
--- /dev/null
+++ b/application/libraries/Ddownload/Ddownload.php
@@ -0,0 +1,34 @@
+<?php
+/*
+ * Copyright 2013 Pierre Schmitz <pierre@archlinux.de>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+abstract class Ddownload_Driver extends CI_Driver {
+
+ abstract public function serveFile($file, $filename, $type);
+}
+
+class Ddownload extends CI_Driver_Library {
+
+ protected $_adapter = null;
+
+ protected $valid_drivers = array(
+ 'php', 'nginx', 'lighttpd'
+ );
+
+ function __construct()
+ {
+ $CI =& get_instance();
+
+ $this->_adapter = $CI->config->item('download_driver');
+ }
+
+ public function serveFile($file, $filename, $type)
+ {
+ $this->{$this->_adapter}->serveFile($file, $filename, $type);
+ }
+}
diff --git a/application/libraries/Ddownload/drivers/Ddownload_lighttpd.php b/application/libraries/Ddownload/drivers/Ddownload_lighttpd.php
new file mode 100644
index 000000000..fbdb04b02
--- /dev/null
+++ b/application/libraries/Ddownload/drivers/Ddownload_lighttpd.php
@@ -0,0 +1,26 @@
+<?php
+/*
+ * Copyright 2013 Pierre Schmitz <pierre@archlinux.de>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+class Ddownload_lighttpd extends Ddownload_Driver {
+
+ public function serveFile($file, $filename, $type)
+ {
+ $CI =& get_instance();
+ $upload_path = $CI->config->item('upload_path');
+
+ if (strpos($file, $upload_path) !== 0) {
+ throw new \exceptions\ApiException("libraries/ddownload/lighttpd/invalid-file-path", 'Invalid file path');
+ }
+
+ header('Content-disposition: inline; filename="'.$filename."\"\n");
+ header('Content-Type: '.$type."\n");
+ header('X-Sendfile: '.$file."\n");
+ }
+
+}
diff --git a/application/libraries/Ddownload/drivers/Ddownload_nginx.php b/application/libraries/Ddownload/drivers/Ddownload_nginx.php
new file mode 100644
index 000000000..58c7502a7
--- /dev/null
+++ b/application/libraries/Ddownload/drivers/Ddownload_nginx.php
@@ -0,0 +1,29 @@
+<?php
+/*
+ * Copyright 2013 Pierre Schmitz <pierre@archlinux.de>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+class Ddownload_nginx extends Ddownload_Driver {
+
+ public function serveFile($file, $filename, $type)
+ {
+ $CI =& get_instance();
+ $upload_path = $CI->config->item('upload_path');
+ $download_location = $CI->config->item('download_nginx_location');
+
+ if (strpos($file, $upload_path) === 0) {
+ $file_path = substr($file, strlen($upload_path));
+ } else {
+ throw new \exceptions\ApiException("libraries/ddownload/nginx/invalid-file-path", 'Invalid file path');
+ }
+
+ header('Content-disposition: inline; filename="'.$filename."\"\n");
+ header('Content-Type: '.$type."\n");
+ header('X-Accel-Redirect: '.$download_location.$file_path."\n");
+ }
+
+}
diff --git a/application/libraries/Ddownload/drivers/Ddownload_php.php b/application/libraries/Ddownload/drivers/Ddownload_php.php
new file mode 100644
index 000000000..90c002b58
--- /dev/null
+++ b/application/libraries/Ddownload/drivers/Ddownload_php.php
@@ -0,0 +1,111 @@
+<?php
+/*
+ * Copyright 2013 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+class Ddownload_php extends Ddownload_Driver {
+
+ // Original source: http://www.phpfreaks.com/forums/index.php?topic=198274.msg895468#msg895468
+ public function serveFile($file, $filename, $type)
+ {
+ $fp = fopen($file, 'r');
+
+ $size = filesize($file); // File size
+ $length = $size; // Content length
+ $start = 0; // Start byte
+ $end = $size - 1; // End byte
+ // Now that we've gotten so far without errors we send the accept range header
+ /* At the moment we only support single ranges.
+ * Multiple ranges requires some more work to ensure it works correctly
+ * and comply with the spesifications: http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.2
+ *
+ * Multirange support annouces itself with:
+ * header('Accept-Ranges: bytes');
+ *
+ * Multirange content must be sent with multipart/byteranges mediatype,
+ * (mediatype = mimetype)
+ * as well as a boundry header to indicate the various chunks of data.
+ */
+ header("Accept-Ranges: 0-$length");
+ // header('Accept-Ranges: bytes');
+ // multipart/byteranges
+ // http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.2
+ if (isset($_SERVER['HTTP_RANGE']))
+ {
+ $c_start = $start;
+ $c_end = $end;
+ // Extract the range string
+ list(, $range) = explode('=', $_SERVER['HTTP_RANGE'], 2);
+ // Make sure the client hasn't sent us a multibyte range
+ if (strpos($range, ',') !== false)
+ {
+ // (?) Shoud this be issued here, or should the first
+ // range be used? Or should the header be ignored and
+ // we output the whole content?
+ header('HTTP/1.1 416 Requested Range Not Satisfiable');
+ header("Content-Range: bytes $start-$end/$size");
+ // (?) Echo some info to the client?
+ exit;
+ }
+ // If the range starts with an '-' we start from the beginning
+ // If not, we forward the file pointer
+ // And make sure to get the end byte if spesified
+ if ($range[0] == '-')
+ {
+ // The n-number of the last bytes is requested
+ $c_start = $size - substr($range, 1);
+ }
+ else
+ {
+ $range = explode('-', $range);
+ $c_start = $range[0];
+ $c_end = (isset($range[1]) && is_numeric($range[1])) ? $range[1] : $size;
+ }
+ /* Check the range and make sure it's treated according to the specs.
+ * http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
+ */
+ // End bytes can not be larger than $end.
+ $c_end = ($c_end > $end) ? $end : $c_end;
+ // Validate the requested range and return an error if it's not correct.
+ if ($c_start > $c_end || $c_start > $size - 1 || $c_end >= $size)
+ {
+ header('HTTP/1.1 416 Requested Range Not Satisfiable');
+ header("Content-Range: bytes $start-$end/$size");
+ // (?) Echo some info to the client?
+ exit;
+ }
+ $start = $c_start;
+ $end = $c_end;
+ $length = $end - $start + 1; // Calculate new content length
+ fseek($fp, $start);
+ header('HTTP/1.1 206 Partial Content');
+ // Notify the client the byte range we'll be outputting
+ header("Content-Range: bytes $start-$end/$size");
+ }
+ header("Content-Length: $length");
+ header("Content-disposition: inline; filename=\"".$filename."\"\n");
+ header("Content-Type: ".$type."\n");
+
+ // Start buffered download
+ $buffer = 1024 * 8;
+ while(!feof($fp) && ($p = ftell($fp)) <= $end)
+ {
+ if ($p + $buffer > $end)
+ {
+ // In case we're only outputtin a chunk, make sure we don't
+ // read past the length
+ $buffer = $end - $p + 1;
+ }
+ set_time_limit(0); // Reset time limit for big files
+ echo fread($fp, $buffer);
+ flush(); // Free up memory. Otherwise large files will trigger PHP's memory limit.
+ }
+
+ fclose($fp);
+ }
+
+}
diff --git a/application/libraries/Duser/Duser.php b/application/libraries/Duser/Duser.php
new file mode 100644
index 000000000..0007fabd8
--- /dev/null
+++ b/application/libraries/Duser/Duser.php
@@ -0,0 +1,124 @@
+<?php
+/*
+ * Copyright 2013 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+abstract class Duser_Driver extends CI_Driver {
+
+ // List of optional functions that are implemented
+ //
+ // Possible values are:
+ // - can_register_new_users (only supported with the DB driver!)
+ // - can_reset_password (only supported with the DB driver!)
+ // - can_change_email (only supported with the DB driver!)
+ public $optional_functions = array();
+
+ /*
+ * The returned array should contain the following keys:
+ * - username string
+ * - userid INT > 0
+ *
+ * @param username
+ * @param password
+ * @return mixed array on success, false on failure
+ */
+ abstract public function login($username, $password);
+
+ /*
+ * @param username
+ * @return boolean true is username exists, false otherwise
+ */
+ public function username_exists($username) {
+ return null;
+ }
+
+ /*
+ * @param userid
+ * @return string email address of the user
+ */
+ public function get_email($userid) {
+ return null;
+ }
+}
+
+class Duser extends CI_Driver_Library {
+
+ protected $_adapter = null;
+
+ protected $valid_drivers = array(
+ 'db', 'ldap', 'fluxbb'
+ );
+
+ function __construct()
+ {
+ $CI =& get_instance();
+
+ $this->_adapter = $CI->config->item("authentication_driver");
+ }
+
+ // require an optional function to be implemented
+ public function require_implemented($function) {
+ if (!$this->is_implemented($function)) {
+ throw new \exceptions\PublicApiException("libraries/duser/optional-function-not-implemented", ""
+ ."Optional function '".$function."' not implemented in user adapter '".$this->_adapter."'. "
+ ."Requested functionally unavailable.");
+ }
+ }
+
+ // check if an optional function is implemented
+ public function is_implemented($function) {
+ if (in_array($function, $this->{$this->_adapter}->optional_functions)) {
+ return true;
+ }
+
+ return false;
+ }
+
+ public function login($username, $password)
+ {
+ $login_info = $this->{$this->_adapter}->login($username, $password);
+ if ($login_info === false) {
+ return false;
+ }
+
+ $CI =& get_instance();
+
+ $CI->session->set_userdata(array(
+ 'logged_in' => true,
+ 'username' => $login_info["username"],
+ 'userid' => $login_info["userid"],
+ 'access_level' => 'full',
+ ));
+
+ return true;
+ }
+
+ public function username_exists($username)
+ {
+ if ($username === false) {
+ return false;
+ }
+
+ return $this->{$this->_adapter}->username_exists($username);
+ }
+
+ public function get_email($userid)
+ {
+ return $this->{$this->_adapter}->get_email($userid);
+ }
+
+ public function test_login_credentials($username, $password)
+ {
+ $login_info = $this->{$this->_adapter}->login($username, $password);
+
+ if (isset($login_info['username']) && $login_info['username'] === $username) {
+ return true;
+ }
+
+ return false;
+ }
+}
diff --git a/application/libraries/Duser/drivers/Duser_db.php b/application/libraries/Duser/drivers/Duser_db.php
new file mode 100644
index 000000000..062da9e54
--- /dev/null
+++ b/application/libraries/Duser/drivers/Duser_db.php
@@ -0,0 +1,79 @@
+<?php
+/*
+ * Copyright 2013 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+class Duser_db extends Duser_Driver {
+
+ /* FIXME: If you use this driver as a template, remove can_reset_password
+ * and can_register_new_users. These features require the DB driver and
+ * will NOT work with other drivers.
+ */
+ public $optional_functions = array(
+ 'can_reset_password',
+ 'can_register_new_users',
+ 'can_change_email',
+ 'can_delete_account',
+ );
+
+ public function login($username, $password)
+ {
+ $CI =& get_instance();
+
+ $query = $CI->db->select('username, id, password')
+ ->from('users')
+ ->where('username', $username)
+ ->get()->row_array();
+
+ if (empty($query)) {
+ return false;
+ }
+
+ if (password_verify($password, $query['password'])) {
+ $CI->muser->rehash_password($query['id'], $password, $query['password']);
+ return array(
+ "username" => $username,
+ "userid" => $query["id"]
+ );
+ } else {
+ return false;
+ }
+ }
+
+ public function username_exists($username)
+ {
+ $CI =& get_instance();
+
+ $query = $CI->db->select('id')
+ ->from('users')
+ ->where('username', $username)
+ ->get();
+
+ if ($query->num_rows() > 0) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ public function get_email($userid)
+ {
+ $CI =& get_instance();
+
+ $query = $CI->db->select('email')
+ ->from('users')
+ ->where('id', $userid)
+ ->get()->row_array();
+
+ if (empty($query)) {
+ throw new \exceptions\ApiException("libraries/duser/db/get_email-failed", "Failed to get email address from db");
+ }
+
+ return $query["email"];
+ }
+
+}
diff --git a/application/libraries/Duser/drivers/Duser_fluxbb.php b/application/libraries/Duser/drivers/Duser_fluxbb.php
new file mode 100644
index 000000000..1790e830b
--- /dev/null
+++ b/application/libraries/Duser/drivers/Duser_fluxbb.php
@@ -0,0 +1,53 @@
+<?php
+/*
+ * Copyright 2013 Pierre Schmitz <pierre@archlinux.de>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+class Duser_fluxbb extends Duser_Driver {
+
+ private $CI = null;
+ private $config = array();
+
+ function __construct()
+ {
+ $this->CI =& get_instance();
+ $this->config = $this->CI->config->item('auth_fluxbb');
+ }
+
+ public function login($username, $password)
+ {
+ $query = $this->CI->db->query('
+ SELECT username, id
+ FROM '.$this->config['database'].'.users
+ WHERE username = ? AND password = ?
+ ', array($username, sha1($password)))->row_array();
+
+ if (!empty($query)) {
+ return array(
+ 'username' => $query['username'],
+ 'userid' => $query['id']
+ );
+ } else {
+ return false;
+ }
+ }
+
+ public function username_exists($username)
+ {
+ $query = $this->CI->db->query('
+ SELECT id
+ FROM '.$this->config['database'].'.users
+ WHERE username = ?
+ ', array($username));
+
+ if ($query->num_rows() > 0) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+}
diff --git a/application/libraries/Duser/drivers/Duser_ldap.php b/application/libraries/Duser/drivers/Duser_ldap.php
new file mode 100644
index 000000000..9481397d0
--- /dev/null
+++ b/application/libraries/Duser/drivers/Duser_ldap.php
@@ -0,0 +1,79 @@
+<?php
+/*
+ * Copyright 2013 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ * Contributions by Hannes Rist
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+class Duser_ldap extends Duser_Driver {
+ // none supported
+ public $optional_functions = array();
+
+ // Original source: http://code.activestate.com/recipes/101525-ldap-authentication/
+ public function login($username, $password) {
+ $CI =& get_instance();
+
+ $config = $CI->config->item("auth_ldap");
+
+ if ($username == "" || $password == "") {
+ return false;
+ }
+
+ $ds = ldap_connect($config['host'],$config['port']);
+ if ($ds === false) {
+ return false;
+ }
+
+ if (isset($config['bind_rdn']) && isset($config['bind_password'])) {
+ ldap_bind($ds, $config['bind_rdn'], $config['bind_password']);
+ }
+
+ if (isset($config['filter'])) {
+ $filter = sprintf($config['filter'], $username);
+ } else {
+ $filter = $config["username_field"].'='.$username;
+ }
+
+
+ switch ($config["scope"]) {
+ case "base":
+ $r = ldap_read($ds, $config['basedn'], $filter);
+ break;
+ case "one":
+ $r = ldap_list($ds, $config['basedn'], $filter);
+ break;
+ case "subtree":
+ $r = ldap_search($ds, $config['basedn'], $filter);
+ break;
+ default:
+ throw new \exceptions\ApiException("libraries/duser/ldap/invalid-ldap-scope", "Invalid LDAP scope");
+ }
+ if ($r === false) {
+ return false;
+ }
+
+ foreach ($config["options"] as $key => $value) {
+ if (ldap_set_option($ds, $key, $value) === false) {
+ return false;
+ }
+ }
+
+ $result = ldap_get_entries($ds, $r);
+ if ($result === false || !isset($result[0])) {
+ return false;
+ }
+
+ // ignore errors from ldap_bind as it will throw an error if the password is incorrect
+ if (@ldap_bind($ds, $result[0]['dn'], $password)) {
+ ldap_unbind($ds);
+ return array(
+ "username" => $result[0][$config["username_field"]][0],
+ "userid" => $result[0][$config["userid_field"]][0]
+ );
+ }
+
+ return false;
+ }
+}
diff --git a/application/libraries/ExceptionHandler.php b/application/libraries/ExceptionHandler.php
new file mode 100644
index 000000000..75cbb5c66
--- /dev/null
+++ b/application/libraries/ExceptionHandler.php
@@ -0,0 +1,154 @@
+<?php
+/*
+ * Copyright 2015 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+namespace libraries;
+
+class ExceptionHandler {
+ static function setup()
+ {
+ set_error_handler(array("\libraries\ExceptionHandler", "error_handler"));
+ set_exception_handler(array("\libraries\ExceptionHandler", 'exception_handler'));
+ register_shutdown_function(array("\libraries\ExceptionHandler", "check_for_fatal"));
+ assert_options(ASSERT_ACTIVE, true);
+ assert_options(ASSERT_CALLBACK, array("\libraries\ExceptionHandler", '_assert_failure'));
+ }
+
+ static function error_handler($errno, $errstr, $errfile, $errline)
+ {
+ if (!(error_reporting() & $errno)) {
+ // This error code is not included in error_reporting
+ return;
+ }
+ throw new \ErrorException($errstr, 0, $errno, $errfile, $errline);
+ }
+
+ // Source: https://gist.github.com/abtris/1437966
+ static private function getExceptionTraceAsString($exception) {
+ $rtn = "";
+ $count = 0;
+ foreach ($exception->getTrace() as $frame) {
+ $args = "";
+ if (isset($frame['args'])) {
+ $args = array();
+ foreach ($frame['args'] as $arg) {
+ if (is_string($arg)) {
+ $args[] = "'" . $arg . "'";
+ } elseif (is_array($arg)) {
+ $args[] = "Array";
+ } elseif (is_null($arg)) {
+ $args[] = 'NULL';
+ } elseif (is_bool($arg)) {
+ $args[] = ($arg) ? "true" : "false";
+ } elseif (is_object($arg)) {
+ $args[] = get_class($arg);
+ } elseif (is_resource($arg)) {
+ $args[] = get_resource_type($arg);
+ } else {
+ $args[] = $arg;
+ }
+ }
+ $args = join(", ", $args);
+ }
+ $rtn .= sprintf( "#%s %s(%s): %s(%s)\n",
+ $count,
+ isset($frame['file']) ? $frame['file'] : 'unknown file',
+ isset($frame['line']) ? $frame['line'] : 'unknown line',
+ (isset($frame['class'])) ? $frame['class'].$frame['type'].$frame['function'] : $frame['function'],
+ $args );
+ $count++;
+ }
+ return $rtn;
+ }
+
+ static public function log_exception($ex)
+ {
+ $exceptions = array($ex);
+ while ($ex->getPrevious() !== null) {
+ $ex = $ex->getPrevious();
+ $exceptions[] = $ex;
+ }
+
+ foreach ($exceptions as $key => $e) {
+ $message = sprintf("Exception %d/%d '%s' with message '%s' in %s:%d\n", $key+1, count($exceptions), get_class($e), $e->getMessage(), $e->getFile(), $e->getLine());
+ if (method_exists($e, "get_error_id")) {
+ $message .= 'Error ID: '.$e->get_error_id()."\n";
+ }
+ if (method_exists($e, "get_data") && $e->get_data() !== NULL) {
+ $message .= 'Data: '.var_export($e->get_data(), true)."\n";
+ }
+ $message .= "Backtrace:\n".self::getExceptionTraceAsString($e)."\n";
+ error_log($message);
+ }
+ }
+
+ // The actual exception handler
+ static public function exception_handler($ex)
+ {
+ self::log_exception($ex);
+
+ $display_errors = in_array(strtolower(ini_get('display_errors')), array('1', 'on', 'true', 'stdout'));
+ if (php_sapi_name() === 'cli' OR defined('STDIN')) {
+ $display_errors = true;
+ }
+
+ $GLOBALS["is_error_page"] = true;
+ $heading = "Internal Server Error";
+ $message = "<p>An unhandled error occured.</p>\n";
+
+ if ($display_errors) {
+ $exceptions = array($ex);
+ while ($ex->getPrevious() !== null) {
+ $ex = $ex->getPrevious();
+ $exceptions[] = $ex;
+ }
+
+ foreach ($exceptions as $key => $e) {
+ $backtrace = self::getExceptionTraceAsString($e);
+ $message .= '<div>';
+ $message .= '<b>Exception '.($key+1).' of '.count($exceptions).'</b><br>';
+ $message .= '<b>Fatal error</b>: Uncaught exception '.htmlspecialchars(get_class($e)).'<br>';
+ $message .= '<b>Message</b>: '.htmlspecialchars($e->getMessage()).'<br>';
+ if (method_exists($e, "get_error_id")) {
+ $message .= '<b>Error ID</b>: '.htmlspecialchars($e->get_error_id()).'<br>';
+ }
+ if (method_exists($e, "get_data") && $e->get_data() !== NULL) {
+ $message .= '<b>Data</b>: <pre>'.htmlspecialchars(var_export($e->get_data(), true)).'</pre><br>';
+ }
+ $message .= '<b>Backtrace:</b><br>';
+ $message .= '<pre>'.htmlspecialchars(str_replace(FCPATH, "./", $backtrace)).'</pre>';
+ $message .= 'thrown in <b>'.htmlspecialchars($e->getFile()).'</b> on line <b>'.htmlspecialchars($e->getLine()).'</b><br>';
+ $message .= '</div>';
+ }
+ } else {
+ $message .="<p>More information can be found in the php error log or by enabling display_errors.</p>";
+ }
+
+ $message = "$message";
+ include VIEWPATH."/errors/html/error_general.php";
+ }
+
+ /**
+ * Checks for a fatal error, work around for set_error_handler not working on fatal errors.
+ */
+ static public function check_for_fatal()
+ {
+ $error = error_get_last();
+ if (isset($error) && $error["type"] == E_ERROR) {
+ self::exception_handler(new \ErrorException(
+ $error["message"], 0, $error["type"], $error["file"], $error["line"]));
+ }
+ }
+
+ static public function assert_failure($file, $line, $expr, $message = "")
+ {
+ self::exception_handler(new Exception("assert($expr): Assertion failed in $file at line $line".($message != "" ? " with message: '$message'" : "")));
+ exit(1);
+ }
+
+}
diff --git a/application/libraries/Exif.php b/application/libraries/Exif.php
new file mode 100644
index 000000000..27dd11a65
--- /dev/null
+++ b/application/libraries/Exif.php
@@ -0,0 +1,37 @@
+<?php
+/*
+ * Copyright 2014-2015 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+namespace libraries;
+
+class Exif {
+ static public function get_exif($file)
+ {
+ // TODO: support more types (identify or exiftool? might be slow :( )
+ try {
+ $type = getimagesize($file)[2];
+ } catch (\ErrorException $e) {
+ return false;
+ }
+ switch ($type) {
+ case IMAGETYPE_JPEG:
+ getimagesize($file, $info);
+ if (isset($info["APP1"]) && strpos($info["APP1"], "http://ns.adobe.com/xap/1.0/") === 0) {
+ // ignore XMP data which makes exif_read_data throw a warning
+ // http://stackoverflow.com/a/8864064
+ return false;
+ }
+ return @exif_read_data($file);
+ break;
+ default:
+ }
+
+ return false;
+ }
+
+}
diff --git a/application/libraries/Image.php b/application/libraries/Image.php
new file mode 100644
index 000000000..18814e181
--- /dev/null
+++ b/application/libraries/Image.php
@@ -0,0 +1,236 @@
+<?php
+/*
+ * Copyright 2014-2015 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+namespace libraries\Image;
+
+interface ImageDriver {
+ /**
+ * Replace the current image by reading in a file
+ * @param file file to read
+ */
+ public function read($file);
+
+ /**
+ * Return the current image rendered to a specific format. Passing null as
+ * the target_type returns the image in the format of the source image
+ * (loaded with read()).
+ *
+ * @param target_type one of IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG or null
+ * @return binary image data
+ */
+ public function get($target_type);
+
+ /**
+ * Resize the image.
+ * @param width
+ * @param height
+ */
+ public function resize($width, $height);
+
+ /**
+ * Crop the image to the area defined by x, y, width and height.
+ *
+ * @param x starting coordinate
+ * @param y starting coordinate
+ * @param width width of the area
+ * @param height height of the area
+ */
+ public function crop($x, $y, $width, $height);
+
+ /**
+ * Crop/resize the image to fit into the desired size. This also rotates
+ * the image if the source image had an EXIF orientation tag.
+ *
+ * @param width width of the resulting image
+ * @param height height of the resulting image
+ */
+ public function makeThumb($target_width, $target_height);
+
+ /**
+ * Rotate the image according to the sources EXIF orientation tag if any.
+ */
+ public function apply_exif_orientation();
+
+ /**
+ * Mirror the image along the x axis.
+ */
+ public function mirror();
+
+ /**
+ * Return priority for this driver. Higher number means a higher priority.
+ *
+ * @param mimetype mimetype of the file
+ * @return > 0 if supported, < 0 if the mimetype can't be handled
+ */
+ public static function get_priority($mimetype);
+}
+
+namespace libraries;
+
+/**
+ * This class deals with a single image and provides useful operations that
+ * operate on this image.
+ */
+class Image {
+ private $driver;
+
+ private static function get_image_drivers()
+ {
+ return array(
+ "libraries\Image\Drivers\GD",
+ "libraries\Image\Drivers\imagemagick",
+ );
+ }
+
+ /**
+ * Create a new object and load the contents of file.
+ * @param file file to read
+ */
+ public function __construct($file)
+ {
+ $this->read($file);
+ }
+
+ /**
+ * Get the best driver supporting $mimetype.
+ *
+ * @param drivers list of driver classes
+ * @param mimetype mimetype the driver should support
+ * @return driver from $drivers or NULL if no driver supports the type
+ */
+ private static function best_driver($drivers, $mimetype)
+ {
+ $best = 0;
+ $best_driver = null;
+ foreach ($drivers as $driver) {
+ $current = $driver::get_priority($mimetype);
+ if ($current > $best && $current > 0) {
+ $best_driver = $driver;
+ $best = $current;
+ }
+ }
+
+ if ($best_driver === NULL) {
+ throw new \exceptions\PublicApiException("libraries/Image/unsupported-image-type", "Unsupported image type");
+ }
+
+ return $best_driver;
+ }
+
+ /**
+ * Check if a mimetype is supported by the image library.
+ *
+ * @param mimetype
+ * @return true if supported, false otherwise
+ */
+ public static function type_supported($mimetype)
+ {
+ static $cache = array();
+ if (isset($cache[$mimetype])) {
+ return $cache[$mimetype];
+ }
+
+ try {
+ $driver = self::best_driver(self::get_image_drivers(), $mimetype);
+ $cache[$mimetype] = true;
+ } catch (\exceptions\ApiException $e) {
+ if ($e->get_error_id() == "libraries/Image/unsupported-image-type") {
+ $cache[$mimetype] = false;
+ } else {
+ throw $e;
+ }
+ }
+ return $cache[$mimetype];
+ }
+
+ /**
+ * Replace the current image by reading in a file
+ * @param file file to read
+ */
+ public function read($file)
+ {
+ $mimetype = mimetype($file);
+ $driver = self::best_driver(self::get_image_drivers(), $mimetype);
+ $this->driver = new $driver($file);
+ }
+
+ /**
+ * Return the current image rendered to a specific format. Passing null as
+ * the target_type returns the image in the format of the source image
+ * (loaded with read()).
+ *
+ * @param target_type one of IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG or null
+ * @return binary image data
+ */
+ public function get($target_type = null)
+ {
+ return $this->driver->get($target_type);
+ }
+
+ /**
+ * Resize the image.
+ * @param width
+ * @param height
+ */
+ public function resize($width, $height)
+ {
+ return $this->driver->resize($width, $height);
+ }
+
+ /**
+ * Crop the image to the area defined by x, y, width and height.
+ *
+ * @param x starting coordinate
+ * @param y starting coordinate
+ * @param width width of the area
+ * @param height height of the area
+ */
+ public function crop($x, $y, $width, $height)
+ {
+ return $this->driver->crop($x, $y, $width, $height);
+ }
+
+ /**
+ * Crop/resize the image to fit into the desired size. This also rotates
+ * the image if the source image had an EXIF orientation tag.
+ *
+ * @param width width of the resulting image
+ * @param height height of the resulting image
+ */
+ public function makeThumb($target_width, $target_height)
+ {
+ return $this->driver->makeThumb($target_width, $target_height);
+ }
+
+ static public function get_exif_orientation($file)
+ {
+ $exif = \libraries\Exif::get_exif($file);
+ if (isset($exif["Orientation"])) {
+ return $exif["Orientation"];
+ }
+ return 0;
+ }
+
+ /**
+ * Rotate the image according to the sources EXIF orientation tag if any.
+ */
+ public function apply_exif_orientation()
+ {
+ return $this->driver->apply_exif_orientation();
+ }
+
+ /**
+ * Mirror the image along the x axis.
+ */
+ public function mirror()
+ {
+ return $this->driver->mirror();
+ }
+
+}
diff --git a/application/libraries/Image/Drivers/GD.php b/application/libraries/Image/Drivers/GD.php
new file mode 100644
index 000000000..e2e0a99be
--- /dev/null
+++ b/application/libraries/Image/Drivers/GD.php
@@ -0,0 +1,217 @@
+<?php
+/*
+ * Copyright 2014-2015 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+namespace libraries\Image\Drivers;
+
+class GD implements \libraries\Image\ImageDriver {
+ private $img;
+ private $source_type;
+ private $exif;
+
+ public static function get_priority($mimetype)
+ {
+ switch($mimetype) {
+ case "image/jpeg":
+ case "image/png":
+ case "image/gif":
+ return 1000;
+ break;
+ default:
+ return -1;
+ break;
+ }
+ }
+
+ /**
+ * Create a new object and load the contents of file.
+ * @param file file to read
+ */
+ public function __construct($file)
+ {
+ $this->read($file);
+ }
+
+ public function read($file)
+ {
+ $img = imagecreatefromstring(file_get_contents($file));
+ if ($img === false) {
+ throw new \exceptions\ApiException("libraries/Image/unsupported-image-type", "Unsupported image type");
+ }
+ $this->set_img_object($img);
+ $this->fix_alpha();
+
+ $this->source_type = getimagesize($file)[2];
+ $this->exif = \libraries\Exif::get_exif($file);
+ }
+
+ public function get($target_type = null)
+ {
+ if ($target_type === null) {
+ $target_type = $this->source_type;
+ }
+
+ ob_start();
+ switch ($target_type) {
+ case IMAGETYPE_GIF:
+ $ret = imagegif($this->img);
+ break;
+ case IMAGETYPE_JPEG:
+ $ret = imagejpeg($this->img);
+ break;
+ case IMAGETYPE_PNG:
+ $ret = imagepng($this->img);
+ break;
+ default:
+ assert(0);
+ }
+ $result = ob_get_clean();
+
+ if (!$ret || $result === false) {
+ throw new \exceptions\ApiException("libraries/Image/thumbnail-creation-failed", "Failed to create thumbnail");
+ }
+
+ return $result;
+ }
+
+ public function resize($width, $height)
+ {
+ $temp_gdim = imagecreatetruecolor($width, $height);
+ $this->fix_alpha();
+ imagecopyresampled(
+ $temp_gdim,
+ $this->img,
+ 0, 0,
+ 0, 0,
+ $width, $height,
+ imagesx($this->img), imagesy($this->img)
+ );
+
+ $this->set_img_object($temp_gdim);
+ }
+
+ public function crop($x, $y, $width, $height)
+ {
+ $thumb = imagecreatetruecolor($width, $height);
+ $this->fix_alpha();
+ imagecopy(
+ $thumb,
+ $this->img,
+ 0, 0,
+ $x, $y,
+ $width, $height
+ );
+
+ $this->set_img_object($thumb);
+ }
+
+ // Source: http://salman-w.blogspot.co.at/2009/04/crop-to-fit-image-using-aspphp.html
+ public function makeThumb($target_width, $target_height)
+ {
+ $source_aspect_ratio = imagesx($this->img) / imagesy($this->img);
+ $desired_aspect_ratio = $target_width / $target_height;
+
+ if ($source_aspect_ratio > $desired_aspect_ratio) {
+ // Triggered when source image is wider
+ $temp_height = $target_height;
+ $temp_width = round(($target_height * $source_aspect_ratio));
+ } else {
+ // Triggered otherwise (i.e. source image is similar or taller)
+ $temp_width = $target_width;
+ $temp_height = round(($target_width / $source_aspect_ratio));
+ }
+
+ $this->resize($temp_width, $temp_height);
+
+ $x0 = ($temp_width - $target_width) / 2;
+ $y0 = ($temp_height - $target_height) / 2;
+ $this->crop($x0, $y0, $target_width, $target_height);
+
+ $this->apply_exif_orientation();
+ }
+
+ public function apply_exif_orientation()
+ {
+ if (isset($this->exif['Orientation'])) {
+ $mirror = false;
+ $deg = 0;
+
+ switch ($this->exif['Orientation']) {
+ case 2:
+ $mirror = true;
+ break;
+ case 3:
+ $deg = 180;
+ break;
+ case 4:
+ $deg = 180;
+ $mirror = true;
+ break;
+ case 5:
+ $deg = 270;
+ $mirror = true;
+ break;
+ case 6:
+ $deg = 270;
+ break;
+ case 7:
+ $deg = 90;
+ $mirror = true;
+ break;
+ case 8:
+ $deg = 90;
+ break;
+ }
+
+ if ($deg) {
+ $this->set_img_object(imagerotate($this->img, $deg, 0));
+ }
+
+ if ($mirror) {
+ $this->mirror();
+ }
+ }
+ }
+
+ public function mirror()
+ {
+ $width = imagesx($this->img);
+ $height = imagesy($this->img);
+
+ $src_x = $width -1;
+ $src_y = 0;
+ $src_width = -$width;
+ $src_height = $height;
+
+ $imgdest = imagecreatetruecolor($width, $height);
+ imagealphablending($imgdest,false);
+ imagesavealpha($imgdest,true);
+
+ imagecopyresampled($imgdest, $this->img, 0, 0, $src_x, $src_y, $width, $height, $src_width, $src_height);
+ $this->set_img_object($imgdest);
+ }
+
+ private function set_img_object($new)
+ {
+ assert($new !== false);
+
+ $old = $this->img;
+ $this->img = $new;
+
+ if ($old != null) {
+ imagedestroy($old);
+ }
+ }
+
+ private function fix_alpha()
+ {
+ imagealphablending($this->img,false);
+ imagesavealpha($this->img,true);
+ }
+
+}
diff --git a/application/libraries/Image/Drivers/imagemagick.php b/application/libraries/Image/Drivers/imagemagick.php
new file mode 100644
index 000000000..33e62ffe4
--- /dev/null
+++ b/application/libraries/Image/Drivers/imagemagick.php
@@ -0,0 +1,120 @@
+<?php
+/*
+ * Copyright 2015 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+namespace libraries\Image\Drivers;
+
+class imagemagick implements \libraries\Image\ImageDriver {
+ private $source_file;
+ private $arguments = array();
+
+ public static function get_priority($mimetype)
+ {
+ $mimetype = $mimetype;
+ $base = explode("/", $mimetype)[0];
+
+ if ($base == "image") {
+ return 100;
+ }
+
+ return -1;
+ }
+
+ /**
+ * Create a new object and load the contents of file.
+ * @param file file to read
+ */
+ public function __construct($file)
+ {
+ $this->read($file);
+ }
+
+ public function read($file)
+ {
+ if (!file_exists($file)) {
+ throw new \exceptions\ApiException("libraries/Image/drivers/imagemagick/missing-file", "Source file doesn't exist");
+ }
+
+ $this->source_file = $file;
+ $this->arguments = array();
+ }
+
+ public function get($target_type = null)
+ {
+ if ($target_type === null) {
+ return file_get_contents($this->source_file);
+ }
+
+ $command = array("convert");
+ $command = array_merge($command, $this->arguments);
+ $command[] = $this->source_file."[0]";
+
+ switch ($target_type) {
+ case IMAGETYPE_GIF:
+ $command[] = "gif:-";
+ break;
+ case IMAGETYPE_JPEG:
+ $command[] = "jpeg:-";
+ break;
+ case IMAGETYPE_PNG:
+ $command[] = "png:-";
+ break;
+ default:
+ assert(0);
+ }
+
+ try {
+ $ret = (new \libraries\ProcRunner($command))->forbid_nonzero()->exec();
+ } catch (\exceptions\ApiException $e) {
+ throw new \exceptions\ApiException("libraries/Image/thumbnail-creation-failed", "Failed to create thumbnail", null, $e);
+ }
+
+ return $ret["stdout"];
+ }
+
+ public function resize($width, $height)
+ {
+ $this->arguments[] = "-resize";
+ $this->arguments[] = "${width}x${height}";
+ }
+
+ public function crop($x, $y, $width, $height)
+ {
+ $this->arguments[] = "+repage";
+ $this->arguments[] = "-crop";
+ $this->arguments[] = "${width}x${height}+${x}+${y}";
+ $this->arguments[] = "+repage";
+ }
+
+ // Source: http://salman-w.blogspot.co.at/2009/04/crop-to-fit-image-using-aspphp.html
+ public function makeThumb($target_width, $target_height)
+ {
+ assert(is_int($target_width));
+ assert(is_int($target_height));
+
+ $this->apply_exif_orientation();
+
+ $this->arguments[] = "-thumbnail";
+ $this->arguments[] = "${target_width}x${target_height}^";
+ $this->arguments[] = "-gravity";
+ $this->arguments[] = "center";
+ $this->arguments[] = "-extent";
+ $this->arguments[] = "${target_width}x${target_height}^";
+ }
+
+ public function apply_exif_orientation()
+ {
+ $this->arguments[] = "-auto-orient";
+ }
+
+ public function mirror()
+ {
+ $this->arguments[] = "-flip";
+ }
+
+}
diff --git a/application/libraries/MY_Session.php b/application/libraries/MY_Session.php
new file mode 100644
index 000000000..0443bca31
--- /dev/null
+++ b/application/libraries/MY_Session.php
@@ -0,0 +1,38 @@
+<?php
+/*
+ * Copyright 2013 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+class MY_Session extends CI_Session {
+ private $memory_only = false;
+
+ public function __construct() {
+ $CI =& get_instance();
+ $CI->load->helper("filebin");
+
+ /* Clients using API keys do not need a persistent session since API keys
+ * should be sent with each request. This reduces database queries and
+ * prevents us from sending useless cookies.
+ */
+ if (!stateful_client()) {
+ $this->memory_only = true;
+ $CI->config->set_item("sess_use_database", false);
+ }
+
+ parent::__construct();
+ }
+
+ public function _set_cookie($cookie_data = NULL)
+ {
+ if ($this->memory_only) {
+ return;
+ }
+
+ parent::_set_cookie($cookie_data);
+
+ }
+}
diff --git a/application/libraries/Output_cache.php b/application/libraries/Output_cache.php
new file mode 100644
index 000000000..1d8339887
--- /dev/null
+++ b/application/libraries/Output_cache.php
@@ -0,0 +1,82 @@
+<?php
+/*
+ * Copyright 2014,2016 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+namespace libraries;
+
+class Output_cache {
+ private $output_cache = array();
+
+ /**
+ * Combine multiple objects for the same view into one
+ * @param data data to pass to the view
+ * @param view view path
+ */
+ public function add_merge($data, $view)
+ {
+ assert($view !== NULL);
+
+ // combine multiple objects for the same view into one
+ $count = count($this->output_cache);
+ if ($count > 0 && $this->output_cache[$count - 1]["view"] === $view) {
+ $this->output_cache[$count - 1]["data"] = array_merge_recursive($this->output_cache[$count - 1]["data"], $data);
+ } else {
+ $this->add($data, $view);
+ }
+ }
+
+ /**
+ * Add some data that will be output directly if view is NULL or passed
+ * to the view otherweise.
+ *
+ * @param data data to pass to view or output
+ * @param view view path or NULL
+ */
+ public function add($data, $view = NULL)
+ {
+ $this->output_cache[] = array(
+ "view" => $view,
+ "data" => $data,
+ );
+ }
+
+ /**
+ * Add a function that will be excuted when render() is called.
+ * This function is supposed to use render_now() to output data.
+ *
+ * @param data_function
+ */
+ public function add_function($data_function)
+ {
+ $this->output_cache[] = array(
+ "view" => NULL,
+ "data_function" => $data_function,
+ );
+ }
+
+ public function render_now($data, $view = NULL)
+ {
+ if ($view !== NULL) {
+ echo get_instance()->load->view($view, $data, true);
+ } else {
+ echo $data;
+ }
+ }
+
+ public function render()
+ {
+ while ($output = array_shift($this->output_cache)) {
+ if (isset($output["data_function"])) {
+ $output["data_function"]();
+ } else {
+ $data = $output["data"];
+ $this->render_now($data, $output["view"]);
+ }
+ }
+ }
+}
diff --git a/application/libraries/ProcRunner.php b/application/libraries/ProcRunner.php
new file mode 100644
index 000000000..6aaaa1f20
--- /dev/null
+++ b/application/libraries/ProcRunner.php
@@ -0,0 +1,129 @@
+<?php
+/*
+ * Copyright 2015 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+namespace libraries;
+
+class ProcRunner {
+ private $cmd;
+ private $input = NULL;
+ private $forbid_nonzero = false;
+ private $forbid_stderr = false;
+
+ /**
+ * This function automatically escapes all parameters before executing the command.
+ *
+ * @param cmd array with the command and it's arguments
+ */
+ function __construct($cmd)
+ {
+ assert(is_array($cmd));
+ $this->cmd = implode(" ", array_map('escapeshellarg', $cmd));
+ }
+
+ /**
+ * Set stdin. You will have to set this to NULL if you call exec() a second
+ * time and don't want stdin to be sent again
+ *
+ * @param input string to send via stdin
+ */
+ function input($input)
+ {
+ $this->input = $input;
+ return $this;
+ }
+
+ function forbid_nonzero()
+ {
+ $this->forbid_nonzero = true;
+ return $this;
+ }
+
+
+ function forbid_stderr()
+ {
+ $this->forbid_stderr = true;
+ return $this;
+ }
+
+ /**
+ * Run the command.
+ *
+ * @return array with keys return_code, stdout, stderr
+ */
+ function exec()
+ {
+ $descriptorspec = array(
+ 1 => array('pipe', 'w'),
+ 2 => array('pipe', 'w'),
+ );
+
+ if ($this->input !== NULL) {
+ $descriptorspec[0] = array('pipe', 'r');
+ }
+
+ $proc = proc_open($this->cmd, $descriptorspec, $pipes);
+
+ if ($proc === false) {
+ throw new \exceptions\ApiException('procrunner/proc_open-failed',
+ 'Failed to run process',
+ array($this->cmd, $this->input)
+ );
+ }
+
+ if ($this->input !== NULL) {
+ fwrite($pipes[0], $this->input);
+ fclose($pipes[0]);
+ }
+
+ $stdout = stream_get_contents($pipes[1]);
+ fclose($pipes[1]);
+ assert($stdout !== false);
+
+ $stderr = stream_get_contents($pipes[2]);
+ fclose($pipes[2]);
+ assert($stderr !== false);
+
+ $return_code = proc_close($proc);
+
+ $ret = array(
+ "return_code" => $return_code,
+ "stdout" => $stdout,
+ "stderr" => $stderr,
+ );
+
+ if ($this->forbid_nonzero && $return_code !== 0) {
+ throw new \exceptions\ApiException('procrunner/non-zero-exit',
+ 'Process exited with a non-zero status',
+ array($this->cmd, $this->input, $ret)
+ );
+ }
+
+ if ($this->forbid_stderr && $stderr !== "") {
+ throw new \exceptions\ApiException('procrunner/stderr',
+ 'Output on stderr not allowed but received',
+ array($this->cmd, $this->input, $ret)
+ );
+ }
+
+ return $ret;
+ }
+
+ /**
+ * Run the command and enable some sanity checks such as empty stderr and
+ * zero exit status. Might enable more in the future.
+ *
+ * @See exec
+ */
+ function execSafe()
+ {
+ $this->forbid_stderr();
+ $this->forbid_nonzero();
+ return $this->exec();
+ }
+}
diff --git a/application/libraries/Pygments.php b/application/libraries/Pygments.php
new file mode 100644
index 000000000..6f51cc9e7
--- /dev/null
+++ b/application/libraries/Pygments.php
@@ -0,0 +1,254 @@
+<?php
+/*
+ * Copyright 2015 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+namespace libraries;
+
+class Pygments {
+ private $file;
+ private $mimetype;
+ private $filename;
+
+ public function __construct($file, $mimetype, $filename) {
+ $this->file = $file;
+ $this->mimetype = $mimetype;
+ $this->filename = $filename;
+ }
+
+ private static function get_pygments_info() {
+ return cache_function_full('pygments_info-v2', 1800, function() {
+ $r = (new \libraries\ProcRunner(array(FCPATH."scripts/get_lexer_list.py")))->execSafe();
+
+ $ret = json_decode($r["stdout"], true);
+ if ($ret === NULL) {
+ throw new \exceptions\ApiException('pygments/json-failed', "Failed to decode JSON", $r);
+ }
+
+ return $ret;
+ });
+ }
+
+ public static function get_lexers() {
+ return cache_function('lexers-v2', 1800, function() {
+ $last_desc = "";
+
+ foreach (self::get_pygments_info() as $lexer) {
+ if (empty($lexer['names'])) {
+ continue;
+ }
+ $desc = $lexer['fullname'];
+ $name = $lexer['names'][0];
+ if ($desc == $last_desc) {
+ continue;
+ }
+ $last_desc = $desc;
+ $lexers[$name] = $desc;
+ }
+ $lexers["text"] = "Plain text";
+ return $lexers;
+ });
+ }
+
+ // Allow certain types to be highlight without doing it automatically
+ public function should_highlight()
+ {
+ $typearray = array(
+ 'image/svg+xml',
+ );
+ if (in_array($this->mimetype, $typearray)) return false;
+
+ if ($this->mime2lexer($this->mimetype)) return true;
+
+ return false;
+ }
+
+ public function can_highlight()
+ {
+ if ($this->mime2lexer($this->mimetype)) return true;
+
+ return false;
+ }
+
+ // Return the lexer that should be used for highlighting
+ public function autodetect_lexer()
+ {
+ if (!$this->should_highlight()) {
+ return false;
+ }
+
+ $lexer = $this->mime2lexer($this->mimetype);
+
+ // filename lexers overwrite mime type mappings
+ $filename_lexer = $this->filename2lexer();
+ if ($filename_lexer) {
+ return $filename_lexer;
+ }
+
+ return $lexer;
+ }
+
+ // Map MIME types to lexers needed for highlighting
+ private function mime2lexer()
+ {
+ $typearray = array(
+ 'application/javascript' => 'javascript',
+ 'application/mbox' => 'text',
+ 'application/postscript' => 'postscript',
+ 'application/smil' => 'ocaml',
+ 'application/x-applix-spreadsheet' => 'actionscript',
+ 'application/x-awk' => 'awk',
+ 'application/x-desktop' => 'text',
+ 'application/x-fluid' => 'text',
+ 'application/x-genesis-rom' => 'text',
+ 'application/x-java' => 'java',
+ 'application/x-m4' => 'text',
+ 'application/xml-dtd' => "xml",
+ 'application/xml' => 'xml',
+ 'application/x-perl' => 'perl',
+ 'application/x-php' => 'php',
+ 'application/x-ruby' => 'ruby',
+ 'application/x-shellscript' => 'bash',
+ 'application/xslt+xml' => "xml",
+ 'application/x-x509-ca-cert' => 'text',
+ 'message/rfc822' => 'text',
+ 'text/css' => 'css',
+ 'text/html' => 'xml',
+ 'text/plain-ascii' => 'ascii',
+ 'text/plain' => 'text',
+ 'text/troff' => 'groff',
+ 'text/x-asm' => 'nasm',
+ 'text/x-awk' => 'awk',
+ 'text/x-c' => 'c',
+ 'text/x-c++' => 'cpp',
+ 'text/x-c++hdr' => 'c',
+ 'text/x-chdr' => 'c',
+ 'text/x-csrc' => 'c',
+ 'text/x-c++src' => 'cpp',
+ 'text/x-diff' => 'diff',
+ 'text/x-gawk' => 'awk',
+ 'text/x-haskell' => 'haskell',
+ 'text/x-java' => 'java',
+ 'text/x-lisp' => 'cl',
+ 'text/x-literate-haskell' => 'haskell',
+ 'text/x-lua' => 'lua',
+ 'text/x-makefile' => 'make',
+ 'text/x-ocaml' => 'ocaml',
+ 'text/x-patch' => 'diff',
+ 'text/x-perl' => 'perl',
+ 'text/x-php' => 'php',
+ 'text/x-python' => 'python',
+ 'text/x-ruby' => 'ruby',
+ 'text/x-scheme' => 'scheme',
+ 'text/x-shellscript' => 'bash',
+ 'text/x-subviewer' => 'bash',
+ 'text/x-tcl' => 'tcl',
+ 'text/x-tex' => 'tex',
+ );
+ if (array_key_exists($this->mimetype, $typearray)) return $typearray[$this->mimetype];
+
+ // fall back to pygments own list if not found in our list
+ foreach (self::get_pygments_info() as $lexer) {
+ if (isset($lexer['mimetypes'][$this->mimetype])) {
+ return $lexer['names'][0];
+ }
+ }
+
+ if (strpos($this->mimetype, 'text/') === 0) return 'text';
+
+ # default
+ return false;
+ }
+
+ // Map special filenames to lexers
+ private function filename2lexer()
+ {
+ $namearray = array(
+ 'asciinema.json' => 'asciinema',
+ 'PKGBUILD' => 'bash',
+ '.vimrc' => 'vim'
+ );
+ if (array_key_exists($this->filename, $namearray)) return $namearray[$this->filename];
+
+ $longextarray = array(
+ '.asciinema.json' => 'asciinema',
+ );
+ foreach ($longextarray as $key => $lexer) {
+ if (substr($this->filename, -strlen($key)) === $key) {
+ return $lexer;
+ }
+ }
+
+ if (strpos($this->filename, ".") !== false) {
+ $extension = substr($this->filename, strrpos($this->filename, ".") + 1);
+ if ($extension === false) {
+ return false;
+ }
+
+ $extensionarray = array(
+ 'awk' => 'awk',
+ 'cast' => 'asciinema',
+ 'c' => 'c',
+ 'coffee' => 'coffee-script',
+ 'cpp' => 'cpp',
+ 'cr' => 'crystal',
+ 'diff' => 'diff',
+ 'go' => 'go',
+ 'haml' => 'haml',
+ 'h' => 'c',
+ 'hs' => 'haskell',
+ 'html' => 'xml',
+ 'java' => 'java',
+ 'js' => 'js',
+ 'json' => 'json',
+ 'lhs' => 'lhs',
+ 'lua' => 'lua',
+ 'mli' => 'ocaml',
+ 'mll' => 'ocaml',
+ 'ml' => 'ocaml',
+ 'mly' => 'ocaml',
+ 'mysql' => 'mysql',
+ 'patch' => 'diff',
+ 'pgsql' => 'postgresql',
+ 'php' => 'php',
+ 'pl' => 'perl',
+ 'plpgsql' => 'plpgsql',
+ 'pm' => 'perl',
+ 'postgresql' => 'postgresql',
+ 'pp' => 'puppet',
+ 'py' => 'python',
+ 'rb' => 'ruby',
+ 'rs' => 'rust',
+ 's' => 'asm',
+ 'sh' => 'bash',
+ 'sql' => 'sql',
+ 'tcl' => 'tcl',
+ 'tex' => 'tex',
+ 'yml' => 'yaml',
+ );
+ if (array_key_exists($extension, $extensionarray)) return $extensionarray[$extension];
+ }
+
+ return false;
+ }
+
+ // Handle lexer aliases
+ public function resolve_lexer_alias($alias)
+ {
+ if ($alias === false) return false;
+ $aliasarray = array(
+ 'py' => 'python',
+ 'sh' => 'bash',
+ 's' => 'asm',
+ 'pl' => 'perl'
+ );
+ if (array_key_exists($alias, $aliasarray)) return $aliasarray[$alias];
+
+ return $alias;
+ }
+
+}
diff --git a/application/libraries/Tempfile.php b/application/libraries/Tempfile.php
new file mode 100644
index 000000000..f42efbfdf
--- /dev/null
+++ b/application/libraries/Tempfile.php
@@ -0,0 +1,31 @@
+<?php
+/*
+ * Copyright 2015 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+namespace libraries;
+
+class Tempfile {
+ private $file;
+
+ public function __construct()
+ {
+ $this->file = tempnam(sys_get_temp_dir(), "tempfile");
+ }
+
+ public function __destruct()
+ {
+ if (file_exists($this->file)) {
+ unlink($this->file);
+ }
+ }
+
+ public function get_file()
+ {
+ return $this->file;
+ }
+}
diff --git a/application/migrations/001_add_files.php b/application/migrations/001_add_files.php
new file mode 100644
index 000000000..7b1398e1c
--- /dev/null
+++ b/application/migrations/001_add_files.php
@@ -0,0 +1,45 @@
+<?php
+defined('BASEPATH') OR exit('No direct script access allowed');
+
+class Migration_Add_files extends CI_Migration {
+
+ public function up()
+ {
+ $prefix = $this->db->dbprefix;
+
+ if ($this->db->dbdriver == 'postgre') {
+ $this->db->query('
+ CREATE TABLE IF NOT EXISTS "'.$prefix.'files" (
+ "hash" varchar(32) NOT NULL,
+ "id" varchar(6) NOT NULL,
+ "filename" varchar(256) NOT NULL,
+ "password" varchar(40) DEFAULT NULL,
+ "date" integer NOT NULL,
+ "mimetype" varchar(255) NOT NULL,
+ PRIMARY KEY ("id")
+ );
+ CREATE INDEX "'.$prefix.'files_date_idx" ON '.$prefix.'files ("date");
+ CREATE INDEX "'.$prefix.'files_hash_id_idx" ON '.$prefix.'files ("hash", "id");
+ ');
+ } else {
+ $this->db->query('
+ CREATE TABLE IF NOT EXISTS `'.$prefix.'files` (
+ `hash` varchar(32) CHARACTER SET ascii NOT NULL,
+ `id` varchar(6) CHARACTER SET ascii COLLATE ascii_bin NOT NULL,
+ `filename` varchar(256) COLLATE utf8_bin NOT NULL,
+ `password` varchar(40) CHARACTER SET ascii COLLATE ascii_bin DEFAULT NULL,
+ `date` int(11) unsigned NOT NULL,
+ `mimetype` varchar(255) CHARACTER SET ascii NOT NULL,
+ PRIMARY KEY (`id`),
+ KEY `date` (`date`),
+ KEY `hash` (`hash`,`id`)
+ ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
+ ');
+ }
+ }
+
+ public function down()
+ {
+ $this->dbforge->drop_table('files');
+ }
+}
diff --git a/application/migrations/002_add_users.php b/application/migrations/002_add_users.php
new file mode 100644
index 000000000..454618e48
--- /dev/null
+++ b/application/migrations/002_add_users.php
@@ -0,0 +1,79 @@
+<?php
+defined('BASEPATH') OR exit('No direct script access allowed');
+
+class Migration_Add_users extends CI_Migration {
+
+ public function up()
+ {
+ $prefix = $this->db->dbprefix;
+
+ if ($this->db->dbdriver == 'postgre') {
+ $this->db->query('
+ CREATE TABLE IF NOT EXISTS "'.$prefix.'users" (
+ "id" serial PRIMARY KEY,
+ "username" character varying(32) NOT NULL,
+ "password" character varying(60) NOT NULL,
+ "email" character varying(255) NOT NULL
+ )
+ ');
+
+ $this->db->query('
+ CREATE TABLE IF NOT EXISTS "'.$prefix.'ci_sessions" (
+ "session_id" character varying(40) NOT NULL DEFAULT 0,
+ "ip_address" character varying(16) NOT NULL DEFAULT 0,
+ "user_agent" character varying(120) NOT NULL,
+ "last_activity" integer NOT NULL DEFAULT 0,
+ "user_data" text NOT NULL,
+ PRIMARY KEY ("session_id")
+ );
+ CREATE INDEX "'.$prefix.'ci_sessions_last_activity_idx" ON "'.$prefix.'ci_sessions" ("last_activity");
+ ');
+
+ $this->db->query('
+ ALTER TABLE "'.$prefix.'files" ADD "user" integer NOT NULL DEFAULT 0;
+ CREATE INDEX "'.$prefix.'user_idx" ON "'.$prefix.'files" ("user");
+ ');
+
+ } else {
+
+ $this->db->query('
+ CREATE TABLE IF NOT EXISTS `'.$prefix.'users` (
+ `id` int(8) UNSIGNED NOT NULL AUTO_INCREMENT,
+ `username` varchar(32) COLLATE ascii_general_ci NOT NULL,
+ `password` varchar(60) COLLATE ascii_general_ci NOT NULL,
+ `email` varchar(255) COLLATE ascii_general_ci NOT NULL,
+ PRIMARY KEY (`id`)
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+ ');
+
+ $this->db->query('
+ CREATE TABLE IF NOT EXISTS `'.$prefix.'ci_sessions` (
+ `session_id` varchar(40) NOT NULL DEFAULT 0,
+ `ip_address` varchar(16) NOT NULL DEFAULT 0,
+ `user_agent` varchar(120) NOT NULL,
+ `last_activity` int(10) unsigned NOT NULL DEFAULT 0,
+ `user_data` text NOT NULL,
+ PRIMARY KEY (`session_id`),
+ KEY `last_activity_idx` (`last_activity`)
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+ ');
+
+ $this->db->query('
+ ALTER TABLE `'.$prefix.'files`
+ ADD `user` INT(8) UNSIGNED NOT NULL DEFAULT 0,
+ ADD INDEX (`user`)
+ ');
+ }
+ }
+
+ public function down()
+ {
+ $this->dbforge->drop_table('users');
+ $this->dbforge->drop_table('ci_sessions');
+ if ($this->db->dbdriver == 'postgre') {
+ $this->db->query('ALTER TABLE "'.$prefix.'files" DROP "user"');
+ } else {
+ $this->db->query('ALTER TABLE `'.$prefix.'files` DROP `user`');
+ }
+ }
+}
diff --git a/application/migrations/003_add_referrers.php b/application/migrations/003_add_referrers.php
new file mode 100644
index 000000000..e6da1c0dd
--- /dev/null
+++ b/application/migrations/003_add_referrers.php
@@ -0,0 +1,61 @@
+<?php
+defined('BASEPATH') OR exit('No direct script access allowed');
+
+class Migration_Add_referrers extends CI_Migration {
+
+ public function up()
+ {
+ $prefix = $this->db->dbprefix;
+
+ if ($this->db->dbdriver == 'postgre') {
+ $this->db->query('
+ CREATE TABLE "'.$prefix.'invitations" (
+ "user" integer NOT NULL,
+ "key" character varying(16) NOT NULL,
+ "date" integer NOT NULL,
+ PRIMARY KEY ("key")
+ );
+ CREATE INDEX "'.$prefix.'invitations_user_idx" ON "'.$prefix.'invitations" ("user");
+ CREATE INDEX "'.$prefix.'invitations_date_idx" ON "'.$prefix.'invitations" ("date");
+ ');
+ $this->db->query('
+ ALTER TABLE "'.$prefix.'users"
+ ADD "referrer" integer NOT NULL DEFAULT 0
+ ');
+
+ } else {
+
+ $this->db->query('
+ CREATE TABLE `'.$prefix.'invitations` (
+ `user` int(8) unsigned NOT NULL,
+ `key` varchar(16) CHARACTER SET ascii NOT NULL,
+ `date` int(11) unsigned NOT NULL,
+ PRIMARY KEY (`key`),
+ KEY `user` (`user`),
+ KEY `date` (`date`)
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin
+ ');
+ $this->db->query('
+ ALTER TABLE `'.$prefix.'users`
+ ADD `referrer` INT(8) UNSIGNED NOT NULL DEFAULT 0
+ ');
+ }
+ }
+
+ public function down()
+ {
+ $prefix = $this->db->dbprefix;
+
+ if ($this->db->dbdriver == 'postgre') {
+ $this->db->query('
+ ALTER TABLE "'.$prefix.'users" DROP "referrer"
+ ');
+ } else {
+ $this->db->query('
+ ALTER TABLE `'.$prefix.'users` DROP `referrer`
+ ');
+ }
+ $this->dbforge->drop_table('invitations');
+
+ }
+}
diff --git a/application/migrations/004_add_filesize.php b/application/migrations/004_add_filesize.php
new file mode 100644
index 000000000..ca10e7dc3
--- /dev/null
+++ b/application/migrations/004_add_filesize.php
@@ -0,0 +1,37 @@
+<?php
+defined('BASEPATH') OR exit('No direct script access allowed');
+
+class Migration_Add_filesize extends CI_Migration {
+
+ public function up()
+ {
+ $prefix = $this->db->dbprefix;
+
+ if ($this->db->dbdriver == 'postgre') {
+ $this->db->query('
+ ALTER TABLE "'.$prefix.'files"
+ ADD "filesize" integer NOT NULL
+ ');
+ } else {
+ $this->db->query('
+ ALTER TABLE `'.$prefix.'files`
+ ADD `filesize` INT UNSIGNED NOT NULL
+ ');
+ }
+ }
+
+ public function down()
+ {
+ $prefix = $this->db->dbprefix;
+
+ if ($this->db->dbdriver == 'postgre') {
+ $this->db->query('
+ ALTER TABLE "'.$prefix.'files" DROP "filesize"
+ ');
+ } else {
+ $this->db->query('
+ ALTER TABLE `'.$prefix.'files` DROP `filesize`
+ ');
+ }
+ }
+}
diff --git a/application/migrations/005_drop_file_password.php b/application/migrations/005_drop_file_password.php
new file mode 100644
index 000000000..1b3b5fc12
--- /dev/null
+++ b/application/migrations/005_drop_file_password.php
@@ -0,0 +1,33 @@
+<?php
+defined('BASEPATH') OR exit('No direct script access allowed');
+
+class Migration_Drop_file_password extends CI_Migration {
+
+ public function up()
+ {
+ $prefix = $this->db->dbprefix;
+
+ if ($this->db->dbdriver == 'postgre') {
+ $this->db->query('ALTER TABLE "'.$prefix.'files" DROP "password"');
+ } else {
+ $this->db->query('ALTER TABLE `'.$prefix.'files` DROP `password`;');
+ }
+ }
+
+ public function down()
+ {
+ $prefix = $this->db->dbprefix;
+
+ if ($this->db->dbdriver == 'postgre') {
+ $this->db->query('
+ ALTER TABLE "'.$prefix.'files"
+ ADD "password" character varying(40) DEFAULT NULL
+ ');
+ } else {
+ $this->db->query("
+ ALTER TABLE `'.$prefix.'files`
+ ADD `password` varchar(40) CHARACTER SET ascii COLLATE ascii_bin DEFAULT NULL;
+ ");
+ }
+ }
+}
diff --git a/application/migrations/006_add_username_index.php b/application/migrations/006_add_username_index.php
new file mode 100644
index 000000000..1633a95a9
--- /dev/null
+++ b/application/migrations/006_add_username_index.php
@@ -0,0 +1,35 @@
+<?php
+defined('BASEPATH') OR exit('No direct script access allowed');
+
+class Migration_Add_username_index extends CI_Migration {
+
+ public function up()
+ {
+ $prefix = $this->db->dbprefix;
+
+ if ($this->db->dbdriver == 'postgre') {
+ $this->db->query('
+ CREATE UNIQUE INDEX "'.$prefix.'users_username_idx" ON "'.$prefix.'users" ("username")
+ ');
+ } else {
+ $this->db->query('
+ ALTER TABLE `'.$prefix.'users`
+ ADD UNIQUE `username` (`username`);
+ ');
+ }
+ }
+
+ public function down()
+ {
+ $prefix = $this->db->dbprefix;
+
+ if ($this->db->dbdriver == 'postgre') {
+ $this->db->query('DROP INDEX "'.$prefix.'users_username_idx"');
+ } else {
+ $this->db->query("
+ ALTER TABLE `'.$prefix.'users`
+ DROP INDEX `username`;
+ ");
+ }
+ }
+}
diff --git a/application/migrations/007_repurpose_invitations.php b/application/migrations/007_repurpose_invitations.php
new file mode 100644
index 000000000..0bc39c64b
--- /dev/null
+++ b/application/migrations/007_repurpose_invitations.php
@@ -0,0 +1,68 @@
+<?php
+defined('BASEPATH') OR exit('No direct script access allowed');
+
+class Migration_Repurpose_invitations extends CI_Migration {
+
+ public function up()
+ {
+ $prefix = $this->db->dbprefix;
+
+ if ($this->db->dbdriver == 'postgre') {
+ $this->db->query('
+ ALTER TABLE "'.$prefix.'invitations"
+ ADD "action" character varying(255) NOT NULL,
+ ADD "data" TEXT NULL;
+ CREATE INDEX "'.$prefix.'invitations_action_idx" ON '.$prefix.'invitations ("action");
+ ');
+
+ $this->db->query('
+ UPDATE "'.$prefix.'invitations" SET "action" = \'invitation\' WHERE "action" = \'\'
+ ');
+
+ $this->db->query('
+ ALTER TABLE "'.$prefix.'invitations" RENAME TO '.$prefix.'actions;
+ ');
+
+ } else {
+
+ $this->db->query('
+ ALTER TABLE `'.$prefix.'invitations`
+ ADD `action` VARCHAR(255) NOT NULL,
+ ADD `data` TEXT NULL,
+ ADD INDEX `action` (`action`);
+ ');
+
+ $this->db->query('
+ UPDATE `'.$prefix.'invitations` SET `action` = \'invitation\' WHERE `action` = \'\';
+ ');
+
+ $this->db->query('
+ ALTER TABLE `'.$prefix.'invitations` RENAME `'.$prefix.'actions`;
+ ');
+ }
+ }
+
+ public function down()
+ {
+ $prefix = $this->db->dbprefix;
+
+ if ($this->db->dbdriver == 'postgre') {
+ $this->db->query('ALTER TABLE "'.$prefix.'actions" RENAME TO "'.$prefix.'invitations"');
+ $this->db->query('
+ ALTER TABLE "'.$prefix.'invitations"
+ DROP "action",
+ DROP "data";
+ ');
+
+ } else {
+
+ $this->db->query('ALTER TABLE `'.$prefix.'actions` RENAME `'.$prefix.'invitations`');
+ $this->db->query('
+ ALTER TABLE `'.$prefix.'invitations`
+ DROP `action`,
+ DROP `data`;
+ ');
+ }
+
+ }
+}
diff --git a/application/migrations/008_add_profiles.php b/application/migrations/008_add_profiles.php
new file mode 100644
index 000000000..4cdd14de0
--- /dev/null
+++ b/application/migrations/008_add_profiles.php
@@ -0,0 +1,61 @@
+<?php
+defined('BASEPATH') OR exit('No direct script access allowed');
+
+class Migration_Add_profiles extends CI_Migration {
+
+ public function up()
+ {
+ $prefix = $this->db->dbprefix;
+
+ if ($this->db->dbdriver == 'postgre') {
+ $this->db->query('
+ CREATE TABLE "'.$prefix.'profiles" (
+ "user" integer NOT NULL,
+ "upload_id_limits" varchar(255) NOT NULL,
+ PRIMARY KEY ("user")
+ )
+ ');
+
+ $this->db->query('
+ ALTER TABLE "'.$prefix.'files" ALTER COLUMN "id" TYPE varchar(255);
+ ');
+
+ } else {
+
+ $this->db->query('
+ CREATE TABLE `'.$prefix.'profiles` (
+ `user` int(8) unsigned NOT NULL,
+ `upload_id_limits` varchar(255) COLLATE utf8_bin NOT NULL,
+ PRIMARY KEY (`user`)
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin
+ ');
+
+ $this->db->query('
+ ALTER TABLE `'.$prefix.'files` CHANGE `id` `id` VARCHAR( 255 );
+ ');
+ }
+ }
+
+ public function down()
+ {
+ $prefix = $this->db->dbprefix;
+
+ if ($this->db->dbdriver == 'postgre') {
+ $this->db->query('
+ DROP TABLE "'.$prefix.'profiles";
+ ');
+ $this->db->query('
+ ALTER TABLE "'.$prefix.'files" ALTER COLUMN "id" TYPE varchar(6);
+ ');
+
+ } else {
+
+ $this->db->query("
+ DROP TABLE `'.$prefix.'profiles`;
+ ");
+ $this->db->query("
+ ALTER TABLE `'.$prefix.'files` CHANGE `id` `id` VARCHAR( 6 );
+ ");
+ }
+ }
+}
diff --git a/application/migrations/009_add_apikeys.php b/application/migrations/009_add_apikeys.php
new file mode 100644
index 000000000..e9dba4e41
--- /dev/null
+++ b/application/migrations/009_add_apikeys.php
@@ -0,0 +1,41 @@
+<?php
+defined('BASEPATH') OR exit('No direct script access allowed');
+
+class Migration_Add_apikeys extends CI_Migration {
+
+ public function up()
+ {
+ $prefix = $this->db->dbprefix;
+
+ if ($this->db->dbdriver == 'postgre') {
+ $this->db->query('
+ CREATE TABLE "'.$prefix.'apikeys" (
+ "key" varchar(64) NOT NULL,
+ "user" integer NOT NULL,
+ "created" timestamp WITH TIME ZONE NOT NULL DEFAULT NOW(),
+ "comment" varchar(255) NOT NULL,
+ PRIMARY KEY ("key")
+ );
+ CREATE INDEX "'.$prefix.'apikeys_user_idx" ON "'.$prefix.'apikeys" ("user");
+ ');
+
+ } else {
+
+ $this->db->query('
+ CREATE TABLE `'.$prefix.'apikeys` (
+ `key` varchar(64) COLLATE utf8_bin NOT NULL,
+ `user` int(8) unsigned NOT NULL,
+ `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ `comment` varchar(255) CHARACTER SET ascii COLLATE ascii_bin NOT NULL,
+ PRIMARY KEY (`key`),
+ KEY `user` (`user`)
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin
+ ');
+ }
+ }
+
+ public function down()
+ {
+ $this->dbforge->drop_table('apikeys');
+ }
+}
diff --git a/application/migrations/010_files_innodb.php b/application/migrations/010_files_innodb.php
new file mode 100644
index 000000000..98f9dea31
--- /dev/null
+++ b/application/migrations/010_files_innodb.php
@@ -0,0 +1,20 @@
+<?php
+defined('BASEPATH') OR exit('No direct script access allowed');
+
+class Migration_files_innodb extends CI_Migration {
+
+ public function up()
+ {
+ $prefix = $this->db->dbprefix;
+
+ if ($this->db->dbdriver != 'postgre') {
+ $this->db->query('
+ ALTER TABLE `'.$prefix.'files` ENGINE = InnoDB;
+ ');
+ }
+ }
+
+ public function down()
+ {
+ }
+}
diff --git a/application/migrations/011_apikeys_add_access_level.php b/application/migrations/011_apikeys_add_access_level.php
new file mode 100644
index 000000000..14d0b03d3
--- /dev/null
+++ b/application/migrations/011_apikeys_add_access_level.php
@@ -0,0 +1,35 @@
+<?php
+defined('BASEPATH') OR exit('No direct script access allowed');
+
+class Migration_apikeys_add_access_level extends CI_Migration {
+
+ public function up()
+ {
+ $prefix = $this->db->dbprefix;
+
+ if ($this->db->dbdriver == 'postgre') {
+ $this->db->query('
+ alter table "'.$prefix.'apikeys" add "access_level" varchar(255) default \'apikey\'
+ ');
+ } else {
+ $this->db->query('
+ alter table `'.$prefix.'apikeys` add `access_level` varchar(255) default \'apikey\';
+ ');
+ }
+ }
+
+ public function down()
+ {
+ $prefix = $this->db->dbprefix;
+
+ if ($this->db->dbdriver == 'postgre') {
+ $this->db->query('
+ alter table "'.$prefix.'apikeys" drop "access_level"
+ ');
+ } else {
+ $this->db->query('
+ alter table `'.$prefix.'apikeys` drop `access_level`
+ ');
+ }
+ }
+}
diff --git a/application/migrations/012_add_constraints.php b/application/migrations/012_add_constraints.php
new file mode 100644
index 000000000..a2569d54d
--- /dev/null
+++ b/application/migrations/012_add_constraints.php
@@ -0,0 +1,36 @@
+<?php
+defined('BASEPATH') OR exit('No direct script access allowed');
+
+class Migration_add_constraints extends CI_Migration {
+
+ public function up()
+ {
+ $prefix = $this->db->dbprefix;
+
+ if ($this->db->dbdriver == 'postgre') {
+ $this->db->query('ALTER TABLE "'.$prefix.'users" ALTER COLUMN "referrer" TYPE integer');
+ $this->db->query('ALTER TABLE "'.$prefix.'users" ALTER COLUMN "referrer" DROP NOT NULL');
+ $this->db->query('CREATE INDEX "'.$prefix.'users_referrer_idx" ON "'.$prefix.'users" ("referrer")');
+ $this->db->query('UPDATE "'.$prefix.'users" SET "referrer" = NULL where "referrer" = 0');
+ $this->db->query('
+ ALTER TABLE "'.$prefix.'users"
+ ADD CONSTRAINT "'.$prefix.'referrer_user_fkey" FOREIGN KEY ("referrer")
+ REFERENCES "'.$prefix.'users"("id") ON DELETE RESTRICT ON UPDATE RESTRICT
+ ');
+
+ } else {
+
+ $this->db->query('ALTER TABLE `'.$prefix.'users` ADD INDEX(`referrer`);');
+ $this->db->query('ALTER TABLE `'.$prefix.'users` CHANGE `referrer` `referrer`
+ INT(8) UNSIGNED NULL;');
+ $this->db->query('UPDATE `'.$prefix.'users` SET `referrer` = NULL where `referrer` = 0;');
+ $this->db->query('ALTER TABLE `'.$prefix.'users` ADD FOREIGN KEY (`referrer`)
+ REFERENCES `'.$prefix.'users`(`id`) ON DELETE RESTRICT ON UPDATE RESTRICT;');
+ }
+ }
+
+ public function down()
+ {
+ throw new \exceptions\ApiException("migration/downgrade-not-supported", "downgrade not supported");
+ }
+}
diff --git a/application/migrations/013_add_multipaste.php b/application/migrations/013_add_multipaste.php
new file mode 100644
index 000000000..6dd9bcb7b
--- /dev/null
+++ b/application/migrations/013_add_multipaste.php
@@ -0,0 +1,62 @@
+<?php
+defined('BASEPATH') OR exit('No direct script access allowed');
+
+class Migration_add_multipaste extends CI_Migration {
+
+ public function up()
+ {
+ $prefix = $this->db->dbprefix;
+
+ if ($this->db->dbdriver == 'postgre') {
+ $this->db->query('
+ CREATE TABLE "'.$prefix.'multipaste" (
+ "url_id" varchar(255) NOT NULL PRIMARY KEY,
+ "multipaste_id" serial UNIQUE,
+ "user_id" integer NOT NULL,
+ "date" integer NOT NULL
+ );
+ CREATE INDEX "'.$prefix.'multipaste_user_idx" ON "'.$prefix.'multipaste" ("user_id");
+ ');
+
+ $this->db->query('
+ CREATE TABLE "'.$prefix.'multipaste_file_map" (
+ "multipaste_id" integer NOT NULL REFERENCES "'.$prefix.'multipaste" ("multipaste_id") ON DELETE CASCADE ON UPDATE CASCADE,
+ "file_url_id" varchar(255) NOT NULL REFERENCES "'.$prefix.'files"("id") ON DELETE CASCADE ON UPDATE CASCADE,
+ "sort_order" serial PRIMARY KEY,
+ UNIQUE ("multipaste_id", "file_url_id")
+ );
+ CREATE INDEX "'.$prefix.'multipaste_file_map_file_idx" ON "'.$prefix.'multipaste_file_map" ("file_url_id");
+ ');
+
+ } else {
+
+ $this->db->query('
+ CREATE TABLE `'.$prefix.'multipaste` (
+ `url_id` varchar(255) NOT NULL,
+ `multipaste_id` int(11) NOT NULL AUTO_INCREMENT,
+ `user_id` int(11) NOT NULL,
+ `date` int(11) NOT NULL,
+ PRIMARY KEY (`url_id`),
+ UNIQUE KEY `multipaste_id` (`multipaste_id`),
+ KEY `user_id` (`user_id`)
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;');
+
+ $this->db->query('
+ CREATE TABLE `'.$prefix.'multipaste_file_map` (
+ `multipaste_id` int(11) NOT NULL,
+ `file_url_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
+ `sort_order` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`sort_order`),
+ UNIQUE KEY `multipaste_id` (`multipaste_id`,`file_url_id`),
+ KEY `multipaste_file_map_ibfk_2` (`file_url_id`),
+ CONSTRAINT `'.$prefix.'multipaste_file_map_ibfk_1` FOREIGN KEY (`multipaste_id`) REFERENCES `'.$prefix.'multipaste` (`multipaste_id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT `'.$prefix.'multipaste_file_map_ibfk_2` FOREIGN KEY (`file_url_id`) REFERENCES `'.$prefix.'files` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;');
+ }
+ }
+
+ public function down()
+ {
+ throw new \exceptions\ApiException("migration/downgrade-not-supported", "downgrade not supported");
+ }
+}
diff --git a/application/migrations/014_deduplicate_file_storage.php b/application/migrations/014_deduplicate_file_storage.php
new file mode 100644
index 000000000..bd96c56d8
--- /dev/null
+++ b/application/migrations/014_deduplicate_file_storage.php
@@ -0,0 +1,137 @@
+<?php
+defined('BASEPATH') OR exit('No direct script access allowed');
+
+class Migration_deduplicate_file_storage extends CI_Migration {
+
+ public function up()
+ {
+ $prefix = $this->db->dbprefix;
+
+ if ($this->db->dbdriver == 'postgre') {
+ $this->db->query('
+ CREATE TABLE "'.$prefix.'file_storage" (
+ "id" serial NOT NULL,
+ "filesize" integer NOT NULL,
+ "mimetype" varchar(255) NOT NULL,
+ "hash" char(32) NOT NULL,
+ "date" integer NOT NULL,
+ PRIMARY KEY ("id"),
+ UNIQUE ("id", "hash")
+ );
+ ');
+ $this->db->query('
+ ALTER TABLE "'.$prefix.'files"
+ ADD "file_storage_id" integer NULL;
+ CREATE INDEX "'.$prefix.'files_file_storage_id_idx" ON "'.$prefix.'files" ("file_storage_id");
+ ');
+
+ $this->db->query('
+ INSERT INTO "'.$prefix.'file_storage" (filesize, mimetype, hash, date)
+ SELECT filesize, mimetype, hash, date FROM "'.$prefix.'files";
+ ');
+
+ $this->db->query('
+ UPDATE "'.$prefix.'files" f
+ SET file_storage_id = fs.id
+ FROM "'.$prefix.'file_storage" fs
+ WHERE fs.hash = f.hash
+ ');
+
+ // remove file_storage rows that are not referenced by files.id
+ // AND that are duplicates when grouped by hash
+ $this->db->query('
+ DELETE
+ FROM "'.$prefix.'file_storage" fs
+ USING "'.$prefix.'file_storage" fs2
+ WHERE fs.hash = fs2.hash
+ AND fs.id > fs2.id
+ AND fs.id NOT IN (
+ SELECT file_storage_id
+ FROM "'.$prefix.'files" f
+ );
+ ');
+ } else {
+ $this->db->query('
+ CREATE TABLE `'.$prefix.'file_storage` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `filesize` int(11) NOT NULL,
+ `mimetype` varchar(255) NOT NULL,
+ `hash` char(32) NOT NULL,
+ `date` int(11) NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `data_id` (`id`, `hash`)
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+ ');
+ $this->db->query('
+ ALTER TABLE `'.$prefix.'files`
+ ADD `file_storage_id` INT NOT NULL,
+ ADD INDEX (`file_storage_id`);
+ ');
+
+ $this->db->query('
+ INSERT INTO `'.$prefix.'file_storage` (id, filesize, mimetype, hash, date)
+ SELECT NULL, filesize, mimetype, hash, date FROM `'.$prefix.'files`;
+ ');
+
+ $this->db->query('
+ UPDATE `'.$prefix.'files` f
+ JOIN `'.$prefix.'file_storage` fs ON fs.hash = f.hash
+ SET f.file_storage_id = fs.id
+ ');
+
+ // XXX: This query also exists in migration 15
+ $this->db->query('
+ DELETE fs
+ FROM `'.$prefix.'file_storage` fs, `'.$prefix.'file_storage` fs2
+ WHERE fs.hash = fs2.hash
+ AND fs.id > fs2.id
+ AND fs.id NOT IN (
+ SELECT file_storage_id
+ FROM `'.$prefix.'files` f
+ );
+ ');
+ }
+
+ $chunk = 500;
+ $total = $this->db->count_all("file_storage");
+
+ for ($limit = 0; $limit < $total; $limit += $chunk) {
+ $query = $this->db->select('hash, id')
+ ->from('file_storage')
+ ->limit($chunk, $limit)
+ ->get()->result_array();
+
+ foreach ($query as $key => $item) {
+ $old = $this->mfile->file($item["hash"]);
+ $data_id = $item["hash"].'-'.$item["id"];
+ $new = $this->mfile->file($data_id);
+ if (file_exists($old)) {
+ rename($old, $new);
+ } else {
+ echo "Warning: no file found for $data_id. Skipping...\n";
+ }
+ }
+ }
+
+ if ($this->db->dbdriver == 'postgre') {
+ $this->db->query('
+ ALTER TABLE "'.$prefix.'files"
+ ADD FOREIGN KEY ("file_storage_id") REFERENCES "'.$prefix.'file_storage"("id") ON DELETE CASCADE ON UPDATE CASCADE;
+ ');
+ } else {
+ $this->db->query('
+ ALTER TABLE `'.$prefix.'files`
+ ADD FOREIGN KEY (`file_storage_id`) REFERENCES `'.$prefix.'file_storage`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
+ ');
+ }
+
+ $this->dbforge->drop_column("files", "hash");
+ $this->dbforge->drop_column("files", "mimetype");
+ $this->dbforge->drop_column("files", "filesize");
+ }
+
+ public function down()
+ {
+ throw new \exceptions\ApiException("migration/downgrade-not-supported", "downgrade not supported");
+ }
+}
diff --git a/application/migrations/015_actually_deduplicate_file_storage.php b/application/migrations/015_actually_deduplicate_file_storage.php
new file mode 100644
index 000000000..76ff2d6b9
--- /dev/null
+++ b/application/migrations/015_actually_deduplicate_file_storage.php
@@ -0,0 +1,56 @@
+<?php
+defined('BASEPATH') OR exit('No direct script access allowed');
+
+class Migration_actually_deduplicate_file_storage extends CI_Migration {
+
+ public function up()
+ {
+ $prefix = $this->db->dbprefix;
+
+ if ($this->db->dbdriver == 'postgre') {
+ // no need for this query since 14 is not buggy
+ } else {
+ // XXX: This query also exists in migration 14
+ $this->db->query('
+ DELETE fs
+ FROM `'.$prefix.'file_storage` fs, `'.$prefix.'file_storage` fs2
+ WHERE fs.hash = fs2.hash
+ AND fs.id > fs2.id
+ AND fs.id NOT IN (
+ SELECT file_storage_id
+ FROM `'.$prefix.'files` f
+ );
+ ');
+ }
+
+ $chunk = 500;
+ $total = $this->db->count_all("file_storage");
+ $consistent = true;
+
+ for ($limit = 0; $limit < $total; $limit += $chunk) {
+ $query = $this->db->select('hash, id')
+ ->from('file_storage')
+ ->limit($chunk, $limit)
+ ->get()->result_array();
+
+ foreach ($query as $key => $item) {
+ $data_id = $item["hash"].'-'.$item["id"];
+ $file = $this->mfile->file($data_id);
+ if (!file_exists($file)) {
+ echo "Warning: no file found for $data_id\n";
+ $consistent = false;
+ }
+ }
+ }
+
+ if (!$consistent) {
+ echo "Your database is not consistent with your file system.\n";
+ echo "Please report this as it is most likely a bug.\n";
+ }
+ }
+
+ public function down()
+ {
+ throw new \exceptions\ApiException("migration/downgrade-not-supported", "downgrade not supported");
+ }
+}
diff --git a/application/migrations/016_allow_ipv6_storage.php b/application/migrations/016_allow_ipv6_storage.php
new file mode 100644
index 000000000..726a18601
--- /dev/null
+++ b/application/migrations/016_allow_ipv6_storage.php
@@ -0,0 +1,27 @@
+<?php
+defined('BASEPATH') OR exit('No direct script access allowed');
+
+class Migration_allow_ipv6_storage extends CI_Migration {
+
+ public function up()
+ {
+ $prefix = $this->db->dbprefix;
+
+ if ($this->db->dbdriver == 'postgre') {
+ $this->db->query('
+ ALTER TABLE "'.$prefix.'ci_sessions"
+ ALTER COLUMN "ip_address" type varchar(39);
+ ');
+ } else {
+ $this->db->query('
+ ALTER TABLE `'.$prefix.'ci_sessions`
+ CHANGE `ip_address` `ip_address` varchar(39);
+ ');
+ }
+ }
+
+ public function down()
+ {
+ throw new \exceptions\ApiException("migration/downgrade-not-supported", "downgrade not supported");
+ }
+}
diff --git a/application/migrations/017_increase_password_length.php b/application/migrations/017_increase_password_length.php
new file mode 100644
index 000000000..9d12d3f52
--- /dev/null
+++ b/application/migrations/017_increase_password_length.php
@@ -0,0 +1,27 @@
+<?php
+defined('BASEPATH') OR exit('No direct script access allowed');
+
+class Migration_increase_password_length extends CI_Migration {
+
+ public function up()
+ {
+ $prefix = $this->db->dbprefix;
+
+ if ($this->db->dbdriver == 'postgre') {
+ $this->db->query('
+ ALTER TABLE "'.$prefix.'users"
+ ALTER COLUMN "password" type varchar(255);
+ ');
+ } else {
+ $this->db->query('
+ ALTER TABLE `'.$prefix.'users`
+ CHANGE `password` `password` varchar(255);
+ ');
+ }
+ }
+
+ public function down()
+ {
+ throw new \exceptions\ApiException("migration/downgrade-not-supported", "downgrade not supported");
+ }
+}
diff --git a/application/migrations/018_allow_null_values_userinfo.php b/application/migrations/018_allow_null_values_userinfo.php
new file mode 100644
index 000000000..1497dd0d4
--- /dev/null
+++ b/application/migrations/018_allow_null_values_userinfo.php
@@ -0,0 +1,31 @@
+<?php
+defined('BASEPATH') OR exit('No direct script access allowed');
+
+class Migration_allow_null_values_userinfo extends CI_Migration {
+
+ public function up()
+ {
+ $prefix = $this->db->dbprefix;
+
+ if ($this->db->dbdriver == 'postgre') {
+ $this->db->query('
+ ALTER TABLE "'.$prefix.'users"
+ ALTER COLUMN "username" DROP NOT NULL,
+ ALTER COLUMN "password" DROP NOT NULL,
+ ALTER COLUMN "email" DROP NOT NULL;
+ ');
+ } else {
+ $this->db->query('
+ ALTER TABLE `'.$prefix.'users`
+ CHANGE `username` `username` varchar(32) NULL,
+ CHANGE `password` `password` varchar(255) NULL,
+ CHANGE `email` `email` varchar(255) NULL;
+ ');
+ }
+ }
+
+ public function down()
+ {
+ throw new \exceptions\ApiException("migration/downgrade-not-supported", "downgrade not supported");
+ }
+}
diff --git a/application/migrations/019_change_filesize_type.php b/application/migrations/019_change_filesize_type.php
new file mode 100644
index 000000000..33abf89ed
--- /dev/null
+++ b/application/migrations/019_change_filesize_type.php
@@ -0,0 +1,51 @@
+<?php
+defined('BASEPATH') OR exit('No direct script access allowed');
+
+class Migration_change_filesize_type extends CI_Migration {
+
+ public function up()
+ {
+ $prefix = $this->db->dbprefix;
+
+ if ($this->db->dbdriver == 'postgre') {
+ $this->db->query('
+ ALTER TABLE "'.$prefix.'file_storage"
+ ALTER "filesize" TYPE bigint;
+ ');
+ } else {
+ $this->db->query('
+ ALTER TABLE `'.$prefix.'file_storage`
+ MODIFY `filesize` bigint;
+ ');
+ }
+
+ $chunk = 500;
+
+ $this->db->where('filesize', 2147483647);
+ $total = $this->db->count_all_results("file_storage");
+
+ for ($limit = 0; $limit < $total; $limit += $chunk) {
+ $query = $this->db->select('hash, id')
+ ->from('file_storage')
+ ->where('filesize', 2147483647)
+ ->limit($chunk, $limit)
+ ->get()->result_array();
+
+ foreach ($query as $key => $item) {
+ $data_id = $item["hash"].'-'.$item['id'];
+ $filesize = filesize($this->mfile->file($data_id));
+
+ $this->db->where('id', $item['id'])
+ ->set(array(
+ 'filesize' => $filesize,
+ ))
+ ->update('file_storage');
+ }
+ }
+ }
+
+ public function down()
+ {
+ throw new \exceptions\ApiException("migration/downgrade-not-supported", "downgrade not supported");
+ }
+}
diff --git a/application/migrations/020_update_session_table.php b/application/migrations/020_update_session_table.php
new file mode 100644
index 000000000..94a240def
--- /dev/null
+++ b/application/migrations/020_update_session_table.php
@@ -0,0 +1,45 @@
+<?php
+defined('BASEPATH') OR exit('No direct script access allowed');
+
+class Migration_update_session_table extends CI_Migration {
+
+ public function up()
+ {
+ $prefix = $this->db->dbprefix;
+
+ if ($this->db->dbdriver == 'postgre') {
+ $this->db->query('
+ ALTER TABLE "'.$prefix.'ci_sessions"
+ DROP COLUMN "user_agent";
+ ');
+ $this->db->query('
+ ALTER TABLE "'.$prefix.'ci_sessions"
+ RENAME COLUMN "session_id" TO "id";
+ ');
+ $this->db->query('
+ ALTER TABLE "'.$prefix.'ci_sessions"
+ RENAME COLUMN "last_activity" TO "timestamp";
+ ');
+ $this->db->query('
+ ALTER TABLE "'.$prefix.'ci_sessions"
+ RENAME COLUMN "user_data" TO "data";
+ ');
+ $this->db->query('
+ ALTER TABLE "'.$prefix.'ci_sessions" ALTER COLUMN id SET DATA TYPE varchar(128);
+ ');
+ } else {
+ $this->db->query('
+ ALTER TABLE `'.$prefix.'ci_sessions`
+ DROP `user_agent`,
+ CHANGE `session_id` `id` VARCHAR(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ CHANGE `last_activity` `timestamp` INT(10) UNSIGNED NOT NULL DEFAULT 0,
+ CHANGE `user_data` `data` BLOB NOT NULL;
+ ');
+ }
+ }
+
+ public function down()
+ {
+ throw new \exceptions\ApiException("migration/downgrade-not-supported", "downgrade not supported");
+ }
+}
diff --git a/application/migrations/021_change_charset.php b/application/migrations/021_change_charset.php
new file mode 100644
index 000000000..475732ed5
--- /dev/null
+++ b/application/migrations/021_change_charset.php
@@ -0,0 +1,28 @@
+<?php
+defined('BASEPATH') OR exit('No direct script access allowed');
+
+class Migration_change_charset extends CI_Migration {
+
+ public function up()
+ {
+ $prefix = $this->db->dbprefix;
+
+ if ($this->db->dbdriver == 'postgre') {
+ # nothing to do
+ } else {
+ $this->db->query('SET FOREIGN_KEY_CHECKS = 0');
+ foreach ([
+ ['apikeys', 'comment', 'VARCHAR(255)'],
+ ['files', 'filename', 'VARCHAR(256)'],
+ ] as $col) {
+ $this->db->query('ALTER TABLE `'.$prefix.$col[0].'` CHANGE `'.$col[1].'` `'.$col[1].'` '.$col[2].' CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;');
+ }
+ $this->db->query('SET FOREIGN_KEY_CHECKS = 1');
+ }
+ }
+
+ public function down()
+ {
+ throw new \exceptions\ApiException("migration/downgrade-not-supported", "downgrade not supported");
+ }
+}
diff --git a/application/models/Mfile.php b/application/models/Mfile.php
new file mode 100644
index 000000000..977240c89
--- /dev/null
+++ b/application/models/Mfile.php
@@ -0,0 +1,275 @@
+<?php
+/*
+ * Copyright 2009-2013 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+class Mfile extends CI_Model {
+
+ private $upload_path;
+
+ function __construct()
+ {
+ parent::__construct();
+ $this->load->model("muser");
+
+ $this->upload_path = $this->config->item('upload_path');
+ $this->id_validation_config = array(
+ "upload_max_age" => $this->config->item("upload_max_age"),
+ "small_upload_size" => $this->config->item("small_upload_size"),
+ "sess_expiration" => $this->config->item("sess_expiration"),
+ );
+ }
+
+ // Returns an unused ID
+ function new_id($min = 3, $max = 6)
+ {
+ static $id_blacklist = NULL;
+
+ if ($id_blacklist == NULL) {
+ // This prevents people from being unable to access their uploads
+ // because of URL rewriting
+ $id_blacklist = scandir(FCPATH);
+ $id_blacklist[] = "file";
+ $id_blacklist[] = "user";
+ }
+
+ $max_tries = 100;
+
+ for ($try = 0; $try < $max_tries; $try++) {
+ $id = random_alphanum($min, $max);
+
+ if ($this->id_exists($id) || in_array($id, $id_blacklist)) {
+ continue;
+ }
+
+ return $id;
+ }
+
+ throw new \exceptions\PublicApiException("file/new_id-try-limit", "Failed to find unused ID after $max_tries tries");
+ }
+
+ function id_exists($id)
+ {
+ if (!$id) {
+ return false;
+ }
+
+ $query = $this->db->select('id')
+ ->from('files')
+ ->where('id', $id)
+ ->limit(1)
+ ->get();
+
+ return $query->num_rows() == 1;
+ }
+
+ function get_filedata($id)
+ {
+ return cache_function("filedatav2-$id", 300, function() use ($id) {
+ $query = $this->db
+ ->select('files.id, hash, file_storage.id storage_id, filename, mimetype, files.date, user, filesize')
+ ->from('files')
+ ->join('file_storage', 'file_storage.id = files.file_storage_id')
+ ->where('files.id', $id)
+ ->limit(1)
+ ->get();
+
+ if ($query->num_rows() > 0) {
+ $data = $query->row_array();
+ $data["data_id"] = $data["hash"]."-".$data["storage_id"];
+ return $data;
+ } else {
+ return false;
+ }
+ });
+ }
+
+ // return the folder in which the file with $data_id is stored
+ function folder($data_id) {
+ return $this->upload_path.'/'.substr($data_id, 0, 3);
+ }
+
+ // Returns the full path to the file with $data_id
+ function file($data_id) {
+ return $this->folder($data_id).'/'.$data_id;
+ }
+
+ // Add a file to the DB
+ function add_file($userid, $id, $filename, $storage_id)
+ {
+ $this->db->insert("files", array(
+ "id" => $id,
+ "filename" => $filename,
+ "date" => time(),
+ "user" => $userid,
+ "file_storage_id" => $storage_id,
+ ));
+ }
+
+ function adopt($id)
+ {
+ $userid = $this->muser->get_userid();
+
+ $this->db->set(array('user' => $userid ))
+ ->where('id', $id)
+ ->where('user', 0)
+ ->update('files');
+ return $this->db->affected_rows();
+ }
+
+ // remove old/invalid/broken IDs
+ public function valid_id($id)
+ {
+ $filedata = $this->get_filedata($id);
+
+ if (!$filedata) {
+ return false;
+ }
+
+ return $this->valid_filedata($filedata);
+ }
+
+ public function valid_filedata($filedata)
+ {
+ return \service\files::valid_id($filedata, $this->id_validation_config, $this, time());
+ }
+
+ public function file_exists($file)
+ {
+ return file_exists($file);
+ }
+
+ public function filemtime($file)
+ {
+ return filemtime($file);
+ }
+
+ public function filesize($file)
+ {
+ return filesize($file);
+ }
+
+ public function get_timeout($id)
+ {
+ $filedata = $this->get_filedata($id);
+ $file = $this->file($filedata["data_id"]);
+
+ if ($this->config->item("upload_max_age") == 0) {
+ return -1;
+ }
+
+ if (filesize($file) > $this->config->item("small_upload_size")) {
+ return $filedata["date"] + $this->config->item("upload_max_age");
+ } else {
+ return -1;
+ }
+ }
+
+ public function get_timeout_string($id)
+ {
+ $timeout = $this->get_timeout($id);
+
+ if ($timeout >= 0) {
+ return date("r", $timeout);
+ } else {
+ return "unknown";
+ }
+ }
+
+ private function unused_file($data_id)
+ {
+ list ($hash, $storage_id) = explode("-", $data_id);
+ $query = $this->db->select('files.id')
+ ->from('files')
+ ->join('file_storage', 'file_storage.id = files.file_storage_id')
+ ->where('hash', $hash)
+ ->where('file_storage.id', $storage_id)
+ ->limit(1)
+ ->get();
+
+ return $query->num_rows() == 0;
+ }
+
+ public function delete_by_user($userid)
+ {
+ $query = $this->db->select("id")
+ ->where("user", $userid)
+ ->get("files")->result_array();
+ $ids = array_map(function ($a) {return $a['id'];}, $query);
+
+ foreach ($ids as $id) {
+ $this->delete_id($id);
+ }
+ }
+
+ public function delete_id($id)
+ {
+ $filedata = $this->get_filedata($id);
+
+ // Delete the file and all multipastes using it
+ // Note that this does not delete all relations in multipaste_file_map
+ // which is actually done by an SQL contraint.
+ // TODO: make it work properly without the constraint
+ $map = $this->db->select('url_id')
+ ->distinct()
+ ->from('multipaste_file_map')
+ ->join("multipaste", "multipaste.multipaste_id = multipaste_file_map.multipaste_id")
+ ->where('file_url_id', $id)
+ ->get()->result_array();
+
+ $this->db->where('id', $id)
+ ->delete('files');
+ delete_cache("filedata-$id");
+
+ foreach ($map as $entry) {
+ assert(!empty($entry['url_id']));
+ $this->mmultipaste->delete_id($entry["url_id"]);
+ }
+
+ if ($this->id_exists($id)) {
+ return false;
+ }
+
+ if ($filedata !== false) {
+ assert(isset($filedata["data_id"]));
+ if ($this->unused_file($filedata['data_id'])) {
+ $this->delete_data_id($filedata['data_id']);
+ }
+ }
+ return true;
+ }
+
+ public function delete_data_id($data_id)
+ {
+ list ($hash, $storage_id) = explode("-", $data_id);
+
+ $this->db->where('id', $storage_id)
+ ->delete('file_storage');
+ if (file_exists($this->file($data_id))) {
+ unlink($this->file($data_id));
+ }
+ $dir = $this->folder($data_id);
+ if (file_exists($dir)) {
+ if (count(scandir($dir)) == 2) {
+ rmdir($dir);
+ }
+ }
+ delete_cache("${data_id}_thumb_150");
+ }
+
+ public function get_owner($id)
+ {
+ return $this->db->select('user')
+ ->from('files')
+ ->where('id', $id)
+ ->get()->row_array()
+ ['user'];
+ }
+
+}
+
+# vim: set noet:
diff --git a/application/models/Mmultipaste.php b/application/models/Mmultipaste.php
new file mode 100644
index 000000000..52ea4dfb4
--- /dev/null
+++ b/application/models/Mmultipaste.php
@@ -0,0 +1,184 @@
+<?php
+/*
+ * Copyright 2014 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+class Mmultipaste extends CI_Model {
+
+ function __construct()
+ {
+ parent::__construct();
+ $this->load->model("muser");
+ $this->load->model("mfile");
+ }
+
+ /**
+ * Returns an unused ID
+ *
+ * @param min minimal length of the resulting ID
+ * @param max maximum length of the resulting ID
+ */
+ public function new_id($min = 3, $max = 6)
+ {
+ static $id_blacklist = NULL;
+
+ if ($id_blacklist == NULL) {
+ // This prevents people from being unable to access their uploads
+ // because of URL rewriting
+ $id_blacklist = scandir(FCPATH);
+ $id_blacklist[] = "file";
+ $id_blacklist[] = "user";
+ }
+
+ $max_tries = 100;
+
+ for ($try = 0; $try < $max_tries; $try++) {
+ $id = "m-".random_alphanum($min, $max);
+
+ // TODO: try to insert the id into file_groups instead of checking with
+ // id_exists (prevents race conditio)
+ if ($this->id_exists($id) || in_array($id, $id_blacklist)) {
+ continue;
+ }
+
+ $this->db->insert("multipaste", array(
+ "url_id" => $id,
+ "user_id" => $this->muser->get_userid(),
+ "date" => time(),
+ ));
+
+ return $id;
+ }
+
+ throw new \exceptions\PublicApiException("file/new_id-try-limit", "Failed to find unused ID after $max_tries tries");
+ }
+
+ public function id_exists($id)
+ {
+ if (!$id) {
+ return false;
+ }
+
+ $sql = '
+ SELECT url_id
+ FROM '.$this->db->dbprefix.'multipaste
+ WHERE url_id = ?
+ LIMIT 1';
+ $query = $this->db->query($sql, array($id));
+
+ return $query->num_rows() == 1;
+ }
+
+ public function valid_id($id)
+ {
+ $files = $this->get_files($id);
+ if (count($files) === 0) {
+ return false;
+ }
+
+ foreach ($files as $file) {
+ if (!$this->mfile->valid_id($file["id"])) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ function adopt($id)
+ {
+ $userid = $this->muser->get_userid();
+
+ $this->db->set(array('user_id' => $userid ))
+ ->where('url_id', $id)
+ ->where('user_id', 0)
+ ->update('multipaste');
+ return $this->db->affected_rows();
+ }
+
+ public function get_tarball_path($id)
+ {
+ return $this->config->item("upload_path")."/special/multipaste-tarballs/".substr(md5($id), 0, 3)."/$id.tar.gz";
+ }
+
+ public function delete_by_user($userid)
+ {
+ $query = $this->db->select("url_id")
+ ->where("user_id", $userid)
+ ->get("multipaste")->result_array();
+ $ids = array_map(function ($a) {return $a['url_id'];}, $query);
+
+ foreach ($ids as $id) {
+ $this->delete_id($id);
+ }
+ }
+
+ public function delete_id($id)
+ {
+ $this->db->where('url_id', $id)
+ ->delete('multipaste');
+
+ $path = $this->get_tarball_path($id);
+ $f = new \service\storage($this->get_tarball_path($id));
+ $f->unlink();
+
+ return !$this->id_exists($id);
+ }
+
+ public function get_owner($id)
+ {
+ return $this->db->query("
+ SELECT user_id
+ FROM ".$this->db->dbprefix."multipaste
+ WHERE url_id = ?
+ ", array($id))->row_array()["user_id"];
+ }
+
+ public function get_multipaste($id)
+ {
+ return $this->db->query("
+ SELECT url_id, user_id, date
+ FROM ".$this->db->dbprefix."multipaste
+ WHERE url_id = ?
+ ", array($id))->row_array();
+ }
+
+ public function get_files($url_id)
+ {
+ $ret = array();
+
+ $query = $this->db->query("
+ SELECT mfm.file_url_id
+ FROM ".$this->db->dbprefix."multipaste_file_map mfm
+ JOIN ".$this->db->dbprefix."multipaste m ON m.multipaste_id = mfm.multipaste_id
+ WHERE m.url_id = ?
+ ORDER BY mfm.sort_order
+ ", array($url_id))->result_array();
+
+ foreach ($query as $row) {
+ $filedata = $this->mfile->get_filedata($row["file_url_id"]);
+ $ret[] = $filedata;
+ }
+
+ return $ret;
+ }
+
+ public function get_multipaste_id($url_id)
+ {
+ $query = $this->db->query("
+ SELECT multipaste_id
+ FROM ".$this->db->dbprefix."multipaste
+ WHERE url_id = ?
+ ", array($url_id));
+
+ if ($query->num_rows() > 0) {
+ return $query->row_array()["multipaste_id"];
+ }
+
+ return false;
+ }
+
+}
diff --git a/application/models/Muser.php b/application/models/Muser.php
new file mode 100644
index 000000000..521d1c989
--- /dev/null
+++ b/application/models/Muser.php
@@ -0,0 +1,406 @@
+<?php
+/*
+ * Copyright 2012-2013 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+class Muser extends CI_Model {
+
+ private $default_upload_id_limits = "3-6";
+
+ // last level has the most access
+ private $access_levels = array("basic", "apikey", "full");
+
+ private $hashalgo;
+ private $hashoptions = array();
+
+ function __construct()
+ {
+ parent::__construct();
+
+ $this->load->helper("filebin");
+ $this->load->driver("duser");
+ $this->hashalgo = $this->config->item('auth_db')['hashing_algorithm'];
+ $this->hashoptions = $this->config->item('auth_db')['hashing_options'];
+ }
+
+ function has_session()
+ {
+ // checking $this doesn't work
+ $CI =& get_instance();
+ if (property_exists($CI, "session")) {
+ return true;
+ }
+
+ // Only load the session class if we already have a cookie that might need to be renewed.
+ // Otherwise we just create lots of stale sessions.
+ if (isset($_COOKIE[$this->config->item("sess_cookie_name")])) {
+ $this->load->library("session");
+ return true;
+ }
+
+ return false;
+ }
+
+ function require_session()
+ {
+ if (!$this->has_session()) {
+ $this->load->library("session");
+ }
+ }
+
+ function logged_in()
+ {
+ if ($this->has_session()) {
+ return $this->session->userdata('logged_in') === true;
+ }
+
+ return false;
+ }
+
+ function login($username, $password)
+ {
+ $this->require_session();
+ return $this->duser->login($username, $password);
+ }
+
+ private function login_api_client()
+ {
+ $username = $this->input->post("username");
+ $password = $this->input->post("password");
+
+ // TODO keep for now. might be useful if adapted to apikeys instead of passwords
+ // prefer post parameters if either (username or password) is set
+ //if ($username === false && $password === false) {
+ //if (isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW'])) {
+ //$username = $_SERVER['PHP_AUTH_USER'];
+ //$password = $_SERVER['PHP_AUTH_PW'];
+ //}
+ //}
+
+ if ($username !== false && $password !== false) {
+ if ($this->login($username, $password)) {
+ return true;
+ } else {
+ throw new \exceptions\NotAuthenticatedException("user/login-failed", "Login failed");
+ }
+ }
+
+ return null;
+ }
+
+ function apilogin($apikey)
+ {
+ $this->require_session();
+
+ // get rid of spaces and newlines
+ $apikey = trim($apikey);
+
+ $query = $this->db->select('user, access_level')
+ ->from('apikeys')
+ ->where('key', $apikey)
+ ->get()->row_array();
+
+ if (isset($query["user"])) {
+ $this->session->set_userdata(array(
+ 'logged_in' => true,
+ 'username' => '',
+ 'userid' => $query["user"],
+ 'access_level' => $query["access_level"],
+ ));
+ return true;
+ }
+
+ throw new \exceptions\NotAuthenticatedException("user/api-login-failed", "API key login failed");
+ }
+
+ function logout()
+ {
+ $this->require_session();
+ $this->session->unset_userdata('logged_in');
+ $this->session->unset_userdata('username');
+ $this->session->unset_userdata('userid');
+ $this->session->sess_destroy();
+ }
+
+ function get_username()
+ {
+ if (!$this->logged_in()) {
+ return "";
+ }
+
+ return $this->session->userdata('username');
+ }
+
+ /*
+ * Check if a given username is valid.
+ *
+ * Valid usernames contain only lowercase characters and numbers. They are
+ * also <= 32 characters in length.
+ *
+ * @return boolean
+ */
+ public function valid_username($username)
+ {
+ return strlen($username) <= 32 && preg_match("/^[a-z0-9]+$/", $username);
+ }
+
+ /**
+ * Check if a given email is valid. Only perform minimal checking since
+ * verifying emails is very very difficuly.
+ *
+ * @return boolean
+ */
+ public function valid_email($email)
+ {
+ return $email === filter_var($email, FILTER_VALIDATE_EMAIL);
+ }
+
+ public function add_user($username, $password, $email, $referrer)
+ {
+ if (!$this->valid_username($username)) {
+ throw new \exceptions\UserInputException("user/invalid-username", "Invalid username (only up to 32 chars of a-z0-9 are allowed)");
+ } else {
+ if ($this->muser->username_exists($username)) {
+ throw new \exceptions\UserInputException("user/username-already-exists", "Username already exists");
+ }
+ }
+
+ if (!$this->valid_email($email)) {
+ throw new \exceptions\UserInputException("user/invalid-email", "Invalid email");
+ }
+
+ $this->db->set(array(
+ 'username' => $username,
+ 'password' => $this->hash_password($password),
+ 'email' => $email,
+ 'referrer' => $referrer
+ ))
+ ->insert('users');
+ }
+
+ /**
+ * Delete a user.
+ *
+ * @param username
+ * @param password
+ * @return true on sucess, false otherwise
+ */
+ public function delete_user($username, $password)
+ {
+ $this->duser->require_implemented("can_delete_account");
+
+ if ($this->duser->test_login_credentials($username, $password)) {
+ $this->delete_user_real($username);
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Delete a user
+ *
+ * @param username
+ * @return void
+ */
+ public function delete_user_real($username)
+ {
+ $this->duser->require_implemented("can_delete_account");
+ $userid = $this->get_userid_by_name($username);
+ if ($userid === null) {
+ throw new \exceptions\ApiException("user/delete", "User cannot be found", ["username" => $username]);
+ }
+
+ $this->db->delete('profiles', array('user' => $userid));
+
+ $this->load->model("mfile");
+ $this->load->model("mmultipaste");
+ $this->mfile->delete_by_user($userid);
+ $this->mmultipaste->delete_by_user($userid);
+
+ # null out user data to keep referer information traceable
+ # If referer information was relinked, one user could create many
+ # accounts, delete the account that was used to invite them and
+ # then cause trouble so that the account that invited him gets
+ # banned because the admin thinks that account invited abusers
+ $this->db->set(array(
+ 'username' => null,
+ 'password' => null,
+ 'email' => null,
+ ))
+ ->where(array('username' => $username))
+ ->update('users');
+ }
+
+ function get_userid()
+ {
+ if (!$this->logged_in()) {
+ return 0;
+ }
+
+ return $this->session->userdata("userid");
+ }
+
+ public function get_userid_by_name($username)
+ {
+ $query = $this->db->select('id')
+ ->from('users')
+ ->where('username', $username)
+ ->get()->row_array();
+ if ($query) {
+ return $query['id'];
+ }
+
+ return null;
+ }
+
+ function get_email($userid)
+ {
+ return $this->duser->get_email($userid);
+ }
+
+ public function get_access_levels()
+ {
+ return $this->access_levels;
+ }
+
+ private function check_access_level($wanted_level)
+ {
+ $session_level = $this->session->userdata("access_level");
+
+ $wanted = array_search($wanted_level, $this->get_access_levels());
+ $have = array_search($session_level, $this->get_access_levels());
+
+ if ($wanted === false || $have === false) {
+ throw new \exceptions\PublicApiException("api/invalid-accesslevel", "Failed to determine access level");
+ }
+
+ if ($have >= $wanted) {
+ return;
+ }
+
+ throw new \exceptions\InsufficientPermissionsException("api/insufficient-permissions", "Access denied: Access level too low. Required: $wanted_level; Have: $session_level");
+ }
+
+ function require_access($wanted_level = "full")
+ {
+ if ($this->input->post("apikey") !== null) {
+ $this->apilogin($this->input->post("apikey"));
+ }
+
+ //if (is_api_client()) {
+ //$this->login_api_client();
+ //}
+
+ if ($this->logged_in()) {
+ return $this->check_access_level($wanted_level);
+ }
+
+ throw new \exceptions\NotAuthenticatedException("api/not-authenticated", "Not authenticated. FileBin requires you to have an account, please go to the homepage at ".site_url()." for more information.");
+ }
+
+ function username_exists($username)
+ {
+ return $this->duser->username_exists($username);
+ }
+
+ function get_action($action, $key)
+ {
+ $query = $this->db->from('actions')
+ ->where('key', $key)
+ ->where('action', $action)
+ ->get()->row_array();
+
+ if (!isset($query["key"]) || $key !== $query["key"]) {
+ throw new \exceptions\UserInputException("user/get_action/invalid-action", "Invalid action key. Has the key been used already?");
+ }
+
+ return $query;
+ }
+
+ public function get_profile_data()
+ {
+ $userid = $this->get_userid();
+
+ $fields = array(
+ "user" => $userid,
+ "upload_id_limits" => $this->default_upload_id_limits,
+ );
+
+ $query = $this->db->select(implode(', ', array_keys($fields)))
+ ->from('profiles')
+ ->where('user', $userid)
+ ->get()->row_array();
+
+ if ($query === null) {
+ $query = [];
+ }
+
+ $extra_fields = array(
+ "username" => $this->get_username(),
+ "email" => $this->get_email($userid),
+ );
+
+ return array_merge($fields, $query, $extra_fields);
+ }
+
+ public function update_profile($data)
+ {
+ assert(is_array($data));
+
+ $data["user"] = $this->get_userid();
+
+ $exists_in_db = $this->db->get_where("profiles", array("user" => $data["user"]))->num_rows() > 0;
+
+ if ($exists_in_db) {
+ $this->db->where("user", $data["user"]);
+ $this->db->update("profiles", $data);
+ } else {
+ $this->db->insert("profiles", $data);
+ }
+ }
+
+ public function set_password($userid, $password) {
+ $this->db->where('id', $userid)
+ ->update('users', array(
+ 'password' => $this->hash_password($password)
+ ));
+ }
+
+ public function rehash_password($userid, $password, $hash) {
+ if (password_needs_rehash($hash, $this->hashalgo, $this->hashoptions)) {
+ $this->set_password($userid, $password);
+ }
+ }
+
+ public function get_upload_id_limits()
+ {
+ $userid = $this->get_userid();
+
+ $query = $this->db->select('upload_id_limits')
+ ->from('profiles')
+ ->where('user', $userid)
+ ->get()->row_array();
+
+ if (empty($query)) {
+ return explode("-", $this->default_upload_id_limits);
+ }
+
+ return explode("-", $query["upload_id_limits"]);
+ }
+
+ function hash_password($password)
+ {
+ $hash = password_hash($password, $this->hashalgo, $this->hashoptions);
+ if ($hash === false) {
+ throw new \exceptions\ApiException('user/hash_password/failed', "Failed to hash password");
+ }
+ return $hash;
+ }
+
+}
+
diff --git a/application/service/files.php b/application/service/files.php
new file mode 100644
index 000000000..a98e0873f
--- /dev/null
+++ b/application/service/files.php
@@ -0,0 +1,553 @@
+<?php
+/*
+ * Copyright 2014 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+namespace service;
+
+class files {
+
+ static public function history($user)
+ {
+ $CI =& get_instance();
+ $items = array();
+
+ $fields = array("files.id", "filename", "mimetype", "files.date", "hash", "filesize");
+ $query = $CI->db->select(implode(',', $fields))
+ ->from('files')
+ ->join('file_storage', 'file_storage.id = files.file_storage_id')
+ ->where('user', $user)
+ ->get()->result_array();
+ foreach ($query as $key => $item) {
+ if (\libraries\Image::type_supported($item["mimetype"])) {
+ $item['thumbnail'] = site_url("file/thumbnail/".$item['id']);
+ }
+ $items[$item["id"]] = $item;
+ }
+
+ $total_size = $CI->db->query("
+ SELECT coalesce(sum(sub.filesize), 0) sum
+ FROM (
+ SELECT DISTINCT fs.id, filesize
+ FROM ".$CI->db->dbprefix."file_storage fs
+ JOIN ".$CI->db->dbprefix."files f ON fs.id = f.file_storage_id
+ WHERE f.user = ?
+
+ ) sub
+ ", array($user))->row_array();
+
+ $ret["items"] = $items;
+ $ret["multipaste_items"] = self::get_multipaste_history($user);
+ $ret["total_size"] = $total_size["sum"];
+
+ return $ret;
+ }
+
+ static private function get_multipaste_history($user)
+ {
+ $CI =& get_instance();
+ $multipaste_items_grouped = array();
+ $multipaste_items = array();
+
+ $query = $CI->db
+ ->select('m.url_id, m.date')
+ ->from("multipaste m")
+ ->where("user_id", $user)
+ ->get()->result_array();
+ $multipaste_info = array();
+ foreach ($query as $item) {
+ $multipaste_info[$item["url_id"]] = $item;
+ }
+
+ $multipaste_items_query = $CI->db
+ ->select("m.url_id, f.id")
+ ->from("multipaste m")
+ ->join("multipaste_file_map mfm", "m.multipaste_id = mfm.multipaste_id")
+ ->join("files f", "f.id = mfm.file_url_id")
+ ->where("m.user_id", $user)
+ ->order_by("mfm.sort_order")
+ ->get()->result_array();
+
+ $counter = 0;
+
+ foreach ($multipaste_items_query as $item) {
+ $multipaste_info[$item["url_id"]]["items"][$item["id"]] = array(
+ "id" => $item["id"],
+ // normalize sort_order value so we don't leak any information
+ "sort_order" => $counter++,
+ );
+ }
+
+ // No idea why, but this can/could happen so be more forgiving and clean up
+ foreach ($multipaste_info as $key => $m) {
+ if (!isset($m["items"])) {
+ $CI->mmultipaste->delete_id($key);
+ unset($multipaste_info[$key]);
+ }
+ }
+
+ return $multipaste_info;
+ }
+
+ static public function add_file_data($userid, $id, $content, $filename)
+ {
+ $f = new \libraries\Tempfile();
+ $file = $f->get_file();
+ file_put_contents($file, $content);
+ self::add_file_callback($userid, $id, $file, $filename);
+ }
+
+ /**
+ * Ellipsize text to be at max $max_lines lines long. If the last line is
+ * not complete (strlen($text) < $filesize), drop it so that every line of
+ * the returned text is complete. If there is only one line, return that
+ * line as is and add the ellipses at the end.
+ *
+ * @param text Text to add ellipses to
+ * @param max_lines Number of lines the returned text should contain
+ * @param filesize size of the original file where the text comes from
+ * @return ellipsized text
+ */
+ static public function ellipsize($text, $max_lines, $filesize)
+ {
+ $lines = explode("\n", $text);
+ $orig_len = strlen($text);
+ $orig_linecount = count($lines);
+
+ if ($orig_linecount > 1) {
+ if ($orig_len < $filesize) {
+ // ensure we have a full line at the end
+ $lines = array_slice($lines, 0, -1);
+ }
+
+ if (count($lines) > $max_lines) {
+ $lines = array_slice($lines, 0, $max_lines);
+ }
+
+ if (count($lines) != $orig_linecount) {
+ // only add elipses when we drop at least one line
+ $lines[] = "...";
+ }
+ } elseif ($orig_len < $filesize) {
+ $lines[count($lines) - 1] .= " ...";
+ }
+
+ return implode("\n", $lines);
+ }
+
+ static public function add_uploaded_file($userid, $id, $file, $filename)
+ {
+ self::add_file_callback($userid, $id, $file, $filename);
+ }
+
+ static private function add_file_callback($userid, $id, $new_file, $filename)
+ {
+ $CI =& get_instance();
+ $hash = md5_file($new_file);
+ $storage_id = null;
+
+ $CI->db->trans_start();
+ $query = $CI->db->select('id, hash')
+ ->from('file_storage')
+ ->where('hash', $hash)
+ ->get()->result_array();
+
+ foreach($query as $row) {
+ $data_id = implode("-", array($row['hash'], $row['id']));
+ $old_file = $CI->mfile->file($data_id);
+
+ if (files_are_equal($old_file, $new_file)) {
+ $storage_id = $row["id"];
+ break;
+ }
+ }
+
+ $new_storage_id_created = false;
+ if ($storage_id === null) {
+ $filesize = filesize($new_file);
+ $mimetype = mimetype($new_file);
+
+ $CI->db->insert("file_storage", array(
+ "filesize" => $filesize,
+ "mimetype" => $mimetype,
+ "hash" => $hash,
+ "date" => time(),
+ ));
+ $storage_id = $CI->db->insert_id();
+ $new_storage_id_created = true;
+ assert(!file_exists($CI->mfile->file($hash."-".$storage_id)));
+ }
+ $data_id = $hash."-".$storage_id;
+
+ $dir = $CI->mfile->folder($data_id);
+ file_exists($dir) || mkdir ($dir);
+ $new_path = $CI->mfile->file($data_id);
+
+ // Update mtime for cronjob
+ touch($new_path);
+
+ // touch may create a new file if the cronjob cleaned up in between the db check and here.
+ // In that case the file will be empty so move in the data
+ if ($new_storage_id_created || filesize($new_path) === 0) {
+ $dest = new \service\storage($new_path);
+ $tmpfile = $dest->begin();
+
+ // $new_file may reside on a different file system so this call
+ // could perform a copy operation internally. $dest->commit() will
+ // ensure that it performs an atomic overwrite (rename).
+ rename($new_file, $tmpfile);
+ $dest->commit();
+ }
+
+ $CI->mfile->add_file($userid, $id, $filename, $storage_id);
+ $CI->db->trans_complete();
+ }
+
+ static public function verify_uploaded_files($files)
+ {
+ $CI =& get_instance();
+ $errors = array();
+
+ if (empty($files)) {
+ throw new \exceptions\UserInputException("file/no-file", "No file was uploaded or unknown error occured.");
+ }
+
+ foreach ($files as $key => $file) {
+ $error_message = "";
+
+ // getNormalizedFILES() removes any file with error == 4
+ if ($file['error'] !== UPLOAD_ERR_OK) {
+ // ERR_OK only for completeness, condition above ignores it
+ $error_msgs = array(
+ UPLOAD_ERR_OK => "There is no error, the file uploaded with success",
+ UPLOAD_ERR_INI_SIZE => "The uploaded file exceeds the upload_max_filesize directive in php.ini",
+ UPLOAD_ERR_FORM_SIZE => "The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form",
+ UPLOAD_ERR_PARTIAL => "The uploaded file was only partially uploaded",
+ UPLOAD_ERR_NO_FILE => "No file was uploaded",
+ UPLOAD_ERR_NO_TMP_DIR => "Missing a temporary folder",
+ UPLOAD_ERR_CANT_WRITE => "Failed to write file to disk",
+ UPLOAD_ERR_EXTENSION => "A PHP extension stopped the file upload",
+ );
+
+ $error_message = "Unknown error.";
+
+ if (isset($error_msgs[$file['error']])) {
+ $error_message = $error_msgs[$file['error']];
+ } else {
+ $error_message = "Unknown error code: ".$file['error'].". Please report a bug.";
+ }
+ }
+
+ $filesize = filesize($file['tmp_name']);
+ if ($filesize > $CI->config->item('upload_max_size')) {
+ $error_message = "File too big";
+ }
+
+ if ($error_message != "") {
+ $errors[$file["formfield"]] = array(
+ "filename" => $file["name"],
+ "formfield" => $file["formfield"],
+ "message" => $error_message,
+ );
+ throw new \exceptions\FileUploadVerifyException("file/upload-verify", "Failed to verify uploaded file(s)", $errors);
+ }
+ }
+ }
+
+ // TODO: streamline this interface to be somewhat atomic in regards to
+ // wrong owner/unknown ids (verify first and throw exception)
+ static public function delete($ids)
+ {
+ $CI =& get_instance();
+
+ $userid = $CI->muser->get_userid();
+ $errors = array();
+ $deleted = array();
+ $deleted_count = 0;
+ $total_count = 0;
+
+ if (!$ids || !is_array($ids)) {
+ throw new \exceptions\UserInputException("file/delete/no-ids", "No IDs specified");
+ }
+
+ foreach ($ids as $id) {
+ $total_count++;
+ $nextID = false;
+
+ foreach (array($CI->mfile, $CI->mmultipaste) as $model) {
+ if ($model->id_exists($id)) {
+ if ($model->get_owner($id) !== $userid) {
+ $errors[$id] = array(
+ "id" => $id,
+ "reason" => "wrong owner",
+ );
+ $nextID = true;
+ continue;
+ }
+ if ($model->delete_id($id)) {
+ $deleted[$id] = array(
+ "id" => $id,
+ );
+ $deleted_count++;
+ $nextID = true;
+ } else {
+ $errors[$id] = array(
+ "id" => $id,
+ "reason" => "unknown error",
+ );
+ }
+ }
+ }
+
+ if ($nextID) {
+ continue;
+ }
+
+ $errors[$id] = array(
+ "id" => $id,
+ "reason" => "doesn't exist",
+ );
+ }
+
+ return array(
+ "errors" => $errors,
+ "deleted" => $deleted,
+ "total_count" => $total_count,
+ "deleted_count" => $deleted_count,
+ );
+ }
+
+ static public function create_multipaste($ids, $userid, $limits)
+ {
+ $CI =& get_instance();
+
+ if (!$ids || !is_array($ids)) {
+ throw new \exceptions\UserInputException("file/create_multipaste/no-ids", "No IDs specified");
+ }
+
+ if (count(array_unique($ids)) != count($ids)) {
+ throw new \exceptions\UserInputException("file/create_multipaste/duplicate-id", "Duplicate IDs are not supported");
+ }
+
+ $errors = array();
+
+ foreach ($ids as $id) {
+ if (!$CI->mfile->id_exists($id)) {
+ $errors[$id] = array(
+ "id" => $id,
+ "reason" => "doesn't exist",
+ );
+ continue;
+ }
+
+ $filedata = $CI->mfile->get_filedata($id);
+ if ($filedata["user"] != $userid) {
+ $errors[$id] = array(
+ "id" => $id,
+ "reason" => "not owned by you",
+ );
+ }
+ }
+
+ if (!empty($errors)) {
+ throw new \exceptions\VerifyException("file/create_multipaste/verify-failed", "Failed to verify ID(s)", $errors);
+ }
+
+ $url_id = $CI->mmultipaste->new_id($limits[0], $limits[1]);
+
+ $multipaste_id = $CI->mmultipaste->get_multipaste_id($url_id);
+ assert($multipaste_id !== false);
+
+ foreach ($ids as $id) {
+ $CI->db->insert("multipaste_file_map", array(
+ "file_url_id" => $id,
+ "multipaste_id" => $multipaste_id,
+ ));
+ }
+
+ return array(
+ "url_id" => $url_id,
+ "url" => site_url($url_id)."/",
+ );
+ }
+
+ static public function valid_id(array $filedata, array $config, $model, $current_date)
+ {
+ assert(isset($filedata["data_id"]));
+ assert(isset($filedata["id"]));
+ assert(isset($filedata["user"]));
+ assert(isset($filedata["date"]));
+ assert(isset($config["upload_max_age"]));
+ assert(isset($config["sess_expiration"]));
+ assert(isset($config["small_upload_size"]));
+
+ $file = $model->file($filedata['data_id']);
+
+ if (!$model->file_exists($file)) {
+ $model->delete_data_id($filedata["data_id"]);
+ return false;
+ }
+
+ if ($filedata["user"] == 0) {
+ if ($filedata["date"] < $current_date - $config["sess_expiration"]) {
+ $model->delete_id($filedata["id"]);
+ return false;
+ }
+ }
+
+ // 0 age disables age checks
+ if ($config['upload_max_age'] == 0) return true;
+
+ // small files don't expire
+ if ($model->filesize($file) <= $config["small_upload_size"]) {
+ return true;
+ }
+
+ // files older than this should be removed
+ $remove_before = $current_date - $config["upload_max_age"];
+
+ if ($filedata["date"] < $remove_before) {
+ // if the file has been uploaded multiple times the mtime is the time
+ // of the last upload
+ $mtime = $model->filemtime($file);
+ if ($mtime < $remove_before) {
+ $model->delete_data_id($filedata["data_id"]);
+ } else {
+ $model->delete_id($filedata["id"]);
+ }
+ return false;
+ }
+
+ return true;
+ }
+
+ static public function tooltip(array $filedata)
+ {
+ $filesize = format_bytes($filedata["filesize"]);
+ $file = get_instance()->mfile->file($filedata["data_id"]);
+ $upload_date = date("r", $filedata["date"]);
+
+ $height = 0;
+ $width = 0;
+ try {
+ list($width, $height) = getimagesize($file);
+ } catch (\ErrorException $e) {
+ // likely unsupported filetype
+ }
+
+ $tooltip = "${filedata["id"]} - $filesize<br>";
+ $tooltip .= "$upload_date<br>";
+
+
+ if ($height > 0 && $width > 0) {
+ $tooltip .= "${width}x${height} - ${filedata["mimetype"]}<br>";
+ } else {
+ $tooltip .= "${filedata["mimetype"]}<br>";
+ }
+
+ return $tooltip;
+ }
+
+ static public function clean_multipaste_tarballs()
+ {
+ $CI =& get_instance();
+
+ $tarball_dir = $CI->config->item("upload_path")."/special/multipaste-tarballs";
+ if (is_dir($tarball_dir)) {
+ $tarball_cache_time = $CI->config->item("tarball_cache_time");
+ $it = new \RecursiveIteratorIterator(
+ new \RecursiveDirectoryIterator($tarball_dir), \RecursiveIteratorIterator::SELF_FIRST);
+
+ foreach ($it as $file) {
+ if ($file->isFile()) {
+ if ($file->getMTime() < time() - $tarball_cache_time) {
+ $lock = fopen($file, "r+");
+ flock($lock, LOCK_EX);
+ unlink($file);
+ flock($lock, LOCK_UN);
+ }
+ }
+ }
+ }
+ }
+
+ static public function remove_files_missing_in_db()
+ {
+ $CI =& get_instance();
+
+ $upload_path = $CI->config->item("upload_path");
+ $outer_dh = opendir($upload_path);
+
+ while (($dir = readdir($outer_dh)) !== false) {
+ if (!is_dir($upload_path."/".$dir) || $dir == ".." || $dir == "." || $dir == "special") {
+ continue;
+ }
+
+ $dh = opendir($upload_path."/".$dir);
+
+ $empty = true;
+
+ while (($file = readdir($dh)) !== false) {
+ if ($file == ".." || $file == ".") {
+ continue;
+ }
+
+ try {
+ list($hash, $storage_id) = explode("-", $file);
+ } catch (\ErrorException $e) {
+ unlink($upload_path."/".$dir."/".$file);
+ continue;
+ }
+
+ $query = $CI->db->select('hash, id')
+ ->from('file_storage')
+ ->where('hash', $hash)
+ ->where('id', $storage_id)
+ ->limit(1)
+ ->get()->row_array();
+
+ if (empty($query)) {
+ $CI->mfile->delete_data_id($file);
+ } else {
+ $empty = false;
+ }
+ }
+
+ closedir($dh);
+
+ if ($empty && file_exists($upload_path."/".$dir)) {
+ rmdir($upload_path."/".$dir);
+ }
+ }
+ closedir($outer_dh);
+ }
+
+ static public function remove_files_missing_on_disk()
+ {
+ $CI =& get_instance();
+
+ $chunk = 500;
+ $total = $CI->db->count_all("file_storage");
+
+ for ($limit = 0; $limit < $total; $limit += $chunk) {
+ $query = $CI->db->select('hash, id')
+ ->from('file_storage')
+ ->limit($chunk, $limit)
+ ->get()->result_array();
+
+ foreach ($query as $key => $item) {
+ $data_id = $item["hash"].'-'.$item['id'];
+ $file = $CI->mfile->file($data_id);
+
+ if (!$CI->mfile->file_exists($file)) {
+ $CI->mfile->delete_data_id($data_id);
+ }
+ }
+ }
+ }
+
+}
diff --git a/application/service/multipaste_queue.php b/application/service/multipaste_queue.php
new file mode 100644
index 000000000..553e9a6c2
--- /dev/null
+++ b/application/service/multipaste_queue.php
@@ -0,0 +1,96 @@
+<?php
+/*
+ * Copyright 2016 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+namespace service;
+
+class multipaste_queue {
+
+ public function __construct($session = null, $mfile = null, $mmultipaste = null) {
+ $CI =& get_instance();
+
+ $this->session = $session;
+ $this->mfile = $mfile;
+ $this->mmultipaste = $mmultipaste;
+
+ if ($this->session === null) {
+ $this->session = $CI->session;
+ }
+
+ if ($this->mfile === null) {
+ $CI->load->model("mfile");
+ $this->mfile = $CI->mfile;
+ }
+
+ if ($this->mmultipaste === null) {
+ $CI->load->model("mmultipaste");
+ $this->mmultipaste = $CI->mmultipaste;
+ }
+ }
+
+ /**
+ * Append ids to the queue
+ *
+ * @param array ids
+ * @return void
+ */
+ public function append(array $ids) {
+ $old_ids = $this->get();
+
+ # replace multipaste ids with their corresponding paste ids
+ $ids = array_map(function($id) {return array_values($this->resolve_multipaste($id));}, $ids);
+ $ids = array_reduce($ids, function($a, $b) {return array_merge($a, $b);}, []);
+
+ $ids = array_unique(array_merge($old_ids, $ids));
+ $this->set($ids);
+ }
+
+ /**
+ * Return array of ids in a multipaste if the argument id is a multipaste.
+ * Otherwise return an array containing just the argument id.
+ *
+ * @param id
+ * @return array of ids
+ */
+ private function resolve_multipaste($id) {
+ if (strpos($id, "m-") === 0) {
+ if ($this->mmultipaste->valid_id($id)) {
+ return array_map(function($filedata) {return $filedata['id'];}, $this->mmultipaste->get_files($id));
+ }
+ }
+ return [$id];
+ }
+
+ /**
+ * Get the queue
+ *
+ * @return array of ids
+ */
+ public function get() {
+ $ids = $this->session->userdata("multipaste_queue");
+ if ($ids === NULL) {
+ $ids = [];
+ }
+
+ assert(is_array($ids));
+ return $ids;
+ }
+
+ /**
+ * Set the queue to $ids
+ *
+ * @param array ids
+ * @return void
+ */
+ public function set(array $ids) {
+ $ids = array_filter($ids, function($id) {return $this->mfile->valid_id($id);});
+
+ $this->session->set_userdata("multipaste_queue", $ids);
+ }
+
+}
diff --git a/application/service/renderer.php b/application/service/renderer.php
new file mode 100644
index 000000000..6baf62c78
--- /dev/null
+++ b/application/service/renderer.php
@@ -0,0 +1,187 @@
+<?php
+/*
+ * Copyright 2017 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+namespace service;
+class renderer {
+
+
+ /**
+ * @param $output_cache output cache object
+ * @param $mfile mfile object
+ * @param $data data for the rendering of views
+ */
+ public function __construct($output_cache, $mfile, $data)
+ {
+ $this->output_cache = $output_cache;
+ $this->mfile = $mfile;
+ $this->data = $data;
+ }
+
+ private function colorify($file, $lexer, $anchor_id = false)
+ {
+ $output = "";
+ $lines_to_remove = 0;
+
+ $output .= '<div class="code content table">'."\n";
+ $output .= '<div class="highlight"><code class="code-container">'."\n";
+
+ $content = file_get_contents($file);
+
+ $linecount = count(explode("\n", $content));
+ $content = $this->reformat_json($lexer, $linecount, $content);
+
+ if ($lexer == "ascii") {
+ // TODO: use exec safe and catch exception
+ $ret = (new \libraries\ProcRunner(array('ansi2html', '-p', '-m')))
+ ->input($content)
+ ->forbid_stderr()
+ ->exec();
+ // Last line is empty
+ $lines_to_remove = 1;
+ } else {
+ // TODO: use exec safe and catch exception
+ $ret = (new \libraries\ProcRunner(array('pygmentize', '-F', 'codetagify', '-O', 'encoding=guess,outencoding=utf8,stripnl=False', '-l', $lexer, '-f', 'html')))
+ ->input($content)
+ ->exec();
+ // Last 2 items are "</pre></div>" and ""
+ $lines_to_remove = 2;
+ }
+
+
+ $buf = explode("\n", $ret["stdout"]);
+ $line_count = count($buf);
+
+ for ($i = 1; $i <= $lines_to_remove; $i++) {
+ unset($buf[$line_count - $i]);
+ }
+
+ foreach ($buf as $key => $line) {
+ $line_number = $key + 1;
+ if ($key == 0) {
+ $line = str_replace("<div class=\"highlight\"><pre>", "", $line);
+ }
+
+ $anchor = "n$line_number";
+ if ($anchor_id !== false) {
+ $anchor = "n-$anchor_id-$line_number";
+ }
+
+ if ($line === "") {
+ $line = "<br>";
+ }
+
+ // Be careful not to add superflous whitespace here (we are in a <code>)
+ $output .= "<div class=\"table-row\">"
+ ."<a href=\"#$anchor\" class=\"linenumber table-cell\">"
+ ."<span class=\"anchor\" id=\"$anchor\"> </span>"
+ ."</a>"
+ ."<span class=\"line table-cell\">".$line."</span><!--\n";
+ $output .= "--></div>";
+ }
+
+ $output .= "</code></div>";
+ $output .= "</div>";
+
+ return array(
+ "return_value" => $ret["return_code"],
+ "output" => $output
+ );
+ }
+
+ public function highlight_file($filedata, $lexer, $is_multipaste)
+ {
+ // highlight the file and cache the result, fall back to plain text if $lexer fails
+ foreach (array($lexer, "text") as $lexer) {
+ $highlit = cache_function($filedata['data_id'].'_'.$lexer, 100,
+ function() use ($filedata, $lexer, $is_multipaste) {
+ $file = $this->mfile->file($filedata['data_id']);
+ if ($lexer == "rmd") {
+ ob_start();
+
+ echo '<div class="code content table markdownrender">'."\n";
+ echo '<div class="table-row">'."\n";
+ echo '<div class="table-cell">'."\n";
+
+ require_once(APPPATH."/third_party/parsedown/Parsedown.php");
+ $parsedown = new \Parsedown();
+ echo $parsedown->text(file_get_contents($file));
+
+ echo '</div></div></div>';
+
+ return array(
+ "output" => ob_get_clean(),
+ "return_value" => 0,
+ );
+ } else {
+ return $this->colorify($file, $lexer, $is_multipaste ? $filedata["id"] : false);
+ }
+ });
+
+ if ($highlit["return_value"] == 0) {
+ break;
+ } else {
+ $message = "Error trying to process the file. Either the lexer is unknown or something is broken.";
+ if ($lexer != "text") {
+ $message .= " Falling back to plain text.";
+ }
+ $this->output_cache->render_now(
+ array("error_message" => "<p>$message</p>"),
+ "file/fragments/alert-wide"
+ );
+ }
+ }
+
+ $data = array_merge($this->data, array(
+ 'title' => htmlspecialchars($filedata['filename']),
+ 'id' => $filedata["id"],
+ 'current_highlight' => htmlspecialchars($lexer),
+ 'timeout' => $this->mfile->get_timeout_string($filedata["id"]),
+ 'filedata' => $filedata,
+ ));
+
+ $this->output_cache->render_now($data, 'file/html_paste_header');
+ $this->output_cache->render_now($highlit["output"]);
+ $this->output_cache->render_now($data, 'file/html_paste_footer');
+ }
+
+ /**
+ * @param $lexer
+ * @param $linecount
+ * @param $content
+ * @return string
+ */
+ private function reformat_json($lexer, $linecount, $content)
+ {
+ if ($lexer !== "json" || $linecount !== 1) {
+ return $content;
+ }
+
+ $decoded_json = json_decode($content);
+ if ($decoded_json === null || $decoded_json === false) {
+ return $content;
+ }
+
+ $pretty_json = json_encode($decoded_json, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
+ if ($pretty_json === false) {
+ return $content;
+ }
+
+ $this->output_cache->render_now(
+ array(
+ "error_type" => "alert-info",
+ "error_message" => "<p>The file below has been reformated for readability. It may differ from the original.</p>"
+ ),
+ "file/fragments/alert-wide"
+ );
+
+ return $pretty_json;
+ }
+
+
+}
diff --git a/application/service/storage.php b/application/service/storage.php
new file mode 100644
index 000000000..b2c2abca7
--- /dev/null
+++ b/application/service/storage.php
@@ -0,0 +1,160 @@
+<?php
+/*
+ * Copyright 2014 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+namespace service;
+
+/**
+ * This class allows to change a temporary file and replace the original one atomically
+ */
+class storage {
+ private $path;
+ private $tempfile = NULL;
+
+ public function __construct($path)
+ {
+ assert(!is_dir($path));
+
+ $this->path = $path;
+ }
+
+ /**
+ * Create a temp file which can be written to.
+ *
+ * Call commit() once you are done writing.
+ * Call rollback() to remove the file and throw away any data written.
+ *
+ * Calling this multiple times will automatically rollback previous calls.
+ *
+ * @return temp file path
+ */
+ public function begin()
+ {
+ if($this->tempfile !== NULL) {
+ $this->rollback();
+ }
+
+ $this->tempfile = $this->create_tempfile();
+
+ return $this->tempfile;
+ }
+
+ /**
+ * Create a temporary file. You'll need to remove it yourself when no longer needed.
+ *
+ * @return path to the temporary file
+ */
+ private function create_tempfile()
+ {
+ $dir = dirname($this->get_file());
+ $prefix = basename($this->get_file());
+
+ if (!is_dir($dir)) {
+ mkdir($dir, 0777, true);
+ }
+ assert(is_dir($dir));
+
+ return tempnam($dir, $prefix);
+ }
+
+ /**
+ * Save the temporary file returned by begin() to the permanent path
+ * (supplied to the constructor) in an atomic fashion.
+ */
+ public function commit()
+ {
+ $ret = rename($this->tempfile, $this->get_file());
+ if ($ret) {
+ $this->tempfile = NULL;
+ }
+
+ return $ret;
+ }
+
+ public function exists()
+ {
+ return file_exists($this->get_file());
+ }
+
+ public function get_file()
+ {
+ return $this->path;
+ }
+
+ /**
+ * Throw away any changes made to the temporary file returned by begin()
+ */
+ public function rollback()
+ {
+ if ($this->tempfile !== NULL) {
+ unlink($this->tempfile);
+ $this->tempfile = NULL;
+ }
+ }
+
+ public function __destruct()
+ {
+ $this->rollback();
+ }
+
+ /**
+ * GZIPs the temp file
+ *
+ * From http://stackoverflow.com/questions/6073397/how-do-you-create-a-gz-file-using-php
+ * Based on function by Kioob at:
+ * http://www.php.net/manual/en/function.gzwrite.php#34955
+ *
+ * @param integer $level GZIP compression level (default: 6)
+ * @return boolean true if operation succeeds, false on error
+ */
+ public function gzip_compress($level = 6){
+ if ($this->tempfile === NULL) {
+ return;
+ }
+
+ $source = $this->tempfile;
+ $file = new storage($source);
+ $dest = $file->begin();
+ $mode = 'wb' . $level;
+ $error = false;
+ $chunk_size = 1024*512;
+
+ if ($fp_out = gzopen($dest, $mode)) {
+ if ($fp_in = fopen($source,'rb')) {
+ while (!feof($fp_in)) {
+ gzwrite($fp_out, fread($fp_in, $chunk_size));
+ }
+ fclose($fp_in);
+ } else {
+ $error = true;
+ }
+ gzclose($fp_out);
+ } else {
+ $error = true;
+ }
+
+ if ($error) {
+ return false;
+ } else {
+ $file->commit();
+ return true;
+ }
+ }
+
+ /**
+ * Delete the file if it exists.
+ */
+ public function unlink()
+ {
+ if ($this->exists()) {
+ unlink($this->get_file());
+ }
+ }
+}
+
+# vim: set noet:
diff --git a/application/service/user.php b/application/service/user.php
new file mode 100644
index 000000000..1d678106a
--- /dev/null
+++ b/application/service/user.php
@@ -0,0 +1,128 @@
+<?php
+/*
+ * Copyright 2014 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+namespace service;
+
+class user {
+
+ /**
+ * Create a new api key.
+ *
+ * Refer to Muser->get_access_levels() for a list of valid access levels.
+ *
+ * @param userid ID of the user
+ * @param comment free text comment describing the api key/it's usage/allowing to identify the key
+ * @param access_level access level of the key
+ * @return the new key
+ */
+ static public function create_apikey($userid, $comment, $access_level)
+ {
+ $CI =& get_instance();
+
+ $valid_levels = $CI->muser->get_access_levels();
+ if (array_search($access_level, $valid_levels) === false) {
+ throw new \exceptions\UserInputException("user/validation/access_level/invalid", "Invalid access levels requested.");
+ }
+
+ if (strlen($comment) > 255) {
+ throw new \exceptions\UserInputException("user/validation/comment/too-long", "Comment may only be 255 chars long.");
+ }
+
+ $key = random_alphanum(32);
+
+ $CI->db->set(array(
+ 'key' => $key,
+ 'user' => $userid,
+ 'comment' => $comment,
+ 'access_level' => $access_level
+ ))
+ ->insert('apikeys');
+
+ return $key;
+ }
+
+ /**
+ * Get apikeys for a user
+ * @param userid ID of the user
+ * @return array with the key data
+ */
+ static public function apikeys($userid)
+ {
+ $CI =& get_instance();
+ $ret = array();
+
+ $query = $CI->db->select('key, created, comment, access_level')
+ ->from('apikeys')
+ ->where('user', $userid)
+ ->order_by('created', 'desc')
+ ->get()->result_array();
+
+ // Convert timestamp to unix timestamp
+ // TODO: migrate database to integer timestamp and get rid of this
+ foreach ($query as &$record) {
+ if (!empty($record['created'])) {
+ $record['created'] = strtotime($record['created']);
+ }
+ $ret[$record["key"]] = $record;
+ }
+ unset($record);
+
+ return array(
+ "apikeys" => $ret,
+ );
+ }
+
+ /**
+ * Create an invitation key for a user
+ * @param userid id of the user
+ * @return key the created invitation key
+ */
+ static public function create_invitation_key($userid) {
+ $CI =& get_instance();
+
+ $invitations = $CI->db->select('user')
+ ->from('actions')
+ ->where('user', $userid)
+ ->where('action', 'invitation')
+ ->count_all_results();
+
+ if ($invitations + 1 > $CI->config->item('max_invitation_keys')) {
+ throw new \exceptions\InsufficientPermissionsException("user/invitation-limit", "You can't create more invitation keys at this time.");
+ }
+
+ $key = random_alphanum(12, 16);
+
+ $CI->db->set(array(
+ 'key' => $key,
+ 'user' => $userid,
+ 'date' => time(),
+ 'action' => 'invitation'
+ ))
+ ->insert('actions');
+
+ return $key;
+ }
+
+ /**
+ * Remove an invitation key belonging to a user
+ * @param userid id of the user
+ * @param key key to remove
+ * @return number of removed keys
+ */
+ static public function delete_invitation_key($userid, $key) {
+ $CI =& get_instance();
+
+ $CI->db
+ ->where('key', $key)
+ ->where('user', $userid)
+ ->delete('actions');
+
+ return $CI->db->affected_rows();
+ }
+}
diff --git a/application/test/Test.php b/application/test/Test.php
new file mode 100644
index 000000000..b8052fbba
--- /dev/null
+++ b/application/test/Test.php
@@ -0,0 +1,186 @@
+<?php
+/*
+ * Copyright 2015 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+namespace test;
+
+require_once APPPATH."/third_party/test-more-php/Test-More-OO.php";
+
+class TestMore extends \TestMore {
+ private $TestNamePrefix = "";
+
+ public function setTestNamePrefix($prefix) {
+ $this->TestNamePrefix = $prefix;
+ }
+
+ public function ok ($Result = NULL, $TestName = NULL) {
+ return parent::ok($Result, $this->TestNamePrefix.$TestName);
+ }
+}
+
+abstract class Test {
+ protected $t;
+ protected $server_url = "";
+ private $testid = "";
+ private $server_proc = null;
+
+ public function __construct()
+ {
+ $this->t = new TestMore();
+ $this->t->plan("no_plan");
+ }
+
+ public function __destruct()
+ {
+ if ($this->server_proc) {
+ proc_terminate($this->server_proc);
+ }
+ }
+
+ public function startServer($port)
+ {
+ $url = "http://127.0.0.1:$port/index.php";
+
+ $pipes = [];
+ $descriptorspec = [
+ 0 => ['file', '/dev/null', 'r'],
+ 1 => STDOUT,
+ 2 => STDOUT,
+ ];
+
+ $this->server_proc = proc_open("php -S 127.0.0.1:$port", $descriptorspec, $pipes);
+
+ $this->wait_for_server($url);
+ $this->server_url = $url;
+ }
+
+ private function wait_for_server($url)
+ {
+ while (!$this->url_is_reachable($url)) {
+ echo "Waiting for server at $url to start...\n";
+ usleep(10000);
+ }
+ }
+
+ private function url_is_reachable($url)
+ {
+ $handle = curl_init($url);
+ curl_setopt($handle, CURLOPT_RETURNTRANSFER, TRUE);
+ curl_exec($handle);
+ $status = curl_getinfo($handle, CURLINFO_HTTP_CODE);
+ curl_close($handle);
+
+ if ($status == 200) {
+ return true;
+ }
+
+ return false;
+ }
+
+ public function setTestID($testid)
+ {
+ $this->testid = $testid;
+ }
+
+ // Method: POST, PUT, GET etc
+ // Data: array("param" => "value") ==> index.php?param=value
+ // Source: http://stackoverflow.com/a/9802854/953022
+ protected function CallAPI($method, $url, $data = false, $return_json = false)
+ {
+ $result = $this->SendHTTPRequest($method, $url, $data);
+
+ if ($return_json) {
+ return $result;
+ }
+
+ $json = json_decode($result, true);
+ if ($json === NULL) {
+ $this->t->fail("json decode");
+ $this->diagReply($result);
+ }
+
+ return $json;
+ }
+
+ protected function SendHTTPRequest($method, $url, $data = false)
+ {
+ $curl = curl_init();
+
+ switch ($method) {
+ case "POST":
+ curl_setopt($curl, CURLOPT_POST, 1);
+
+ if ($data)
+ curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
+ break;
+ case "PUT":
+ curl_setopt($curl, CURLOPT_PUT, 1);
+ break;
+ default:
+ if ($data)
+ $url = sprintf("%s?%s", $url, http_build_query($data));
+ }
+
+ curl_setopt($curl, CURLOPT_URL, $url);
+ curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
+ curl_setopt($curl, CURLOPT_HTTPHEADER, array(
+ "Accept: application/json",
+ "X-Testsuite-Testname: API request from ".$this->testid,
+ "Expect: ",
+ ));
+
+ $result = curl_exec($curl);
+
+ curl_close($curl);
+ return $result;
+ }
+
+ protected function excpectStatus($testname, $reply, $status)
+ {
+ if (!isset($reply["status"]) || $reply["status"] != $status) {
+ $this->t->fail($testname);
+ $this->diagReply($reply);
+ } else {
+ $this->t->pass($testname);
+ }
+ return $reply;
+ }
+
+ protected function expectSuccess($testname, $reply)
+ {
+ return $this->excpectStatus($testname, $reply, "success");
+ }
+
+ protected function expectError($testname, $reply)
+ {
+ return $this->excpectStatus($testname, $reply, "error");
+ }
+
+ protected function diagReply($reply)
+ {
+ $this->t->diag("Request got unexpected response:");
+ $this->t->diag(var_export($reply, true));
+ }
+
+ public function init()
+ {
+ }
+
+ public function cleanup()
+ {
+ }
+
+ public function done_testing()
+ {
+ $this->t->done_testing();
+ }
+
+ public function setTestNamePrefix($prefix) {
+ $this->t->setTestNamePrefix($prefix);
+ }
+}
diff --git a/application/test/tests/api_v2/common.php b/application/test/tests/api_v2/common.php
new file mode 100644
index 000000000..103e156a8
--- /dev/null
+++ b/application/test/tests/api_v2/common.php
@@ -0,0 +1,60 @@
+<?php
+/*
+ * Copyright 2015 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+namespace test\tests\api_v2;
+
+class common extends \test\Test {
+
+ protected $userCounter = null;
+
+ public function __construct()
+ {
+ parent::__construct();
+
+ $CI =& get_instance();
+ $CI->load->model("muser");
+ $CI->load->model("mfile");
+ }
+
+ protected function uploadFile($apikey, $file)
+ {
+ $ret = $this->CallAPI("POST", "$this->server_url/api/v2.0.0/file/upload", array(
+ "apikey" => $apikey,
+ "file[1]" => curl_file_create($file),
+ ));
+ $this->expectSuccess("upload file", $ret);
+ return $ret;
+ }
+
+ protected function createUser($counter)
+ {
+ $CI =& get_instance();
+ $CI->muser->add_user("apiv2testuser$counter", "testpass$counter",
+ "testuser$counter@testsuite.local", NULL);
+ return $CI->db->insert_id();
+ }
+
+ protected function createApikey($userid, $access_level = "apikey")
+ {
+ return \service\user::create_apikey($userid, "", $access_level);
+ }
+
+ protected function createUserAndApikey($access_level = "apikey")
+ {
+ assert($this->userCounter !== null);
+ $this->userCounter++;
+ $userid = $this->createUser($this->userCounter);
+ return $this->createApikey($userid, $access_level);
+ }
+
+ protected function callEndpoint($verb, $endpoint, $data, $return_json = false)
+ {
+ return $this->CallAPI($verb, "$this->server_url/api/v2.0.0/$endpoint", $data, $return_json);
+ }
+}
diff --git a/application/test/tests/api_v2/test_api_permissions.php b/application/test/tests/api_v2/test_api_permissions.php
new file mode 100644
index 000000000..6df612911
--- /dev/null
+++ b/application/test/tests/api_v2/test_api_permissions.php
@@ -0,0 +1,108 @@
+<?php
+/*
+ * Copyright 2015-2016 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+namespace test\tests\api_v2;
+
+class test_api_permissions extends common {
+
+ public function __construct()
+ {
+ parent::__construct();
+ $this->startServer(23200);
+ $this->userCounter = 100;
+ }
+
+ public function test_callPrivateEndpointsWithoutApikey()
+ {
+ $endpoints = array(
+ "file/upload",
+ "file/history",
+ "file/delete",
+ "file/create_multipaste",
+ "user/apikeys",
+ "user/create_apikey",
+ "user/delete_apikey",
+ );
+ foreach ($endpoints as $endpoint) {
+ $ret = $this->CallEndpoint("POST", $endpoint, array(
+ ));
+ $this->expectError("call $endpoint without apikey", $ret);
+ $this->t->is_deeply(array(
+ 'status' => 'error',
+ 'error_id' => 'api/not-authenticated',
+ 'message' => 'Not authenticated. FileBin requires you to have an account, please go to the homepage at http://127.0.0.1:23200/ for more information.',
+ ), $ret, "expected error");
+ }
+ }
+
+ public function test_callPrivateEndpointsWithUnsupportedAuthentication()
+ {
+ $endpoints = array(
+ "file/upload",
+ "file/history",
+ "file/delete",
+ "file/create_multipaste",
+ "user/apikeys",
+ // create_apikey is the only one that supports username/pw
+ //"user/create_apikey",
+ "user/delete_apikey",
+ );
+ foreach ($endpoints as $endpoint) {
+ $ret = $this->CallEndpoint("POST", $endpoint, array(
+ "username" => "apiv2testuser1",
+ "password" => "testpass1",
+ ));
+ $this->expectError("call $endpoint without apikey", $ret);
+ $this->t->is_deeply(array(
+ 'status' => 'error',
+ 'error_id' => 'api/not-authenticated',
+ 'message' => 'Not authenticated. FileBin requires you to have an account, please go to the homepage at http://127.0.0.1:23200/ for more information.',
+ ), $ret, "expected error");
+ }
+ }
+
+ public function test_callEndpointsWithoutEnoughPermissions()
+ {
+ $testconfig = array(
+ array(
+ "have_level" => "basic",
+ "wanted_level" => "apikey",
+ "apikey" => $this->createUserAndApikey('basic'),
+ "endpoints" => array(
+ "file/delete",
+ "file/history",
+ ),
+ ),
+ array(
+ "have_level" => "apikey",
+ "wanted_level" => "full",
+ "apikey" => $this->createUserAndApikey(),
+ "endpoints" => array(
+ "user/apikeys",
+ "user/create_apikey",
+ "user/delete_apikey",
+ ),
+ ),
+ );
+ foreach ($testconfig as $test) {
+ foreach ($test['endpoints'] as $endpoint) {
+ $ret = $this->CallEndpoint("POST", $endpoint, array(
+ "apikey" => $test['apikey'],
+ ));
+ $this->expectError("call $endpoint without enough permissions", $ret);
+ $this->t->is_deeply(array(
+ 'status' => "error",
+ 'error_id' => "api/insufficient-permissions",
+ 'message' => "Access denied: Access level too low. Required: ${test['wanted_level']}; Have: ${test['have_level']}",
+ ), $ret, "expected permission error");
+ }
+ }
+ }
+
+}
diff --git a/application/test/tests/api_v2/test_create_apikey.php b/application/test/tests/api_v2/test_create_apikey.php
new file mode 100644
index 000000000..203eb5531
--- /dev/null
+++ b/application/test/tests/api_v2/test_create_apikey.php
@@ -0,0 +1,66 @@
+<?php
+/*
+ * Copyright 2016 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+namespace test\tests\api_v2;
+
+class test_create_apikey extends common {
+
+ public function __construct()
+ {
+ parent::__construct();
+ $this->startServer(23202);
+ $this->userCounter = 2100;
+ }
+
+ public function test_create_apikey_createNewKey()
+ {
+ $this->createUser(1);
+ $ret = $this->CallEndpoint("POST", "user/create_apikey", array(
+ "username" => "apiv2testuser1",
+ "password" => "testpass1",
+ "access_level" => "apikey",
+ "comment" => "main api key",
+ ));
+ $this->expectSuccess("create-apikey", $ret);
+
+ $this->t->isnt($ret["data"]["new_key"], "", "apikey not empty");
+ }
+
+ public function test_authentication_invalidPassword()
+ {
+ $userid = $this->createUser(3);
+ $ret = $this->CallEndpoint("POST", "user/create_apikey", array(
+ "username" => "apiv2testuser3",
+ "password" => "wrongpass",
+ ));
+ $this->expectError("invalid password", $ret);
+
+ $this->t->is_deeply(array (
+ 'status' => 'error',
+ 'error_id' => 'user/login-failed',
+ 'message' => 'Login failed',
+ ), $ret, "expected error");
+ }
+
+ public function test_authentication_invalidUser()
+ {
+ $userid = $this->createUser(4);
+ $ret = $this->CallEndpoint("POST", "user/create_apikey", array(
+ "username" => "apiv2testuserinvalid",
+ "password" => "testpass4",
+ ));
+ $this->expectError("invalid username", $ret);
+
+ $this->t->is_deeply(array (
+ 'status' => 'error',
+ 'error_id' => 'user/login-failed',
+ 'message' => 'Login failed',
+ ), $ret, "expected error");
+ }
+}
diff --git a/application/test/tests/api_v2/test_file_create_multipaste.php b/application/test/tests/api_v2/test_file_create_multipaste.php
new file mode 100644
index 000000000..2b6e9d8de
--- /dev/null
+++ b/application/test/tests/api_v2/test_file_create_multipaste.php
@@ -0,0 +1,148 @@
+<?php
+/*
+ * Copyright 2016 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+namespace test\tests\api_v2;
+
+class test_file_create_multipaste extends common {
+
+ public function __construct()
+ {
+ parent::__construct();
+ $this->startServer(23204);
+ $this->userCounter = 4100;
+ }
+
+ public function test_create_multipaste_canCreate()
+ {
+ $apikey = $this->createUserAndApikey("basic");
+ $ret = $this->uploadFile($apikey, "data/tests/small-file");
+ $id = $ret["data"]["ids"][0];
+
+ $ret = $this->uploadFile($apikey, "data/tests/small-file");
+ $id2 = $ret["data"]["ids"][0];
+
+ $ret = $this->CallEndpoint("POST", "file/create_multipaste", array(
+ "apikey" => $apikey,
+ "ids[1]" => $id,
+ "ids[2]" => $id2,
+ ));
+ $this->expectSuccess("create multipaste", $ret);
+
+ $this->t->isnt($ret["data"]["url_id"], "", "got a multipaste ID");
+ $this->t->isnt($ret["data"]["url"], "", "got a multipaste URL");
+ }
+
+ public function test_create_multipaste_errorOnWrongID()
+ {
+ $apikey = $this->createUserAndApikey("basic");
+ $ret = $this->uploadFile($apikey, "data/tests/small-file");
+ $id = $ret["data"]["ids"][0];
+
+ $id2 = $id."invalid";
+ $ret = $this->CallEndpoint("POST", "file/create_multipaste", array(
+ "apikey" => $apikey,
+ "ids[1]" => $id,
+ "ids[2]" => $id2,
+ ));
+ $this->expectError("create multipaste with wrong ID", $ret);
+
+ $this->t->is_deeply(array(
+ 'status' => 'error',
+ 'error_id' => 'file/create_multipaste/verify-failed',
+ 'message' => 'Failed to verify ID(s)',
+ 'data' =>
+ array (
+ $id2 =>
+ array (
+ 'id' => $id2,
+ 'reason' => 'doesn\'t exist',
+ ),
+ ),
+ ), $ret, "expected error response");
+ }
+
+ public function test_create_multipaste_errorOnWrongOwner()
+ {
+ $apikey = $this->createUserAndApikey("basic");
+ $apikey2 = $this->createUserAndApikey("basic");
+ $ret = $this->uploadFile($apikey, "data/tests/small-file");
+ $id = $ret["data"]["ids"][0];
+
+ $ret = $this->CallEndpoint("POST", "file/create_multipaste", array(
+ "apikey" => $apikey2,
+ "ids[1]" => $id,
+ ));
+ $this->expectError("create multipaste with wrong owner", $ret);
+
+ $this->t->is_deeply(array(
+ 'status' => 'error',
+ 'error_id' => 'file/create_multipaste/verify-failed',
+ 'message' => 'Failed to verify ID(s)',
+ 'data' =>
+ array (
+ $id =>
+ array (
+ 'id' => $id,
+ 'reason' => 'not owned by you',
+ ),
+ ),
+ ), $ret, "expected error response");
+ }
+
+ public function test_delete_canDeleteMultipaste()
+ {
+ $apikey = $this->createUserAndApikey();
+ $ret = $this->uploadFile($apikey, "data/tests/small-file");
+ $id = $ret["data"]["ids"][0];
+ $ret = $this->CallEndpoint("POST", "file/create_multipaste", array(
+ "apikey" => $apikey,
+ "ids[1]" => $id,
+ ));
+ $this->expectSuccess("create multipaste", $ret);
+
+ $mid = $ret['data']['url_id'];
+ $ret = $this->CallEndpoint("POST", "file/delete", array(
+ "apikey" => $apikey,
+ "ids[1]" => $mid,
+ ));
+ $this->expectSuccess("delete uploaded file", $ret);
+
+ $this->t->ok(empty($ret["data"]["errors"]), "no errors");
+ $this->t->is_deeply(array(
+ $mid => array(
+ "id" => $mid
+ )
+ ), $ret["data"]["deleted"], "deleted wanted ID");
+ $this->t->is($ret["data"]["total_count"], 1, "total_count correct");
+ $this->t->is($ret["data"]["deleted_count"], 1, "deleted_count correct");
+ }
+
+ public function test_create_multipaste_minidlength()
+ {
+ $apikey = $this->createUserAndApikey("basic");
+ $ret = $this->uploadFile($apikey, "data/tests/small-file");
+ $id = $ret["data"]["ids"][0];
+
+ $ret = $this->uploadFile($apikey, "data/tests/small-file");
+ $id2 = $ret["data"]["ids"][0];
+
+ $ret = $this->CallEndpoint("POST", "file/create_multipaste", array(
+ "apikey" => $apikey,
+ "ids[1]" => $id,
+ "ids[2]" => $id2,
+ "minimum-id-length" => 42,
+ ));
+ $this->expectSuccess("create multipaste", $ret);
+
+ $this->t->isnt($ret["data"]["url_id"], "", "got a multipaste ID");
+ $this->t->isnt($ret["data"]["url"], "", "got a multipaste URL");
+
+ $this->t->ok(strlen($ret["data"]["url_id"]) >= 42, "minimum url length upheld");
+ }
+}
diff --git a/application/test/tests/api_v2/test_file_delete.php b/application/test/tests/api_v2/test_file_delete.php
new file mode 100644
index 000000000..d9ffc5b2c
--- /dev/null
+++ b/application/test/tests/api_v2/test_file_delete.php
@@ -0,0 +1,82 @@
+<?php
+/*
+ * Copyright 2016 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+namespace test\tests\api_v2;
+
+class test_file_delete extends common {
+
+ public function __construct()
+ {
+ parent::__construct();
+ $this->startServer(23203);
+ $this->userCounter = 3100;
+ }
+
+ public function test_delete_canDeleteUploaded()
+ {
+ $apikey = $this->createUserAndApikey();
+ $ret = $this->uploadFile($apikey, "data/tests/small-file");
+ $id = $ret["data"]["ids"][0];
+
+ $ret = $this->CallEndpoint("POST", "file/delete", array(
+ "apikey" => $apikey,
+ "ids[1]" => $id,
+ ));
+ $this->expectSuccess("delete uploaded file", $ret);
+
+ $this->t->ok(empty($ret["data"]["errors"]), "no errors");
+ $this->t->is_deeply(array(
+ $id => array(
+ "id" => $id
+ )
+ ), $ret["data"]["deleted"], "deleted wanted ID");
+ $this->t->is($ret["data"]["total_count"], 1, "total_count correct");
+ $this->t->is($ret["data"]["deleted_count"], 1, "deleted_count correct");
+ }
+
+ public function test_delete_errorIfNotOwner()
+ {
+ $apikey = $this->createUserAndApikey();
+ $apikey2 = $this->createUserAndApikey();
+ $ret = $this->uploadFile($apikey, "data/tests/small-file");
+ $id = $ret["data"]["ids"][0];
+
+ $ret = $this->CallEndpoint("POST", "file/delete", array(
+ "apikey" => $apikey2,
+ "ids[1]" => $id,
+ ));
+ $this->expectSuccess("delete file of someone else", $ret);
+
+ $this->t->ok(empty($ret["data"]["deleted"]), "not deleted");
+ $this->t->is_deeply(array(
+ $id => array(
+ "id" => $id,
+ "reason" => "wrong owner"
+ )
+ ), $ret["data"]["errors"], "error wanted ID");
+ $this->t->is($ret["data"]["total_count"], 1, "total_count correct");
+ $this->t->is($ret["data"]["deleted_count"], 0, "deleted_count correct");
+ }
+
+ public function test_delete_empty_json_structure()
+ {
+ $apikey = $this->createUserAndApikey();
+ $ret = $this->uploadFile($apikey, "data/tests/small-file");
+ $id = $ret["data"]["ids"][0];
+
+ $ret = $this->CallEndpoint("POST", "file/delete", array(
+ "apikey" => $apikey,
+ "ids[1]" => $id,
+ ), true);
+
+ $this->t->is($ret, '{"status":"success","data":{"errors":{},"deleted":{"'.$id.'":{"id":"'.$id.'"}},"total_count":1,"deleted_count":1}}', "empty lists should be json objects, not arrays");
+ }
+
+
+}
diff --git a/application/test/tests/api_v2/test_file_upload.php b/application/test/tests/api_v2/test_file_upload.php
new file mode 100644
index 000000000..07769774f
--- /dev/null
+++ b/application/test/tests/api_v2/test_file_upload.php
@@ -0,0 +1,112 @@
+<?php
+/*
+ * Copyright 2016 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+namespace test\tests\api_v2;
+
+class test_file_upload extends common {
+
+ public function __construct()
+ {
+ parent::__construct();
+ $this->startServer(23205);
+ $this->userCounter = 5100;
+ }
+
+ public function test_upload_uploadFile()
+ {
+ $apikey = $this->createUserAndApikey();
+ $ret = $this->CallEndpoint("POST", "file/upload", array(
+ "apikey" => $apikey,
+ "file[1]" => curl_file_create("data/tests/small-file"),
+ ));
+ $this->expectSuccess("upload file", $ret);
+
+ $this->t->ok(!empty($ret["data"]["ids"]), "got IDs");
+ $this->t->ok(!empty($ret["data"]["urls"]), "got URLs");
+ }
+
+ public function test_upload_uploadFileSameMD5()
+ {
+ $apikey = $this->createUserAndApikey();
+ $ret = $this->CallEndpoint("POST", "file/upload", array(
+ "apikey" => $apikey,
+ "file[1]" => curl_file_create("data/tests/message1.bin"),
+ "file[2]" => curl_file_create("data/tests/message2.bin"),
+ ));
+ $this->expectSuccess("upload file", $ret);
+
+ $this->t->ok(!empty($ret["data"]["ids"]), "got IDs");
+ $this->t->ok(!empty($ret["data"]["urls"]), "got URLs");
+
+ foreach ($ret["data"]["urls"] as $url) {
+ # remove tailing /
+ $url = substr($url, 0, strlen($url) - 1);
+ $data[] = $this->SendHTTPRequest("GET", $url, '');
+ }
+ $this->t->ok($data[0] !== $data[1], 'Returned file contents should differ');
+ $this->t->is($data[0], file_get_contents("data/tests/message1.bin"), "Returned correct data for file 1");
+ $this->t->is($data[1], file_get_contents("data/tests/message2.bin"), "Returned correct data for file 2");
+ }
+
+ public function test_upload_uploadNothing()
+ {
+ $apikey = $this->createUserAndApikey();
+ $ret = $this->CallEndpoint("POST", "file/upload", array(
+ "apikey" => $apikey,
+ ));
+ $this->expectError("upload no file", $ret);
+ $this->t->is_deeply(array(
+ 'status' => 'error',
+ 'error_id' => 'file/no-file',
+ 'message' => 'No file was uploaded or unknown error occurred.',
+ ), $ret, "expected reply");
+ }
+
+ public function test_upload_minidlength()
+ {
+ $apikey = $this->createUserAndApikey();
+ $ret = $this->CallEndpoint("POST", "file/upload", array(
+ "apikey" => $apikey,
+ "file[1]" => curl_file_create("data/tests/small-file"),
+ "minimum-id-length" => 42,
+ ));
+ $this->expectSuccess("upload file", $ret);
+
+ foreach ($ret["data"]["urls"] as $url) {
+ $matches = array();
+ preg_match('/\/([^\/]+)\/$/', $url, $matches);
+ $this->t->ok(strlen($matches[1]) >= 42, "minimum url length upheld");
+ }
+ }
+
+ public function test_upload_bad_minidlength()
+ {
+ $apikey = $this->createUserAndApikey();
+
+ $combinations = [
+ "non-numberic minimum-id-length" => "nonumber",
+ "negative minimum-id-length (-42)" => -42,
+ "minimum-id-length=0" => 0,
+ "minimum-id-length=1" => 1,
+ ];
+ foreach ($combinations as $msg => $input) {
+ $ret = $this->CallEndpoint("POST", "file/upload", array(
+ "apikey" => $apikey,
+ "file[1]" => curl_file_create("data/tests/small-file"),
+ "minimum-id-length" => $input,
+ ));
+ $this->expectError("upload file with bad minimum-id-length. Test value: $msg", $ret);
+ $this->t->is_deeply(array(
+ 'status' => 'error',
+ 'error_id' => 'file/bad-minimum-id-length',
+ 'message' => "Passed parameter 'minimum-id-length' is not a valid integer or too small (min value: 2)",
+ ), $ret, "expected reply");
+ }
+ }
+}
diff --git a/application/test/tests/api_v2/test_history.php b/application/test/tests/api_v2/test_history.php
new file mode 100644
index 000000000..f09aab9bb
--- /dev/null
+++ b/application/test/tests/api_v2/test_history.php
@@ -0,0 +1,137 @@
+<?php
+/*
+ * Copyright 2016 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+namespace test\tests\api_v2;
+
+class test_history extends common {
+
+ public function __construct()
+ {
+ parent::__construct();
+ $this->startServer(23201);
+ $this->userCounter = 1100;
+ }
+
+ public function test_history_empty()
+ {
+ $apikey = $this->createUserAndApikey();
+ $ret = $this->CallEndpoint("POST", "file/history", array(
+ "apikey" => $apikey,
+ ));
+ $this->expectSuccess("get history", $ret);
+
+ $this->t->ok(empty($ret["data"]["items"]), "items key exists and empty");
+ $this->t->ok(empty($ret["data"]["multipaste_items"]), "multipaste_items key exists and empty");
+ $this->t->is($ret["data"]["total_size"], "0", "total_size = 0 since no uploads");
+ }
+
+ public function test_history_empty_json_structure()
+ {
+ $apikey = $this->createUserAndApikey();
+ $ret = $this->CallEndpoint("POST", "file/history", array(
+ "apikey" => $apikey,
+ ), true);
+
+ $this->t->is($ret, '{"status":"success","data":{"items":{},"multipaste_items":{},"total_size":"0"}}', "empty lists should be json objects, not arrays");
+ }
+
+ public function test_history_notEmptyAfterUploadSameMD5()
+ {
+ $apikey = $this->createUserAndApikey();
+ $this->CallEndpoint("POST", "file/upload", array(
+ "apikey" => $apikey,
+ "file[1]" => curl_file_create("data/tests/message1.bin"),
+ "file[2]" => curl_file_create("data/tests/message2.bin"),
+ ));
+ $expected_filesize = filesize("data/tests/message1.bin") + filesize("data/tests/message2.bin");
+
+ $ret = $this->CallEndpoint("POST", "file/history", array(
+ "apikey" => $apikey,
+ ));
+ $this->expectSuccess("history not empty after upload", $ret);
+
+ $this->t->ok(!empty($ret["data"]["items"]), "history not empty after upload (items)");
+ $this->t->ok(empty($ret["data"]["multipaste_items"]), "didn't upload multipaste");
+ $this->t->is($ret["data"]["total_size"], "$expected_filesize", "total_size == uploaded files");
+ }
+
+ public function test_history_notEmptyAfterMultipaste()
+ {
+ $apikey = $this->createUserAndApikey();
+ $uploadid = $this->uploadFile($apikey, "data/tests/small-file")['data']['ids'][0];
+ $multipasteid = $this->CallEndpoint("POST", "file/create_multipaste", array(
+ "apikey" => $apikey,
+ 'ids[1]' => $uploadid,
+ ))['data']['url_id'];
+
+ $ret = $this->CallEndpoint("POST", "file/history", array(
+ "apikey" => $apikey,
+ ));
+ $this->expectSuccess("history not empty after multipaste", $ret);
+
+ $this->t->ok(!empty($ret["data"]["items"]), "history not empty after multipaste (items)");
+ $this->t->is($ret['data']["multipaste_items"][$multipasteid]['items'][$uploadid]['id'], $uploadid, "multipaste contains correct id");
+ $this->t->is_deeply(array(
+ 'url_id', 'date', 'items'
+ ), array_keys($ret['data']["multipaste_items"][$multipasteid]), "multipaste info only lists correct keys");
+ $this->t->is_deeply(array('id'), array_keys($ret['data']["multipaste_items"][$multipasteid]['items'][$uploadid]), "multipaste item info only lists correct keys");
+ }
+
+ public function test_history_notEmptyAfterUpload()
+ {
+ $apikey = $this->createUserAndApikey();
+ $uploadid = $this->uploadFile($apikey, "data/tests/small-file")['data']['ids'][0];
+ $uploadid_image = $this->uploadFile($apikey, "data/tests/black_white.png")['data']['ids'][0];
+ $expected_size = filesize("data/tests/small-file") + filesize("data/tests/black_white.png");
+
+ $ret = $this->CallEndpoint("POST", "file/history", array(
+ "apikey" => $apikey,
+ ));
+ $this->expectSuccess("history not empty after upload", $ret);
+
+ $this->t->ok(!empty($ret["data"]["items"]), "history not empty after upload (items)");
+ $this->t->is_deeply(array(
+ 'id', 'filename', 'mimetype', 'date', 'hash', 'filesize'
+ ), array_keys($ret['data']["items"][$uploadid]), "item info only lists correct keys");
+ $this->t->is_deeply(array(
+ 'id', 'filename', 'mimetype', 'date', 'hash', 'filesize', 'thumbnail'
+ ), array_keys($ret['data']["items"][$uploadid_image]), "item info for image lists thumbnail too");
+ $this->t->ok(empty($ret["data"]["multipaste_items"]), "didn't upload multipaste");
+ $this->t->is($ret["data"]["total_size"], "$expected_size", "total_size == uploaded files");
+ }
+
+ public function test_history_notSharedBetweenUsers()
+ {
+ $apikey = $this->createUserAndApikey();
+ $apikey2 = $this->createUserAndApikey();
+ $this->uploadFile($apikey, "data/tests/small-file");
+
+ $ret = $this->CallEndpoint("POST", "file/history", array(
+ "apikey" => $apikey2,
+ ));
+ $this->expectSuccess("get history", $ret);
+
+ $this->t->ok(empty($ret["data"]["items"]), "items key exists and empty");
+ $this->t->ok(empty($ret["data"]["multipaste_items"]), "multipaste_items key exists and empty");
+ $this->t->is($ret["data"]["total_size"], "0", "total_size = 0 since no uploads");
+ }
+
+ public function test_history_specialVarsNotExpanded()
+ {
+ $apikey = $this->createUserAndApikey();
+ $uploadid = $this->uploadFile($apikey, "data/tests/{elapsed_time}.txt")['data']['ids'][0];
+
+ $ret = $this->CallEndpoint("POST", "file/history", array(
+ "apikey" => $apikey,
+ ));
+ $this->expectSuccess("get history", $ret);
+
+ $this->t->is($ret["data"]["items"][$uploadid]['filename'], '{elapsed_time}.txt', "{elapsed_time} is not expanded in history reply");
+ }
+}
diff --git a/application/test/tests/api_v2/test_misc.php b/application/test/tests/api_v2/test_misc.php
new file mode 100644
index 000000000..e7c249054
--- /dev/null
+++ b/application/test/tests/api_v2/test_misc.php
@@ -0,0 +1,48 @@
+<?php
+/*
+ * Copyright 2016 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+namespace test\tests\api_v2;
+
+class test_misc extends common {
+
+ public function __construct()
+ {
+ parent::__construct();
+ $this->startServer(23207);
+ $this->userCounter = 7100;
+ }
+
+ public function test_apikeys_getApikey()
+ {
+ $userid = $this->createUser(2);
+ $apikey = $this->createApikey($userid);
+ $apikey_full = $this->createApikey($userid, "full");
+ $ret = $this->CallEndpoint("POST", "user/apikeys", array(
+ "apikey" => $apikey_full,
+ ));
+ $this->expectSuccess("get apikeys", $ret);
+
+ $this->t->is($ret["data"]["apikeys"][$apikey]["key"], $apikey, "expected key 1");
+ $this->t->is($ret["data"]["apikeys"][$apikey]["access_level"], "apikey", "expected key 1 acces_level");
+ $this->t->is($ret["data"]["apikeys"][$apikey]["comment"], "", "expected key 1 comment");
+ $this->t->ok(is_int($ret["data"]["apikeys"][$apikey]["created"]) , "expected key 1 creation time is int");
+ }
+
+ public function test_get_config()
+ {
+ $ret = $this->CallEndpoint("GET", "file/get_config", array(
+ ));
+ $this->expectSuccess("get_config", $ret);
+
+ $this->t->like($ret["data"]["upload_max_size"], '/[0-9]+/', "upload_max_size is int");
+ $this->t->like($ret["data"]["max_files_per_request"], '/[0-9]+/', "max_files_per_request is int");
+ }
+
+
+}
diff --git a/application/test/tests/api_v2/test_user_delete_apikey.php b/application/test/tests/api_v2/test_user_delete_apikey.php
new file mode 100644
index 000000000..062b0d6c1
--- /dev/null
+++ b/application/test/tests/api_v2/test_user_delete_apikey.php
@@ -0,0 +1,49 @@
+<?php
+/*
+ * Copyright 2016 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+namespace test\tests\api_v2;
+
+class test_user_delete_apikey extends common {
+
+ public function __construct()
+ {
+ parent::__construct();
+ $this->startServer(23206);
+ $this->userCounter = 6100;
+ }
+
+ public function test_delete_apikey_deleteOwnKey()
+ {
+ $apikey = $this->createUserAndApikey("full");
+ $ret = $this->CallEndpoint("POST", "user/delete_apikey", array(
+ "apikey" => $apikey,
+ "delete_key" => $apikey,
+ ));
+ $this->expectSuccess("delete apikey", $ret);
+
+ $this->t->is($ret["data"]["deleted_keys"][$apikey]["key"], $apikey, "expected key");
+ }
+
+ public function test_delete_apikey_errorDeleteOtherUserKey()
+ {
+ $apikey = $this->createUserAndApikey("full");
+ $apikey2 = $this->createUserAndApikey("full");
+ $ret = $this->CallEndpoint("POST", "user/delete_apikey", array(
+ "apikey" => $apikey,
+ "delete_key" => $apikey2,
+ ));
+ $this->expectError("delete apikey of other user", $ret);
+ $this->t->is_deeply(array(
+ 'status' => 'error',
+ 'error_id' => 'user/delete_apikey/failed',
+ 'message' => 'Apikey deletion failed. Possibly wrong owner.',
+ ), $ret, "expected error");
+ }
+
+}
diff --git a/application/test/tests/test_database_schema.php b/application/test/tests/test_database_schema.php
new file mode 100644
index 000000000..02f188e1f
--- /dev/null
+++ b/application/test/tests/test_database_schema.php
@@ -0,0 +1,38 @@
+<?php
+/*
+ * Copyright 2017 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+namespace test\tests;
+
+class test_database_schema extends \test\Test {
+
+ public function __construct()
+ {
+ parent::__construct();
+ }
+
+ public function test_file_storage_bigint() {
+ $filesize = pow(2, 35) + 1;
+
+ $CI =& get_instance();
+ $CI->db->insert("file_storage", array(
+ "filesize" => $filesize,
+ "mimetype" => "text/plain",
+ "hash" => md5("test"),
+ "date" => time(),
+ ));
+ $id = $CI->db->insert_id();
+ $db_value = $CI->db->select('filesize')
+ ->from('file_storage')
+ ->where('id', $id)
+ ->get()->result_array()[0]["filesize"];
+ $this->t->is(intval($db_value), $filesize, "Large filesize is stored correctly in db");
+ }
+
+
+}
diff --git a/application/test/tests/test_filebin_helper.php b/application/test/tests/test_filebin_helper.php
new file mode 100644
index 000000000..a46d4bc3c
--- /dev/null
+++ b/application/test/tests/test_filebin_helper.php
@@ -0,0 +1,108 @@
+<?php
+/*
+ * Copyright 2016 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+namespace test\tests;
+
+class test_filebin_helper extends \test\Test {
+
+ public function __construct()
+ {
+ parent::__construct();
+ }
+
+ public function init()
+ {
+ }
+
+ public function cleanup()
+ {
+ }
+
+ public function test_expiration_duration()
+ {
+ $this->t->is(expiration_duration(60*60*24*2), "2 days", "2 days");
+ $this->t->is(expiration_duration(60*60*24), "1 day", "1 day");
+ $this->t->is(expiration_duration(60*60*2), "2 hours", "2 hours");
+ $this->t->is(expiration_duration(60*60), "1 hour", "1 hour");
+ $this->t->is(expiration_duration(60*2), "2 minutes", "2 minutes");
+ $this->t->is(expiration_duration(60), "1 minute", "1 minute");
+ $this->t->is(expiration_duration(59), "59 seconds", "59 seconds");
+ $this->t->is(expiration_duration(1), "1 second", "1 second");
+
+ $this->t->is(expiration_duration(60*60*24 + 60*60 + 60), "1 day, 1 hour, 1 minute", "1 day, 1 hour, 1 minute");
+ $this->t->is(expiration_duration(60*60*24 + 60*60 + 120), "1 day, 1 hour, 2 minutes", "1 day, 1 hour, 2 minutes");
+ $this->t->is(expiration_duration(60*60*24 + 60*60*2 + 60), "1 day, 2 hours, 1 minute", "1 day, 2 hours, 1 minute");
+ $this->t->is(expiration_duration(60*60*24 + 60*60*2 + 120), "1 day, 2 hours, 2 minutes", "1 day, 2 hours, 2 minutes");
+ $this->t->is(expiration_duration(60*60*24*2 + 60*60 + 60), "2 days, 1 hour, 1 minute", "2 days, 1 hour, 1 minute");
+ $this->t->is(expiration_duration(60*60*24*2 + 60*60 + 120), "2 days, 1 hour, 2 minutes", "2 days, 1 hour, 2 minutes");
+ $this->t->is(expiration_duration(60*60*24*2 + 60*60*2 + 60), "2 days, 2 hours, 1 minute", "2 days, 2 hours, 1 minute");
+ $this->t->is(expiration_duration(60*60*24*2 + 60*60*2 + 120), "2 days, 2 hours, 2 minutes", "2 days, 2 hours, 2 minutes");
+
+ $this->t->is(expiration_duration(60*60*24 + 60*60), "1 day, 1 hour", "1 day, 1 hour");
+ $this->t->is(expiration_duration(60*60*24 + 60*60*2), "1 day, 2 hours", "1 day, 2 hours");
+ $this->t->is(expiration_duration(60*60*24*2 + 60*60), "2 days, 1 hour", "2 days, 1 hour");
+ $this->t->is(expiration_duration(60*60*24*2 + 60*60*2), "2 days, 2 hours", "2 days, 2 hours");
+
+ $this->t->is(expiration_duration(60*60*24 + 60), "1 day, 1 minute", "1 day, 1 minute");
+ $this->t->is(expiration_duration(60*60*24 + 120), "1 day, 2 minutes", "1 day, 2 minutes");
+ $this->t->is(expiration_duration(60*60*24*2 + 60), "2 days, 1 minute", "2 days, 1 minute");
+ $this->t->is(expiration_duration(60*60*2*24 + 120), "2 days, 2 minutes", "2 days, 2 minutes");
+
+ $this->t->is(expiration_duration(60*60 + 60), "1 hour, 1 minute", "1 hour, 1 minute");
+ $this->t->is(expiration_duration(60*60 + 120), "1 hour, 2 minutes", "1 hour, 2 minutes");
+ $this->t->is(expiration_duration(60*60*2 + 60), "2 hours, 1 minute", "2 hours, 1 minute");
+ $this->t->is(expiration_duration(60*60*2 + 120), "2 hours, 2 minutes", "2 hours, 2 minutes");
+
+ $this->t->is(expiration_duration(61), "1 minute, 1 second", "1 minute, 1 second");
+ $this->t->is(expiration_duration(62), "1 minute, 2 seconds", "1 minute, 2 seconds");
+ $this->t->is(expiration_duration(121), "2 minutes, 1 second", "2 minutes, 1 second");
+ $this->t->is(expiration_duration(122), "2 minutes, 2 seconds", "2 minutes, 2 seconds");
+
+ $this->t->is(expiration_duration(60*60*24 + 60*60*23 + 60*59), "1 day, 23 hours, 59 minutes", "1 day, 23 hours, 59 minutes");
+ $this->t->is(expiration_duration(60*60*23 + 60*59), "23 hours, 59 minutes", "23 hours, 59 minutes");
+ $this->t->is(expiration_duration(60*60*2 + 60*59), "2 hours, 59 minutes", "2 hours, 59 minutes");
+ }
+
+ public function test_format_bytes()
+ {
+ $this->t->is(format_bytes(500), "500B", "500B");
+ $this->t->is(format_bytes(1500), "1500B", "1500B");
+ $this->t->is(format_bytes(1500*1024), "1500.00KiB", "1500.00KiB");
+ $this->t->is(format_bytes(1500*1024*1024), "1500.00MiB", "1500.00MiB");
+ $this->t->is(format_bytes(1500*1024*1024*1024), "1500.00GiB", "1500.00GiB");
+ $this->t->is(format_bytes(1500*1024*1024*1024*1024), "1500.00TiB", "1500.00TiB");
+ $this->t->is(format_bytes(1500*1024*1024*1024*1024*1024), "1500.00PiB", "1500.00PiB");
+ }
+
+ public function test_files_are_equal()
+ {
+ $a1 = FCPATH.'/data/tests/message1.bin';
+ $a2 = FCPATH.'/data/tests/message2.bin';
+ $b = FCPATH.'/data/tests/simple.pdf';
+ $this->t->is(files_are_equal($a1, $a2), false, "Same hash, but different file");
+ $this->t->is(files_are_equal($a1, $b), false, "Different filesize");
+ $this->t->is(files_are_equal($a1, $a1), true, "Same file");
+ $this->t->is(files_are_equal($a2, $a2), true, "Same file");
+ }
+
+ public function test_return_bytes()
+ {
+ $this->t->is(return_bytes("1k"), 1*1024, "1k");
+ $this->t->is(return_bytes("1M"), 1*1024*1024, "1M");
+ $this->t->is(return_bytes("1G"), 1*1024*1024*1024, "1G");
+
+ try {
+ return_bytes("1P");
+ } catch (\exceptions\ApiException $e) {
+ $this->t->is($e->get_error_id(), 'filebin-helper/invalid-input-unit', "unhandled text: 1P");
+ }
+
+ $this->t->is(return_bytes("106954752"), 106954752, "value without unit is returned as int");
+ }
+}
diff --git a/application/test/tests/test_libraries_exif.php b/application/test/tests/test_libraries_exif.php
new file mode 100644
index 000000000..3ca821c03
--- /dev/null
+++ b/application/test/tests/test_libraries_exif.php
@@ -0,0 +1,48 @@
+<?php
+/*
+ * Copyright 2016 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+namespace test\tests;
+
+class test_libraries_exif extends \test\Test {
+
+ public function __construct()
+ {
+ parent::__construct();
+ }
+
+ public function init()
+ {
+ }
+
+ public function cleanup()
+ {
+ }
+
+ public function test_get_exif_jpeg()
+ {
+ $ret = \libraries\Exif::get_exif(FCPATH.'/data/tests/exif-orientation-examples/Portrait_1.jpg');
+
+ $this->t->is($ret['Orientation'], 1, "Get correct EXIF Orientation");
+ $this->t->is($ret['FileName'], "Portrait_1.jpg", "Get correct EXIF FileName");
+ }
+
+ public function test_get_exif_invalidTypes()
+ {
+ $ret = \libraries\Exif::get_exif(FCPATH.'/data/tests/black_white.png');
+ $this->t->is($ret, false, "PNG not supported");
+ }
+
+ public function test_get_exif_missingFile()
+ {
+ $ret = \libraries\Exif::get_exif(FCPATH.'/data/tests/thisFileDoesNotExist');
+ $this->t->is($ret, false, "Should return false for missing file");
+ }
+
+}
+
diff --git a/application/test/tests/test_libraries_image.php b/application/test/tests/test_libraries_image.php
new file mode 100644
index 000000000..d6afc64df
--- /dev/null
+++ b/application/test/tests/test_libraries_image.php
@@ -0,0 +1,110 @@
+<?php
+/*
+ * Copyright 2015 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+namespace test\tests;
+
+class test_libraries_image extends \test\Test {
+
+ public function __construct()
+ {
+ parent::__construct();
+ }
+
+ public function init()
+ {
+ }
+
+ public function cleanup()
+ {
+ }
+
+ public function test_type_supported_normalCase()
+ {
+ $this->t->is(\libraries\Image::type_supported('image/png'), true, 'image/png should be supported');
+ $this->t->is(\libraries\Image::type_supported('image/jpeg'), true, 'image/jpeg should be supported');
+
+ $this->t->is(\libraries\Image::type_supported('application/pdf'), false, 'application/pdf should not be supported');
+ $this->t->is(\libraries\Image::type_supported('application/octet-stream'), false, 'application/octet-stream should not be supported');
+ $this->t->is(\libraries\Image::type_supported('text/plain'), false, 'text/plain should not be supported');
+ }
+
+ public function test_makeThumb_PNG()
+ {
+ $img = new \libraries\Image(FCPATH."/data/tests/black_white.png");
+ $img->makeThumb(150, 150);
+ $thumb = $img->get(IMAGETYPE_PNG);
+
+ $this->t->ok($thumb !== "", "Got thumbnail");
+ }
+
+ public function test_makeThumb_PDF()
+ {
+ try {
+ $img = new \libraries\Image(FCPATH."/data/tests/simple.pdf");
+ $this->t->fail("PDF should not be supported");
+ $img->makeThumb(150, 150);
+ $thumb = $img->get(IMAGETYPE_JPEG);
+ $this->t->ok($thumb !== "", "Got thumbnail");
+ } catch (\exceptions\PublicApiException $e) {
+ $correct_error = $e->get_error_id() == "libraries/Image/unsupported-image-type";
+ $this->t->ok($correct_error, "Should get exception");
+ if (!$correct_error) {
+ // @codeCoverageIgnoreStart
+ throw $e;
+ // @codeCoverageIgnoreEnd
+ }
+ }
+ }
+
+ public function test_makeThumb_binaryFile()
+ {
+ try {
+ $img = new \libraries\Image(FCPATH."/data/tests/message1.bin");
+ } catch (\exceptions\PublicApiException $e) {
+ $correct_error = $e->get_error_id() == "libraries/Image/unsupported-image-type";
+ $this->t->ok($correct_error, "Should get exception");
+ if (!$correct_error) {
+ // @codeCoverageIgnoreStart
+ throw $e;
+ // @codeCoverageIgnoreEnd
+ }
+ }
+ }
+
+ public function test_get_exif_orientation()
+ {
+ $ret = \libraries\Image::get_exif_orientation(FCPATH."/data/tests/black_white.png");
+ $this->t->is($ret, 0, "Got correct Orientation for image without orientation information");
+
+ foreach ([1,2,3,4,5,6,7,8] as $orientation) {
+ $ret = \libraries\Image::get_exif_orientation(FCPATH."/data/tests/exif-orientation-examples/Landscape_$orientation.jpg");
+ $this->t->is($ret, $orientation, "Got correct Orientation for Landscape_$orientation.jpg");
+
+ $ret = \libraries\Image::get_exif_orientation(FCPATH."/data/tests/exif-orientation-examples/Portrait_$orientation.jpg");
+ $this->t->is($ret, $orientation, "Got correct Orientation for Portrait_$orientation.jpg");
+ }
+ }
+
+ public function test_makeThumb_differentOrientation()
+ {
+ foreach ([1,2,3,4,5,6,7,8] as $orientation) {
+ $img = new \libraries\Image(FCPATH."/data/tests/exif-orientation-examples/Landscape_$orientation.jpg");
+ $img->makeThumb(100, 100);
+ $thumb = $img->get();
+ $this->t->ok($thumb != '', "Got thumbnail for Landscape_$orientation.jpg");
+
+ $img = new \libraries\Image(FCPATH."/data/tests/exif-orientation-examples/Portrait_$orientation.jpg");
+ $img->makeThumb(100, 100);
+ $thumb = $img->get();
+ $this->t->ok($thumb != '', "Got thumbnail for Portrait_$orientation.jpg");
+ }
+ }
+
+}
+
diff --git a/application/test/tests/test_libraries_output_cache.php b/application/test/tests/test_libraries_output_cache.php
new file mode 100644
index 000000000..3668bc6b4
--- /dev/null
+++ b/application/test/tests/test_libraries_output_cache.php
@@ -0,0 +1,82 @@
+<?php
+/*
+ * Copyright 2016 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+namespace test\tests;
+
+class test_libraries_output_cache extends \test\Test {
+
+ public function __construct()
+ {
+ parent::__construct();
+ }
+
+ public function init()
+ {
+ }
+
+ public function cleanup()
+ {
+ }
+
+ public function test_add()
+ {
+ $oc = new \libraries\Output_cache();
+ $oc->add("teststring");
+
+ ob_start();
+ $oc->render();
+ $output = ob_get_clean();
+
+ $this->t->is($output, "teststring", "Simple add renders correctly");
+ }
+
+ public function test_add_function()
+ {
+ $oc = new \libraries\Output_cache();
+ $oc->add_function(function() {echo "teststring";});
+
+ ob_start();
+ $oc->render();
+ $output = ob_get_clean();
+
+ $this->t->is($output, "teststring", "Simple add_function renders correctly");
+ }
+
+ public function test_add_merge()
+ {
+
+ $oc = new \libraries\Output_cache();
+ $oc->add_merge(['items' => ["test1\n"]], 'tests/echo-fragment');
+ $oc->add_merge(['items' => ["test2\n"]], 'tests/echo-fragment');
+
+ ob_start();
+ $oc->render();
+ $output = ob_get_clean();
+
+ $this->t->is($output, "listing 2 items:\ntest1\ntest2\n", "Simple add renders correctly");
+ }
+
+ public function test_add_merge_mixedViews()
+ {
+
+ $oc = new \libraries\Output_cache();
+ $oc->add_merge(['items' => ["test1\n"]], 'tests/echo-fragment');
+ $oc->add_merge(['items' => ["test2\n"]], 'tests/echo-fragment');
+ $oc->add("blub\n");
+ $oc->add_merge(['items' => ["test3\n"]], 'tests/echo-fragment');
+
+ ob_start();
+ $oc->render();
+ $output = ob_get_clean();
+
+ $this->t->is($output, "listing 2 items:\ntest1\ntest2\nblub\nlisting 1 items:\ntest3\n", "Simple add renders correctly");
+ }
+
+}
+
diff --git a/application/test/tests/test_libraries_procrunner.php b/application/test/tests/test_libraries_procrunner.php
new file mode 100644
index 000000000..daac8a2bc
--- /dev/null
+++ b/application/test/tests/test_libraries_procrunner.php
@@ -0,0 +1,122 @@
+<?php
+/*
+ * Copyright 2015 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+namespace test\tests;
+
+class test_libraries_procrunner extends \test\Test {
+
+ public function __construct()
+ {
+ parent::__construct();
+ }
+
+ public function init()
+ {
+ }
+
+ public function cleanup()
+ {
+ }
+
+ public function test_exec_true()
+ {
+ $p = new \libraries\ProcRunner(['true']);
+ $ret = $p->exec();
+
+ $this->t->is($ret['stderr'], '', 'stderr should be empty');
+ $this->t->is($ret['stdout'], '', 'stdout should be empty');
+ $this->t->is($ret['return_code'], 0, 'return code should be 0');
+ }
+
+ public function test_exec_false()
+ {
+ $p = new \libraries\ProcRunner(['false']);
+ $ret = $p->exec();
+
+ $this->t->is($ret['stderr'], '', 'stderr should be empty');
+ $this->t->is($ret['stdout'], '', 'stdout should be empty');
+ $this->t->is($ret['return_code'], 1, 'return code should be 1');
+ }
+
+ public function test_exec_nonexistent()
+ {
+ $p = new \libraries\ProcRunner(['thisCommandDoesNotExist']);
+ $ret = $p->exec();
+
+ if (PHP_MAJOR_VERSION >= 8) {
+ $this->t->is($ret['stderr'], "sh: line 1: thisCommandDoesNotExist: command not found\n", 'stderr should be empty');
+ } else {
+ $this->t->is($ret['stderr'], "sh: thisCommandDoesNotExist: command not found\n", 'stderr should be empty');
+ }
+ $this->t->is($ret['stdout'], '', 'stdout should be empty');
+ $this->t->is($ret['return_code'], 127, 'return code should be 127');
+ }
+
+ public function test_exec_tac()
+ {
+
+ $line1 = "this is the first line";
+ $line2 = "and this is the second one";
+ $input = "$line1\n$line2\n";
+ $output = "$line2\n$line1\n";
+
+ $p = new \libraries\ProcRunner(['tac']);
+ $p->input($input);
+ $ret = $p->exec();
+
+ $this->t->is($ret['stderr'], '', 'stderr should be empty');
+ $this->t->is($ret['stdout'], $output, 'stdout should be reversed');
+ $this->t->is($ret['return_code'], 0, 'return code should be 0');
+ }
+
+ public function test_forbid_nonzero()
+ {
+ $p = new \libraries\ProcRunner(['false']);
+ $p->forbid_nonzero();
+
+ try {
+ $p->exec();
+ $this->t->ok(false, "this should have caused an an exception");
+ } catch (\exceptions\ApiException $e) {
+ $this->t->is($e->get_error_id(), 'procrunner/non-zero-exit', "correct exception triggered");
+ $this->t->is_deeply($e->get_data(), [
+ "'false'",
+ null,
+ [
+ 'return_code' => 1,
+ 'stdout' => '',
+ 'stderr' => '',
+ ],
+ ], "correct exception data");
+ }
+ }
+
+ public function test_forbid_stderr()
+ {
+ $p = new \libraries\ProcRunner(['bash', '-c', 'echo "This is a test error message" >&2; exit 2;']);
+ $p->forbid_stderr();
+
+ try {
+ $p->exec();
+ $this->t->ok(false, "this should have caused an an exception");
+ } catch (\exceptions\ApiException $e) {
+ $this->t->is($e->get_error_id(), 'procrunner/stderr', "correct exception triggered");
+ $this->t->is_deeply($e->get_data(), [
+ "'bash' '-c' 'echo \"This is a test error message\" >&2; exit 2;'",
+ null,
+ [
+ 'return_code' => 2,
+ 'stdout' => '',
+ 'stderr' => "This is a test error message\n",
+ ],
+ ], "correct exception data");
+ }
+ }
+}
+
diff --git a/application/test/tests/test_libraries_pygments.php b/application/test/tests/test_libraries_pygments.php
new file mode 100644
index 000000000..2e6e8447f
--- /dev/null
+++ b/application/test/tests/test_libraries_pygments.php
@@ -0,0 +1,115 @@
+<?php
+/*
+ * Copyright 2015 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+namespace test\tests;
+
+class test_libraries_pygments extends \test\Test {
+
+ public function __construct()
+ {
+ parent::__construct();
+ }
+
+ public function init()
+ {
+ }
+
+ public function cleanup()
+ {
+ }
+
+ public function test_autodetect_lexer_normalCase()
+ {
+ $p = new \libraries\Pygments('/invalid/filepath', 'text/plain', 'stdin');
+ $this->t->is($p->autodetect_lexer(), 'text', "text/plain should be text");
+
+ $p = new \libraries\Pygments('/invalid/filepath', 'application/x-php', 'stdin');
+ $this->t->is($p->autodetect_lexer(), 'php', "application/php should be php");
+
+ // This is from pygments and not our hardcoded list
+ $p = new \libraries\Pygments('/invalid/filepath', 'text/x-pascal', 'stdin');
+ $this->t->is($p->autodetect_lexer(), 'delphi', "text/x-pascal should be delphi");
+
+ $p = new \libraries\Pygments('/invalid/filepath', 'application/octet-stream', 'stdin');
+ $this->t->is($p->autodetect_lexer(), false, "application/octet-stream should return false");
+ }
+
+ public function test_autodetect_lexer_specialFilenames()
+ {
+ $p = new \libraries\Pygments('/invalid/filepath', 'text/plain', 'foo.c');
+ $this->t->is($p->autodetect_lexer(), 'c', "foo.c should be c");
+
+ $p = new \libraries\Pygments('/invalid/filepath', 'text/plain', 'PKGBUILD');
+ $this->t->is($p->autodetect_lexer(), 'bash', "PKGBUILD should be bash");
+
+ $p = new \libraries\Pygments('/invalid/filepath', 'text/plain', 'asciinema.json');
+ $this->t->is($p->autodetect_lexer(), 'asciinema', "asciinema.json should be asciinema");
+
+ $p = new \libraries\Pygments('/invalid/filepath', 'text/plain', 'test.asciinema.json');
+ $this->t->is($p->autodetect_lexer(), 'asciinema', "asciinema.json should be asciinema");
+ }
+
+ public function test_autodetect_lexer_specialFilenamesBinaryShouldNotHighlight()
+ {
+ $p = new \libraries\Pygments('/invalid/filepath', 'application/octet-stream', 'foo.c');
+ $this->t->is($p->autodetect_lexer(), false, "foo.c should not highlight if binary");
+
+ $p = new \libraries\Pygments('/invalid/filepath', 'application/octet-stream', 'PKGBUILD');
+ $this->t->is($p->autodetect_lexer(), false, "PKGBUILD should not highlight if binary");
+ }
+
+ public function test_can_highlight_normalCase()
+ {
+ $p = new \libraries\Pygments('/invalid/filepath', 'text/plain', 'stdin');
+ $this->t->is($p->can_highlight(), true, "text/plain can highlight");
+
+ $p = new \libraries\Pygments('/invalid/filepath', 'application/x-php', 'stdin');
+ $this->t->is($p->can_highlight(), true, "application/x-php can highlight");
+
+ $p = new \libraries\Pygments('/invalid/filepath', 'application/octet-stream', 'stdin');
+ $this->t->is($p->can_highlight(), false, "application/octet-stream can not highlight");
+ }
+
+ public function test_autodetect_lexer_canButShouldntHighlight()
+ {
+ $p = new \libraries\Pygments('/invalid/filepath', 'image/svg+xml', 'foo.svg');
+ $this->t->is($p->autodetect_lexer(), false, "image/svg+xml should return false");
+ }
+
+ public function test_can_highlight_canButShouldntHighlight()
+ {
+ $p = new \libraries\Pygments('/invalid/filepath', 'image/svg+xml', 'foo.svg');
+ $this->t->is($p->can_highlight(), true, "image/svg+xml can highlight");
+ }
+
+ public function test_autodetect_lexer_strangeFilenames()
+ {
+ $p = new \libraries\Pygments('/invalid/filepath', 'text/plain', 'foo.');
+ $this->t->is($p->autodetect_lexer(), 'text', "foo. should be text");
+
+ }
+
+ public function test_get_lexers()
+ {
+ $l = \libraries\Pygments::get_lexers();
+
+ $this->t->is($l['text'], 'Plain text', 'Plain text lexer exists');
+ $this->t->is($l['c'], 'C', 'C lexer exists');
+ }
+
+ public function test_resolve_lexer_alias()
+ {
+ $p = new \libraries\Pygments('/invalid/filepath', 'text/plain', 'foo.pl');
+ $this->t->is($p->resolve_lexer_alias('pl'), 'perl', "Test pl alias for perl");
+
+ $this->t->is($p->resolve_lexer_alias('thisIsInvalid'), 'thisIsInvalid', "Test invalid alias");
+ }
+
+}
+
diff --git a/application/test/tests/test_libraries_tempfile.php b/application/test/tests/test_libraries_tempfile.php
new file mode 100644
index 000000000..f4c10a22e
--- /dev/null
+++ b/application/test/tests/test_libraries_tempfile.php
@@ -0,0 +1,46 @@
+<?php
+/*
+ * Copyright 2015 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+namespace test\tests;
+
+class test_libraries_tempfile extends \test\Test {
+
+ public function __construct()
+ {
+ parent::__construct();
+ }
+
+ public function init()
+ {
+ }
+
+ public function cleanup()
+ {
+ }
+
+ public function test_destructor_normalCase()
+ {
+ $t = new \libraries\Tempfile();
+ $file = $t->get_file();
+ $this->t->is(file_exists($file), true, "file should exist");
+ unset($t);
+ $this->t->is(file_exists($file), false, "file should no longer exist after destruction of object");
+ }
+
+ public function test_destructor_alreadyRemoved()
+ {
+ $t = new \libraries\Tempfile();
+ $file = $t->get_file();
+ $this->t->is(file_exists($file), true, "file should exist");
+ unlink($file);
+ $this->t->is(file_exists($file), false, "file deleted");
+ unset($t);
+ $this->t->is(file_exists($file), false, "file should no longer exist after destruction of object");
+ }
+}
diff --git a/application/test/tests/test_models_muser.php b/application/test/tests/test_models_muser.php
new file mode 100644
index 000000000..af0e58834
--- /dev/null
+++ b/application/test/tests/test_models_muser.php
@@ -0,0 +1,113 @@
+<?php
+/*
+ * Copyright 2016 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+namespace test\tests;
+
+class test_models_muser extends \test\Test {
+
+ public function __construct()
+ {
+ parent::__construct();
+ }
+
+ public function init()
+ {
+ }
+
+ public function cleanup()
+ {
+ }
+
+ public function test_valid_username()
+ {
+ $CI =& get_instance();
+
+ $this->t->is($CI->muser->valid_username("thisisbob42"), true, "valid username");
+ $this->t->is($CI->muser->valid_username("31337"), true, "valid username");
+ $this->t->is($CI->muser->valid_username("thisisjoe"), true, "valid username");
+ $this->t->is($CI->muser->valid_username("1234567890123456789012345678901"), true, "31 chars");
+ $this->t->is($CI->muser->valid_username("12345678901234567890123456789012"), true, "32 chars");
+
+ $this->t->is($CI->muser->valid_username("Joe"), false, "contains uppercase");
+ $this->t->is($CI->muser->valid_username("joe_bob"), false, "contains underscore");
+ $this->t->is($CI->muser->valid_username("joe-bob"), false, "contains dash");
+ $this->t->is($CI->muser->valid_username("123456789012345678901234567890123"), false, "33 chars");
+ $this->t->is($CI->muser->valid_username("1234567890123456789012345678901234"), false, "34 chars");
+ }
+
+ public function test_valid_email()
+ {
+ $CI =& get_instance();
+
+ $this->t->is($CI->muser->valid_email("joe@bob.com"), true, "valid email");
+ $this->t->is($CI->muser->valid_email("joe+mailbox@bob.com"), true, "valid email");
+ $this->t->is($CI->muser->valid_email("bob@fancyaddress.net"), true, "valid email");
+
+ $this->t->is($CI->muser->valid_email("joebob.com"), false, "missing @");
+ }
+
+ public function test_delete_user()
+ {
+ $CI =& get_instance();
+ $CI->muser->add_user("userdeltest1", "supersecret", "tester@localhost.lan", null);
+ $this->t->is($CI->muser->username_exists("userdeltest1"), true, "User should exist after creation");
+
+ $ret = $CI->muser->delete_user("userdeltest1", "wrongpassword");
+ $this->t->is($ret, false, "Deletion should fail with incorrect password");
+
+ $ret = $CI->muser->delete_user("userdeltest1", "");
+ $this->t->is($ret, false, "Deletion should fail with empty password");
+
+ $this->t->is($CI->muser->username_exists("userdeltest1"), true, "User should exist after failed deletions");
+
+ $ret = $CI->muser->delete_user("userdeltest1", "supersecret");
+ $this->t->is($ret, true, "Deletion should succeed with correct data");
+ $this->t->is($CI->muser->username_exists("userdeltest1"), false, "User should not exist after deletion");
+ }
+
+ public function test_delete_user_verifyFilesDeleted()
+ {
+ $CI =& get_instance();
+
+ $id = "testid1";
+ $id2 = "testid2";
+ $content = "test content";
+ $filename = "some cool name";
+ $username = "testuser1";
+ $password = "testpass";
+
+ $CI->muser->add_user($username, $password, "tester@localhost.lan", null);
+ $userid = $CI->muser->get_userid_by_name($username);
+
+ $CI->muser->add_user("joe", "joeisawesome", "tester2@localhost.lan", null);
+ $userid2 = $CI->muser->get_userid_by_name("joe");
+
+ \service\files::add_file_data($userid, $id, $content, $filename);
+ \service\files::add_file_data($userid2, $id2, $content, $filename);
+
+ $mid = \service\files::create_multipaste([$id], $userid, [3,6])['url_id'];
+ $mid2 = \service\files::create_multipaste([$id2], $userid2, [3,6])['url_id'];
+
+ $this->t->is($CI->mfile->id_exists($id), true, "File exists after being added");
+ $this->t->is($CI->mmultipaste->id_exists($mid), true, "Multipaste exists after creation");
+ $this->t->is($CI->mfile->id_exists($id2), true, "File2 exists after being added");
+ $this->t->is($CI->mmultipaste->id_exists($mid2), true, "Multipaste2 exists after creation");
+
+ $ret = $CI->muser->delete_user($username, $password);
+ $this->t->is($ret, true, "Delete user");
+
+ $this->t->is($CI->mfile->id_exists($id), false, "File should be gone after deletion of user");
+ $this->t->is($CI->mmultipaste->id_exists($mid), false, "Multipaste should be gone after deletion of user");
+ $this->t->is($CI->mfile->id_exists($id2), true, "File2 owned by different user should still exist after deletion from other user");
+ $this->t->is($CI->mmultipaste->id_exists($mid2), true, "Multipaste2 owned by different user should still exist after deletion from other user");
+ }
+
+
+}
+
diff --git a/application/test/tests/test_service_files.php b/application/test/tests/test_service_files.php
new file mode 100644
index 000000000..b9d6fce66
--- /dev/null
+++ b/application/test/tests/test_service_files.php
@@ -0,0 +1,121 @@
+<?php
+/*
+ * Copyright 2015 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+namespace test\tests;
+
+class test_service_files extends \test\Test {
+
+ public function __construct()
+ {
+ parent::__construct();
+
+ $CI =& get_instance();
+ $CI->load->model("muser");
+ $CI->load->model("mfile");
+
+ }
+
+ public function test_verify_uploaded_files_noFiles()
+ {
+ $a = array();
+ try {
+ \service\files::verify_uploaded_files($a);
+ // @codeCoverageIgnoreStart
+ $this->t->fail("verify should error");
+ // @codeCoverageIgnoreEnd
+ } catch (\exceptions\UserInputException $e) {
+ $this->t->is($e->get_error_id(), "file/no-file", "verify should error");
+ }
+ }
+
+ public function test_verify_uploaded_files_normal()
+ {
+ $CI =& get_instance();
+ $a = array(
+ array(
+ "name" => "foobar.txt",
+ "type" => "text/plain",
+ "tmp_name" => NULL,
+ "error" => UPLOAD_ERR_OK,
+ "size" => 1,
+ "formfield" => "file[1]",
+ )
+ );
+
+ \service\files::verify_uploaded_files($a);
+ $this->t->pass("verify should work");
+ }
+
+ public function test_verify_uploaded_files_uploadError()
+ {
+ $CI =& get_instance();
+ $a = array(
+ array(
+ "name" => "foobar.txt",
+ "type" => "text/plain",
+ "tmp_name" => NULL,
+ "error" => UPLOAD_ERR_NO_FILE,
+ "size" => 1,
+ "formfield" => "file[1]",
+ )
+ );
+
+ try {
+ \service\files::verify_uploaded_files($a);
+ // @codeCoverageIgnoreStart
+ $this->t->fail("verify should error");
+ // @codeCoverageIgnoreEnd
+ } catch (\exceptions\UserInputException $e) {
+ $data = $e->get_data();
+ $this->t->is($e->get_error_id(), "file/upload-verify", "verify should error");
+ $this->t->is_deeply(array(
+ 'file[1]' => array(
+ 'filename' => 'foobar.txt',
+ 'formfield' => 'file[1]',
+ 'message' => 'No file was uploaded',
+ ),
+ ), $data, "expected data in exception");
+ }
+ }
+
+ public function test_ellipsize()
+ {
+ $a1 = "abc";
+ $a2 = "abc\nabc";
+ $a3 = "abc\nabc\nabc";
+ $a4 = "abc\nabc\nabc\nabc";
+
+ $this->t->is(\service\files::ellipsize($a1, 1, strlen($a1)),
+ $a1, "Trim 1 line to 1, no change");
+
+ $this->t->is(\service\files::ellipsize($a3, 3, strlen($a3)),
+ $a3, "Trim 3 lines to 3, no change");
+
+ $this->t->is(\service\files::ellipsize($a3, 5, strlen($a3)),
+ $a3, "Trim 3 lines to 5, no change");
+
+ $this->t->is(\service\files::ellipsize($a2, 1, strlen($a2)),
+ "$a1\n...", "Trim 2 lines to 1, drop one line");
+
+ $this->t->is(\service\files::ellipsize($a3, 2, strlen($a3)),
+ "$a2\n...", "Trim 3 lines to 2, drop one line");
+
+ $this->t->is(\service\files::ellipsize($a4, 2, strlen($a4)),
+ "$a2\n...", "Trim 4 lines to 2, drop 2 lines");
+
+ $this->t->is(\service\files::ellipsize($a3, 3, strlen($a3) + 1),
+ "$a2\n...", "Last line incomplete, drop one line");
+
+ $this->t->is(\service\files::ellipsize($a1, 5, strlen($a1) + 1),
+ "$a1 ...", "Single line incomplete, only add dots");
+ }
+
+
+}
+
diff --git a/application/test/tests/test_service_files_valid_id.php b/application/test/tests/test_service_files_valid_id.php
new file mode 100644
index 000000000..24886be43
--- /dev/null
+++ b/application/test/tests/test_service_files_valid_id.php
@@ -0,0 +1,115 @@
+<?php
+/*
+ * Copyright 2015 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+namespace test\tests;
+
+class test_service_files_valid_id extends \test\Test {
+ private $model;
+ private $filedata;
+ private $config;
+
+ public function __construct()
+ {
+ parent::__construct();
+
+ $CI =& get_instance();
+ $CI->load->model("muser");
+ $CI->load->model("mfile");
+
+ }
+
+ public function init()
+ {
+ $this->model = \Mockery::mock("Mfile");
+ $this->model->shouldReceive("delete_id")->never()->byDefault();
+ $this->model->shouldReceive("delete_data_id")->never()->byDefault();
+ $this->model->shouldReceive("file")->with("file-hash-1-1")->andReturn("/invalid/path/file-1")->byDefault();
+ $this->model->shouldReceive("filemtime")->with("/invalid/path/file-1")->andReturn(500)->byDefault();
+ $this->model->shouldReceive("filesize")->with("/invalid/path/file-1")->andReturn(50*1024)->byDefault();
+ $this->model->shouldReceive("file_exists")->with("/invalid/path/file-1")->andReturn(true)->byDefault();
+
+ $this->filedata = array(
+ "data_id" => "file-hash-1-1",
+ "hash" => "file-hash-1",
+ "id" => "file-id-1",
+ "user" => 2,
+ "date" => 500,
+ );
+
+ $this->config = array(
+ "upload_max_age" => 20,
+ "sess_expiration" => 10,
+ "small_upload_size" => 10*1024,
+ );
+ }
+
+ public function cleanup()
+ {
+ \Mockery::close();
+ }
+
+ public function test_valid_id_keepNormalUpload()
+ {
+ $ret = \service\files::valid_id($this->filedata, $this->config, $this->model, 505);
+ $this->t->is($ret, true, "normal case should be valid");
+ }
+
+ public function test_valid_id_keepSmallUpload()
+ {
+ $this->model->shouldReceive("filesize")->with("/invalid/path/file-1")->once()->andReturn(50);
+
+ $ret = \service\files::valid_id($this->filedata, $this->config, $this->model, 550);
+ $this->t->is($ret, true, "file is old, but small and should be kept");
+ }
+
+ public function test_valid_id_removeOldFile()
+ {
+ $this->model->shouldReceive("delete_data_id")->with("file-hash-1-1")->once();
+
+ $ret = \service\files::valid_id($this->filedata, $this->config, $this->model, 550);
+ $this->t->is($ret, false, "file is old and should be removed");
+ }
+
+ public function test_valid_id_removeOldUpload()
+ {
+ $this->model->shouldReceive("delete_id")->with("file-id-1")->once();
+ $this->model->shouldReceive("filemtime")->with("/invalid/path/file-1")->once()->andReturn(540);
+
+ $ret = \service\files::valid_id($this->filedata, $this->config, $this->model, 550);
+ $this->t->is($ret, false, "upload is old and should be removed");
+ }
+
+ public function test_valid_id_keepNormalUnownedFile()
+ {
+ $this->filedata["user"] = 0;
+
+ $ret = \service\files::valid_id($this->filedata, $this->config, $this->model, 505);
+ $this->t->is($ret, true, "upload is unowned and should be kept");
+ }
+
+ public function test_valid_id_removeOldUnownedFile()
+ {
+ $this->model->shouldReceive("delete_id")->with("file-id-1")->once();
+ $this->filedata["user"] = 0;
+
+ $ret = \service\files::valid_id($this->filedata, $this->config, $this->model, 515);
+ $this->t->is($ret, false, "upload is old, unowned and should be removed");
+ }
+
+ public function test_valid_id_removeMissingFile()
+ {
+ $this->model->shouldReceive("file_exists")->with("/invalid/path/file-1")->once()->andReturn(false);
+ $this->model->shouldReceive("delete_data_id")->with("file-hash-1-1")->once();
+
+ $ret = \service\files::valid_id($this->filedata, $this->config, $this->model, 505);
+ $this->t->is($ret, false, "missing file should be removed");
+ }
+
+}
+
diff --git a/application/test/tests/test_service_multipaste_queue.php b/application/test/tests/test_service_multipaste_queue.php
new file mode 100644
index 000000000..cab53e335
--- /dev/null
+++ b/application/test/tests/test_service_multipaste_queue.php
@@ -0,0 +1,93 @@
+<?php
+/*
+ * Copyright 2016 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+namespace test\tests;
+
+class test_service_multipaste_queue extends \test\Test {
+
+ public function __construct()
+ {
+ parent::__construct();
+ }
+
+ public function init()
+ {
+ $this->session = \Mockery::mock("Session");
+ $this->session->shouldReceive("userdata")->never()->byDefault();
+ $this->session->shouldReceive("set_userdata")->never()->byDefault();
+
+ $this->mfile = \Mockery::mock("Mfile");
+ $this->mfile->shouldReceive("valid_id")->never()->byDefault();
+
+ $this->mmultipaste = \Mockery::mock("Mmultipaste");
+ $this->mmultipaste->shouldReceive("valid_id")->never()->byDefault();
+
+ $this->m = new \service\multipaste_queue($this->session, $this->mfile, $this->mmultipaste);
+ }
+
+ public function cleanup()
+ {
+ \Mockery::close();
+ }
+
+ public function test_get()
+ {
+ $this->session->shouldReceive('userdata')->with("multipaste_queue")->once()->andReturn(null);
+ $this->t->is_deeply($this->m->get(), [], "Fresh queue is empty");
+ }
+
+ public function test_set()
+ {
+ $this->session->shouldReceive('set_userdata')->with("multipaste_queue", ['abc', '123'])->once();
+
+ $this->mfile->shouldReceive('valid_id')->with('abc')->once()->andReturn(true);
+ $this->mfile->shouldReceive('valid_id')->with('123')->once()->andReturn(true);
+
+ $this->t->is($this->m->set(['abc', '123']), null, "set() should succeed");
+ }
+
+ public function test_append()
+ {
+ $this->session->shouldReceive('userdata')->with("multipaste_queue")->once()->andReturn(null);
+ $this->mfile->shouldReceive('valid_id')->with('abc')->times(2)->andReturn(true);
+ $this->session->shouldReceive('set_userdata')->with("multipaste_queue", ['abc'])->once();
+ $this->t->is($this->m->append(['abc']), null, "append([abc]) should succeed");
+
+ $this->session->shouldReceive('userdata')->with("multipaste_queue")->once()->andReturn(['abc']);
+ $this->mfile->shouldReceive('valid_id')->with('123')->once()->andReturn(true);
+ $this->session->shouldReceive('set_userdata')->with("multipaste_queue", ['abc', '123'])->once();
+ $this->t->is($this->m->append(['123']), null, "append([123]) should succeed");
+ }
+
+ public function test_append_itemAlreadyInQueue()
+ {
+ $this->session->shouldReceive('userdata')->with("multipaste_queue")->once()->andReturn(['abc', '123']);
+ $this->mfile->shouldReceive('valid_id')->with('abc')->once()->andReturn(true);
+ $this->mfile->shouldReceive('valid_id')->with('123')->once()->andReturn(true);
+ $this->session->shouldReceive('set_userdata')->with("multipaste_queue", ['abc', '123'])->once();
+ $this->t->is($this->m->append(['abc']), null, "append([abc]) should succeed");
+ }
+
+ public function test_append_multipaste()
+ {
+ $this->session->shouldReceive('userdata')->with("multipaste_queue")->once()->andReturn([]);
+ $this->mmultipaste->shouldReceive('valid_id')->with('m-abc')->once()->andReturn(true);
+ $this->mmultipaste->shouldReceive('get_files')->with('m-abc')->once()->andReturn([
+ ['id' => 'abc'],
+ ['id' => '123'],
+ ]);
+ $this->mfile->shouldReceive('valid_id')->with('abc')->once()->andReturn(true);
+ $this->mfile->shouldReceive('valid_id')->with('123')->once()->andReturn(true);
+ $this->session->shouldReceive('set_userdata')->with("multipaste_queue", ['abc', '123'])->once();
+ $this->t->is($this->m->append(['m-abc']), null, "append([m-abc]) should succeed");
+ }
+
+
+}
+
diff --git a/application/test/tests/test_service_storage.php b/application/test/tests/test_service_storage.php
new file mode 100644
index 000000000..83284ea4b
--- /dev/null
+++ b/application/test/tests/test_service_storage.php
@@ -0,0 +1,172 @@
+<?php
+/*
+ * Copyright 2016 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+namespace test\tests;
+
+class test_service_storage extends \test\Test {
+
+ private $tempdir;
+
+ public function __construct()
+ {
+ parent::__construct();
+ }
+
+ public function init()
+ {
+ $this->tempdir = trim((new \libraries\ProcRunner(['mktemp', '-d']))->execSafe()['stdout']);
+ }
+
+ public function cleanup()
+ {
+ rmdir($this->tempdir);
+ }
+
+ public function test_normalCase()
+ {
+ $file = $this->tempdir.'/testfile1';
+ $storage = new \service\storage($file);
+
+ $this->t->is($storage->get_file(), $file, "get_file returns correct path");
+
+ $a = $storage->begin();
+ file_put_contents($a, "teststring1");
+ $this->t->is(file_exists($file), false, "Test file doesn't exist yet");
+ $this->t->is($storage->exists(), false, "Test file doesn't exist yet");
+
+ $storage->commit();
+ $this->t->is(file_exists($file), true, "Test file has been created");
+ $this->t->is(file_get_contents($file), 'teststring1', "Test file has correct content");
+
+ unlink($file);
+ }
+
+ public function test_existingFile()
+ {
+ $file = $this->tempdir.'/testfile-existing-file';
+ file_put_contents($file, "teststring-old");
+
+ $storage = new \service\storage($file);
+
+ $a = $storage->begin();
+ file_put_contents($a, "teststring-changed");
+ $this->t->is(file_exists($file), true, "Test file already exists");
+ $this->t->is(file_get_contents($file), 'teststring-old', "Test file has old content");
+
+ $storage->commit();
+ $this->t->is(file_exists($file), true, "Test file still exists");
+ $this->t->is(file_get_contents($file), 'teststring-changed', "Test file has updated content");
+
+ unlink($file);
+ }
+
+ public function test_rollback()
+ {
+ $file = $this->tempdir.'/testfile-rollback';
+ file_put_contents($file, "teststring-old");
+
+ $storage = new \service\storage($file);
+
+ $a = $storage->begin();
+ file_put_contents($a, "teststring-changed");
+ $this->t->is(file_exists($file), true, "Test file already exists");
+ $this->t->is(file_get_contents($file), 'teststring-old', "Test file has old content");
+
+ $storage->rollback();
+ $this->t->is(file_exists($file), true, "Test file still exists");
+ $this->t->is(file_get_contents($file), 'teststring-old', "Test file still has old content");
+
+ unlink($file);
+ }
+
+ public function test_gzip_compress()
+ {
+ $file = $this->tempdir.'/testfile-gzip';
+ file_put_contents($file, "teststring-old");
+
+ $storage = new \service\storage($file);
+
+ $a = $storage->begin();
+ $new_string = str_repeat("teststring-changed", 500);
+ file_put_contents($a, $new_string);
+
+ $ret = $storage->gzip_compress();
+ $this->t->is($ret, true, "Compression succeeded");
+
+ $this->t->is(file_exists($file), true, "Test file still exists");
+ $this->t->is(file_get_contents($file), 'teststring-old', "Test file still has old content");
+
+ $storage->commit();
+
+ ob_start();
+ readgzfile($file);
+ $file_content = ob_get_clean();
+
+ $this->t->is_deeply($new_string, $file_content, "File is compressed and has correct content");
+
+ unlink($file);
+ }
+
+ public function test_unlink()
+ {
+ $file = $this->tempdir.'/testfile-unlink';
+ file_put_contents($file, "teststring-old");
+
+ $storage = new \service\storage($file);
+ $this->t->is(file_exists($file), true, "Test file exists");
+ $storage->unlink();
+ $this->t->is(file_exists($file), false, "Test file has been removed");
+ }
+
+ public function test_unlink_missingFile()
+ {
+ $file = $this->tempdir.'/testfile-unlink';
+
+ $storage = new \service\storage($file);
+ $this->t->is(file_exists($file), false, "Test file does nto exist");
+ $storage->unlink();
+ $this->t->is(file_exists($file), false, "Test file still doesn't exist");
+ }
+
+ public function test_begin_calledMultipleTimes()
+ {
+ $file = $this->tempdir.'/testfile-begin-multi';
+ file_put_contents($file, "teststring-old");
+
+ $storage = new \service\storage($file);
+ $a = $storage->begin();
+ file_put_contents($a, "blub");
+
+ $b = $storage->begin();
+ file_put_contents($b, "second write");
+
+ $storage->commit();
+ $this->t->is(file_get_contents($file), "second write", "File contains second write");
+
+ unlink($file);
+ }
+
+ public function test_begin_creationOfDir()
+ {
+ $dir = $this->tempdir.'/testdir/';
+ $file = $dir.'testfile';
+ $storage = new \service\storage($file);
+
+ $this->t->is(is_dir($dir), false, "Directory does not exist");
+
+ $a = $storage->begin();
+
+ $this->t->is(is_dir($dir), true, "Directory exists");
+
+ $storage->rollback();
+ rmdir($dir);
+ }
+
+}
+
diff --git a/application/test/tests/test_service_user.php b/application/test/tests/test_service_user.php
new file mode 100644
index 000000000..d7e34a71b
--- /dev/null
+++ b/application/test/tests/test_service_user.php
@@ -0,0 +1,65 @@
+<?php
+/*
+ * Copyright 2018 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+namespace test\tests;
+
+class test_service_user extends \test\Test {
+
+ public function __construct() {
+ parent::__construct();
+ }
+
+ public function init() {
+ }
+
+ public function cleanup() {
+ }
+
+ public function test_invitation_key_delete() {
+ $CI =& get_instance();
+
+ $userid = 1;
+
+ $result = $CI->db->select('user, key, action')->from('actions')->get()->result_array();
+ $this->t->is_deeply([], $result, "database contains no actions");
+
+ $key = \service\user::create_invitation_key($userid);
+
+ $result = $CI->db->select('user, key, action')->from('actions')->get()->result_array();
+ $this->t->is_deeply([['user' => "".$userid, 'key' => $key, 'action' => 'invitation']], $result, "database contains new key");
+
+ $ret = \service\user::delete_invitation_key($userid+1, $key);
+ $this->t->is(0, $ret, "Should have removed no keys because incorrect user/key");
+ $result = $CI->db->select('user, key, action')->from('actions')->get()->result_array();
+ $this->t->is_deeply([['user' => "".$userid, 'key' => $key, 'action' => 'invitation']], $result, "database contains new key after incorrect deletion");
+
+ $ret = \service\user::delete_invitation_key($userid+1, "foobar-");
+ $this->t->is(0, $ret, "Should have removed no keys because incorrect user/key");
+ $result = $CI->db->select('user, key, action')->from('actions')->get()->result_array();
+ $this->t->is_deeply([['user' => "".$userid, 'key' => $key, 'action' => 'invitation']], $result, "database contains new key after incorrect deletion");
+
+ $ret = \service\user::delete_invitation_key($userid+1, "");
+ $this->t->is(0, $ret, "Should have removed no keys because incorrect user/key");
+ $result = $CI->db->select('user, key, action')->from('actions')->get()->result_array();
+ $this->t->is_deeply([['user' => "".$userid, 'key' => $key, 'action' => 'invitation']], $result, "database contains new key after incorrect deletion");
+
+ $ret = \service\user::delete_invitation_key($userid, "");
+ $this->t->is(0, $ret, "Should have removed no keys because incorrect user/key");
+ $result = $CI->db->select('user, key, action')->from('actions')->get()->result_array();
+ $this->t->is_deeply([['user' => "".$userid, 'key' => $key, 'action' => 'invitation']], $result, "database contains new key");
+
+ $ret = \service\user::delete_invitation_key($userid, $key);
+ $this->t->is(1, $ret, "One key should be removed");
+ $result = $CI->db->select('user, key, action')->from('actions')->get()->result_array();
+ $this->t->is_deeply([], $result, "key has been deleted");
+
+ }
+
+}
+
diff --git a/application/third_party/QrCode b/application/third_party/QrCode
new file mode 160000
+Subproject 4638f11b6944cccce997db7fa7508b5a7ad1a61
diff --git a/application/third_party/mockery b/application/third_party/mockery
new file mode 160000
+Subproject 20cab678faed06fac225193be281ea0fddb43b9
diff --git a/application/third_party/parsedown b/application/third_party/parsedown
new file mode 160000
+Subproject 490a8f35a4163f59230f53c34f1fbb22a864c01
diff --git a/application/third_party/test-more-php/Test-More-OO.php b/application/third_party/test-more-php/Test-More-OO.php
new file mode 100755
index 000000000..7ce9f9421
--- /dev/null
+++ b/application/third_party/test-more-php/Test-More-OO.php
@@ -0,0 +1,455 @@
+<?php
+/*
+ Test-More-OO.php:
+ A workalike of Perl's Test::More for PHP.
+
+ Why Test-More?
+ Test-More is a great way to start testing RIGHT NOW.
+
+ Why ok and not ok?
+ Test-More produces TAP compliant output.
+ For more on TAP, see: http://testanything.org
+ For the TAP spec, see: http://search.cpan.org/dist/TAP/TAP.pm
+
+ Other testing libraries:
+ You can replace Test-Simple with Test-More without making any changes
+ to existing test code, providing access to further testing methods.
+ You can also replace any other PHP Test::More workalike library out there
+ with Test-More.php and it will work without making any changes to the code.
+
+ Assertions:
+ produce TAP output
+ provide testing functions
+ exit with error code:
+ 0 all tests successful
+ 255 test died or all passed but wrong # of tests run
+ any other number how many failed (including missing or extras)
+
+ Example:
+ require_once('Test-More-OO.php');
+ $t = new TestMore();
+ $t->plan(2);
+ $t->ok(1 + 1 = 2, 'One plus one equals two');
+ $t->ok( doSomethingAndReturnTrue() , 'doSomethingAndReturnTrue() successful');
+
+ Procedural Example:
+ require_once('Test-More.php');
+ plan(2);
+ ok(1 + 1 = 2, 'One plus one equals two');
+ ok( doSomethingAndReturnTrue() , 'doSomethingAndReturnTrue() successful');
+
+ From a browser
+ If you are running Test-Simple on a web server and want slightly more web-readable
+ output, call the web_output() method/function.
+
+ Updates
+ Updates will be posted to the Google code page:
+ http://code.google.com/p/test-more-php/
+
+ Bugs
+ Please file bug reports via the Issues tracker at the google code page.
+
+ Acknowledgements
+ Michael G Schwern: http://search.cpan.org/~mschwern/Test-Simple/
+ Chris Shiflet: http://shiflett.org/code/test-more.php
+
+ Author
+ Copyright RJ Herrick <RJHerrick@beyondlogical.net> 2009, 2010
+
+*/
+
+require_once('Test-Simple-OO.php');
+
+class TestMore extends TestSimple {
+
+/* Test-More extensions */
+ private $interp;
+
+ function pass ($name = NULL) {
+ return $this->ok(TRUE, $name);
+ }
+
+ function fail ($name = NULL) {
+ return $this->ok(FALSE, $name);
+ }
+
+ function _compare ($operator, $thing1, $thing2, $name = NULL) {
+ // Test.php's cmp_ok function accepts coderefs, hmmm
+
+ $result = eval("return (\$thing1 $operator \$thing2);");
+
+ return $this->ok($result, $name);
+ }
+
+ private function dumpvar($a) {
+ ob_start();
+ var_dump($a);
+ $ret = ob_get_clean();
+ $ret = preg_replace("/^[^\n]*\n/", "", $ret);
+ $ret = preg_replace("/\n$/", "", $ret);
+ # replace unprintable characters with questionmarks
+ $old = ini_get("mbstring.substitute_character");
+ ini_set("mbstring.substitute_character", "?");
+ $ret = mb_convert_encoding($ret, 'UTF-8', 'UTF-8');
+ ini_set("mbstring.substitute_character", $old);
+ return $ret;
+ }
+
+ function is ($thing1, $thing2, $name = NULL) {
+ $pass = $this->_compare ('===',$thing1,$thing2,$name);
+ if (!$pass) {
+ $this->diag(" got: ".$this->dumpvar($thing1)."",
+ " expected: ".$this->dumpvar($thing2)."");
+ }
+ return $pass;
+ }
+
+ function isnt ($thing1, $thing2, $name = NULL) {
+ $pass = $this->_compare ('!==',$thing1,$thing2,$name);
+ if (!$pass) {
+ $this->diag(" got: '$thing1'",
+ " expected: '$thing2'");
+ }
+ return $pass;
+ }
+
+ function like ($string, $pattern, $name = NULL) {
+ $pass = preg_match($pattern, $string);
+
+ $ok = $this->ok($pass, $name);
+
+ if (!$ok) {
+ $this->diag(" '$string'");
+ $this->diag(" doesn't match '$pattern'");
+ }
+
+ return $ok;
+ }
+
+ function unlike ($string, $pattern, $name = NULL) {
+ $pass = !preg_match($pattern, $string);
+
+ $ok = $this->ok($pass, $name);
+
+ if (!$ok) {
+ $this->diag(" '$string'");
+ $this->diag(" matches '$pattern'");
+ }
+
+ return $ok;
+ }
+
+ function cmp_ok ($thing1, $operator, $thing2, $name = NULL) {
+ eval("\$pass = (\$thing1 $operator \$thing2);");
+
+ ob_start();
+ var_dump($thing1);
+ $_thing1 = trim(ob_get_clean());
+
+ ob_start();
+ var_dump($thing2);
+ $_thing2 = trim(ob_get_clean());
+
+ $ok = $this->ok($pass, $name);
+
+ if (!$ok) {
+ $this->diag(" got: $_thing1");
+ $this->diag(" expected: $_thing2");
+ }
+
+ return $ok;
+ }
+
+ function can_ok ($object, $methods) {
+ $pass = TRUE;
+ $errors = array();
+ if (!is_array($methods)) $methods = array($methods);
+
+ foreach ($methods as $method) {
+ if (!method_exists($object, $method)) {
+ $pass = FALSE;
+ $errors[] = " method_exists(\$object, $method) failed";
+ }
+ }
+
+ $ok = $this->ok($pass, "method_exists(\$object, ...)");
+
+ if (!$ok) {
+ $this->diag($errors);
+ }
+
+ return $ok;
+ }
+
+ function isa_ok ($object, $expected_class, $object_name = 'The object') {
+ $got_class = get_class($object);
+
+ if (version_compare(phpversion(), '5', '>=')) {
+ $pass = ($got_class == $expected_class);
+ } else {
+ $pass = ($got_class == strtolower($expected_class));
+ }
+
+ if ($pass) {
+ $ok = $this->ok(TRUE, "$object_name isa $expected_class");
+ } else {
+ $ok = $this->ok(FALSE, "$object_name isn't a '$expected_class' it's a '$got_class'");
+ }
+
+ return $ok;
+ }
+
+ function _include_fatal_error_handler ($buffer) {
+
+ // Finish successfully? Carry on.
+ if ($buffer === 'included OK') return '';
+
+ $module = $this->LastModuleTested;
+
+ // Inside ob_start, won't see the output
+ $this->ok(FALSE,"include $module");
+
+ $message = trim($buffer);
+ $unrunmsg = '';
+
+ if ( is_int($this->NumberOfTests) ) {
+ $unrun = $this->NumberOfTests - (int)$this->TestsRun;
+ $plural = $unrun == 1 ? '' : 's';
+ $unrunmsg = "# Looks like ${unrun} planned test${plural} never ran.\n";
+ }
+
+ $gasp = $this->LastFail . "\n"
+ . "# Tried to include '$module'\n"
+ . "# $message\n"
+ . $unrunmsg
+ . "# Looks like 1 test aborted before it could finish due to a fatal error!\n"
+ . "Bail out! Terminating prematurely due to fatal error.\n"
+ ;
+
+ return $gasp;
+ }
+
+ function _include_ok ($module,$type) {
+ $path = null;
+ $full_path = null;
+ $retval = 999;
+
+ // Resolve full path, nice to know although only necessary on windows
+ foreach (explode(PATH_SEPARATOR,get_include_path()) as $prefix) {
+ // Repeat existance test and find full path
+ $full_path = realpath($prefix.DIRECTORY_SEPARATOR.$module);
+ $lines = @file($full_path);
+ // Stop on success
+ if ($lines) {
+ $path = $full_path;
+ break;
+ }
+ }
+ // Make sure, if we would include it, it's not going to choke on syntax
+ $error = false;
+ if ($path) {
+ @exec('"'.$this->interp().'" -l '.$path, $bunk, $retval);
+ if ($retval===0) {
+ // Prep in case we hit error handler
+ $this->Backtrace = debug_backtrace();
+ $this->LastModuleTested = $module;
+ ob_start(array($this,'_include_fatal_error_handler'));
+ if ($type === 'include') {
+ $done = (include $module);
+ } else if ($type === 'require') {
+ $done = (require $module);
+ } else {
+ $this->bail("Second argument to _include_ok() must be 'require' or 'include'");
+ }
+ echo "included OK";
+ ob_end_flush();
+ if (!$done) $error = " Unable to $type '$module'";
+ } else {
+ $error = " Syntax check for '$module' failed";
+ }
+ } else {
+ $error = " Cannot find ${type}d file '$module'";
+ }
+
+ $pass = !$retval && $done;
+ $ok = $this->ok($pass, "$type $module" );
+ if ($error) $this->diag($error);
+ if ($error && $path) $this->diag(" Resolved $module as $full_path");
+ return $ok;
+ }
+
+ function include_ok ($module) {
+ // Test success of including file, but continue testing if possible even if unable to include
+
+ return $this->_include_ok($module,'include');
+ }
+
+
+ function require_ok ($module) {
+ // As include_ok() but exit gracefully if requirement missing
+
+ $ok = $this->_include_ok($module,'require');
+
+ // Stop testing if we fail a require test
+ // Not a bail because you asked for it
+ if ($ok == FALSE) {
+ $this->diag(" Exiting due to missing requirement.");
+ throw new RuntimeException("Missing requirement");
+ }
+
+ return $ok;
+ }
+
+ function skip($why, $num) {
+
+ if ($num < 0) $num = 0;
+
+ $this->Skips += $num;
+ $this->SkipReason = $why;
+
+ return TRUE;
+ }
+
+ function eq_array ($thing1, $thing2) {
+ // Deprecated comparison function provided for compatibility
+ // Look only at values, order is important
+ $this->diag(" ! eq_array() is a deprecated comparison function provided for compatibility. Use array_diff() or similar instead.");
+ return !array_diff($thing1, $thing2);
+ }
+
+ function eq_hash ($thing1, $thing2) {
+ // Deprecated comparison function provided for compatibility
+ // Look at keys and values, order is NOT important
+ $this->diag(" ! eq_hash() is a deprecated comparison function provided for compatibility. Use array_diff() or similar instead.");
+ return !array_diff_assoc($thing1, $thing2);
+ }
+
+ function eq_set ($thing1, $thing2, $name = NULL) {
+ // Deprecated comparison function provided for compatibility
+ // Look only at values, duplicates are NOT important
+ $this->diag(" ! eq_set() is a deprecated comparison function provided for compatibility. Use array_diff() or similar instead.");
+ $a = $thing1;
+ sort($a);
+ $b = $thing2;
+ sort($b);
+ return !array_diff($a, $b);
+ }
+
+ function is_deeply ($thing1, $thing2, $name = NULL) {
+
+ $pass = $this->_compare_deeply($thing1, $thing2, $name);
+
+ $ok = $this->ok($pass,$name);
+
+ if (!$ok) {
+ foreach(array($thing1,$thing2) as $it){
+ ob_start();
+ var_dump($it);
+ $dump = ob_get_clean();
+ #$stringified[] = implode("\n#",explode("\n",$dump));
+ $stringified[] = str_replace("\n","\n# ",$dump);
+ }
+ $this->diag(" wanted: ".$stringified[0]);
+ $this->diag(" got: ".$stringified[1]);
+ }
+
+ return $ok;
+ }
+
+ function isnt_deeply ($thing1, $thing2, $name = NULL) {
+
+ $pass = !$this->_compare_deeply($thing1, $thing2, $name);
+
+ $ok = $this->ok($pass,$name);
+
+ if (!$ok) $this->diag("Structures are identical.\n");
+
+ return $ok;
+ }
+
+ function _compare_deeply ($thing1, $thing2) {
+
+ if (is_array($thing1) && is_array($thing2)) {
+ if ((count($thing1) === count($thing2)) && !array_diff_key($thing1,$thing2)) {
+ foreach(array_keys($thing1) as $key){
+ $pass = $this->_compare_deeply($thing1[$key],$thing2[$key]);
+ if(!$pass) {
+ return FALSE;
+ }
+ }
+ return TRUE;
+
+ } else {
+ return FALSE;
+ }
+
+ } else {
+ return $thing1 === $thing2;
+ }
+ }
+
+ function todo ($why, $howmany) {
+ // Marks tests as expected to fail, then runs them anyway
+
+ if ($howmany < 0) $howmany = 0;
+
+ $this->Todo = $howmany;
+ $this->TodoReason = $why;
+
+ return TRUE;
+ }
+
+ function todo_skip ($why, $howmany) {
+ // Marks tests as expected to fail, then skips them, as they are expected to also create fatal errors
+
+ $this->todo($why, $howmany);
+ $this->skip($why, $howmany);
+
+ return TRUE;
+ }
+
+ function todo_start ($why) {
+ // as starting a TODO block in Perl- instead of using todo() to set a number of tests, all
+ // tests until todo_end are expected to fail and run anyway
+
+ $this->TodoBlock = FALSE;
+ $this->TodoReason = $why;
+
+ return TRUE;
+ }
+
+ function todo_end () {
+ // as ending a SKIP block in Perl
+
+ $this->TodoBlock = FALSE;
+ unset($this->TodoReason);
+
+ return TRUE;
+ }
+
+ function interp ($new_interp_command=NULL) {
+ // Return the command used to invoke the PHP interpreter, such as for exec()
+
+ if ($new_interp_command == NULL && $this->interp == '') {
+ // In some situations you might need to specify a php interpreter.
+ if ( isset($_SERVER['PHP']) ) {
+ $new_interp_command = escapeshellcmd($_SERVER['PHP']);
+ } else {
+ $new_interp_command = 'php';
+ }
+ }
+ if ($new_interp_command != $this->interp) {
+ $this->interp = $new_interp_command;
+
+ // Check that we can use the interpreter
+ @exec('"'.$this->interp.'" -v', $bunk, $retval);
+ if ($retval!==0) $this->bail("Unable to run PHP interpreter with '$this->interp'. Try setting the PHP environmant variable to the path of the interpreter.");
+ }
+
+ return $this->interp;
+ }
+
+
+}
+
+?>
diff --git a/application/third_party/test-more-php/Test-More.php b/application/third_party/test-more-php/Test-More.php
new file mode 100755
index 000000000..3cdf1ad37
--- /dev/null
+++ b/application/third_party/test-more-php/Test-More.php
@@ -0,0 +1,41 @@
+<?php
+/*
+ Procedural interface wrapper for Test-More-OO.php.
+ See Test-More-OO.php for documentation.
+*/
+
+require_once('Test-More-OO.php');
+
+global $__Test;
+$__Test = new TestMore();
+
+// Expose public API for TestMore methods as functions
+function plan() { global $__Test; $args = func_get_args(); return call_user_func_array(array($__Test,'plan'),$args); }
+function ok() { global $__Test; $args = func_get_args(); return call_user_func_array(array($__Test,'ok'),$args); }
+function diag() { global $__Test; $args = func_get_args(); return call_user_func_array(array($__Test,'diag'),$args); }
+function web_output() { global $__Test; $args = func_get_args(); return call_user_func_array(array($__Test,'web_output'),$args); }
+function done_testing() { global $__Test; $args = func_get_args(); return call_user_func_array(array($__Test,'done_testing'),$args); }
+function bail() { global $__Test; $args = func_get_args(); return call_user_func_array(array($__Test,'bail'),$args); }
+function pass() { global $__Test; $args = func_get_args(); return call_user_func_array(array($__Test,'pass'),$args); }
+function fail() { global $__Test; $args = func_get_args(); return call_user_func_array(array($__Test,'fail'),$args); }
+function is() { global $__Test; $args = func_get_args(); return call_user_func_array(array($__Test,'is'),$args); }
+function isnt() { global $__Test; $args = func_get_args(); return call_user_func_array(array($__Test,'isnt'),$args); }
+function like() { global $__Test; $args = func_get_args(); return call_user_func_array(array($__Test,'like'),$args); }
+function unlike() { global $__Test; $args = func_get_args(); return call_user_func_array(array($__Test,'unlike'),$args); }
+function cmp_ok() { global $__Test; $args = func_get_args(); return call_user_func_array(array($__Test,'cmp_ok'),$args); }
+function can_ok() { global $__Test; $args = func_get_args(); return call_user_func_array(array($__Test,'can_ok'),$args); }
+function isa_ok() { global $__Test; $args = func_get_args(); return call_user_func_array(array($__Test,'isa_ok'),$args); }
+function include_ok() { global $__Test; $args = func_get_args(); return call_user_func_array(array($__Test,'include_ok'),$args); }
+function require_ok() { global $__Test; $args = func_get_args(); return call_user_func_array(array($__Test,'require_ok'),$args); }
+function skip() { global $__Test; $args = func_get_args(); return call_user_func_array(array($__Test,'skip'),$args); }
+function eq_array() { global $__Test; $args = func_get_args(); return call_user_func_array(array($__Test,'eq_array'),$args); }
+function eq_hash() { global $__Test; $args = func_get_args(); return call_user_func_array(array($__Test,'eq_hash'),$args); }
+function eq_set() { global $__Test; $args = func_get_args(); return call_user_func_array(array($__Test,'eq_set'),$args); }
+function is_deeply() { global $__Test; $args = func_get_args(); return call_user_func_array(array($__Test,'is_deeply'),$args); }
+function isnt_deeply() { global $__Test; $args = func_get_args(); return call_user_func_array(array($__Test,'isnt_deeply'),$args); }
+function todo() { global $__Test; $args = func_get_args(); return call_user_func_array(array($__Test,'todo'),$args); }
+function todo_skip() { global $__Test; $args = func_get_args(); return call_user_func_array(array($__Test,'todo_skip'),$args); }
+function todo_start() { global $__Test; $args = func_get_args(); return call_user_func_array(array($__Test,'todo_start'),$args); }
+function todo_end() { global $__Test; $args = func_get_args(); return call_user_func_array(array($__Test,'todo_end'),$args); }
+
+?>
diff --git a/application/third_party/test-more-php/Test-Simple-OO.php b/application/third_party/test-more-php/Test-Simple-OO.php
new file mode 100755
index 000000000..9bbe4aada
--- /dev/null
+++ b/application/third_party/test-more-php/Test-Simple-OO.php
@@ -0,0 +1,237 @@
+<?php
+/*
+ Test-Simple-OO.php:
+ A workalike of Perl's Test::Simple for PHP.
+
+ Why Test-Simple?
+ Test-Simple is a super simple way to start testing RIGHT NOW.
+
+ Why ok and not ok?
+ Test-Simple produces TAP compliant output.
+ For more on TAP, see: http://testanything.org
+ For the TAP spec, see: http://search.cpan.org/dist/TAP/TAP.pm
+
+ Why plan?
+ Planning is enforced because, unless you explicitly declare your
+ intent, the test set cannot ensure that all the required testing
+ was performed. An assumption could be made, but error prone
+ assumptions are exactly what testing is here to prevent.
+
+ Other testing libraries:
+ You can replace Test-Simple with Test-More without making any changes
+ to existing test code, providing access to further testing methods.
+ You can also replace any other PHP Test::More workalike library out there
+ with Test-More.php and it will work without making any changes to the code.
+
+ Assertions:
+ produce TAP output
+ provide basic testing functions (plan, ok)
+ exit with error code:
+ 0 all tests successful
+ 255 test died or all passed but wrong # of tests run
+ any other number how many failed (including missing or extras)
+
+ Example:
+ require_once('Test-More-OO.php');
+ $t = new TestMore();
+ $t->plan(2);
+ $t->ok(1 + 1 = 2, 'One plus one equals two');
+ $t->ok( doSomethingAndReturnTrue() , 'doSomethingAndReturnTrue() successful');
+
+ Procedural Example:
+ require_once('Test-Simple');
+ plan(2);
+ ok(1 + 1 = 2, 'One plus one equals two');
+ ok( doSomethingAndReturnTrue() , 'doSomethingAndReturnTrue() successful');
+
+ From a browser
+ If you are running Test-Simple on a web server and want slightly more web-readable
+ output, call the web_output() method/function.
+
+ Updates
+ Updates will be posted to the Google code page:
+ http://code.google.com/p/test-more-php/
+
+ Bugs
+ Please file bug reports via the Issues tracker at the google code page.
+
+ Acknowledgements
+ Michael G Schwern: http://search.cpan.org/~mschwern/Test-Simple/
+ Chris Shiflet: http://shiflett.org/code/test-more.php
+
+ Author
+ Copyright RJ Herrick <RJHerrick@beyondlogical.net> 2009, 2010
+
+*/
+
+class TestSimple {
+
+ protected $Results = array('Failed'=>NULL,'Passed'=>NULL);
+ protected $TestName = array();
+ protected $TestsRun = 0;
+ protected $Skips;
+ protected $NumberOfTests;
+ protected $CurrentTestNumber;
+ protected $Filter;
+
+ protected $notes;
+
+ function plan ($NumberOfTests = NULL, $SkipReason = '') {
+ // Get/set intended number of tests
+
+ if ( is_int($this->NumberOfTests) && !is_null($NumberOfTests) ) $this->diag('The plan was already output.');
+
+ if ( $NumberOfTests === 'no_plan' ) {
+ // Equivalent to done_testing() at end of test script
+ $this->NumberOfTests = $NumberOfTests;
+ return;
+ } else if ( $NumberOfTests === 'skip_all' ) {
+ // Equivalent to done_testing() at end of test script
+ $this->NumberOfTests = $NumberOfTests;
+ $this->SkipAllReason = $SkipReason;
+ $this->diag("Skipping all tests: $SkipReason");
+ return;
+ }
+
+ // Return current value if no params passed (query to the plan)
+ if ( !func_num_args() && isset($this->NumberOfTests) ) return $this->NumberOfTests;
+
+ // Number of tests looks acceptable
+ if (!is_int($NumberOfTests) || 0 > $NumberOfTests) $this->bail( "Number of tests must be a positive integer. You gave it '$NumberOfTests'" );
+
+ // If just reporting
+ $skipinfo = '';
+ if ($this->NumberOfTests === 'skip_all') $skipinfo = ' # '.$this->SkipAllReason;
+
+ echo "1..${NumberOfTests}${skipinfo}\n";
+ $this->NumberOfTests = $NumberOfTests;
+
+ return;
+ }
+
+ function ok ($Result = NULL, $TestName = NULL) {
+ // Confirm param 1 is true (in the PHP sense)
+ // Unload the buffer regularly
+ if ($this->Filter) {
+ ob_flush();
+ }
+
+ $this->CurrentTestNumber++;
+ $this->TestsRun++;
+
+ if ($this->Skips) {
+ $this->Skips--;
+ $this->TestsSkipped++;
+ echo('ok '.$this->CurrentTestNumber.' # skip '.$this->SkipReason."\n");
+ return TRUE;
+ }
+
+ if ($this->NumberOfTests === 'skip_all') {
+ $this->TestsSkipped++;
+ $this->diag("SKIP '$TestName'");
+ echo('ok '.$this->CurrentTestNumber." # skip\n");
+ return TRUE;
+ }
+
+ if ( func_num_args() == 0 ) $this->bail('You must pass ok() a result to evaluate.');
+ if ( func_num_args() == 2 ) $this->TestName[$this->CurrentTestNumber] = $TestName;
+ if ( func_num_args() > 2 ) $this->bail('Wrong number of arguments passed to ok()');
+
+ $verdict = $Result ? 'Passed' : 'Failed';
+
+ $this->Results[$verdict]++;
+ #$this->TestResult[$this->CurrentTestNumber] = $verdict;
+
+ $caption = isset($this->TestName[$this->CurrentTestNumber]) ? $this->TestName[$this->CurrentTestNumber] : '';
+
+ $title = $this->CurrentTestNumber
+ . (isset($this->TestName[$this->CurrentTestNumber]) ? (' - '.$this->TestName[$this->CurrentTestNumber]) : '');
+
+ if ($verdict === 'Passed') {
+ echo "ok $title\n";
+ return TRUE;
+
+ } else {
+ echo $this->LastFail = "not ok $title\n";
+
+ $stack = isset($this->Backtrace) ? $this->Backtrace : debug_backtrace();
+ foreach (array_reverse($stack) as $frame) {
+ if (isset($frame["object"]) && $frame["object"] == $this) {
+ $file = $frame["file"];
+ $line = $frame["line"];
+ break;
+ }
+ }
+ unset($this->Backtrace);
+
+ if ($caption) {
+ $this->diag(" Failed test '$caption'"," at $file line $line.");
+ $this->LastFail .= "# Failed test '$caption'\n# at $file line $line.";
+ } else {
+ $this->diag(" Failed test at $file line $line.");
+ $this->LastFail .= "# Failed test at $file line $line.";
+ }
+
+ return FALSE;
+ }
+ }
+
+ function done_testing () {
+ // Change of plans (if there was one in the first place)
+ $this->plan((int)$this->TestsRun);
+ return;
+ }
+
+ function bail ($message = '') {
+ // Problem running the program
+ TestSimple::_bail($message);
+ }
+
+ static function _bail ($message = '') {
+ echo "Bail out! $message\n";
+ throw new RuntimeException("Bail out! $message");
+ }
+
+ function diag() {
+ // Print a diagnostic comment
+ $diagnostics = func_get_args();
+ $msg = '';
+ foreach ($diagnostics as $line) $msg .= "# ".str_replace("\n","\n# ",$line)."\n";
+ echo $msg;
+ if ($this->Filter) ob_flush();
+ return $msg;
+ }
+
+ function __destruct () {
+ // Parting remarks and proper exit code
+
+ # if ($this->NumberOfTests === 'no_plan') done_testing();
+ # if ($this->NumberOfTests === 'skip_all') plan(0);
+
+ if ($this->TestsRun && !isset($this->NumberOfTests)) {
+ echo "# Tests were run but no plan() was declared and done_testing() was not seen.\n";
+ } else {
+ if ($this->TestsRun !== $this->NumberOfTests) echo("# Looks like you planned ".(int)$this->NumberOfTests .' tests but ran '.(int)$this->TestsRun.".\n");
+
+ if ($this->Results['Failed']) echo("# Looks like you failed ". $this->Results['Failed'] .' tests of '.(int)$this->TestsRun.".\n");
+ }
+
+ // an extension to help debug
+ if ($this->notes) echo $this->notes;
+
+ if ($this->Filter) ob_end_flush();
+
+ $retval = ($this->Results['Failed'] > 254) ? 254 : $this->Results['Failed'];
+ return;
+ }
+
+ function web_output($callback = NULL) {
+ // Basic web formatting (newlines) of output via ob filter
+ if (isset($callback)) $this->Filter = $callback;
+ if (!isset($this->Filter)) $this->Filter = create_function('$string','$output = str_replace("\n","<br />\n",$string); return $output;');
+ ob_start($this->Filter);
+ }
+
+}
+
+?>
diff --git a/application/third_party/test-more-php/Test-Simple.php b/application/third_party/test-more-php/Test-Simple.php
new file mode 100755
index 000000000..5005383df
--- /dev/null
+++ b/application/third_party/test-more-php/Test-Simple.php
@@ -0,0 +1,18 @@
+<?php
+/*
+ Procedural wrapper for Test-Simple.php
+ See Test-Simple-OO.php for documentation.
+*/
+
+require_once('Test-Simple-OO.php');
+
+global $__Test;
+$__Test = new TestSimple();
+
+// Expose public API for TestSimple methods as functions
+function plan() { global $__Test; $args = func_get_args(); return call_user_func_array(array($__Test,'plan'),$args); }
+function ok() { global $__Test; $args = func_get_args(); return call_user_func_array(array($__Test,'ok'),$args); }
+function diag() { global $__Test; $args = func_get_args(); return call_user_func_array(array($__Test,'diag'),$args); }
+function web_output() { global $__Test; $args = func_get_args(); return call_user_func_array(array($__Test,'web_output'),$args); }
+
+?>
diff --git a/application/third_party/test-more-php/t/PHProvable.pl b/application/third_party/test-more-php/t/PHProvable.pl
new file mode 100755
index 000000000..1d2295895
--- /dev/null
+++ b/application/third_party/test-more-php/t/PHProvable.pl
@@ -0,0 +1,35 @@
+#!/bin/env perl
+
+# PHProveable.pl
+#
+# A wrapper/dummy for
+#
+# This script allows you to use the prove program with PHP test scripts
+# that output TAP, such as those written with Test-Simple or Test-More,
+# without requiring that the php test script be writen with a UNIX style
+# shebang line pointing to the processor:
+#
+# #!/bin/env php
+#
+# USAGE:
+# Your PHP test script should be named like this: TESTSCRIPTNAME.t.php.
+# You can either copy this file and name it TESTSCRIPTNAME.t or call it
+# explicitly as the first and only argument:
+# PHProvable.pl TESTSCRIPTNAME.t.php
+# The first method means you end up with a stub for each PHP script,
+# although on a system with symlinks you can use a symlink instead of
+# copying PHProveable:
+# ln -s PHPRoveable.pl TESTSCRIPTNAME.t
+# The stub method allows you to just run `prove` in a directory and have
+# it look for a /t directory, then find your *.t stubs and run them as
+# usual.
+#
+# NOTES:
+# Yeah, there are many ways to skin a cat. You could just leave the .php
+# off your test script and add the shebang line, but then you can't just
+# run the script via CGI without the shebang showing up as extra content,
+# and it won't work on windows via the CLI.
+
+my $script = $ARGV[0] ? $ARGV[0] : "$0.php";
+my $php_interp = $ENV{'PHP'} ? $ENV{'PHP'} : 'php';
+exec("$php_interp $script");
diff --git a/application/third_party/test-more-php/t/badlib.php b/application/third_party/test-more-php/t/badlib.php
new file mode 100755
index 000000000..ef7ee536a
--- /dev/null
+++ b/application/third_party/test-more-php/t/badlib.php
@@ -0,0 +1,5 @@
+<?php
+
+ die on inclusion
+
+?>
diff --git a/application/third_party/test-more-php/t/borklib.php b/application/third_party/test-more-php/t/borklib.php
new file mode 100755
index 000000000..da1ed4da9
--- /dev/null
+++ b/application/third_party/test-more-php/t/borklib.php
@@ -0,0 +1,5 @@
+<?php
+
+ missing_func();
+
+?>
diff --git a/application/third_party/test-more-php/t/goodlib.php b/application/third_party/test-more-php/t/goodlib.php
new file mode 100755
index 000000000..5b2140962
--- /dev/null
+++ b/application/third_party/test-more-php/t/goodlib.php
@@ -0,0 +1,5 @@
+<?php
+
+ function xyzzy () { return true; }
+
+?>
diff --git a/application/third_party/test-more-php/t/goodpage.php b/application/third_party/test-more-php/t/goodpage.php
new file mode 100755
index 000000000..ce38cb818
--- /dev/null
+++ b/application/third_party/test-more-php/t/goodpage.php
@@ -0,0 +1,5 @@
+<?php
+
+ $fnord++;
+
+?>
diff --git a/application/third_party/test-more-php/t/testertests_bail_badplan_negative.php b/application/third_party/test-more-php/t/testertests_bail_badplan_negative.php
new file mode 100755
index 000000000..81488367a
--- /dev/null
+++ b/application/third_party/test-more-php/t/testertests_bail_badplan_negative.php
@@ -0,0 +1,9 @@
+<?php
+
+ $lib = isset($_SERVER['TESTLIB']) ? $_SERVER['TESTLIB'] : 'Test-Simple.php';
+ require_once($lib);
+
+ plan(-2);
+
+ ok(1);
+?>
diff --git a/application/third_party/test-more-php/t/testertests_bail_badplan_noninteger.php b/application/third_party/test-more-php/t/testertests_bail_badplan_noninteger.php
new file mode 100755
index 000000000..843b13d31
--- /dev/null
+++ b/application/third_party/test-more-php/t/testertests_bail_badplan_noninteger.php
@@ -0,0 +1,9 @@
+<?php
+
+ $lib = isset($_SERVER['TESTLIB']) ? $_SERVER['TESTLIB'] : 'Test-Simple.php';
+ require_once($lib);
+
+ plan('xxx');
+
+ ok(1);
+?>
diff --git a/application/third_party/test-more-php/t/testertests_bundle.php b/application/third_party/test-more-php/t/testertests_bundle.php
new file mode 100755
index 000000000..91bf79569
--- /dev/null
+++ b/application/third_party/test-more-php/t/testertests_bundle.php
@@ -0,0 +1,42 @@
+<?php
+
+ $lib = isset($_SERVER['TESTLIB']) ? $_SERVER['TESTLIB'] : 'Test-More.php';
+ require_once($lib);
+ #plan(3);
+
+ diag('Test of various functions not otherwise broken out.');
+
+ pass("pass() is ok");
+ fail("fail() is not ok");
+
+ is('Ab3','Ab3','is() is ok');
+ isnt('Ab3',123,'isnt() is ok');
+ like('yackowackodot','/wacko/',"like() is ok");
+ unlike('yackowackodot','/boing/',"unlike() is ok");
+
+ cmp_ok(12, '>', 10, 'cmp_ok() is ok');
+ can_ok($__Test, 'plan' );
+ isa_ok($__Test, 'TestMore', 'Default Testing object');
+ include_ok('t/goodlib.php');
+ require_ok('t/goodpage.php');
+
+ $foo = array(1,'B','third');
+ $oof = array('third','B',1);
+
+ $bar = array('q'=>23,'Y'=>42,);
+ $rab = array('Y'=>42,'q'=>23,);
+
+ is_deeply($foo,$foo,'is_deeply() is ok');
+ isnt_deeply($foo,$bar,'isnt_deeply() is ok');
+
+ /*
+ function skip($SkipReason, $num) {
+ function todo ($why, $howmany) {
+ function todo_skip ($why, $howmany) {
+ function todo_start ($why) {
+ function todo_end () {
+ */
+
+ diag("Should fail 1 test, testing fail()");
+ done_testing();
+?>
diff --git a/application/third_party/test-more-php/t/testertests_deprecated_comparisons.php b/application/third_party/test-more-php/t/testertests_deprecated_comparisons.php
new file mode 100755
index 000000000..3fb42ee6d
--- /dev/null
+++ b/application/third_party/test-more-php/t/testertests_deprecated_comparisons.php
@@ -0,0 +1,27 @@
+<?php
+ $lib = isset($_SERVER['TESTLIB']) ? $_SERVER['TESTLIB'] : 'Test-Simple.php';
+ require_once($lib);
+ plan('no_plan');
+
+ diag('Test of deprecated Test::More functions provided for compatibility completeness.');
+
+ $foo = array(0=>1,1=>'B',2=>'third');
+ $oof = array(0=>'third',1=>'B',2=>1);
+
+
+
+ $bar = array('q'=>23,'Y'=>42,);
+ $rab = array('Y'=>42,'q'=>23,);
+
+
+
+ ok(eq_array($foo,$oof),'eq_array() with misordered array is ok');
+ ok(eq_array($bar,$rab),'eq_array() with misordered assoc is ok');
+ ok(eq_hash($foo,$oof),'eq_hash() with misordered array is ok');
+ ok(eq_hash($bar,$rab),'eq_hash() with misordered assoc is ok');
+ ok(eq_set($foo,$oof),'eq_set() with misordered array is ok');
+ ok(eq_set($bar,$rab),'eq_set() with misordered assoc is ok');
+
+ done_testing();
+
+?>
diff --git a/application/third_party/test-more-php/t/testertests_deprecated_comparisons.pl b/application/third_party/test-more-php/t/testertests_deprecated_comparisons.pl
new file mode 100755
index 000000000..2bea27ec4
--- /dev/null
+++ b/application/third_party/test-more-php/t/testertests_deprecated_comparisons.pl
@@ -0,0 +1,25 @@
+#!/bin/env perl
+ use strict;
+ use warnings;
+ use Test::More ('no_plan');
+
+ diag('Test of deprecated Test::More functions provided for compatibility completeness.');
+
+ my $foo = [1,'B','third'];
+ my $oof = ['third','B',1];
+ my $foo_h = {0=>1,1=>'B',2=>'third'};
+ my $oof_h = {0=>'third',1=>'B',2=>1};
+
+ my $bar = [23,42,];
+ my $rab = [42,23,];
+ my $bar_h = {'q'=>23,'Y'=>42,};
+ my $rab_h = {'Y'=>42,'q'=>23,};
+
+ ok(eq_array($foo,$oof),'eq_array() with misordered array is ok');
+ ok(eq_array($bar,$rab),'eq_array() with misordered assoc is ok');
+ ok(eq_hash($foo_h,$oof_h),'eq_hash() with misordered array is ok');
+ ok(eq_hash($bar_h,$rab_h),'eq_hash() with misordered assoc is ok');
+ ok(eq_set($foo,$oof),'eq_set() with misordered array is ok');
+ ok(eq_set($bar,$rab),'eq_set() with misordered assoc is ok');
+
+ done_testing();
diff --git a/application/third_party/test-more-php/t/testertests_exit_0.php b/application/third_party/test-more-php/t/testertests_exit_0.php
new file mode 100755
index 000000000..7b407016f
--- /dev/null
+++ b/application/third_party/test-more-php/t/testertests_exit_0.php
@@ -0,0 +1,8 @@
+<?php
+
+ $lib = isset($_SERVER['TESTLIB']) ? $_SERVER['TESTLIB'] : 'Test-Simple.php';
+ require_once($lib);
+
+ plan(1);
+ ok(1);
+?>
diff --git a/application/third_party/test-more-php/t/testertests_exit_fail_260.php b/application/third_party/test-more-php/t/testertests_exit_fail_260.php
new file mode 100755
index 000000000..7737ba0ae
--- /dev/null
+++ b/application/third_party/test-more-php/t/testertests_exit_fail_260.php
@@ -0,0 +1,14 @@
+<?php
+
+ $lib = isset($_SERVER['TESTLIB']) ? $_SERVER['TESTLIB'] : 'Test-Simple.php';
+ require_once($lib);
+
+ plan(262);
+ $failures = 260;
+
+ ok(1);
+ for ($x=1;$x<$failures;$x++){
+ ok(0);
+ }
+ ok(1);
+?>
diff --git a/application/third_party/test-more-php/t/testertests_exit_fail_5.php b/application/third_party/test-more-php/t/testertests_exit_fail_5.php
new file mode 100755
index 000000000..4b6596746
--- /dev/null
+++ b/application/third_party/test-more-php/t/testertests_exit_fail_5.php
@@ -0,0 +1,14 @@
+<?php
+
+ $lib = isset($_SERVER['TESTLIB']) ? $_SERVER['TESTLIB'] : 'Test-Simple.php';
+ require_once($lib);
+
+ plan(7);
+ $failures = 5;
+
+ ok(1);
+ for ($x=0;$x<$failures;$x++){
+ ok(0);
+ }
+ ok(1);
+?>
diff --git a/application/third_party/test-more-php/t/testertests_func_ok.php b/application/third_party/test-more-php/t/testertests_func_ok.php
new file mode 100755
index 000000000..1561faf91
--- /dev/null
+++ b/application/third_party/test-more-php/t/testertests_func_ok.php
@@ -0,0 +1,24 @@
+<?php
+
+
+
+ $lib = isset($_SERVER['TESTLIB']) ? $_SERVER['TESTLIB'] : 'Test-Simple.php';
+ require_once($lib);
+
+ print "# OK tests\n";
+ print "# (No message for next test)\n";
+ ok(1);
+ ok(1,"1 is ok");
+ ok(TRUE,"TRUE is ok");
+ ok('string',"'string' is ok");
+
+ print "# Not OK tests\n";
+ print "# (No message for next test)\n";
+ ok(0);
+ ok(0,"0 is not ok");
+ ok(FALSE,"FALSE is not ok");
+ ok('',"'' is not ok");
+ ok( NULL,"NULL is not ok");
+
+ done_testing();
+?>
diff --git a/application/third_party/test-more-php/t/testertests_func_ok.php_Test-More.out b/application/third_party/test-more-php/t/testertests_func_ok.php_Test-More.out
new file mode 100755
index 000000000..d06ec52d4
--- /dev/null
+++ b/application/third_party/test-more-php/t/testertests_func_ok.php_Test-More.out
@@ -0,0 +1,24 @@
+# OK
+# (No message for next test)
+ok 1
+ok 2 - 1 is ok
+ok 3 - TRUE is ok
+ok 4 - 'string' is ok
+# Not OK
+# (No message for next test)
+not ok 5
+# Failed test at testertests_func_ok.php line 18.
+not ok 6 - 0 is not ok
+# Failed test '0 is not ok'
+# at testertests_func_ok.php line 19.
+not ok 7 - FALSE is not ok
+# Failed test 'FALSE is not ok'
+# at testertests_func_ok.php line 20.
+not ok 8 - '' is not ok
+# Failed test ''' is not ok'
+# at testertests_func_ok.php line 21.
+not ok 9 - NULL is not ok
+# Failed test 'NULL is not ok'
+# at testertests_func_ok.php line 22.
+1..9
+# Looks like you failed 5 tests of 9.
diff --git a/application/third_party/test-more-php/t/testertests_func_ok.php_Test-Simple.out b/application/third_party/test-more-php/t/testertests_func_ok.php_Test-Simple.out
new file mode 100755
index 000000000..771678b8e
--- /dev/null
+++ b/application/third_party/test-more-php/t/testertests_func_ok.php_Test-Simple.out
@@ -0,0 +1,16 @@
+# OK
+# (No message for next test)
+ok 1
+ok 2 - 1 is ok
+ok 3 - TRUE is ok
+ok 4 - 'string' is ok
+# Not OK
+# (No message for next test)
+not ok 5
+not ok 6 - 0 is not ok
+not ok 7 - FALSE is not ok
+not ok 8 - '' is not ok
+not ok 9 - NULL is not ok
+1..9
+
+# Looks like you failed 5 tests of 9.
diff --git a/application/third_party/test-more-php/t/testertests_func_ok.pl b/application/third_party/test-more-php/t/testertests_func_ok.pl
new file mode 100755
index 000000000..e87d97bb1
--- /dev/null
+++ b/application/third_party/test-more-php/t/testertests_func_ok.pl
@@ -0,0 +1,24 @@
+#!/bin/env perl
+ use strict;
+ use warnings;
+
+ my $lib = defined($ENV{'TESTLIB'}) ? $ENV{'TESTLIB'} : 'Test::Simple';
+ eval "use $lib;";
+
+ print "# OK\n";
+ print "# (No message for next test)\n";
+ ok(1);
+ ok(1,"1 is ok");
+ ok( !0,"TRUE is ok");
+ ok('string',"'string' is ok");
+
+ print "# Not OK\n";
+ print "# (No message for next test)\n";
+ ok(0);
+ ok(0,"0 is not ok");
+ ok( !1,"FALSE is not ok");
+ ok('',"'' is not ok");
+ ok(undef,"undef is not ok");
+
+ done_testing();
+
diff --git a/application/third_party/test-more-php/t/testertests_func_ok.pl_Test-More.out b/application/third_party/test-more-php/t/testertests_func_ok.pl_Test-More.out
new file mode 100755
index 000000000..e72f09462
--- /dev/null
+++ b/application/third_party/test-more-php/t/testertests_func_ok.pl_Test-More.out
@@ -0,0 +1,24 @@
+# OK
+# (No message for next test)
+ok 1
+ok 2 - 1 is ok
+ok 3 - TRUE is ok
+ok 4 - 'string' is ok
+# Not OK
+# (No message for next test)
+not ok 5
+# Failed test at testertests_func_ok.pl line 18.
+not ok 6 - 0 is not ok
+# Failed test '0 is not ok'
+# at testertests_func_ok.pl line 19.
+not ok 7 - FALSE is not ok
+# Failed test 'FALSE is not ok'
+# at testertests_func_ok.pl line 20.
+not ok 8 - '' is not ok
+# Failed test ''' is not ok'
+# at testertests_func_ok.pl line 21.
+not ok 9 - undef is not ok
+# Failed test 'undef is not ok'
+# at testertests_func_ok.pl line 22.
+1..9
+# Looks like you failed 5 tests of 9.
diff --git a/application/third_party/test-more-php/t/testertests_func_ok.pl_Test-Simple.out b/application/third_party/test-more-php/t/testertests_func_ok.pl_Test-Simple.out
new file mode 100755
index 000000000..54c1e576a
--- /dev/null
+++ b/application/third_party/test-more-php/t/testertests_func_ok.pl_Test-Simple.out
@@ -0,0 +1,24 @@
+# OK
+# (No message for next test)
+ok 1
+ok 2 - 1 is ok
+ok 3 - !0 is ok
+ok 4 - 'string' is ok
+# Not OK
+# (No message for next test)
+not ok 5
+# Failed test at testertests_func_ok.pl line 17.
+not ok 6 - 0 is not ok
+# Failed test '0 is not ok'
+# at testertests_func_ok.pl line 18.
+not ok 7 - !1 is not ok
+# Failed test '!1 is not ok'
+# at testertests_func_ok.pl line 19.
+not ok 8 - '' is not ok
+# Failed test ''' is not ok'
+# at testertests_func_ok.pl line 20.
+not ok 9 - undef is not ok
+# Failed test 'undef is not ok'
+# at testertests_func_ok.pl line 21.
+Undefined subroutine &main::done_testing called at testertests_func_ok.pl line 23.
+# Tests were run but no plan was declared and done_testing() was not seen.
diff --git a/application/third_party/test-more-php/t/testertests_func_skip.php b/application/third_party/test-more-php/t/testertests_func_skip.php
new file mode 100755
index 000000000..1a5f03823
--- /dev/null
+++ b/application/third_party/test-more-php/t/testertests_func_skip.php
@@ -0,0 +1,11 @@
+<?php
+
+ $lib = isset($_SERVER['TESTLIB']) ? $_SERVER['TESTLIB'] : 'Test-More.php';
+ require_once($lib);
+ plan(2);
+
+ skip("Test: Skip one",1);
+ fail("Gets skipped");
+ pass("Gets run ok");
+
+?>
diff --git a/application/third_party/test-more-php/t/testertests_func_skip.pl b/application/third_party/test-more-php/t/testertests_func_skip.pl
new file mode 100755
index 000000000..4f3c545b0
--- /dev/null
+++ b/application/third_party/test-more-php/t/testertests_func_skip.pl
@@ -0,0 +1,9 @@
+#!/bin/env perl
+ use strict;
+ use warnings;
+ use Test::More;
+ plan(tests=>2);
+
+ skip("Test: Skip one",1);
+ fail("Gets skipped");
+ pass("Gets run ok");
diff --git a/application/third_party/test-more-php/t/testertests_include_ok_badlib.php b/application/third_party/test-more-php/t/testertests_include_ok_badlib.php
new file mode 100755
index 000000000..52764fb53
--- /dev/null
+++ b/application/third_party/test-more-php/t/testertests_include_ok_badlib.php
@@ -0,0 +1,21 @@
+<?php
+
+
+
+ $lib = isset($_SERVER['TESTLIB']) ? $_SERVER['TESTLIB'] : 'Test-Simple.php';
+ require_once($lib);
+ plan(5);
+
+ diag('Should fail 3 of 5 tests');
+
+ ok(1, "Pass one");
+
+ include_ok('missing.php','Including a missing file should be not ok');
+
+ include_ok('badlib.php','Including a file with bad syntax should be not ok');
+
+ include_ok('borklib.php','Including a file with non-syntactical errors should be not ok');
+
+ ok(1, 'Continue testing after failed include');
+
+?>
diff --git a/application/third_party/test-more-php/t/testertests_include_ok_fatal.php b/application/third_party/test-more-php/t/testertests_include_ok_fatal.php
new file mode 100755
index 000000000..982cd5caf
--- /dev/null
+++ b/application/third_party/test-more-php/t/testertests_include_ok_fatal.php
@@ -0,0 +1,17 @@
+<?php
+
+
+
+ $lib = isset($_SERVER['TESTLIB']) ? $_SERVER['TESTLIB'] : 'Test-Simple.php';
+ require_once($lib);
+ plan(3);
+
+ diag('If PHP throws a fatal error, bail as nicely as possible.');
+
+ ok(1, "Pass one for good measure");
+
+ include_ok($lib,'Including a library again should redefine a function and bail.');
+
+ ok(1, 'This test will not be reached.');
+
+?>
diff --git a/application/third_party/test-more-php/t/testertests_interp.php b/application/third_party/test-more-php/t/testertests_interp.php
new file mode 100755
index 000000000..f646f81d8
--- /dev/null
+++ b/application/third_party/test-more-php/t/testertests_interp.php
@@ -0,0 +1,10 @@
+<?php
+
+ $lib = 'Test-More.php';
+ require_once($lib);
+ $t = new TestMore();
+ $t->plan(1);
+
+ $t->is( $t->interp(),'php',"interp defaults to php");
+
+?>
diff --git a/application/third_party/test-more-php/t/testertests_interp_env.php b/application/third_party/test-more-php/t/testertests_interp_env.php
new file mode 100755
index 000000000..8c12f0a12
--- /dev/null
+++ b/application/third_party/test-more-php/t/testertests_interp_env.php
@@ -0,0 +1,19 @@
+<?php
+
+ $lib = 'Test-More.php';
+ require_once($lib);
+ $t = new TestMore();
+ $t->plan(1);
+
+ if (strpos(strtoupper($_SERVER['OS']),'WINDOWS') !== FALSE) {
+ // Should also accept extension
+ $newinterp = 'php.exe';
+ } else {
+ // Fair guess
+ $newinterp = '/usr/local/bin/php';
+ }
+
+ $_SERVER['PHP'] = $newinterp;
+ $t->is( $t->interp(),$newinterp,"set valid alternate interp via PHP environment variable ($newinterp)");
+
+?>
diff --git a/application/third_party/test-more-php/t/testertests_interp_set.php b/application/third_party/test-more-php/t/testertests_interp_set.php
new file mode 100755
index 000000000..6e5fa2276
--- /dev/null
+++ b/application/third_party/test-more-php/t/testertests_interp_set.php
@@ -0,0 +1,18 @@
+<?php
+
+ $lib = 'Test-More.php';
+ require_once($lib);
+ $t = new TestMore();
+ $t->plan(1);
+
+ if (strpos(strtoupper($_SERVER['OS']),'WINDOWS') !== FALSE) {
+ // Should also accept extension
+ $newinterp = 'php.exe';
+ } else {
+ // Fair guess
+ $newinterp = '/usr/local/bin/php';
+ }
+
+ $t->is( $t->interp($newinterp),$newinterp,"set valid alternate interp by passing arg: interp($newinterp)");
+
+?>
diff --git a/application/third_party/test-more-php/t/testertests_is_deeply.php b/application/third_party/test-more-php/t/testertests_is_deeply.php
new file mode 100755
index 000000000..de30f2b82
--- /dev/null
+++ b/application/third_party/test-more-php/t/testertests_is_deeply.php
@@ -0,0 +1,31 @@
+<?php
+
+
+
+ $lib = isset($_SERVER['TESTLIB']) ? $_SERVER['TESTLIB'] : 'Test-More.php';
+ require_once($lib);
+ plan('no_plan');
+
+ diag("Assertions:");
+
+ is_deeply(NULL, NULL);
+ is_deeply(TRUE, TRUE);
+ is_deeply(FALSE, FALSE);
+ is_deeply(42, 42);
+ is_deeply('abcdef', 'abcdef');
+ is_deeply(array(), array());
+ is_deeply(array(1), array(1));
+ is_deeply(array(array()), array(array()));
+ is_deeply(array(array(123)), array(array(123)));
+ is_deeply(array(1,'abc'), array(0=>1,1=>'abc'));
+
+ diag("Denials:");
+
+ isnt_deeply(NULL, TRUE, 'NULL !== TRUE');
+ isnt_deeply(NULL, FALSE, 'NULL !== FALSE');
+ isnt_deeply(NULL, 0, 'NULL !== 0');
+ isnt_deeply(NULL, '', "NULL !== ''");
+ isnt_deeply(0, FALSE, '0 !== FALSE');
+ isnt_deeply(1, TRUE, '1 !== TRUE');
+
+?>
diff --git a/application/third_party/test-more-php/t/testertests_require_ok_badlib.php b/application/third_party/test-more-php/t/testertests_require_ok_badlib.php
new file mode 100755
index 000000000..12d0e8b7e
--- /dev/null
+++ b/application/third_party/test-more-php/t/testertests_require_ok_badlib.php
@@ -0,0 +1,12 @@
+<?php
+
+
+
+ $lib = isset($_SERVER['TESTLIB']) ? $_SERVER['TESTLIB'] : 'Test-Simple.php';
+ require_once($lib);
+ plan(2);
+
+ require_ok('badlib.php','Requiring a file with bad syntax should be not ok');
+
+ ok(1, 'Continue testing after failed require');
+?>
diff --git a/application/third_party/test-more-php/t/testertests_require_ok_borklib.php b/application/third_party/test-more-php/t/testertests_require_ok_borklib.php
new file mode 100755
index 000000000..4472ca795
--- /dev/null
+++ b/application/third_party/test-more-php/t/testertests_require_ok_borklib.php
@@ -0,0 +1,12 @@
+<?php
+
+
+
+ $lib = isset($_SERVER['TESTLIB']) ? $_SERVER['TESTLIB'] : 'Test-Simple.php';
+ require_once($lib);
+ plan(2);
+
+ require_ok('borklib.php','Requiring a file with non-syntactical errors should be not ok');
+
+ ok(1, 'Continue testing after failed require');
+?>
diff --git a/application/third_party/test-more-php/t/testertests_require_ok_missing.php b/application/third_party/test-more-php/t/testertests_require_ok_missing.php
new file mode 100755
index 000000000..087d5d0c0
--- /dev/null
+++ b/application/third_party/test-more-php/t/testertests_require_ok_missing.php
@@ -0,0 +1,12 @@
+<?php
+
+
+
+ $lib = isset($_SERVER['TESTLIB']) ? $_SERVER['TESTLIB'] : 'Test-Simple.php';
+ require_once($lib);
+ plan(2);
+
+ require_ok('missing.php','Requiring a missing file should be not ok');
+
+ ok(1, 'Continue testing after failed require');
+?>
diff --git a/application/third_party/test-more-php/t/try.php b/application/third_party/test-more-php/t/try.php
new file mode 100755
index 000000000..1ca9c2410
--- /dev/null
+++ b/application/third_party/test-more-php/t/try.php
@@ -0,0 +1,7 @@
+#!/usr/bin/env php
+<?php
+ $lib = isset($_SERVER['TESTLIB']) ? $_SERVER['TESTLIB'] : 'Test-Simple.php';
+ require_once($lib);
+ plan(1);
+ ok(1);
+?>
diff --git a/application/views/contact.php b/application/views/contact.php
new file mode 100644
index 000000000..6497ab6a7
--- /dev/null
+++ b/application/views/contact.php
@@ -0,0 +1 @@
+<?php echo $contact_info; ?>
diff --git a/application/views/errors/html/error_404.php b/application/views/errors/html/error_404.php
index 756ea9d62..b71da106d 100644
--- a/application/views/errors/html/error_404.php
+++ b/application/views/errors/html/error_404.php
@@ -1,64 +1,3 @@
<?php
-defined('BASEPATH') OR exit('No direct script access allowed');
-?><!DOCTYPE html>
-<html lang="en">
-<head>
-<meta charset="utf-8">
-<title>404 Page Not Found</title>
-<style type="text/css">
-
-::selection { background-color: #E13300; color: white; }
-::-moz-selection { background-color: #E13300; color: white; }
-
-body {
- background-color: #fff;
- margin: 40px;
- font: 13px/20px normal Helvetica, Arial, sans-serif;
- color: #4F5155;
-}
-
-a {
- color: #003399;
- background-color: transparent;
- font-weight: normal;
-}
-
-h1 {
- color: #444;
- background-color: transparent;
- border-bottom: 1px solid #D0D0D0;
- font-size: 19px;
- font-weight: normal;
- margin: 0 0 14px 0;
- padding: 14px 15px 10px 15px;
-}
-
-code {
- font-family: Consolas, Monaco, Courier New, Courier, monospace;
- font-size: 12px;
- background-color: #f9f9f9;
- border: 1px solid #D0D0D0;
- color: #002166;
- display: block;
- margin: 14px 0 14px 0;
- padding: 12px 10px 12px 10px;
-}
-
-#container {
- margin: 10px;
- border: 1px solid #D0D0D0;
- box-shadow: 0 0 8px #D0D0D0;
-}
-
-p {
- margin: 12px 15px 12px 15px;
-}
-</style>
-</head>
-<body>
- <div id="container">
- <h1><?php echo $heading; ?></h1>
- <?php echo $message; ?>
- </div>
-</body>
-</html> \ No newline at end of file
+$title = "404 Page Not Found";
+include VIEWPATH."errors/html/error_general.php";
diff --git a/application/views/errors/html/error_db.php b/application/views/errors/html/error_db.php
index f5a43f638..adff63559 100644
--- a/application/views/errors/html/error_db.php
+++ b/application/views/errors/html/error_db.php
@@ -1,64 +1,3 @@
<?php
-defined('BASEPATH') OR exit('No direct script access allowed');
-?><!DOCTYPE html>
-<html lang="en">
-<head>
-<meta charset="utf-8">
-<title>Database Error</title>
-<style type="text/css">
-
-::selection { background-color: #E13300; color: white; }
-::-moz-selection { background-color: #E13300; color: white; }
-
-body {
- background-color: #fff;
- margin: 40px;
- font: 13px/20px normal Helvetica, Arial, sans-serif;
- color: #4F5155;
-}
-
-a {
- color: #003399;
- background-color: transparent;
- font-weight: normal;
-}
-
-h1 {
- color: #444;
- background-color: transparent;
- border-bottom: 1px solid #D0D0D0;
- font-size: 19px;
- font-weight: normal;
- margin: 0 0 14px 0;
- padding: 14px 15px 10px 15px;
-}
-
-code {
- font-family: Consolas, Monaco, Courier New, Courier, monospace;
- font-size: 12px;
- background-color: #f9f9f9;
- border: 1px solid #D0D0D0;
- color: #002166;
- display: block;
- margin: 14px 0 14px 0;
- padding: 12px 10px 12px 10px;
-}
-
-#container {
- margin: 10px;
- border: 1px solid #D0D0D0;
- box-shadow: 0 0 8px #D0D0D0;
-}
-
-p {
- margin: 12px 15px 12px 15px;
-}
-</style>
-</head>
-<body>
- <div id="container">
- <h1><?php echo $heading; ?></h1>
- <?php echo $message; ?>
- </div>
-</body>
-</html> \ No newline at end of file
+$title = "Database Error";
+include VIEWPATH."errors/html/error_general.php";
diff --git a/application/views/errors/html/error_general.php b/application/views/errors/html/error_general.php
index fc3b2ebad..0f809dccd 100644
--- a/application/views/errors/html/error_general.php
+++ b/application/views/errors/html/error_general.php
@@ -1,5 +1,43 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
+
+// fancy error page only works if we can load helpers
+if (class_exists("CI_Controller") && !isset($GLOBALS["is_error_page"]) && isset(get_instance()->load)) {
+ if (!isset($title)) {
+ $title = "Error";
+ }
+ $GLOBALS["is_error_page"] = true;
+
+ $CI =& get_instance();
+ $CI->load->helper("filebin");
+ $CI->load->helper("url");
+
+ if (is_cli()) {
+ $message = str_replace("</p>", "</p>\n", $message);
+ $message = strip_tags($message);
+ echo "$heading: $message\n";
+ exit();
+ }
+
+ include APPPATH.'views/header.php';
+
+ ?>
+ <div class="error">
+ <h1><?php echo $heading; ?></h1>
+ <?php echo $message; ?>
+ </div>
+
+ <?php
+ include APPPATH.'views/footer.php';
+} elseif (php_sapi_name() === 'cli' OR defined('STDIN')) {
+ echo "# $heading\n";
+ $msg = strip_tags(str_replace("<br>", "\n", $message));
+ foreach (explode("\n", $msg) as $line) {
+ echo "# $line\n";
+ }
+ exit(255);
+} else {
+ // default CI error page
?><!DOCTYPE html>
<html lang="en">
<head>
@@ -50,7 +88,7 @@ code {
box-shadow: 0 0 8px #D0D0D0;
}
-p {
+p, div {
margin: 12px 15px 12px 15px;
}
</style>
@@ -61,4 +99,6 @@ p {
<?php echo $message; ?>
</div>
</body>
-</html> \ No newline at end of file
+</html>
+<?php
+}
diff --git a/application/views/file/deleted.php b/application/views/file/deleted.php
new file mode 100644
index 000000000..8a5818f2d
--- /dev/null
+++ b/application/views/file/deleted.php
@@ -0,0 +1,11 @@
+<div class="center">
+ <?php if (!empty($errors)) {
+ echo "<p>";
+ foreach ($errors as $error) {
+ echo "${error["id"]}: ${error["reason"]}<br>\n";
+ }
+ echo "</p>";
+ } ?>
+
+ <p><?php echo $deleted_count; ?> of <?php echo $total_count; ?> deleted.</p>
+</div>
diff --git a/application/views/file/file_info.php b/application/views/file/file_info.php
new file mode 100644
index 000000000..f704001a2
--- /dev/null
+++ b/application/views/file/file_info.php
@@ -0,0 +1,36 @@
+<div class="center simple-container">
+ <?php if($filedata): ?>
+ <div class="table-responive">
+ <table class="table" style="margin: auto">
+ <tr>
+ <td class="title">ID</td>
+ <td class="text"><a href="<?php echo site_url($id); ?>/"><?php echo $id; ?></a></td>
+ </tr>
+ <tr>
+ <td class="title">Filename</td>
+ <td class="text"><?php echo htmlspecialchars($filedata["filename"]); ?></td>
+ </tr>
+ <tr>
+ <td class="title">Date of upload</td>
+ <td class="text"><?php echo date("r", $filedata["date"]); ?></td>
+ </tr>
+ <tr>
+ <td class="title">Date of removal</td>
+ <td class="text"><?php echo $timeout; ?></td>
+ </tr>
+ <tr>
+ <td class="title">Size</td>
+ <td class="text"><?php echo format_bytes($filedata["filesize"]); ?></td>
+ </tr>
+ <tr>
+ <td class="title">Mimetype</td>
+ <td class="text"><?php echo $filedata["mimetype"]; ?></td>
+ </tr>
+ <tr>
+ <td class="title">Hash (MD5)</td>
+ <td class="text"><?php echo $filedata["hash"]; ?></td>
+ </tr>
+ </table>
+ </div>
+ <?php endif; ?>
+</div>
diff --git a/application/views/file/fragments/alert-wide.php b/application/views/file/fragments/alert-wide.php
new file mode 100644
index 000000000..d17fdc4c0
--- /dev/null
+++ b/application/views/file/fragments/alert-wide.php
@@ -0,0 +1,3 @@
+<div class="alert <?php echo isset($error_type) ? $error_type : "alert-danger"; ?> alert-wide">
+ <?php echo $error_message; ?>
+</div>
diff --git a/application/views/file/fragments/asciinema-player.php b/application/views/file/fragments/asciinema-player.php
new file mode 100644
index 000000000..53a500831
--- /dev/null
+++ b/application/views/file/fragments/asciinema-player.php
@@ -0,0 +1,8 @@
+<div class="container-wide">
+<div class='panel panel-default'>
+ <div class='panel-heading'>
+ <?php echo anchor(site_url($filedata['id'])."/", htmlspecialchars($filedata["filename"])); ?>
+ </div>
+ <div id="player-container-<?php echo $filedata['id']; ?>" class="asciinema_player" data-url="<?php echo site_url($filedata['id']); ?>"></div>
+</div>
+</div>
diff --git a/application/views/file/fragments/audio-player.php b/application/views/file/fragments/audio-player.php
new file mode 100644
index 000000000..154153489
--- /dev/null
+++ b/application/views/file/fragments/audio-player.php
@@ -0,0 +1,8 @@
+<div class="container-wide">
+<p>
+ <audio controls="controls">
+ <source src="<?php echo site_url($filedata["id"]); ?>">
+ </audio>
+ <?php echo anchor(site_url($filedata['id'])."/", htmlspecialchars($filedata["filename"])); ?>
+</p>
+</div>
diff --git a/application/views/file/fragments/thumbnail.php b/application/views/file/fragments/thumbnail.php
new file mode 100644
index 000000000..82d0743fb
--- /dev/null
+++ b/application/views/file/fragments/thumbnail.php
@@ -0,0 +1,35 @@
+<!-- Comment markers background: http://stackoverflow.com/a/14776780/953022 -->
+<div class="container-wide">
+<?php
+$base_url = site_url();
+if (substr($base_url, -1) !== "/") {
+ $base_url .= "/";
+}
+$counter = 0;
+?>
+<div class="upload_thumbnails"><!--
+ <?php foreach($items as $key => $item):
+ $counter++;
+ ?>
+ --><a
+ <?php if (strpos($item["mimetype"], "image/") === 0) {?>rel="gallery" class="colorbox"<?php } ?>
+ data-orientation="<?php echo $item["orientation"]; ?>"
+ href="<?php echo $base_url.$item["id"]."/"; ?>"
+ title="<?php echo htmlentities($item["filename"], ENT_QUOTES); ?>"
+ data-content="<?php echo htmlentities($item["tooltip"], ENT_QUOTES); ?>"
+ data-id="<?php echo $item["id"]; ?>"><!--
+ --><?php if ($counter > 42) {
+ ?><img
+ class="thumb lazyload"
+ data-original="<?php echo $base_url."file/thumbnail/".$item["id"]; ?>"
+ ><?php
+ } else {
+ ?><img
+ class="thumb"
+ src="<?php echo $base_url."file/thumbnail/".$item["id"]; ?>"><?php
+ } ?><!--
+ --><noscript><img class="thumb" src="<?php echo $base_url."file/thumbnail/".$item["id"]; ?>"></noscript></a><!--
+ <?php endforeach; ?>
+ -->
+</div>
+</div>
diff --git a/application/views/file/fragments/uploads_table.php b/application/views/file/fragments/uploads_table.php
new file mode 100644
index 000000000..6673f22a3
--- /dev/null
+++ b/application/views/file/fragments/uploads_table.php
@@ -0,0 +1,25 @@
+<div class="table-responsive container-wide">
+ <p>Non-previewable file(s):</p>
+ <table class="table table-striped tablesorter">
+ <thead>
+ <tr>
+ <th>ID</th>
+ <th>Filename</th>
+ <th>Mimetype</th>
+ <th>Date</th>
+ <th>Size</th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php foreach($items as $item): ?>
+ <tr>
+ <td><a href="<?php echo site_url("/".$item["id"]) ?>/"><?php echo $item["id"] ?></a></td>
+ <td class="wrap"><?php echo htmlspecialchars($item["filename"]); ?></td>
+ <td><?php echo $item["mimetype"] ?></td>
+ <td class="nowrap" data-sort-value="<?=$item["date"]; ?>"><?php echo date("r", $item["date"]); ?></td>
+ <td><?php echo format_bytes($item["filesize"]) ?></td>
+ </tr>
+ <?php endforeach; ?>
+ </tbody>
+ </table>
+</div>
diff --git a/application/views/file/fragments/video-player.php b/application/views/file/fragments/video-player.php
new file mode 100644
index 000000000..6342c1692
--- /dev/null
+++ b/application/views/file/fragments/video-player.php
@@ -0,0 +1,12 @@
+<div class="container-wide">
+<div class='panel panel-default'>
+ <div class='panel-heading'>
+ <?php echo anchor(site_url($filedata['id'])."/", htmlspecialchars($filedata["filename"])); ?>
+ </div>
+ <div>
+ <video controls="controls">
+ <source src="<?php echo site_url($filedata["id"]); ?>">
+ </video>
+ </div>
+</div>
+</div>
diff --git a/application/views/file/html_footer.php b/application/views/file/html_footer.php
new file mode 100644
index 000000000..7c9cac8f7
--- /dev/null
+++ b/application/views/file/html_footer.php
@@ -0,0 +1,3 @@
+<div class="container">
+<?php
+include(FCPATH."application/views/footer.php");
diff --git a/application/views/file/html_header.php b/application/views/file/html_header.php
new file mode 100644
index 000000000..5f25b6acc
--- /dev/null
+++ b/application/views/file/html_header.php
@@ -0,0 +1,13 @@
+<?php
+include(FCPATH."application/views/header.php"); ?>
+
+</div><!-- .container -->
+<script type="text/javascript">
+ /* <![CDATA[ */
+ window.appConfig.lexers = <?php echo json_encode($lexers); ?>;
+ /* ]]> */
+</script>
+
+<?php if (isset($error_message)) {
+ include 'framgents/alert-wide.php';
+} ?>
diff --git a/application/views/file/html_paste_footer.php b/application/views/file/html_paste_footer.php
new file mode 100644
index 000000000..22bc4dabb
--- /dev/null
+++ b/application/views/file/html_paste_footer.php
@@ -0,0 +1,2 @@
+</div><!-- .container .paste-container -->
+
diff --git a/application/views/file/html_paste_header.php b/application/views/file/html_paste_header.php
new file mode 100644
index 000000000..046b23dd8
--- /dev/null
+++ b/application/views/file/html_paste_header.php
@@ -0,0 +1,87 @@
+<div class="paste-container container-wide">
+ <div style="border:1px solid #ccc;">
+ <div class="navbar navbar-default navbar-static-top navbar-paste">
+ <ul class="nav navbar-nav navbar-left dont-float">
+ <li><a href="<?=site_url($id)."/"; ?>" class="navbar-brand" data-toggle="modal"><?php echo $title ?></a></li>
+ <li class="divider"></li>
+ <li class="dropdown">
+ <a href="#" class="dropdown-toggle lexer-toggle" data-toggle="dropdown">
+ Language: <?php echo htmlspecialchars($current_highlight); ?>
+ <b class="caret"></b>
+ </a>
+ <div class="dropdown-menu" style="padding: 15px;">
+ <form class="lexer-form">
+ <input data-base-url="<?=site_url($id); ?>" type="text" id="language-<?=$id; ?>" placeholder="Language" class="form-control">
+ </form>
+ </div>
+ </li>
+ <li class="divider"></li>
+ <li>
+ <a href="#file-info-<?=$id; ?>" role="button" data-toggle="modal">Info</a>
+ </li>
+ <?php if (isset($user_logged_in) && $user_logged_in) { ?>
+ <li class="divider"></li>
+ <li><a href="<?php echo site_url('file/index?repaste='.$id); ?>" role="button">Repaste</a></li>
+ <?php } ?>
+ </ul>
+ <div class="btn-group navbar-right" style="margin: 8px;">
+ <a class="btn btn-default linewrap-toggle" rel="tooltip" title="Toggle wrapping of long lines">Linewrap</a>
+ <div class="btn-group">
+ <a class="btn btn-default dropdown-toggle tabwidth-toggle" rel="tooltip" title="Set tab width in spaces" data-toggle="dropdown" href="#">Tab width: <span class="tabwidth-value"></span> <span class="caret"></span></a>
+ <div class="dropdown-menu tabwidth-dropdown">
+ <form class="tabwidth-form">
+ <input type="number" class="form-control" min="0">
+ </form>
+ </div>
+ </div>
+ <a href="<?php echo site_url($id."/plain") ?>" class="btn btn-default" rel="tooltip" title="View as plain text">Plain</a>
+ <a href="<?php echo site_url($id) ?>" class="btn btn-default" rel="tooltip" title="View as raw file (org. mime type)">Raw</a>
+ <?php if ($current_highlight === 'rmd') { ?>
+ <a href="<?php echo site_url($id)."/" ?>" class="btn btn-default" rel="tooltip" title="Render as Code">Code</a>
+ <?php } else { ?>
+ <a href="<?php echo site_url($id."/rmd") ?>" class="btn btn-default" rel="tooltip" title="Render as Markdown">Markdown</a>
+ <?php } ?>
+ </div>
+ </div> <!-- .navbar -->
+ <div id="file-info-<?=$id; ?>" class="modal fade" role="dialog" aria-labelledby="file-info-<?=$id; ?>" aria-hidden="true">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal">&times;</button>
+ <h3 class="modal-title">Paste Information</h3>
+ </div>
+ <div class="modal-body">
+ <table class="table">
+ <tr>
+ <td style="border:0;">Filename:</td>
+ <td style="border:0;"><?php echo htmlspecialchars($filedata["filename"]) ?></td>
+ </tr>
+ <tr>
+ <td>Size:</td>
+ <td><?php echo format_bytes($filedata["filesize"]) ?></td>
+ </tr>
+ <tr>
+ <td>Mimetype:</td>
+ <td><?php echo $filedata["mimetype"] ?></td>
+ </tr>
+ <tr>
+ <td>Uploaded:</td>
+ <td><?php echo date("r", $filedata["date"]) ?></td>
+ </tr>
+ <tr>
+ <td>Removal:</td>
+ <td><?php echo $timeout ?></td>
+ </tr>
+ </table>
+ </div>
+ <div class="modal-footer">
+ <?php echo form_open("file/do_delete/", array("style" => "display: inline")); ?>
+ <input type="hidden" name="ids[<?php echo $id; ?>]" value="<?php echo $id; ?>">
+ <button class="btn btn-danger pull-left" aria-hidden="true">Delete</button>
+ </form>
+ <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
+ </div>
+ </div>
+ </div>
+ </div> <!-- .modal -->
+ </div>
diff --git a/application/views/file/multipaste/queue.php b/application/views/file/multipaste/queue.php
new file mode 100644
index 000000000..3f42b3cdf
--- /dev/null
+++ b/application/views/file/multipaste/queue.php
@@ -0,0 +1,32 @@
+<div class="multipasteQueue">
+ <?php echo form_open("file/multipaste/form_submit", ["data-ajax_url" => site_url("file/multipaste/ajax_submit")]); ?>
+ <div class="items"><!--
+ <?php foreach ($items as $item) {?>
+ --><div data-id="<?php echo $item['id']; ?>">
+ <input type="hidden" name="ids[<?php echo $item['id']; ?>]" value="<?php echo $item['id']; ?>">
+ <div class='item'>
+ <?php if (isset($item['thumbnail'])) { ?>
+ <img
+ src="<?php echo $item['thumbnail']; ?>"
+ title="<?php echo $item['title']; ?>"
+ data-content="<?php echo $item['tooltip']; ?>">
+ <?php } else { ?>
+ <div>
+ <?php echo $item['title']; ?><br>
+ <?php echo $item['tooltip']; ?>
+ </div>
+ <?php } ?>
+ </div>
+ <button class='multipaste_queue_delete btn-danger btn btn-xs'>Remove</button>
+ </div><!--
+ <?php } ?>
+ --></div>
+ <button type="submit" class="btn btn-default" name="process" value="save">
+ <div class="ajaxFeedback" style="display: none">
+ <span class="glyphicon glyphicon-refresh spinning"></span>
+ </div>
+ Only save queue order
+ </button>
+ <button type="submit" class="btn btn-primary" name="process" value="create">Create multipaste</button>
+ </form>
+</div>
diff --git a/application/views/file/multipaste_info.php b/application/views/file/multipaste_info.php
new file mode 100644
index 000000000..5baf732a2
--- /dev/null
+++ b/application/views/file/multipaste_info.php
@@ -0,0 +1,26 @@
+<div class="center simple-container">
+ <div class="table-responive">
+ <table class="table" style="margin: auto">
+ <tr>
+ <td class="title">ID</td>
+ <td class="text"><a href="<?=site_url($id); ?>/"><?=$id; ?></a></td>
+ </tr>
+ <tr>
+ <td class="title">Number of files</td>
+ <td class="text"><?=$file_count; ?></td>
+ </tr>
+ <tr>
+ <td class="title">Date of upload</td>
+ <td class="text"><?=date("r", $upload_date); ?></td>
+ </tr>
+ <tr>
+ <td class="title">Date of removal</td>
+ <td class="text"><?=$timeout_string; ?></td>
+ </tr>
+ <tr>
+ <td class="title">Total size (including duplicates)</td>
+ <td class="text"><?=format_bytes($size); ?></td>
+ </tr>
+ </table>
+ </div>
+</div>
diff --git a/application/views/file/nav_history.php b/application/views/file/nav_history.php
new file mode 100644
index 000000000..1a3e55c0b
--- /dev/null
+++ b/application/views/file/nav_history.php
@@ -0,0 +1,18 @@
+<ul class="nav nav-tabs">
+<?php
+$nav = array(
+ "List" => "file/upload_history",
+ "Thumbnails" => "file/upload_history_thumbnails",
+);
+
+$CI =& get_instance();
+
+foreach ($nav as $key => $item) {
+ ?>
+ <li <?php echo $CI->uri->uri_string() == $item ? 'class="active"' : ''; ?>>
+ <a href="<?php echo site_url($item); ?>"><?php echo $key; ?></a>
+ </li>
+ <?php
+}
+?>
+</ul>
diff --git a/application/views/file/non_existent.php b/application/views/file/non_existent.php
new file mode 100644
index 000000000..13d8c6950
--- /dev/null
+++ b/application/views/file/non_existent.php
@@ -0,0 +1,3 @@
+<div class="center">
+ <p>I'm sorry, but the requested file doesn't exist.</p>
+</div>
diff --git a/application/views/file/show_url.php b/application/views/file/show_url.php
new file mode 100644
index 000000000..a3d965717
--- /dev/null
+++ b/application/views/file/show_url.php
@@ -0,0 +1,8 @@
+<div class="center">
+ <p>You can get your file(s) here:</p>
+ <p>
+ <?php foreach ($urls as $key => $url) { ?>
+ <a href="<?php echo $url; ?>"><?php echo $url; ?></a><br />
+ <?php } ?>
+ </p>
+</div>
diff --git a/application/views/file/upload_form.php b/application/views/file/upload_form.php
new file mode 100644
index 000000000..e2350c09d
--- /dev/null
+++ b/application/views/file/upload_form.php
@@ -0,0 +1,175 @@
+<?php if (isset($user_logged_in) && $user_logged_in) { ?>
+<?php echo form_open_multipart('file/do_websubmit'); ?>
+ <div class="row">
+ <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 text-upload-form">
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ <h3 class="panel-title">Text paste</h3>
+ </div>
+ <div class="panel-body" id="textboxes">
+ <ul class="nav nav-tabs">
+ <li class="active"><a href="#text-upload-tab-1" data-toggle="tab">Paste 1 </a></li>
+ </ul>
+ <div class="tab-content">
+ <div class="tab-pane active" id="text-upload-tab-1">
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ <input type="text" name="filename[1]" class="form-control" placeholder="Filename/title (default: stdin)" value="<?php if (isset($textarea_filename)) { echo htmlspecialchars($textarea_filename); } ?>">
+ </div>
+ <textarea name="content[1]" class="form-control text-upload" placeholder="Paste content"><?php
+ if (isset($textarea_content)) {
+ echo $textarea_content;
+ }
+ ?></textarea>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ <h3 class="panel-title">File upload</h3>
+ </div>
+ <div class="panel-body">
+ <div>
+ <input class="file-upload" type="file" name="file[]" multiple="multiple"><br>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
+ <div class="panel panel-info">
+ <div class="panel-heading">
+ <h3 class="panel-title">Notice!</h3>
+ </div>
+ <div class="panel-body">
+ <p>
+ You can upload files and paste text at the same time. Empty text or file inputs will be ignored.
+ </p>
+ <p><button type="submit" id="upload_button" class="btn btn-primary">Upload/Paste it!</button></p>
+ <p>
+ Uploads/pastes are <?php if ($upload_max_age > 0) {
+ echo "deleted after ".expiration_duration($upload_max_age);
+ if ($small_upload_size > 0) {
+ echo " unless they are smaller than ".format_bytes($small_upload_size);
+ }
+ } else {
+ echo "stored forever";
+ } ?>. Maximum upload size is <?php echo format_bytes($max_upload_size); ?>.
+ You can upload a maximum of <?php echo ini_get("max_file_uploads"); ?> files at once.
+ </p>
+ </div>
+ </div>
+ </div>
+ </div>
+</form>
+
+<script type="text/javascript">
+ /* <![CDATA[ */
+ window.appConfig.maxUploadSize = "<?php echo $max_upload_size; ?>";
+ window.appConfig.maxFilesPerUpload = "<?php echo ini_get("max_file_uploads"); ?>";
+ /* ]]> */
+</script>
+
+<?php } else { ?>
+ <?php echo form_open('user/login', array('class' => 'form-inline')); ?>
+ <input type="text" name="username" placeholder="Username" autofocus class="form-control inline-input"/>
+ <input type="password" name="password" placeholder="Password" class="form-control inline-input"/>
+ <input type="submit" class="btn btn-primary" value="Login" name="process" />
+ <?php if(auth_driver_function_implemented("can_reset_password")) { ?>
+ <p class="help-block"><?php echo anchor("user/reset_password", "Forgot your password?"); ?></p>
+ <?php } ?>
+ </form>
+<?php } ?>
+<div class="row">
+ <div class="col-lg-6">
+ <div class="page-header"><h1>Features</h1></div>
+ <h3>How to link your pastes:</h3>
+ <dl class="dl-horizontal">
+ <dt>/&lt;ID&gt;/</dt><dd>automatically highlight the paste</dd>
+ <dt>/&lt;ID&gt;</dt><dd>set the detected MIME type and let the browser do the rest</dd>
+ <dt>/&lt;ID&gt;/plain</dt><dd>force the MIME type to be text/plain</dd>
+ <dt>/&lt;ID&gt;/&lt;file extension&gt;</dt><dd>override auto detection and use the supplied file extension or language name for highlighting</dd>
+ <dt>/&lt;ID&gt;/qr</dt><dd>display a qr code containing a link to <span class="example">/&lt;ID&gt;/</span></dd>
+ <dt>/&lt;ID&gt;/rmd</dt><dd>convert markdown to HTML</dd>
+ <dt>/&lt;ID&gt;/ascii</dt><dd>convert text with ANSI (shell) escape codes to HTML</dd>
+ <dt>/&lt;ID&gt;/info</dt><dd>display some information about the ID</dd>
+ <dt>/file/thumbnail/&lt;ID&gt;</dt><dd>return a JPEG thumbnail for the ID (only works for some file types)</dd>
+ </dl>
+ <p>
+ If your upload is not detected as text, only <b>/&lt;ID&gt;/qr</b>,
+ <b>/&lt;ID&gt;/plain</b>, <b>/&lt;ID&gt;/info</b> and
+ <b>/file/thumbnail/&lt;ID&gt;</b> will work as above and all others will simply
+ return the file with the detected MIME type.
+ </p>
+
+ <h3>How to link your multipastes:</h3>
+ <p>Multipaste IDs begin with <code>m-</code> and only support the following features.</p>
+ <dl class="dl-horizontal">
+ <dt>/&lt;ID&gt;/</dt><dd>automatically display everything in a sensible way</dd>
+ <dt>/&lt;ID&gt;/qr</dt><dd>display a qr code containing a link to <span class="example">/&lt;ID&gt;/</span></dd>
+ <dt>/&lt;ID&gt;/info</dt><dd>display some information about the multipaste</dd>
+ <dt>/&lt;ID&gt;/tar</dt><dd>download a tarball of all files in the multipaste (files may be renamed to avoid conflicts)</dd>
+ <dt>/&lt;ID&gt;/pls</dt><dd>download a PLS playlist of all audio/video files in the multipaste</dd>
+ </dl>
+
+ <h3>Special filenames:</h3>
+ <dl class="dl-horizontal">
+ <dt>*.asciinema.json<br>or *.cast</dt><dd>treat the file as an <a href="https://asciinema.org/">asciinema screencast</a> and display a videoplayer for it</dd>
+ </dl>
+ </div>
+
+ <div class="col-lg-6">
+ <div class="page-header"><h1>Information</h1></div>
+ <p>
+ This website's primary goal is aiding developers, power users, students and
+ alike in solving problems, debugging software, sharing their configuration,
+ etc. It is not intended to distribute confidential or harmful information,
+ scripts or software or copyrighted content for which you do not have a
+ distribution license.
+ </p>
+ <?php if(auth_driver_function_implemented("can_register_new_users")) { ?>
+ <p>
+ If you want an account, ask someone who is already using this
+ service to <a href="<?php echo site_url("user/invite"); ?>">invite</a> you.
+ </p>
+ <p>
+ Invitations are used to control abuse and encourage users to "be nice". They
+ are not intended as a means of exclusivity. In case of abuse reports, involved
+ accounts may be banned and the user who invited them may also be banned. The
+ invitation tree will be followed upwards if necessary.
+ </p>
+ <?php } ?>
+
+ <h3>Clients</h3>
+ <h4>Linux</h4>
+ <p>
+ Development: <?php echo anchor("https://git.server-speed.net/users/flo/fb/"); ?><br />
+ Latest release: <?php echo $client_link ? anchor($client_link) : "unknown"; ?><br />
+ GPG sigs, older versions: <?php echo anchor("https://paste.xinu.at/data/client"); ?>
+ </p>
+
+ <p>
+ Arch Linux: <code>pacman -S fb-client</code><br />
+ Gentoo: Add <a href="https://git.holgersson.xyz/foss/holgersson-overlay/src/branch/master/README.rst">this overlay</a> and run <code>emerge -a fb-client</code><br />
+ FreeBSD: <code>pkg install fb</code><br />
+ OpenSUSE: <a href="https://build.opensuse.org/package/show/home:mwilhelmy/fb-client">home:mwilhelmy / fb-client</a>
+ </p>
+
+ <h4>Android</h4>
+ <p>
+ Development: <a href="https://github.com/v4rakh/fbmobile">v4rakh/fbmobile @ Github</a><br>
+ Google Play: <a href="https://play.google.com/store/apps/details?id=de.varakh.fbmobile">FileBin @ Google Play</a><br>
+ </p>
+
+ <p>
+ Unmaintained Legacy Client:<br>
+ Development: <a href="https://github.com/sebastianrakel/fb-client-android">sebastianrakel/fb-client-android @ Github</a><br>
+ F-Droid Store: <a href="https://f-droid.org/repository/browse/?fdid=eu.devunit.fb_client">fb-client Android @ F-Droid</a><br>
+ </p>
+ </div>
+</div>
diff --git a/application/views/file/upload_history.php b/application/views/file/upload_history.php
new file mode 100644
index 000000000..c6cbe7946
--- /dev/null
+++ b/application/views/file/upload_history.php
@@ -0,0 +1,39 @@
+<?php echo form_open("file/handle_history_submit") ?>
+ <div class="nav-history">
+ <div class="container">
+ <div class="pull-right">
+ <button class="btn btn-danger" name="process" value="delete">Delete checked</button>
+ <button class="btn btn-primary" name="process" value="multipaste">Add checked to multipaste queue</button>
+ </div>
+ <?php include 'nav_history.php'; ?>
+ </div>
+ </div>
+ <div class="table-responsive">
+ <table id="upload_history" class="table table-striped tablesorter {sortlist: [[4,1]]}">
+ <thead>
+ <tr>
+ <th class="{sorter: false}"><input type="checkbox" name="all-ids" id="history-all"></th>
+ <th>ID</th>
+ <th>Filename</th>
+ <th>Mimetype
+ <th>Date</th>
+ <th>Size</th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php foreach($items as $key => $item): ?>
+ <tr>
+ <td><input type="checkbox" name="ids[<?php echo $item["id"] ?>]" value="<?php echo $item["id"] ?>" class="delete-history"></td>
+ <td><a href="<?php echo site_url("/".$item["id"]) ?>/" data-content="<?php if (isset($item['preview_text'])) {echo htmlentities($item['preview_text'], ENT_QUOTES);} ?>"><?php echo $item["id"] ?></a></td>
+ <td class="wrap"><?php echo htmlspecialchars($item["filename"]); ?></td>
+ <td><?php echo $item["mimetype"] ?></td>
+ <td class="nowrap" data-sort-value="<?=$item["date"]; ?>"><?php echo date("r", $item["date"]); ?></td>
+ <td><?php echo $item["filesize"] ?></td>
+ </tr>
+ <?php endforeach; ?>
+ </tbody>
+ </table>
+ </div>
+</form>
+
+<p>Total sum of your distinct uploads: <?php echo $total_size; ?>.</p>
diff --git a/application/views/file/upload_history_thumbnails.php b/application/views/file/upload_history_thumbnails.php
new file mode 100644
index 000000000..7d4fc6298
--- /dev/null
+++ b/application/views/file/upload_history_thumbnails.php
@@ -0,0 +1,26 @@
+<div class="nav-history">
+ <div class="container">
+ <div class="pull-right">
+ <?php echo form_open("file/handle_history_submit/", array("id" => "submit_form", "style" => "display: inline")); ?>
+ <button type="submit" class="btn btn-danger" style="display: none" name='process' value='delete'>Delete selected</button>
+ <button type="submit" class="btn btn-primary" style="display: none" name='process' value='multipaste'>Add selected to multipaste queue</button>
+ </form>
+ <button class="btn btn-default" id="toggle_select_mode" style="display: inline">Select mode</button>
+ </div>
+
+ <?php include 'nav_history.php'; ?>
+ </div>
+</div>
+<?php include 'fragments/thumbnail.php'; ?>
+
+<div class="row-fluid">
+ <div class="span12 alert alert-block alert-info">
+ <h4 class="alert-heading">Notice!</h4>
+ <p>
+ Currently only images and pdf files are displayed here. If you are
+ looking for something else, please switch to the
+ <a href="<?php echo site_url("file/upload_history"); ?>">list view</a>
+ which contains your complete history.
+ </p>
+ </div>
+</div>
diff --git a/application/views/footer.php b/application/views/footer.php
new file mode 100644
index 000000000..e3d3bc752
--- /dev/null
+++ b/application/views/footer.php
@@ -0,0 +1,23 @@
+ </div><!-- .container -->
+<div id="push"></div>
+</div> <!-- #wrap -->
+<footer class="footer" id="footer">
+ <div class="container muted credits">
+ <p>Site code licensed under <a href="http://www.gnu.org/licenses/agpl-3.0.html" target="_blank">AGPL v3</a>.</p>
+ <p><a href="http://glyphicons.com">Glyphicons Free</a> licensed under <a href="http://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a>.</p>
+ <ul class="footer-links">
+ <li><a href="http://git.server-speed.net/users/flo/filebin/">Source</a></li>
+ <li class="muted">&middot;</li>
+ <li><a href="<?php echo site_url("file/contact"); ?>">Contact</a></li>
+ </ul>
+ </div>
+</footer>
+
+<?php
+$CI = &get_instance();
+if ($CI->config->item("environment") == "development" && property_exists($CI, "email")) {
+ echo $CI->email->print_debugger();
+}
+?>
+</body>
+</html>
diff --git a/application/views/header.php b/application/views/header.php
new file mode 100644
index 000000000..47d9a02f6
--- /dev/null
+++ b/application/views/header.php
@@ -0,0 +1,121 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+ <meta charset="utf-8">
+ <title><?php echo isset($title) ? $title : 'FileBin'; ?></title>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="robots" content="noindex,nofollow" />
+ <meta name="description" content="">
+ <meta name="author" content="">
+
+ <link href="<?php echo link_with_mtime("/data/css/ui-lightness/jquery-ui.min.css"); ?>" rel="stylesheet">
+ <link href="<?php echo link_with_mtime("/data/css/bootstrap.min.css"); ?>" rel="stylesheet">
+ <link href="<?php echo link_with_mtime("/data/css/style.css"); ?>" rel="stylesheet">
+ <link href="<?php echo link_with_mtime("/data/css/colorbox.css"); ?>" rel="stylesheet">
+ <link href="<?php echo link_with_mtime("/data/css/asciinema-player.css"); ?>" rel="stylesheet">
+ <?php
+ if (file_exists(FCPATH."data/local/style.css")) {
+ echo '<link href="'.link_with_mtime("/data/local/style.css").'" rel="stylesheet">';
+ }
+
+ if (file_exists(FCPATH."data/local/favicon.png")) {
+ echo '<link href="'.link_with_mtime("/data/local/favicon.png").'" rel="shortcut icon">';
+ }
+ ?>
+ <script src="<?php echo link_with_mtime("/data/js/vendor/asciinema-player.js"); ?>"></script>
+ <script src="<?php echo link_with_mtime("/data/js/vendor/require.js"); ?>"></script>
+ <script type="text/javascript">
+ /* <![CDATA[ */
+ window.appConfig = {};
+ require.config({
+ baseUrl: '<?php echo base_url('/data/js'); ?>',
+ urlArgs: '<?php echo js_cache_buster(); ?>',
+ paths: {
+ 'main': ['main.min', 'main']
+ }
+ });
+ require(['main']);
+ /* ]]> */
+ </script>
+</head>
+
+<body>
+<div id="wrap">
+<?php if (file_exists(FCPATH."data/local/header.inc.php")) {
+ include FCPATH."data/local/header.inc.php";
+}?>
+ <nav class="navbar navbar-fixed-top navbar-inverse" role="navigation">
+ <div class="container">
+ <div class="navbar-header">
+ <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
+ <span class="sr-only">Toggle navigation</span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </button>
+ <a class="navbar-brand" href="<?php echo site_url(); ?>"><?php
+ if (file_exists(FCPATH."data/local/logo.svg")) {
+ echo '<img class="brand-icon" src="'.link_with_mtime("/data/local/logo.svg").'" style="height: 20px"> FileBin';
+ } else {
+ echo "FileBin";
+ }
+ ?>
+ </a>
+ </div>
+ <div class="collapse navbar-collapse navbar-ex1-collapse">
+ <?php if(!isset($GLOBALS["is_error_page"])) { ?>
+ <ul class="nav navbar-nav navbar-right">
+ <?php if (isset($user_logged_in) && $user_logged_in) { ?>
+ <li><a class="navbar-link" href="<?php echo site_url("/user/logout"); ?>">Logout</a></li>
+ <?php } else { ?>
+ <li class="dropdown">
+ <a class="dropdown-toggle" href="#" data-toggle="dropdown">Login <b class="caret"></b></a>
+ <div class="dropdown-menu" style="padding: 5px;">
+ <?php if(auth_driver_function_implemented("can_reset_password")) { ?>
+ <p><?php echo anchor("user/reset_password", "Forgot your password?"); ?></p>
+ <?php } ?>
+ <?php echo form_open("user/login?redirect_uri=".$redirect_uri, array("class" => "form-signin")); ?>
+ <input type="text" name="username" placeholder="Username" class="form-control">
+ <input type="password" name="password" placeholder="Password" class="form-control">
+ <button type="submit" name="process" class="btn btn-default btn-block">Login</button>
+ </form>
+ </div>
+ </li>
+ <?php } ?>
+ </ul>
+ <?php }; ?>
+ <ul class="nav navbar-nav">
+ <?php if (isset($user_logged_in) && $user_logged_in) { ?>
+ <li><a href="<?php echo site_url("file/index") ?>"><span class="glyphicon glyphicon-pencil"></span> New</a></li>
+ <li><a href="<?php echo site_url("file/upload_history") ?>"><span class="glyphicon glyphicon-book"></span> History</a></li>
+ <li class="dropdown">
+ <a href="<?php echo site_url("user/index"); ?>" class="dropdown-toggle" data-toggle="dropdown">
+ <span class="glyphicon glyphicon-user"></span> Account <b class="caret"></b>
+ </a>
+ <ul class="dropdown-menu">
+ <?php include "user/nav.php"; ?>
+ </ul>
+ </li>
+ <?php if (isset($show_multipaste_queue) && $show_multipaste_queue) {?>
+ <li class="btn-primary multipaste_button"><a href="<?php echo site_url("file/multipaste/queue"); ?>">Multipaste queue</a></li>
+ <?php } ?>
+ <?php } ?>
+ </ul>
+ </div>
+ </div>
+ </nav>
+ <div id="navbar-height"></div>
+
+ <div class="container">
+ <?php
+ if (isset($alerts)) {
+ foreach ($alerts as $alert) { ?>
+ <div class="alert alert-dismissable alert-<?php echo $alert["type"]; ?>" style="text-align: center">
+ <button type="button" class="close" data-dismiss="alert">&times;</button>
+ <?php echo $alert["message"]; ?>
+ </div>
+ <?php
+ }
+ }
+ ?>
diff --git a/application/views/tests/echo-fragment.php b/application/views/tests/echo-fragment.php
new file mode 100644
index 000000000..f8c26661f
--- /dev/null
+++ b/application/views/tests/echo-fragment.php
@@ -0,0 +1,5 @@
+<?php
+echo "listing ".count($items)." items:\n";
+foreach ($items as $item) {
+ echo $item;
+}
diff --git a/application/views/user/apikeys.php b/application/views/user/apikeys.php
new file mode 100644
index 000000000..2b6934c6d
--- /dev/null
+++ b/application/views/user/apikeys.php
@@ -0,0 +1,60 @@
+<h2>API keys</h2>
+<div class="table-responsive">
+ <table class="table table-striped">
+ <thead>
+ <tr>
+ <th>#</th>
+ <th>Key</th>
+ <th style="width: 30%;">Comment</th>
+ <th>Created on</th>
+ <th>Access</th>
+ <th></th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php $i = 1; ?>
+ <?php foreach($query as $key => $item): ?>
+ <tr>
+ <td><?php echo $i++; ?></td>
+ <td><?php echo $item["key"]; ?></td>
+ <td><?php echo htmlentities($item["comment"]); ?></td>
+ <td><?php echo date("Y/m/d H:i", $item["created"]); ?></td>
+ <td>
+ <?php if ($item["access_level"] == "full"): ?>
+ <span class="glyphicon glyphicon-warning-sign"></span>
+ <?php endif; ?>
+ <?php echo $item["access_level"]; ?>
+ </td>
+ <td>
+ <?php echo form_open("user/delete_apikey", array("style" => "margin-bottom: 0")); ?>
+ <?php echo form_hidden("key", $item["key"]); ?>
+ <button class="btn btn-danger btn-xs" type="submit">Delete</input>
+ </form>
+ </td>
+ </tr>
+ <?php endforeach; ?>
+ </tbody>
+ </table>
+</div>
+
+<h3>Access levels:</h3>
+
+<dl class="dl-horizontal">
+ <dt>basic</dt>
+ <dd>Allows uploading files.</dd>
+ <dt>apikey</dt>
+ <dd>Allows removing existing files and viewing the history. Includes <code>basic</code>.</dd>
+ <dt>full</dt>
+ <dd>Allows everything, including, but not limited to, creating and removing api keys, changing profile settings and creating invitation keys. Includes <code>apikey</code>.</dd>
+
+<p>
+ <?php echo form_open('user/create_apikey', array("class" => "form-inline")); ?>
+ <input type="text" name="comment" placeholder="Comment" class="form-control" style="width: 200px;"/>
+ <select name="access_level" class="form-control" style="width: 100px;">
+ <option>basic</option>
+ <option selected="selected">apikey</option>
+ <option>full</option>
+ </select>
+ <input class="btn btn-primary" type="submit" value="Create a new key" name="process" />
+</form>
+</p>
diff --git a/application/views/user/delete_account_form.php b/application/views/user/delete_account_form.php
new file mode 100644
index 000000000..dbb28531d
--- /dev/null
+++ b/application/views/user/delete_account_form.php
@@ -0,0 +1,27 @@
+<div class="row">
+ <div class="col-sm-12">
+ <h1>Account deletion</h1>
+ <p>
+ Here you can permanently delete your account on this FileBin installation.<br>
+ <b>WARNING: All your data will be irrevocably deleted.</b>
+ </p>
+ </div>
+</div>
+
+<?php echo form_open("user/delete_account"); ?>
+ <div class="row">
+ <div class="form-group col-lg-8 col-md-10">
+ <label class="control-label col-lg-2 col-md-2" for="inputPassword">Password</label>
+ <div class="col-lg-5 col-md-5">
+ <input type="password" id="inputPassword" name="password" placeholder="Password" class="form-control">
+ </div>
+ </div>
+ </div>
+ <div class='row'>
+ <div class="form-group col-lg-8 col-md-10">
+ <div class="col-lg-offset-2 col-lg-5 col-md-offset-2 col-md-5">
+ <button type="submit" name="delete" class="form-control btn-danger">Delete my account (<?php echo htmlentities($username); ?>)</button>
+ </div>
+ </div>
+ </div>
+</form>
diff --git a/application/views/user/delete_account_success.php b/application/views/user/delete_account_success.php
new file mode 100644
index 000000000..72d7ff12b
--- /dev/null
+++ b/application/views/user/delete_account_success.php
@@ -0,0 +1,8 @@
+<div class="row">
+ <div class="col-sm-12">
+ <h1>Account deletion successful</h1>
+ <p>
+ Your account has been successfully deleted. Thank you for using FileBin!
+ </p>
+ </div>
+</div>
diff --git a/application/views/user/hash_password.php b/application/views/user/hash_password.php
new file mode 100644
index 000000000..98bef9df5
--- /dev/null
+++ b/application/views/user/hash_password.php
@@ -0,0 +1,38 @@
+<?php
+if (!empty($error)) {
+ echo "<p class='alert alert-danger'>";
+ echo implode("<br />\n", $error);
+ echo "</p>";
+}
+
+if ($hash) {
+ echo "<p>Result (this hash uses a random salt, so it will be different each time you submit this form):<br />$hash</p>\n";
+}
+?>
+<?php echo form_open('user/hash_password'); ?>
+<div class="row">
+ <div class="form-group col-lg-10 col-md-10">
+ <label class="control-label col-lg-2 col-md-2" for="inputPassword">Password</label>
+ <div class="col-lg-5 col-md-5">
+ <input type="password" id="inputPassword" name="password" placeholder="Password" class="form-control">
+ </div>
+ </div>
+</div>
+
+<div class="row">
+ <div class="form-group col-lg-10 col-md-10">
+ <label class="control-label col-lg-2 col-md-2" for="inputPassword">Confirm password</label>
+ <div class="col-lg-5 col-md-5">
+ <input type="password" id="inputPasswordConfirm" name="password_confirm" placeholder="Password confirmation" class="form-control">
+ </div>
+ </div>
+</div>
+
+<div class="row">
+ <div class="form-group col-lg-10 col-md-10">
+ <div class="col-lg-offset-2 col-lg-5 col-md-offset-2 col-md-5">
+ <button type="submit" class="btn btn-primary" name="process">Hash it</button>
+ </div>
+ </div>
+</form>
+
diff --git a/application/views/user/index.php b/application/views/user/index.php
new file mode 100644
index 000000000..9e6f48116
--- /dev/null
+++ b/application/views/user/index.php
@@ -0,0 +1,3 @@
+<ul class="nav">
+<?php include "nav.php"; ?>
+</ul>
diff --git a/application/views/user/invite.php b/application/views/user/invite.php
new file mode 100644
index 000000000..042ba0b61
--- /dev/null
+++ b/application/views/user/invite.php
@@ -0,0 +1,45 @@
+<div class="alert alert-warning">
+ <p>
+ <b>Watch out!</b>
+ </p>
+ <p>
+ You are free to invite anyone you want to, but please keep in
+ mind that if this person violates the rules and is banned, your
+ account will also be disabled.
+ </p>
+</div>
+
+<h2>Unused invitation keys</h2>
+<div class="table-responsive">
+ <table class="table table-striped">
+ <thead>
+ <tr>
+ <th>#</th>
+ <th style="width: 70%;">Key</th>
+ <th>Created on</th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php $i = 1; ?>
+ <?php foreach($query as $key => $item): ?>
+ <tr>
+ <td><?php echo $i++; ?></td>
+ <td><?php echo anchor("user/register/".$item["key"], $item["key"]) ?></td>
+ <td><?php echo date("Y/m/d H:i", $item["date"]) ?></td>
+ <td>
+ <?php echo form_open('user/delete_invitation_key'); ?>
+ <input class="btn btn-danger btn-xs" type="submit" value="Delete" name="delete" />
+ <input type="hidden" name="key" value="<?php echo $item["key"]; ?>" />
+ </form>
+ </td>
+ </tr>
+ <?php endforeach; ?>
+ </tbody>
+ </table>
+</div>
+
+<p>
+ <?php echo form_open('user/create_invitation_key'); ?>
+ <input class="btn btn-primary btn-large" type="submit" value="Create a new key" name="process" />
+ </form>
+</p>
diff --git a/application/views/user/login.php b/application/views/user/login.php
new file mode 100644
index 000000000..6fb4d97dd
--- /dev/null
+++ b/application/views/user/login.php
@@ -0,0 +1,26 @@
+<?php
+if (isset($login_error)) { ?>
+ <div class="alert alert-danger">The entered credentials are invalid.</div>
+<?php } ?>
+
+<?php echo form_open("user/login?redirect_uri=$redirect_uri", array("class" => "login-page")); ?>
+ <div class="form-group">
+ <label class="control-label" for="inputUsername">Username</label>
+ <div class="controls">
+ <input type="text" id="inputUsername" name="username" placeholder="Username" class="form-control">
+ </div>
+ </div>
+
+ <div class="form-group">
+ <label class="control-label" for="inputPassword">Password</label>
+ <div class="controls">
+ <input type="password" id="inputPassword" name="password" placeholder="Password" class="form-control">
+ </div>
+ </div>
+
+ <div class="form-group">
+ <div class="controls">
+ <button type="submit" class="btn btn-primary" name="process">Login</button>
+ </div>
+ </div>
+</form>
diff --git a/application/views/user/nav.php b/application/views/user/nav.php
new file mode 100644
index 000000000..49c7aa988
--- /dev/null
+++ b/application/views/user/nav.php
@@ -0,0 +1,11 @@
+<?php if(auth_driver_function_implemented("can_register_new_users")) { ?>
+<li><a href="<?php echo site_url("user/invite") ?>"><span class="glyphicon glyphicon-plus"></span> Invite</a></li>
+<?php } ?>
+
+<li><a href="<?php echo site_url("user/profile") ?>"><span class="glyphicon glyphicon-user"></span> Profile</a></li>
+<li><a href="<?php echo site_url("user/apikeys") ?>"><span class="glyphicon glyphicon-tags"></span> API keys</a></li>
+
+<?php if(auth_driver_function_implemented("can_reset_password")) { ?>
+<li><a href="<?php echo site_url("user/reset_password") ?>"><span class="glyphicon glyphicon-lock"></span> Change password</a></li>
+<?php } ?>
+
diff --git a/application/views/user/profile.php b/application/views/user/profile.php
new file mode 100644
index 000000000..fbd29f474
--- /dev/null
+++ b/application/views/user/profile.php
@@ -0,0 +1,48 @@
+<?php echo form_open("user/profile"); ?>
+
+<div class="row">
+ <div class="form-group col-lg-8 col-md-10">
+ <label class="control-label col-lg-2 col-md-2" for="inputUsername">Username</label>
+ <div class="col-lg-5 col-md-5">
+ <input type="text" id="inputUsername" name="username" placeholder="Username" disabled="disabled" value="<?php echo $profile_data["username"]; ?>" class="form-control">
+ </div>
+ </div>
+</div>
+
+<?php if($profile_data["email"] !== null) { ?>
+<div class="row">
+ <div class="form-group col-lg-8 col-md-10">
+ <label class="control-label col-lg-2 col-md-2" for="inputEmail">Email</label>
+ <div class="col-lg-5 col-md-5">
+ <input type="text" id="inputEmail" name="email" placeholder="Email" <?php if(!auth_driver_function_implemented("can_change_email")) { ?>disabled="disabled" <?php } ?>value="<?php echo $profile_data["email"]; ?>" class="form-control">
+ </div>
+ </div>
+</div>
+<?php } ?>
+
+<div class="row">
+ <div class="form-group col-lg-8 col-md-10">
+ <label class="control-label col-lg-2 col-md-2" for="inputUploadIDLimits">Upload ID length limits</label>
+ <div class="col-lg-5 col-md-5">
+ <input type="text" id="inputUploadIDLimits" name="upload_id_limits" placeholder="number-number" value="<?php echo $profile_data["upload_id_limits"]; ?>" class="form-control">
+ <span class="help-block">Values have to be between 3 and 64 inclusive. Please remember that longer IDs don't protect your pastes from being found if you post the link somewhere a search engine can see it.</span>
+ </div>
+ </div>
+</div>
+
+<div class="row">
+ <div class="form-group col-lg-8 col-md-10">
+ <div class="col-lg-offset-2 col-lg-5 col-md-offset-2 col-md-5">
+ <button type="submit" class="btn btn-primary" name="process">Save changes</button>
+ </div>
+ </div>
+</div>
+</form>
+
+<div class="row vertical-space-small"></div>
+
+<?php if(auth_driver_function_implemented("can_delete_account")) { ?>
+<div class="row">
+ <p>If you want to permanently delete your account, please click <a href="<?php echo site_url("user/delete_account"); ?>">here</a>.</p>
+</div>
+<?php } ?>
diff --git a/application/views/user/register.php b/application/views/user/register.php
new file mode 100644
index 000000000..0f03a2f00
--- /dev/null
+++ b/application/views/user/register.php
@@ -0,0 +1,52 @@
+<?php if (!empty($error)) {
+ echo "<p class='alert alert-danger'>";
+ echo implode("<br />\n", $error);
+ echo "</p>";
+} ?>
+<?php echo form_open('user/register/'.$key); ?>
+<div class="row">
+ <div class="form-group col-lg-8 col-md-10">
+ <label class="control-label col-lg-2 col-md-2" for="inputUsername">Username</label>
+ <div class="col-lg-5 col-md-5">
+ <input type="text" id="inputUsername" name="username" placeholder="Username" value="<?php echo $values["username"]; ?>" class="form-control">
+ <span class="help-block">The username may contain up to 32 chars of a-z0-9 (only lowercase characters).</span>
+ </div>
+ </div>
+</div>
+
+<div class="row">
+ <div class="form-group col-lg-8 col-md-10">
+ <label class="control-label col-lg-2 col-md-2" for="inputEmail">Email</label>
+ <div class="col-lg-5 col-md-5">
+ <input type="text" id="inputEmail" name="email" placeholder="Email" value="<?php echo $values["email"]; ?>" class="form-control">
+ </div>
+ </div>
+</div>
+
+<div class="row">
+ <div class="form-group col-lg-8 col-md-10">
+ <label class="control-label col-lg-2 col-md-2" for="inputPassword">Password</label>
+ <div class="col-lg-5 col-md-5">
+ <input type="password" id="inputPassword" name="password" placeholder="Password" class="form-control">
+ </div>
+ </div>
+</div>
+
+<div class="row">
+ <div class="form-group col-lg-8 col-md-10">
+ <label class="control-label col-lg-2 col-md-2" for="inputPassword">Confirm password</label>
+ <div class="col-lg-5 col-md-5">
+ <input type="password" id="inputPasswordConfirm" name="password_confirm" placeholder="Password confirmation" class="form-control">
+ </div>
+ </div>
+</div>
+
+<div class="row">
+ <div class="form-group col-lg-8 col-md-10">
+ <div class="col-lg-offset-2 col-lg-5 col-md-offset-2 col-md-5">
+ <button type="submit" class="btn btn-primary" name="process">Register</button>
+ </div>
+ </div>
+</div>
+</form>
+
diff --git a/application/views/user/registered.php b/application/views/user/registered.php
new file mode 100644
index 000000000..f13006aae
--- /dev/null
+++ b/application/views/user/registered.php
@@ -0,0 +1,3 @@
+<div class="center">
+ <p>Your account has been created, you may log in now.</p>
+</div>
diff --git a/application/views/user/reset_password_form.php b/application/views/user/reset_password_form.php
new file mode 100644
index 000000000..9c8253189
--- /dev/null
+++ b/application/views/user/reset_password_form.php
@@ -0,0 +1,33 @@
+<?php if (!empty($error)) {
+ echo "<p class='alert alert-danger'>";
+ echo implode("<br />\n", $error);
+ echo "</p>";
+} ?>
+<?php echo form_open('user/reset_password/'.$key); ?>
+<div class="row">
+ <div class="form-group col-lg-8 col-md-10">
+ <label class="control-label col-lg-2 col-md-2" for="inputPassword">Password</label>
+ <div class="col-lg-5 col-md-5">
+ <input type="password" id="inputPassword" name="password" placeholder="Password" class="form-control">
+ </div>
+ </div>
+</div>
+
+<div class="row">
+ <div class="form-group col-lg-8 col-md-10">
+ <label class="control-label col-lg-2 col-md-2" for="inputPassword">Confirm password</label>
+ <div class="col-lg-5 col-md-5">
+ <input type="password" id="inputPasswordConfirm" name="password_confirm" placeholder="Password confirmation" class="form-control">
+ </div>
+ </div>
+</div>
+
+<div class="row">
+ <div class="form-group col-lg-8 col-md-10">
+ <div class="col-lg-offset-2 col-lg-5 col-md-offset-2 col-md-5">
+ <button type="submit" class="btn btn-primary" name="process">Change password</button>
+ </div>
+ </div>
+</div>
+</form>
+
diff --git a/application/views/user/reset_password_link_sent.php b/application/views/user/reset_password_link_sent.php
new file mode 100644
index 000000000..a5b249f89
--- /dev/null
+++ b/application/views/user/reset_password_link_sent.php
@@ -0,0 +1,3 @@
+<p>
+ A mail containing your password reset link has been sent to your email address at <?php echo htmlentities($email_domain); ?>.
+</p>
diff --git a/application/views/user/reset_password_success.php b/application/views/user/reset_password_success.php
new file mode 100644
index 000000000..bc7448833
--- /dev/null
+++ b/application/views/user/reset_password_success.php
@@ -0,0 +1,3 @@
+<div class="center">
+ <p>Your password has been changed successfully.</p>
+</div>
diff --git a/application/views/user/reset_password_username_form.php b/application/views/user/reset_password_username_form.php
new file mode 100644
index 000000000..713cd4919
--- /dev/null
+++ b/application/views/user/reset_password_username_form.php
@@ -0,0 +1,19 @@
+<?php echo form_open('user/reset_password'); ?>
+<div class="row">
+ <div class="form-group col-lg-8 col-md-10">
+ <label class="control-label col-lg-2 col-md-2" for="inputUsername">Username</label>
+ <div class="col-lg-5 col-md-5">
+ <input type="text" id="inputUsername" name="username" placeholder="Username" value="<?php echo isset($username) ? $username : ""; ?>" class="form-control">
+ </div>
+ </div>
+</div>
+
+<div class="row">
+ <div class="form-group col-lg-8 col-md-10">
+ <div class="col-lg-offset-2 col-lg-5 col-md-offset-2 col-md-5">
+ <button type="submit" class="btn btn-primary" name="process">Send mail</button>
+ </div>
+ </div>
+</div>
+</form>
+
diff --git a/application/views/welcome_message.php b/application/views/welcome_message.php
deleted file mode 100644
index 9db22bc5e..000000000
--- a/application/views/welcome_message.php
+++ /dev/null
@@ -1,100 +0,0 @@
-<?php
-defined('BASEPATH') OR exit('No direct script access allowed');
-?><!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="utf-8">
- <title>Welcome to CodeIgniter</title>
-
- <style type="text/css">
-
- ::selection { background-color: #E13300; color: white; }
- ::-moz-selection { background-color: #E13300; color: white; }
-
- body {
- background-color: #fff;
- margin: 40px;
- font: 13px/20px normal Helvetica, Arial, sans-serif;
- color: #4F5155;
- }
-
- a {
- color: #003399;
- background-color: transparent;
- font-weight: normal;
- text-decoration: none;
- }
-
- a:hover {
- color: #97310e;
- }
-
- h1 {
- color: #444;
- background-color: transparent;
- border-bottom: 1px solid #D0D0D0;
- font-size: 19px;
- font-weight: normal;
- margin: 0 0 14px 0;
- padding: 14px 15px 10px 15px;
- }
-
- code {
- font-family: Consolas, Monaco, Courier New, Courier, monospace;
- font-size: 12px;
- background-color: #f9f9f9;
- border: 1px solid #D0D0D0;
- color: #002166;
- display: block;
- margin: 14px 0 14px 0;
- padding: 12px 10px 12px 10px;
- }
-
- #body {
- margin: 0 15px 0 15px;
- min-height: 96px;
- }
-
- p {
- margin: 0 0 10px;
- padding:0;
- }
-
- p.footer {
- text-align: right;
- font-size: 11px;
- border-top: 1px solid #D0D0D0;
- line-height: 32px;
- padding: 0 10px 0 10px;
- margin: 20px 0 0 0;
- }
-
- #container {
- margin: 10px;
- border: 1px solid #D0D0D0;
- box-shadow: 0 0 8px #D0D0D0;
- }
- </style>
-</head>
-<body>
-
-<div id="container">
- <h1>Welcome to CodeIgniter!</h1>
-
- <div id="body">
- <p>The page you are looking at is being generated dynamically by CodeIgniter.</p>
-
- <p>If you would like to edit this page you'll find it located at:</p>
- <code>application/views/welcome_message.php</code>
-
- <p>The corresponding controller for this page is found at:</p>
- <code>application/controllers/Welcome.php</code>
-
- <p>If you are exploring CodeIgniter for the very first time, you should start by reading the <a href="userguide3/">User Guide</a>.</p>
- </div>
-
- <p class="footer">Page rendered in <strong>{elapsed_time}</strong> seconds. <?php echo (ENVIRONMENT === 'development') ? 'CodeIgniter Version <strong>' . CI_VERSION . '</strong>' : '' ?></p>
-</div>
-
-</body>
-</html>
diff --git a/build-release.sh b/build-release.sh
deleted file mode 100755
index ea5497560..000000000
--- a/build-release.sh
+++ /dev/null
@@ -1,84 +0,0 @@
-#!/usr/bin/env bash
-
-cd $(dirname $BASH_SOURCE)
-
-if [ $# -eq 0 ]; then
- echo 'Usage: '$BASH_SOURCE' <version_number>'
- exit 1
-fi
-
-version_number=$1
-
-if [ ${#version_number} -lt 5 ]
-then
- echo "Provided version number is too short"
- exit 1
-elif [ ${version_number: -4} == "-dev" ]
-then
- echo "'-dev' releases are not allowed"
- exit 1
-fi
-
-version_id=${version_number:0:5}
-version_id=${version_id//./}
-upgrade_rst='user_guide_src/source/installation/upgrade_'$version_id'.rst'
-
-if [ ${#version_id} -ne 3 ]
-then
- echo "Invalid version number format"
- exit 1
-elif [ `grep -c -F --regexp="'$version_number'" system/core/CodeIgniter.php` -ne 1 ]
-then
- echo "Provided version number doesn't match in system/core/CodeIgniter.php"
- exit 1
-elif [ `grep -c -F --regexp="'$version_number'" user_guide_src/source/conf.py` -ne 2 ]
-then
- echo "Provided version number doesn't match in user_guide_src/source/conf.py"
- exit 1
-elif [ `grep -c -F --regexp="$version_number (Current version) <https://codeload.github.com/bcit-ci/CodeIgniter/zip/$version_number>" user_guide_src/source/installation/downloads.rst` -ne 1 ]
-then
- echo "user_guide_src/source/installation/downloads.rst doesn't appear to contain a link for this version"
- exit 1
-elif [ ! -f "$upgrade_rst" ]
-then
- echo "${upgrade_rst} doesn't exist"
- exit 1
-fi
-
-echo "Running tests ..."
-
-php -d zend.enable_gc=0 -d date.timezone=UTC -d mbstring.func_overload=7 -d mbstring.internal_encoding=UTF-8 vendor/bin/phpunit --coverage-text --configuration tests/travis/sqlite.phpunit.xml
-
-if [ $? -ne 0 ]
-then
- echo "Build FAILED!"
- exit 1
-fi
-
-cd user_guide_src/
-
-echo ""
-echo "Building HTML docs; please check output for warnings ..."
-echo ""
-
-make html
-
-echo ""
-
-if [ $? -ne 0 ]
-then
- echo "Build FAILED!"
- exit 1
-fi
-
-cd ..
-
-if [ -d user_guide/ ]
-then
- rm -r user_guide/
-fi
-
-cp -r user_guide_src/build/html/ user_guide/
-git add user_guide/
-
-echo "Build complete."
diff --git a/check_deps.php b/check_deps.php
new file mode 100755
index 000000000..bb716a0a2
--- /dev/null
+++ b/check_deps.php
@@ -0,0 +1,88 @@
+#!/usr/bin/php
+<?php
+
+if (version_compare(PHP_VERSION, '5.5.0') < 0) {
+ echo "Filebin will most certainly not work with php older than 5.5. Use at your own risk!\n\n";
+}
+
+$errors = "";
+
+define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
+define('FCPATH', str_replace(SELF, "", __FILE__));
+if (getenv("HOME") == "") {
+ putenv('HOME='.FCPATH);
+}
+
+$old_path = getenv("PATH");
+putenv("PATH=$old_path:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin");
+
+// test exec()
+exec("echo -n works") == "works" || $errors .= "exec() failed\n";
+
+// test passthru()
+ob_start();
+passthru("echo -n works");
+$buf = ob_get_contents();
+ob_end_clean();
+$buf == "works" || $errors .= "passthru() failed\n";
+
+// test pygmentize
+ob_start();
+passthru("pygmentize -V 2>&1", $buf);
+ob_end_clean();
+if ($buf != "0") {
+ $errors .= " - Error when testing pygmentize: Return code was \"$buf\".\n";
+}
+
+// test ansi2html
+ob_start();
+passthru("ansi2html -h 2>&1", $buf);
+ob_end_clean();
+if ($buf != "0") {
+ $errors .= " - Error when testing ansi2html: Return code was \"$buf\".\n";
+}
+
+// test imagemagick
+ob_start();
+passthru("convert --version 2>&1", $buf);
+ob_end_clean();
+if ($buf != "0") {
+ $errors .= " - Error when testing imagemagick (convert): Return code was \"$buf\".\n";
+}
+
+// test composer
+ob_start();
+passthru("composer --version 2>&1", $buf);
+ob_end_clean();
+if ($buf != "0") {
+ $errors .= " - Error when testing composer: Return code was \"$buf\".\n";
+}
+
+// test PHP modules
+$mod_groups = array(
+ "thumbnail generation - GD" => array("gd"),
+ "thumbnail generation - EXIF" => array("exif"),
+ "database support" => array("mysql", "mysqli", "pgsql", "pdo_mysql", "pdo_pgsql"),
+ "multipaste tarball support" => array("phar"),
+ "multibyte functions" => array("mbstring"),
+);
+foreach ($mod_groups as $function => $mods) {
+ $found = 0;
+ foreach ($mods as $module) {
+ if (extension_loaded($module)) {
+ $found++;
+ }
+ }
+ if ($found == 0) {
+ $errors .= " - none of the modules needed for $function are loaded. Make sure to load at least one of these: ".implode(", ", $mods)."\n";
+ }
+}
+
+
+if ($errors != "") {
+ echo "Errors occured:\n";
+ echo $errors;
+ exit(1);
+} else {
+ echo "Dependency checks completed sucessfully.\n";
+}
diff --git a/composer.json b/composer.json
index 01e65f40f..3c77414f3 100644
--- a/composer.json
+++ b/composer.json
@@ -1,35 +1,26 @@
{
- "description": "The CodeIgniter framework",
- "name": "codeigniter/framework",
+ "description": "FileBin",
+ "name": "bluewind/filebin",
"type": "project",
- "homepage": "https://codeigniter.com",
- "license": "MIT",
+ "homepage": "https://github.com/Bluewind/filebin",
+ "license": "AGPLv3",
"support": {
- "forum": "http://forum.codeigniter.com/",
- "wiki": "https://github.com/bcit-ci/CodeIgniter/wiki",
- "slack": "https://codeigniterchat.slack.com",
- "source": "https://github.com/bcit-ci/CodeIgniter"
+ "forum": "https://github.com/Bluewind/filebin",
+ "source": "https://github.com/Bluewind/filebin"
},
"require": {
- "php": ">=5.3.7"
+ "php": ">=5.5",
+ "ext-gd": "*",
+ "ext-exif": "*",
+ "ext-fileinfo": "*",
+ "ext-phar": "*",
+ "ext-mbstring": "*"
},
"suggest": {
"paragonie/random_compat": "Provides better randomness in PHP 5.x"
},
- "scripts": {
- "test:coverage": [
- "@putenv XDEBUG_MODE=coverage",
- "phpunit --color=always --coverage-text --configuration tests/travis/sqlite.phpunit.xml"
- ],
- "post-install-cmd": [
- "sed -i s/name{0}/name[0]/ vendor/mikey179/vfsstream/src/main/php/org/bovigo/vfs/vfsStream.php"
- ],
- "post-update-cmd": [
- "sed -i s/name{0}/name[0]/ vendor/mikey179/vfsstream/src/main/php/org/bovigo/vfs/vfsStream.php"
- ]
- },
"require-dev": {
- "mikey179/vfsstream": "1.6.*",
- "phpunit/phpunit": "4.* || 5.* || 9.*"
+ "phpunit/php-code-coverage": "^9 || ^10",
+ "ext-xdebug": "*"
}
}
diff --git a/composer.lock b/composer.lock
new file mode 100644
index 000000000..b69cd9330
--- /dev/null
+++ b/composer.lock
@@ -0,0 +1,615 @@
+{
+ "_readme": [
+ "This file locks the dependencies of your project to a known state",
+ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
+ "This file is @generated automatically"
+ ],
+ "content-hash": "49dc23764dd78a97c88c4a0fbc48fcf4",
+ "packages": [],
+ "packages-dev": [
+ {
+ "name": "nikic/php-parser",
+ "version": "v4.10.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/nikic/PHP-Parser.git",
+ "reference": "c6d052fc58cb876152f89f532b95a8d7907e7f0e"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/c6d052fc58cb876152f89f532b95a8d7907e7f0e",
+ "reference": "c6d052fc58cb876152f89f532b95a8d7907e7f0e",
+ "shasum": ""
+ },
+ "require": {
+ "ext-tokenizer": "*",
+ "php": ">=7.0"
+ },
+ "require-dev": {
+ "ircmaxell/php-yacc": "^0.0.7",
+ "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0"
+ },
+ "bin": [
+ "bin/php-parse"
+ ],
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "4.9-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "PhpParser\\": "lib/PhpParser"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Nikita Popov"
+ }
+ ],
+ "description": "A PHP parser written in PHP",
+ "keywords": [
+ "parser",
+ "php"
+ ],
+ "support": {
+ "issues": "https://github.com/nikic/PHP-Parser/issues",
+ "source": "https://github.com/nikic/PHP-Parser/tree/v4.10.4"
+ },
+ "time": "2020-12-20T10:01:03+00:00"
+ },
+ {
+ "name": "phpunit/php-code-coverage",
+ "version": "9.2.5",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
+ "reference": "f3e026641cc91909d421802dd3ac7827ebfd97e1"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f3e026641cc91909d421802dd3ac7827ebfd97e1",
+ "reference": "f3e026641cc91909d421802dd3ac7827ebfd97e1",
+ "shasum": ""
+ },
+ "require": {
+ "ext-dom": "*",
+ "ext-libxml": "*",
+ "ext-xmlwriter": "*",
+ "nikic/php-parser": "^4.10.2",
+ "php": ">=7.3",
+ "phpunit/php-file-iterator": "^3.0.3",
+ "phpunit/php-text-template": "^2.0.2",
+ "sebastian/code-unit-reverse-lookup": "^2.0.2",
+ "sebastian/complexity": "^2.0",
+ "sebastian/environment": "^5.1.2",
+ "sebastian/lines-of-code": "^1.0.3",
+ "sebastian/version": "^3.0.1",
+ "theseer/tokenizer": "^1.2.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
+ "suggest": {
+ "ext-pcov": "*",
+ "ext-xdebug": "*"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "9.2-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
+ "homepage": "https://github.com/sebastianbergmann/php-code-coverage",
+ "keywords": [
+ "coverage",
+ "testing",
+ "xunit"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
+ "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.5"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2020-11-28T06:44:49+00:00"
+ },
+ {
+ "name": "phpunit/php-file-iterator",
+ "version": "3.0.5",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
+ "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/aa4be8575f26070b100fccb67faabb28f21f66f8",
+ "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "FilterIterator implementation that filters files based on a list of suffixes.",
+ "homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
+ "keywords": [
+ "filesystem",
+ "iterator"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues",
+ "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.5"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2020-09-28T05:57:25+00:00"
+ },
+ {
+ "name": "phpunit/php-text-template",
+ "version": "2.0.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-text-template.git",
+ "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28",
+ "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Simple template engine.",
+ "homepage": "https://github.com/sebastianbergmann/php-text-template/",
+ "keywords": [
+ "template"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/php-text-template/issues",
+ "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2020-10-26T05:33:50+00:00"
+ },
+ {
+ "name": "sebastian/code-unit-reverse-lookup",
+ "version": "2.0.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git",
+ "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5",
+ "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Looks up which function or method a line of code belongs to",
+ "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues",
+ "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2020-09-28T05:30:19+00:00"
+ },
+ {
+ "name": "sebastian/complexity",
+ "version": "2.0.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/complexity.git",
+ "reference": "739b35e53379900cc9ac327b2147867b8b6efd88"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88",
+ "reference": "739b35e53379900cc9ac327b2147867b8b6efd88",
+ "shasum": ""
+ },
+ "require": {
+ "nikic/php-parser": "^4.7",
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Library for calculating the complexity of PHP code units",
+ "homepage": "https://github.com/sebastianbergmann/complexity",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/complexity/issues",
+ "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2020-10-26T15:52:27+00:00"
+ },
+ {
+ "name": "sebastian/environment",
+ "version": "5.1.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/environment.git",
+ "reference": "388b6ced16caa751030f6a69e588299fa09200ac"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/388b6ced16caa751030f6a69e588299fa09200ac",
+ "reference": "388b6ced16caa751030f6a69e588299fa09200ac",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
+ "suggest": {
+ "ext-posix": "*"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "5.1-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Provides functionality to handle HHVM/PHP environments",
+ "homepage": "http://www.github.com/sebastianbergmann/environment",
+ "keywords": [
+ "Xdebug",
+ "environment",
+ "hhvm"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/environment/issues",
+ "source": "https://github.com/sebastianbergmann/environment/tree/5.1.3"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2020-09-28T05:52:38+00:00"
+ },
+ {
+ "name": "sebastian/lines-of-code",
+ "version": "1.0.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/lines-of-code.git",
+ "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc",
+ "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc",
+ "shasum": ""
+ },
+ "require": {
+ "nikic/php-parser": "^4.6",
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Library for counting the lines of code in PHP source code",
+ "homepage": "https://github.com/sebastianbergmann/lines-of-code",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/lines-of-code/issues",
+ "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2020-11-28T06:42:11+00:00"
+ },
+ {
+ "name": "sebastian/version",
+ "version": "3.0.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/version.git",
+ "reference": "c6c1022351a901512170118436c764e473f6de8c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c",
+ "reference": "c6c1022351a901512170118436c764e473f6de8c",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Library that helps with managing the version number of Git-hosted PHP projects",
+ "homepage": "https://github.com/sebastianbergmann/version",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/version/issues",
+ "source": "https://github.com/sebastianbergmann/version/tree/3.0.2"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2020-09-28T06:39:44+00:00"
+ },
+ {
+ "name": "theseer/tokenizer",
+ "version": "1.2.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/theseer/tokenizer.git",
+ "reference": "75a63c33a8577608444246075ea0af0d052e452a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/theseer/tokenizer/zipball/75a63c33a8577608444246075ea0af0d052e452a",
+ "reference": "75a63c33a8577608444246075ea0af0d052e452a",
+ "shasum": ""
+ },
+ "require": {
+ "ext-dom": "*",
+ "ext-tokenizer": "*",
+ "ext-xmlwriter": "*",
+ "php": "^7.2 || ^8.0"
+ },
+ "type": "library",
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Arne Blankerts",
+ "email": "arne@blankerts.de",
+ "role": "Developer"
+ }
+ ],
+ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats",
+ "support": {
+ "issues": "https://github.com/theseer/tokenizer/issues",
+ "source": "https://github.com/theseer/tokenizer/tree/master"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/theseer",
+ "type": "github"
+ }
+ ],
+ "time": "2020-07-12T23:59:07+00:00"
+ }
+ ],
+ "aliases": [],
+ "minimum-stability": "stable",
+ "stability-flags": [],
+ "prefer-stable": false,
+ "prefer-lowest": false,
+ "platform": {
+ "php": ">=5.5",
+ "ext-gd": "*",
+ "ext-exif": "*",
+ "ext-fileinfo": "*",
+ "ext-phar": "*",
+ "ext-mbstring": "*"
+ },
+ "platform-dev": {
+ "ext-xdebug": "*"
+ },
+ "plugin-api-version": "2.0.0"
+}
diff --git a/crontab b/crontab
new file mode 100644
index 000000000..d461ba15b
--- /dev/null
+++ b/crontab
@@ -0,0 +1,2 @@
+*/10 * * * * php ~/index.php file cron
+28 * * * * php ~/index.php user cron
diff --git a/data/.htaccess b/data/.htaccess
new file mode 100644
index 000000000..902c08446
--- /dev/null
+++ b/data/.htaccess
@@ -0,0 +1,13 @@
+<IfModule mod_expires.c>
+ ExpiresActive on
+ ExpiresByType text/css "access plus 1 year"
+ ExpiresByType application/javascript "access plus 1 year"
+ ExpiresByType image/svg+xml "access plus 1 year"
+</IfModule>
+
+<IfModule mod_headers.c>
+ Header append Cache-Control "public"
+</IfModule>
+
+FileEtag none
+
diff --git a/data/client b/data/client
new file mode 120000
index 000000000..4db3afc3c
--- /dev/null
+++ b/data/client
@@ -0,0 +1 @@
+../public_html/data/client \ No newline at end of file
diff --git a/data/css b/data/css
new file mode 120000
index 000000000..94aec2ac2
--- /dev/null
+++ b/data/css
@@ -0,0 +1 @@
+../public_html/data/css \ No newline at end of file
diff --git a/data/fonts b/data/fonts
new file mode 120000
index 000000000..386f89120
--- /dev/null
+++ b/data/fonts
@@ -0,0 +1 @@
+../public_html/data/fonts \ No newline at end of file
diff --git a/data/img b/data/img
new file mode 120000
index 000000000..813bf7cad
--- /dev/null
+++ b/data/img
@@ -0,0 +1 @@
+../public_html/data/img \ No newline at end of file
diff --git a/data/js b/data/js
new file mode 120000
index 000000000..c2e03f7df
--- /dev/null
+++ b/data/js
@@ -0,0 +1 @@
+../public_html/data/js \ No newline at end of file
diff --git a/data/local/.gitignore b/data/local/.gitignore
new file mode 100644
index 000000000..a6c22d616
--- /dev/null
+++ b/data/local/.gitignore
@@ -0,0 +1,5 @@
+contact-info.php
+favicon.png
+logo.svg
+header.inc.php
+style.css
diff --git a/data/local/examples/.gitignore b/data/local/examples/.gitignore
new file mode 100644
index 000000000..1aaf04e37
--- /dev/null
+++ b/data/local/examples/.gitignore
@@ -0,0 +1,3 @@
+!*.php
+!*.svg
+!*.png
diff --git a/data/local/examples/contact-info.php b/data/local/examples/contact-info.php
new file mode 100644
index 000000000..dfac270b3
--- /dev/null
+++ b/data/local/examples/contact-info.php
@@ -0,0 +1,4 @@
+<address>
+ <strong>John Doe</strong><br>
+ <a href="mailto:#">john.doe@example.com</a>
+</address>
diff --git a/data/local/examples/favicon.png b/data/local/examples/favicon.png
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/data/local/examples/favicon.png
diff --git a/data/local/examples/header.inc.php b/data/local/examples/header.inc.php
new file mode 100644
index 000000000..d61d30af7
--- /dev/null
+++ b/data/local/examples/header.inc.php
@@ -0,0 +1,4 @@
+<!--
+This header will be included (kind of) right after the <body> tag.
+Use it to prepend your own site's navigation if needed.
+-->
diff --git a/data/local/examples/logo.svg b/data/local/examples/logo.svg
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/data/local/examples/logo.svg
diff --git a/data/local/examples/style.css b/data/local/examples/style.css
new file mode 100644
index 000000000..846bd0118
--- /dev/null
+++ b/data/local/examples/style.css
@@ -0,0 +1,4 @@
+/*
+ * This style will be included after all other style sheets.
+ * Use it to override any CSS rule to suite your needs
+ */
diff --git a/data/tests/black_white.png b/data/tests/black_white.png
new file mode 100644
index 000000000..f15dfc646
--- /dev/null
+++ b/data/tests/black_white.png
Binary files differ
diff --git a/data/tests/exif-orientation-examples b/data/tests/exif-orientation-examples
new file mode 160000
+Subproject 85c6e142ee57d1c5c7a29b2efcd5980a584758e
diff --git a/data/tests/message1.bin b/data/tests/message1.bin
new file mode 100644
index 000000000..2df129a78
--- /dev/null
+++ b/data/tests/message1.bin
Binary files differ
diff --git a/data/tests/message2.bin b/data/tests/message2.bin
new file mode 100644
index 000000000..dfaf4d1e9
--- /dev/null
+++ b/data/tests/message2.bin
@@ -0,0 +1 @@
+Mh\ rw{roVJ=x>{(KnKU_BuIgm]`_ \ No newline at end of file
diff --git a/data/tests/simple.pdf b/data/tests/simple.pdf
new file mode 100644
index 000000000..85e541756
--- /dev/null
+++ b/data/tests/simple.pdf
Binary files differ
diff --git a/data/tests/small-file b/data/tests/small-file
new file mode 100644
index 000000000..9e730c42b
--- /dev/null
+++ b/data/tests/small-file
@@ -0,0 +1,3 @@
+This is just a small test file.
+
+Yes, it's really just that.
diff --git a/data/tests/{elapsed_time}.txt b/data/tests/{elapsed_time}.txt
new file mode 100644
index 000000000..40142d09c
--- /dev/null
+++ b/data/tests/{elapsed_time}.txt
@@ -0,0 +1 @@
+blub
diff --git a/data/uploads/.htaccess b/data/uploads/.htaccess
new file mode 100644
index 000000000..8d2f25636
--- /dev/null
+++ b/data/uploads/.htaccess
@@ -0,0 +1 @@
+deny from all
diff --git a/doc/api.md b/doc/api.md
new file mode 100644
index 000000000..3484acd2b
--- /dev/null
+++ b/doc/api.md
@@ -0,0 +1,161 @@
+# API
+
+**Table of Contents**
+
+- [General notes](#general-notes)
+ - [URLs](#urls)
+ - [Compatibility](#compatibility)
+ - [Unless stated otherwise ...](#unless-stated-otherwise-)
+ - [Access levels](#access-levels)
+- [Endpoints](#endpoints)
+ - [Examples](#examples)
+- [Error handling](#error-handling)
+ - [General errors](#general-errors)
+- [Overview over API versions](#overview-over-api-versions)
+
+The API provides programmatic access to upload, delete files, view the
+currently uploaded ones and combine them to multipastes, as well as functions
+to manage api keys. Responses are available in JSON.
+
+## General notes
+
+### URLs
+
+The URLs for API endpoints start with the base URL followed by `/api/`, the
+version supported by the client and the endpoint. For example:
+`https://paste.xinu.at/api/v1.0.0/some/endpoint`.
+
+The version number follows the [semantic versioning guidelines](http://semver.org/).
+The requested version number must be of the format `vX[.X[.X]]` with X being
+a positive number. `v1` and `v1.0` will both be treated as `v1.0.0`.
+
+The most recent API version is `v2.1.1`.
+
+### Compatibility
+
+The API will evolve by adding and removing endpoints, parameters and keywords.
+Unknown keywords should be treated gracefully by your application.
+
+Behavior not documented here should not be expected to be available and may be
+changed without notice.
+
+### Unless stated otherwise ...
+
+
+* ... requests should be sent via POST.
+* ... endpoints expect an apikey with access level `apikey` to be sent with the request.
+* ... requests should not be assumed to be atomic (i.e. data may be changed on the server despite an error being returned).
+
+
+* ... timestamps are returned as UNIX timestamps (seconds).
+* ... sizes are returned in bytes.
+* ... values are specific to the user owning the apikey (e.g. the `total_size` field of file/history).
+
+
+* ... errors will generate a response with `status=error`.
+* ... error messages may differ from those listed in the tables.
+* ... errors listed are only the most common ones (i.e. the lists are non-exhaustive).
+
+### Access levels
+
+An api key can have one of the following access levels. Levels further down in
+the table include those above themselves.
+
+| access-level | Comment |
+| ------------ | ------- |
+| basic | Allows only uploading of files |
+| apikey | Allows to delete uploads and view the history |
+| full | Allows everything |
+
+## Endpoints
+
+Documentation for specific endpoints can be found in `./doc/api/`:
+
+* [Documentation for the /file/ endpoints](api/file.md)
+* [Documentation for the /user/ endpoints](api/user.md)
+
+Responses will always contain a `status` field which can contain the following
+values: `success`, `error`. If the response does not contain the status field
+it should be regarded as invalid.
+
+If `status=success` the response will contain a `data` field which contains
+function specific data.
+
+
+```javascript
+// General definitions
+
+// Listed above
+access-level: String;
+
+// An api key
+apikey: String;
+
+// An ID that can be used to display a multipaste or a single file
+upload-id: String;
+
+
+// General success response
+responseSuccess = {
+ "status": "success",
+ "data": object or array, // Differs per endpoint. Refer to the specific endpoint documentation.
+}
+```
+
+### Examples
+
+For the examples given in the endpoint documentation, set the following
+variables in your shell. Please note that they and their values will show up in
+your shell history and in top/ps if used. Be careful on untrusted systems.
+
+```bash
+apikey="anApiKey"
+base="https://paste.xinu.at/api/v2.0.0"
+```
+
+## Error handling
+
+If `status=error` the response will be of the following format:
+
+```javascript
+// Error response format
+responseError = {
+ "status": "error",
+ "message": "A message that can be displayed to the user",
+ "error_id": "program/useable/error/id",
+ "data": object or array, // optional, only used if mentioned
+}
+```
+
+
+### General errors
+
+These are the most common errors that can be returned by any API call.
+
+| error_id | Message | Note |
+| -------- | ------- | ---- |
+| api/invalid-version | Invalid API version requested | Failed syntax check |
+| api/invalid-endpoint | Invalid endpoint requested | Failed syntax check |
+| api/version-not-supported | Requested API version is not supported | |
+| api/unknown-endpoint | Unknown endpoint requested | Likely a typo in your URL |
+| internal-error | An unhandled internal server error occured | |
+| user/api-login-failed | API key login failed | |
+| api/insufficient-permissions | Access denied: Access level too low | |
+| api/not-authenticated | Not authenticated | Likely no apikey was sent |
+
+## Overview over API versions
+
+| Version | Endpoint | Note |
+| ------- | -------- | ---- |
+| 2.2.0 | file/create_multipaste | Add paramter ''minimum-id-length'' to control the length of generated content id |
+| 2.2.0 | file/upload | Add parameter ''minimum-id-length'' to control the length of generated content id |
+| 2.1.1 | file/history | Empty objects (values of `items` and `multipaste_items`) are now always returned as {}. Before they were returned as [] |
+| 2.1.1 | file/delete | Empty objects (values of `errors` and `deleted`) are now always returned as {}. Before they were returned as [] |
+| 2.1.0 | file/history | Add ''item.thumbnail'' |
+| 2.0.0 | file/history | Add ''multipaste_item.date'' |
+| 2.0.0 | file/history | Remove private fields in response |
+| 1.4.0 | file/get_config | Add data.{max_input_vars,request_max_size} |
+| 1.3.0 | file/create_multipaste | Allow multipaste creation for basic access level |
+| 1.2.0 | user/delete_apikeys | Add this endpoint |
+| 1.1.0 | file/create_multipaste | Add url key to response |
+| 1.0.0 | * | Initial API version |
diff --git a/doc/api/file.md b/doc/api/file.md
new file mode 100644
index 000000000..0dcf6a8ad
--- /dev/null
+++ b/doc/api/file.md
@@ -0,0 +1,307 @@
+# /file API endpoints
+
+**Table of Contents**
+
+- [file/get_config](#fileget_config)
+- [file/upload](#fileupload)
+- [file/history](#filehistory)
+- [file/delete](#filedelete)
+- [file/create_multipaste](#filecreate_multipaste)
+
+## file/get_config
+
+Request method: GET
+This is a public method and does not require an apikey.
+
+Return some useful values that may differ between service installations/subsequent requests.
+
+Success response:
+```javascript
+// Success response
+responseSuccess.data = {
+ // Maximum size of a single file
+ "upload_max_size": int,
+
+ // Maximum number of files sent with one request
+ "max_files_per_request": int,
+
+ // Maximum number of variables sent with one request
+ // (be sure to account for the api key when using this)
+ "max_input_vars": int,
+
+ // Maximum size of a complete request
+ "request_max_size": int,
+}
+```
+
+Example:
+```
+> curl -s $base/file/get_config | json_pp
+{
+ "data" : {
+ "max_files_per_request" : 20,
+ "upload_max_size" : 1073741824,
+ "request_max_size" : 1073741824,
+ "max_input_vars" : 1000
+ },
+ "status" : "success"
+}
+```
+
+| Version | Change |
+| ------- | ------ |
+| 1.4.0 | Add data.{max_input_vars,request_max_size} |
+
+## file/upload
+
+Required access level: `basic`
+
+Upload a new file.
+
+| POST field | Type | Comment |
+| ---------- | ---- | ------- |
+| file[`<index>`] | File | Required. Arbitrary index. |
+| minimum-id-length | Int | Optional. Values >= 2 only |
+
+| error_id | Message | Note |
+| -------- | ------- | ---- |
+| file/no-file | No file was uploaded or unknown error occurred | |
+| file/bad-minimum-id-length | Invalid value passsed to bad-minimum-id-length | |
+| file/upload-verify | Failed to verify uploaded file(s) | This error provides additional detail |
+
+```javascript
+// Success response
+responseSuccess.data = {
+ "ids": [upload-id, ...],
+ "urls": [String, ...],
+}
+
+// Error file/upload-verify
+responseError.data = {
+ String-formfield: {
+ "filename": String, // from the request
+ "formfield": String-formfield, // from the request, this is the same as the key of this object
+ "message": String, // can be displayed to the user
+ },
+ ...
+}
+```
+
+Example:
+```
+> echo test | curl -s $base/file/upload -F apikey=$apikey -F "file=@-" | json_pp
+{
+ "status" : "success",
+ "data" : {
+ "ids" : [
+ "uu28"
+ ],
+ "urls" : [
+ "http://filebin.localhost/uu28/"
+ ]
+ }
+}
+```
+
+| Version | Change |
+| ------- | ------ |
+| 2.2.0 | Add parameter ''minimum-id-length'' to control the length of generated content id |
+
+## file/history
+
+Return the currently available files/multipastes.
+
+```javascript
+// Definitions
+item = {
+ "id": upload-id,
+ "filename": String,
+ "mimetype": String,
+ "date": Timestamp,
+ "hash": String,
+ "filesize": int,
+ "thumbnail": String, // URL. only set when there is a thumbnail available
+}
+
+multipaste_item = {
+ "url_id": upload-id,
+ "id": upload-id, // this references item.id described above
+ "date": Timestamp,
+}
+
+// Success response
+responseSuccess.data = {
+ "items": {item.id: item, ...},
+ "multipaste_items": {multipaste_item.url_id: multipaste_item, ...},
+ "total_size": int, // total size of all files (excluding duplicates)
+}
+```
+
+Example:
+```
+> curl -s $base/file/history -F apikey=$apikey | json_pp
+{
+ "status" : "success",
+ "data" : {
+ "multipaste_items" : {
+ "m-JcK" : {
+ "items" : {
+ "oeL" : {
+ "id" : "oeL"
+ },
+ "7kn" : {
+ "id" : "7kn"
+ }
+ },
+ "url_id" : "m-JcK",
+ "date" : "1444119317"
+ }
+ },
+ "total_size" : "164006",
+ "items" : {
+ "oeL" : {
+ "id" : "oeL",
+ "hash" : "098f6bcd4621d373cade4e832627b4f6",
+ "date" : "1444119317",
+ "filename" : "test2",
+ "filesize" : "4",
+ "mimetype" : "text/plain"
+ },
+ "7kn" : {
+ "date" : "1444119317",
+ "hash" : "6a72c253e8e9e6d01544f1c6b4573e6e",
+ "id" : "7kn",
+ "thumbnail" : "http://filebin.localhost/file/thumbnail/7kn",
+ "mimetype" : "image/jpeg",
+ "filesize" : "164001",
+ "filename" : "Relax.jpg"
+ },
+ "l7p" : {
+ "date" : "1444116077",
+ "hash" : "cfcd208495d565ef66e7dff9f98764da",
+ "id" : "l7p",
+ "mimetype" : "application/octet-stream",
+ "filesize" : "1",
+ "filename" : "stdin"
+ }
+ }
+ }
+}
+```
+
+| Version | Change |
+| ------- | ------ |
+| 2.0.0 | Add ''multipaste_item.date''. Remove ''multipaste_item.{multipaste_id,user_id}''. |
+| 2.1.0 | Add ''item.thumbnail'' |
+| 2.1.1 | Empty objects (values of `items` and `multipaste_items`) are now always returned as {}. Before they were returned as [] |
+
+## file/delete
+
+Delete files or multipastes. Multipastes containing deleted files will also be silently removed.
+
+Note: This function returns some errors in the success response.
+
+| POST field | Type | Comment |
+| ---------- | ---- | ------- |
+| ids[`<index>`] | upload-id | Required. Arbitrary index. |
+
+| error_id | Message | Note |
+| -------- | ------- | ---- |
+| file/delete/no-ids | No IDs specified | |
+
+```javascript
+// Success response
+responseSuccess.data = {
+ "errors": {
+ upload-id: {
+ "id": upload-id, // this is the same as the key of this object
+ "reason": String,
+ },
+ ...
+ },
+ "deleted": {
+ upload-id: {
+ "id": upload-id, // this is the same as the key of this object
+ },
+ ...
+ },
+ "total_count": int,
+ "deleted_count": int,
+}
+```
+
+
+Example:
+```
+> curl -s $base/file/delete -F apikey=$apikey -F "ids[1]=uu28" | json_pp
+{
+ "data" : {
+ "errors" : {},
+ "total_count" : 1,
+ "deleted" : {
+ "uu28" : {
+ "id" : "uu28"
+ }
+ },
+ "deleted_count" : 1
+ },
+ "status" : "success"
+}
+```
+
+| Version | Change |
+| ------- | ------ |
+| 2.1.1 | Empty objects (values of `errors` and `deleted`) are now always returned as {}. Before they were returned as [] |
+
+## file/create_multipaste
+
+Required access level: `basic`
+
+Create a new multipaste.
+
+| POST field | Type | Comment |
+| ---------- | ---- | ------- |
+| ids[`<index>`] | upload-id | Required. Arbitrary index. This only accepts IDs of files, not other multipastes. |
+| minimum-id-length | Int | Optional. Values >= 2 only |
+
+| error_id | Message | Note |
+| -------- | ------- | ---- |
+| file/bad-minimum-id-length | Invalid value passsed to bad-minimum-id-length | |
+| file/create_multipaste/no-ids | No IDs specified | |
+| file/create_multipaste/duplicate-id | Duplicate IDs are not supported | |
+| file/create_multipaste/verify-failed | Failed to verify ID(s) | This error provides additional detail |
+
+```javascript
+// Success response
+responseSuccess.data = {
+ "url_id": upload-id,
+ "url": String, // Complete URL to url_id
+}
+
+// Error file/create_multipaste/verify-failed
+responseError.data = {
+ upload-id: {
+ "id": upload-id, // this is the same as the key of this object
+ "reason": String,
+ },
+ ...
+}
+```
+
+Example:
+```
+> curl -s $base/file/create_multipaste -F apikey=$apikey -F "ids[1]=uu28" | json_pp
+{
+ "data" : {
+ "url" : "http://filebin.localhost/m-J250b/",
+ "url_id" : "m-J25Ob"
+ },
+ "status" : "success"
+}
+```
+
+| Version | Change |
+| ------- | ------ |
+| 1.1.0 | Add url key to response |
+| 1.3.0 | Change required access level from ''apikey'' to ''basic'' |
+| 2.2.0 | Add paramter ''minimum-id-length'' to control the length of generated content id |
diff --git a/doc/api/user.md b/doc/api/user.md
new file mode 100644
index 000000000..33959fcc2
--- /dev/null
+++ b/doc/api/user.md
@@ -0,0 +1,123 @@
+# /user API endpoints
+**Table of Contents**
+
+- [user/apikeys](#userapikeys)
+- [user/create_apikey](#usercreate_apikey)
+- [user/delete_apikey](#userdelete_apikey)
+
+## user/apikeys
+
+Required access level: `full`
+
+Return apikeys of the user.
+
+```javascript
+// Success response
+responseSuccess.data = {
+ "apikeys": {
+ apikey: {
+ "key": apikey, // this is the same as the key of this object
+ "created": Timestamp,
+ "comment": String,
+ "access_level": access-level,
+ },
+ ...
+ },
+]
+```
+
+Example:
+```
+> curl -s $base/user/apikeys -F apikey=$apikey | json_pp
+{
+ "data" : {
+ "apikeys" : {
+ "Sa71PVwKthRrrIEUIacqN9PNTouVQAWz" : {
+ "key" : "Sa71PVwKthRrrIEUIacqN9PNTouVQAWz",
+ "comment" : "fb-client flo@Marin",
+ "created" : 1378389775,
+ "access_level" : "full"
+ },
+ }
+ },
+ "status" : "success"
+}
+```
+
+## user/create_apikey
+
+Required access level: `full`
+
+Create a new apikey.
+
+This is the only endpoint that may be called without an apikey, but with username and password instead. Sending both, username/password and an api key results in undefined behaviour.
+
+| POST field | Type | Comment |
+| ---------- | ---- | ------- |
+| username | String | Required if not called with api key. |
+| password | String | Required if not called with api key. |
+| access_level | access-level | Required |
+| comment | String | Optional but recommended (username, hostname, client software name, ...). Maximum 255 chars. |
+
+
+```javascript
+// Success response
+responseSuccess.data = {
+ "new_key": String,
+}
+```
+
+Example:
+```
+> curl -s $base/user/create_apikey -F username=test -F password=test -F access_level=apikey -F "comment=This is a test key" | json_pp
+{
+ "data" : {
+ "new_key" : "2qXhd9E4ezBE53KiRtB5EE95r6m6ZeI1"
+ },
+ "status" : "success"
+}
+```
+
+## user/delete_apikey
+
+Required access level: `full`
+
+Delete an apikey.
+
+| POST field | Type | Comment |
+| ---------- | ---- | ------- |
+| delete_key | apikey | Key to delete |
+
+| error_id | Message | Note |
+| -------- | ------- | ---- |
+| user/delete_apikey/failed | Apikey deletion failed. Possibly wrong owner. | |
+
+```javascript
+// Success response
+responseSuccess.data = {
+ "deleted_keys": {
+ apikey: {
+ "key": apikey, // this is the same as the key of this object
+ },
+ },
+}
+```
+
+Example:
+```
+> curl -s $base/user/delete_apikey -F apikey=$apikey -F delete_key=o0fDrc0LF8Kemqb9qzXXaScGsz9XCegj | json_pp
+{
+ "data" : {
+ "deleted_keys" : {
+ "o0fDrc0LF8Kemqb9qzXXaScGsz9XCegj" : {
+ "key" : "o0fDrc0LF8Kemqb9qzXXaScGsz9XCegj"
+ }
+ }
+ },
+ "status" : "success"
+}
+```
+
+| Version | Change |
+| ------- | ------ |
+| 1.2.0 | Add this endpoint |
diff --git a/doc/setup.md b/doc/setup.md
new file mode 100644
index 000000000..c955437b2
--- /dev/null
+++ b/doc/setup.md
@@ -0,0 +1,28 @@
+# Setup
+
+For installation instructions follow `./INSTALL`.
+
+## Fancy URLs
+
+Set `$config['index_page'] = '';` in `application/config/config-local.php` and adjust your webserver's rewrite config.
+
+### Apache
+
+See the shipped htaccess.txt
+
+### Nginx
+
+```
+location / {
+ try_files $uri $uri/ @ee;
+}
+location @ee {
+ rewrite ^(.*) /index.php?$1 last;
+}
+```
+
+### Lighttpd
+
+```
+url.rewrite-if-not-file = ( "^(.*)$" => "/index.php/?$1" )
+```
diff --git a/docker/README.md b/docker/README.md
new file mode 100644
index 000000000..870591c9f
--- /dev/null
+++ b/docker/README.md
@@ -0,0 +1,43 @@
+# Filebin Docker Container
+
+## Filebin
+Filebin is a paste service developed by Florian Pritz [https://paste.xinu.at/](https://paste.xinu.at/)
+
+## Dockerfile
+[Dockerfile](https://github.com/Bluewind/filebin/blob/master/Dockerfile)
+
+## Ports
+The PHP webserver is listening on ```8080```
+
+## Volumes
+
+- **Uploaded Data:** uploaded files are saved to ```/var/lib/filebin/filebin/data/uploads```
+- **Advanced Configuration:** the configuration is located at ```/var/lib/filebin/filebin/application/config```
+
+## Environment Variables
+- **FB_DB_HOSTNAME:** the hostname of the mysql/mariadb server
+- **FB_DB_USERNAME:** the username for the mysql/mariadb server
+- **FB_DB_PASSWORD:** the password for the mysql/mariadb server
+- **FB_DB_DATABASE:** the database on the mysql/mariadb for Filebin
+
+- **FB_CONTACT_NAME:** Contact Name
+- **FB_CONTACT_MAIL:** Contact E-Mail (will be used as email for the first user)
+
+- **FB_SMTP_HOST:** Address of the SMTP Server
+- **FB_SMTP_PORT:** Port for SMTP Server (default 587)
+- **FB_SMTP_USER:** Username for SMTP Server (will also be used as mail from)
+- **FB_SMTP_PASSWORD:** Password for the SMTP Server Useraccount
+
+## First User
+The first user is **admin** with the password **admin**
+
+## Run
+
+### with docker-compose
+```bash
+docker-compose build
+docker-compose up
+```
+
+### with linked mysql/mariadb database server
+```docker run -ti --rm -p <port>:8080 --link mdb:mysql -e FB_DB_HOSTNAME=mysql -e FB_DB_USERNAME=filebin_usr -e FB_DB_PASSWORD=test -e FB_DB_DATABASE=filebin -e FB_CONTACT_NAME="John Doe" -e FB_CONTACT_MAIL="john.doe@localmail.local" sebastianrakel/filebin```
diff --git a/docker/add_user.sh b/docker/add_user.sh
new file mode 100755
index 000000000..88618746d
--- /dev/null
+++ b/docker/add_user.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+cd ${FILEBIN_DIR}
+echo "Creating initial user. If it exists, this will show an error message instead"
+printf "%s\n%s\n%s\n" admin ${FB_CONTACT_MAIL} admin | php index.php user add_user
diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml
new file mode 100644
index 000000000..e6975682f
--- /dev/null
+++ b/docker/docker-compose.yml
@@ -0,0 +1,30 @@
+version: '2'
+services:
+ mysql:
+ image: mysql
+ command: --default-authentication-plugin=mysql_native_password
+ environment:
+ - MYSQL_DATABASE=filebin
+ - MYSQL_USER=filebin
+ # TODO: can this be set to a random password?
+ - MYSQL_PASSWORD=filebin-docker-demo
+ - MYSQL_RANDOM_ROOT_PASSWORD=yes
+
+ filebin:
+ links:
+ - mysql
+ build: ..
+ ports:
+ - "8080:8080"
+ environment:
+ - FB_DB_HOSTNAME=mysql
+ - FB_DB_USERNAME=filebin
+ - FB_DB_PASSWORD=filebin-docker-demo
+ - FB_DB_DATABASE=filebin
+ - FB_CONTACT_NAME=John Doe
+ - FB_CONTACT_MAIL=root@example.local
+ - FB_SMTP_HOST=localhost
+ - FB_SMTP_PORT=587
+ - FB_SMTP_USER=webmaster@example.invalid
+ - FB_SMTP_PASSWORD=mysecretpassword
+
diff --git a/docker/filebin_starter.sh b/docker/filebin_starter.sh
new file mode 100755
index 000000000..38088537e
--- /dev/null
+++ b/docker/filebin_starter.sh
@@ -0,0 +1,83 @@
+#!/bin/bash
+
+#set -euo pipefail
+
+function set_mail_config() {
+cat <<EOF > ${FILEBIN_HOME_DIR}/msmtprc
+account filebinmail
+tls on
+tls_certcheck off
+auth on
+host ${FB_SMTP_HOST}
+port ${FB_SMTP_PORT}
+user ${FB_SMTP_USER}
+from ${FB_SMTP_USER}
+password ${FB_SMTP_PASSWORD}
+EOF
+
+chmod 600 ${FILEBIN_HOME_DIR}/msmtprc
+}
+
+function set_config() {
+ FB_ENCRYPTION_KEY=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c32`
+cat <<EOF >${FILEBIN_DIR}/application/config/config-local.php
+<?php
+\$config['base_url'] = 'http://127.0.0.1:8080/';
+\$config['encryption_key'] = '${FB_ENCRYPTION_KEY}';
+\$config['email_from'] = '${FB_SMTP_USER}';
+EOF
+}
+
+function set_database_config() {
+cat <<EOF >${FILEBIN_DIR}/application/config/database.php
+<?php
+defined('BASEPATH') OR exit('No direct script access allowed');
+\$active_group = 'default';
+\$query_builder = TRUE;
+
+\$db['default'] = array(
+ 'dsn' => 'mysql:host=${FB_DB_HOSTNAME};dbname=${FB_DB_DATABASE}',
+ 'hostname' => '',
+ 'port' => 3306,
+ 'username' => '${FB_DB_USERNAME}',
+ 'password' => '${FB_DB_PASSWORD}',
+ 'database' => '${FB_DB_DATABASE}',
+ 'dbdriver' => 'pdo',
+ 'dbprefix' => '',
+ 'pconnect' => FALSE,
+ 'db_debug' => TRUE,
+ 'char_set' => 'utf8mb4', // if you use postgres, set this to utf8
+ 'dbcollat' => 'utf8mb4_bin', // if you use postgres, set this to utf8_bin
+ 'swap_pre' => '',
+ 'encrypt' => FALSE,
+ 'compress' => FALSE,
+ 'stricton' => TRUE,
+ 'failover' => array(),
+ 'save_queries' => TRUE
+);
+EOF
+}
+
+# wait for DB to be ready
+while ! nc "$FB_DB_HOSTNAME" 3306 </dev/null >/dev/null; do
+ echo "Waiting for database"
+ sleep 0.5
+done
+
+set_config
+set_database_config
+set_mail_config
+
+CONTACT_INFO_FILE=${FILEBIN_DIR}/data/local/contact-info.php
+cp $FILEBIN_DIR/data/local/examples/contact-info.php ${CONTACT_INFO_FILE}
+
+sed -i "s/John Doe/${FB_CONTACT_NAME}/" ${CONTACT_INFO_FILE}
+sed -i "s/john.doe@example.com/${FB_CONTACT_MAIL}/" ${CONTACT_INFO_FILE}
+
+${FILEBIN_DIR}/scripts/install-git-hooks.sh
+${FILEBIN_DIR}/git-hooks/post-merge
+
+${FILEBIN_HOME_DIR}/add_user.sh
+
+cd $FILEBIN_DIR/public_html
+php -S 0.0.0.0:8080
diff --git a/extras/munin/filebin_stats b/extras/munin/filebin_stats
new file mode 100644
index 000000000..4396c3503
--- /dev/null
+++ b/extras/munin/filebin_stats
@@ -0,0 +1,25 @@
+#!/bin/bash
+#
+# Put something along those lines into your munin-node config
+#
+# [filebin_stats]
+# env.mysqlopts --defaults-file=/var/lib/munin/.my.cnf
+# env.database filebin
+
+case $1 in
+ config)
+ cat <<'EOM'
+graph_title FileBin
+graph_args --base 1024 --logarithmic --units=si
+graph_vlabel Space
+used.label Storage used
+dedup.label Storage saved by deduplication
+EOM
+ exit 0;;
+esac
+
+echo -n "used.value "
+mysql $mysqlopts -sr $database <<<"select coalesce(sum(filesize), 0) as 'Used storage' from file_storage;" || echo "a"
+
+echo -n "dedup.value "
+mysql $mysqlopts -sr $database <<<"select coalesce(sum((c - 1) * sub.filesize), 0) 'Space saved by deduplication' from (select fs.id, filesize, count(*) c from files join file_storage fs on fs.id = files.file_storage_id group by fs.id having c > 1 order by c) sub;" || echo "a"
diff --git a/git-hooks/post-merge b/git-hooks/post-merge
new file mode 100755
index 000000000..ffcaa5bcc
--- /dev/null
+++ b/git-hooks/post-merge
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+if [[ -z "$GIT_DIR" ]]; then
+ GIT_DIR="$(dirname "$(realpath "$0")")/../.git"
+fi
+
+cd "$GIT_DIR/.."
+
+changes=$(git diff --name-only @{1} 2> /dev/null)
+fresh_clone=$?
+
+# Exit if nothing has changed
+if [ ! $fresh_clone ] && [[ -z "$changes" ]]; then
+ exit
+fi
+
+if echo "$changes" | grep scripts/install-git-hooks.sh; then
+ scripts/install-git-hooks.sh
+fi
+
+composer install --no-dev
+
+# Make sure submodules are up to date
+git submodule update --init --recursive
+
+# Update databse
+php index.php tools update_database
+
+# Minify javascript
+if echo "$changes" | grep data/js/ > /dev/null; then
+ scripts/optimize_js.sh
+fi
+
+if [[ ! -f ./data/js/main.min.js ]]; then
+ scripts/optimize_js.sh
+fi
+
+# Show changes to NEWS
+git diff @{1} NEWS 2> /dev/null | cat
diff --git a/htaccess.txt b/htaccess.txt
new file mode 100644
index 000000000..5385c71b8
--- /dev/null
+++ b/htaccess.txt
@@ -0,0 +1,7 @@
+<IfModule mod_rewrite.c>
+ RewriteEngine on
+ RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
+ RewriteCond %{REQUEST_FILENAME} !-f
+ RewriteCond %{REQUEST_FILENAME} !-d
+ RewriteRule ^(.*)$ /index.php/?$1 [L]
+</IfModule>
diff --git a/index.php b/index.php
index 11f8c6281..43c87ba95 100644
--- a/index.php
+++ b/index.php
@@ -1,315 +1,10 @@
<?php
-/**
- * CodeIgniter
- *
- * An open source application development framework for PHP
- *
- * This content is released under the MIT License (MIT)
- *
- * Copyright (c) 2014 - 2019, British Columbia Institute of Technology
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- * @package CodeIgniter
- * @author EllisLab Dev Team
- * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
- * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
- * @license https://opensource.org/licenses/MIT MIT License
- * @link https://codeigniter.com
- * @since Version 1.0.0
- * @filesource
- */
-
/*
- *---------------------------------------------------------------
- * APPLICATION ENVIRONMENT
- *---------------------------------------------------------------
+ * Copyright 2015 Florian "Bluewind" Pritz <bluewind@server-speed.net>
*
- * You can load different configurations depending on your
- * current environment. Setting the environment also influences
- * things like logging and error reporting.
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
*
- * This can be set to anything, but default usage is:
- *
- * development
- * testing
- * production
- *
- * NOTE: If you change these, also change the error_reporting() code below
*/
- define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'development');
-/*
- *---------------------------------------------------------------
- * ERROR REPORTING
- *---------------------------------------------------------------
- *
- * Different environments will require different levels of error reporting.
- * By default development will show errors but testing and live will hide them.
- */
-switch (ENVIRONMENT)
-{
- case 'development':
- error_reporting(-1);
- ini_set('display_errors', 1);
- break;
-
- case 'testing':
- case 'production':
- ini_set('display_errors', 0);
- if (version_compare(PHP_VERSION, '5.3', '>='))
- {
- error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED);
- }
- else
- {
- error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_USER_NOTICE);
- }
- break;
-
- default:
- header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
- echo 'The application environment is not set correctly.';
- exit(1); // EXIT_ERROR
-}
-
-/*
- *---------------------------------------------------------------
- * SYSTEM DIRECTORY NAME
- *---------------------------------------------------------------
- *
- * This variable must contain the name of your "system" directory.
- * Set the path if it is not in the same directory as this file.
- */
- $system_path = 'system';
-
-/*
- *---------------------------------------------------------------
- * APPLICATION DIRECTORY NAME
- *---------------------------------------------------------------
- *
- * If you want this front controller to use a different "application"
- * directory than the default one you can set its name here. The directory
- * can also be renamed or relocated anywhere on your server. If you do,
- * use an absolute (full) server path.
- * For more info please see the user guide:
- *
- * https://codeigniter.com/userguide3/general/managing_apps.html
- *
- * NO TRAILING SLASH!
- */
- $application_folder = 'application';
-
-/*
- *---------------------------------------------------------------
- * VIEW DIRECTORY NAME
- *---------------------------------------------------------------
- *
- * If you want to move the view directory out of the application
- * directory, set the path to it here. The directory can be renamed
- * and relocated anywhere on your server. If blank, it will default
- * to the standard location inside your application directory.
- * If you do move this, use an absolute (full) server path.
- *
- * NO TRAILING SLASH!
- */
- $view_folder = '';
-
-
-/*
- * --------------------------------------------------------------------
- * DEFAULT CONTROLLER
- * --------------------------------------------------------------------
- *
- * Normally you will set your default controller in the routes.php file.
- * You can, however, force a custom routing by hard-coding a
- * specific controller class/function here. For most applications, you
- * WILL NOT set your routing here, but it's an option for those
- * special instances where you might want to override the standard
- * routing in a specific front controller that shares a common CI installation.
- *
- * IMPORTANT: If you set the routing here, NO OTHER controller will be
- * callable. In essence, this preference limits your application to ONE
- * specific controller. Leave the function name blank if you need
- * to call functions dynamically via the URI.
- *
- * Un-comment the $routing array below to use this feature
- */
- // The directory name, relative to the "controllers" directory. Leave blank
- // if your controller is not in a sub-directory within the "controllers" one
- // $routing['directory'] = '';
-
- // The controller class file name. Example: mycontroller
- // $routing['controller'] = '';
-
- // The controller function you wish to be called.
- // $routing['function'] = '';
-
-
-/*
- * -------------------------------------------------------------------
- * CUSTOM CONFIG VALUES
- * -------------------------------------------------------------------
- *
- * The $assign_to_config array below will be passed dynamically to the
- * config class when initialized. This allows you to set custom config
- * items or override any default config values found in the config.php file.
- * This can be handy as it permits you to share one application between
- * multiple front controller files, with each file containing different
- * config values.
- *
- * Un-comment the $assign_to_config array below to use this feature
- */
- // $assign_to_config['name_of_config_item'] = 'value of config item';
-
-
-
-// --------------------------------------------------------------------
-// END OF USER CONFIGURABLE SETTINGS. DO NOT EDIT BELOW THIS LINE
-// --------------------------------------------------------------------
-
-/*
- * ---------------------------------------------------------------
- * Resolve the system path for increased reliability
- * ---------------------------------------------------------------
- */
-
- // Set the current directory correctly for CLI requests
- if (defined('STDIN'))
- {
- chdir(dirname(__FILE__));
- }
-
- if (($_temp = realpath($system_path)) !== FALSE)
- {
- $system_path = $_temp.DIRECTORY_SEPARATOR;
- }
- else
- {
- // Ensure there's a trailing slash
- $system_path = strtr(
- rtrim($system_path, '/\\'),
- '/\\',
- DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR
- ).DIRECTORY_SEPARATOR;
- }
-
- // Is the system path correct?
- if ( ! is_dir($system_path))
- {
- header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
- echo 'Your system folder path does not appear to be set correctly. Please open the following file and correct this: '.pathinfo(__FILE__, PATHINFO_BASENAME);
- exit(3); // EXIT_CONFIG
- }
-
-/*
- * -------------------------------------------------------------------
- * Now that we know the path, set the main path constants
- * -------------------------------------------------------------------
- */
- // The name of THIS file
- define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
-
- // Path to the system directory
- define('BASEPATH', $system_path);
-
- // Path to the front controller (this file) directory
- define('FCPATH', dirname(__FILE__).DIRECTORY_SEPARATOR);
-
- // Name of the "system" directory
- define('SYSDIR', basename(BASEPATH));
-
- // The path to the "application" directory
- if (is_dir($application_folder))
- {
- if (($_temp = realpath($application_folder)) !== FALSE)
- {
- $application_folder = $_temp;
- }
- else
- {
- $application_folder = strtr(
- rtrim($application_folder, '/\\'),
- '/\\',
- DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR
- );
- }
- }
- elseif (is_dir(BASEPATH.$application_folder.DIRECTORY_SEPARATOR))
- {
- $application_folder = BASEPATH.strtr(
- trim($application_folder, '/\\'),
- '/\\',
- DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR
- );
- }
- else
- {
- header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
- echo 'Your application folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF;
- exit(3); // EXIT_CONFIG
- }
-
- define('APPPATH', $application_folder.DIRECTORY_SEPARATOR);
-
- // The path to the "views" directory
- if ( ! isset($view_folder[0]) && is_dir(APPPATH.'views'.DIRECTORY_SEPARATOR))
- {
- $view_folder = APPPATH.'views';
- }
- elseif (is_dir($view_folder))
- {
- if (($_temp = realpath($view_folder)) !== FALSE)
- {
- $view_folder = $_temp;
- }
- else
- {
- $view_folder = strtr(
- rtrim($view_folder, '/\\'),
- '/\\',
- DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR
- );
- }
- }
- elseif (is_dir(APPPATH.$view_folder.DIRECTORY_SEPARATOR))
- {
- $view_folder = APPPATH.strtr(
- trim($view_folder, '/\\'),
- '/\\',
- DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR
- );
- }
- else
- {
- header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
- echo 'Your view folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF;
- exit(3); // EXIT_CONFIG
- }
-
- define('VIEWPATH', $view_folder.DIRECTORY_SEPARATOR);
-
-/*
- * --------------------------------------------------------------------
- * LOAD THE BOOTSTRAP FILE
- * --------------------------------------------------------------------
- *
- * And away we go...
- */
-require_once BASEPATH.'core/CodeIgniter.php';
+include dirname(__FILE__).'/public_html/index.php';
diff --git a/phpdoc.dist.xml b/phpdoc.dist.xml
deleted file mode 100644
index 6dc58c259..000000000
--- a/phpdoc.dist.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<phpdoc>
- <title>CodeIgniter v3.0.0 API</title>
- <parser>
- <target>./api/</target>
- </parser>
- <transformer>
- <target>./api/</target>
- </transformer>
- <files>
- <directory>./system</directory>
- </files>
-
- <logging>
- <level>warn</level>
- <paths>
- <default>./api/log/{DATE}.log</default>
- <errors>./api/{DATE}.errors.log</errors>
- </paths>
- </logging>
-</phpdoc> \ No newline at end of file
diff --git a/public_html/data/css/asciinema-player.css b/public_html/data/css/asciinema-player.css
new file mode 100644
index 000000000..8d77df46e
--- /dev/null
+++ b/public_html/data/css/asciinema-player.css
@@ -0,0 +1,2563 @@
+.asciinema-player-wrapper {
+ position: relative;
+ text-align: center;
+ outline: none;
+}
+.asciinema-player-wrapper .title-bar {
+ display: none;
+ top: -78px;
+ transition: top 0.15s linear;
+ position: absolute;
+ left: 0;
+ right: 0;
+ box-sizing: content-box;
+ font-size: 20px;
+ line-height: 1em;
+ padding: 15px;
+ font-family: sans-serif;
+ color: white;
+ background-color: rgba(0, 0, 0, 0.8);
+}
+.asciinema-player-wrapper .title-bar img {
+ vertical-align: middle;
+ height: 48px;
+ margin-right: 16px;
+}
+.asciinema-player-wrapper .title-bar a {
+ color: white;
+ text-decoration: underline;
+}
+.asciinema-player-wrapper .title-bar a:hover {
+ text-decoration: none;
+}
+.asciinema-player-wrapper:fullscreen {
+ background-color: #000;
+ width: 100%;
+ height: 100%;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-justify-content: center;
+ justify-content: center;
+ -webkit-align-items: center;
+ align-items: center;
+}
+.asciinema-player-wrapper:fullscreen .asciinema-player {
+ position: static;
+}
+.asciinema-player-wrapper:fullscreen .title-bar {
+ display: initial;
+}
+.asciinema-player-wrapper:fullscreen.hud .title-bar {
+ top: 0;
+}
+.asciinema-player-wrapper:-webkit-full-screen {
+ background-color: #000;
+ width: 100%;
+ height: 100%;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-justify-content: center;
+ justify-content: center;
+ -webkit-align-items: center;
+ align-items: center;
+}
+.asciinema-player-wrapper:-webkit-full-screen .asciinema-player {
+ position: static;
+}
+.asciinema-player-wrapper:-webkit-full-screen .title-bar {
+ display: initial;
+}
+.asciinema-player-wrapper:-webkit-full-screen.hud .title-bar {
+ top: 0;
+}
+.asciinema-player-wrapper:-moz-full-screen {
+ background-color: #000;
+ width: 100%;
+ height: 100%;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-justify-content: center;
+ justify-content: center;
+ -webkit-align-items: center;
+ align-items: center;
+}
+.asciinema-player-wrapper:-moz-full-screen .asciinema-player {
+ position: static;
+}
+.asciinema-player-wrapper:-moz-full-screen .title-bar {
+ display: initial;
+}
+.asciinema-player-wrapper:-moz-full-screen.hud .title-bar {
+ top: 0;
+}
+.asciinema-player-wrapper:-ms-fullscreen {
+ background-color: #000;
+ width: 100%;
+ height: 100%;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-justify-content: center;
+ justify-content: center;
+ -webkit-align-items: center;
+ align-items: center;
+}
+.asciinema-player-wrapper:-ms-fullscreen .asciinema-player {
+ position: static;
+}
+.asciinema-player-wrapper:-ms-fullscreen .title-bar {
+ display: initial;
+}
+.asciinema-player-wrapper:-ms-fullscreen.hud .title-bar {
+ top: 0;
+}
+.asciinema-player-wrapper .asciinema-player {
+ text-align: left;
+ display: inline-block;
+ padding: 0px;
+ position: relative;
+ box-sizing: content-box;
+ -moz-box-sizing: content-box;
+ -webkit-box-sizing: content-box;
+ overflow: hidden;
+ max-width: 100%;
+}
+.asciinema-terminal {
+ box-sizing: content-box;
+ -moz-box-sizing: content-box;
+ -webkit-box-sizing: content-box;
+ overflow: hidden;
+ padding: 0;
+ margin: 0px;
+ display: block;
+ white-space: pre;
+ border: 0;
+ word-wrap: normal;
+ word-break: normal;
+ border-radius: 0;
+ border-style: solid;
+ cursor: text;
+ border-width: 0.5em;
+ font-family: Consolas, Menlo, 'Bitstream Vera Sans Mono', monospace, 'Powerline Symbols';
+ line-height: 1.3333333333em;
+}
+.asciinema-terminal .line {
+ letter-spacing: normal;
+ overflow: hidden;
+ height: 1.3333333333em;
+}
+.asciinema-terminal .line span {
+ padding: 0;
+ display: inline-block;
+ height: 1.3333333333em;
+}
+.asciinema-terminal .line {
+ display: block;
+ width: 200%;
+}
+.asciinema-terminal .bright {
+ font-weight: bold;
+}
+.asciinema-terminal .underline {
+ text-decoration: underline;
+}
+.asciinema-terminal .italic {
+ font-style: italic;
+}
+.asciinema-terminal.font-small {
+ font-size: 12px;
+}
+.asciinema-terminal.font-medium {
+ font-size: 18px;
+}
+.asciinema-terminal.font-big {
+ font-size: 24px;
+}
+.asciinema-player .control-bar {
+ width: 100%;
+ height: 32px;
+ background: rgba(0, 0, 0, 0.8);
+ /* no gradient fallback */
+ background: -moz-linear-gradient(top, rgba(0, 0, 0, 0.5) 0%, #000000 25%, #000000 100%);
+ /* FF3.6-15 */
+ background: -webkit-linear-gradient(top, rgba(0, 0, 0, 0.5) 0%, #000000 25%, #000000 100%);
+ /* Chrome10-25,Safari5.1-6 */
+ background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5) 0%, #000000 25%, #000000 100%);
+ /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
+ color: #bbbbbb;
+ box-sizing: content-box;
+ line-height: 1;
+ position: absolute;
+ bottom: -35px;
+ left: 0;
+ transition: bottom 0.15s linear;
+}
+.asciinema-player .control-bar * {
+ box-sizing: inherit;
+ font-size: 0;
+}
+.asciinema-player .control-bar svg.icon path {
+ fill: #bbbbbb;
+}
+.asciinema-player .control-bar .playback-button {
+ display: block;
+ float: left;
+ cursor: pointer;
+ height: 12px;
+ width: 12px;
+ padding: 10px;
+}
+.asciinema-player .control-bar .playback-button svg {
+ height: 12px;
+ width: 12px;
+}
+.asciinema-player .control-bar .timer {
+ display: block;
+ float: left;
+ width: 50px;
+ height: 100%;
+ text-align: center;
+ font-family: Helvetica, Arial, sans-serif;
+ font-size: 11px;
+ font-weight: bold;
+ line-height: 32px;
+ cursor: default;
+}
+.asciinema-player .control-bar .timer span {
+ display: inline-block;
+ font-size: inherit;
+}
+.asciinema-player .control-bar .timer .time-remaining {
+ display: none;
+}
+.asciinema-player .control-bar .timer:hover .time-elapsed {
+ display: none;
+}
+.asciinema-player .control-bar .timer:hover .time-remaining {
+ display: inline;
+}
+.asciinema-player .control-bar .progressbar {
+ display: block;
+ overflow: hidden;
+ height: 100%;
+ padding: 0 10px;
+}
+.asciinema-player .control-bar .progressbar .bar {
+ display: block;
+ cursor: pointer;
+ height: 100%;
+ padding-top: 15px;
+ font-size: 0;
+}
+.asciinema-player .control-bar .progressbar .bar .gutter {
+ display: block;
+ height: 3px;
+ background-color: #333;
+}
+.asciinema-player .control-bar .progressbar .bar .gutter span {
+ display: inline-block;
+ height: 100%;
+ background-color: #bbbbbb;
+ border-radius: 3px;
+}
+.asciinema-player .control-bar.live .progressbar .bar {
+ cursor: default;
+}
+.asciinema-player .control-bar .fullscreen-button {
+ display: block;
+ float: right;
+ width: 14px;
+ height: 14px;
+ padding: 9px;
+ cursor: pointer;
+}
+.asciinema-player .control-bar .fullscreen-button svg {
+ width: 14px;
+ height: 14px;
+}
+.asciinema-player .control-bar .fullscreen-button svg:first-child {
+ display: inline;
+}
+.asciinema-player .control-bar .fullscreen-button svg:last-child {
+ display: none;
+}
+.asciinema-player-wrapper.hud .control-bar {
+ bottom: 0px;
+}
+.asciinema-player-wrapper:fullscreen .fullscreen-button svg:first-child {
+ display: none;
+}
+.asciinema-player-wrapper:fullscreen .fullscreen-button svg:last-child {
+ display: inline;
+}
+.asciinema-player-wrapper:-webkit-full-screen .fullscreen-button svg:first-child {
+ display: none;
+}
+.asciinema-player-wrapper:-webkit-full-screen .fullscreen-button svg:last-child {
+ display: inline;
+}
+.asciinema-player-wrapper:-moz-full-screen .fullscreen-button svg:first-child {
+ display: none;
+}
+.asciinema-player-wrapper:-moz-full-screen .fullscreen-button svg:last-child {
+ display: inline;
+}
+.asciinema-player-wrapper:-ms-fullscreen .fullscreen-button svg:first-child {
+ display: none;
+}
+.asciinema-player-wrapper:-ms-fullscreen .fullscreen-button svg:last-child {
+ display: inline;
+}
+.asciinema-player .loading {
+ z-index: 10;
+ background-repeat: no-repeat;
+ background-position: center;
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 32px;
+ background-color: rgba(0, 0, 0, 0.5);
+}
+.asciinema-player .start-prompt {
+ z-index: 10;
+ background-repeat: no-repeat;
+ background-position: center;
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 32px;
+ z-index: 20;
+ cursor: pointer;
+}
+.asciinema-player .start-prompt .play-button {
+ font-size: 0px;
+}
+.asciinema-player .start-prompt .play-button {
+ position: absolute;
+ left: 0;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ text-align: center;
+ color: white;
+ display: table;
+ width: 100%;
+ height: 100%;
+}
+.asciinema-player .start-prompt .play-button div {
+ vertical-align: middle;
+ display: table-cell;
+}
+.asciinema-player .start-prompt .play-button div span {
+ width: 96px;
+ height: 96px;
+ display: inline-block;
+}
+@-webkit-keyframes expand {
+ 0% {
+ -webkit-transform: scale(0);
+ }
+ 50% {
+ -webkit-transform: scale(1);
+ }
+ 100% {
+ z-index: 1;
+ }
+}
+@-moz-keyframes expand {
+ 0% {
+ -moz-transform: scale(0);
+ }
+ 50% {
+ -moz-transform: scale(1);
+ }
+ 100% {
+ z-index: 1;
+ }
+}
+@-o-keyframes expand {
+ 0% {
+ -o-transform: scale(0);
+ }
+ 50% {
+ -o-transform: scale(1);
+ }
+ 100% {
+ z-index: 1;
+ }
+}
+@keyframes expand {
+ 0% {
+ transform: scale(0);
+ }
+ 50% {
+ transform: scale(1);
+ }
+ 100% {
+ z-index: 1;
+ }
+}
+.loader {
+ position: absolute;
+ left: 50%;
+ top: 50%;
+ margin: -20px 0 0 -20px;
+ background-color: white;
+ border-radius: 50%;
+ box-shadow: 0 0 0 6.66667px #141414;
+ width: 40px;
+ height: 40px;
+}
+.loader:before,
+.loader:after {
+ content: "";
+ position: absolute;
+ left: 50%;
+ top: 50%;
+ display: block;
+ margin: -21px 0 0 -21px;
+ border-radius: 50%;
+ z-index: 2;
+ width: 42px;
+ height: 42px;
+}
+.loader:before {
+ background-color: #141414;
+ -webkit-animation: expand 1.6s linear infinite both;
+ -moz-animation: expand 1.6s linear infinite both;
+ animation: expand 1.6s linear infinite both;
+}
+.loader:after {
+ background-color: white;
+ -webkit-animation: expand 1.6s linear 0.8s infinite both;
+ -moz-animation: expand 1.6s linear 0.8s infinite both;
+ animation: expand 1.6s linear 0.8s infinite both;
+}
+.asciinema-terminal .fg-16 {
+ color: #000000;
+}
+.asciinema-terminal .bg-16 {
+ background-color: #000000;
+}
+.asciinema-terminal .fg-17 {
+ color: #00005f;
+}
+.asciinema-terminal .bg-17 {
+ background-color: #00005f;
+}
+.asciinema-terminal .fg-18 {
+ color: #000087;
+}
+.asciinema-terminal .bg-18 {
+ background-color: #000087;
+}
+.asciinema-terminal .fg-19 {
+ color: #0000af;
+}
+.asciinema-terminal .bg-19 {
+ background-color: #0000af;
+}
+.asciinema-terminal .fg-20 {
+ color: #0000d7;
+}
+.asciinema-terminal .bg-20 {
+ background-color: #0000d7;
+}
+.asciinema-terminal .fg-21 {
+ color: #0000ff;
+}
+.asciinema-terminal .bg-21 {
+ background-color: #0000ff;
+}
+.asciinema-terminal .fg-22 {
+ color: #005f00;
+}
+.asciinema-terminal .bg-22 {
+ background-color: #005f00;
+}
+.asciinema-terminal .fg-23 {
+ color: #005f5f;
+}
+.asciinema-terminal .bg-23 {
+ background-color: #005f5f;
+}
+.asciinema-terminal .fg-24 {
+ color: #005f87;
+}
+.asciinema-terminal .bg-24 {
+ background-color: #005f87;
+}
+.asciinema-terminal .fg-25 {
+ color: #005faf;
+}
+.asciinema-terminal .bg-25 {
+ background-color: #005faf;
+}
+.asciinema-terminal .fg-26 {
+ color: #005fd7;
+}
+.asciinema-terminal .bg-26 {
+ background-color: #005fd7;
+}
+.asciinema-terminal .fg-27 {
+ color: #005fff;
+}
+.asciinema-terminal .bg-27 {
+ background-color: #005fff;
+}
+.asciinema-terminal .fg-28 {
+ color: #008700;
+}
+.asciinema-terminal .bg-28 {
+ background-color: #008700;
+}
+.asciinema-terminal .fg-29 {
+ color: #00875f;
+}
+.asciinema-terminal .bg-29 {
+ background-color: #00875f;
+}
+.asciinema-terminal .fg-30 {
+ color: #008787;
+}
+.asciinema-terminal .bg-30 {
+ background-color: #008787;
+}
+.asciinema-terminal .fg-31 {
+ color: #0087af;
+}
+.asciinema-terminal .bg-31 {
+ background-color: #0087af;
+}
+.asciinema-terminal .fg-32 {
+ color: #0087d7;
+}
+.asciinema-terminal .bg-32 {
+ background-color: #0087d7;
+}
+.asciinema-terminal .fg-33 {
+ color: #0087ff;
+}
+.asciinema-terminal .bg-33 {
+ background-color: #0087ff;
+}
+.asciinema-terminal .fg-34 {
+ color: #00af00;
+}
+.asciinema-terminal .bg-34 {
+ background-color: #00af00;
+}
+.asciinema-terminal .fg-35 {
+ color: #00af5f;
+}
+.asciinema-terminal .bg-35 {
+ background-color: #00af5f;
+}
+.asciinema-terminal .fg-36 {
+ color: #00af87;
+}
+.asciinema-terminal .bg-36 {
+ background-color: #00af87;
+}
+.asciinema-terminal .fg-37 {
+ color: #00afaf;
+}
+.asciinema-terminal .bg-37 {
+ background-color: #00afaf;
+}
+.asciinema-terminal .fg-38 {
+ color: #00afd7;
+}
+.asciinema-terminal .bg-38 {
+ background-color: #00afd7;
+}
+.asciinema-terminal .fg-39 {
+ color: #00afff;
+}
+.asciinema-terminal .bg-39 {
+ background-color: #00afff;
+}
+.asciinema-terminal .fg-40 {
+ color: #00d700;
+}
+.asciinema-terminal .bg-40 {
+ background-color: #00d700;
+}
+.asciinema-terminal .fg-41 {
+ color: #00d75f;
+}
+.asciinema-terminal .bg-41 {
+ background-color: #00d75f;
+}
+.asciinema-terminal .fg-42 {
+ color: #00d787;
+}
+.asciinema-terminal .bg-42 {
+ background-color: #00d787;
+}
+.asciinema-terminal .fg-43 {
+ color: #00d7af;
+}
+.asciinema-terminal .bg-43 {
+ background-color: #00d7af;
+}
+.asciinema-terminal .fg-44 {
+ color: #00d7d7;
+}
+.asciinema-terminal .bg-44 {
+ background-color: #00d7d7;
+}
+.asciinema-terminal .fg-45 {
+ color: #00d7ff;
+}
+.asciinema-terminal .bg-45 {
+ background-color: #00d7ff;
+}
+.asciinema-terminal .fg-46 {
+ color: #00ff00;
+}
+.asciinema-terminal .bg-46 {
+ background-color: #00ff00;
+}
+.asciinema-terminal .fg-47 {
+ color: #00ff5f;
+}
+.asciinema-terminal .bg-47 {
+ background-color: #00ff5f;
+}
+.asciinema-terminal .fg-48 {
+ color: #00ff87;
+}
+.asciinema-terminal .bg-48 {
+ background-color: #00ff87;
+}
+.asciinema-terminal .fg-49 {
+ color: #00ffaf;
+}
+.asciinema-terminal .bg-49 {
+ background-color: #00ffaf;
+}
+.asciinema-terminal .fg-50 {
+ color: #00ffd7;
+}
+.asciinema-terminal .bg-50 {
+ background-color: #00ffd7;
+}
+.asciinema-terminal .fg-51 {
+ color: #00ffff;
+}
+.asciinema-terminal .bg-51 {
+ background-color: #00ffff;
+}
+.asciinema-terminal .fg-52 {
+ color: #5f0000;
+}
+.asciinema-terminal .bg-52 {
+ background-color: #5f0000;
+}
+.asciinema-terminal .fg-53 {
+ color: #5f005f;
+}
+.asciinema-terminal .bg-53 {
+ background-color: #5f005f;
+}
+.asciinema-terminal .fg-54 {
+ color: #5f0087;
+}
+.asciinema-terminal .bg-54 {
+ background-color: #5f0087;
+}
+.asciinema-terminal .fg-55 {
+ color: #5f00af;
+}
+.asciinema-terminal .bg-55 {
+ background-color: #5f00af;
+}
+.asciinema-terminal .fg-56 {
+ color: #5f00d7;
+}
+.asciinema-terminal .bg-56 {
+ background-color: #5f00d7;
+}
+.asciinema-terminal .fg-57 {
+ color: #5f00ff;
+}
+.asciinema-terminal .bg-57 {
+ background-color: #5f00ff;
+}
+.asciinema-terminal .fg-58 {
+ color: #5f5f00;
+}
+.asciinema-terminal .bg-58 {
+ background-color: #5f5f00;
+}
+.asciinema-terminal .fg-59 {
+ color: #5f5f5f;
+}
+.asciinema-terminal .bg-59 {
+ background-color: #5f5f5f;
+}
+.asciinema-terminal .fg-60 {
+ color: #5f5f87;
+}
+.asciinema-terminal .bg-60 {
+ background-color: #5f5f87;
+}
+.asciinema-terminal .fg-61 {
+ color: #5f5faf;
+}
+.asciinema-terminal .bg-61 {
+ background-color: #5f5faf;
+}
+.asciinema-terminal .fg-62 {
+ color: #5f5fd7;
+}
+.asciinema-terminal .bg-62 {
+ background-color: #5f5fd7;
+}
+.asciinema-terminal .fg-63 {
+ color: #5f5fff;
+}
+.asciinema-terminal .bg-63 {
+ background-color: #5f5fff;
+}
+.asciinema-terminal .fg-64 {
+ color: #5f8700;
+}
+.asciinema-terminal .bg-64 {
+ background-color: #5f8700;
+}
+.asciinema-terminal .fg-65 {
+ color: #5f875f;
+}
+.asciinema-terminal .bg-65 {
+ background-color: #5f875f;
+}
+.asciinema-terminal .fg-66 {
+ color: #5f8787;
+}
+.asciinema-terminal .bg-66 {
+ background-color: #5f8787;
+}
+.asciinema-terminal .fg-67 {
+ color: #5f87af;
+}
+.asciinema-terminal .bg-67 {
+ background-color: #5f87af;
+}
+.asciinema-terminal .fg-68 {
+ color: #5f87d7;
+}
+.asciinema-terminal .bg-68 {
+ background-color: #5f87d7;
+}
+.asciinema-terminal .fg-69 {
+ color: #5f87ff;
+}
+.asciinema-terminal .bg-69 {
+ background-color: #5f87ff;
+}
+.asciinema-terminal .fg-70 {
+ color: #5faf00;
+}
+.asciinema-terminal .bg-70 {
+ background-color: #5faf00;
+}
+.asciinema-terminal .fg-71 {
+ color: #5faf5f;
+}
+.asciinema-terminal .bg-71 {
+ background-color: #5faf5f;
+}
+.asciinema-terminal .fg-72 {
+ color: #5faf87;
+}
+.asciinema-terminal .bg-72 {
+ background-color: #5faf87;
+}
+.asciinema-terminal .fg-73 {
+ color: #5fafaf;
+}
+.asciinema-terminal .bg-73 {
+ background-color: #5fafaf;
+}
+.asciinema-terminal .fg-74 {
+ color: #5fafd7;
+}
+.asciinema-terminal .bg-74 {
+ background-color: #5fafd7;
+}
+.asciinema-terminal .fg-75 {
+ color: #5fafff;
+}
+.asciinema-terminal .bg-75 {
+ background-color: #5fafff;
+}
+.asciinema-terminal .fg-76 {
+ color: #5fd700;
+}
+.asciinema-terminal .bg-76 {
+ background-color: #5fd700;
+}
+.asciinema-terminal .fg-77 {
+ color: #5fd75f;
+}
+.asciinema-terminal .bg-77 {
+ background-color: #5fd75f;
+}
+.asciinema-terminal .fg-78 {
+ color: #5fd787;
+}
+.asciinema-terminal .bg-78 {
+ background-color: #5fd787;
+}
+.asciinema-terminal .fg-79 {
+ color: #5fd7af;
+}
+.asciinema-terminal .bg-79 {
+ background-color: #5fd7af;
+}
+.asciinema-terminal .fg-80 {
+ color: #5fd7d7;
+}
+.asciinema-terminal .bg-80 {
+ background-color: #5fd7d7;
+}
+.asciinema-terminal .fg-81 {
+ color: #5fd7ff;
+}
+.asciinema-terminal .bg-81 {
+ background-color: #5fd7ff;
+}
+.asciinema-terminal .fg-82 {
+ color: #5fff00;
+}
+.asciinema-terminal .bg-82 {
+ background-color: #5fff00;
+}
+.asciinema-terminal .fg-83 {
+ color: #5fff5f;
+}
+.asciinema-terminal .bg-83 {
+ background-color: #5fff5f;
+}
+.asciinema-terminal .fg-84 {
+ color: #5fff87;
+}
+.asciinema-terminal .bg-84 {
+ background-color: #5fff87;
+}
+.asciinema-terminal .fg-85 {
+ color: #5fffaf;
+}
+.asciinema-terminal .bg-85 {
+ background-color: #5fffaf;
+}
+.asciinema-terminal .fg-86 {
+ color: #5fffd7;
+}
+.asciinema-terminal .bg-86 {
+ background-color: #5fffd7;
+}
+.asciinema-terminal .fg-87 {
+ color: #5fffff;
+}
+.asciinema-terminal .bg-87 {
+ background-color: #5fffff;
+}
+.asciinema-terminal .fg-88 {
+ color: #870000;
+}
+.asciinema-terminal .bg-88 {
+ background-color: #870000;
+}
+.asciinema-terminal .fg-89 {
+ color: #87005f;
+}
+.asciinema-terminal .bg-89 {
+ background-color: #87005f;
+}
+.asciinema-terminal .fg-90 {
+ color: #870087;
+}
+.asciinema-terminal .bg-90 {
+ background-color: #870087;
+}
+.asciinema-terminal .fg-91 {
+ color: #8700af;
+}
+.asciinema-terminal .bg-91 {
+ background-color: #8700af;
+}
+.asciinema-terminal .fg-92 {
+ color: #8700d7;
+}
+.asciinema-terminal .bg-92 {
+ background-color: #8700d7;
+}
+.asciinema-terminal .fg-93 {
+ color: #8700ff;
+}
+.asciinema-terminal .bg-93 {
+ background-color: #8700ff;
+}
+.asciinema-terminal .fg-94 {
+ color: #875f00;
+}
+.asciinema-terminal .bg-94 {
+ background-color: #875f00;
+}
+.asciinema-terminal .fg-95 {
+ color: #875f5f;
+}
+.asciinema-terminal .bg-95 {
+ background-color: #875f5f;
+}
+.asciinema-terminal .fg-96 {
+ color: #875f87;
+}
+.asciinema-terminal .bg-96 {
+ background-color: #875f87;
+}
+.asciinema-terminal .fg-97 {
+ color: #875faf;
+}
+.asciinema-terminal .bg-97 {
+ background-color: #875faf;
+}
+.asciinema-terminal .fg-98 {
+ color: #875fd7;
+}
+.asciinema-terminal .bg-98 {
+ background-color: #875fd7;
+}
+.asciinema-terminal .fg-99 {
+ color: #875fff;
+}
+.asciinema-terminal .bg-99 {
+ background-color: #875fff;
+}
+.asciinema-terminal .fg-100 {
+ color: #878700;
+}
+.asciinema-terminal .bg-100 {
+ background-color: #878700;
+}
+.asciinema-terminal .fg-101 {
+ color: #87875f;
+}
+.asciinema-terminal .bg-101 {
+ background-color: #87875f;
+}
+.asciinema-terminal .fg-102 {
+ color: #878787;
+}
+.asciinema-terminal .bg-102 {
+ background-color: #878787;
+}
+.asciinema-terminal .fg-103 {
+ color: #8787af;
+}
+.asciinema-terminal .bg-103 {
+ background-color: #8787af;
+}
+.asciinema-terminal .fg-104 {
+ color: #8787d7;
+}
+.asciinema-terminal .bg-104 {
+ background-color: #8787d7;
+}
+.asciinema-terminal .fg-105 {
+ color: #8787ff;
+}
+.asciinema-terminal .bg-105 {
+ background-color: #8787ff;
+}
+.asciinema-terminal .fg-106 {
+ color: #87af00;
+}
+.asciinema-terminal .bg-106 {
+ background-color: #87af00;
+}
+.asciinema-terminal .fg-107 {
+ color: #87af5f;
+}
+.asciinema-terminal .bg-107 {
+ background-color: #87af5f;
+}
+.asciinema-terminal .fg-108 {
+ color: #87af87;
+}
+.asciinema-terminal .bg-108 {
+ background-color: #87af87;
+}
+.asciinema-terminal .fg-109 {
+ color: #87afaf;
+}
+.asciinema-terminal .bg-109 {
+ background-color: #87afaf;
+}
+.asciinema-terminal .fg-110 {
+ color: #87afd7;
+}
+.asciinema-terminal .bg-110 {
+ background-color: #87afd7;
+}
+.asciinema-terminal .fg-111 {
+ color: #87afff;
+}
+.asciinema-terminal .bg-111 {
+ background-color: #87afff;
+}
+.asciinema-terminal .fg-112 {
+ color: #87d700;
+}
+.asciinema-terminal .bg-112 {
+ background-color: #87d700;
+}
+.asciinema-terminal .fg-113 {
+ color: #87d75f;
+}
+.asciinema-terminal .bg-113 {
+ background-color: #87d75f;
+}
+.asciinema-terminal .fg-114 {
+ color: #87d787;
+}
+.asciinema-terminal .bg-114 {
+ background-color: #87d787;
+}
+.asciinema-terminal .fg-115 {
+ color: #87d7af;
+}
+.asciinema-terminal .bg-115 {
+ background-color: #87d7af;
+}
+.asciinema-terminal .fg-116 {
+ color: #87d7d7;
+}
+.asciinema-terminal .bg-116 {
+ background-color: #87d7d7;
+}
+.asciinema-terminal .fg-117 {
+ color: #87d7ff;
+}
+.asciinema-terminal .bg-117 {
+ background-color: #87d7ff;
+}
+.asciinema-terminal .fg-118 {
+ color: #87ff00;
+}
+.asciinema-terminal .bg-118 {
+ background-color: #87ff00;
+}
+.asciinema-terminal .fg-119 {
+ color: #87ff5f;
+}
+.asciinema-terminal .bg-119 {
+ background-color: #87ff5f;
+}
+.asciinema-terminal .fg-120 {
+ color: #87ff87;
+}
+.asciinema-terminal .bg-120 {
+ background-color: #87ff87;
+}
+.asciinema-terminal .fg-121 {
+ color: #87ffaf;
+}
+.asciinema-terminal .bg-121 {
+ background-color: #87ffaf;
+}
+.asciinema-terminal .fg-122 {
+ color: #87ffd7;
+}
+.asciinema-terminal .bg-122 {
+ background-color: #87ffd7;
+}
+.asciinema-terminal .fg-123 {
+ color: #87ffff;
+}
+.asciinema-terminal .bg-123 {
+ background-color: #87ffff;
+}
+.asciinema-terminal .fg-124 {
+ color: #af0000;
+}
+.asciinema-terminal .bg-124 {
+ background-color: #af0000;
+}
+.asciinema-terminal .fg-125 {
+ color: #af005f;
+}
+.asciinema-terminal .bg-125 {
+ background-color: #af005f;
+}
+.asciinema-terminal .fg-126 {
+ color: #af0087;
+}
+.asciinema-terminal .bg-126 {
+ background-color: #af0087;
+}
+.asciinema-terminal .fg-127 {
+ color: #af00af;
+}
+.asciinema-terminal .bg-127 {
+ background-color: #af00af;
+}
+.asciinema-terminal .fg-128 {
+ color: #af00d7;
+}
+.asciinema-terminal .bg-128 {
+ background-color: #af00d7;
+}
+.asciinema-terminal .fg-129 {
+ color: #af00ff;
+}
+.asciinema-terminal .bg-129 {
+ background-color: #af00ff;
+}
+.asciinema-terminal .fg-130 {
+ color: #af5f00;
+}
+.asciinema-terminal .bg-130 {
+ background-color: #af5f00;
+}
+.asciinema-terminal .fg-131 {
+ color: #af5f5f;
+}
+.asciinema-terminal .bg-131 {
+ background-color: #af5f5f;
+}
+.asciinema-terminal .fg-132 {
+ color: #af5f87;
+}
+.asciinema-terminal .bg-132 {
+ background-color: #af5f87;
+}
+.asciinema-terminal .fg-133 {
+ color: #af5faf;
+}
+.asciinema-terminal .bg-133 {
+ background-color: #af5faf;
+}
+.asciinema-terminal .fg-134 {
+ color: #af5fd7;
+}
+.asciinema-terminal .bg-134 {
+ background-color: #af5fd7;
+}
+.asciinema-terminal .fg-135 {
+ color: #af5fff;
+}
+.asciinema-terminal .bg-135 {
+ background-color: #af5fff;
+}
+.asciinema-terminal .fg-136 {
+ color: #af8700;
+}
+.asciinema-terminal .bg-136 {
+ background-color: #af8700;
+}
+.asciinema-terminal .fg-137 {
+ color: #af875f;
+}
+.asciinema-terminal .bg-137 {
+ background-color: #af875f;
+}
+.asciinema-terminal .fg-138 {
+ color: #af8787;
+}
+.asciinema-terminal .bg-138 {
+ background-color: #af8787;
+}
+.asciinema-terminal .fg-139 {
+ color: #af87af;
+}
+.asciinema-terminal .bg-139 {
+ background-color: #af87af;
+}
+.asciinema-terminal .fg-140 {
+ color: #af87d7;
+}
+.asciinema-terminal .bg-140 {
+ background-color: #af87d7;
+}
+.asciinema-terminal .fg-141 {
+ color: #af87ff;
+}
+.asciinema-terminal .bg-141 {
+ background-color: #af87ff;
+}
+.asciinema-terminal .fg-142 {
+ color: #afaf00;
+}
+.asciinema-terminal .bg-142 {
+ background-color: #afaf00;
+}
+.asciinema-terminal .fg-143 {
+ color: #afaf5f;
+}
+.asciinema-terminal .bg-143 {
+ background-color: #afaf5f;
+}
+.asciinema-terminal .fg-144 {
+ color: #afaf87;
+}
+.asciinema-terminal .bg-144 {
+ background-color: #afaf87;
+}
+.asciinema-terminal .fg-145 {
+ color: #afafaf;
+}
+.asciinema-terminal .bg-145 {
+ background-color: #afafaf;
+}
+.asciinema-terminal .fg-146 {
+ color: #afafd7;
+}
+.asciinema-terminal .bg-146 {
+ background-color: #afafd7;
+}
+.asciinema-terminal .fg-147 {
+ color: #afafff;
+}
+.asciinema-terminal .bg-147 {
+ background-color: #afafff;
+}
+.asciinema-terminal .fg-148 {
+ color: #afd700;
+}
+.asciinema-terminal .bg-148 {
+ background-color: #afd700;
+}
+.asciinema-terminal .fg-149 {
+ color: #afd75f;
+}
+.asciinema-terminal .bg-149 {
+ background-color: #afd75f;
+}
+.asciinema-terminal .fg-150 {
+ color: #afd787;
+}
+.asciinema-terminal .bg-150 {
+ background-color: #afd787;
+}
+.asciinema-terminal .fg-151 {
+ color: #afd7af;
+}
+.asciinema-terminal .bg-151 {
+ background-color: #afd7af;
+}
+.asciinema-terminal .fg-152 {
+ color: #afd7d7;
+}
+.asciinema-terminal .bg-152 {
+ background-color: #afd7d7;
+}
+.asciinema-terminal .fg-153 {
+ color: #afd7ff;
+}
+.asciinema-terminal .bg-153 {
+ background-color: #afd7ff;
+}
+.asciinema-terminal .fg-154 {
+ color: #afff00;
+}
+.asciinema-terminal .bg-154 {
+ background-color: #afff00;
+}
+.asciinema-terminal .fg-155 {
+ color: #afff5f;
+}
+.asciinema-terminal .bg-155 {
+ background-color: #afff5f;
+}
+.asciinema-terminal .fg-156 {
+ color: #afff87;
+}
+.asciinema-terminal .bg-156 {
+ background-color: #afff87;
+}
+.asciinema-terminal .fg-157 {
+ color: #afffaf;
+}
+.asciinema-terminal .bg-157 {
+ background-color: #afffaf;
+}
+.asciinema-terminal .fg-158 {
+ color: #afffd7;
+}
+.asciinema-terminal .bg-158 {
+ background-color: #afffd7;
+}
+.asciinema-terminal .fg-159 {
+ color: #afffff;
+}
+.asciinema-terminal .bg-159 {
+ background-color: #afffff;
+}
+.asciinema-terminal .fg-160 {
+ color: #d70000;
+}
+.asciinema-terminal .bg-160 {
+ background-color: #d70000;
+}
+.asciinema-terminal .fg-161 {
+ color: #d7005f;
+}
+.asciinema-terminal .bg-161 {
+ background-color: #d7005f;
+}
+.asciinema-terminal .fg-162 {
+ color: #d70087;
+}
+.asciinema-terminal .bg-162 {
+ background-color: #d70087;
+}
+.asciinema-terminal .fg-163 {
+ color: #d700af;
+}
+.asciinema-terminal .bg-163 {
+ background-color: #d700af;
+}
+.asciinema-terminal .fg-164 {
+ color: #d700d7;
+}
+.asciinema-terminal .bg-164 {
+ background-color: #d700d7;
+}
+.asciinema-terminal .fg-165 {
+ color: #d700ff;
+}
+.asciinema-terminal .bg-165 {
+ background-color: #d700ff;
+}
+.asciinema-terminal .fg-166 {
+ color: #d75f00;
+}
+.asciinema-terminal .bg-166 {
+ background-color: #d75f00;
+}
+.asciinema-terminal .fg-167 {
+ color: #d75f5f;
+}
+.asciinema-terminal .bg-167 {
+ background-color: #d75f5f;
+}
+.asciinema-terminal .fg-168 {
+ color: #d75f87;
+}
+.asciinema-terminal .bg-168 {
+ background-color: #d75f87;
+}
+.asciinema-terminal .fg-169 {
+ color: #d75faf;
+}
+.asciinema-terminal .bg-169 {
+ background-color: #d75faf;
+}
+.asciinema-terminal .fg-170 {
+ color: #d75fd7;
+}
+.asciinema-terminal .bg-170 {
+ background-color: #d75fd7;
+}
+.asciinema-terminal .fg-171 {
+ color: #d75fff;
+}
+.asciinema-terminal .bg-171 {
+ background-color: #d75fff;
+}
+.asciinema-terminal .fg-172 {
+ color: #d78700;
+}
+.asciinema-terminal .bg-172 {
+ background-color: #d78700;
+}
+.asciinema-terminal .fg-173 {
+ color: #d7875f;
+}
+.asciinema-terminal .bg-173 {
+ background-color: #d7875f;
+}
+.asciinema-terminal .fg-174 {
+ color: #d78787;
+}
+.asciinema-terminal .bg-174 {
+ background-color: #d78787;
+}
+.asciinema-terminal .fg-175 {
+ color: #d787af;
+}
+.asciinema-terminal .bg-175 {
+ background-color: #d787af;
+}
+.asciinema-terminal .fg-176 {
+ color: #d787d7;
+}
+.asciinema-terminal .bg-176 {
+ background-color: #d787d7;
+}
+.asciinema-terminal .fg-177 {
+ color: #d787ff;
+}
+.asciinema-terminal .bg-177 {
+ background-color: #d787ff;
+}
+.asciinema-terminal .fg-178 {
+ color: #d7af00;
+}
+.asciinema-terminal .bg-178 {
+ background-color: #d7af00;
+}
+.asciinema-terminal .fg-179 {
+ color: #d7af5f;
+}
+.asciinema-terminal .bg-179 {
+ background-color: #d7af5f;
+}
+.asciinema-terminal .fg-180 {
+ color: #d7af87;
+}
+.asciinema-terminal .bg-180 {
+ background-color: #d7af87;
+}
+.asciinema-terminal .fg-181 {
+ color: #d7afaf;
+}
+.asciinema-terminal .bg-181 {
+ background-color: #d7afaf;
+}
+.asciinema-terminal .fg-182 {
+ color: #d7afd7;
+}
+.asciinema-terminal .bg-182 {
+ background-color: #d7afd7;
+}
+.asciinema-terminal .fg-183 {
+ color: #d7afff;
+}
+.asciinema-terminal .bg-183 {
+ background-color: #d7afff;
+}
+.asciinema-terminal .fg-184 {
+ color: #d7d700;
+}
+.asciinema-terminal .bg-184 {
+ background-color: #d7d700;
+}
+.asciinema-terminal .fg-185 {
+ color: #d7d75f;
+}
+.asciinema-terminal .bg-185 {
+ background-color: #d7d75f;
+}
+.asciinema-terminal .fg-186 {
+ color: #d7d787;
+}
+.asciinema-terminal .bg-186 {
+ background-color: #d7d787;
+}
+.asciinema-terminal .fg-187 {
+ color: #d7d7af;
+}
+.asciinema-terminal .bg-187 {
+ background-color: #d7d7af;
+}
+.asciinema-terminal .fg-188 {
+ color: #d7d7d7;
+}
+.asciinema-terminal .bg-188 {
+ background-color: #d7d7d7;
+}
+.asciinema-terminal .fg-189 {
+ color: #d7d7ff;
+}
+.asciinema-terminal .bg-189 {
+ background-color: #d7d7ff;
+}
+.asciinema-terminal .fg-190 {
+ color: #d7ff00;
+}
+.asciinema-terminal .bg-190 {
+ background-color: #d7ff00;
+}
+.asciinema-terminal .fg-191 {
+ color: #d7ff5f;
+}
+.asciinema-terminal .bg-191 {
+ background-color: #d7ff5f;
+}
+.asciinema-terminal .fg-192 {
+ color: #d7ff87;
+}
+.asciinema-terminal .bg-192 {
+ background-color: #d7ff87;
+}
+.asciinema-terminal .fg-193 {
+ color: #d7ffaf;
+}
+.asciinema-terminal .bg-193 {
+ background-color: #d7ffaf;
+}
+.asciinema-terminal .fg-194 {
+ color: #d7ffd7;
+}
+.asciinema-terminal .bg-194 {
+ background-color: #d7ffd7;
+}
+.asciinema-terminal .fg-195 {
+ color: #d7ffff;
+}
+.asciinema-terminal .bg-195 {
+ background-color: #d7ffff;
+}
+.asciinema-terminal .fg-196 {
+ color: #ff0000;
+}
+.asciinema-terminal .bg-196 {
+ background-color: #ff0000;
+}
+.asciinema-terminal .fg-197 {
+ color: #ff005f;
+}
+.asciinema-terminal .bg-197 {
+ background-color: #ff005f;
+}
+.asciinema-terminal .fg-198 {
+ color: #ff0087;
+}
+.asciinema-terminal .bg-198 {
+ background-color: #ff0087;
+}
+.asciinema-terminal .fg-199 {
+ color: #ff00af;
+}
+.asciinema-terminal .bg-199 {
+ background-color: #ff00af;
+}
+.asciinema-terminal .fg-200 {
+ color: #ff00d7;
+}
+.asciinema-terminal .bg-200 {
+ background-color: #ff00d7;
+}
+.asciinema-terminal .fg-201 {
+ color: #ff00ff;
+}
+.asciinema-terminal .bg-201 {
+ background-color: #ff00ff;
+}
+.asciinema-terminal .fg-202 {
+ color: #ff5f00;
+}
+.asciinema-terminal .bg-202 {
+ background-color: #ff5f00;
+}
+.asciinema-terminal .fg-203 {
+ color: #ff5f5f;
+}
+.asciinema-terminal .bg-203 {
+ background-color: #ff5f5f;
+}
+.asciinema-terminal .fg-204 {
+ color: #ff5f87;
+}
+.asciinema-terminal .bg-204 {
+ background-color: #ff5f87;
+}
+.asciinema-terminal .fg-205 {
+ color: #ff5faf;
+}
+.asciinema-terminal .bg-205 {
+ background-color: #ff5faf;
+}
+.asciinema-terminal .fg-206 {
+ color: #ff5fd7;
+}
+.asciinema-terminal .bg-206 {
+ background-color: #ff5fd7;
+}
+.asciinema-terminal .fg-207 {
+ color: #ff5fff;
+}
+.asciinema-terminal .bg-207 {
+ background-color: #ff5fff;
+}
+.asciinema-terminal .fg-208 {
+ color: #ff8700;
+}
+.asciinema-terminal .bg-208 {
+ background-color: #ff8700;
+}
+.asciinema-terminal .fg-209 {
+ color: #ff875f;
+}
+.asciinema-terminal .bg-209 {
+ background-color: #ff875f;
+}
+.asciinema-terminal .fg-210 {
+ color: #ff8787;
+}
+.asciinema-terminal .bg-210 {
+ background-color: #ff8787;
+}
+.asciinema-terminal .fg-211 {
+ color: #ff87af;
+}
+.asciinema-terminal .bg-211 {
+ background-color: #ff87af;
+}
+.asciinema-terminal .fg-212 {
+ color: #ff87d7;
+}
+.asciinema-terminal .bg-212 {
+ background-color: #ff87d7;
+}
+.asciinema-terminal .fg-213 {
+ color: #ff87ff;
+}
+.asciinema-terminal .bg-213 {
+ background-color: #ff87ff;
+}
+.asciinema-terminal .fg-214 {
+ color: #ffaf00;
+}
+.asciinema-terminal .bg-214 {
+ background-color: #ffaf00;
+}
+.asciinema-terminal .fg-215 {
+ color: #ffaf5f;
+}
+.asciinema-terminal .bg-215 {
+ background-color: #ffaf5f;
+}
+.asciinema-terminal .fg-216 {
+ color: #ffaf87;
+}
+.asciinema-terminal .bg-216 {
+ background-color: #ffaf87;
+}
+.asciinema-terminal .fg-217 {
+ color: #ffafaf;
+}
+.asciinema-terminal .bg-217 {
+ background-color: #ffafaf;
+}
+.asciinema-terminal .fg-218 {
+ color: #ffafd7;
+}
+.asciinema-terminal .bg-218 {
+ background-color: #ffafd7;
+}
+.asciinema-terminal .fg-219 {
+ color: #ffafff;
+}
+.asciinema-terminal .bg-219 {
+ background-color: #ffafff;
+}
+.asciinema-terminal .fg-220 {
+ color: #ffd700;
+}
+.asciinema-terminal .bg-220 {
+ background-color: #ffd700;
+}
+.asciinema-terminal .fg-221 {
+ color: #ffd75f;
+}
+.asciinema-terminal .bg-221 {
+ background-color: #ffd75f;
+}
+.asciinema-terminal .fg-222 {
+ color: #ffd787;
+}
+.asciinema-terminal .bg-222 {
+ background-color: #ffd787;
+}
+.asciinema-terminal .fg-223 {
+ color: #ffd7af;
+}
+.asciinema-terminal .bg-223 {
+ background-color: #ffd7af;
+}
+.asciinema-terminal .fg-224 {
+ color: #ffd7d7;
+}
+.asciinema-terminal .bg-224 {
+ background-color: #ffd7d7;
+}
+.asciinema-terminal .fg-225 {
+ color: #ffd7ff;
+}
+.asciinema-terminal .bg-225 {
+ background-color: #ffd7ff;
+}
+.asciinema-terminal .fg-226 {
+ color: #ffff00;
+}
+.asciinema-terminal .bg-226 {
+ background-color: #ffff00;
+}
+.asciinema-terminal .fg-227 {
+ color: #ffff5f;
+}
+.asciinema-terminal .bg-227 {
+ background-color: #ffff5f;
+}
+.asciinema-terminal .fg-228 {
+ color: #ffff87;
+}
+.asciinema-terminal .bg-228 {
+ background-color: #ffff87;
+}
+.asciinema-terminal .fg-229 {
+ color: #ffffaf;
+}
+.asciinema-terminal .bg-229 {
+ background-color: #ffffaf;
+}
+.asciinema-terminal .fg-230 {
+ color: #ffffd7;
+}
+.asciinema-terminal .bg-230 {
+ background-color: #ffffd7;
+}
+.asciinema-terminal .fg-231 {
+ color: #ffffff;
+}
+.asciinema-terminal .bg-231 {
+ background-color: #ffffff;
+}
+.asciinema-terminal .fg-232 {
+ color: #080808;
+}
+.asciinema-terminal .bg-232 {
+ background-color: #080808;
+}
+.asciinema-terminal .fg-233 {
+ color: #121212;
+}
+.asciinema-terminal .bg-233 {
+ background-color: #121212;
+}
+.asciinema-terminal .fg-234 {
+ color: #1c1c1c;
+}
+.asciinema-terminal .bg-234 {
+ background-color: #1c1c1c;
+}
+.asciinema-terminal .fg-235 {
+ color: #262626;
+}
+.asciinema-terminal .bg-235 {
+ background-color: #262626;
+}
+.asciinema-terminal .fg-236 {
+ color: #303030;
+}
+.asciinema-terminal .bg-236 {
+ background-color: #303030;
+}
+.asciinema-terminal .fg-237 {
+ color: #3a3a3a;
+}
+.asciinema-terminal .bg-237 {
+ background-color: #3a3a3a;
+}
+.asciinema-terminal .fg-238 {
+ color: #444444;
+}
+.asciinema-terminal .bg-238 {
+ background-color: #444444;
+}
+.asciinema-terminal .fg-239 {
+ color: #4e4e4e;
+}
+.asciinema-terminal .bg-239 {
+ background-color: #4e4e4e;
+}
+.asciinema-terminal .fg-240 {
+ color: #585858;
+}
+.asciinema-terminal .bg-240 {
+ background-color: #585858;
+}
+.asciinema-terminal .fg-241 {
+ color: #626262;
+}
+.asciinema-terminal .bg-241 {
+ background-color: #626262;
+}
+.asciinema-terminal .fg-242 {
+ color: #6c6c6c;
+}
+.asciinema-terminal .bg-242 {
+ background-color: #6c6c6c;
+}
+.asciinema-terminal .fg-243 {
+ color: #767676;
+}
+.asciinema-terminal .bg-243 {
+ background-color: #767676;
+}
+.asciinema-terminal .fg-244 {
+ color: #808080;
+}
+.asciinema-terminal .bg-244 {
+ background-color: #808080;
+}
+.asciinema-terminal .fg-245 {
+ color: #8a8a8a;
+}
+.asciinema-terminal .bg-245 {
+ background-color: #8a8a8a;
+}
+.asciinema-terminal .fg-246 {
+ color: #949494;
+}
+.asciinema-terminal .bg-246 {
+ background-color: #949494;
+}
+.asciinema-terminal .fg-247 {
+ color: #9e9e9e;
+}
+.asciinema-terminal .bg-247 {
+ background-color: #9e9e9e;
+}
+.asciinema-terminal .fg-248 {
+ color: #a8a8a8;
+}
+.asciinema-terminal .bg-248 {
+ background-color: #a8a8a8;
+}
+.asciinema-terminal .fg-249 {
+ color: #b2b2b2;
+}
+.asciinema-terminal .bg-249 {
+ background-color: #b2b2b2;
+}
+.asciinema-terminal .fg-250 {
+ color: #bcbcbc;
+}
+.asciinema-terminal .bg-250 {
+ background-color: #bcbcbc;
+}
+.asciinema-terminal .fg-251 {
+ color: #c6c6c6;
+}
+.asciinema-terminal .bg-251 {
+ background-color: #c6c6c6;
+}
+.asciinema-terminal .fg-252 {
+ color: #d0d0d0;
+}
+.asciinema-terminal .bg-252 {
+ background-color: #d0d0d0;
+}
+.asciinema-terminal .fg-253 {
+ color: #dadada;
+}
+.asciinema-terminal .bg-253 {
+ background-color: #dadada;
+}
+.asciinema-terminal .fg-254 {
+ color: #e4e4e4;
+}
+.asciinema-terminal .bg-254 {
+ background-color: #e4e4e4;
+}
+.asciinema-terminal .fg-255 {
+ color: #eeeeee;
+}
+.asciinema-terminal .bg-255 {
+ background-color: #eeeeee;
+}
+.asciinema-theme-asciinema .asciinema-terminal {
+ color: #cccccc;
+ background-color: #121314;
+ border-color: #121314;
+}
+.asciinema-theme-asciinema .fg-bg {
+ color: #121314;
+}
+.asciinema-theme-asciinema .bg-fg {
+ background-color: #cccccc;
+}
+.asciinema-theme-asciinema .fg-0 {
+ color: #000000;
+}
+.asciinema-theme-asciinema .bg-0 {
+ background-color: #000000;
+}
+.asciinema-theme-asciinema .fg-1 {
+ color: #dd3c69;
+}
+.asciinema-theme-asciinema .bg-1 {
+ background-color: #dd3c69;
+}
+.asciinema-theme-asciinema .fg-2 {
+ color: #4ebf22;
+}
+.asciinema-theme-asciinema .bg-2 {
+ background-color: #4ebf22;
+}
+.asciinema-theme-asciinema .fg-3 {
+ color: #ddaf3c;
+}
+.asciinema-theme-asciinema .bg-3 {
+ background-color: #ddaf3c;
+}
+.asciinema-theme-asciinema .fg-4 {
+ color: #26b0d7;
+}
+.asciinema-theme-asciinema .bg-4 {
+ background-color: #26b0d7;
+}
+.asciinema-theme-asciinema .fg-5 {
+ color: #b954e1;
+}
+.asciinema-theme-asciinema .bg-5 {
+ background-color: #b954e1;
+}
+.asciinema-theme-asciinema .fg-6 {
+ color: #54e1b9;
+}
+.asciinema-theme-asciinema .bg-6 {
+ background-color: #54e1b9;
+}
+.asciinema-theme-asciinema .fg-7 {
+ color: #d9d9d9;
+}
+.asciinema-theme-asciinema .bg-7 {
+ background-color: #d9d9d9;
+}
+.asciinema-theme-asciinema .fg-8 {
+ color: #4d4d4d;
+}
+.asciinema-theme-asciinema .bg-8 {
+ background-color: #4d4d4d;
+}
+.asciinema-theme-asciinema .fg-9 {
+ color: #dd3c69;
+}
+.asciinema-theme-asciinema .bg-9 {
+ background-color: #dd3c69;
+}
+.asciinema-theme-asciinema .fg-10 {
+ color: #4ebf22;
+}
+.asciinema-theme-asciinema .bg-10 {
+ background-color: #4ebf22;
+}
+.asciinema-theme-asciinema .fg-11 {
+ color: #ddaf3c;
+}
+.asciinema-theme-asciinema .bg-11 {
+ background-color: #ddaf3c;
+}
+.asciinema-theme-asciinema .fg-12 {
+ color: #26b0d7;
+}
+.asciinema-theme-asciinema .bg-12 {
+ background-color: #26b0d7;
+}
+.asciinema-theme-asciinema .fg-13 {
+ color: #b954e1;
+}
+.asciinema-theme-asciinema .bg-13 {
+ background-color: #b954e1;
+}
+.asciinema-theme-asciinema .fg-14 {
+ color: #54e1b9;
+}
+.asciinema-theme-asciinema .bg-14 {
+ background-color: #54e1b9;
+}
+.asciinema-theme-asciinema .fg-15 {
+ color: #ffffff;
+}
+.asciinema-theme-asciinema .bg-15 {
+ background-color: #ffffff;
+}
+.asciinema-theme-asciinema .fg-8,
+.asciinema-theme-asciinema .fg-9,
+.asciinema-theme-asciinema .fg-10,
+.asciinema-theme-asciinema .fg-11,
+.asciinema-theme-asciinema .fg-12,
+.asciinema-theme-asciinema .fg-13,
+.asciinema-theme-asciinema .fg-14,
+.asciinema-theme-asciinema .fg-15 {
+ font-weight: bold;
+}
+.asciinema-theme-tango .asciinema-terminal {
+ color: #cccccc;
+ background-color: #121314;
+ border-color: #121314;
+}
+.asciinema-theme-tango .fg-bg {
+ color: #121314;
+}
+.asciinema-theme-tango .bg-fg {
+ background-color: #cccccc;
+}
+.asciinema-theme-tango .fg-0 {
+ color: #000000;
+}
+.asciinema-theme-tango .bg-0 {
+ background-color: #000000;
+}
+.asciinema-theme-tango .fg-1 {
+ color: #cc0000;
+}
+.asciinema-theme-tango .bg-1 {
+ background-color: #cc0000;
+}
+.asciinema-theme-tango .fg-2 {
+ color: #4e9a06;
+}
+.asciinema-theme-tango .bg-2 {
+ background-color: #4e9a06;
+}
+.asciinema-theme-tango .fg-3 {
+ color: #c4a000;
+}
+.asciinema-theme-tango .bg-3 {
+ background-color: #c4a000;
+}
+.asciinema-theme-tango .fg-4 {
+ color: #3465a4;
+}
+.asciinema-theme-tango .bg-4 {
+ background-color: #3465a4;
+}
+.asciinema-theme-tango .fg-5 {
+ color: #75507b;
+}
+.asciinema-theme-tango .bg-5 {
+ background-color: #75507b;
+}
+.asciinema-theme-tango .fg-6 {
+ color: #06989a;
+}
+.asciinema-theme-tango .bg-6 {
+ background-color: #06989a;
+}
+.asciinema-theme-tango .fg-7 {
+ color: #d3d7cf;
+}
+.asciinema-theme-tango .bg-7 {
+ background-color: #d3d7cf;
+}
+.asciinema-theme-tango .fg-8 {
+ color: #555753;
+}
+.asciinema-theme-tango .bg-8 {
+ background-color: #555753;
+}
+.asciinema-theme-tango .fg-9 {
+ color: #ef2929;
+}
+.asciinema-theme-tango .bg-9 {
+ background-color: #ef2929;
+}
+.asciinema-theme-tango .fg-10 {
+ color: #8ae234;
+}
+.asciinema-theme-tango .bg-10 {
+ background-color: #8ae234;
+}
+.asciinema-theme-tango .fg-11 {
+ color: #fce94f;
+}
+.asciinema-theme-tango .bg-11 {
+ background-color: #fce94f;
+}
+.asciinema-theme-tango .fg-12 {
+ color: #729fcf;
+}
+.asciinema-theme-tango .bg-12 {
+ background-color: #729fcf;
+}
+.asciinema-theme-tango .fg-13 {
+ color: #ad7fa8;
+}
+.asciinema-theme-tango .bg-13 {
+ background-color: #ad7fa8;
+}
+.asciinema-theme-tango .fg-14 {
+ color: #34e2e2;
+}
+.asciinema-theme-tango .bg-14 {
+ background-color: #34e2e2;
+}
+.asciinema-theme-tango .fg-15 {
+ color: #eeeeec;
+}
+.asciinema-theme-tango .bg-15 {
+ background-color: #eeeeec;
+}
+.asciinema-theme-tango .fg-8,
+.asciinema-theme-tango .fg-9,
+.asciinema-theme-tango .fg-10,
+.asciinema-theme-tango .fg-11,
+.asciinema-theme-tango .fg-12,
+.asciinema-theme-tango .fg-13,
+.asciinema-theme-tango .fg-14,
+.asciinema-theme-tango .fg-15 {
+ font-weight: bold;
+}
+.asciinema-theme-solarized-dark .asciinema-terminal {
+ color: #839496;
+ background-color: #002b36;
+ border-color: #002b36;
+}
+.asciinema-theme-solarized-dark .fg-bg {
+ color: #002b36;
+}
+.asciinema-theme-solarized-dark .bg-fg {
+ background-color: #839496;
+}
+.asciinema-theme-solarized-dark .fg-0 {
+ color: #073642;
+}
+.asciinema-theme-solarized-dark .bg-0 {
+ background-color: #073642;
+}
+.asciinema-theme-solarized-dark .fg-1 {
+ color: #dc322f;
+}
+.asciinema-theme-solarized-dark .bg-1 {
+ background-color: #dc322f;
+}
+.asciinema-theme-solarized-dark .fg-2 {
+ color: #859900;
+}
+.asciinema-theme-solarized-dark .bg-2 {
+ background-color: #859900;
+}
+.asciinema-theme-solarized-dark .fg-3 {
+ color: #b58900;
+}
+.asciinema-theme-solarized-dark .bg-3 {
+ background-color: #b58900;
+}
+.asciinema-theme-solarized-dark .fg-4 {
+ color: #268bd2;
+}
+.asciinema-theme-solarized-dark .bg-4 {
+ background-color: #268bd2;
+}
+.asciinema-theme-solarized-dark .fg-5 {
+ color: #d33682;
+}
+.asciinema-theme-solarized-dark .bg-5 {
+ background-color: #d33682;
+}
+.asciinema-theme-solarized-dark .fg-6 {
+ color: #2aa198;
+}
+.asciinema-theme-solarized-dark .bg-6 {
+ background-color: #2aa198;
+}
+.asciinema-theme-solarized-dark .fg-7 {
+ color: #eee8d5;
+}
+.asciinema-theme-solarized-dark .bg-7 {
+ background-color: #eee8d5;
+}
+.asciinema-theme-solarized-dark .fg-8 {
+ color: #002b36;
+}
+.asciinema-theme-solarized-dark .bg-8 {
+ background-color: #002b36;
+}
+.asciinema-theme-solarized-dark .fg-9 {
+ color: #cb4b16;
+}
+.asciinema-theme-solarized-dark .bg-9 {
+ background-color: #cb4b16;
+}
+.asciinema-theme-solarized-dark .fg-10 {
+ color: #586e75;
+}
+.asciinema-theme-solarized-dark .bg-10 {
+ background-color: #586e75;
+}
+.asciinema-theme-solarized-dark .fg-11 {
+ color: #657b83;
+}
+.asciinema-theme-solarized-dark .bg-11 {
+ background-color: #657b83;
+}
+.asciinema-theme-solarized-dark .fg-12 {
+ color: #839496;
+}
+.asciinema-theme-solarized-dark .bg-12 {
+ background-color: #839496;
+}
+.asciinema-theme-solarized-dark .fg-13 {
+ color: #6c71c4;
+}
+.asciinema-theme-solarized-dark .bg-13 {
+ background-color: #6c71c4;
+}
+.asciinema-theme-solarized-dark .fg-14 {
+ color: #93a1a1;
+}
+.asciinema-theme-solarized-dark .bg-14 {
+ background-color: #93a1a1;
+}
+.asciinema-theme-solarized-dark .fg-15 {
+ color: #fdf6e3;
+}
+.asciinema-theme-solarized-dark .bg-15 {
+ background-color: #fdf6e3;
+}
+.asciinema-theme-solarized-light .asciinema-terminal {
+ color: #657b83;
+ background-color: #fdf6e3;
+ border-color: #fdf6e3;
+}
+.asciinema-theme-solarized-light .fg-bg {
+ color: #fdf6e3;
+}
+.asciinema-theme-solarized-light .bg-fg {
+ background-color: #657b83;
+}
+.asciinema-theme-solarized-light .fg-0 {
+ color: #073642;
+}
+.asciinema-theme-solarized-light .bg-0 {
+ background-color: #073642;
+}
+.asciinema-theme-solarized-light .fg-1 {
+ color: #dc322f;
+}
+.asciinema-theme-solarized-light .bg-1 {
+ background-color: #dc322f;
+}
+.asciinema-theme-solarized-light .fg-2 {
+ color: #859900;
+}
+.asciinema-theme-solarized-light .bg-2 {
+ background-color: #859900;
+}
+.asciinema-theme-solarized-light .fg-3 {
+ color: #b58900;
+}
+.asciinema-theme-solarized-light .bg-3 {
+ background-color: #b58900;
+}
+.asciinema-theme-solarized-light .fg-4 {
+ color: #268bd2;
+}
+.asciinema-theme-solarized-light .bg-4 {
+ background-color: #268bd2;
+}
+.asciinema-theme-solarized-light .fg-5 {
+ color: #d33682;
+}
+.asciinema-theme-solarized-light .bg-5 {
+ background-color: #d33682;
+}
+.asciinema-theme-solarized-light .fg-6 {
+ color: #2aa198;
+}
+.asciinema-theme-solarized-light .bg-6 {
+ background-color: #2aa198;
+}
+.asciinema-theme-solarized-light .fg-7 {
+ color: #eee8d5;
+}
+.asciinema-theme-solarized-light .bg-7 {
+ background-color: #eee8d5;
+}
+.asciinema-theme-solarized-light .fg-8 {
+ color: #002b36;
+}
+.asciinema-theme-solarized-light .bg-8 {
+ background-color: #002b36;
+}
+.asciinema-theme-solarized-light .fg-9 {
+ color: #cb4b16;
+}
+.asciinema-theme-solarized-light .bg-9 {
+ background-color: #cb4b16;
+}
+.asciinema-theme-solarized-light .fg-10 {
+ color: #586e75;
+}
+.asciinema-theme-solarized-light .bg-10 {
+ background-color: #586e75;
+}
+.asciinema-theme-solarized-light .fg-11 {
+ color: #657c83;
+}
+.asciinema-theme-solarized-light .bg-11 {
+ background-color: #657c83;
+}
+.asciinema-theme-solarized-light .fg-12 {
+ color: #839496;
+}
+.asciinema-theme-solarized-light .bg-12 {
+ background-color: #839496;
+}
+.asciinema-theme-solarized-light .fg-13 {
+ color: #6c71c4;
+}
+.asciinema-theme-solarized-light .bg-13 {
+ background-color: #6c71c4;
+}
+.asciinema-theme-solarized-light .fg-14 {
+ color: #93a1a1;
+}
+.asciinema-theme-solarized-light .bg-14 {
+ background-color: #93a1a1;
+}
+.asciinema-theme-solarized-light .fg-15 {
+ color: #fdf6e3;
+}
+.asciinema-theme-solarized-light .bg-15 {
+ background-color: #fdf6e3;
+}
+.asciinema-theme-seti .asciinema-terminal {
+ color: #cacecd;
+ background-color: #111213;
+ border-color: #111213;
+}
+.asciinema-theme-seti .fg-bg {
+ color: #111213;
+}
+.asciinema-theme-seti .bg-fg {
+ background-color: #cacecd;
+}
+.asciinema-theme-seti .fg-0 {
+ color: #323232;
+}
+.asciinema-theme-seti .bg-0 {
+ background-color: #323232;
+}
+.asciinema-theme-seti .fg-1 {
+ color: #c22832;
+}
+.asciinema-theme-seti .bg-1 {
+ background-color: #c22832;
+}
+.asciinema-theme-seti .fg-2 {
+ color: #8ec43d;
+}
+.asciinema-theme-seti .bg-2 {
+ background-color: #8ec43d;
+}
+.asciinema-theme-seti .fg-3 {
+ color: #e0c64f;
+}
+.asciinema-theme-seti .bg-3 {
+ background-color: #e0c64f;
+}
+.asciinema-theme-seti .fg-4 {
+ color: #43a5d5;
+}
+.asciinema-theme-seti .bg-4 {
+ background-color: #43a5d5;
+}
+.asciinema-theme-seti .fg-5 {
+ color: #8b57b5;
+}
+.asciinema-theme-seti .bg-5 {
+ background-color: #8b57b5;
+}
+.asciinema-theme-seti .fg-6 {
+ color: #8ec43d;
+}
+.asciinema-theme-seti .bg-6 {
+ background-color: #8ec43d;
+}
+.asciinema-theme-seti .fg-7 {
+ color: #eeeeee;
+}
+.asciinema-theme-seti .bg-7 {
+ background-color: #eeeeee;
+}
+.asciinema-theme-seti .fg-8 {
+ color: #323232;
+}
+.asciinema-theme-seti .bg-8 {
+ background-color: #323232;
+}
+.asciinema-theme-seti .fg-9 {
+ color: #c22832;
+}
+.asciinema-theme-seti .bg-9 {
+ background-color: #c22832;
+}
+.asciinema-theme-seti .fg-10 {
+ color: #8ec43d;
+}
+.asciinema-theme-seti .bg-10 {
+ background-color: #8ec43d;
+}
+.asciinema-theme-seti .fg-11 {
+ color: #e0c64f;
+}
+.asciinema-theme-seti .bg-11 {
+ background-color: #e0c64f;
+}
+.asciinema-theme-seti .fg-12 {
+ color: #43a5d5;
+}
+.asciinema-theme-seti .bg-12 {
+ background-color: #43a5d5;
+}
+.asciinema-theme-seti .fg-13 {
+ color: #8b57b5;
+}
+.asciinema-theme-seti .bg-13 {
+ background-color: #8b57b5;
+}
+.asciinema-theme-seti .fg-14 {
+ color: #8ec43d;
+}
+.asciinema-theme-seti .bg-14 {
+ background-color: #8ec43d;
+}
+.asciinema-theme-seti .fg-15 {
+ color: #ffffff;
+}
+.asciinema-theme-seti .bg-15 {
+ background-color: #ffffff;
+}
+.asciinema-theme-seti .fg-8,
+.asciinema-theme-seti .fg-9,
+.asciinema-theme-seti .fg-10,
+.asciinema-theme-seti .fg-11,
+.asciinema-theme-seti .fg-12,
+.asciinema-theme-seti .fg-13,
+.asciinema-theme-seti .fg-14,
+.asciinema-theme-seti .fg-15 {
+ font-weight: bold;
+}
+/* Based on Monokai from base16 collection - https://github.com/chriskempson/base16 */
+.asciinema-theme-monokai .asciinema-terminal {
+ color: #f8f8f2;
+ background-color: #272822;
+ border-color: #272822;
+}
+.asciinema-theme-monokai .fg-bg {
+ color: #272822;
+}
+.asciinema-theme-monokai .bg-fg {
+ background-color: #f8f8f2;
+}
+.asciinema-theme-monokai .fg-0 {
+ color: #272822;
+}
+.asciinema-theme-monokai .bg-0 {
+ background-color: #272822;
+}
+.asciinema-theme-monokai .fg-1 {
+ color: #f92672;
+}
+.asciinema-theme-monokai .bg-1 {
+ background-color: #f92672;
+}
+.asciinema-theme-monokai .fg-2 {
+ color: #a6e22e;
+}
+.asciinema-theme-monokai .bg-2 {
+ background-color: #a6e22e;
+}
+.asciinema-theme-monokai .fg-3 {
+ color: #f4bf75;
+}
+.asciinema-theme-monokai .bg-3 {
+ background-color: #f4bf75;
+}
+.asciinema-theme-monokai .fg-4 {
+ color: #66d9ef;
+}
+.asciinema-theme-monokai .bg-4 {
+ background-color: #66d9ef;
+}
+.asciinema-theme-monokai .fg-5 {
+ color: #ae81ff;
+}
+.asciinema-theme-monokai .bg-5 {
+ background-color: #ae81ff;
+}
+.asciinema-theme-monokai .fg-6 {
+ color: #a1efe4;
+}
+.asciinema-theme-monokai .bg-6 {
+ background-color: #a1efe4;
+}
+.asciinema-theme-monokai .fg-7 {
+ color: #f8f8f2;
+}
+.asciinema-theme-monokai .bg-7 {
+ background-color: #f8f8f2;
+}
+.asciinema-theme-monokai .fg-8 {
+ color: #75715e;
+}
+.asciinema-theme-monokai .bg-8 {
+ background-color: #75715e;
+}
+.asciinema-theme-monokai .fg-9 {
+ color: #f92672;
+}
+.asciinema-theme-monokai .bg-9 {
+ background-color: #f92672;
+}
+.asciinema-theme-monokai .fg-10 {
+ color: #a6e22e;
+}
+.asciinema-theme-monokai .bg-10 {
+ background-color: #a6e22e;
+}
+.asciinema-theme-monokai .fg-11 {
+ color: #f4bf75;
+}
+.asciinema-theme-monokai .bg-11 {
+ background-color: #f4bf75;
+}
+.asciinema-theme-monokai .fg-12 {
+ color: #66d9ef;
+}
+.asciinema-theme-monokai .bg-12 {
+ background-color: #66d9ef;
+}
+.asciinema-theme-monokai .fg-13 {
+ color: #ae81ff;
+}
+.asciinema-theme-monokai .bg-13 {
+ background-color: #ae81ff;
+}
+.asciinema-theme-monokai .fg-14 {
+ color: #a1efe4;
+}
+.asciinema-theme-monokai .bg-14 {
+ background-color: #a1efe4;
+}
+.asciinema-theme-monokai .fg-15 {
+ color: #f9f8f5;
+}
+.asciinema-theme-monokai .bg-15 {
+ background-color: #f9f8f5;
+}
+.asciinema-theme-monokai .fg-8,
+.asciinema-theme-monokai .fg-9,
+.asciinema-theme-monokai .fg-10,
+.asciinema-theme-monokai .fg-11,
+.asciinema-theme-monokai .fg-12,
+.asciinema-theme-monokai .fg-13,
+.asciinema-theme-monokai .fg-14,
+.asciinema-theme-monokai .fg-15 {
+ font-weight: bold;
+}
diff --git a/public_html/data/css/bootstrap-theme.css b/public_html/data/css/bootstrap-theme.css
new file mode 100644
index 000000000..e11f889fb
--- /dev/null
+++ b/public_html/data/css/bootstrap-theme.css
@@ -0,0 +1,596 @@
+/*!
+ * Bootstrap v3.3.5 (http://getbootstrap.com)
+ * Copyright 2011-2016 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ */
+
+/*!
+ * Generated using the Bootstrap Customizer (http://getbootstrap.com/customize/?id=e51bc4b79b5712077b546b4ea577f138)
+ * Config saved to config.json and https://gist.github.com/e51bc4b79b5712077b546b4ea577f138
+ */
+/*!
+ * Bootstrap v3.3.6 (http://getbootstrap.com)
+ * Copyright 2011-2015 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ */
+.btn-default,
+.btn-primary,
+.btn-success,
+.btn-info,
+.btn-warning,
+.btn-danger {
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2);
+ -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075);
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075);
+}
+.btn-default:active,
+.btn-primary:active,
+.btn-success:active,
+.btn-info:active,
+.btn-warning:active,
+.btn-danger:active,
+.btn-default.active,
+.btn-primary.active,
+.btn-success.active,
+.btn-info.active,
+.btn-warning.active,
+.btn-danger.active {
+ -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
+ box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
+}
+.btn-default.disabled,
+.btn-primary.disabled,
+.btn-success.disabled,
+.btn-info.disabled,
+.btn-warning.disabled,
+.btn-danger.disabled,
+.btn-default[disabled],
+.btn-primary[disabled],
+.btn-success[disabled],
+.btn-info[disabled],
+.btn-warning[disabled],
+.btn-danger[disabled],
+fieldset[disabled] .btn-default,
+fieldset[disabled] .btn-primary,
+fieldset[disabled] .btn-success,
+fieldset[disabled] .btn-info,
+fieldset[disabled] .btn-warning,
+fieldset[disabled] .btn-danger {
+ -webkit-box-shadow: none;
+ box-shadow: none;
+}
+.btn-default .badge,
+.btn-primary .badge,
+.btn-success .badge,
+.btn-info .badge,
+.btn-warning .badge,
+.btn-danger .badge {
+ text-shadow: none;
+}
+.btn:active,
+.btn.active {
+ background-image: none;
+}
+.btn-default {
+ background-image: -webkit-linear-gradient(top, #ffffff 0%, #e0e0e0 100%);
+ background-image: -o-linear-gradient(top, #ffffff 0%, #e0e0e0 100%);
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#e0e0e0));
+ background-image: linear-gradient(to bottom, #ffffff 0%, #e0e0e0 100%);
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0);
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
+ background-repeat: repeat-x;
+ border-color: #dbdbdb;
+ text-shadow: 0 1px 0 #fff;
+ border-color: #ccc;
+}
+.btn-default:hover,
+.btn-default:focus {
+ background-color: #e0e0e0;
+ background-position: 0 -15px;
+}
+.btn-default:active,
+.btn-default.active {
+ background-color: #e0e0e0;
+ border-color: #dbdbdb;
+}
+.btn-default.disabled,
+.btn-default[disabled],
+fieldset[disabled] .btn-default,
+.btn-default.disabled:hover,
+.btn-default[disabled]:hover,
+fieldset[disabled] .btn-default:hover,
+.btn-default.disabled:focus,
+.btn-default[disabled]:focus,
+fieldset[disabled] .btn-default:focus,
+.btn-default.disabled.focus,
+.btn-default[disabled].focus,
+fieldset[disabled] .btn-default.focus,
+.btn-default.disabled:active,
+.btn-default[disabled]:active,
+fieldset[disabled] .btn-default:active,
+.btn-default.disabled.active,
+.btn-default[disabled].active,
+fieldset[disabled] .btn-default.active {
+ background-color: #e0e0e0;
+ background-image: none;
+}
+.btn-primary {
+ background-image: -webkit-linear-gradient(top, #337ab7 0%, #265a88 100%);
+ background-image: -o-linear-gradient(top, #337ab7 0%, #265a88 100%);
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#265a88));
+ background-image: linear-gradient(to bottom, #337ab7 0%, #265a88 100%);
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff265a88', GradientType=0);
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
+ background-repeat: repeat-x;
+ border-color: #245580;
+}
+.btn-primary:hover,
+.btn-primary:focus {
+ background-color: #265a88;
+ background-position: 0 -15px;
+}
+.btn-primary:active,
+.btn-primary.active {
+ background-color: #265a88;
+ border-color: #245580;
+}
+.btn-primary.disabled,
+.btn-primary[disabled],
+fieldset[disabled] .btn-primary,
+.btn-primary.disabled:hover,
+.btn-primary[disabled]:hover,
+fieldset[disabled] .btn-primary:hover,
+.btn-primary.disabled:focus,
+.btn-primary[disabled]:focus,
+fieldset[disabled] .btn-primary:focus,
+.btn-primary.disabled.focus,
+.btn-primary[disabled].focus,
+fieldset[disabled] .btn-primary.focus,
+.btn-primary.disabled:active,
+.btn-primary[disabled]:active,
+fieldset[disabled] .btn-primary:active,
+.btn-primary.disabled.active,
+.btn-primary[disabled].active,
+fieldset[disabled] .btn-primary.active {
+ background-color: #265a88;
+ background-image: none;
+}
+.btn-success {
+ background-image: -webkit-linear-gradient(top, #5cb85c 0%, #419641 100%);
+ background-image: -o-linear-gradient(top, #5cb85c 0%, #419641 100%);
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#5cb85c), to(#419641));
+ background-image: linear-gradient(to bottom, #5cb85c 0%, #419641 100%);
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0);
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
+ background-repeat: repeat-x;
+ border-color: #3e8f3e;
+}
+.btn-success:hover,
+.btn-success:focus {
+ background-color: #419641;
+ background-position: 0 -15px;
+}
+.btn-success:active,
+.btn-success.active {
+ background-color: #419641;
+ border-color: #3e8f3e;
+}
+.btn-success.disabled,
+.btn-success[disabled],
+fieldset[disabled] .btn-success,
+.btn-success.disabled:hover,
+.btn-success[disabled]:hover,
+fieldset[disabled] .btn-success:hover,
+.btn-success.disabled:focus,
+.btn-success[disabled]:focus,
+fieldset[disabled] .btn-success:focus,
+.btn-success.disabled.focus,
+.btn-success[disabled].focus,
+fieldset[disabled] .btn-success.focus,
+.btn-success.disabled:active,
+.btn-success[disabled]:active,
+fieldset[disabled] .btn-success:active,
+.btn-success.disabled.active,
+.btn-success[disabled].active,
+fieldset[disabled] .btn-success.active {
+ background-color: #419641;
+ background-image: none;
+}
+.btn-info {
+ background-image: -webkit-linear-gradient(top, #5bc0de 0%, #2aabd2 100%);
+ background-image: -o-linear-gradient(top, #5bc0de 0%, #2aabd2 100%);
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#5bc0de), to(#2aabd2));
+ background-image: linear-gradient(to bottom, #5bc0de 0%, #2aabd2 100%);
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0);
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
+ background-repeat: repeat-x;
+ border-color: #28a4c9;
+}
+.btn-info:hover,
+.btn-info:focus {
+ background-color: #2aabd2;
+ background-position: 0 -15px;
+}
+.btn-info:active,
+.btn-info.active {
+ background-color: #2aabd2;
+ border-color: #28a4c9;
+}
+.btn-info.disabled,
+.btn-info[disabled],
+fieldset[disabled] .btn-info,
+.btn-info.disabled:hover,
+.btn-info[disabled]:hover,
+fieldset[disabled] .btn-info:hover,
+.btn-info.disabled:focus,
+.btn-info[disabled]:focus,
+fieldset[disabled] .btn-info:focus,
+.btn-info.disabled.focus,
+.btn-info[disabled].focus,
+fieldset[disabled] .btn-info.focus,
+.btn-info.disabled:active,
+.btn-info[disabled]:active,
+fieldset[disabled] .btn-info:active,
+.btn-info.disabled.active,
+.btn-info[disabled].active,
+fieldset[disabled] .btn-info.active {
+ background-color: #2aabd2;
+ background-image: none;
+}
+.btn-warning {
+ background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #eb9316 100%);
+ background-image: -o-linear-gradient(top, #f0ad4e 0%, #eb9316 100%);
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#f0ad4e), to(#eb9316));
+ background-image: linear-gradient(to bottom, #f0ad4e 0%, #eb9316 100%);
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0);
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
+ background-repeat: repeat-x;
+ border-color: #e38d13;
+}
+.btn-warning:hover,
+.btn-warning:focus {
+ background-color: #eb9316;
+ background-position: 0 -15px;
+}
+.btn-warning:active,
+.btn-warning.active {
+ background-color: #eb9316;
+ border-color: #e38d13;
+}
+.btn-warning.disabled,
+.btn-warning[disabled],
+fieldset[disabled] .btn-warning,
+.btn-warning.disabled:hover,
+.btn-warning[disabled]:hover,
+fieldset[disabled] .btn-warning:hover,
+.btn-warning.disabled:focus,
+.btn-warning[disabled]:focus,
+fieldset[disabled] .btn-warning:focus,
+.btn-warning.disabled.focus,
+.btn-warning[disabled].focus,
+fieldset[disabled] .btn-warning.focus,
+.btn-warning.disabled:active,
+.btn-warning[disabled]:active,
+fieldset[disabled] .btn-warning:active,
+.btn-warning.disabled.active,
+.btn-warning[disabled].active,
+fieldset[disabled] .btn-warning.active {
+ background-color: #eb9316;
+ background-image: none;
+}
+.btn-danger {
+ background-image: -webkit-linear-gradient(top, #d9534f 0%, #c12e2a 100%);
+ background-image: -o-linear-gradient(top, #d9534f 0%, #c12e2a 100%);
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#d9534f), to(#c12e2a));
+ background-image: linear-gradient(to bottom, #d9534f 0%, #c12e2a 100%);
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc12e2a', GradientType=0);
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
+ background-repeat: repeat-x;
+ border-color: #b92c28;
+}
+.btn-danger:hover,
+.btn-danger:focus {
+ background-color: #c12e2a;
+ background-position: 0 -15px;
+}
+.btn-danger:active,
+.btn-danger.active {
+ background-color: #c12e2a;
+ border-color: #b92c28;
+}
+.btn-danger.disabled,
+.btn-danger[disabled],
+fieldset[disabled] .btn-danger,
+.btn-danger.disabled:hover,
+.btn-danger[disabled]:hover,
+fieldset[disabled] .btn-danger:hover,
+.btn-danger.disabled:focus,
+.btn-danger[disabled]:focus,
+fieldset[disabled] .btn-danger:focus,
+.btn-danger.disabled.focus,
+.btn-danger[disabled].focus,
+fieldset[disabled] .btn-danger.focus,
+.btn-danger.disabled:active,
+.btn-danger[disabled]:active,
+fieldset[disabled] .btn-danger:active,
+.btn-danger.disabled.active,
+.btn-danger[disabled].active,
+fieldset[disabled] .btn-danger.active {
+ background-color: #c12e2a;
+ background-image: none;
+}
+.thumbnail,
+.img-thumbnail {
+ -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075);
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075);
+}
+.dropdown-menu > li > a:hover,
+.dropdown-menu > li > a:focus {
+ background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);
+ background-image: -o-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#f5f5f5), to(#e8e8e8));
+ background-image: linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);
+ background-color: #e8e8e8;
+}
+.dropdown-menu > .active > a,
+.dropdown-menu > .active > a:hover,
+.dropdown-menu > .active > a:focus {
+ background-image: -webkit-linear-gradient(top, #337ab7 0%, #2e6da4 100%);
+ background-image: -o-linear-gradient(top, #337ab7 0%, #2e6da4 100%);
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#2e6da4));
+ background-image: linear-gradient(to bottom, #337ab7 0%, #2e6da4 100%);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);
+ background-color: #2e6da4;
+}
+.navbar-default {
+ background-image: -webkit-linear-gradient(top, #ffffff 0%, #f8f8f8 100%);
+ background-image: -o-linear-gradient(top, #ffffff 0%, #f8f8f8 100%);
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#f8f8f8));
+ background-image: linear-gradient(to bottom, #ffffff 0%, #f8f8f8 100%);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0);
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
+ border-radius: 4px;
+ -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 5px rgba(0, 0, 0, 0.075);
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 5px rgba(0, 0, 0, 0.075);
+}
+.navbar-default .navbar-nav > .open > a,
+.navbar-default .navbar-nav > .active > a {
+ background-image: -webkit-linear-gradient(top, #dbdbdb 0%, #e2e2e2 100%);
+ background-image: -o-linear-gradient(top, #dbdbdb 0%, #e2e2e2 100%);
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#dbdbdb), to(#e2e2e2));
+ background-image: linear-gradient(to bottom, #dbdbdb 0%, #e2e2e2 100%);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdbdbdb', endColorstr='#ffe2e2e2', GradientType=0);
+ -webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.075);
+ box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.075);
+}
+.navbar-brand,
+.navbar-nav > li > a {
+ text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
+}
+.navbar-inverse {
+ background-image: -webkit-linear-gradient(top, #3c3c3c 0%, #222222 100%);
+ background-image: -o-linear-gradient(top, #3c3c3c 0%, #222222 100%);
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#3c3c3c), to(#222222));
+ background-image: linear-gradient(to bottom, #3c3c3c 0%, #222222 100%);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0);
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
+ border-radius: 4px;
+}
+.navbar-inverse .navbar-nav > .open > a,
+.navbar-inverse .navbar-nav > .active > a {
+ background-image: -webkit-linear-gradient(top, #080808 0%, #0f0f0f 100%);
+ background-image: -o-linear-gradient(top, #080808 0%, #0f0f0f 100%);
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#080808), to(#0f0f0f));
+ background-image: linear-gradient(to bottom, #080808 0%, #0f0f0f 100%);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff080808', endColorstr='#ff0f0f0f', GradientType=0);
+ -webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.25);
+ box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.25);
+}
+.navbar-inverse .navbar-brand,
+.navbar-inverse .navbar-nav > li > a {
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
+}
+.navbar-static-top,
+.navbar-fixed-top,
+.navbar-fixed-bottom {
+ border-radius: 0;
+}
+@media (max-width: 767px) {
+ .navbar .navbar-nav .open .dropdown-menu > .active > a,
+ .navbar .navbar-nav .open .dropdown-menu > .active > a:hover,
+ .navbar .navbar-nav .open .dropdown-menu > .active > a:focus {
+ color: #fff;
+ background-image: -webkit-linear-gradient(top, #337ab7 0%, #2e6da4 100%);
+ background-image: -o-linear-gradient(top, #337ab7 0%, #2e6da4 100%);
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#2e6da4));
+ background-image: linear-gradient(to bottom, #337ab7 0%, #2e6da4 100%);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);
+ }
+}
+.alert {
+ text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2);
+ -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05);
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05);
+}
+.alert-success {
+ background-image: -webkit-linear-gradient(top, #dff0d8 0%, #c8e5bc 100%);
+ background-image: -o-linear-gradient(top, #dff0d8 0%, #c8e5bc 100%);
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#dff0d8), to(#c8e5bc));
+ background-image: linear-gradient(to bottom, #dff0d8 0%, #c8e5bc 100%);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0);
+ border-color: #b2dba1;
+}
+.alert-info {
+ background-image: -webkit-linear-gradient(top, #d9edf7 0%, #b9def0 100%);
+ background-image: -o-linear-gradient(top, #d9edf7 0%, #b9def0 100%);
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#d9edf7), to(#b9def0));
+ background-image: linear-gradient(to bottom, #d9edf7 0%, #b9def0 100%);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0);
+ border-color: #9acfea;
+}
+.alert-warning {
+ background-image: -webkit-linear-gradient(top, #fcf8e3 0%, #f8efc0 100%);
+ background-image: -o-linear-gradient(top, #fcf8e3 0%, #f8efc0 100%);
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#fcf8e3), to(#f8efc0));
+ background-image: linear-gradient(to bottom, #fcf8e3 0%, #f8efc0 100%);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0);
+ border-color: #f5e79e;
+}
+.alert-danger {
+ background-image: -webkit-linear-gradient(top, #f2dede 0%, #e7c3c3 100%);
+ background-image: -o-linear-gradient(top, #f2dede 0%, #e7c3c3 100%);
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#f2dede), to(#e7c3c3));
+ background-image: linear-gradient(to bottom, #f2dede 0%, #e7c3c3 100%);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0);
+ border-color: #dca7a7;
+}
+.progress {
+ background-image: -webkit-linear-gradient(top, #ebebeb 0%, #f5f5f5 100%);
+ background-image: -o-linear-gradient(top, #ebebeb 0%, #f5f5f5 100%);
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#ebebeb), to(#f5f5f5));
+ background-image: linear-gradient(to bottom, #ebebeb 0%, #f5f5f5 100%);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0);
+}
+.progress-bar {
+ background-image: -webkit-linear-gradient(top, #337ab7 0%, #286090 100%);
+ background-image: -o-linear-gradient(top, #337ab7 0%, #286090 100%);
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#286090));
+ background-image: linear-gradient(to bottom, #337ab7 0%, #286090 100%);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff286090', GradientType=0);
+}
+.progress-bar-success {
+ background-image: -webkit-linear-gradient(top, #5cb85c 0%, #449d44 100%);
+ background-image: -o-linear-gradient(top, #5cb85c 0%, #449d44 100%);
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#5cb85c), to(#449d44));
+ background-image: linear-gradient(to bottom, #5cb85c 0%, #449d44 100%);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0);
+}
+.progress-bar-info {
+ background-image: -webkit-linear-gradient(top, #5bc0de 0%, #31b0d5 100%);
+ background-image: -o-linear-gradient(top, #5bc0de 0%, #31b0d5 100%);
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#5bc0de), to(#31b0d5));
+ background-image: linear-gradient(to bottom, #5bc0de 0%, #31b0d5 100%);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0);
+}
+.progress-bar-warning {
+ background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #ec971f 100%);
+ background-image: -o-linear-gradient(top, #f0ad4e 0%, #ec971f 100%);
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#f0ad4e), to(#ec971f));
+ background-image: linear-gradient(to bottom, #f0ad4e 0%, #ec971f 100%);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0);
+}
+.progress-bar-danger {
+ background-image: -webkit-linear-gradient(top, #d9534f 0%, #c9302c 100%);
+ background-image: -o-linear-gradient(top, #d9534f 0%, #c9302c 100%);
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#d9534f), to(#c9302c));
+ background-image: linear-gradient(to bottom, #d9534f 0%, #c9302c 100%);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0);
+}
+.progress-bar-striped {
+ background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+ background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+ background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+}
+.list-group {
+ border-radius: 4px;
+ -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075);
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075);
+}
+.list-group-item.active,
+.list-group-item.active:hover,
+.list-group-item.active:focus {
+ text-shadow: 0 -1px 0 #286090;
+ background-image: -webkit-linear-gradient(top, #337ab7 0%, #2b669a 100%);
+ background-image: -o-linear-gradient(top, #337ab7 0%, #2b669a 100%);
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#2b669a));
+ background-image: linear-gradient(to bottom, #337ab7 0%, #2b669a 100%);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2b669a', GradientType=0);
+ border-color: #2b669a;
+}
+.list-group-item.active .badge,
+.list-group-item.active:hover .badge,
+.list-group-item.active:focus .badge {
+ text-shadow: none;
+}
+.panel {
+ -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
+}
+.panel-default > .panel-heading {
+ background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);
+ background-image: -o-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#f5f5f5), to(#e8e8e8));
+ background-image: linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);
+}
+.panel-primary > .panel-heading {
+ background-image: -webkit-linear-gradient(top, #337ab7 0%, #2e6da4 100%);
+ background-image: -o-linear-gradient(top, #337ab7 0%, #2e6da4 100%);
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#2e6da4));
+ background-image: linear-gradient(to bottom, #337ab7 0%, #2e6da4 100%);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);
+}
+.panel-success > .panel-heading {
+ background-image: -webkit-linear-gradient(top, #dff0d8 0%, #d0e9c6 100%);
+ background-image: -o-linear-gradient(top, #dff0d8 0%, #d0e9c6 100%);
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#dff0d8), to(#d0e9c6));
+ background-image: linear-gradient(to bottom, #dff0d8 0%, #d0e9c6 100%);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0);
+}
+.panel-info > .panel-heading {
+ background-image: -webkit-linear-gradient(top, #d9edf7 0%, #c4e3f3 100%);
+ background-image: -o-linear-gradient(top, #d9edf7 0%, #c4e3f3 100%);
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#d9edf7), to(#c4e3f3));
+ background-image: linear-gradient(to bottom, #d9edf7 0%, #c4e3f3 100%);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0);
+}
+.panel-warning > .panel-heading {
+ background-image: -webkit-linear-gradient(top, #fcf8e3 0%, #faf2cc 100%);
+ background-image: -o-linear-gradient(top, #fcf8e3 0%, #faf2cc 100%);
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#fcf8e3), to(#faf2cc));
+ background-image: linear-gradient(to bottom, #fcf8e3 0%, #faf2cc 100%);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0);
+}
+.panel-danger > .panel-heading {
+ background-image: -webkit-linear-gradient(top, #f2dede 0%, #ebcccc 100%);
+ background-image: -o-linear-gradient(top, #f2dede 0%, #ebcccc 100%);
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#f2dede), to(#ebcccc));
+ background-image: linear-gradient(to bottom, #f2dede 0%, #ebcccc 100%);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0);
+}
+.well {
+ background-image: -webkit-linear-gradient(top, #e8e8e8 0%, #f5f5f5 100%);
+ background-image: -o-linear-gradient(top, #e8e8e8 0%, #f5f5f5 100%);
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#e8e8e8), to(#f5f5f5));
+ background-image: linear-gradient(to bottom, #e8e8e8 0%, #f5f5f5 100%);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0);
+ border-color: #dcdcdc;
+ -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 0 rgba(255, 255, 255, 0.1);
+ box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 0 rgba(255, 255, 255, 0.1);
+}
diff --git a/public_html/data/css/bootstrap-theme.min.css b/public_html/data/css/bootstrap-theme.min.css
new file mode 100644
index 000000000..03a5017b9
--- /dev/null
+++ b/public_html/data/css/bootstrap-theme.min.css
@@ -0,0 +1,14 @@
+/*!
+ * Bootstrap v3.3.5 (http://getbootstrap.com)
+ * Copyright 2011-2016 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ */
+
+/*!
+ * Generated using the Bootstrap Customizer (http://getbootstrap.com/customize/?id=e51bc4b79b5712077b546b4ea577f138)
+ * Config saved to config.json and https://gist.github.com/e51bc4b79b5712077b546b4ea577f138
+ *//*!
+ * Bootstrap v3.3.6 (http://getbootstrap.com)
+ * Copyright 2011-2015 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ */.btn-default,.btn-primary,.btn-success,.btn-info,.btn-warning,.btn-danger{text-shadow:0 -1px 0 rgba(0,0,0,0.2);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.15),0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 0 rgba(255,255,255,0.15),0 1px 1px rgba(0,0,0,0.075)}.btn-default:active,.btn-primary:active,.btn-success:active,.btn-info:active,.btn-warning:active,.btn-danger:active,.btn-default.active,.btn-primary.active,.btn-success.active,.btn-info.active,.btn-warning.active,.btn-danger.active{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn-default.disabled,.btn-primary.disabled,.btn-success.disabled,.btn-info.disabled,.btn-warning.disabled,.btn-danger.disabled,.btn-default[disabled],.btn-primary[disabled],.btn-success[disabled],.btn-info[disabled],.btn-warning[disabled],.btn-danger[disabled],fieldset[disabled] .btn-default,fieldset[disabled] .btn-primary,fieldset[disabled] .btn-success,fieldset[disabled] .btn-info,fieldset[disabled] .btn-warning,fieldset[disabled] .btn-danger{-webkit-box-shadow:none;box-shadow:none}.btn-default .badge,.btn-primary .badge,.btn-success .badge,.btn-info .badge,.btn-warning .badge,.btn-danger .badge{text-shadow:none}.btn:active,.btn.active{background-image:none}.btn-default{background-image:-webkit-linear-gradient(top, #fff 0, #e0e0e0 100%);background-image:-o-linear-gradient(top, #fff 0, #e0e0e0 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #fff), to(#e0e0e0));background-image:linear-gradient(to bottom, #fff 0, #e0e0e0 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background-repeat:repeat-x;border-color:#dbdbdb;text-shadow:0 1px 0 #fff;border-color:#ccc}.btn-default:hover,.btn-default:focus{background-color:#e0e0e0;background-position:0 -15px}.btn-default:active,.btn-default.active{background-color:#e0e0e0;border-color:#dbdbdb}.btn-default.disabled,.btn-default[disabled],fieldset[disabled] .btn-default,.btn-default.disabled:hover,.btn-default[disabled]:hover,fieldset[disabled] .btn-default:hover,.btn-default.disabled:focus,.btn-default[disabled]:focus,fieldset[disabled] .btn-default:focus,.btn-default.disabled.focus,.btn-default[disabled].focus,fieldset[disabled] .btn-default.focus,.btn-default.disabled:active,.btn-default[disabled]:active,fieldset[disabled] .btn-default:active,.btn-default.disabled.active,.btn-default[disabled].active,fieldset[disabled] .btn-default.active{background-color:#e0e0e0;background-image:none}.btn-primary{background-image:-webkit-linear-gradient(top, #337ab7 0, #265a88 100%);background-image:-o-linear-gradient(top, #337ab7 0, #265a88 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #337ab7), to(#265a88));background-image:linear-gradient(to bottom, #337ab7 0, #265a88 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff265a88', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background-repeat:repeat-x;border-color:#245580}.btn-primary:hover,.btn-primary:focus{background-color:#265a88;background-position:0 -15px}.btn-primary:active,.btn-primary.active{background-color:#265a88;border-color:#245580}.btn-primary.disabled,.btn-primary[disabled],fieldset[disabled] .btn-primary,.btn-primary.disabled:hover,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary:hover,.btn-primary.disabled:focus,.btn-primary[disabled]:focus,fieldset[disabled] .btn-primary:focus,.btn-primary.disabled.focus,.btn-primary[disabled].focus,fieldset[disabled] .btn-primary.focus,.btn-primary.disabled:active,.btn-primary[disabled]:active,fieldset[disabled] .btn-primary:active,.btn-primary.disabled.active,.btn-primary[disabled].active,fieldset[disabled] .btn-primary.active{background-color:#265a88;background-image:none}.btn-success{background-image:-webkit-linear-gradient(top, #5cb85c 0, #419641 100%);background-image:-o-linear-gradient(top, #5cb85c 0, #419641 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #5cb85c), to(#419641));background-image:linear-gradient(to bottom, #5cb85c 0, #419641 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background-repeat:repeat-x;border-color:#3e8f3e}.btn-success:hover,.btn-success:focus{background-color:#419641;background-position:0 -15px}.btn-success:active,.btn-success.active{background-color:#419641;border-color:#3e8f3e}.btn-success.disabled,.btn-success[disabled],fieldset[disabled] .btn-success,.btn-success.disabled:hover,.btn-success[disabled]:hover,fieldset[disabled] .btn-success:hover,.btn-success.disabled:focus,.btn-success[disabled]:focus,fieldset[disabled] .btn-success:focus,.btn-success.disabled.focus,.btn-success[disabled].focus,fieldset[disabled] .btn-success.focus,.btn-success.disabled:active,.btn-success[disabled]:active,fieldset[disabled] .btn-success:active,.btn-success.disabled.active,.btn-success[disabled].active,fieldset[disabled] .btn-success.active{background-color:#419641;background-image:none}.btn-info{background-image:-webkit-linear-gradient(top, #5bc0de 0, #2aabd2 100%);background-image:-o-linear-gradient(top, #5bc0de 0, #2aabd2 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #5bc0de), to(#2aabd2));background-image:linear-gradient(to bottom, #5bc0de 0, #2aabd2 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background-repeat:repeat-x;border-color:#28a4c9}.btn-info:hover,.btn-info:focus{background-color:#2aabd2;background-position:0 -15px}.btn-info:active,.btn-info.active{background-color:#2aabd2;border-color:#28a4c9}.btn-info.disabled,.btn-info[disabled],fieldset[disabled] .btn-info,.btn-info.disabled:hover,.btn-info[disabled]:hover,fieldset[disabled] .btn-info:hover,.btn-info.disabled:focus,.btn-info[disabled]:focus,fieldset[disabled] .btn-info:focus,.btn-info.disabled.focus,.btn-info[disabled].focus,fieldset[disabled] .btn-info.focus,.btn-info.disabled:active,.btn-info[disabled]:active,fieldset[disabled] .btn-info:active,.btn-info.disabled.active,.btn-info[disabled].active,fieldset[disabled] .btn-info.active{background-color:#2aabd2;background-image:none}.btn-warning{background-image:-webkit-linear-gradient(top, #f0ad4e 0, #eb9316 100%);background-image:-o-linear-gradient(top, #f0ad4e 0, #eb9316 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #f0ad4e), to(#eb9316));background-image:linear-gradient(to bottom, #f0ad4e 0, #eb9316 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background-repeat:repeat-x;border-color:#e38d13}.btn-warning:hover,.btn-warning:focus{background-color:#eb9316;background-position:0 -15px}.btn-warning:active,.btn-warning.active{background-color:#eb9316;border-color:#e38d13}.btn-warning.disabled,.btn-warning[disabled],fieldset[disabled] .btn-warning,.btn-warning.disabled:hover,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning:hover,.btn-warning.disabled:focus,.btn-warning[disabled]:focus,fieldset[disabled] .btn-warning:focus,.btn-warning.disabled.focus,.btn-warning[disabled].focus,fieldset[disabled] .btn-warning.focus,.btn-warning.disabled:active,.btn-warning[disabled]:active,fieldset[disabled] .btn-warning:active,.btn-warning.disabled.active,.btn-warning[disabled].active,fieldset[disabled] .btn-warning.active{background-color:#eb9316;background-image:none}.btn-danger{background-image:-webkit-linear-gradient(top, #d9534f 0, #c12e2a 100%);background-image:-o-linear-gradient(top, #d9534f 0, #c12e2a 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #d9534f), to(#c12e2a));background-image:linear-gradient(to bottom, #d9534f 0, #c12e2a 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc12e2a', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background-repeat:repeat-x;border-color:#b92c28}.btn-danger:hover,.btn-danger:focus{background-color:#c12e2a;background-position:0 -15px}.btn-danger:active,.btn-danger.active{background-color:#c12e2a;border-color:#b92c28}.btn-danger.disabled,.btn-danger[disabled],fieldset[disabled] .btn-danger,.btn-danger.disabled:hover,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger:hover,.btn-danger.disabled:focus,.btn-danger[disabled]:focus,fieldset[disabled] .btn-danger:focus,.btn-danger.disabled.focus,.btn-danger[disabled].focus,fieldset[disabled] .btn-danger.focus,.btn-danger.disabled:active,.btn-danger[disabled]:active,fieldset[disabled] .btn-danger:active,.btn-danger.disabled.active,.btn-danger[disabled].active,fieldset[disabled] .btn-danger.active{background-color:#c12e2a;background-image:none}.thumbnail,.img-thumbnail{-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.075);box-shadow:0 1px 2px rgba(0,0,0,0.075)}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{background-image:-webkit-linear-gradient(top, #f5f5f5 0, #e8e8e8 100%);background-image:-o-linear-gradient(top, #f5f5f5 0, #e8e8e8 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #f5f5f5), to(#e8e8e8));background-image:linear-gradient(to bottom, #f5f5f5 0, #e8e8e8 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);background-color:#e8e8e8}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{background-image:-webkit-linear-gradient(top, #337ab7 0, #2e6da4 100%);background-image:-o-linear-gradient(top, #337ab7 0, #2e6da4 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #337ab7), to(#2e6da4));background-image:linear-gradient(to bottom, #337ab7 0, #2e6da4 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);background-color:#2e6da4}.navbar-default{background-image:-webkit-linear-gradient(top, #fff 0, #f8f8f8 100%);background-image:-o-linear-gradient(top, #fff 0, #f8f8f8 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #fff), to(#f8f8f8));background-image:linear-gradient(to bottom, #fff 0, #f8f8f8 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);border-radius:4px;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.15),0 1px 5px rgba(0,0,0,0.075);box-shadow:inset 0 1px 0 rgba(255,255,255,0.15),0 1px 5px rgba(0,0,0,0.075)}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.active>a{background-image:-webkit-linear-gradient(top, #dbdbdb 0, #e2e2e2 100%);background-image:-o-linear-gradient(top, #dbdbdb 0, #e2e2e2 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #dbdbdb), to(#e2e2e2));background-image:linear-gradient(to bottom, #dbdbdb 0, #e2e2e2 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdbdbdb', endColorstr='#ffe2e2e2', GradientType=0);-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,0.075);box-shadow:inset 0 3px 9px rgba(0,0,0,0.075)}.navbar-brand,.navbar-nav>li>a{text-shadow:0 1px 0 rgba(255,255,255,0.25)}.navbar-inverse{background-image:-webkit-linear-gradient(top, #3c3c3c 0, #222 100%);background-image:-o-linear-gradient(top, #3c3c3c 0, #222 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #3c3c3c), to(#222));background-image:linear-gradient(to bottom, #3c3c3c 0, #222 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);border-radius:4px}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.active>a{background-image:-webkit-linear-gradient(top, #080808 0, #0f0f0f 100%);background-image:-o-linear-gradient(top, #080808 0, #0f0f0f 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #080808), to(#0f0f0f));background-image:linear-gradient(to bottom, #080808 0, #0f0f0f 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff080808', endColorstr='#ff0f0f0f', GradientType=0);-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,0.25);box-shadow:inset 0 3px 9px rgba(0,0,0,0.25)}.navbar-inverse .navbar-brand,.navbar-inverse .navbar-nav>li>a{text-shadow:0 -1px 0 rgba(0,0,0,0.25)}.navbar-static-top,.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}@media (max-width:767px){.navbar .navbar-nav .open .dropdown-menu>.active>a,.navbar .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar .navbar-nav .open .dropdown-menu>.active>a:focus{color:#fff;background-image:-webkit-linear-gradient(top, #337ab7 0, #2e6da4 100%);background-image:-o-linear-gradient(top, #337ab7 0, #2e6da4 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #337ab7), to(#2e6da4));background-image:linear-gradient(to bottom, #337ab7 0, #2e6da4 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0)}}.alert{text-shadow:0 1px 0 rgba(255,255,255,0.2);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.25),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.25),0 1px 2px rgba(0,0,0,0.05)}.alert-success{background-image:-webkit-linear-gradient(top, #dff0d8 0, #c8e5bc 100%);background-image:-o-linear-gradient(top, #dff0d8 0, #c8e5bc 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #dff0d8), to(#c8e5bc));background-image:linear-gradient(to bottom, #dff0d8 0, #c8e5bc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0);border-color:#b2dba1}.alert-info{background-image:-webkit-linear-gradient(top, #d9edf7 0, #b9def0 100%);background-image:-o-linear-gradient(top, #d9edf7 0, #b9def0 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #d9edf7), to(#b9def0));background-image:linear-gradient(to bottom, #d9edf7 0, #b9def0 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0);border-color:#9acfea}.alert-warning{background-image:-webkit-linear-gradient(top, #fcf8e3 0, #f8efc0 100%);background-image:-o-linear-gradient(top, #fcf8e3 0, #f8efc0 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #fcf8e3), to(#f8efc0));background-image:linear-gradient(to bottom, #fcf8e3 0, #f8efc0 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0);border-color:#f5e79e}.alert-danger{background-image:-webkit-linear-gradient(top, #f2dede 0, #e7c3c3 100%);background-image:-o-linear-gradient(top, #f2dede 0, #e7c3c3 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #f2dede), to(#e7c3c3));background-image:linear-gradient(to bottom, #f2dede 0, #e7c3c3 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0);border-color:#dca7a7}.progress{background-image:-webkit-linear-gradient(top, #ebebeb 0, #f5f5f5 100%);background-image:-o-linear-gradient(top, #ebebeb 0, #f5f5f5 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #ebebeb), to(#f5f5f5));background-image:linear-gradient(to bottom, #ebebeb 0, #f5f5f5 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0)}.progress-bar{background-image:-webkit-linear-gradient(top, #337ab7 0, #286090 100%);background-image:-o-linear-gradient(top, #337ab7 0, #286090 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #337ab7), to(#286090));background-image:linear-gradient(to bottom, #337ab7 0, #286090 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff286090', GradientType=0)}.progress-bar-success{background-image:-webkit-linear-gradient(top, #5cb85c 0, #449d44 100%);background-image:-o-linear-gradient(top, #5cb85c 0, #449d44 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #5cb85c), to(#449d44));background-image:linear-gradient(to bottom, #5cb85c 0, #449d44 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0)}.progress-bar-info{background-image:-webkit-linear-gradient(top, #5bc0de 0, #31b0d5 100%);background-image:-o-linear-gradient(top, #5bc0de 0, #31b0d5 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #5bc0de), to(#31b0d5));background-image:linear-gradient(to bottom, #5bc0de 0, #31b0d5 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0)}.progress-bar-warning{background-image:-webkit-linear-gradient(top, #f0ad4e 0, #ec971f 100%);background-image:-o-linear-gradient(top, #f0ad4e 0, #ec971f 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #f0ad4e), to(#ec971f));background-image:linear-gradient(to bottom, #f0ad4e 0, #ec971f 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0)}.progress-bar-danger{background-image:-webkit-linear-gradient(top, #d9534f 0, #c9302c 100%);background-image:-o-linear-gradient(top, #d9534f 0, #c9302c 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #d9534f), to(#c9302c));background-image:linear-gradient(to bottom, #d9534f 0, #c9302c 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0)}.progress-bar-striped{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.list-group{border-radius:4px;-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.075);box-shadow:0 1px 2px rgba(0,0,0,0.075)}.list-group-item.active,.list-group-item.active:hover,.list-group-item.active:focus{text-shadow:0 -1px 0 #286090;background-image:-webkit-linear-gradient(top, #337ab7 0, #2b669a 100%);background-image:-o-linear-gradient(top, #337ab7 0, #2b669a 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #337ab7), to(#2b669a));background-image:linear-gradient(to bottom, #337ab7 0, #2b669a 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2b669a', GradientType=0);border-color:#2b669a}.list-group-item.active .badge,.list-group-item.active:hover .badge,.list-group-item.active:focus .badge{text-shadow:none}.panel{-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.05);box-shadow:0 1px 2px rgba(0,0,0,0.05)}.panel-default>.panel-heading{background-image:-webkit-linear-gradient(top, #f5f5f5 0, #e8e8e8 100%);background-image:-o-linear-gradient(top, #f5f5f5 0, #e8e8e8 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #f5f5f5), to(#e8e8e8));background-image:linear-gradient(to bottom, #f5f5f5 0, #e8e8e8 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0)}.panel-primary>.panel-heading{background-image:-webkit-linear-gradient(top, #337ab7 0, #2e6da4 100%);background-image:-o-linear-gradient(top, #337ab7 0, #2e6da4 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #337ab7), to(#2e6da4));background-image:linear-gradient(to bottom, #337ab7 0, #2e6da4 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0)}.panel-success>.panel-heading{background-image:-webkit-linear-gradient(top, #dff0d8 0, #d0e9c6 100%);background-image:-o-linear-gradient(top, #dff0d8 0, #d0e9c6 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #dff0d8), to(#d0e9c6));background-image:linear-gradient(to bottom, #dff0d8 0, #d0e9c6 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0)}.panel-info>.panel-heading{background-image:-webkit-linear-gradient(top, #d9edf7 0, #c4e3f3 100%);background-image:-o-linear-gradient(top, #d9edf7 0, #c4e3f3 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #d9edf7), to(#c4e3f3));background-image:linear-gradient(to bottom, #d9edf7 0, #c4e3f3 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0)}.panel-warning>.panel-heading{background-image:-webkit-linear-gradient(top, #fcf8e3 0, #faf2cc 100%);background-image:-o-linear-gradient(top, #fcf8e3 0, #faf2cc 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #fcf8e3), to(#faf2cc));background-image:linear-gradient(to bottom, #fcf8e3 0, #faf2cc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0)}.panel-danger>.panel-heading{background-image:-webkit-linear-gradient(top, #f2dede 0, #ebcccc 100%);background-image:-o-linear-gradient(top, #f2dede 0, #ebcccc 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #f2dede), to(#ebcccc));background-image:linear-gradient(to bottom, #f2dede 0, #ebcccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0)}.well{background-image:-webkit-linear-gradient(top, #e8e8e8 0, #f5f5f5 100%);background-image:-o-linear-gradient(top, #e8e8e8 0, #f5f5f5 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #e8e8e8), to(#f5f5f5));background-image:linear-gradient(to bottom, #e8e8e8 0, #f5f5f5 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0);border-color:#dcdcdc;-webkit-box-shadow:inset 0 1px 3px rgba(0,0,0,0.05),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 3px rgba(0,0,0,0.05),0 1px 0 rgba(255,255,255,0.1)} \ No newline at end of file
diff --git a/public_html/data/css/bootstrap.css b/public_html/data/css/bootstrap.css
new file mode 100644
index 000000000..0c643852f
--- /dev/null
+++ b/public_html/data/css/bootstrap.css
@@ -0,0 +1,6762 @@
+/*!
+ * Bootstrap v3.3.5 (http://getbootstrap.com)
+ * Copyright 2011-2016 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ */
+
+/*!
+ * Generated using the Bootstrap Customizer (http://getbootstrap.com/customize/?id=e51bc4b79b5712077b546b4ea577f138)
+ * Config saved to config.json and https://gist.github.com/e51bc4b79b5712077b546b4ea577f138
+ */
+/*!
+ * Bootstrap v3.3.6 (http://getbootstrap.com)
+ * Copyright 2011-2015 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ */
+/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */
+html {
+ font-family: sans-serif;
+ -ms-text-size-adjust: 100%;
+ -webkit-text-size-adjust: 100%;
+}
+body {
+ margin: 0;
+}
+article,
+aside,
+details,
+figcaption,
+figure,
+footer,
+header,
+hgroup,
+main,
+menu,
+nav,
+section,
+summary {
+ display: block;
+}
+audio,
+canvas,
+progress,
+video {
+ display: inline-block;
+ vertical-align: baseline;
+}
+audio:not([controls]) {
+ display: none;
+ height: 0;
+}
+[hidden],
+template {
+ display: none;
+}
+a {
+ background-color: transparent;
+}
+a:active,
+a:hover {
+ outline: 0;
+}
+abbr[title] {
+ border-bottom: 1px dotted;
+}
+b,
+strong {
+ font-weight: bold;
+}
+dfn {
+ font-style: italic;
+}
+h1 {
+ font-size: 2em;
+ margin: 0.67em 0;
+}
+mark {
+ background: #ff0;
+ color: #000;
+}
+small {
+ font-size: 80%;
+}
+sub,
+sup {
+ font-size: 75%;
+ line-height: 0;
+ position: relative;
+ vertical-align: baseline;
+}
+sup {
+ top: -0.5em;
+}
+sub {
+ bottom: -0.25em;
+}
+img {
+ border: 0;
+}
+svg:not(:root) {
+ overflow: hidden;
+}
+figure {
+ margin: 1em 40px;
+}
+hr {
+ -webkit-box-sizing: content-box;
+ -moz-box-sizing: content-box;
+ box-sizing: content-box;
+ height: 0;
+}
+pre {
+ overflow: auto;
+}
+code,
+kbd,
+pre,
+samp {
+ font-family: monospace, monospace;
+ font-size: 1em;
+}
+button,
+input,
+optgroup,
+select,
+textarea {
+ color: inherit;
+ font: inherit;
+ margin: 0;
+}
+button {
+ overflow: visible;
+}
+button,
+select {
+ text-transform: none;
+}
+button,
+html input[type="button"],
+input[type="reset"],
+input[type="submit"] {
+ -webkit-appearance: button;
+ cursor: pointer;
+}
+button[disabled],
+html input[disabled] {
+ cursor: default;
+}
+button::-moz-focus-inner,
+input::-moz-focus-inner {
+ border: 0;
+ padding: 0;
+}
+input {
+ line-height: normal;
+}
+input[type="checkbox"],
+input[type="radio"] {
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ padding: 0;
+}
+input[type="number"]::-webkit-inner-spin-button,
+input[type="number"]::-webkit-outer-spin-button {
+ height: auto;
+}
+input[type="search"] {
+ -webkit-appearance: textfield;
+ -webkit-box-sizing: content-box;
+ -moz-box-sizing: content-box;
+ box-sizing: content-box;
+}
+input[type="search"]::-webkit-search-cancel-button,
+input[type="search"]::-webkit-search-decoration {
+ -webkit-appearance: none;
+}
+fieldset {
+ border: 1px solid #c0c0c0;
+ margin: 0 2px;
+ padding: 0.35em 0.625em 0.75em;
+}
+legend {
+ border: 0;
+ padding: 0;
+}
+textarea {
+ overflow: auto;
+}
+optgroup {
+ font-weight: bold;
+}
+table {
+ border-collapse: collapse;
+ border-spacing: 0;
+}
+td,
+th {
+ padding: 0;
+}
+/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */
+@media print {
+ *,
+ *:before,
+ *:after {
+ background: transparent !important;
+ color: #000 !important;
+ -webkit-box-shadow: none !important;
+ box-shadow: none !important;
+ text-shadow: none !important;
+ }
+ a,
+ a:visited {
+ text-decoration: underline;
+ }
+ a[href]:after {
+ content: " (" attr(href) ")";
+ }
+ abbr[title]:after {
+ content: " (" attr(title) ")";
+ }
+ a[href^="#"]:after,
+ a[href^="javascript:"]:after {
+ content: "";
+ }
+ pre,
+ blockquote {
+ border: 1px solid #999;
+ page-break-inside: avoid;
+ }
+ thead {
+ display: table-header-group;
+ }
+ tr,
+ img {
+ page-break-inside: avoid;
+ }
+ img {
+ max-width: 100% !important;
+ }
+ p,
+ h2,
+ h3 {
+ orphans: 3;
+ widows: 3;
+ }
+ h2,
+ h3 {
+ page-break-after: avoid;
+ }
+ .navbar {
+ display: none;
+ }
+ .btn > .caret,
+ .dropup > .btn > .caret {
+ border-top-color: #000 !important;
+ }
+ .label {
+ border: 1px solid #000;
+ }
+ .table {
+ border-collapse: collapse !important;
+ }
+ .table td,
+ .table th {
+ background-color: #fff !important;
+ }
+ .table-bordered th,
+ .table-bordered td {
+ border: 1px solid #ddd !important;
+ }
+}
+@font-face {
+ font-family: 'Glyphicons Halflings';
+ src: url('../fonts/glyphicons-halflings-regular.eot');
+ src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff2') format('woff2'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
+}
+.glyphicon {
+ position: relative;
+ top: 1px;
+ display: inline-block;
+ font-family: 'Glyphicons Halflings';
+ font-style: normal;
+ font-weight: normal;
+ line-height: 1;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+.glyphicon-asterisk:before {
+ content: "\002a";
+}
+.glyphicon-plus:before {
+ content: "\002b";
+}
+.glyphicon-euro:before,
+.glyphicon-eur:before {
+ content: "\20ac";
+}
+.glyphicon-minus:before {
+ content: "\2212";
+}
+.glyphicon-cloud:before {
+ content: "\2601";
+}
+.glyphicon-envelope:before {
+ content: "\2709";
+}
+.glyphicon-pencil:before {
+ content: "\270f";
+}
+.glyphicon-glass:before {
+ content: "\e001";
+}
+.glyphicon-music:before {
+ content: "\e002";
+}
+.glyphicon-search:before {
+ content: "\e003";
+}
+.glyphicon-heart:before {
+ content: "\e005";
+}
+.glyphicon-star:before {
+ content: "\e006";
+}
+.glyphicon-star-empty:before {
+ content: "\e007";
+}
+.glyphicon-user:before {
+ content: "\e008";
+}
+.glyphicon-film:before {
+ content: "\e009";
+}
+.glyphicon-th-large:before {
+ content: "\e010";
+}
+.glyphicon-th:before {
+ content: "\e011";
+}
+.glyphicon-th-list:before {
+ content: "\e012";
+}
+.glyphicon-ok:before {
+ content: "\e013";
+}
+.glyphicon-remove:before {
+ content: "\e014";
+}
+.glyphicon-zoom-in:before {
+ content: "\e015";
+}
+.glyphicon-zoom-out:before {
+ content: "\e016";
+}
+.glyphicon-off:before {
+ content: "\e017";
+}
+.glyphicon-signal:before {
+ content: "\e018";
+}
+.glyphicon-cog:before {
+ content: "\e019";
+}
+.glyphicon-trash:before {
+ content: "\e020";
+}
+.glyphicon-home:before {
+ content: "\e021";
+}
+.glyphicon-file:before {
+ content: "\e022";
+}
+.glyphicon-time:before {
+ content: "\e023";
+}
+.glyphicon-road:before {
+ content: "\e024";
+}
+.glyphicon-download-alt:before {
+ content: "\e025";
+}
+.glyphicon-download:before {
+ content: "\e026";
+}
+.glyphicon-upload:before {
+ content: "\e027";
+}
+.glyphicon-inbox:before {
+ content: "\e028";
+}
+.glyphicon-play-circle:before {
+ content: "\e029";
+}
+.glyphicon-repeat:before {
+ content: "\e030";
+}
+.glyphicon-refresh:before {
+ content: "\e031";
+}
+.glyphicon-list-alt:before {
+ content: "\e032";
+}
+.glyphicon-lock:before {
+ content: "\e033";
+}
+.glyphicon-flag:before {
+ content: "\e034";
+}
+.glyphicon-headphones:before {
+ content: "\e035";
+}
+.glyphicon-volume-off:before {
+ content: "\e036";
+}
+.glyphicon-volume-down:before {
+ content: "\e037";
+}
+.glyphicon-volume-up:before {
+ content: "\e038";
+}
+.glyphicon-qrcode:before {
+ content: "\e039";
+}
+.glyphicon-barcode:before {
+ content: "\e040";
+}
+.glyphicon-tag:before {
+ content: "\e041";
+}
+.glyphicon-tags:before {
+ content: "\e042";
+}
+.glyphicon-book:before {
+ content: "\e043";
+}
+.glyphicon-bookmark:before {
+ content: "\e044";
+}
+.glyphicon-print:before {
+ content: "\e045";
+}
+.glyphicon-camera:before {
+ content: "\e046";
+}
+.glyphicon-font:before {
+ content: "\e047";
+}
+.glyphicon-bold:before {
+ content: "\e048";
+}
+.glyphicon-italic:before {
+ content: "\e049";
+}
+.glyphicon-text-height:before {
+ content: "\e050";
+}
+.glyphicon-text-width:before {
+ content: "\e051";
+}
+.glyphicon-align-left:before {
+ content: "\e052";
+}
+.glyphicon-align-center:before {
+ content: "\e053";
+}
+.glyphicon-align-right:before {
+ content: "\e054";
+}
+.glyphicon-align-justify:before {
+ content: "\e055";
+}
+.glyphicon-list:before {
+ content: "\e056";
+}
+.glyphicon-indent-left:before {
+ content: "\e057";
+}
+.glyphicon-indent-right:before {
+ content: "\e058";
+}
+.glyphicon-facetime-video:before {
+ content: "\e059";
+}
+.glyphicon-picture:before {
+ content: "\e060";
+}
+.glyphicon-map-marker:before {
+ content: "\e062";
+}
+.glyphicon-adjust:before {
+ content: "\e063";
+}
+.glyphicon-tint:before {
+ content: "\e064";
+}
+.glyphicon-edit:before {
+ content: "\e065";
+}
+.glyphicon-share:before {
+ content: "\e066";
+}
+.glyphicon-check:before {
+ content: "\e067";
+}
+.glyphicon-move:before {
+ content: "\e068";
+}
+.glyphicon-step-backward:before {
+ content: "\e069";
+}
+.glyphicon-fast-backward:before {
+ content: "\e070";
+}
+.glyphicon-backward:before {
+ content: "\e071";
+}
+.glyphicon-play:before {
+ content: "\e072";
+}
+.glyphicon-pause:before {
+ content: "\e073";
+}
+.glyphicon-stop:before {
+ content: "\e074";
+}
+.glyphicon-forward:before {
+ content: "\e075";
+}
+.glyphicon-fast-forward:before {
+ content: "\e076";
+}
+.glyphicon-step-forward:before {
+ content: "\e077";
+}
+.glyphicon-eject:before {
+ content: "\e078";
+}
+.glyphicon-chevron-left:before {
+ content: "\e079";
+}
+.glyphicon-chevron-right:before {
+ content: "\e080";
+}
+.glyphicon-plus-sign:before {
+ content: "\e081";
+}
+.glyphicon-minus-sign:before {
+ content: "\e082";
+}
+.glyphicon-remove-sign:before {
+ content: "\e083";
+}
+.glyphicon-ok-sign:before {
+ content: "\e084";
+}
+.glyphicon-question-sign:before {
+ content: "\e085";
+}
+.glyphicon-info-sign:before {
+ content: "\e086";
+}
+.glyphicon-screenshot:before {
+ content: "\e087";
+}
+.glyphicon-remove-circle:before {
+ content: "\e088";
+}
+.glyphicon-ok-circle:before {
+ content: "\e089";
+}
+.glyphicon-ban-circle:before {
+ content: "\e090";
+}
+.glyphicon-arrow-left:before {
+ content: "\e091";
+}
+.glyphicon-arrow-right:before {
+ content: "\e092";
+}
+.glyphicon-arrow-up:before {
+ content: "\e093";
+}
+.glyphicon-arrow-down:before {
+ content: "\e094";
+}
+.glyphicon-share-alt:before {
+ content: "\e095";
+}
+.glyphicon-resize-full:before {
+ content: "\e096";
+}
+.glyphicon-resize-small:before {
+ content: "\e097";
+}
+.glyphicon-exclamation-sign:before {
+ content: "\e101";
+}
+.glyphicon-gift:before {
+ content: "\e102";
+}
+.glyphicon-leaf:before {
+ content: "\e103";
+}
+.glyphicon-fire:before {
+ content: "\e104";
+}
+.glyphicon-eye-open:before {
+ content: "\e105";
+}
+.glyphicon-eye-close:before {
+ content: "\e106";
+}
+.glyphicon-warning-sign:before {
+ content: "\e107";
+}
+.glyphicon-plane:before {
+ content: "\e108";
+}
+.glyphicon-calendar:before {
+ content: "\e109";
+}
+.glyphicon-random:before {
+ content: "\e110";
+}
+.glyphicon-comment:before {
+ content: "\e111";
+}
+.glyphicon-magnet:before {
+ content: "\e112";
+}
+.glyphicon-chevron-up:before {
+ content: "\e113";
+}
+.glyphicon-chevron-down:before {
+ content: "\e114";
+}
+.glyphicon-retweet:before {
+ content: "\e115";
+}
+.glyphicon-shopping-cart:before {
+ content: "\e116";
+}
+.glyphicon-folder-close:before {
+ content: "\e117";
+}
+.glyphicon-folder-open:before {
+ content: "\e118";
+}
+.glyphicon-resize-vertical:before {
+ content: "\e119";
+}
+.glyphicon-resize-horizontal:before {
+ content: "\e120";
+}
+.glyphicon-hdd:before {
+ content: "\e121";
+}
+.glyphicon-bullhorn:before {
+ content: "\e122";
+}
+.glyphicon-bell:before {
+ content: "\e123";
+}
+.glyphicon-certificate:before {
+ content: "\e124";
+}
+.glyphicon-thumbs-up:before {
+ content: "\e125";
+}
+.glyphicon-thumbs-down:before {
+ content: "\e126";
+}
+.glyphicon-hand-right:before {
+ content: "\e127";
+}
+.glyphicon-hand-left:before {
+ content: "\e128";
+}
+.glyphicon-hand-up:before {
+ content: "\e129";
+}
+.glyphicon-hand-down:before {
+ content: "\e130";
+}
+.glyphicon-circle-arrow-right:before {
+ content: "\e131";
+}
+.glyphicon-circle-arrow-left:before {
+ content: "\e132";
+}
+.glyphicon-circle-arrow-up:before {
+ content: "\e133";
+}
+.glyphicon-circle-arrow-down:before {
+ content: "\e134";
+}
+.glyphicon-globe:before {
+ content: "\e135";
+}
+.glyphicon-wrench:before {
+ content: "\e136";
+}
+.glyphicon-tasks:before {
+ content: "\e137";
+}
+.glyphicon-filter:before {
+ content: "\e138";
+}
+.glyphicon-briefcase:before {
+ content: "\e139";
+}
+.glyphicon-fullscreen:before {
+ content: "\e140";
+}
+.glyphicon-dashboard:before {
+ content: "\e141";
+}
+.glyphicon-paperclip:before {
+ content: "\e142";
+}
+.glyphicon-heart-empty:before {
+ content: "\e143";
+}
+.glyphicon-link:before {
+ content: "\e144";
+}
+.glyphicon-phone:before {
+ content: "\e145";
+}
+.glyphicon-pushpin:before {
+ content: "\e146";
+}
+.glyphicon-usd:before {
+ content: "\e148";
+}
+.glyphicon-gbp:before {
+ content: "\e149";
+}
+.glyphicon-sort:before {
+ content: "\e150";
+}
+.glyphicon-sort-by-alphabet:before {
+ content: "\e151";
+}
+.glyphicon-sort-by-alphabet-alt:before {
+ content: "\e152";
+}
+.glyphicon-sort-by-order:before {
+ content: "\e153";
+}
+.glyphicon-sort-by-order-alt:before {
+ content: "\e154";
+}
+.glyphicon-sort-by-attributes:before {
+ content: "\e155";
+}
+.glyphicon-sort-by-attributes-alt:before {
+ content: "\e156";
+}
+.glyphicon-unchecked:before {
+ content: "\e157";
+}
+.glyphicon-expand:before {
+ content: "\e158";
+}
+.glyphicon-collapse-down:before {
+ content: "\e159";
+}
+.glyphicon-collapse-up:before {
+ content: "\e160";
+}
+.glyphicon-log-in:before {
+ content: "\e161";
+}
+.glyphicon-flash:before {
+ content: "\e162";
+}
+.glyphicon-log-out:before {
+ content: "\e163";
+}
+.glyphicon-new-window:before {
+ content: "\e164";
+}
+.glyphicon-record:before {
+ content: "\e165";
+}
+.glyphicon-save:before {
+ content: "\e166";
+}
+.glyphicon-open:before {
+ content: "\e167";
+}
+.glyphicon-saved:before {
+ content: "\e168";
+}
+.glyphicon-import:before {
+ content: "\e169";
+}
+.glyphicon-export:before {
+ content: "\e170";
+}
+.glyphicon-send:before {
+ content: "\e171";
+}
+.glyphicon-floppy-disk:before {
+ content: "\e172";
+}
+.glyphicon-floppy-saved:before {
+ content: "\e173";
+}
+.glyphicon-floppy-remove:before {
+ content: "\e174";
+}
+.glyphicon-floppy-save:before {
+ content: "\e175";
+}
+.glyphicon-floppy-open:before {
+ content: "\e176";
+}
+.glyphicon-credit-card:before {
+ content: "\e177";
+}
+.glyphicon-transfer:before {
+ content: "\e178";
+}
+.glyphicon-cutlery:before {
+ content: "\e179";
+}
+.glyphicon-header:before {
+ content: "\e180";
+}
+.glyphicon-compressed:before {
+ content: "\e181";
+}
+.glyphicon-earphone:before {
+ content: "\e182";
+}
+.glyphicon-phone-alt:before {
+ content: "\e183";
+}
+.glyphicon-tower:before {
+ content: "\e184";
+}
+.glyphicon-stats:before {
+ content: "\e185";
+}
+.glyphicon-sd-video:before {
+ content: "\e186";
+}
+.glyphicon-hd-video:before {
+ content: "\e187";
+}
+.glyphicon-subtitles:before {
+ content: "\e188";
+}
+.glyphicon-sound-stereo:before {
+ content: "\e189";
+}
+.glyphicon-sound-dolby:before {
+ content: "\e190";
+}
+.glyphicon-sound-5-1:before {
+ content: "\e191";
+}
+.glyphicon-sound-6-1:before {
+ content: "\e192";
+}
+.glyphicon-sound-7-1:before {
+ content: "\e193";
+}
+.glyphicon-copyright-mark:before {
+ content: "\e194";
+}
+.glyphicon-registration-mark:before {
+ content: "\e195";
+}
+.glyphicon-cloud-download:before {
+ content: "\e197";
+}
+.glyphicon-cloud-upload:before {
+ content: "\e198";
+}
+.glyphicon-tree-conifer:before {
+ content: "\e199";
+}
+.glyphicon-tree-deciduous:before {
+ content: "\e200";
+}
+.glyphicon-cd:before {
+ content: "\e201";
+}
+.glyphicon-save-file:before {
+ content: "\e202";
+}
+.glyphicon-open-file:before {
+ content: "\e203";
+}
+.glyphicon-level-up:before {
+ content: "\e204";
+}
+.glyphicon-copy:before {
+ content: "\e205";
+}
+.glyphicon-paste:before {
+ content: "\e206";
+}
+.glyphicon-alert:before {
+ content: "\e209";
+}
+.glyphicon-equalizer:before {
+ content: "\e210";
+}
+.glyphicon-king:before {
+ content: "\e211";
+}
+.glyphicon-queen:before {
+ content: "\e212";
+}
+.glyphicon-pawn:before {
+ content: "\e213";
+}
+.glyphicon-bishop:before {
+ content: "\e214";
+}
+.glyphicon-knight:before {
+ content: "\e215";
+}
+.glyphicon-baby-formula:before {
+ content: "\e216";
+}
+.glyphicon-tent:before {
+ content: "\26fa";
+}
+.glyphicon-blackboard:before {
+ content: "\e218";
+}
+.glyphicon-bed:before {
+ content: "\e219";
+}
+.glyphicon-apple:before {
+ content: "\f8ff";
+}
+.glyphicon-erase:before {
+ content: "\e221";
+}
+.glyphicon-hourglass:before {
+ content: "\231b";
+}
+.glyphicon-lamp:before {
+ content: "\e223";
+}
+.glyphicon-duplicate:before {
+ content: "\e224";
+}
+.glyphicon-piggy-bank:before {
+ content: "\e225";
+}
+.glyphicon-scissors:before {
+ content: "\e226";
+}
+.glyphicon-bitcoin:before {
+ content: "\e227";
+}
+.glyphicon-btc:before {
+ content: "\e227";
+}
+.glyphicon-xbt:before {
+ content: "\e227";
+}
+.glyphicon-yen:before {
+ content: "\00a5";
+}
+.glyphicon-jpy:before {
+ content: "\00a5";
+}
+.glyphicon-ruble:before {
+ content: "\20bd";
+}
+.glyphicon-rub:before {
+ content: "\20bd";
+}
+.glyphicon-scale:before {
+ content: "\e230";
+}
+.glyphicon-ice-lolly:before {
+ content: "\e231";
+}
+.glyphicon-ice-lolly-tasted:before {
+ content: "\e232";
+}
+.glyphicon-education:before {
+ content: "\e233";
+}
+.glyphicon-option-horizontal:before {
+ content: "\e234";
+}
+.glyphicon-option-vertical:before {
+ content: "\e235";
+}
+.glyphicon-menu-hamburger:before {
+ content: "\e236";
+}
+.glyphicon-modal-window:before {
+ content: "\e237";
+}
+.glyphicon-oil:before {
+ content: "\e238";
+}
+.glyphicon-grain:before {
+ content: "\e239";
+}
+.glyphicon-sunglasses:before {
+ content: "\e240";
+}
+.glyphicon-text-size:before {
+ content: "\e241";
+}
+.glyphicon-text-color:before {
+ content: "\e242";
+}
+.glyphicon-text-background:before {
+ content: "\e243";
+}
+.glyphicon-object-align-top:before {
+ content: "\e244";
+}
+.glyphicon-object-align-bottom:before {
+ content: "\e245";
+}
+.glyphicon-object-align-horizontal:before {
+ content: "\e246";
+}
+.glyphicon-object-align-left:before {
+ content: "\e247";
+}
+.glyphicon-object-align-vertical:before {
+ content: "\e248";
+}
+.glyphicon-object-align-right:before {
+ content: "\e249";
+}
+.glyphicon-triangle-right:before {
+ content: "\e250";
+}
+.glyphicon-triangle-left:before {
+ content: "\e251";
+}
+.glyphicon-triangle-bottom:before {
+ content: "\e252";
+}
+.glyphicon-triangle-top:before {
+ content: "\e253";
+}
+.glyphicon-console:before {
+ content: "\e254";
+}
+.glyphicon-superscript:before {
+ content: "\e255";
+}
+.glyphicon-subscript:before {
+ content: "\e256";
+}
+.glyphicon-menu-left:before {
+ content: "\e257";
+}
+.glyphicon-menu-right:before {
+ content: "\e258";
+}
+.glyphicon-menu-down:before {
+ content: "\e259";
+}
+.glyphicon-menu-up:before {
+ content: "\e260";
+}
+* {
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+}
+*:before,
+*:after {
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+}
+html {
+ font-size: 10px;
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+}
+body {
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
+ font-size: 14px;
+ line-height: 1.42857143;
+ color: #333333;
+ background-color: #ffffff;
+}
+input,
+button,
+select,
+textarea {
+ font-family: inherit;
+ font-size: inherit;
+ line-height: inherit;
+}
+a {
+ color: #337ab7;
+ text-decoration: none;
+}
+a:hover,
+a:focus {
+ color: #23527c;
+ text-decoration: underline;
+}
+a:focus {
+ outline: thin dotted;
+ outline: 5px auto -webkit-focus-ring-color;
+ outline-offset: -2px;
+}
+figure {
+ margin: 0;
+}
+img {
+ vertical-align: middle;
+}
+.img-responsive,
+.thumbnail > img,
+.thumbnail a > img,
+.carousel-inner > .item > img,
+.carousel-inner > .item > a > img {
+ display: block;
+ max-width: 100%;
+ height: auto;
+}
+.img-rounded {
+ border-radius: 6px;
+}
+.img-thumbnail {
+ padding: 4px;
+ line-height: 1.42857143;
+ background-color: #ffffff;
+ border: 1px solid #dddddd;
+ border-radius: 4px;
+ -webkit-transition: all 0.2s ease-in-out;
+ -o-transition: all 0.2s ease-in-out;
+ transition: all 0.2s ease-in-out;
+ display: inline-block;
+ max-width: 100%;
+ height: auto;
+}
+.img-circle {
+ border-radius: 50%;
+}
+hr {
+ margin-top: 20px;
+ margin-bottom: 20px;
+ border: 0;
+ border-top: 1px solid #eeeeee;
+}
+.sr-only {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ margin: -1px;
+ padding: 0;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ border: 0;
+}
+.sr-only-focusable:active,
+.sr-only-focusable:focus {
+ position: static;
+ width: auto;
+ height: auto;
+ margin: 0;
+ overflow: visible;
+ clip: auto;
+}
+[role="button"] {
+ cursor: pointer;
+}
+h1,
+h2,
+h3,
+h4,
+h5,
+h6,
+.h1,
+.h2,
+.h3,
+.h4,
+.h5,
+.h6 {
+ font-family: inherit;
+ font-weight: 500;
+ line-height: 1.1;
+ color: inherit;
+}
+h1 small,
+h2 small,
+h3 small,
+h4 small,
+h5 small,
+h6 small,
+.h1 small,
+.h2 small,
+.h3 small,
+.h4 small,
+.h5 small,
+.h6 small,
+h1 .small,
+h2 .small,
+h3 .small,
+h4 .small,
+h5 .small,
+h6 .small,
+.h1 .small,
+.h2 .small,
+.h3 .small,
+.h4 .small,
+.h5 .small,
+.h6 .small {
+ font-weight: normal;
+ line-height: 1;
+ color: #777777;
+}
+h1,
+.h1,
+h2,
+.h2,
+h3,
+.h3 {
+ margin-top: 20px;
+ margin-bottom: 10px;
+}
+h1 small,
+.h1 small,
+h2 small,
+.h2 small,
+h3 small,
+.h3 small,
+h1 .small,
+.h1 .small,
+h2 .small,
+.h2 .small,
+h3 .small,
+.h3 .small {
+ font-size: 65%;
+}
+h4,
+.h4,
+h5,
+.h5,
+h6,
+.h6 {
+ margin-top: 10px;
+ margin-bottom: 10px;
+}
+h4 small,
+.h4 small,
+h5 small,
+.h5 small,
+h6 small,
+.h6 small,
+h4 .small,
+.h4 .small,
+h5 .small,
+.h5 .small,
+h6 .small,
+.h6 .small {
+ font-size: 75%;
+}
+h1,
+.h1 {
+ font-size: 36px;
+}
+h2,
+.h2 {
+ font-size: 30px;
+}
+h3,
+.h3 {
+ font-size: 24px;
+}
+h4,
+.h4 {
+ font-size: 18px;
+}
+h5,
+.h5 {
+ font-size: 14px;
+}
+h6,
+.h6 {
+ font-size: 12px;
+}
+p {
+ margin: 0 0 10px;
+}
+.lead {
+ margin-bottom: 20px;
+ font-size: 16px;
+ font-weight: 300;
+ line-height: 1.4;
+}
+@media (min-width: 768px) {
+ .lead {
+ font-size: 21px;
+ }
+}
+small,
+.small {
+ font-size: 85%;
+}
+mark,
+.mark {
+ background-color: #fcf8e3;
+ padding: .2em;
+}
+.text-left {
+ text-align: left;
+}
+.text-right {
+ text-align: right;
+}
+.text-center {
+ text-align: center;
+}
+.text-justify {
+ text-align: justify;
+}
+.text-nowrap {
+ white-space: nowrap;
+}
+.text-lowercase {
+ text-transform: lowercase;
+}
+.text-uppercase {
+ text-transform: uppercase;
+}
+.text-capitalize {
+ text-transform: capitalize;
+}
+.text-muted {
+ color: #777777;
+}
+.text-primary {
+ color: #337ab7;
+}
+a.text-primary:hover,
+a.text-primary:focus {
+ color: #286090;
+}
+.text-success {
+ color: #3c763d;
+}
+a.text-success:hover,
+a.text-success:focus {
+ color: #2b542c;
+}
+.text-info {
+ color: #31708f;
+}
+a.text-info:hover,
+a.text-info:focus {
+ color: #245269;
+}
+.text-warning {
+ color: #8a6d3b;
+}
+a.text-warning:hover,
+a.text-warning:focus {
+ color: #66512c;
+}
+.text-danger {
+ color: #a94442;
+}
+a.text-danger:hover,
+a.text-danger:focus {
+ color: #843534;
+}
+.bg-primary {
+ color: #fff;
+ background-color: #337ab7;
+}
+a.bg-primary:hover,
+a.bg-primary:focus {
+ background-color: #286090;
+}
+.bg-success {
+ background-color: #dff0d8;
+}
+a.bg-success:hover,
+a.bg-success:focus {
+ background-color: #c1e2b3;
+}
+.bg-info {
+ background-color: #d9edf7;
+}
+a.bg-info:hover,
+a.bg-info:focus {
+ background-color: #afd9ee;
+}
+.bg-warning {
+ background-color: #fcf8e3;
+}
+a.bg-warning:hover,
+a.bg-warning:focus {
+ background-color: #f7ecb5;
+}
+.bg-danger {
+ background-color: #f2dede;
+}
+a.bg-danger:hover,
+a.bg-danger:focus {
+ background-color: #e4b9b9;
+}
+.page-header {
+ padding-bottom: 9px;
+ margin: 40px 0 20px;
+ border-bottom: 1px solid #eeeeee;
+}
+ul,
+ol {
+ margin-top: 0;
+ margin-bottom: 10px;
+}
+ul ul,
+ol ul,
+ul ol,
+ol ol {
+ margin-bottom: 0;
+}
+.list-unstyled {
+ padding-left: 0;
+ list-style: none;
+}
+.list-inline {
+ padding-left: 0;
+ list-style: none;
+ margin-left: -5px;
+}
+.list-inline > li {
+ display: inline-block;
+ padding-left: 5px;
+ padding-right: 5px;
+}
+dl {
+ margin-top: 0;
+ margin-bottom: 20px;
+}
+dt,
+dd {
+ line-height: 1.42857143;
+}
+dt {
+ font-weight: bold;
+}
+dd {
+ margin-left: 0;
+}
+@media (min-width: 768px) {
+ .dl-horizontal dt {
+ float: left;
+ width: 160px;
+ clear: left;
+ text-align: right;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+ .dl-horizontal dd {
+ margin-left: 180px;
+ }
+}
+abbr[title],
+abbr[data-original-title] {
+ cursor: help;
+ border-bottom: 1px dotted #777777;
+}
+.initialism {
+ font-size: 90%;
+ text-transform: uppercase;
+}
+blockquote {
+ padding: 10px 20px;
+ margin: 0 0 20px;
+ font-size: 17.5px;
+ border-left: 5px solid #eeeeee;
+}
+blockquote p:last-child,
+blockquote ul:last-child,
+blockquote ol:last-child {
+ margin-bottom: 0;
+}
+blockquote footer,
+blockquote small,
+blockquote .small {
+ display: block;
+ font-size: 80%;
+ line-height: 1.42857143;
+ color: #777777;
+}
+blockquote footer:before,
+blockquote small:before,
+blockquote .small:before {
+ content: '\2014 \00A0';
+}
+.blockquote-reverse,
+blockquote.pull-right {
+ padding-right: 15px;
+ padding-left: 0;
+ border-right: 5px solid #eeeeee;
+ border-left: 0;
+ text-align: right;
+}
+.blockquote-reverse footer:before,
+blockquote.pull-right footer:before,
+.blockquote-reverse small:before,
+blockquote.pull-right small:before,
+.blockquote-reverse .small:before,
+blockquote.pull-right .small:before {
+ content: '';
+}
+.blockquote-reverse footer:after,
+blockquote.pull-right footer:after,
+.blockquote-reverse small:after,
+blockquote.pull-right small:after,
+.blockquote-reverse .small:after,
+blockquote.pull-right .small:after {
+ content: '\00A0 \2014';
+}
+address {
+ margin-bottom: 20px;
+ font-style: normal;
+ line-height: 1.42857143;
+}
+code,
+kbd,
+pre,
+samp {
+ font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
+}
+code {
+ padding: 2px 4px;
+ font-size: 90%;
+ color: #c7254e;
+ background-color: #f9f2f4;
+ border-radius: 4px;
+}
+kbd {
+ padding: 2px 4px;
+ font-size: 90%;
+ color: #ffffff;
+ background-color: #333333;
+ border-radius: 3px;
+ -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25);
+ box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25);
+}
+kbd kbd {
+ padding: 0;
+ font-size: 100%;
+ font-weight: bold;
+ -webkit-box-shadow: none;
+ box-shadow: none;
+}
+pre {
+ display: block;
+ padding: 9.5px;
+ margin: 0 0 10px;
+ font-size: 13px;
+ line-height: 1.42857143;
+ word-break: break-all;
+ word-wrap: break-word;
+ color: #333333;
+ background-color: #f5f5f5;
+ border: 1px solid #cccccc;
+ border-radius: 4px;
+}
+pre code {
+ padding: 0;
+ font-size: inherit;
+ color: inherit;
+ white-space: pre-wrap;
+ background-color: transparent;
+ border-radius: 0;
+}
+.pre-scrollable {
+ max-height: 340px;
+ overflow-y: scroll;
+}
+.container {
+ margin-right: auto;
+ margin-left: auto;
+ padding-left: 15px;
+ padding-right: 15px;
+}
+@media (min-width: 768px) {
+ .container {
+ width: 750px;
+ }
+}
+@media (min-width: 992px) {
+ .container {
+ width: 970px;
+ }
+}
+@media (min-width: 1200px) {
+ .container {
+ width: 1170px;
+ }
+}
+.container-fluid {
+ margin-right: auto;
+ margin-left: auto;
+ padding-left: 15px;
+ padding-right: 15px;
+}
+.row {
+ margin-left: -15px;
+ margin-right: -15px;
+}
+.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 {
+ position: relative;
+ min-height: 1px;
+ padding-left: 15px;
+ padding-right: 15px;
+}
+.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 {
+ float: left;
+}
+.col-xs-12 {
+ width: 100%;
+}
+.col-xs-11 {
+ width: 91.66666667%;
+}
+.col-xs-10 {
+ width: 83.33333333%;
+}
+.col-xs-9 {
+ width: 75%;
+}
+.col-xs-8 {
+ width: 66.66666667%;
+}
+.col-xs-7 {
+ width: 58.33333333%;
+}
+.col-xs-6 {
+ width: 50%;
+}
+.col-xs-5 {
+ width: 41.66666667%;
+}
+.col-xs-4 {
+ width: 33.33333333%;
+}
+.col-xs-3 {
+ width: 25%;
+}
+.col-xs-2 {
+ width: 16.66666667%;
+}
+.col-xs-1 {
+ width: 8.33333333%;
+}
+.col-xs-pull-12 {
+ right: 100%;
+}
+.col-xs-pull-11 {
+ right: 91.66666667%;
+}
+.col-xs-pull-10 {
+ right: 83.33333333%;
+}
+.col-xs-pull-9 {
+ right: 75%;
+}
+.col-xs-pull-8 {
+ right: 66.66666667%;
+}
+.col-xs-pull-7 {
+ right: 58.33333333%;
+}
+.col-xs-pull-6 {
+ right: 50%;
+}
+.col-xs-pull-5 {
+ right: 41.66666667%;
+}
+.col-xs-pull-4 {
+ right: 33.33333333%;
+}
+.col-xs-pull-3 {
+ right: 25%;
+}
+.col-xs-pull-2 {
+ right: 16.66666667%;
+}
+.col-xs-pull-1 {
+ right: 8.33333333%;
+}
+.col-xs-pull-0 {
+ right: auto;
+}
+.col-xs-push-12 {
+ left: 100%;
+}
+.col-xs-push-11 {
+ left: 91.66666667%;
+}
+.col-xs-push-10 {
+ left: 83.33333333%;
+}
+.col-xs-push-9 {
+ left: 75%;
+}
+.col-xs-push-8 {
+ left: 66.66666667%;
+}
+.col-xs-push-7 {
+ left: 58.33333333%;
+}
+.col-xs-push-6 {
+ left: 50%;
+}
+.col-xs-push-5 {
+ left: 41.66666667%;
+}
+.col-xs-push-4 {
+ left: 33.33333333%;
+}
+.col-xs-push-3 {
+ left: 25%;
+}
+.col-xs-push-2 {
+ left: 16.66666667%;
+}
+.col-xs-push-1 {
+ left: 8.33333333%;
+}
+.col-xs-push-0 {
+ left: auto;
+}
+.col-xs-offset-12 {
+ margin-left: 100%;
+}
+.col-xs-offset-11 {
+ margin-left: 91.66666667%;
+}
+.col-xs-offset-10 {
+ margin-left: 83.33333333%;
+}
+.col-xs-offset-9 {
+ margin-left: 75%;
+}
+.col-xs-offset-8 {
+ margin-left: 66.66666667%;
+}
+.col-xs-offset-7 {
+ margin-left: 58.33333333%;
+}
+.col-xs-offset-6 {
+ margin-left: 50%;
+}
+.col-xs-offset-5 {
+ margin-left: 41.66666667%;
+}
+.col-xs-offset-4 {
+ margin-left: 33.33333333%;
+}
+.col-xs-offset-3 {
+ margin-left: 25%;
+}
+.col-xs-offset-2 {
+ margin-left: 16.66666667%;
+}
+.col-xs-offset-1 {
+ margin-left: 8.33333333%;
+}
+.col-xs-offset-0 {
+ margin-left: 0%;
+}
+@media (min-width: 768px) {
+ .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 {
+ float: left;
+ }
+ .col-sm-12 {
+ width: 100%;
+ }
+ .col-sm-11 {
+ width: 91.66666667%;
+ }
+ .col-sm-10 {
+ width: 83.33333333%;
+ }
+ .col-sm-9 {
+ width: 75%;
+ }
+ .col-sm-8 {
+ width: 66.66666667%;
+ }
+ .col-sm-7 {
+ width: 58.33333333%;
+ }
+ .col-sm-6 {
+ width: 50%;
+ }
+ .col-sm-5 {
+ width: 41.66666667%;
+ }
+ .col-sm-4 {
+ width: 33.33333333%;
+ }
+ .col-sm-3 {
+ width: 25%;
+ }
+ .col-sm-2 {
+ width: 16.66666667%;
+ }
+ .col-sm-1 {
+ width: 8.33333333%;
+ }
+ .col-sm-pull-12 {
+ right: 100%;
+ }
+ .col-sm-pull-11 {
+ right: 91.66666667%;
+ }
+ .col-sm-pull-10 {
+ right: 83.33333333%;
+ }
+ .col-sm-pull-9 {
+ right: 75%;
+ }
+ .col-sm-pull-8 {
+ right: 66.66666667%;
+ }
+ .col-sm-pull-7 {
+ right: 58.33333333%;
+ }
+ .col-sm-pull-6 {
+ right: 50%;
+ }
+ .col-sm-pull-5 {
+ right: 41.66666667%;
+ }
+ .col-sm-pull-4 {
+ right: 33.33333333%;
+ }
+ .col-sm-pull-3 {
+ right: 25%;
+ }
+ .col-sm-pull-2 {
+ right: 16.66666667%;
+ }
+ .col-sm-pull-1 {
+ right: 8.33333333%;
+ }
+ .col-sm-pull-0 {
+ right: auto;
+ }
+ .col-sm-push-12 {
+ left: 100%;
+ }
+ .col-sm-push-11 {
+ left: 91.66666667%;
+ }
+ .col-sm-push-10 {
+ left: 83.33333333%;
+ }
+ .col-sm-push-9 {
+ left: 75%;
+ }
+ .col-sm-push-8 {
+ left: 66.66666667%;
+ }
+ .col-sm-push-7 {
+ left: 58.33333333%;
+ }
+ .col-sm-push-6 {
+ left: 50%;
+ }
+ .col-sm-push-5 {
+ left: 41.66666667%;
+ }
+ .col-sm-push-4 {
+ left: 33.33333333%;
+ }
+ .col-sm-push-3 {
+ left: 25%;
+ }
+ .col-sm-push-2 {
+ left: 16.66666667%;
+ }
+ .col-sm-push-1 {
+ left: 8.33333333%;
+ }
+ .col-sm-push-0 {
+ left: auto;
+ }
+ .col-sm-offset-12 {
+ margin-left: 100%;
+ }
+ .col-sm-offset-11 {
+ margin-left: 91.66666667%;
+ }
+ .col-sm-offset-10 {
+ margin-left: 83.33333333%;
+ }
+ .col-sm-offset-9 {
+ margin-left: 75%;
+ }
+ .col-sm-offset-8 {
+ margin-left: 66.66666667%;
+ }
+ .col-sm-offset-7 {
+ margin-left: 58.33333333%;
+ }
+ .col-sm-offset-6 {
+ margin-left: 50%;
+ }
+ .col-sm-offset-5 {
+ margin-left: 41.66666667%;
+ }
+ .col-sm-offset-4 {
+ margin-left: 33.33333333%;
+ }
+ .col-sm-offset-3 {
+ margin-left: 25%;
+ }
+ .col-sm-offset-2 {
+ margin-left: 16.66666667%;
+ }
+ .col-sm-offset-1 {
+ margin-left: 8.33333333%;
+ }
+ .col-sm-offset-0 {
+ margin-left: 0%;
+ }
+}
+@media (min-width: 992px) {
+ .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 {
+ float: left;
+ }
+ .col-md-12 {
+ width: 100%;
+ }
+ .col-md-11 {
+ width: 91.66666667%;
+ }
+ .col-md-10 {
+ width: 83.33333333%;
+ }
+ .col-md-9 {
+ width: 75%;
+ }
+ .col-md-8 {
+ width: 66.66666667%;
+ }
+ .col-md-7 {
+ width: 58.33333333%;
+ }
+ .col-md-6 {
+ width: 50%;
+ }
+ .col-md-5 {
+ width: 41.66666667%;
+ }
+ .col-md-4 {
+ width: 33.33333333%;
+ }
+ .col-md-3 {
+ width: 25%;
+ }
+ .col-md-2 {
+ width: 16.66666667%;
+ }
+ .col-md-1 {
+ width: 8.33333333%;
+ }
+ .col-md-pull-12 {
+ right: 100%;
+ }
+ .col-md-pull-11 {
+ right: 91.66666667%;
+ }
+ .col-md-pull-10 {
+ right: 83.33333333%;
+ }
+ .col-md-pull-9 {
+ right: 75%;
+ }
+ .col-md-pull-8 {
+ right: 66.66666667%;
+ }
+ .col-md-pull-7 {
+ right: 58.33333333%;
+ }
+ .col-md-pull-6 {
+ right: 50%;
+ }
+ .col-md-pull-5 {
+ right: 41.66666667%;
+ }
+ .col-md-pull-4 {
+ right: 33.33333333%;
+ }
+ .col-md-pull-3 {
+ right: 25%;
+ }
+ .col-md-pull-2 {
+ right: 16.66666667%;
+ }
+ .col-md-pull-1 {
+ right: 8.33333333%;
+ }
+ .col-md-pull-0 {
+ right: auto;
+ }
+ .col-md-push-12 {
+ left: 100%;
+ }
+ .col-md-push-11 {
+ left: 91.66666667%;
+ }
+ .col-md-push-10 {
+ left: 83.33333333%;
+ }
+ .col-md-push-9 {
+ left: 75%;
+ }
+ .col-md-push-8 {
+ left: 66.66666667%;
+ }
+ .col-md-push-7 {
+ left: 58.33333333%;
+ }
+ .col-md-push-6 {
+ left: 50%;
+ }
+ .col-md-push-5 {
+ left: 41.66666667%;
+ }
+ .col-md-push-4 {
+ left: 33.33333333%;
+ }
+ .col-md-push-3 {
+ left: 25%;
+ }
+ .col-md-push-2 {
+ left: 16.66666667%;
+ }
+ .col-md-push-1 {
+ left: 8.33333333%;
+ }
+ .col-md-push-0 {
+ left: auto;
+ }
+ .col-md-offset-12 {
+ margin-left: 100%;
+ }
+ .col-md-offset-11 {
+ margin-left: 91.66666667%;
+ }
+ .col-md-offset-10 {
+ margin-left: 83.33333333%;
+ }
+ .col-md-offset-9 {
+ margin-left: 75%;
+ }
+ .col-md-offset-8 {
+ margin-left: 66.66666667%;
+ }
+ .col-md-offset-7 {
+ margin-left: 58.33333333%;
+ }
+ .col-md-offset-6 {
+ margin-left: 50%;
+ }
+ .col-md-offset-5 {
+ margin-left: 41.66666667%;
+ }
+ .col-md-offset-4 {
+ margin-left: 33.33333333%;
+ }
+ .col-md-offset-3 {
+ margin-left: 25%;
+ }
+ .col-md-offset-2 {
+ margin-left: 16.66666667%;
+ }
+ .col-md-offset-1 {
+ margin-left: 8.33333333%;
+ }
+ .col-md-offset-0 {
+ margin-left: 0%;
+ }
+}
+@media (min-width: 1200px) {
+ .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 {
+ float: left;
+ }
+ .col-lg-12 {
+ width: 100%;
+ }
+ .col-lg-11 {
+ width: 91.66666667%;
+ }
+ .col-lg-10 {
+ width: 83.33333333%;
+ }
+ .col-lg-9 {
+ width: 75%;
+ }
+ .col-lg-8 {
+ width: 66.66666667%;
+ }
+ .col-lg-7 {
+ width: 58.33333333%;
+ }
+ .col-lg-6 {
+ width: 50%;
+ }
+ .col-lg-5 {
+ width: 41.66666667%;
+ }
+ .col-lg-4 {
+ width: 33.33333333%;
+ }
+ .col-lg-3 {
+ width: 25%;
+ }
+ .col-lg-2 {
+ width: 16.66666667%;
+ }
+ .col-lg-1 {
+ width: 8.33333333%;
+ }
+ .col-lg-pull-12 {
+ right: 100%;
+ }
+ .col-lg-pull-11 {
+ right: 91.66666667%;
+ }
+ .col-lg-pull-10 {
+ right: 83.33333333%;
+ }
+ .col-lg-pull-9 {
+ right: 75%;
+ }
+ .col-lg-pull-8 {
+ right: 66.66666667%;
+ }
+ .col-lg-pull-7 {
+ right: 58.33333333%;
+ }
+ .col-lg-pull-6 {
+ right: 50%;
+ }
+ .col-lg-pull-5 {
+ right: 41.66666667%;
+ }
+ .col-lg-pull-4 {
+ right: 33.33333333%;
+ }
+ .col-lg-pull-3 {
+ right: 25%;
+ }
+ .col-lg-pull-2 {
+ right: 16.66666667%;
+ }
+ .col-lg-pull-1 {
+ right: 8.33333333%;
+ }
+ .col-lg-pull-0 {
+ right: auto;
+ }
+ .col-lg-push-12 {
+ left: 100%;
+ }
+ .col-lg-push-11 {
+ left: 91.66666667%;
+ }
+ .col-lg-push-10 {
+ left: 83.33333333%;
+ }
+ .col-lg-push-9 {
+ left: 75%;
+ }
+ .col-lg-push-8 {
+ left: 66.66666667%;
+ }
+ .col-lg-push-7 {
+ left: 58.33333333%;
+ }
+ .col-lg-push-6 {
+ left: 50%;
+ }
+ .col-lg-push-5 {
+ left: 41.66666667%;
+ }
+ .col-lg-push-4 {
+ left: 33.33333333%;
+ }
+ .col-lg-push-3 {
+ left: 25%;
+ }
+ .col-lg-push-2 {
+ left: 16.66666667%;
+ }
+ .col-lg-push-1 {
+ left: 8.33333333%;
+ }
+ .col-lg-push-0 {
+ left: auto;
+ }
+ .col-lg-offset-12 {
+ margin-left: 100%;
+ }
+ .col-lg-offset-11 {
+ margin-left: 91.66666667%;
+ }
+ .col-lg-offset-10 {
+ margin-left: 83.33333333%;
+ }
+ .col-lg-offset-9 {
+ margin-left: 75%;
+ }
+ .col-lg-offset-8 {
+ margin-left: 66.66666667%;
+ }
+ .col-lg-offset-7 {
+ margin-left: 58.33333333%;
+ }
+ .col-lg-offset-6 {
+ margin-left: 50%;
+ }
+ .col-lg-offset-5 {
+ margin-left: 41.66666667%;
+ }
+ .col-lg-offset-4 {
+ margin-left: 33.33333333%;
+ }
+ .col-lg-offset-3 {
+ margin-left: 25%;
+ }
+ .col-lg-offset-2 {
+ margin-left: 16.66666667%;
+ }
+ .col-lg-offset-1 {
+ margin-left: 8.33333333%;
+ }
+ .col-lg-offset-0 {
+ margin-left: 0%;
+ }
+}
+table {
+ background-color: transparent;
+}
+caption {
+ padding-top: 8px;
+ padding-bottom: 8px;
+ color: #777777;
+ text-align: left;
+}
+th {
+ text-align: left;
+}
+.table {
+ width: 100%;
+ max-width: 100%;
+ margin-bottom: 20px;
+}
+.table > thead > tr > th,
+.table > tbody > tr > th,
+.table > tfoot > tr > th,
+.table > thead > tr > td,
+.table > tbody > tr > td,
+.table > tfoot > tr > td {
+ padding: 8px;
+ line-height: 1.42857143;
+ vertical-align: top;
+ border-top: 1px solid #dddddd;
+}
+.table > thead > tr > th {
+ vertical-align: bottom;
+ border-bottom: 2px solid #dddddd;
+}
+.table > caption + thead > tr:first-child > th,
+.table > colgroup + thead > tr:first-child > th,
+.table > thead:first-child > tr:first-child > th,
+.table > caption + thead > tr:first-child > td,
+.table > colgroup + thead > tr:first-child > td,
+.table > thead:first-child > tr:first-child > td {
+ border-top: 0;
+}
+.table > tbody + tbody {
+ border-top: 2px solid #dddddd;
+}
+.table .table {
+ background-color: #ffffff;
+}
+.table-condensed > thead > tr > th,
+.table-condensed > tbody > tr > th,
+.table-condensed > tfoot > tr > th,
+.table-condensed > thead > tr > td,
+.table-condensed > tbody > tr > td,
+.table-condensed > tfoot > tr > td {
+ padding: 5px;
+}
+.table-bordered {
+ border: 1px solid #dddddd;
+}
+.table-bordered > thead > tr > th,
+.table-bordered > tbody > tr > th,
+.table-bordered > tfoot > tr > th,
+.table-bordered > thead > tr > td,
+.table-bordered > tbody > tr > td,
+.table-bordered > tfoot > tr > td {
+ border: 1px solid #dddddd;
+}
+.table-bordered > thead > tr > th,
+.table-bordered > thead > tr > td {
+ border-bottom-width: 2px;
+}
+.table-striped > tbody > tr:nth-of-type(odd) {
+ background-color: #f9f9f9;
+}
+.table-hover > tbody > tr:hover {
+ background-color: #f5f5f5;
+}
+table col[class*="col-"] {
+ position: static;
+ float: none;
+ display: table-column;
+}
+table td[class*="col-"],
+table th[class*="col-"] {
+ position: static;
+ float: none;
+ display: table-cell;
+}
+.table > thead > tr > td.active,
+.table > tbody > tr > td.active,
+.table > tfoot > tr > td.active,
+.table > thead > tr > th.active,
+.table > tbody > tr > th.active,
+.table > tfoot > tr > th.active,
+.table > thead > tr.active > td,
+.table > tbody > tr.active > td,
+.table > tfoot > tr.active > td,
+.table > thead > tr.active > th,
+.table > tbody > tr.active > th,
+.table > tfoot > tr.active > th {
+ background-color: #f5f5f5;
+}
+.table-hover > tbody > tr > td.active:hover,
+.table-hover > tbody > tr > th.active:hover,
+.table-hover > tbody > tr.active:hover > td,
+.table-hover > tbody > tr:hover > .active,
+.table-hover > tbody > tr.active:hover > th {
+ background-color: #e8e8e8;
+}
+.table > thead > tr > td.success,
+.table > tbody > tr > td.success,
+.table > tfoot > tr > td.success,
+.table > thead > tr > th.success,
+.table > tbody > tr > th.success,
+.table > tfoot > tr > th.success,
+.table > thead > tr.success > td,
+.table > tbody > tr.success > td,
+.table > tfoot > tr.success > td,
+.table > thead > tr.success > th,
+.table > tbody > tr.success > th,
+.table > tfoot > tr.success > th {
+ background-color: #dff0d8;
+}
+.table-hover > tbody > tr > td.success:hover,
+.table-hover > tbody > tr > th.success:hover,
+.table-hover > tbody > tr.success:hover > td,
+.table-hover > tbody > tr:hover > .success,
+.table-hover > tbody > tr.success:hover > th {
+ background-color: #d0e9c6;
+}
+.table > thead > tr > td.info,
+.table > tbody > tr > td.info,
+.table > tfoot > tr > td.info,
+.table > thead > tr > th.info,
+.table > tbody > tr > th.info,
+.table > tfoot > tr > th.info,
+.table > thead > tr.info > td,
+.table > tbody > tr.info > td,
+.table > tfoot > tr.info > td,
+.table > thead > tr.info > th,
+.table > tbody > tr.info > th,
+.table > tfoot > tr.info > th {
+ background-color: #d9edf7;
+}
+.table-hover > tbody > tr > td.info:hover,
+.table-hover > tbody > tr > th.info:hover,
+.table-hover > tbody > tr.info:hover > td,
+.table-hover > tbody > tr:hover > .info,
+.table-hover > tbody > tr.info:hover > th {
+ background-color: #c4e3f3;
+}
+.table > thead > tr > td.warning,
+.table > tbody > tr > td.warning,
+.table > tfoot > tr > td.warning,
+.table > thead > tr > th.warning,
+.table > tbody > tr > th.warning,
+.table > tfoot > tr > th.warning,
+.table > thead > tr.warning > td,
+.table > tbody > tr.warning > td,
+.table > tfoot > tr.warning > td,
+.table > thead > tr.warning > th,
+.table > tbody > tr.warning > th,
+.table > tfoot > tr.warning > th {
+ background-color: #fcf8e3;
+}
+.table-hover > tbody > tr > td.warning:hover,
+.table-hover > tbody > tr > th.warning:hover,
+.table-hover > tbody > tr.warning:hover > td,
+.table-hover > tbody > tr:hover > .warning,
+.table-hover > tbody > tr.warning:hover > th {
+ background-color: #faf2cc;
+}
+.table > thead > tr > td.danger,
+.table > tbody > tr > td.danger,
+.table > tfoot > tr > td.danger,
+.table > thead > tr > th.danger,
+.table > tbody > tr > th.danger,
+.table > tfoot > tr > th.danger,
+.table > thead > tr.danger > td,
+.table > tbody > tr.danger > td,
+.table > tfoot > tr.danger > td,
+.table > thead > tr.danger > th,
+.table > tbody > tr.danger > th,
+.table > tfoot > tr.danger > th {
+ background-color: #f2dede;
+}
+.table-hover > tbody > tr > td.danger:hover,
+.table-hover > tbody > tr > th.danger:hover,
+.table-hover > tbody > tr.danger:hover > td,
+.table-hover > tbody > tr:hover > .danger,
+.table-hover > tbody > tr.danger:hover > th {
+ background-color: #ebcccc;
+}
+.table-responsive {
+ overflow-x: auto;
+ min-height: 0.01%;
+}
+@media screen and (max-width: 767px) {
+ .table-responsive {
+ width: 100%;
+ margin-bottom: 15px;
+ overflow-y: hidden;
+ -ms-overflow-style: -ms-autohiding-scrollbar;
+ border: 1px solid #dddddd;
+ }
+ .table-responsive > .table {
+ margin-bottom: 0;
+ }
+ .table-responsive > .table > thead > tr > th,
+ .table-responsive > .table > tbody > tr > th,
+ .table-responsive > .table > tfoot > tr > th,
+ .table-responsive > .table > thead > tr > td,
+ .table-responsive > .table > tbody > tr > td,
+ .table-responsive > .table > tfoot > tr > td {
+ white-space: nowrap;
+ }
+ .table-responsive > .table-bordered {
+ border: 0;
+ }
+ .table-responsive > .table-bordered > thead > tr > th:first-child,
+ .table-responsive > .table-bordered > tbody > tr > th:first-child,
+ .table-responsive > .table-bordered > tfoot > tr > th:first-child,
+ .table-responsive > .table-bordered > thead > tr > td:first-child,
+ .table-responsive > .table-bordered > tbody > tr > td:first-child,
+ .table-responsive > .table-bordered > tfoot > tr > td:first-child {
+ border-left: 0;
+ }
+ .table-responsive > .table-bordered > thead > tr > th:last-child,
+ .table-responsive > .table-bordered > tbody > tr > th:last-child,
+ .table-responsive > .table-bordered > tfoot > tr > th:last-child,
+ .table-responsive > .table-bordered > thead > tr > td:last-child,
+ .table-responsive > .table-bordered > tbody > tr > td:last-child,
+ .table-responsive > .table-bordered > tfoot > tr > td:last-child {
+ border-right: 0;
+ }
+ .table-responsive > .table-bordered > tbody > tr:last-child > th,
+ .table-responsive > .table-bordered > tfoot > tr:last-child > th,
+ .table-responsive > .table-bordered > tbody > tr:last-child > td,
+ .table-responsive > .table-bordered > tfoot > tr:last-child > td {
+ border-bottom: 0;
+ }
+}
+fieldset {
+ padding: 0;
+ margin: 0;
+ border: 0;
+ min-width: 0;
+}
+legend {
+ display: block;
+ width: 100%;
+ padding: 0;
+ margin-bottom: 20px;
+ font-size: 21px;
+ line-height: inherit;
+ color: #333333;
+ border: 0;
+ border-bottom: 1px solid #e5e5e5;
+}
+label {
+ display: inline-block;
+ max-width: 100%;
+ margin-bottom: 5px;
+ font-weight: bold;
+}
+input[type="search"] {
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+}
+input[type="radio"],
+input[type="checkbox"] {
+ margin: 4px 0 0;
+ margin-top: 1px \9;
+ line-height: normal;
+}
+input[type="file"] {
+ display: block;
+}
+input[type="range"] {
+ display: block;
+ width: 100%;
+}
+select[multiple],
+select[size] {
+ height: auto;
+}
+input[type="file"]:focus,
+input[type="radio"]:focus,
+input[type="checkbox"]:focus {
+ outline: thin dotted;
+ outline: 5px auto -webkit-focus-ring-color;
+ outline-offset: -2px;
+}
+output {
+ display: block;
+ padding-top: 7px;
+ font-size: 14px;
+ line-height: 1.42857143;
+ color: #555555;
+}
+.form-control {
+ display: block;
+ width: 100%;
+ height: 34px;
+ padding: 6px 12px;
+ font-size: 14px;
+ line-height: 1.42857143;
+ color: #555555;
+ background-color: #ffffff;
+ background-image: none;
+ border: 1px solid #cccccc;
+ border-radius: 4px;
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
+ -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;
+ -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
+ transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
+}
+.form-control:focus {
+ border-color: #66afe9;
+ outline: 0;
+ -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
+ box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
+}
+.form-control::-moz-placeholder {
+ color: #999999;
+ opacity: 1;
+}
+.form-control:-ms-input-placeholder {
+ color: #999999;
+}
+.form-control::-webkit-input-placeholder {
+ color: #999999;
+}
+.form-control::-ms-expand {
+ border: 0;
+ background-color: transparent;
+}
+.form-control[disabled],
+.form-control[readonly],
+fieldset[disabled] .form-control {
+ background-color: #eeeeee;
+ opacity: 1;
+}
+.form-control[disabled],
+fieldset[disabled] .form-control {
+ cursor: not-allowed;
+}
+textarea.form-control {
+ height: auto;
+}
+input[type="search"] {
+ -webkit-appearance: none;
+}
+@media screen and (-webkit-min-device-pixel-ratio: 0) {
+ input[type="date"].form-control,
+ input[type="time"].form-control,
+ input[type="datetime-local"].form-control,
+ input[type="month"].form-control {
+ line-height: 34px;
+ }
+ input[type="date"].input-sm,
+ input[type="time"].input-sm,
+ input[type="datetime-local"].input-sm,
+ input[type="month"].input-sm,
+ .input-group-sm input[type="date"],
+ .input-group-sm input[type="time"],
+ .input-group-sm input[type="datetime-local"],
+ .input-group-sm input[type="month"] {
+ line-height: 30px;
+ }
+ input[type="date"].input-lg,
+ input[type="time"].input-lg,
+ input[type="datetime-local"].input-lg,
+ input[type="month"].input-lg,
+ .input-group-lg input[type="date"],
+ .input-group-lg input[type="time"],
+ .input-group-lg input[type="datetime-local"],
+ .input-group-lg input[type="month"] {
+ line-height: 46px;
+ }
+}
+.form-group {
+ margin-bottom: 15px;
+}
+.radio,
+.checkbox {
+ position: relative;
+ display: block;
+ margin-top: 10px;
+ margin-bottom: 10px;
+}
+.radio label,
+.checkbox label {
+ min-height: 20px;
+ padding-left: 20px;
+ margin-bottom: 0;
+ font-weight: normal;
+ cursor: pointer;
+}
+.radio input[type="radio"],
+.radio-inline input[type="radio"],
+.checkbox input[type="checkbox"],
+.checkbox-inline input[type="checkbox"] {
+ position: absolute;
+ margin-left: -20px;
+ margin-top: 4px \9;
+}
+.radio + .radio,
+.checkbox + .checkbox {
+ margin-top: -5px;
+}
+.radio-inline,
+.checkbox-inline {
+ position: relative;
+ display: inline-block;
+ padding-left: 20px;
+ margin-bottom: 0;
+ vertical-align: middle;
+ font-weight: normal;
+ cursor: pointer;
+}
+.radio-inline + .radio-inline,
+.checkbox-inline + .checkbox-inline {
+ margin-top: 0;
+ margin-left: 10px;
+}
+input[type="radio"][disabled],
+input[type="checkbox"][disabled],
+input[type="radio"].disabled,
+input[type="checkbox"].disabled,
+fieldset[disabled] input[type="radio"],
+fieldset[disabled] input[type="checkbox"] {
+ cursor: not-allowed;
+}
+.radio-inline.disabled,
+.checkbox-inline.disabled,
+fieldset[disabled] .radio-inline,
+fieldset[disabled] .checkbox-inline {
+ cursor: not-allowed;
+}
+.radio.disabled label,
+.checkbox.disabled label,
+fieldset[disabled] .radio label,
+fieldset[disabled] .checkbox label {
+ cursor: not-allowed;
+}
+.form-control-static {
+ padding-top: 7px;
+ padding-bottom: 7px;
+ margin-bottom: 0;
+ min-height: 34px;
+}
+.form-control-static.input-lg,
+.form-control-static.input-sm {
+ padding-left: 0;
+ padding-right: 0;
+}
+.input-sm {
+ height: 30px;
+ padding: 5px 10px;
+ font-size: 12px;
+ line-height: 1.5;
+ border-radius: 3px;
+}
+select.input-sm {
+ height: 30px;
+ line-height: 30px;
+}
+textarea.input-sm,
+select[multiple].input-sm {
+ height: auto;
+}
+.form-group-sm .form-control {
+ height: 30px;
+ padding: 5px 10px;
+ font-size: 12px;
+ line-height: 1.5;
+ border-radius: 3px;
+}
+.form-group-sm select.form-control {
+ height: 30px;
+ line-height: 30px;
+}
+.form-group-sm textarea.form-control,
+.form-group-sm select[multiple].form-control {
+ height: auto;
+}
+.form-group-sm .form-control-static {
+ height: 30px;
+ min-height: 32px;
+ padding: 6px 10px;
+ font-size: 12px;
+ line-height: 1.5;
+}
+.input-lg {
+ height: 46px;
+ padding: 10px 16px;
+ font-size: 18px;
+ line-height: 1.3333333;
+ border-radius: 6px;
+}
+select.input-lg {
+ height: 46px;
+ line-height: 46px;
+}
+textarea.input-lg,
+select[multiple].input-lg {
+ height: auto;
+}
+.form-group-lg .form-control {
+ height: 46px;
+ padding: 10px 16px;
+ font-size: 18px;
+ line-height: 1.3333333;
+ border-radius: 6px;
+}
+.form-group-lg select.form-control {
+ height: 46px;
+ line-height: 46px;
+}
+.form-group-lg textarea.form-control,
+.form-group-lg select[multiple].form-control {
+ height: auto;
+}
+.form-group-lg .form-control-static {
+ height: 46px;
+ min-height: 38px;
+ padding: 11px 16px;
+ font-size: 18px;
+ line-height: 1.3333333;
+}
+.has-feedback {
+ position: relative;
+}
+.has-feedback .form-control {
+ padding-right: 42.5px;
+}
+.form-control-feedback {
+ position: absolute;
+ top: 0;
+ right: 0;
+ z-index: 2;
+ display: block;
+ width: 34px;
+ height: 34px;
+ line-height: 34px;
+ text-align: center;
+ pointer-events: none;
+}
+.input-lg + .form-control-feedback,
+.input-group-lg + .form-control-feedback,
+.form-group-lg .form-control + .form-control-feedback {
+ width: 46px;
+ height: 46px;
+ line-height: 46px;
+}
+.input-sm + .form-control-feedback,
+.input-group-sm + .form-control-feedback,
+.form-group-sm .form-control + .form-control-feedback {
+ width: 30px;
+ height: 30px;
+ line-height: 30px;
+}
+.has-success .help-block,
+.has-success .control-label,
+.has-success .radio,
+.has-success .checkbox,
+.has-success .radio-inline,
+.has-success .checkbox-inline,
+.has-success.radio label,
+.has-success.checkbox label,
+.has-success.radio-inline label,
+.has-success.checkbox-inline label {
+ color: #3c763d;
+}
+.has-success .form-control {
+ border-color: #3c763d;
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
+}
+.has-success .form-control:focus {
+ border-color: #2b542c;
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168;
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168;
+}
+.has-success .input-group-addon {
+ color: #3c763d;
+ border-color: #3c763d;
+ background-color: #dff0d8;
+}
+.has-success .form-control-feedback {
+ color: #3c763d;
+}
+.has-warning .help-block,
+.has-warning .control-label,
+.has-warning .radio,
+.has-warning .checkbox,
+.has-warning .radio-inline,
+.has-warning .checkbox-inline,
+.has-warning.radio label,
+.has-warning.checkbox label,
+.has-warning.radio-inline label,
+.has-warning.checkbox-inline label {
+ color: #8a6d3b;
+}
+.has-warning .form-control {
+ border-color: #8a6d3b;
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
+}
+.has-warning .form-control:focus {
+ border-color: #66512c;
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b;
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b;
+}
+.has-warning .input-group-addon {
+ color: #8a6d3b;
+ border-color: #8a6d3b;
+ background-color: #fcf8e3;
+}
+.has-warning .form-control-feedback {
+ color: #8a6d3b;
+}
+.has-error .help-block,
+.has-error .control-label,
+.has-error .radio,
+.has-error .checkbox,
+.has-error .radio-inline,
+.has-error .checkbox-inline,
+.has-error.radio label,
+.has-error.checkbox label,
+.has-error.radio-inline label,
+.has-error.checkbox-inline label {
+ color: #a94442;
+}
+.has-error .form-control {
+ border-color: #a94442;
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
+}
+.has-error .form-control:focus {
+ border-color: #843534;
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483;
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483;
+}
+.has-error .input-group-addon {
+ color: #a94442;
+ border-color: #a94442;
+ background-color: #f2dede;
+}
+.has-error .form-control-feedback {
+ color: #a94442;
+}
+.has-feedback label ~ .form-control-feedback {
+ top: 25px;
+}
+.has-feedback label.sr-only ~ .form-control-feedback {
+ top: 0;
+}
+.help-block {
+ display: block;
+ margin-top: 5px;
+ margin-bottom: 10px;
+ color: #737373;
+}
+@media (min-width: 768px) {
+ .form-inline .form-group {
+ display: inline-block;
+ margin-bottom: 0;
+ vertical-align: middle;
+ }
+ .form-inline .form-control {
+ display: inline-block;
+ width: auto;
+ vertical-align: middle;
+ }
+ .form-inline .form-control-static {
+ display: inline-block;
+ }
+ .form-inline .input-group {
+ display: inline-table;
+ vertical-align: middle;
+ }
+ .form-inline .input-group .input-group-addon,
+ .form-inline .input-group .input-group-btn,
+ .form-inline .input-group .form-control {
+ width: auto;
+ }
+ .form-inline .input-group > .form-control {
+ width: 100%;
+ }
+ .form-inline .control-label {
+ margin-bottom: 0;
+ vertical-align: middle;
+ }
+ .form-inline .radio,
+ .form-inline .checkbox {
+ display: inline-block;
+ margin-top: 0;
+ margin-bottom: 0;
+ vertical-align: middle;
+ }
+ .form-inline .radio label,
+ .form-inline .checkbox label {
+ padding-left: 0;
+ }
+ .form-inline .radio input[type="radio"],
+ .form-inline .checkbox input[type="checkbox"] {
+ position: relative;
+ margin-left: 0;
+ }
+ .form-inline .has-feedback .form-control-feedback {
+ top: 0;
+ }
+}
+.form-horizontal .radio,
+.form-horizontal .checkbox,
+.form-horizontal .radio-inline,
+.form-horizontal .checkbox-inline {
+ margin-top: 0;
+ margin-bottom: 0;
+ padding-top: 7px;
+}
+.form-horizontal .radio,
+.form-horizontal .checkbox {
+ min-height: 27px;
+}
+.form-horizontal .form-group {
+ margin-left: -15px;
+ margin-right: -15px;
+}
+@media (min-width: 768px) {
+ .form-horizontal .control-label {
+ text-align: right;
+ margin-bottom: 0;
+ padding-top: 7px;
+ }
+}
+.form-horizontal .has-feedback .form-control-feedback {
+ right: 15px;
+}
+@media (min-width: 768px) {
+ .form-horizontal .form-group-lg .control-label {
+ padding-top: 11px;
+ font-size: 18px;
+ }
+}
+@media (min-width: 768px) {
+ .form-horizontal .form-group-sm .control-label {
+ padding-top: 6px;
+ font-size: 12px;
+ }
+}
+.btn {
+ display: inline-block;
+ margin-bottom: 0;
+ font-weight: normal;
+ text-align: center;
+ vertical-align: middle;
+ -ms-touch-action: manipulation;
+ touch-action: manipulation;
+ cursor: pointer;
+ background-image: none;
+ border: 1px solid transparent;
+ white-space: nowrap;
+ padding: 6px 12px;
+ font-size: 14px;
+ line-height: 1.42857143;
+ border-radius: 4px;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+.btn:focus,
+.btn:active:focus,
+.btn.active:focus,
+.btn.focus,
+.btn:active.focus,
+.btn.active.focus {
+ outline: thin dotted;
+ outline: 5px auto -webkit-focus-ring-color;
+ outline-offset: -2px;
+}
+.btn:hover,
+.btn:focus,
+.btn.focus {
+ color: #333333;
+ text-decoration: none;
+}
+.btn:active,
+.btn.active {
+ outline: 0;
+ background-image: none;
+ -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
+ box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
+}
+.btn.disabled,
+.btn[disabled],
+fieldset[disabled] .btn {
+ cursor: not-allowed;
+ opacity: 0.65;
+ filter: alpha(opacity=65);
+ -webkit-box-shadow: none;
+ box-shadow: none;
+}
+a.btn.disabled,
+fieldset[disabled] a.btn {
+ pointer-events: none;
+}
+.btn-default {
+ color: #333333;
+ background-color: #ffffff;
+ border-color: #cccccc;
+}
+.btn-default:focus,
+.btn-default.focus {
+ color: #333333;
+ background-color: #e6e6e6;
+ border-color: #8c8c8c;
+}
+.btn-default:hover {
+ color: #333333;
+ background-color: #e6e6e6;
+ border-color: #adadad;
+}
+.btn-default:active,
+.btn-default.active,
+.open > .dropdown-toggle.btn-default {
+ color: #333333;
+ background-color: #e6e6e6;
+ border-color: #adadad;
+}
+.btn-default:active:hover,
+.btn-default.active:hover,
+.open > .dropdown-toggle.btn-default:hover,
+.btn-default:active:focus,
+.btn-default.active:focus,
+.open > .dropdown-toggle.btn-default:focus,
+.btn-default:active.focus,
+.btn-default.active.focus,
+.open > .dropdown-toggle.btn-default.focus {
+ color: #333333;
+ background-color: #d4d4d4;
+ border-color: #8c8c8c;
+}
+.btn-default:active,
+.btn-default.active,
+.open > .dropdown-toggle.btn-default {
+ background-image: none;
+}
+.btn-default.disabled:hover,
+.btn-default[disabled]:hover,
+fieldset[disabled] .btn-default:hover,
+.btn-default.disabled:focus,
+.btn-default[disabled]:focus,
+fieldset[disabled] .btn-default:focus,
+.btn-default.disabled.focus,
+.btn-default[disabled].focus,
+fieldset[disabled] .btn-default.focus {
+ background-color: #ffffff;
+ border-color: #cccccc;
+}
+.btn-default .badge {
+ color: #ffffff;
+ background-color: #333333;
+}
+.btn-primary {
+ color: #ffffff;
+ background-color: #337ab7;
+ border-color: #2e6da4;
+}
+.btn-primary:focus,
+.btn-primary.focus {
+ color: #ffffff;
+ background-color: #286090;
+ border-color: #122b40;
+}
+.btn-primary:hover {
+ color: #ffffff;
+ background-color: #286090;
+ border-color: #204d74;
+}
+.btn-primary:active,
+.btn-primary.active,
+.open > .dropdown-toggle.btn-primary {
+ color: #ffffff;
+ background-color: #286090;
+ border-color: #204d74;
+}
+.btn-primary:active:hover,
+.btn-primary.active:hover,
+.open > .dropdown-toggle.btn-primary:hover,
+.btn-primary:active:focus,
+.btn-primary.active:focus,
+.open > .dropdown-toggle.btn-primary:focus,
+.btn-primary:active.focus,
+.btn-primary.active.focus,
+.open > .dropdown-toggle.btn-primary.focus {
+ color: #ffffff;
+ background-color: #204d74;
+ border-color: #122b40;
+}
+.btn-primary:active,
+.btn-primary.active,
+.open > .dropdown-toggle.btn-primary {
+ background-image: none;
+}
+.btn-primary.disabled:hover,
+.btn-primary[disabled]:hover,
+fieldset[disabled] .btn-primary:hover,
+.btn-primary.disabled:focus,
+.btn-primary[disabled]:focus,
+fieldset[disabled] .btn-primary:focus,
+.btn-primary.disabled.focus,
+.btn-primary[disabled].focus,
+fieldset[disabled] .btn-primary.focus {
+ background-color: #337ab7;
+ border-color: #2e6da4;
+}
+.btn-primary .badge {
+ color: #337ab7;
+ background-color: #ffffff;
+}
+.btn-success {
+ color: #ffffff;
+ background-color: #5cb85c;
+ border-color: #4cae4c;
+}
+.btn-success:focus,
+.btn-success.focus {
+ color: #ffffff;
+ background-color: #449d44;
+ border-color: #255625;
+}
+.btn-success:hover {
+ color: #ffffff;
+ background-color: #449d44;
+ border-color: #398439;
+}
+.btn-success:active,
+.btn-success.active,
+.open > .dropdown-toggle.btn-success {
+ color: #ffffff;
+ background-color: #449d44;
+ border-color: #398439;
+}
+.btn-success:active:hover,
+.btn-success.active:hover,
+.open > .dropdown-toggle.btn-success:hover,
+.btn-success:active:focus,
+.btn-success.active:focus,
+.open > .dropdown-toggle.btn-success:focus,
+.btn-success:active.focus,
+.btn-success.active.focus,
+.open > .dropdown-toggle.btn-success.focus {
+ color: #ffffff;
+ background-color: #398439;
+ border-color: #255625;
+}
+.btn-success:active,
+.btn-success.active,
+.open > .dropdown-toggle.btn-success {
+ background-image: none;
+}
+.btn-success.disabled:hover,
+.btn-success[disabled]:hover,
+fieldset[disabled] .btn-success:hover,
+.btn-success.disabled:focus,
+.btn-success[disabled]:focus,
+fieldset[disabled] .btn-success:focus,
+.btn-success.disabled.focus,
+.btn-success[disabled].focus,
+fieldset[disabled] .btn-success.focus {
+ background-color: #5cb85c;
+ border-color: #4cae4c;
+}
+.btn-success .badge {
+ color: #5cb85c;
+ background-color: #ffffff;
+}
+.btn-info {
+ color: #ffffff;
+ background-color: #5bc0de;
+ border-color: #46b8da;
+}
+.btn-info:focus,
+.btn-info.focus {
+ color: #ffffff;
+ background-color: #31b0d5;
+ border-color: #1b6d85;
+}
+.btn-info:hover {
+ color: #ffffff;
+ background-color: #31b0d5;
+ border-color: #269abc;
+}
+.btn-info:active,
+.btn-info.active,
+.open > .dropdown-toggle.btn-info {
+ color: #ffffff;
+ background-color: #31b0d5;
+ border-color: #269abc;
+}
+.btn-info:active:hover,
+.btn-info.active:hover,
+.open > .dropdown-toggle.btn-info:hover,
+.btn-info:active:focus,
+.btn-info.active:focus,
+.open > .dropdown-toggle.btn-info:focus,
+.btn-info:active.focus,
+.btn-info.active.focus,
+.open > .dropdown-toggle.btn-info.focus {
+ color: #ffffff;
+ background-color: #269abc;
+ border-color: #1b6d85;
+}
+.btn-info:active,
+.btn-info.active,
+.open > .dropdown-toggle.btn-info {
+ background-image: none;
+}
+.btn-info.disabled:hover,
+.btn-info[disabled]:hover,
+fieldset[disabled] .btn-info:hover,
+.btn-info.disabled:focus,
+.btn-info[disabled]:focus,
+fieldset[disabled] .btn-info:focus,
+.btn-info.disabled.focus,
+.btn-info[disabled].focus,
+fieldset[disabled] .btn-info.focus {
+ background-color: #5bc0de;
+ border-color: #46b8da;
+}
+.btn-info .badge {
+ color: #5bc0de;
+ background-color: #ffffff;
+}
+.btn-warning {
+ color: #ffffff;
+ background-color: #f0ad4e;
+ border-color: #eea236;
+}
+.btn-warning:focus,
+.btn-warning.focus {
+ color: #ffffff;
+ background-color: #ec971f;
+ border-color: #985f0d;
+}
+.btn-warning:hover {
+ color: #ffffff;
+ background-color: #ec971f;
+ border-color: #d58512;
+}
+.btn-warning:active,
+.btn-warning.active,
+.open > .dropdown-toggle.btn-warning {
+ color: #ffffff;
+ background-color: #ec971f;
+ border-color: #d58512;
+}
+.btn-warning:active:hover,
+.btn-warning.active:hover,
+.open > .dropdown-toggle.btn-warning:hover,
+.btn-warning:active:focus,
+.btn-warning.active:focus,
+.open > .dropdown-toggle.btn-warning:focus,
+.btn-warning:active.focus,
+.btn-warning.active.focus,
+.open > .dropdown-toggle.btn-warning.focus {
+ color: #ffffff;
+ background-color: #d58512;
+ border-color: #985f0d;
+}
+.btn-warning:active,
+.btn-warning.active,
+.open > .dropdown-toggle.btn-warning {
+ background-image: none;
+}
+.btn-warning.disabled:hover,
+.btn-warning[disabled]:hover,
+fieldset[disabled] .btn-warning:hover,
+.btn-warning.disabled:focus,
+.btn-warning[disabled]:focus,
+fieldset[disabled] .btn-warning:focus,
+.btn-warning.disabled.focus,
+.btn-warning[disabled].focus,
+fieldset[disabled] .btn-warning.focus {
+ background-color: #f0ad4e;
+ border-color: #eea236;
+}
+.btn-warning .badge {
+ color: #f0ad4e;
+ background-color: #ffffff;
+}
+.btn-danger {
+ color: #ffffff;
+ background-color: #d9534f;
+ border-color: #d43f3a;
+}
+.btn-danger:focus,
+.btn-danger.focus {
+ color: #ffffff;
+ background-color: #c9302c;
+ border-color: #761c19;
+}
+.btn-danger:hover {
+ color: #ffffff;
+ background-color: #c9302c;
+ border-color: #ac2925;
+}
+.btn-danger:active,
+.btn-danger.active,
+.open > .dropdown-toggle.btn-danger {
+ color: #ffffff;
+ background-color: #c9302c;
+ border-color: #ac2925;
+}
+.btn-danger:active:hover,
+.btn-danger.active:hover,
+.open > .dropdown-toggle.btn-danger:hover,
+.btn-danger:active:focus,
+.btn-danger.active:focus,
+.open > .dropdown-toggle.btn-danger:focus,
+.btn-danger:active.focus,
+.btn-danger.active.focus,
+.open > .dropdown-toggle.btn-danger.focus {
+ color: #ffffff;
+ background-color: #ac2925;
+ border-color: #761c19;
+}
+.btn-danger:active,
+.btn-danger.active,
+.open > .dropdown-toggle.btn-danger {
+ background-image: none;
+}
+.btn-danger.disabled:hover,
+.btn-danger[disabled]:hover,
+fieldset[disabled] .btn-danger:hover,
+.btn-danger.disabled:focus,
+.btn-danger[disabled]:focus,
+fieldset[disabled] .btn-danger:focus,
+.btn-danger.disabled.focus,
+.btn-danger[disabled].focus,
+fieldset[disabled] .btn-danger.focus {
+ background-color: #d9534f;
+ border-color: #d43f3a;
+}
+.btn-danger .badge {
+ color: #d9534f;
+ background-color: #ffffff;
+}
+.btn-link {
+ color: #337ab7;
+ font-weight: normal;
+ border-radius: 0;
+}
+.btn-link,
+.btn-link:active,
+.btn-link.active,
+.btn-link[disabled],
+fieldset[disabled] .btn-link {
+ background-color: transparent;
+ -webkit-box-shadow: none;
+ box-shadow: none;
+}
+.btn-link,
+.btn-link:hover,
+.btn-link:focus,
+.btn-link:active {
+ border-color: transparent;
+}
+.btn-link:hover,
+.btn-link:focus {
+ color: #23527c;
+ text-decoration: underline;
+ background-color: transparent;
+}
+.btn-link[disabled]:hover,
+fieldset[disabled] .btn-link:hover,
+.btn-link[disabled]:focus,
+fieldset[disabled] .btn-link:focus {
+ color: #777777;
+ text-decoration: none;
+}
+.btn-lg,
+.btn-group-lg > .btn {
+ padding: 10px 16px;
+ font-size: 18px;
+ line-height: 1.3333333;
+ border-radius: 6px;
+}
+.btn-sm,
+.btn-group-sm > .btn {
+ padding: 5px 10px;
+ font-size: 12px;
+ line-height: 1.5;
+ border-radius: 3px;
+}
+.btn-xs,
+.btn-group-xs > .btn {
+ padding: 1px 5px;
+ font-size: 12px;
+ line-height: 1.5;
+ border-radius: 3px;
+}
+.btn-block {
+ display: block;
+ width: 100%;
+}
+.btn-block + .btn-block {
+ margin-top: 5px;
+}
+input[type="submit"].btn-block,
+input[type="reset"].btn-block,
+input[type="button"].btn-block {
+ width: 100%;
+}
+.fade {
+ opacity: 0;
+ -webkit-transition: opacity 0.15s linear;
+ -o-transition: opacity 0.15s linear;
+ transition: opacity 0.15s linear;
+}
+.fade.in {
+ opacity: 1;
+}
+.collapse {
+ display: none;
+}
+.collapse.in {
+ display: block;
+}
+tr.collapse.in {
+ display: table-row;
+}
+tbody.collapse.in {
+ display: table-row-group;
+}
+.collapsing {
+ position: relative;
+ height: 0;
+ overflow: hidden;
+ -webkit-transition-property: height, visibility;
+ -o-transition-property: height, visibility;
+ transition-property: height, visibility;
+ -webkit-transition-duration: 0.35s;
+ -o-transition-duration: 0.35s;
+ transition-duration: 0.35s;
+ -webkit-transition-timing-function: ease;
+ -o-transition-timing-function: ease;
+ transition-timing-function: ease;
+}
+.caret {
+ display: inline-block;
+ width: 0;
+ height: 0;
+ margin-left: 2px;
+ vertical-align: middle;
+ border-top: 4px dashed;
+ border-top: 4px solid \9;
+ border-right: 4px solid transparent;
+ border-left: 4px solid transparent;
+}
+.dropup,
+.dropdown {
+ position: relative;
+}
+.dropdown-toggle:focus {
+ outline: 0;
+}
+.dropdown-menu {
+ position: absolute;
+ top: 100%;
+ left: 0;
+ z-index: 1000;
+ display: none;
+ float: left;
+ min-width: 160px;
+ padding: 5px 0;
+ margin: 2px 0 0;
+ list-style: none;
+ font-size: 14px;
+ text-align: left;
+ background-color: #ffffff;
+ border: 1px solid #cccccc;
+ border: 1px solid rgba(0, 0, 0, 0.15);
+ border-radius: 4px;
+ -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
+ box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
+ -webkit-background-clip: padding-box;
+ background-clip: padding-box;
+}
+.dropdown-menu.pull-right {
+ right: 0;
+ left: auto;
+}
+.dropdown-menu .divider {
+ height: 1px;
+ margin: 9px 0;
+ overflow: hidden;
+ background-color: #e5e5e5;
+}
+.dropdown-menu > li > a {
+ display: block;
+ padding: 3px 20px;
+ clear: both;
+ font-weight: normal;
+ line-height: 1.42857143;
+ color: #333333;
+ white-space: nowrap;
+}
+.dropdown-menu > li > a:hover,
+.dropdown-menu > li > a:focus {
+ text-decoration: none;
+ color: #262626;
+ background-color: #f5f5f5;
+}
+.dropdown-menu > .active > a,
+.dropdown-menu > .active > a:hover,
+.dropdown-menu > .active > a:focus {
+ color: #ffffff;
+ text-decoration: none;
+ outline: 0;
+ background-color: #337ab7;
+}
+.dropdown-menu > .disabled > a,
+.dropdown-menu > .disabled > a:hover,
+.dropdown-menu > .disabled > a:focus {
+ color: #777777;
+}
+.dropdown-menu > .disabled > a:hover,
+.dropdown-menu > .disabled > a:focus {
+ text-decoration: none;
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
+ cursor: not-allowed;
+}
+.open > .dropdown-menu {
+ display: block;
+}
+.open > a {
+ outline: 0;
+}
+.dropdown-menu-right {
+ left: auto;
+ right: 0;
+}
+.dropdown-menu-left {
+ left: 0;
+ right: auto;
+}
+.dropdown-header {
+ display: block;
+ padding: 3px 20px;
+ font-size: 12px;
+ line-height: 1.42857143;
+ color: #777777;
+ white-space: nowrap;
+}
+.dropdown-backdrop {
+ position: fixed;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ top: 0;
+ z-index: 990;
+}
+.pull-right > .dropdown-menu {
+ right: 0;
+ left: auto;
+}
+.dropup .caret,
+.navbar-fixed-bottom .dropdown .caret {
+ border-top: 0;
+ border-bottom: 4px dashed;
+ border-bottom: 4px solid \9;
+ content: "";
+}
+.dropup .dropdown-menu,
+.navbar-fixed-bottom .dropdown .dropdown-menu {
+ top: auto;
+ bottom: 100%;
+ margin-bottom: 2px;
+}
+@media (min-width: 768px) {
+ .navbar-right .dropdown-menu {
+ left: auto;
+ right: 0;
+ }
+ .navbar-right .dropdown-menu-left {
+ left: 0;
+ right: auto;
+ }
+}
+.btn-group,
+.btn-group-vertical {
+ position: relative;
+ display: inline-block;
+ vertical-align: middle;
+}
+.btn-group > .btn,
+.btn-group-vertical > .btn {
+ position: relative;
+ float: left;
+}
+.btn-group > .btn:hover,
+.btn-group-vertical > .btn:hover,
+.btn-group > .btn:focus,
+.btn-group-vertical > .btn:focus,
+.btn-group > .btn:active,
+.btn-group-vertical > .btn:active,
+.btn-group > .btn.active,
+.btn-group-vertical > .btn.active {
+ z-index: 2;
+}
+.btn-group .btn + .btn,
+.btn-group .btn + .btn-group,
+.btn-group .btn-group + .btn,
+.btn-group .btn-group + .btn-group {
+ margin-left: -1px;
+}
+.btn-toolbar {
+ margin-left: -5px;
+}
+.btn-toolbar .btn,
+.btn-toolbar .btn-group,
+.btn-toolbar .input-group {
+ float: left;
+}
+.btn-toolbar > .btn,
+.btn-toolbar > .btn-group,
+.btn-toolbar > .input-group {
+ margin-left: 5px;
+}
+.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) {
+ border-radius: 0;
+}
+.btn-group > .btn:first-child {
+ margin-left: 0;
+}
+.btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) {
+ border-bottom-right-radius: 0;
+ border-top-right-radius: 0;
+}
+.btn-group > .btn:last-child:not(:first-child),
+.btn-group > .dropdown-toggle:not(:first-child) {
+ border-bottom-left-radius: 0;
+ border-top-left-radius: 0;
+}
+.btn-group > .btn-group {
+ float: left;
+}
+.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn {
+ border-radius: 0;
+}
+.btn-group > .btn-group:first-child:not(:last-child) > .btn:last-child,
+.btn-group > .btn-group:first-child:not(:last-child) > .dropdown-toggle {
+ border-bottom-right-radius: 0;
+ border-top-right-radius: 0;
+}
+.btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child {
+ border-bottom-left-radius: 0;
+ border-top-left-radius: 0;
+}
+.btn-group .dropdown-toggle:active,
+.btn-group.open .dropdown-toggle {
+ outline: 0;
+}
+.btn-group > .btn + .dropdown-toggle {
+ padding-left: 8px;
+ padding-right: 8px;
+}
+.btn-group > .btn-lg + .dropdown-toggle {
+ padding-left: 12px;
+ padding-right: 12px;
+}
+.btn-group.open .dropdown-toggle {
+ -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
+ box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
+}
+.btn-group.open .dropdown-toggle.btn-link {
+ -webkit-box-shadow: none;
+ box-shadow: none;
+}
+.btn .caret {
+ margin-left: 0;
+}
+.btn-lg .caret {
+ border-width: 5px 5px 0;
+ border-bottom-width: 0;
+}
+.dropup .btn-lg .caret {
+ border-width: 0 5px 5px;
+}
+.btn-group-vertical > .btn,
+.btn-group-vertical > .btn-group,
+.btn-group-vertical > .btn-group > .btn {
+ display: block;
+ float: none;
+ width: 100%;
+ max-width: 100%;
+}
+.btn-group-vertical > .btn-group > .btn {
+ float: none;
+}
+.btn-group-vertical > .btn + .btn,
+.btn-group-vertical > .btn + .btn-group,
+.btn-group-vertical > .btn-group + .btn,
+.btn-group-vertical > .btn-group + .btn-group {
+ margin-top: -1px;
+ margin-left: 0;
+}
+.btn-group-vertical > .btn:not(:first-child):not(:last-child) {
+ border-radius: 0;
+}
+.btn-group-vertical > .btn:first-child:not(:last-child) {
+ border-top-right-radius: 4px;
+ border-top-left-radius: 4px;
+ border-bottom-right-radius: 0;
+ border-bottom-left-radius: 0;
+}
+.btn-group-vertical > .btn:last-child:not(:first-child) {
+ border-top-right-radius: 0;
+ border-top-left-radius: 0;
+ border-bottom-right-radius: 4px;
+ border-bottom-left-radius: 4px;
+}
+.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn {
+ border-radius: 0;
+}
+.btn-group-vertical > .btn-group:first-child:not(:last-child) > .btn:last-child,
+.btn-group-vertical > .btn-group:first-child:not(:last-child) > .dropdown-toggle {
+ border-bottom-right-radius: 0;
+ border-bottom-left-radius: 0;
+}
+.btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child {
+ border-top-right-radius: 0;
+ border-top-left-radius: 0;
+}
+.btn-group-justified {
+ display: table;
+ width: 100%;
+ table-layout: fixed;
+ border-collapse: separate;
+}
+.btn-group-justified > .btn,
+.btn-group-justified > .btn-group {
+ float: none;
+ display: table-cell;
+ width: 1%;
+}
+.btn-group-justified > .btn-group .btn {
+ width: 100%;
+}
+.btn-group-justified > .btn-group .dropdown-menu {
+ left: auto;
+}
+[data-toggle="buttons"] > .btn input[type="radio"],
+[data-toggle="buttons"] > .btn-group > .btn input[type="radio"],
+[data-toggle="buttons"] > .btn input[type="checkbox"],
+[data-toggle="buttons"] > .btn-group > .btn input[type="checkbox"] {
+ position: absolute;
+ clip: rect(0, 0, 0, 0);
+ pointer-events: none;
+}
+.input-group {
+ position: relative;
+ display: table;
+ border-collapse: separate;
+}
+.input-group[class*="col-"] {
+ float: none;
+ padding-left: 0;
+ padding-right: 0;
+}
+.input-group .form-control {
+ position: relative;
+ z-index: 2;
+ float: left;
+ width: 100%;
+ margin-bottom: 0;
+}
+.input-group .form-control:focus {
+ z-index: 3;
+}
+.input-group-lg > .form-control,
+.input-group-lg > .input-group-addon,
+.input-group-lg > .input-group-btn > .btn {
+ height: 46px;
+ padding: 10px 16px;
+ font-size: 18px;
+ line-height: 1.3333333;
+ border-radius: 6px;
+}
+select.input-group-lg > .form-control,
+select.input-group-lg > .input-group-addon,
+select.input-group-lg > .input-group-btn > .btn {
+ height: 46px;
+ line-height: 46px;
+}
+textarea.input-group-lg > .form-control,
+textarea.input-group-lg > .input-group-addon,
+textarea.input-group-lg > .input-group-btn > .btn,
+select[multiple].input-group-lg > .form-control,
+select[multiple].input-group-lg > .input-group-addon,
+select[multiple].input-group-lg > .input-group-btn > .btn {
+ height: auto;
+}
+.input-group-sm > .form-control,
+.input-group-sm > .input-group-addon,
+.input-group-sm > .input-group-btn > .btn {
+ height: 30px;
+ padding: 5px 10px;
+ font-size: 12px;
+ line-height: 1.5;
+ border-radius: 3px;
+}
+select.input-group-sm > .form-control,
+select.input-group-sm > .input-group-addon,
+select.input-group-sm > .input-group-btn > .btn {
+ height: 30px;
+ line-height: 30px;
+}
+textarea.input-group-sm > .form-control,
+textarea.input-group-sm > .input-group-addon,
+textarea.input-group-sm > .input-group-btn > .btn,
+select[multiple].input-group-sm > .form-control,
+select[multiple].input-group-sm > .input-group-addon,
+select[multiple].input-group-sm > .input-group-btn > .btn {
+ height: auto;
+}
+.input-group-addon,
+.input-group-btn,
+.input-group .form-control {
+ display: table-cell;
+}
+.input-group-addon:not(:first-child):not(:last-child),
+.input-group-btn:not(:first-child):not(:last-child),
+.input-group .form-control:not(:first-child):not(:last-child) {
+ border-radius: 0;
+}
+.input-group-addon,
+.input-group-btn {
+ width: 1%;
+ white-space: nowrap;
+ vertical-align: middle;
+}
+.input-group-addon {
+ padding: 6px 12px;
+ font-size: 14px;
+ font-weight: normal;
+ line-height: 1;
+ color: #555555;
+ text-align: center;
+ background-color: #eeeeee;
+ border: 1px solid #cccccc;
+ border-radius: 4px;
+}
+.input-group-addon.input-sm {
+ padding: 5px 10px;
+ font-size: 12px;
+ border-radius: 3px;
+}
+.input-group-addon.input-lg {
+ padding: 10px 16px;
+ font-size: 18px;
+ border-radius: 6px;
+}
+.input-group-addon input[type="radio"],
+.input-group-addon input[type="checkbox"] {
+ margin-top: 0;
+}
+.input-group .form-control:first-child,
+.input-group-addon:first-child,
+.input-group-btn:first-child > .btn,
+.input-group-btn:first-child > .btn-group > .btn,
+.input-group-btn:first-child > .dropdown-toggle,
+.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle),
+.input-group-btn:last-child > .btn-group:not(:last-child) > .btn {
+ border-bottom-right-radius: 0;
+ border-top-right-radius: 0;
+}
+.input-group-addon:first-child {
+ border-right: 0;
+}
+.input-group .form-control:last-child,
+.input-group-addon:last-child,
+.input-group-btn:last-child > .btn,
+.input-group-btn:last-child > .btn-group > .btn,
+.input-group-btn:last-child > .dropdown-toggle,
+.input-group-btn:first-child > .btn:not(:first-child),
+.input-group-btn:first-child > .btn-group:not(:first-child) > .btn {
+ border-bottom-left-radius: 0;
+ border-top-left-radius: 0;
+}
+.input-group-addon:last-child {
+ border-left: 0;
+}
+.input-group-btn {
+ position: relative;
+ font-size: 0;
+ white-space: nowrap;
+}
+.input-group-btn > .btn {
+ position: relative;
+}
+.input-group-btn > .btn + .btn {
+ margin-left: -1px;
+}
+.input-group-btn > .btn:hover,
+.input-group-btn > .btn:focus,
+.input-group-btn > .btn:active {
+ z-index: 2;
+}
+.input-group-btn:first-child > .btn,
+.input-group-btn:first-child > .btn-group {
+ margin-right: -1px;
+}
+.input-group-btn:last-child > .btn,
+.input-group-btn:last-child > .btn-group {
+ z-index: 2;
+ margin-left: -1px;
+}
+.nav {
+ margin-bottom: 0;
+ padding-left: 0;
+ list-style: none;
+}
+.nav > li {
+ position: relative;
+ display: block;
+}
+.nav > li > a {
+ position: relative;
+ display: block;
+ padding: 10px 15px;
+}
+.nav > li > a:hover,
+.nav > li > a:focus {
+ text-decoration: none;
+ background-color: #eeeeee;
+}
+.nav > li.disabled > a {
+ color: #777777;
+}
+.nav > li.disabled > a:hover,
+.nav > li.disabled > a:focus {
+ color: #777777;
+ text-decoration: none;
+ background-color: transparent;
+ cursor: not-allowed;
+}
+.nav .open > a,
+.nav .open > a:hover,
+.nav .open > a:focus {
+ background-color: #eeeeee;
+ border-color: #337ab7;
+}
+.nav .nav-divider {
+ height: 1px;
+ margin: 9px 0;
+ overflow: hidden;
+ background-color: #e5e5e5;
+}
+.nav > li > a > img {
+ max-width: none;
+}
+.nav-tabs {
+ border-bottom: 1px solid #dddddd;
+}
+.nav-tabs > li {
+ float: left;
+ margin-bottom: -1px;
+}
+.nav-tabs > li > a {
+ margin-right: 2px;
+ line-height: 1.42857143;
+ border: 1px solid transparent;
+ border-radius: 4px 4px 0 0;
+}
+.nav-tabs > li > a:hover {
+ border-color: #eeeeee #eeeeee #dddddd;
+}
+.nav-tabs > li.active > a,
+.nav-tabs > li.active > a:hover,
+.nav-tabs > li.active > a:focus {
+ color: #555555;
+ background-color: #ffffff;
+ border: 1px solid #dddddd;
+ border-bottom-color: transparent;
+ cursor: default;
+}
+.nav-tabs.nav-justified {
+ width: 100%;
+ border-bottom: 0;
+}
+.nav-tabs.nav-justified > li {
+ float: none;
+}
+.nav-tabs.nav-justified > li > a {
+ text-align: center;
+ margin-bottom: 5px;
+}
+.nav-tabs.nav-justified > .dropdown .dropdown-menu {
+ top: auto;
+ left: auto;
+}
+@media (min-width: 768px) {
+ .nav-tabs.nav-justified > li {
+ display: table-cell;
+ width: 1%;
+ }
+ .nav-tabs.nav-justified > li > a {
+ margin-bottom: 0;
+ }
+}
+.nav-tabs.nav-justified > li > a {
+ margin-right: 0;
+ border-radius: 4px;
+}
+.nav-tabs.nav-justified > .active > a,
+.nav-tabs.nav-justified > .active > a:hover,
+.nav-tabs.nav-justified > .active > a:focus {
+ border: 1px solid #dddddd;
+}
+@media (min-width: 768px) {
+ .nav-tabs.nav-justified > li > a {
+ border-bottom: 1px solid #dddddd;
+ border-radius: 4px 4px 0 0;
+ }
+ .nav-tabs.nav-justified > .active > a,
+ .nav-tabs.nav-justified > .active > a:hover,
+ .nav-tabs.nav-justified > .active > a:focus {
+ border-bottom-color: #ffffff;
+ }
+}
+.nav-pills > li {
+ float: left;
+}
+.nav-pills > li > a {
+ border-radius: 4px;
+}
+.nav-pills > li + li {
+ margin-left: 2px;
+}
+.nav-pills > li.active > a,
+.nav-pills > li.active > a:hover,
+.nav-pills > li.active > a:focus {
+ color: #ffffff;
+ background-color: #337ab7;
+}
+.nav-stacked > li {
+ float: none;
+}
+.nav-stacked > li + li {
+ margin-top: 2px;
+ margin-left: 0;
+}
+.nav-justified {
+ width: 100%;
+}
+.nav-justified > li {
+ float: none;
+}
+.nav-justified > li > a {
+ text-align: center;
+ margin-bottom: 5px;
+}
+.nav-justified > .dropdown .dropdown-menu {
+ top: auto;
+ left: auto;
+}
+@media (min-width: 768px) {
+ .nav-justified > li {
+ display: table-cell;
+ width: 1%;
+ }
+ .nav-justified > li > a {
+ margin-bottom: 0;
+ }
+}
+.nav-tabs-justified {
+ border-bottom: 0;
+}
+.nav-tabs-justified > li > a {
+ margin-right: 0;
+ border-radius: 4px;
+}
+.nav-tabs-justified > .active > a,
+.nav-tabs-justified > .active > a:hover,
+.nav-tabs-justified > .active > a:focus {
+ border: 1px solid #dddddd;
+}
+@media (min-width: 768px) {
+ .nav-tabs-justified > li > a {
+ border-bottom: 1px solid #dddddd;
+ border-radius: 4px 4px 0 0;
+ }
+ .nav-tabs-justified > .active > a,
+ .nav-tabs-justified > .active > a:hover,
+ .nav-tabs-justified > .active > a:focus {
+ border-bottom-color: #ffffff;
+ }
+}
+.tab-content > .tab-pane {
+ display: none;
+}
+.tab-content > .active {
+ display: block;
+}
+.nav-tabs .dropdown-menu {
+ margin-top: -1px;
+ border-top-right-radius: 0;
+ border-top-left-radius: 0;
+}
+.navbar {
+ position: relative;
+ min-height: 50px;
+ margin-bottom: 20px;
+ border: 1px solid transparent;
+}
+@media (min-width: 768px) {
+ .navbar {
+ border-radius: 4px;
+ }
+}
+@media (min-width: 768px) {
+ .navbar-header {
+ float: left;
+ }
+}
+.navbar-collapse {
+ overflow-x: visible;
+ padding-right: 15px;
+ padding-left: 15px;
+ border-top: 1px solid transparent;
+ -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
+ -webkit-overflow-scrolling: touch;
+}
+.navbar-collapse.in {
+ overflow-y: auto;
+}
+@media (min-width: 768px) {
+ .navbar-collapse {
+ width: auto;
+ border-top: 0;
+ -webkit-box-shadow: none;
+ box-shadow: none;
+ }
+ .navbar-collapse.collapse {
+ display: block !important;
+ height: auto !important;
+ padding-bottom: 0;
+ overflow: visible !important;
+ }
+ .navbar-collapse.in {
+ overflow-y: visible;
+ }
+ .navbar-fixed-top .navbar-collapse,
+ .navbar-static-top .navbar-collapse,
+ .navbar-fixed-bottom .navbar-collapse {
+ padding-left: 0;
+ padding-right: 0;
+ }
+}
+.navbar-fixed-top .navbar-collapse,
+.navbar-fixed-bottom .navbar-collapse {
+ max-height: 340px;
+}
+@media (max-device-width: 480px) and (orientation: landscape) {
+ .navbar-fixed-top .navbar-collapse,
+ .navbar-fixed-bottom .navbar-collapse {
+ max-height: 200px;
+ }
+}
+.container > .navbar-header,
+.container-fluid > .navbar-header,
+.container > .navbar-collapse,
+.container-fluid > .navbar-collapse {
+ margin-right: -15px;
+ margin-left: -15px;
+}
+@media (min-width: 768px) {
+ .container > .navbar-header,
+ .container-fluid > .navbar-header,
+ .container > .navbar-collapse,
+ .container-fluid > .navbar-collapse {
+ margin-right: 0;
+ margin-left: 0;
+ }
+}
+.navbar-static-top {
+ z-index: 1000;
+ border-width: 0 0 1px;
+}
+@media (min-width: 768px) {
+ .navbar-static-top {
+ border-radius: 0;
+ }
+}
+.navbar-fixed-top,
+.navbar-fixed-bottom {
+ position: fixed;
+ right: 0;
+ left: 0;
+ z-index: 1030;
+}
+@media (min-width: 768px) {
+ .navbar-fixed-top,
+ .navbar-fixed-bottom {
+ border-radius: 0;
+ }
+}
+.navbar-fixed-top {
+ top: 0;
+ border-width: 0 0 1px;
+}
+.navbar-fixed-bottom {
+ bottom: 0;
+ margin-bottom: 0;
+ border-width: 1px 0 0;
+}
+.navbar-brand {
+ float: left;
+ padding: 15px 15px;
+ font-size: 18px;
+ line-height: 20px;
+ height: 50px;
+}
+.navbar-brand:hover,
+.navbar-brand:focus {
+ text-decoration: none;
+}
+.navbar-brand > img {
+ display: block;
+}
+@media (min-width: 768px) {
+ .navbar > .container .navbar-brand,
+ .navbar > .container-fluid .navbar-brand {
+ margin-left: -15px;
+ }
+}
+.navbar-toggle {
+ position: relative;
+ float: right;
+ margin-right: 15px;
+ padding: 9px 10px;
+ margin-top: 8px;
+ margin-bottom: 8px;
+ background-color: transparent;
+ background-image: none;
+ border: 1px solid transparent;
+ border-radius: 4px;
+}
+.navbar-toggle:focus {
+ outline: 0;
+}
+.navbar-toggle .icon-bar {
+ display: block;
+ width: 22px;
+ height: 2px;
+ border-radius: 1px;
+}
+.navbar-toggle .icon-bar + .icon-bar {
+ margin-top: 4px;
+}
+@media (min-width: 768px) {
+ .navbar-toggle {
+ display: none;
+ }
+}
+.navbar-nav {
+ margin: 7.5px -15px;
+}
+.navbar-nav > li > a {
+ padding-top: 10px;
+ padding-bottom: 10px;
+ line-height: 20px;
+}
+@media (max-width: 767px) {
+ .navbar-nav .open .dropdown-menu {
+ position: static;
+ float: none;
+ width: auto;
+ margin-top: 0;
+ background-color: transparent;
+ border: 0;
+ -webkit-box-shadow: none;
+ box-shadow: none;
+ }
+ .navbar-nav .open .dropdown-menu > li > a,
+ .navbar-nav .open .dropdown-menu .dropdown-header {
+ padding: 5px 15px 5px 25px;
+ }
+ .navbar-nav .open .dropdown-menu > li > a {
+ line-height: 20px;
+ }
+ .navbar-nav .open .dropdown-menu > li > a:hover,
+ .navbar-nav .open .dropdown-menu > li > a:focus {
+ background-image: none;
+ }
+}
+@media (min-width: 768px) {
+ .navbar-nav {
+ float: left;
+ margin: 0;
+ }
+ .navbar-nav > li {
+ float: left;
+ }
+ .navbar-nav > li > a {
+ padding-top: 15px;
+ padding-bottom: 15px;
+ }
+}
+.navbar-form {
+ margin-left: -15px;
+ margin-right: -15px;
+ padding: 10px 15px;
+ border-top: 1px solid transparent;
+ border-bottom: 1px solid transparent;
+ -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
+ margin-top: 8px;
+ margin-bottom: 8px;
+}
+@media (min-width: 768px) {
+ .navbar-form .form-group {
+ display: inline-block;
+ margin-bottom: 0;
+ vertical-align: middle;
+ }
+ .navbar-form .form-control {
+ display: inline-block;
+ width: auto;
+ vertical-align: middle;
+ }
+ .navbar-form .form-control-static {
+ display: inline-block;
+ }
+ .navbar-form .input-group {
+ display: inline-table;
+ vertical-align: middle;
+ }
+ .navbar-form .input-group .input-group-addon,
+ .navbar-form .input-group .input-group-btn,
+ .navbar-form .input-group .form-control {
+ width: auto;
+ }
+ .navbar-form .input-group > .form-control {
+ width: 100%;
+ }
+ .navbar-form .control-label {
+ margin-bottom: 0;
+ vertical-align: middle;
+ }
+ .navbar-form .radio,
+ .navbar-form .checkbox {
+ display: inline-block;
+ margin-top: 0;
+ margin-bottom: 0;
+ vertical-align: middle;
+ }
+ .navbar-form .radio label,
+ .navbar-form .checkbox label {
+ padding-left: 0;
+ }
+ .navbar-form .radio input[type="radio"],
+ .navbar-form .checkbox input[type="checkbox"] {
+ position: relative;
+ margin-left: 0;
+ }
+ .navbar-form .has-feedback .form-control-feedback {
+ top: 0;
+ }
+}
+@media (max-width: 767px) {
+ .navbar-form .form-group {
+ margin-bottom: 5px;
+ }
+ .navbar-form .form-group:last-child {
+ margin-bottom: 0;
+ }
+}
+@media (min-width: 768px) {
+ .navbar-form {
+ width: auto;
+ border: 0;
+ margin-left: 0;
+ margin-right: 0;
+ padding-top: 0;
+ padding-bottom: 0;
+ -webkit-box-shadow: none;
+ box-shadow: none;
+ }
+}
+.navbar-nav > li > .dropdown-menu {
+ margin-top: 0;
+ border-top-right-radius: 0;
+ border-top-left-radius: 0;
+}
+.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu {
+ margin-bottom: 0;
+ border-top-right-radius: 4px;
+ border-top-left-radius: 4px;
+ border-bottom-right-radius: 0;
+ border-bottom-left-radius: 0;
+}
+.navbar-btn {
+ margin-top: 8px;
+ margin-bottom: 8px;
+}
+.navbar-btn.btn-sm {
+ margin-top: 10px;
+ margin-bottom: 10px;
+}
+.navbar-btn.btn-xs {
+ margin-top: 14px;
+ margin-bottom: 14px;
+}
+.navbar-text {
+ margin-top: 15px;
+ margin-bottom: 15px;
+}
+@media (min-width: 768px) {
+ .navbar-text {
+ float: left;
+ margin-left: 15px;
+ margin-right: 15px;
+ }
+}
+@media (min-width: 768px) {
+ .navbar-left {
+ float: left !important;
+ }
+ .navbar-right {
+ float: right !important;
+ margin-right: -15px;
+ }
+ .navbar-right ~ .navbar-right {
+ margin-right: 0;
+ }
+}
+.navbar-default {
+ background-color: #f8f8f8;
+ border-color: #e7e7e7;
+}
+.navbar-default .navbar-brand {
+ color: #777777;
+}
+.navbar-default .navbar-brand:hover,
+.navbar-default .navbar-brand:focus {
+ color: #5e5e5e;
+ background-color: transparent;
+}
+.navbar-default .navbar-text {
+ color: #777777;
+}
+.navbar-default .navbar-nav > li > a {
+ color: #777777;
+}
+.navbar-default .navbar-nav > li > a:hover,
+.navbar-default .navbar-nav > li > a:focus {
+ color: #333333;
+ background-color: transparent;
+}
+.navbar-default .navbar-nav > .active > a,
+.navbar-default .navbar-nav > .active > a:hover,
+.navbar-default .navbar-nav > .active > a:focus {
+ color: #555555;
+ background-color: #e7e7e7;
+}
+.navbar-default .navbar-nav > .disabled > a,
+.navbar-default .navbar-nav > .disabled > a:hover,
+.navbar-default .navbar-nav > .disabled > a:focus {
+ color: #cccccc;
+ background-color: transparent;
+}
+.navbar-default .navbar-toggle {
+ border-color: #dddddd;
+}
+.navbar-default .navbar-toggle:hover,
+.navbar-default .navbar-toggle:focus {
+ background-color: #dddddd;
+}
+.navbar-default .navbar-toggle .icon-bar {
+ background-color: #888888;
+}
+.navbar-default .navbar-collapse,
+.navbar-default .navbar-form {
+ border-color: #e7e7e7;
+}
+.navbar-default .navbar-nav > .open > a,
+.navbar-default .navbar-nav > .open > a:hover,
+.navbar-default .navbar-nav > .open > a:focus {
+ background-color: #e7e7e7;
+ color: #555555;
+}
+@media (max-width: 767px) {
+ .navbar-default .navbar-nav .open .dropdown-menu > li > a {
+ color: #777777;
+ }
+ .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover,
+ .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {
+ color: #333333;
+ background-color: transparent;
+ }
+ .navbar-default .navbar-nav .open .dropdown-menu > .active > a,
+ .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover,
+ .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus {
+ color: #555555;
+ background-color: #e7e7e7;
+ }
+ .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a,
+ .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover,
+ .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus {
+ color: #cccccc;
+ background-color: transparent;
+ }
+}
+.navbar-default .navbar-link {
+ color: #777777;
+}
+.navbar-default .navbar-link:hover {
+ color: #333333;
+}
+.navbar-default .btn-link {
+ color: #777777;
+}
+.navbar-default .btn-link:hover,
+.navbar-default .btn-link:focus {
+ color: #333333;
+}
+.navbar-default .btn-link[disabled]:hover,
+fieldset[disabled] .navbar-default .btn-link:hover,
+.navbar-default .btn-link[disabled]:focus,
+fieldset[disabled] .navbar-default .btn-link:focus {
+ color: #cccccc;
+}
+.navbar-inverse {
+ background-color: #222222;
+ border-color: #080808;
+}
+.navbar-inverse .navbar-brand {
+ color: #9d9d9d;
+}
+.navbar-inverse .navbar-brand:hover,
+.navbar-inverse .navbar-brand:focus {
+ color: #ffffff;
+ background-color: transparent;
+}
+.navbar-inverse .navbar-text {
+ color: #9d9d9d;
+}
+.navbar-inverse .navbar-nav > li > a {
+ color: #9d9d9d;
+}
+.navbar-inverse .navbar-nav > li > a:hover,
+.navbar-inverse .navbar-nav > li > a:focus {
+ color: #ffffff;
+ background-color: transparent;
+}
+.navbar-inverse .navbar-nav > .active > a,
+.navbar-inverse .navbar-nav > .active > a:hover,
+.navbar-inverse .navbar-nav > .active > a:focus {
+ color: #ffffff;
+ background-color: #080808;
+}
+.navbar-inverse .navbar-nav > .disabled > a,
+.navbar-inverse .navbar-nav > .disabled > a:hover,
+.navbar-inverse .navbar-nav > .disabled > a:focus {
+ color: #444444;
+ background-color: transparent;
+}
+.navbar-inverse .navbar-toggle {
+ border-color: #333333;
+}
+.navbar-inverse .navbar-toggle:hover,
+.navbar-inverse .navbar-toggle:focus {
+ background-color: #333333;
+}
+.navbar-inverse .navbar-toggle .icon-bar {
+ background-color: #ffffff;
+}
+.navbar-inverse .navbar-collapse,
+.navbar-inverse .navbar-form {
+ border-color: #101010;
+}
+.navbar-inverse .navbar-nav > .open > a,
+.navbar-inverse .navbar-nav > .open > a:hover,
+.navbar-inverse .navbar-nav > .open > a:focus {
+ background-color: #080808;
+ color: #ffffff;
+}
+@media (max-width: 767px) {
+ .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header {
+ border-color: #080808;
+ }
+ .navbar-inverse .navbar-nav .open .dropdown-menu .divider {
+ background-color: #080808;
+ }
+ .navbar-inverse .navbar-nav .open .dropdown-menu > li > a {
+ color: #9d9d9d;
+ }
+ .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover,
+ .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus {
+ color: #ffffff;
+ background-color: transparent;
+ }
+ .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a,
+ .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover,
+ .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus {
+ color: #ffffff;
+ background-color: #080808;
+ }
+ .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a,
+ .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover,
+ .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus {
+ color: #444444;
+ background-color: transparent;
+ }
+}
+.navbar-inverse .navbar-link {
+ color: #9d9d9d;
+}
+.navbar-inverse .navbar-link:hover {
+ color: #ffffff;
+}
+.navbar-inverse .btn-link {
+ color: #9d9d9d;
+}
+.navbar-inverse .btn-link:hover,
+.navbar-inverse .btn-link:focus {
+ color: #ffffff;
+}
+.navbar-inverse .btn-link[disabled]:hover,
+fieldset[disabled] .navbar-inverse .btn-link:hover,
+.navbar-inverse .btn-link[disabled]:focus,
+fieldset[disabled] .navbar-inverse .btn-link:focus {
+ color: #444444;
+}
+.breadcrumb {
+ padding: 8px 15px;
+ margin-bottom: 20px;
+ list-style: none;
+ background-color: #f5f5f5;
+ border-radius: 4px;
+}
+.breadcrumb > li {
+ display: inline-block;
+}
+.breadcrumb > li + li:before {
+ content: "/\00a0";
+ padding: 0 5px;
+ color: #cccccc;
+}
+.breadcrumb > .active {
+ color: #777777;
+}
+.pagination {
+ display: inline-block;
+ padding-left: 0;
+ margin: 20px 0;
+ border-radius: 4px;
+}
+.pagination > li {
+ display: inline;
+}
+.pagination > li > a,
+.pagination > li > span {
+ position: relative;
+ float: left;
+ padding: 6px 12px;
+ line-height: 1.42857143;
+ text-decoration: none;
+ color: #337ab7;
+ background-color: #ffffff;
+ border: 1px solid #dddddd;
+ margin-left: -1px;
+}
+.pagination > li:first-child > a,
+.pagination > li:first-child > span {
+ margin-left: 0;
+ border-bottom-left-radius: 4px;
+ border-top-left-radius: 4px;
+}
+.pagination > li:last-child > a,
+.pagination > li:last-child > span {
+ border-bottom-right-radius: 4px;
+ border-top-right-radius: 4px;
+}
+.pagination > li > a:hover,
+.pagination > li > span:hover,
+.pagination > li > a:focus,
+.pagination > li > span:focus {
+ z-index: 2;
+ color: #23527c;
+ background-color: #eeeeee;
+ border-color: #dddddd;
+}
+.pagination > .active > a,
+.pagination > .active > span,
+.pagination > .active > a:hover,
+.pagination > .active > span:hover,
+.pagination > .active > a:focus,
+.pagination > .active > span:focus {
+ z-index: 3;
+ color: #ffffff;
+ background-color: #337ab7;
+ border-color: #337ab7;
+ cursor: default;
+}
+.pagination > .disabled > span,
+.pagination > .disabled > span:hover,
+.pagination > .disabled > span:focus,
+.pagination > .disabled > a,
+.pagination > .disabled > a:hover,
+.pagination > .disabled > a:focus {
+ color: #777777;
+ background-color: #ffffff;
+ border-color: #dddddd;
+ cursor: not-allowed;
+}
+.pagination-lg > li > a,
+.pagination-lg > li > span {
+ padding: 10px 16px;
+ font-size: 18px;
+ line-height: 1.3333333;
+}
+.pagination-lg > li:first-child > a,
+.pagination-lg > li:first-child > span {
+ border-bottom-left-radius: 6px;
+ border-top-left-radius: 6px;
+}
+.pagination-lg > li:last-child > a,
+.pagination-lg > li:last-child > span {
+ border-bottom-right-radius: 6px;
+ border-top-right-radius: 6px;
+}
+.pagination-sm > li > a,
+.pagination-sm > li > span {
+ padding: 5px 10px;
+ font-size: 12px;
+ line-height: 1.5;
+}
+.pagination-sm > li:first-child > a,
+.pagination-sm > li:first-child > span {
+ border-bottom-left-radius: 3px;
+ border-top-left-radius: 3px;
+}
+.pagination-sm > li:last-child > a,
+.pagination-sm > li:last-child > span {
+ border-bottom-right-radius: 3px;
+ border-top-right-radius: 3px;
+}
+.pager {
+ padding-left: 0;
+ margin: 20px 0;
+ list-style: none;
+ text-align: center;
+}
+.pager li {
+ display: inline;
+}
+.pager li > a,
+.pager li > span {
+ display: inline-block;
+ padding: 5px 14px;
+ background-color: #ffffff;
+ border: 1px solid #dddddd;
+ border-radius: 15px;
+}
+.pager li > a:hover,
+.pager li > a:focus {
+ text-decoration: none;
+ background-color: #eeeeee;
+}
+.pager .next > a,
+.pager .next > span {
+ float: right;
+}
+.pager .previous > a,
+.pager .previous > span {
+ float: left;
+}
+.pager .disabled > a,
+.pager .disabled > a:hover,
+.pager .disabled > a:focus,
+.pager .disabled > span {
+ color: #777777;
+ background-color: #ffffff;
+ cursor: not-allowed;
+}
+.label {
+ display: inline;
+ padding: .2em .6em .3em;
+ font-size: 75%;
+ font-weight: bold;
+ line-height: 1;
+ color: #ffffff;
+ text-align: center;
+ white-space: nowrap;
+ vertical-align: baseline;
+ border-radius: .25em;
+}
+a.label:hover,
+a.label:focus {
+ color: #ffffff;
+ text-decoration: none;
+ cursor: pointer;
+}
+.label:empty {
+ display: none;
+}
+.btn .label {
+ position: relative;
+ top: -1px;
+}
+.label-default {
+ background-color: #777777;
+}
+.label-default[href]:hover,
+.label-default[href]:focus {
+ background-color: #5e5e5e;
+}
+.label-primary {
+ background-color: #337ab7;
+}
+.label-primary[href]:hover,
+.label-primary[href]:focus {
+ background-color: #286090;
+}
+.label-success {
+ background-color: #5cb85c;
+}
+.label-success[href]:hover,
+.label-success[href]:focus {
+ background-color: #449d44;
+}
+.label-info {
+ background-color: #5bc0de;
+}
+.label-info[href]:hover,
+.label-info[href]:focus {
+ background-color: #31b0d5;
+}
+.label-warning {
+ background-color: #f0ad4e;
+}
+.label-warning[href]:hover,
+.label-warning[href]:focus {
+ background-color: #ec971f;
+}
+.label-danger {
+ background-color: #d9534f;
+}
+.label-danger[href]:hover,
+.label-danger[href]:focus {
+ background-color: #c9302c;
+}
+.badge {
+ display: inline-block;
+ min-width: 10px;
+ padding: 3px 7px;
+ font-size: 12px;
+ font-weight: bold;
+ color: #ffffff;
+ line-height: 1;
+ vertical-align: middle;
+ white-space: nowrap;
+ text-align: center;
+ background-color: #777777;
+ border-radius: 10px;
+}
+.badge:empty {
+ display: none;
+}
+.btn .badge {
+ position: relative;
+ top: -1px;
+}
+.btn-xs .badge,
+.btn-group-xs > .btn .badge {
+ top: 0;
+ padding: 1px 5px;
+}
+a.badge:hover,
+a.badge:focus {
+ color: #ffffff;
+ text-decoration: none;
+ cursor: pointer;
+}
+.list-group-item.active > .badge,
+.nav-pills > .active > a > .badge {
+ color: #337ab7;
+ background-color: #ffffff;
+}
+.list-group-item > .badge {
+ float: right;
+}
+.list-group-item > .badge + .badge {
+ margin-right: 5px;
+}
+.nav-pills > li > a > .badge {
+ margin-left: 3px;
+}
+.jumbotron {
+ padding-top: 30px;
+ padding-bottom: 30px;
+ margin-bottom: 30px;
+ color: inherit;
+ background-color: #eeeeee;
+}
+.jumbotron h1,
+.jumbotron .h1 {
+ color: inherit;
+}
+.jumbotron p {
+ margin-bottom: 15px;
+ font-size: 21px;
+ font-weight: 200;
+}
+.jumbotron > hr {
+ border-top-color: #d5d5d5;
+}
+.container .jumbotron,
+.container-fluid .jumbotron {
+ border-radius: 6px;
+ padding-left: 15px;
+ padding-right: 15px;
+}
+.jumbotron .container {
+ max-width: 100%;
+}
+@media screen and (min-width: 768px) {
+ .jumbotron {
+ padding-top: 48px;
+ padding-bottom: 48px;
+ }
+ .container .jumbotron,
+ .container-fluid .jumbotron {
+ padding-left: 60px;
+ padding-right: 60px;
+ }
+ .jumbotron h1,
+ .jumbotron .h1 {
+ font-size: 63px;
+ }
+}
+.thumbnail {
+ display: block;
+ padding: 4px;
+ margin-bottom: 20px;
+ line-height: 1.42857143;
+ background-color: #ffffff;
+ border: 1px solid #dddddd;
+ border-radius: 4px;
+ -webkit-transition: border 0.2s ease-in-out;
+ -o-transition: border 0.2s ease-in-out;
+ transition: border 0.2s ease-in-out;
+}
+.thumbnail > img,
+.thumbnail a > img {
+ margin-left: auto;
+ margin-right: auto;
+}
+a.thumbnail:hover,
+a.thumbnail:focus,
+a.thumbnail.active {
+ border-color: #337ab7;
+}
+.thumbnail .caption {
+ padding: 9px;
+ color: #333333;
+}
+.alert {
+ padding: 15px;
+ margin-bottom: 20px;
+ border: 1px solid transparent;
+ border-radius: 4px;
+}
+.alert h4 {
+ margin-top: 0;
+ color: inherit;
+}
+.alert .alert-link {
+ font-weight: bold;
+}
+.alert > p,
+.alert > ul {
+ margin-bottom: 0;
+}
+.alert > p + p {
+ margin-top: 5px;
+}
+.alert-dismissable,
+.alert-dismissible {
+ padding-right: 35px;
+}
+.alert-dismissable .close,
+.alert-dismissible .close {
+ position: relative;
+ top: -2px;
+ right: -21px;
+ color: inherit;
+}
+.alert-success {
+ background-color: #dff0d8;
+ border-color: #d6e9c6;
+ color: #3c763d;
+}
+.alert-success hr {
+ border-top-color: #c9e2b3;
+}
+.alert-success .alert-link {
+ color: #2b542c;
+}
+.alert-info {
+ background-color: #d9edf7;
+ border-color: #bce8f1;
+ color: #31708f;
+}
+.alert-info hr {
+ border-top-color: #a6e1ec;
+}
+.alert-info .alert-link {
+ color: #245269;
+}
+.alert-warning {
+ background-color: #fcf8e3;
+ border-color: #faebcc;
+ color: #8a6d3b;
+}
+.alert-warning hr {
+ border-top-color: #f7e1b5;
+}
+.alert-warning .alert-link {
+ color: #66512c;
+}
+.alert-danger {
+ background-color: #f2dede;
+ border-color: #ebccd1;
+ color: #a94442;
+}
+.alert-danger hr {
+ border-top-color: #e4b9c0;
+}
+.alert-danger .alert-link {
+ color: #843534;
+}
+@-webkit-keyframes progress-bar-stripes {
+ from {
+ background-position: 40px 0;
+ }
+ to {
+ background-position: 0 0;
+ }
+}
+@-o-keyframes progress-bar-stripes {
+ from {
+ background-position: 40px 0;
+ }
+ to {
+ background-position: 0 0;
+ }
+}
+@keyframes progress-bar-stripes {
+ from {
+ background-position: 40px 0;
+ }
+ to {
+ background-position: 0 0;
+ }
+}
+.progress {
+ overflow: hidden;
+ height: 20px;
+ margin-bottom: 20px;
+ background-color: #f5f5f5;
+ border-radius: 4px;
+ -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
+ box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
+}
+.progress-bar {
+ float: left;
+ width: 0%;
+ height: 100%;
+ font-size: 12px;
+ line-height: 20px;
+ color: #ffffff;
+ text-align: center;
+ background-color: #337ab7;
+ -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
+ box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
+ -webkit-transition: width 0.6s ease;
+ -o-transition: width 0.6s ease;
+ transition: width 0.6s ease;
+}
+.progress-striped .progress-bar,
+.progress-bar-striped {
+ background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+ background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+ background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+ -webkit-background-size: 40px 40px;
+ background-size: 40px 40px;
+}
+.progress.active .progress-bar,
+.progress-bar.active {
+ -webkit-animation: progress-bar-stripes 2s linear infinite;
+ -o-animation: progress-bar-stripes 2s linear infinite;
+ animation: progress-bar-stripes 2s linear infinite;
+}
+.progress-bar-success {
+ background-color: #5cb85c;
+}
+.progress-striped .progress-bar-success {
+ background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+ background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+ background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+}
+.progress-bar-info {
+ background-color: #5bc0de;
+}
+.progress-striped .progress-bar-info {
+ background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+ background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+ background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+}
+.progress-bar-warning {
+ background-color: #f0ad4e;
+}
+.progress-striped .progress-bar-warning {
+ background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+ background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+ background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+}
+.progress-bar-danger {
+ background-color: #d9534f;
+}
+.progress-striped .progress-bar-danger {
+ background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+ background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+ background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+}
+.media {
+ margin-top: 15px;
+}
+.media:first-child {
+ margin-top: 0;
+}
+.media,
+.media-body {
+ zoom: 1;
+ overflow: hidden;
+}
+.media-body {
+ width: 10000px;
+}
+.media-object {
+ display: block;
+}
+.media-object.img-thumbnail {
+ max-width: none;
+}
+.media-right,
+.media > .pull-right {
+ padding-left: 10px;
+}
+.media-left,
+.media > .pull-left {
+ padding-right: 10px;
+}
+.media-left,
+.media-right,
+.media-body {
+ display: table-cell;
+ vertical-align: top;
+}
+.media-middle {
+ vertical-align: middle;
+}
+.media-bottom {
+ vertical-align: bottom;
+}
+.media-heading {
+ margin-top: 0;
+ margin-bottom: 5px;
+}
+.media-list {
+ padding-left: 0;
+ list-style: none;
+}
+.list-group {
+ margin-bottom: 20px;
+ padding-left: 0;
+}
+.list-group-item {
+ position: relative;
+ display: block;
+ padding: 10px 15px;
+ margin-bottom: -1px;
+ background-color: #ffffff;
+ border: 1px solid #dddddd;
+}
+.list-group-item:first-child {
+ border-top-right-radius: 4px;
+ border-top-left-radius: 4px;
+}
+.list-group-item:last-child {
+ margin-bottom: 0;
+ border-bottom-right-radius: 4px;
+ border-bottom-left-radius: 4px;
+}
+a.list-group-item,
+button.list-group-item {
+ color: #555555;
+}
+a.list-group-item .list-group-item-heading,
+button.list-group-item .list-group-item-heading {
+ color: #333333;
+}
+a.list-group-item:hover,
+button.list-group-item:hover,
+a.list-group-item:focus,
+button.list-group-item:focus {
+ text-decoration: none;
+ color: #555555;
+ background-color: #f5f5f5;
+}
+button.list-group-item {
+ width: 100%;
+ text-align: left;
+}
+.list-group-item.disabled,
+.list-group-item.disabled:hover,
+.list-group-item.disabled:focus {
+ background-color: #eeeeee;
+ color: #777777;
+ cursor: not-allowed;
+}
+.list-group-item.disabled .list-group-item-heading,
+.list-group-item.disabled:hover .list-group-item-heading,
+.list-group-item.disabled:focus .list-group-item-heading {
+ color: inherit;
+}
+.list-group-item.disabled .list-group-item-text,
+.list-group-item.disabled:hover .list-group-item-text,
+.list-group-item.disabled:focus .list-group-item-text {
+ color: #777777;
+}
+.list-group-item.active,
+.list-group-item.active:hover,
+.list-group-item.active:focus {
+ z-index: 2;
+ color: #ffffff;
+ background-color: #337ab7;
+ border-color: #337ab7;
+}
+.list-group-item.active .list-group-item-heading,
+.list-group-item.active:hover .list-group-item-heading,
+.list-group-item.active:focus .list-group-item-heading,
+.list-group-item.active .list-group-item-heading > small,
+.list-group-item.active:hover .list-group-item-heading > small,
+.list-group-item.active:focus .list-group-item-heading > small,
+.list-group-item.active .list-group-item-heading > .small,
+.list-group-item.active:hover .list-group-item-heading > .small,
+.list-group-item.active:focus .list-group-item-heading > .small {
+ color: inherit;
+}
+.list-group-item.active .list-group-item-text,
+.list-group-item.active:hover .list-group-item-text,
+.list-group-item.active:focus .list-group-item-text {
+ color: #c7ddef;
+}
+.list-group-item-success {
+ color: #3c763d;
+ background-color: #dff0d8;
+}
+a.list-group-item-success,
+button.list-group-item-success {
+ color: #3c763d;
+}
+a.list-group-item-success .list-group-item-heading,
+button.list-group-item-success .list-group-item-heading {
+ color: inherit;
+}
+a.list-group-item-success:hover,
+button.list-group-item-success:hover,
+a.list-group-item-success:focus,
+button.list-group-item-success:focus {
+ color: #3c763d;
+ background-color: #d0e9c6;
+}
+a.list-group-item-success.active,
+button.list-group-item-success.active,
+a.list-group-item-success.active:hover,
+button.list-group-item-success.active:hover,
+a.list-group-item-success.active:focus,
+button.list-group-item-success.active:focus {
+ color: #fff;
+ background-color: #3c763d;
+ border-color: #3c763d;
+}
+.list-group-item-info {
+ color: #31708f;
+ background-color: #d9edf7;
+}
+a.list-group-item-info,
+button.list-group-item-info {
+ color: #31708f;
+}
+a.list-group-item-info .list-group-item-heading,
+button.list-group-item-info .list-group-item-heading {
+ color: inherit;
+}
+a.list-group-item-info:hover,
+button.list-group-item-info:hover,
+a.list-group-item-info:focus,
+button.list-group-item-info:focus {
+ color: #31708f;
+ background-color: #c4e3f3;
+}
+a.list-group-item-info.active,
+button.list-group-item-info.active,
+a.list-group-item-info.active:hover,
+button.list-group-item-info.active:hover,
+a.list-group-item-info.active:focus,
+button.list-group-item-info.active:focus {
+ color: #fff;
+ background-color: #31708f;
+ border-color: #31708f;
+}
+.list-group-item-warning {
+ color: #8a6d3b;
+ background-color: #fcf8e3;
+}
+a.list-group-item-warning,
+button.list-group-item-warning {
+ color: #8a6d3b;
+}
+a.list-group-item-warning .list-group-item-heading,
+button.list-group-item-warning .list-group-item-heading {
+ color: inherit;
+}
+a.list-group-item-warning:hover,
+button.list-group-item-warning:hover,
+a.list-group-item-warning:focus,
+button.list-group-item-warning:focus {
+ color: #8a6d3b;
+ background-color: #faf2cc;
+}
+a.list-group-item-warning.active,
+button.list-group-item-warning.active,
+a.list-group-item-warning.active:hover,
+button.list-group-item-warning.active:hover,
+a.list-group-item-warning.active:focus,
+button.list-group-item-warning.active:focus {
+ color: #fff;
+ background-color: #8a6d3b;
+ border-color: #8a6d3b;
+}
+.list-group-item-danger {
+ color: #a94442;
+ background-color: #f2dede;
+}
+a.list-group-item-danger,
+button.list-group-item-danger {
+ color: #a94442;
+}
+a.list-group-item-danger .list-group-item-heading,
+button.list-group-item-danger .list-group-item-heading {
+ color: inherit;
+}
+a.list-group-item-danger:hover,
+button.list-group-item-danger:hover,
+a.list-group-item-danger:focus,
+button.list-group-item-danger:focus {
+ color: #a94442;
+ background-color: #ebcccc;
+}
+a.list-group-item-danger.active,
+button.list-group-item-danger.active,
+a.list-group-item-danger.active:hover,
+button.list-group-item-danger.active:hover,
+a.list-group-item-danger.active:focus,
+button.list-group-item-danger.active:focus {
+ color: #fff;
+ background-color: #a94442;
+ border-color: #a94442;
+}
+.list-group-item-heading {
+ margin-top: 0;
+ margin-bottom: 5px;
+}
+.list-group-item-text {
+ margin-bottom: 0;
+ line-height: 1.3;
+}
+.panel {
+ margin-bottom: 20px;
+ background-color: #ffffff;
+ border: 1px solid transparent;
+ border-radius: 4px;
+ -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
+}
+.panel-body {
+ padding: 15px;
+}
+.panel-heading {
+ padding: 10px 15px;
+ border-bottom: 1px solid transparent;
+ border-top-right-radius: 3px;
+ border-top-left-radius: 3px;
+}
+.panel-heading > .dropdown .dropdown-toggle {
+ color: inherit;
+}
+.panel-title {
+ margin-top: 0;
+ margin-bottom: 0;
+ font-size: 16px;
+ color: inherit;
+}
+.panel-title > a,
+.panel-title > small,
+.panel-title > .small,
+.panel-title > small > a,
+.panel-title > .small > a {
+ color: inherit;
+}
+.panel-footer {
+ padding: 10px 15px;
+ background-color: #f5f5f5;
+ border-top: 1px solid #dddddd;
+ border-bottom-right-radius: 3px;
+ border-bottom-left-radius: 3px;
+}
+.panel > .list-group,
+.panel > .panel-collapse > .list-group {
+ margin-bottom: 0;
+}
+.panel > .list-group .list-group-item,
+.panel > .panel-collapse > .list-group .list-group-item {
+ border-width: 1px 0;
+ border-radius: 0;
+}
+.panel > .list-group:first-child .list-group-item:first-child,
+.panel > .panel-collapse > .list-group:first-child .list-group-item:first-child {
+ border-top: 0;
+ border-top-right-radius: 3px;
+ border-top-left-radius: 3px;
+}
+.panel > .list-group:last-child .list-group-item:last-child,
+.panel > .panel-collapse > .list-group:last-child .list-group-item:last-child {
+ border-bottom: 0;
+ border-bottom-right-radius: 3px;
+ border-bottom-left-radius: 3px;
+}
+.panel > .panel-heading + .panel-collapse > .list-group .list-group-item:first-child {
+ border-top-right-radius: 0;
+ border-top-left-radius: 0;
+}
+.panel-heading + .list-group .list-group-item:first-child {
+ border-top-width: 0;
+}
+.list-group + .panel-footer {
+ border-top-width: 0;
+}
+.panel > .table,
+.panel > .table-responsive > .table,
+.panel > .panel-collapse > .table {
+ margin-bottom: 0;
+}
+.panel > .table caption,
+.panel > .table-responsive > .table caption,
+.panel > .panel-collapse > .table caption {
+ padding-left: 15px;
+ padding-right: 15px;
+}
+.panel > .table:first-child,
+.panel > .table-responsive:first-child > .table:first-child {
+ border-top-right-radius: 3px;
+ border-top-left-radius: 3px;
+}
+.panel > .table:first-child > thead:first-child > tr:first-child,
+.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child,
+.panel > .table:first-child > tbody:first-child > tr:first-child,
+.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child {
+ border-top-left-radius: 3px;
+ border-top-right-radius: 3px;
+}
+.panel > .table:first-child > thead:first-child > tr:first-child td:first-child,
+.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:first-child,
+.panel > .table:first-child > tbody:first-child > tr:first-child td:first-child,
+.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:first-child,
+.panel > .table:first-child > thead:first-child > tr:first-child th:first-child,
+.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:first-child,
+.panel > .table:first-child > tbody:first-child > tr:first-child th:first-child,
+.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:first-child {
+ border-top-left-radius: 3px;
+}
+.panel > .table:first-child > thead:first-child > tr:first-child td:last-child,
+.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:last-child,
+.panel > .table:first-child > tbody:first-child > tr:first-child td:last-child,
+.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:last-child,
+.panel > .table:first-child > thead:first-child > tr:first-child th:last-child,
+.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:last-child,
+.panel > .table:first-child > tbody:first-child > tr:first-child th:last-child,
+.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:last-child {
+ border-top-right-radius: 3px;
+}
+.panel > .table:last-child,
+.panel > .table-responsive:last-child > .table:last-child {
+ border-bottom-right-radius: 3px;
+ border-bottom-left-radius: 3px;
+}
+.panel > .table:last-child > tbody:last-child > tr:last-child,
+.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child,
+.panel > .table:last-child > tfoot:last-child > tr:last-child,
+.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child {
+ border-bottom-left-radius: 3px;
+ border-bottom-right-radius: 3px;
+}
+.panel > .table:last-child > tbody:last-child > tr:last-child td:first-child,
+.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:first-child,
+.panel > .table:last-child > tfoot:last-child > tr:last-child td:first-child,
+.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:first-child,
+.panel > .table:last-child > tbody:last-child > tr:last-child th:first-child,
+.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:first-child,
+.panel > .table:last-child > tfoot:last-child > tr:last-child th:first-child,
+.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:first-child {
+ border-bottom-left-radius: 3px;
+}
+.panel > .table:last-child > tbody:last-child > tr:last-child td:last-child,
+.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:last-child,
+.panel > .table:last-child > tfoot:last-child > tr:last-child td:last-child,
+.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:last-child,
+.panel > .table:last-child > tbody:last-child > tr:last-child th:last-child,
+.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:last-child,
+.panel > .table:last-child > tfoot:last-child > tr:last-child th:last-child,
+.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:last-child {
+ border-bottom-right-radius: 3px;
+}
+.panel > .panel-body + .table,
+.panel > .panel-body + .table-responsive,
+.panel > .table + .panel-body,
+.panel > .table-responsive + .panel-body {
+ border-top: 1px solid #dddddd;
+}
+.panel > .table > tbody:first-child > tr:first-child th,
+.panel > .table > tbody:first-child > tr:first-child td {
+ border-top: 0;
+}
+.panel > .table-bordered,
+.panel > .table-responsive > .table-bordered {
+ border: 0;
+}
+.panel > .table-bordered > thead > tr > th:first-child,
+.panel > .table-responsive > .table-bordered > thead > tr > th:first-child,
+.panel > .table-bordered > tbody > tr > th:first-child,
+.panel > .table-responsive > .table-bordered > tbody > tr > th:first-child,
+.panel > .table-bordered > tfoot > tr > th:first-child,
+.panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child,
+.panel > .table-bordered > thead > tr > td:first-child,
+.panel > .table-responsive > .table-bordered > thead > tr > td:first-child,
+.panel > .table-bordered > tbody > tr > td:first-child,
+.panel > .table-responsive > .table-bordered > tbody > tr > td:first-child,
+.panel > .table-bordered > tfoot > tr > td:first-child,
+.panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child {
+ border-left: 0;
+}
+.panel > .table-bordered > thead > tr > th:last-child,
+.panel > .table-responsive > .table-bordered > thead > tr > th:last-child,
+.panel > .table-bordered > tbody > tr > th:last-child,
+.panel > .table-responsive > .table-bordered > tbody > tr > th:last-child,
+.panel > .table-bordered > tfoot > tr > th:last-child,
+.panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child,
+.panel > .table-bordered > thead > tr > td:last-child,
+.panel > .table-responsive > .table-bordered > thead > tr > td:last-child,
+.panel > .table-bordered > tbody > tr > td:last-child,
+.panel > .table-responsive > .table-bordered > tbody > tr > td:last-child,
+.panel > .table-bordered > tfoot > tr > td:last-child,
+.panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child {
+ border-right: 0;
+}
+.panel > .table-bordered > thead > tr:first-child > td,
+.panel > .table-responsive > .table-bordered > thead > tr:first-child > td,
+.panel > .table-bordered > tbody > tr:first-child > td,
+.panel > .table-responsive > .table-bordered > tbody > tr:first-child > td,
+.panel > .table-bordered > thead > tr:first-child > th,
+.panel > .table-responsive > .table-bordered > thead > tr:first-child > th,
+.panel > .table-bordered > tbody > tr:first-child > th,
+.panel > .table-responsive > .table-bordered > tbody > tr:first-child > th {
+ border-bottom: 0;
+}
+.panel > .table-bordered > tbody > tr:last-child > td,
+.panel > .table-responsive > .table-bordered > tbody > tr:last-child > td,
+.panel > .table-bordered > tfoot > tr:last-child > td,
+.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td,
+.panel > .table-bordered > tbody > tr:last-child > th,
+.panel > .table-responsive > .table-bordered > tbody > tr:last-child > th,
+.panel > .table-bordered > tfoot > tr:last-child > th,
+.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th {
+ border-bottom: 0;
+}
+.panel > .table-responsive {
+ border: 0;
+ margin-bottom: 0;
+}
+.panel-group {
+ margin-bottom: 20px;
+}
+.panel-group .panel {
+ margin-bottom: 0;
+ border-radius: 4px;
+}
+.panel-group .panel + .panel {
+ margin-top: 5px;
+}
+.panel-group .panel-heading {
+ border-bottom: 0;
+}
+.panel-group .panel-heading + .panel-collapse > .panel-body,
+.panel-group .panel-heading + .panel-collapse > .list-group {
+ border-top: 1px solid #dddddd;
+}
+.panel-group .panel-footer {
+ border-top: 0;
+}
+.panel-group .panel-footer + .panel-collapse .panel-body {
+ border-bottom: 1px solid #dddddd;
+}
+.panel-default {
+ border-color: #dddddd;
+}
+.panel-default > .panel-heading {
+ color: #333333;
+ background-color: #f5f5f5;
+ border-color: #dddddd;
+}
+.panel-default > .panel-heading + .panel-collapse > .panel-body {
+ border-top-color: #dddddd;
+}
+.panel-default > .panel-heading .badge {
+ color: #f5f5f5;
+ background-color: #333333;
+}
+.panel-default > .panel-footer + .panel-collapse > .panel-body {
+ border-bottom-color: #dddddd;
+}
+.panel-primary {
+ border-color: #337ab7;
+}
+.panel-primary > .panel-heading {
+ color: #ffffff;
+ background-color: #337ab7;
+ border-color: #337ab7;
+}
+.panel-primary > .panel-heading + .panel-collapse > .panel-body {
+ border-top-color: #337ab7;
+}
+.panel-primary > .panel-heading .badge {
+ color: #337ab7;
+ background-color: #ffffff;
+}
+.panel-primary > .panel-footer + .panel-collapse > .panel-body {
+ border-bottom-color: #337ab7;
+}
+.panel-success {
+ border-color: #d6e9c6;
+}
+.panel-success > .panel-heading {
+ color: #3c763d;
+ background-color: #dff0d8;
+ border-color: #d6e9c6;
+}
+.panel-success > .panel-heading + .panel-collapse > .panel-body {
+ border-top-color: #d6e9c6;
+}
+.panel-success > .panel-heading .badge {
+ color: #dff0d8;
+ background-color: #3c763d;
+}
+.panel-success > .panel-footer + .panel-collapse > .panel-body {
+ border-bottom-color: #d6e9c6;
+}
+.panel-info {
+ border-color: #bce8f1;
+}
+.panel-info > .panel-heading {
+ color: #31708f;
+ background-color: #d9edf7;
+ border-color: #bce8f1;
+}
+.panel-info > .panel-heading + .panel-collapse > .panel-body {
+ border-top-color: #bce8f1;
+}
+.panel-info > .panel-heading .badge {
+ color: #d9edf7;
+ background-color: #31708f;
+}
+.panel-info > .panel-footer + .panel-collapse > .panel-body {
+ border-bottom-color: #bce8f1;
+}
+.panel-warning {
+ border-color: #faebcc;
+}
+.panel-warning > .panel-heading {
+ color: #8a6d3b;
+ background-color: #fcf8e3;
+ border-color: #faebcc;
+}
+.panel-warning > .panel-heading + .panel-collapse > .panel-body {
+ border-top-color: #faebcc;
+}
+.panel-warning > .panel-heading .badge {
+ color: #fcf8e3;
+ background-color: #8a6d3b;
+}
+.panel-warning > .panel-footer + .panel-collapse > .panel-body {
+ border-bottom-color: #faebcc;
+}
+.panel-danger {
+ border-color: #ebccd1;
+}
+.panel-danger > .panel-heading {
+ color: #a94442;
+ background-color: #f2dede;
+ border-color: #ebccd1;
+}
+.panel-danger > .panel-heading + .panel-collapse > .panel-body {
+ border-top-color: #ebccd1;
+}
+.panel-danger > .panel-heading .badge {
+ color: #f2dede;
+ background-color: #a94442;
+}
+.panel-danger > .panel-footer + .panel-collapse > .panel-body {
+ border-bottom-color: #ebccd1;
+}
+.embed-responsive {
+ position: relative;
+ display: block;
+ height: 0;
+ padding: 0;
+ overflow: hidden;
+}
+.embed-responsive .embed-responsive-item,
+.embed-responsive iframe,
+.embed-responsive embed,
+.embed-responsive object,
+.embed-responsive video {
+ position: absolute;
+ top: 0;
+ left: 0;
+ bottom: 0;
+ height: 100%;
+ width: 100%;
+ border: 0;
+}
+.embed-responsive-16by9 {
+ padding-bottom: 56.25%;
+}
+.embed-responsive-4by3 {
+ padding-bottom: 75%;
+}
+.well {
+ min-height: 20px;
+ padding: 19px;
+ margin-bottom: 20px;
+ background-color: #f5f5f5;
+ border: 1px solid #e3e3e3;
+ border-radius: 4px;
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
+}
+.well blockquote {
+ border-color: #ddd;
+ border-color: rgba(0, 0, 0, 0.15);
+}
+.well-lg {
+ padding: 24px;
+ border-radius: 6px;
+}
+.well-sm {
+ padding: 9px;
+ border-radius: 3px;
+}
+.close {
+ float: right;
+ font-size: 21px;
+ font-weight: bold;
+ line-height: 1;
+ color: #000000;
+ text-shadow: 0 1px 0 #ffffff;
+ opacity: 0.2;
+ filter: alpha(opacity=20);
+}
+.close:hover,
+.close:focus {
+ color: #000000;
+ text-decoration: none;
+ cursor: pointer;
+ opacity: 0.5;
+ filter: alpha(opacity=50);
+}
+button.close {
+ padding: 0;
+ cursor: pointer;
+ background: transparent;
+ border: 0;
+ -webkit-appearance: none;
+}
+.modal-open {
+ overflow: hidden;
+}
+.modal {
+ display: none;
+ overflow: hidden;
+ position: fixed;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ z-index: 1050;
+ -webkit-overflow-scrolling: touch;
+ outline: 0;
+}
+.modal.fade .modal-dialog {
+ -webkit-transform: translate(0, -25%);
+ -ms-transform: translate(0, -25%);
+ -o-transform: translate(0, -25%);
+ transform: translate(0, -25%);
+ -webkit-transition: -webkit-transform 0.3s ease-out;
+ -o-transition: -o-transform 0.3s ease-out;
+ transition: transform 0.3s ease-out;
+}
+.modal.in .modal-dialog {
+ -webkit-transform: translate(0, 0);
+ -ms-transform: translate(0, 0);
+ -o-transform: translate(0, 0);
+ transform: translate(0, 0);
+}
+.modal-open .modal {
+ overflow-x: hidden;
+ overflow-y: auto;
+}
+.modal-dialog {
+ position: relative;
+ width: auto;
+ margin: 10px;
+}
+.modal-content {
+ position: relative;
+ background-color: #ffffff;
+ border: 1px solid #999999;
+ border: 1px solid rgba(0, 0, 0, 0.2);
+ border-radius: 6px;
+ -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
+ box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
+ -webkit-background-clip: padding-box;
+ background-clip: padding-box;
+ outline: 0;
+}
+.modal-backdrop {
+ position: fixed;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ z-index: 1040;
+ background-color: #000000;
+}
+.modal-backdrop.fade {
+ opacity: 0;
+ filter: alpha(opacity=0);
+}
+.modal-backdrop.in {
+ opacity: 0.5;
+ filter: alpha(opacity=50);
+}
+.modal-header {
+ padding: 15px;
+ border-bottom: 1px solid #e5e5e5;
+}
+.modal-header .close {
+ margin-top: -2px;
+}
+.modal-title {
+ margin: 0;
+ line-height: 1.42857143;
+}
+.modal-body {
+ position: relative;
+ padding: 15px;
+}
+.modal-footer {
+ padding: 15px;
+ text-align: right;
+ border-top: 1px solid #e5e5e5;
+}
+.modal-footer .btn + .btn {
+ margin-left: 5px;
+ margin-bottom: 0;
+}
+.modal-footer .btn-group .btn + .btn {
+ margin-left: -1px;
+}
+.modal-footer .btn-block + .btn-block {
+ margin-left: 0;
+}
+.modal-scrollbar-measure {
+ position: absolute;
+ top: -9999px;
+ width: 50px;
+ height: 50px;
+ overflow: scroll;
+}
+@media (min-width: 768px) {
+ .modal-dialog {
+ width: 600px;
+ margin: 30px auto;
+ }
+ .modal-content {
+ -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
+ box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
+ }
+ .modal-sm {
+ width: 300px;
+ }
+}
+@media (min-width: 992px) {
+ .modal-lg {
+ width: 900px;
+ }
+}
+.tooltip {
+ position: absolute;
+ z-index: 1070;
+ display: block;
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
+ font-style: normal;
+ font-weight: normal;
+ letter-spacing: normal;
+ line-break: auto;
+ line-height: 1.42857143;
+ text-align: left;
+ text-align: start;
+ text-decoration: none;
+ text-shadow: none;
+ text-transform: none;
+ white-space: normal;
+ word-break: normal;
+ word-spacing: normal;
+ word-wrap: normal;
+ font-size: 12px;
+ opacity: 0;
+ filter: alpha(opacity=0);
+}
+.tooltip.in {
+ opacity: 0.9;
+ filter: alpha(opacity=90);
+}
+.tooltip.top {
+ margin-top: -3px;
+ padding: 5px 0;
+}
+.tooltip.right {
+ margin-left: 3px;
+ padding: 0 5px;
+}
+.tooltip.bottom {
+ margin-top: 3px;
+ padding: 5px 0;
+}
+.tooltip.left {
+ margin-left: -3px;
+ padding: 0 5px;
+}
+.tooltip-inner {
+ max-width: 200px;
+ padding: 3px 8px;
+ color: #ffffff;
+ text-align: center;
+ background-color: #000000;
+ border-radius: 4px;
+}
+.tooltip-arrow {
+ position: absolute;
+ width: 0;
+ height: 0;
+ border-color: transparent;
+ border-style: solid;
+}
+.tooltip.top .tooltip-arrow {
+ bottom: 0;
+ left: 50%;
+ margin-left: -5px;
+ border-width: 5px 5px 0;
+ border-top-color: #000000;
+}
+.tooltip.top-left .tooltip-arrow {
+ bottom: 0;
+ right: 5px;
+ margin-bottom: -5px;
+ border-width: 5px 5px 0;
+ border-top-color: #000000;
+}
+.tooltip.top-right .tooltip-arrow {
+ bottom: 0;
+ left: 5px;
+ margin-bottom: -5px;
+ border-width: 5px 5px 0;
+ border-top-color: #000000;
+}
+.tooltip.right .tooltip-arrow {
+ top: 50%;
+ left: 0;
+ margin-top: -5px;
+ border-width: 5px 5px 5px 0;
+ border-right-color: #000000;
+}
+.tooltip.left .tooltip-arrow {
+ top: 50%;
+ right: 0;
+ margin-top: -5px;
+ border-width: 5px 0 5px 5px;
+ border-left-color: #000000;
+}
+.tooltip.bottom .tooltip-arrow {
+ top: 0;
+ left: 50%;
+ margin-left: -5px;
+ border-width: 0 5px 5px;
+ border-bottom-color: #000000;
+}
+.tooltip.bottom-left .tooltip-arrow {
+ top: 0;
+ right: 5px;
+ margin-top: -5px;
+ border-width: 0 5px 5px;
+ border-bottom-color: #000000;
+}
+.tooltip.bottom-right .tooltip-arrow {
+ top: 0;
+ left: 5px;
+ margin-top: -5px;
+ border-width: 0 5px 5px;
+ border-bottom-color: #000000;
+}
+.popover {
+ position: absolute;
+ top: 0;
+ left: 0;
+ z-index: 1060;
+ display: none;
+ max-width: 276px;
+ padding: 1px;
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
+ font-style: normal;
+ font-weight: normal;
+ letter-spacing: normal;
+ line-break: auto;
+ line-height: 1.42857143;
+ text-align: left;
+ text-align: start;
+ text-decoration: none;
+ text-shadow: none;
+ text-transform: none;
+ white-space: normal;
+ word-break: normal;
+ word-spacing: normal;
+ word-wrap: normal;
+ font-size: 14px;
+ background-color: #ffffff;
+ -webkit-background-clip: padding-box;
+ background-clip: padding-box;
+ border: 1px solid #cccccc;
+ border: 1px solid rgba(0, 0, 0, 0.2);
+ border-radius: 6px;
+ -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
+ box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
+}
+.popover.top {
+ margin-top: -10px;
+}
+.popover.right {
+ margin-left: 10px;
+}
+.popover.bottom {
+ margin-top: 10px;
+}
+.popover.left {
+ margin-left: -10px;
+}
+.popover-title {
+ margin: 0;
+ padding: 8px 14px;
+ font-size: 14px;
+ background-color: #f7f7f7;
+ border-bottom: 1px solid #ebebeb;
+ border-radius: 5px 5px 0 0;
+}
+.popover-content {
+ padding: 9px 14px;
+}
+.popover > .arrow,
+.popover > .arrow:after {
+ position: absolute;
+ display: block;
+ width: 0;
+ height: 0;
+ border-color: transparent;
+ border-style: solid;
+}
+.popover > .arrow {
+ border-width: 11px;
+}
+.popover > .arrow:after {
+ border-width: 10px;
+ content: "";
+}
+.popover.top > .arrow {
+ left: 50%;
+ margin-left: -11px;
+ border-bottom-width: 0;
+ border-top-color: #999999;
+ border-top-color: rgba(0, 0, 0, 0.25);
+ bottom: -11px;
+}
+.popover.top > .arrow:after {
+ content: " ";
+ bottom: 1px;
+ margin-left: -10px;
+ border-bottom-width: 0;
+ border-top-color: #ffffff;
+}
+.popover.right > .arrow {
+ top: 50%;
+ left: -11px;
+ margin-top: -11px;
+ border-left-width: 0;
+ border-right-color: #999999;
+ border-right-color: rgba(0, 0, 0, 0.25);
+}
+.popover.right > .arrow:after {
+ content: " ";
+ left: 1px;
+ bottom: -10px;
+ border-left-width: 0;
+ border-right-color: #ffffff;
+}
+.popover.bottom > .arrow {
+ left: 50%;
+ margin-left: -11px;
+ border-top-width: 0;
+ border-bottom-color: #999999;
+ border-bottom-color: rgba(0, 0, 0, 0.25);
+ top: -11px;
+}
+.popover.bottom > .arrow:after {
+ content: " ";
+ top: 1px;
+ margin-left: -10px;
+ border-top-width: 0;
+ border-bottom-color: #ffffff;
+}
+.popover.left > .arrow {
+ top: 50%;
+ right: -11px;
+ margin-top: -11px;
+ border-right-width: 0;
+ border-left-color: #999999;
+ border-left-color: rgba(0, 0, 0, 0.25);
+}
+.popover.left > .arrow:after {
+ content: " ";
+ right: 1px;
+ border-right-width: 0;
+ border-left-color: #ffffff;
+ bottom: -10px;
+}
+.carousel {
+ position: relative;
+}
+.carousel-inner {
+ position: relative;
+ overflow: hidden;
+ width: 100%;
+}
+.carousel-inner > .item {
+ display: none;
+ position: relative;
+ -webkit-transition: 0.6s ease-in-out left;
+ -o-transition: 0.6s ease-in-out left;
+ transition: 0.6s ease-in-out left;
+}
+.carousel-inner > .item > img,
+.carousel-inner > .item > a > img {
+ line-height: 1;
+}
+@media all and (transform-3d), (-webkit-transform-3d) {
+ .carousel-inner > .item {
+ -webkit-transition: -webkit-transform 0.6s ease-in-out;
+ -o-transition: -o-transform 0.6s ease-in-out;
+ transition: transform 0.6s ease-in-out;
+ -webkit-backface-visibility: hidden;
+ backface-visibility: hidden;
+ -webkit-perspective: 1000px;
+ perspective: 1000px;
+ }
+ .carousel-inner > .item.next,
+ .carousel-inner > .item.active.right {
+ -webkit-transform: translate3d(100%, 0, 0);
+ transform: translate3d(100%, 0, 0);
+ left: 0;
+ }
+ .carousel-inner > .item.prev,
+ .carousel-inner > .item.active.left {
+ -webkit-transform: translate3d(-100%, 0, 0);
+ transform: translate3d(-100%, 0, 0);
+ left: 0;
+ }
+ .carousel-inner > .item.next.left,
+ .carousel-inner > .item.prev.right,
+ .carousel-inner > .item.active {
+ -webkit-transform: translate3d(0, 0, 0);
+ transform: translate3d(0, 0, 0);
+ left: 0;
+ }
+}
+.carousel-inner > .active,
+.carousel-inner > .next,
+.carousel-inner > .prev {
+ display: block;
+}
+.carousel-inner > .active {
+ left: 0;
+}
+.carousel-inner > .next,
+.carousel-inner > .prev {
+ position: absolute;
+ top: 0;
+ width: 100%;
+}
+.carousel-inner > .next {
+ left: 100%;
+}
+.carousel-inner > .prev {
+ left: -100%;
+}
+.carousel-inner > .next.left,
+.carousel-inner > .prev.right {
+ left: 0;
+}
+.carousel-inner > .active.left {
+ left: -100%;
+}
+.carousel-inner > .active.right {
+ left: 100%;
+}
+.carousel-control {
+ position: absolute;
+ top: 0;
+ left: 0;
+ bottom: 0;
+ width: 15%;
+ opacity: 0.5;
+ filter: alpha(opacity=50);
+ font-size: 20px;
+ color: #ffffff;
+ text-align: center;
+ text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
+ background-color: rgba(0, 0, 0, 0);
+}
+.carousel-control.left {
+ background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%);
+ background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%);
+ background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0.0001)));
+ background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);
+}
+.carousel-control.right {
+ left: auto;
+ right: 0;
+ background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%);
+ background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%);
+ background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, 0.0001)), to(rgba(0, 0, 0, 0.5)));
+ background-image: linear-gradient(to right, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);
+}
+.carousel-control:hover,
+.carousel-control:focus {
+ outline: 0;
+ color: #ffffff;
+ text-decoration: none;
+ opacity: 0.9;
+ filter: alpha(opacity=90);
+}
+.carousel-control .icon-prev,
+.carousel-control .icon-next,
+.carousel-control .glyphicon-chevron-left,
+.carousel-control .glyphicon-chevron-right {
+ position: absolute;
+ top: 50%;
+ margin-top: -10px;
+ z-index: 5;
+ display: inline-block;
+}
+.carousel-control .icon-prev,
+.carousel-control .glyphicon-chevron-left {
+ left: 50%;
+ margin-left: -10px;
+}
+.carousel-control .icon-next,
+.carousel-control .glyphicon-chevron-right {
+ right: 50%;
+ margin-right: -10px;
+}
+.carousel-control .icon-prev,
+.carousel-control .icon-next {
+ width: 20px;
+ height: 20px;
+ line-height: 1;
+ font-family: serif;
+}
+.carousel-control .icon-prev:before {
+ content: '\2039';
+}
+.carousel-control .icon-next:before {
+ content: '\203a';
+}
+.carousel-indicators {
+ position: absolute;
+ bottom: 10px;
+ left: 50%;
+ z-index: 15;
+ width: 60%;
+ margin-left: -30%;
+ padding-left: 0;
+ list-style: none;
+ text-align: center;
+}
+.carousel-indicators li {
+ display: inline-block;
+ width: 10px;
+ height: 10px;
+ margin: 1px;
+ text-indent: -999px;
+ border: 1px solid #ffffff;
+ border-radius: 10px;
+ cursor: pointer;
+ background-color: #000 \9;
+ background-color: rgba(0, 0, 0, 0);
+}
+.carousel-indicators .active {
+ margin: 0;
+ width: 12px;
+ height: 12px;
+ background-color: #ffffff;
+}
+.carousel-caption {
+ position: absolute;
+ left: 15%;
+ right: 15%;
+ bottom: 20px;
+ z-index: 10;
+ padding-top: 20px;
+ padding-bottom: 20px;
+ color: #ffffff;
+ text-align: center;
+ text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
+}
+.carousel-caption .btn {
+ text-shadow: none;
+}
+@media screen and (min-width: 768px) {
+ .carousel-control .glyphicon-chevron-left,
+ .carousel-control .glyphicon-chevron-right,
+ .carousel-control .icon-prev,
+ .carousel-control .icon-next {
+ width: 30px;
+ height: 30px;
+ margin-top: -10px;
+ font-size: 30px;
+ }
+ .carousel-control .glyphicon-chevron-left,
+ .carousel-control .icon-prev {
+ margin-left: -10px;
+ }
+ .carousel-control .glyphicon-chevron-right,
+ .carousel-control .icon-next {
+ margin-right: -10px;
+ }
+ .carousel-caption {
+ left: 20%;
+ right: 20%;
+ padding-bottom: 30px;
+ }
+ .carousel-indicators {
+ bottom: 20px;
+ }
+}
+.clearfix:before,
+.clearfix:after,
+.dl-horizontal dd:before,
+.dl-horizontal dd:after,
+.container:before,
+.container:after,
+.container-fluid:before,
+.container-fluid:after,
+.row:before,
+.row:after,
+.form-horizontal .form-group:before,
+.form-horizontal .form-group:after,
+.btn-toolbar:before,
+.btn-toolbar:after,
+.btn-group-vertical > .btn-group:before,
+.btn-group-vertical > .btn-group:after,
+.nav:before,
+.nav:after,
+.navbar:before,
+.navbar:after,
+.navbar-header:before,
+.navbar-header:after,
+.navbar-collapse:before,
+.navbar-collapse:after,
+.pager:before,
+.pager:after,
+.panel-body:before,
+.panel-body:after,
+.modal-header:before,
+.modal-header:after,
+.modal-footer:before,
+.modal-footer:after {
+ content: " ";
+ display: table;
+}
+.clearfix:after,
+.dl-horizontal dd:after,
+.container:after,
+.container-fluid:after,
+.row:after,
+.form-horizontal .form-group:after,
+.btn-toolbar:after,
+.btn-group-vertical > .btn-group:after,
+.nav:after,
+.navbar:after,
+.navbar-header:after,
+.navbar-collapse:after,
+.pager:after,
+.panel-body:after,
+.modal-header:after,
+.modal-footer:after {
+ clear: both;
+}
+.center-block {
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+}
+.pull-right {
+ float: right !important;
+}
+.pull-left {
+ float: left !important;
+}
+.hide {
+ display: none !important;
+}
+.show {
+ display: block !important;
+}
+.invisible {
+ visibility: hidden;
+}
+.text-hide {
+ font: 0/0 a;
+ color: transparent;
+ text-shadow: none;
+ background-color: transparent;
+ border: 0;
+}
+.hidden {
+ display: none !important;
+}
+.affix {
+ position: fixed;
+}
+@-ms-viewport {
+ width: device-width;
+}
+.visible-xs,
+.visible-sm,
+.visible-md,
+.visible-lg {
+ display: none !important;
+}
+.visible-xs-block,
+.visible-xs-inline,
+.visible-xs-inline-block,
+.visible-sm-block,
+.visible-sm-inline,
+.visible-sm-inline-block,
+.visible-md-block,
+.visible-md-inline,
+.visible-md-inline-block,
+.visible-lg-block,
+.visible-lg-inline,
+.visible-lg-inline-block {
+ display: none !important;
+}
+@media (max-width: 767px) {
+ .visible-xs {
+ display: block !important;
+ }
+ table.visible-xs {
+ display: table !important;
+ }
+ tr.visible-xs {
+ display: table-row !important;
+ }
+ th.visible-xs,
+ td.visible-xs {
+ display: table-cell !important;
+ }
+}
+@media (max-width: 767px) {
+ .visible-xs-block {
+ display: block !important;
+ }
+}
+@media (max-width: 767px) {
+ .visible-xs-inline {
+ display: inline !important;
+ }
+}
+@media (max-width: 767px) {
+ .visible-xs-inline-block {
+ display: inline-block !important;
+ }
+}
+@media (min-width: 768px) and (max-width: 991px) {
+ .visible-sm {
+ display: block !important;
+ }
+ table.visible-sm {
+ display: table !important;
+ }
+ tr.visible-sm {
+ display: table-row !important;
+ }
+ th.visible-sm,
+ td.visible-sm {
+ display: table-cell !important;
+ }
+}
+@media (min-width: 768px) and (max-width: 991px) {
+ .visible-sm-block {
+ display: block !important;
+ }
+}
+@media (min-width: 768px) and (max-width: 991px) {
+ .visible-sm-inline {
+ display: inline !important;
+ }
+}
+@media (min-width: 768px) and (max-width: 991px) {
+ .visible-sm-inline-block {
+ display: inline-block !important;
+ }
+}
+@media (min-width: 992px) and (max-width: 1199px) {
+ .visible-md {
+ display: block !important;
+ }
+ table.visible-md {
+ display: table !important;
+ }
+ tr.visible-md {
+ display: table-row !important;
+ }
+ th.visible-md,
+ td.visible-md {
+ display: table-cell !important;
+ }
+}
+@media (min-width: 992px) and (max-width: 1199px) {
+ .visible-md-block {
+ display: block !important;
+ }
+}
+@media (min-width: 992px) and (max-width: 1199px) {
+ .visible-md-inline {
+ display: inline !important;
+ }
+}
+@media (min-width: 992px) and (max-width: 1199px) {
+ .visible-md-inline-block {
+ display: inline-block !important;
+ }
+}
+@media (min-width: 1200px) {
+ .visible-lg {
+ display: block !important;
+ }
+ table.visible-lg {
+ display: table !important;
+ }
+ tr.visible-lg {
+ display: table-row !important;
+ }
+ th.visible-lg,
+ td.visible-lg {
+ display: table-cell !important;
+ }
+}
+@media (min-width: 1200px) {
+ .visible-lg-block {
+ display: block !important;
+ }
+}
+@media (min-width: 1200px) {
+ .visible-lg-inline {
+ display: inline !important;
+ }
+}
+@media (min-width: 1200px) {
+ .visible-lg-inline-block {
+ display: inline-block !important;
+ }
+}
+@media (max-width: 767px) {
+ .hidden-xs {
+ display: none !important;
+ }
+}
+@media (min-width: 768px) and (max-width: 991px) {
+ .hidden-sm {
+ display: none !important;
+ }
+}
+@media (min-width: 992px) and (max-width: 1199px) {
+ .hidden-md {
+ display: none !important;
+ }
+}
+@media (min-width: 1200px) {
+ .hidden-lg {
+ display: none !important;
+ }
+}
+.visible-print {
+ display: none !important;
+}
+@media print {
+ .visible-print {
+ display: block !important;
+ }
+ table.visible-print {
+ display: table !important;
+ }
+ tr.visible-print {
+ display: table-row !important;
+ }
+ th.visible-print,
+ td.visible-print {
+ display: table-cell !important;
+ }
+}
+.visible-print-block {
+ display: none !important;
+}
+@media print {
+ .visible-print-block {
+ display: block !important;
+ }
+}
+.visible-print-inline {
+ display: none !important;
+}
+@media print {
+ .visible-print-inline {
+ display: inline !important;
+ }
+}
+.visible-print-inline-block {
+ display: none !important;
+}
+@media print {
+ .visible-print-inline-block {
+ display: inline-block !important;
+ }
+}
+@media print {
+ .hidden-print {
+ display: none !important;
+ }
+}
diff --git a/public_html/data/css/bootstrap.min.css b/public_html/data/css/bootstrap.min.css
new file mode 100644
index 000000000..fc34a8605
--- /dev/null
+++ b/public_html/data/css/bootstrap.min.css
@@ -0,0 +1,14 @@
+/*!
+ * Bootstrap v3.3.5 (http://getbootstrap.com)
+ * Copyright 2011-2016 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ */
+
+/*!
+ * Generated using the Bootstrap Customizer (http://getbootstrap.com/customize/?id=e51bc4b79b5712077b546b4ea577f138)
+ * Config saved to config.json and https://gist.github.com/e51bc4b79b5712077b546b4ea577f138
+ *//*!
+ * Bootstrap v3.3.6 (http://getbootstrap.com)
+ * Copyright 2011-2015 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ *//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{*,*:before,*:after{background:transparent !important;color:#000 !important;-webkit-box-shadow:none !important;box-shadow:none !important;text-shadow:none !important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="#"]:after,a[href^="javascript:"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000 !important}.label{border:1px solid #000}.table{border-collapse:collapse !important}.table td,.table th{background-color:#fff !important}.table-bordered th,.table-bordered td{border:1px solid #ddd !important}}@font-face{font-family:'Glyphicons Halflings';src:url('../fonts/glyphicons-halflings-regular.eot');src:url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),url('../fonts/glyphicons-halflings-regular.woff2') format('woff2'),url('../fonts/glyphicons-halflings-regular.woff') format('woff'),url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'),url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:normal;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\002a"}.glyphicon-plus:before{content:"\002b"}.glyphicon-euro:before,.glyphicon-eur:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}.glyphicon-cd:before{content:"\e201"}.glyphicon-save-file:before{content:"\e202"}.glyphicon-open-file:before{content:"\e203"}.glyphicon-level-up:before{content:"\e204"}.glyphicon-copy:before{content:"\e205"}.glyphicon-paste:before{content:"\e206"}.glyphicon-alert:before{content:"\e209"}.glyphicon-equalizer:before{content:"\e210"}.glyphicon-king:before{content:"\e211"}.glyphicon-queen:before{content:"\e212"}.glyphicon-pawn:before{content:"\e213"}.glyphicon-bishop:before{content:"\e214"}.glyphicon-knight:before{content:"\e215"}.glyphicon-baby-formula:before{content:"\e216"}.glyphicon-tent:before{content:"\26fa"}.glyphicon-blackboard:before{content:"\e218"}.glyphicon-bed:before{content:"\e219"}.glyphicon-apple:before{content:"\f8ff"}.glyphicon-erase:before{content:"\e221"}.glyphicon-hourglass:before{content:"\231b"}.glyphicon-lamp:before{content:"\e223"}.glyphicon-duplicate:before{content:"\e224"}.glyphicon-piggy-bank:before{content:"\e225"}.glyphicon-scissors:before{content:"\e226"}.glyphicon-bitcoin:before{content:"\e227"}.glyphicon-btc:before{content:"\e227"}.glyphicon-xbt:before{content:"\e227"}.glyphicon-yen:before{content:"\00a5"}.glyphicon-jpy:before{content:"\00a5"}.glyphicon-ruble:before{content:"\20bd"}.glyphicon-rub:before{content:"\20bd"}.glyphicon-scale:before{content:"\e230"}.glyphicon-ice-lolly:before{content:"\e231"}.glyphicon-ice-lolly-tasted:before{content:"\e232"}.glyphicon-education:before{content:"\e233"}.glyphicon-option-horizontal:before{content:"\e234"}.glyphicon-option-vertical:before{content:"\e235"}.glyphicon-menu-hamburger:before{content:"\e236"}.glyphicon-modal-window:before{content:"\e237"}.glyphicon-oil:before{content:"\e238"}.glyphicon-grain:before{content:"\e239"}.glyphicon-sunglasses:before{content:"\e240"}.glyphicon-text-size:before{content:"\e241"}.glyphicon-text-color:before{content:"\e242"}.glyphicon-text-background:before{content:"\e243"}.glyphicon-object-align-top:before{content:"\e244"}.glyphicon-object-align-bottom:before{content:"\e245"}.glyphicon-object-align-horizontal:before{content:"\e246"}.glyphicon-object-align-left:before{content:"\e247"}.glyphicon-object-align-vertical:before{content:"\e248"}.glyphicon-object-align-right:before{content:"\e249"}.glyphicon-triangle-right:before{content:"\e250"}.glyphicon-triangle-left:before{content:"\e251"}.glyphicon-triangle-bottom:before{content:"\e252"}.glyphicon-triangle-top:before{content:"\e253"}.glyphicon-console:before{content:"\e254"}.glyphicon-superscript:before{content:"\e255"}.glyphicon-subscript:before{content:"\e256"}.glyphicon-menu-left:before{content:"\e257"}.glyphicon-menu-right:before{content:"\e258"}.glyphicon-menu-down:before{content:"\e259"}.glyphicon-menu-up:before{content:"\e260"}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}*:before,*:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff}input,button,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#337ab7;text-decoration:none}a:hover,a:focus{color:#23527c;text-decoration:underline}a:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.img-responsive,.thumbnail>img,.thumbnail a>img,.carousel-inner>.item>img,.carousel-inner>.item>a>img{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out;display:inline-block;max-width:100%;height:auto}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}[role="button"]{cursor:pointer}h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small,.h1 small,.h2 small,.h3 small,.h4 small,.h5 small,.h6 small,h1 .small,h2 .small,h3 .small,h4 .small,h5 .small,h6 .small,.h1 .small,.h2 .small,.h3 .small,.h4 .small,.h5 .small,.h6 .small{font-weight:normal;line-height:1;color:#777}h1,.h1,h2,.h2,h3,.h3{margin-top:20px;margin-bottom:10px}h1 small,.h1 small,h2 small,.h2 small,h3 small,.h3 small,h1 .small,.h1 .small,h2 .small,.h2 .small,h3 .small,.h3 .small{font-size:65%}h4,.h4,h5,.h5,h6,.h6{margin-top:10px;margin-bottom:10px}h4 small,.h4 small,h5 small,.h5 small,h6 small,.h6 small,h4 .small,.h4 .small,h5 .small,.h5 .small,h6 .small,.h6 .small{font-size:75%}h1,.h1{font-size:36px}h2,.h2{font-size:30px}h3,.h3{font-size:24px}h4,.h4{font-size:18px}h5,.h5{font-size:14px}h6,.h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}small,.small{font-size:85%}mark,.mark{background-color:#fcf8e3;padding:.2em}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#777}.text-primary{color:#337ab7}a.text-primary:hover,a.text-primary:focus{color:#286090}.text-success{color:#3c763d}a.text-success:hover,a.text-success:focus{color:#2b542c}.text-info{color:#31708f}a.text-info:hover,a.text-info:focus{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:hover,a.text-warning:focus{color:#66512c}.text-danger{color:#a94442}a.text-danger:hover,a.text-danger:focus{color:#843534}.bg-primary{color:#fff;background-color:#337ab7}a.bg-primary:hover,a.bg-primary:focus{background-color:#286090}.bg-success{background-color:#dff0d8}a.bg-success:hover,a.bg-success:focus{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:hover,a.bg-info:focus{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:hover,a.bg-warning:focus{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:hover,a.bg-danger:focus{background-color:#e4b9b9}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ul,ol{margin-top:0;margin-bottom:10px}ul ul,ol ul,ul ol,ol ol{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none;margin-left:-5px}.list-inline>li{display:inline-block;padding-left:5px;padding-right:5px}dl{margin-top:0;margin-bottom:20px}dt,dd{line-height:1.42857143}dt{font-weight:bold}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #777}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}blockquote p:last-child,blockquote ul:last-child,blockquote ol:last-child{margin-bottom:0}blockquote footer,blockquote small,blockquote .small{display:block;font-size:80%;line-height:1.42857143;color:#777}blockquote footer:before,blockquote small:before,blockquote .small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0;text-align:right}.blockquote-reverse footer:before,blockquote.pull-right footer:before,.blockquote-reverse small:before,blockquote.pull-right small:before,.blockquote-reverse .small:before,blockquote.pull-right .small:before{content:''}.blockquote-reverse footer:after,blockquote.pull-right footer:after,.blockquote-reverse small:after,blockquote.pull-right small:after,.blockquote-reverse .small:after,blockquote.pull-right .small:after{content:'\00A0 \2014'}address{margin-bottom:20px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333;border-radius:3px;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.25);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.25)}kbd kbd{padding:0;font-size:100%;font-weight:bold;-webkit-box-shadow:none;box-shadow:none}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;word-break:break-all;word-wrap:break-word;color:#333;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}.row{margin-left:-15px;margin-right:-15px}.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12{position:relative;min-height:1px;padding-left:15px;padding-right:15px}.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}table{background-color:transparent}caption{padding-top:8px;padding-bottom:8px;color:#777;text-align:left}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:20px}.table>thead>tr>th,.table>tbody>tr>th,.table>tfoot>tr>th,.table>thead>tr>td,.table>tbody>tr>td,.table>tfoot>tr>td{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>th,.table>caption+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>td,.table>thead:first-child>tr:first-child>td{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>thead>tr>th,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>tbody>tr>td,.table-condensed>tfoot>tr>td{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>tbody>tr>td,.table-bordered>tfoot>tr>td{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>thead>tr>td{border-bottom-width:2px}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}.table-hover>tbody>tr:hover{background-color:#f5f5f5}table col[class*="col-"]{position:static;float:none;display:table-column}table td[class*="col-"],table th[class*="col-"]{position:static;float:none;display:table-cell}.table>thead>tr>td.active,.table>tbody>tr>td.active,.table>tfoot>tr>td.active,.table>thead>tr>th.active,.table>tbody>tr>th.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>tbody>tr.active>td,.table>tfoot>tr.active>td,.table>thead>tr.active>th,.table>tbody>tr.active>th,.table>tfoot>tr.active>th{background-color:#f5f5f5}.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover,.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr.active:hover>th{background-color:#e8e8e8}.table>thead>tr>td.success,.table>tbody>tr>td.success,.table>tfoot>tr>td.success,.table>thead>tr>th.success,.table>tbody>tr>th.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>tbody>tr.success>td,.table>tfoot>tr.success>td,.table>thead>tr.success>th,.table>tbody>tr.success>th,.table>tfoot>tr.success>th{background-color:#dff0d8}.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover,.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr.success:hover>th{background-color:#d0e9c6}.table>thead>tr>td.info,.table>tbody>tr>td.info,.table>tfoot>tr>td.info,.table>thead>tr>th.info,.table>tbody>tr>th.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>tbody>tr.info>td,.table>tfoot>tr.info>td,.table>thead>tr.info>th,.table>tbody>tr.info>th,.table>tfoot>tr.info>th{background-color:#d9edf7}.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover,.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr.info:hover>th{background-color:#c4e3f3}.table>thead>tr>td.warning,.table>tbody>tr>td.warning,.table>tfoot>tr>td.warning,.table>thead>tr>th.warning,.table>tbody>tr>th.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>tbody>tr.warning>td,.table>tfoot>tr.warning>td,.table>thead>tr.warning>th,.table>tbody>tr.warning>th,.table>tfoot>tr.warning>th{background-color:#fcf8e3}.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover,.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr.warning:hover>th{background-color:#faf2cc}.table>thead>tr>td.danger,.table>tbody>tr>td.danger,.table>tfoot>tr>td.danger,.table>thead>tr>th.danger,.table>tbody>tr>th.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>tbody>tr.danger>td,.table>tfoot>tr.danger>td,.table>thead>tr.danger>th,.table>tbody>tr.danger>th,.table>tfoot>tr.danger>th{background-color:#f2dede}.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover,.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr.danger:hover>th{background-color:#ebcccc}.table-responsive{overflow-x:auto;min-height:0.01%}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-y:hidden;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>thead>tr>th,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tfoot>tr>td{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>thead>tr>th:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.table-responsive>.table-bordered>thead>tr>th:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>th,.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>td{border-bottom:0}}fieldset{padding:0;margin:0;border:0;min-width:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:bold}input[type="search"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type="radio"],input[type="checkbox"]{margin:4px 0 0;margin-top:1px \9;line-height:normal}input[type="file"]{display:block}input[type="range"]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:7px;font-size:14px;line-height:1.42857143;color:#555}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-transition:border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s, box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s, box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6)}.form-control::-moz-placeholder{color:#999;opacity:1}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control::-ms-expand{border:0;background-color:transparent}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{background-color:#eee;opacity:1}.form-control[disabled],fieldset[disabled] .form-control{cursor:not-allowed}textarea.form-control{height:auto}input[type="search"]{-webkit-appearance:none}@media screen and (-webkit-min-device-pixel-ratio:0){input[type="date"].form-control,input[type="time"].form-control,input[type="datetime-local"].form-control,input[type="month"].form-control{line-height:34px}input[type="date"].input-sm,input[type="time"].input-sm,input[type="datetime-local"].input-sm,input[type="month"].input-sm,.input-group-sm input[type="date"],.input-group-sm input[type="time"],.input-group-sm input[type="datetime-local"],.input-group-sm input[type="month"]{line-height:30px}input[type="date"].input-lg,input[type="time"].input-lg,input[type="datetime-local"].input-lg,input[type="month"].input-lg,.input-group-lg input[type="date"],.input-group-lg input[type="time"],.input-group-lg input[type="datetime-local"],.input-group-lg input[type="month"]{line-height:46px}}.form-group{margin-bottom:15px}.radio,.checkbox{position:relative;display:block;margin-top:10px;margin-bottom:10px}.radio label,.checkbox label{min-height:20px;padding-left:20px;margin-bottom:0;font-weight:normal;cursor:pointer}.radio input[type="radio"],.radio-inline input[type="radio"],.checkbox input[type="checkbox"],.checkbox-inline input[type="checkbox"]{position:absolute;margin-left:-20px;margin-top:4px \9}.radio+.radio,.checkbox+.checkbox{margin-top:-5px}.radio-inline,.checkbox-inline{position:relative;display:inline-block;padding-left:20px;margin-bottom:0;vertical-align:middle;font-weight:normal;cursor:pointer}.radio-inline+.radio-inline,.checkbox-inline+.checkbox-inline{margin-top:0;margin-left:10px}input[type="radio"][disabled],input[type="checkbox"][disabled],input[type="radio"].disabled,input[type="checkbox"].disabled,fieldset[disabled] input[type="radio"],fieldset[disabled] input[type="checkbox"]{cursor:not-allowed}.radio-inline.disabled,.checkbox-inline.disabled,fieldset[disabled] .radio-inline,fieldset[disabled] .checkbox-inline{cursor:not-allowed}.radio.disabled label,.checkbox.disabled label,fieldset[disabled] .radio label,fieldset[disabled] .checkbox label{cursor:not-allowed}.form-control-static{padding-top:7px;padding-bottom:7px;margin-bottom:0;min-height:34px}.form-control-static.input-lg,.form-control-static.input-sm{padding-left:0;padding-right:0}.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm{height:30px;line-height:30px}textarea.input-sm,select[multiple].input-sm{height:auto}.form-group-sm .form-control{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.form-group-sm select.form-control{height:30px;line-height:30px}.form-group-sm textarea.form-control,.form-group-sm select[multiple].form-control{height:auto}.form-group-sm .form-control-static{height:30px;min-height:32px;padding:6px 10px;font-size:12px;line-height:1.5}.input-lg{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-lg{height:46px;line-height:46px}textarea.input-lg,select[multiple].input-lg{height:auto}.form-group-lg .form-control{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.form-group-lg select.form-control{height:46px;line-height:46px}.form-group-lg textarea.form-control,.form-group-lg select[multiple].form-control{height:auto}.form-group-lg .form-control-static{height:46px;min-height:38px;padding:11px 16px;font-size:18px;line-height:1.3333333}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.5px}.form-control-feedback{position:absolute;top:0;right:0;z-index:2;display:block;width:34px;height:34px;line-height:34px;text-align:center;pointer-events:none}.input-lg+.form-control-feedback,.input-group-lg+.form-control-feedback,.form-group-lg .form-control+.form-control-feedback{width:46px;height:46px;line-height:46px}.input-sm+.form-control-feedback,.input-group-sm+.form-control-feedback,.form-group-sm .form-control+.form-control-feedback{width:30px;height:30px;line-height:30px}.has-success .help-block,.has-success .control-label,.has-success .radio,.has-success .checkbox,.has-success .radio-inline,.has-success .checkbox-inline,.has-success.radio label,.has-success.checkbox label,.has-success.radio-inline label,.has-success.checkbox-inline label{color:#3c763d}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;border-color:#3c763d;background-color:#dff0d8}.has-success .form-control-feedback{color:#3c763d}.has-warning .help-block,.has-warning .control-label,.has-warning .radio,.has-warning .checkbox,.has-warning .radio-inline,.has-warning .checkbox-inline,.has-warning.radio label,.has-warning.checkbox label,.has-warning.radio-inline label,.has-warning.checkbox-inline label{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;border-color:#8a6d3b;background-color:#fcf8e3}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .help-block,.has-error .control-label,.has-error .radio,.has-error .checkbox,.has-error .radio-inline,.has-error .checkbox-inline,.has-error.radio label,.has-error.checkbox label,.has-error.radio-inline label,.has-error.checkbox-inline label{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;border-color:#a94442;background-color:#f2dede}.has-error .form-control-feedback{color:#a94442}.has-feedback label~.form-control-feedback{top:25px}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-static{display:inline-block}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn,.form-inline .input-group .form-control{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .radio,.form-inline .checkbox{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .radio label,.form-inline .checkbox label{padding-left:0}.form-inline .radio input[type="radio"],.form-inline .checkbox input[type="checkbox"]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .radio,.form-horizontal .checkbox,.form-horizontal .radio-inline,.form-horizontal .checkbox-inline{margin-top:0;margin-bottom:0;padding-top:7px}.form-horizontal .radio,.form-horizontal .checkbox{min-height:27px}.form-horizontal .form-group{margin-left:-15px;margin-right:-15px}@media (min-width:768px){.form-horizontal .control-label{text-align:right;margin-bottom:0;padding-top:7px}}.form-horizontal .has-feedback .form-control-feedback{right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:11px;font-size:18px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:6px;font-size:12px}}.btn{display:inline-block;margin-bottom:0;font-weight:normal;text-align:center;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;background-image:none;border:1px solid transparent;white-space:nowrap;padding:6px 12px;font-size:14px;line-height:1.42857143;border-radius:4px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.btn:focus,.btn:active:focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn.active.focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn:hover,.btn:focus,.btn.focus{color:#333;text-decoration:none}.btn:active,.btn.active{outline:0;background-image:none;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none}a.btn.disabled,fieldset[disabled] a.btn{pointer-events:none}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default:focus,.btn-default.focus{color:#333;background-color:#e6e6e6;border-color:#8c8c8c}.btn-default:hover{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default:active,.btn-default.active,.open>.dropdown-toggle.btn-default{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default:active:hover,.btn-default.active:hover,.open>.dropdown-toggle.btn-default:hover,.btn-default:active:focus,.btn-default.active:focus,.open>.dropdown-toggle.btn-default:focus,.btn-default:active.focus,.btn-default.active.focus,.open>.dropdown-toggle.btn-default.focus{color:#333;background-color:#d4d4d4;border-color:#8c8c8c}.btn-default:active,.btn-default.active,.open>.dropdown-toggle.btn-default{background-image:none}.btn-default.disabled:hover,.btn-default[disabled]:hover,fieldset[disabled] .btn-default:hover,.btn-default.disabled:focus,.btn-default[disabled]:focus,fieldset[disabled] .btn-default:focus,.btn-default.disabled.focus,.btn-default[disabled].focus,fieldset[disabled] .btn-default.focus{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#333}.btn-primary{color:#fff;background-color:#337ab7;border-color:#2e6da4}.btn-primary:focus,.btn-primary.focus{color:#fff;background-color:#286090;border-color:#122b40}.btn-primary:hover{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary:active,.btn-primary.active,.open>.dropdown-toggle.btn-primary{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary:active:hover,.btn-primary.active:hover,.open>.dropdown-toggle.btn-primary:hover,.btn-primary:active:focus,.btn-primary.active:focus,.open>.dropdown-toggle.btn-primary:focus,.btn-primary:active.focus,.btn-primary.active.focus,.open>.dropdown-toggle.btn-primary.focus{color:#fff;background-color:#204d74;border-color:#122b40}.btn-primary:active,.btn-primary.active,.open>.dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled:hover,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary:hover,.btn-primary.disabled:focus,.btn-primary[disabled]:focus,fieldset[disabled] .btn-primary:focus,.btn-primary.disabled.focus,.btn-primary[disabled].focus,fieldset[disabled] .btn-primary.focus{background-color:#337ab7;border-color:#2e6da4}.btn-primary .badge{color:#337ab7;background-color:#fff}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success:focus,.btn-success.focus{color:#fff;background-color:#449d44;border-color:#255625}.btn-success:hover{color:#fff;background-color:#449d44;border-color:#398439}.btn-success:active,.btn-success.active,.open>.dropdown-toggle.btn-success{color:#fff;background-color:#449d44;border-color:#398439}.btn-success:active:hover,.btn-success.active:hover,.open>.dropdown-toggle.btn-success:hover,.btn-success:active:focus,.btn-success.active:focus,.open>.dropdown-toggle.btn-success:focus,.btn-success:active.focus,.btn-success.active.focus,.open>.dropdown-toggle.btn-success.focus{color:#fff;background-color:#398439;border-color:#255625}.btn-success:active,.btn-success.active,.open>.dropdown-toggle.btn-success{background-image:none}.btn-success.disabled:hover,.btn-success[disabled]:hover,fieldset[disabled] .btn-success:hover,.btn-success.disabled:focus,.btn-success[disabled]:focus,fieldset[disabled] .btn-success:focus,.btn-success.disabled.focus,.btn-success[disabled].focus,fieldset[disabled] .btn-success.focus{background-color:#5cb85c;border-color:#4cae4c}.btn-success .badge{color:#5cb85c;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info:focus,.btn-info.focus{color:#fff;background-color:#31b0d5;border-color:#1b6d85}.btn-info:hover{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info:active,.btn-info.active,.open>.dropdown-toggle.btn-info{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info:active:hover,.btn-info.active:hover,.open>.dropdown-toggle.btn-info:hover,.btn-info:active:focus,.btn-info.active:focus,.open>.dropdown-toggle.btn-info:focus,.btn-info:active.focus,.btn-info.active.focus,.open>.dropdown-toggle.btn-info.focus{color:#fff;background-color:#269abc;border-color:#1b6d85}.btn-info:active,.btn-info.active,.open>.dropdown-toggle.btn-info{background-image:none}.btn-info.disabled:hover,.btn-info[disabled]:hover,fieldset[disabled] .btn-info:hover,.btn-info.disabled:focus,.btn-info[disabled]:focus,fieldset[disabled] .btn-info:focus,.btn-info.disabled.focus,.btn-info[disabled].focus,fieldset[disabled] .btn-info.focus{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning:focus,.btn-warning.focus{color:#fff;background-color:#ec971f;border-color:#985f0d}.btn-warning:hover{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning:active,.btn-warning.active,.open>.dropdown-toggle.btn-warning{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning:active:hover,.btn-warning.active:hover,.open>.dropdown-toggle.btn-warning:hover,.btn-warning:active:focus,.btn-warning.active:focus,.open>.dropdown-toggle.btn-warning:focus,.btn-warning:active.focus,.btn-warning.active.focus,.open>.dropdown-toggle.btn-warning.focus{color:#fff;background-color:#d58512;border-color:#985f0d}.btn-warning:active,.btn-warning.active,.open>.dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled:hover,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning:hover,.btn-warning.disabled:focus,.btn-warning[disabled]:focus,fieldset[disabled] .btn-warning:focus,.btn-warning.disabled.focus,.btn-warning[disabled].focus,fieldset[disabled] .btn-warning.focus{background-color:#f0ad4e;border-color:#eea236}.btn-warning .badge{color:#f0ad4e;background-color:#fff}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger:focus,.btn-danger.focus{color:#fff;background-color:#c9302c;border-color:#761c19}.btn-danger:hover{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger:active,.btn-danger.active,.open>.dropdown-toggle.btn-danger{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger:active:hover,.btn-danger.active:hover,.open>.dropdown-toggle.btn-danger:hover,.btn-danger:active:focus,.btn-danger.active:focus,.open>.dropdown-toggle.btn-danger:focus,.btn-danger:active.focus,.btn-danger.active.focus,.open>.dropdown-toggle.btn-danger.focus{color:#fff;background-color:#ac2925;border-color:#761c19}.btn-danger:active,.btn-danger.active,.open>.dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled:hover,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger:hover,.btn-danger.disabled:focus,.btn-danger[disabled]:focus,fieldset[disabled] .btn-danger:focus,.btn-danger.disabled.focus,.btn-danger[disabled].focus,fieldset[disabled] .btn-danger.focus{background-color:#d9534f;border-color:#d43f3a}.btn-danger .badge{color:#d9534f;background-color:#fff}.btn-link{color:#337ab7;font-weight:normal;border-radius:0}.btn-link,.btn-link:active,.btn-link.active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:hover,.btn-link:focus,.btn-link:active{border-color:transparent}.btn-link:hover,.btn-link:focus{color:#23527c;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover,fieldset[disabled] .btn-link:hover,.btn-link[disabled]:focus,fieldset[disabled] .btn-link:focus{color:#777;text-decoration:none}.btn-lg,.btn-group-lg>.btn{padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.btn-sm,.btn-group-sm>.btn{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-xs,.btn-group-xs>.btn{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition-property:height, visibility;-o-transition-property:height, visibility;transition-property:height, visibility;-webkit-transition-duration:.35s;-o-transition-duration:.35s;transition-duration:.35s;-webkit-transition-timing-function:ease;-o-transition-timing-function:ease;transition-timing-function:ease}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px dashed;border-top:4px solid \9;border-right:4px solid transparent;border-left:4px solid transparent}.dropup,.dropdown{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;font-size:14px;text-align:left;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,0.175);box-shadow:0 6px 12px rgba(0,0,0,0.175);-webkit-background-clip:padding-box;background-clip:padding-box}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:normal;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{text-decoration:none;color:#262626;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{color:#fff;text-decoration:none;outline:0;background-color:#337ab7}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{color:#777}.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{text-decoration:none;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);cursor:not-allowed}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{left:auto;right:0}.dropdown-menu-left{left:0;right:auto}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}.dropdown-backdrop{position:fixed;left:0;right:0;bottom:0;top:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px dashed;border-bottom:4px solid \9;content:""}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:2px}@media (min-width:768px){.navbar-right .dropdown-menu{left:auto;right:0}.navbar-right .dropdown-menu-left{left:0;right:auto}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group>.btn,.btn-group-vertical>.btn{position:relative;float:left}.btn-group>.btn:hover,.btn-group-vertical>.btn:hover,.btn-group>.btn:focus,.btn-group-vertical>.btn:focus,.btn-group>.btn:active,.btn-group-vertical>.btn:active,.btn-group>.btn.active,.btn-group-vertical>.btn.active{z-index:2}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn,.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-top-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-top-right-radius:0}.btn-group>.btn-group:last-child:not(:first-child)>.btn:first-child{border-bottom-left-radius:0;border-top-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-left:8px;padding-right:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-left:12px;padding-right:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-right-radius:4px;border-top-left-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-right-radius:0;border-top-left-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{float:none;display:table-cell;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle="buttons"]>.btn input[type="radio"],[data-toggle="buttons"]>.btn-group>.btn input[type="radio"],[data-toggle="buttons"]>.btn input[type="checkbox"],[data-toggle="buttons"]>.btn-group>.btn input[type="checkbox"]{position:absolute;clip:rect(0, 0, 0, 0);pointer-events:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*="col-"]{float:none;padding-left:0;padding-right:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group .form-control:focus{z-index:3}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:46px;line-height:46px}textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn,select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn,select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn{height:auto}.input-group-addon,.input-group-btn,.input-group .form-control{display:table-cell}.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child),.input-group .form-control:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:normal;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type="radio"],.input-group-addon input[type="checkbox"]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group-btn:last-child>.btn-group:not(:last-child)>.btn{border-bottom-right-radius:0;border-top-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:first-child>.btn-group:not(:first-child)>.btn{border-bottom-left-radius:0;border-top-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:hover,.input-group-btn>.btn:focus,.input-group-btn>.btn:active{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{z-index:2;margin-left:-1px}.nav{margin-bottom:0;padding-left:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:hover,.nav>li>a:focus{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#777}.nav>li.disabled>a:hover,.nav>li.disabled>a:focus{color:#777;text-decoration:none;background-color:transparent;cursor:not-allowed}.nav .open>a,.nav .open>a:hover,.nav .open>a:focus{background-color:#eee;border-color:#337ab7}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:hover,.nav-tabs>li.active>a:focus{color:#555;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent;cursor:default}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{text-align:center;margin-bottom:5px}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border:1px solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:hover,.nav-pills>li.active>a:focus{color:#fff;background-color:#337ab7}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{text-align:center;margin-bottom:5px}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border:1px solid #ddd}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-right-radius:0;border-top-left-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:4px}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{overflow-x:visible;padding-right:15px;padding-left:15px;border-top:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1);-webkit-overflow-scrolling:touch}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block !important;height:auto !important;padding-bottom:0;overflow:visible !important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{padding-left:0;padding-right:0}}.navbar-fixed-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{max-height:340px}@media (max-device-width:480px) and (orientation:landscape){.navbar-fixed-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{max-height:200px}}.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030}@media (min-width:768px){.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;padding:15px 15px;font-size:18px;line-height:20px;height:50px}.navbar-brand:hover,.navbar-brand:focus{text-decoration:none}.navbar-brand>img{display:block}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;margin-right:15px;padding:9px 10px;margin-top:8px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-nav .open .dropdown-menu>li>a,.navbar-nav .open .dropdown-menu .dropdown-header{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:hover,.navbar-nav .open .dropdown-menu>li>a:focus{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}}.navbar-form{margin-left:-15px;margin-right:-15px;padding:10px 15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);margin-top:8px;margin-bottom:8px}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .form-control-static{display:inline-block}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn,.navbar-form .input-group .form-control{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .radio,.navbar-form .checkbox{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .radio label,.navbar-form .checkbox label{padding-left:0}.navbar-form .radio input[type="radio"],.navbar-form .checkbox input[type="checkbox"]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}.navbar-form .form-group:last-child{margin-bottom:0}}@media (min-width:768px){.navbar-form{width:auto;border:0;margin-left:0;margin-right:0;padding-top:0;padding-bottom:0;-webkit-box-shadow:none;box-shadow:none}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-right-radius:0;border-top-left-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{margin-bottom:0;border-top-right-radius:4px;border-top-left-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:8px;margin-bottom:8px}.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px}.navbar-text{margin-top:15px;margin-bottom:15px}@media (min-width:768px){.navbar-text{float:left;margin-left:15px;margin-right:15px}}@media (min-width:768px){.navbar-left{float:left !important}.navbar-right{float:right !important;margin-right:-15px}.navbar-right~.navbar-right{margin-right:0}}.navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:hover,.navbar-default .navbar-brand:focus{color:#5e5e5e;background-color:transparent}.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a{color:#777}.navbar-default .navbar-nav>li>a:hover,.navbar-default .navbar-nav>li>a:focus{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:hover,.navbar-default .navbar-nav>.active>a:focus{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:hover,.navbar-default .navbar-nav>.disabled>a:focus{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:hover,.navbar-default .navbar-toggle:focus{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e7e7e7}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{background-color:#e7e7e7;color:#555}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-default .btn-link{color:#777}.navbar-default .btn-link:hover,.navbar-default .btn-link:focus{color:#333}.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:hover,.navbar-default .btn-link[disabled]:focus,fieldset[disabled] .navbar-default .btn-link:focus{color:#ccc}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#9d9d9d}.navbar-inverse .navbar-brand:hover,.navbar-inverse .navbar-brand:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a:hover,.navbar-inverse .navbar-nav>li>a:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:hover,.navbar-inverse .navbar-nav>.active>a:focus{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:hover,.navbar-inverse .navbar-nav>.disabled>a:focus{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:hover,.navbar-inverse .navbar-toggle:focus{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:hover,.navbar-inverse .navbar-nav>.open>a:focus{background-color:#080808;color:#fff}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#9d9d9d}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .btn-link{color:#9d9d9d}.navbar-inverse .btn-link:hover,.navbar-inverse .btn-link:focus{color:#fff}.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:hover,.navbar-inverse .btn-link[disabled]:focus,fieldset[disabled] .navbar-inverse .btn-link:focus{color:#444}.breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{content:"/\00a0";padding:0 5px;color:#ccc}.breadcrumb>.active{color:#777}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;line-height:1.42857143;text-decoration:none;color:#337ab7;background-color:#fff;border:1px solid #ddd;margin-left:-1px}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-bottom-left-radius:4px;border-top-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-bottom-right-radius:4px;border-top-right-radius:4px}.pagination>li>a:hover,.pagination>li>span:hover,.pagination>li>a:focus,.pagination>li>span:focus{z-index:2;color:#23527c;background-color:#eee;border-color:#ddd}.pagination>.active>a,.pagination>.active>span,.pagination>.active>a:hover,.pagination>.active>span:hover,.pagination>.active>a:focus,.pagination>.active>span:focus{z-index:3;color:#fff;background-color:#337ab7;border-color:#337ab7;cursor:default}.pagination>.disabled>span,.pagination>.disabled>span:hover,.pagination>.disabled>span:focus,.pagination>.disabled>a,.pagination>.disabled>a:hover,.pagination>.disabled>a:focus{color:#777;background-color:#fff;border-color:#ddd;cursor:not-allowed}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px;line-height:1.3333333}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-bottom-left-radius:6px;border-top-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-bottom-right-radius:6px;border-top-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px;line-height:1.5}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-bottom-left-radius:3px;border-top-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-bottom-right-radius:3px;border-top-right-radius:3px}.pager{padding-left:0;margin:20px 0;list-style:none;text-align:center}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:hover,.pager li>a:focus{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>a:focus,.pager .disabled>span{color:#777;background-color:#fff;cursor:not-allowed}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:bold;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.label:hover,a.label:focus{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#777}.label-default[href]:hover,.label-default[href]:focus{background-color:#5e5e5e}.label-primary{background-color:#337ab7}.label-primary[href]:hover,.label-primary[href]:focus{background-color:#286090}.label-success{background-color:#5cb85c}.label-success[href]:hover,.label-success[href]:focus{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:hover,.label-info[href]:focus{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:hover,.label-warning[href]:focus{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:hover,.label-danger[href]:focus{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:bold;color:#fff;line-height:1;vertical-align:middle;white-space:nowrap;text-align:center;background-color:#777;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-xs .badge,.btn-group-xs>.btn .badge{top:0;padding:1px 5px}a.badge:hover,a.badge:focus{color:#fff;text-decoration:none;cursor:pointer}.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#337ab7;background-color:#fff}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding-top:30px;padding-bottom:30px;margin-bottom:30px;color:inherit;background-color:#eee}.jumbotron h1,.jumbotron .h1{color:inherit}.jumbotron p{margin-bottom:15px;font-size:21px;font-weight:200}.jumbotron>hr{border-top-color:#d5d5d5}.container .jumbotron,.container-fluid .jumbotron{border-radius:6px;padding-left:15px;padding-right:15px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron,.container-fluid .jumbotron{padding-left:60px;padding-right:60px}.jumbotron h1,.jumbotron .h1{font-size:63px}}.thumbnail{display:block;padding:4px;margin-bottom:20px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:border .2s ease-in-out;-o-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.thumbnail>img,.thumbnail a>img{margin-left:auto;margin-right:auto}a.thumbnail:hover,a.thumbnail:focus,a.thumbnail.active{border-color:#337ab7}.thumbnail .caption{padding:9px;color:#333}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:bold}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{background-color:#dff0d8;border-color:#d6e9c6;color:#3c763d}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{background-color:#d9edf7;border-color:#bce8f1;color:#31708f}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{background-color:#fcf8e3;border-color:#faebcc;color:#8a6d3b}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{background-color:#f2dede;border-color:#ebccd1;color:#a94442}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{overflow:hidden;height:20px;margin-bottom:20px;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1)}.progress-bar{float:left;width:0%;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#337ab7;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-webkit-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress-striped .progress-bar,.progress-bar-striped{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);-webkit-background-size:40px 40px;background-size:40px 40px}.progress.active .progress-bar,.progress-bar.active{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.progress-bar-warning{background-color:#f0ad4e}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.media{margin-top:15px}.media:first-child{margin-top:0}.media,.media-body{zoom:1;overflow:hidden}.media-body{width:10000px}.media-object{display:block}.media-object.img-thumbnail{max-width:none}.media-right,.media>.pull-right{padding-left:10px}.media-left,.media>.pull-left{padding-right:10px}.media-left,.media-right,.media-body{display:table-cell;vertical-align:top}.media-middle{vertical-align:middle}.media-bottom{vertical-align:bottom}.media-heading{margin-top:0;margin-bottom:5px}.media-list{padding-left:0;list-style:none}.list-group{margin-bottom:20px;padding-left:0}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-right-radius:4px;border-top-left-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}a.list-group-item,button.list-group-item{color:#555}a.list-group-item .list-group-item-heading,button.list-group-item .list-group-item-heading{color:#333}a.list-group-item:hover,button.list-group-item:hover,a.list-group-item:focus,button.list-group-item:focus{text-decoration:none;color:#555;background-color:#f5f5f5}button.list-group-item{width:100%;text-align:left}.list-group-item.disabled,.list-group-item.disabled:hover,.list-group-item.disabled:focus{background-color:#eee;color:#777;cursor:not-allowed}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text{color:#777}.list-group-item.active,.list-group-item.active:hover,.list-group-item.active:focus{z-index:2;color:#fff;background-color:#337ab7;border-color:#337ab7}.list-group-item.active .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>.small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:hover .list-group-item-text,.list-group-item.active:focus .list-group-item-text{color:#c7ddef}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success,button.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading,button.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:hover,button.list-group-item-success:hover,a.list-group-item-success:focus,button.list-group-item-success:focus{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,button.list-group-item-success.active,a.list-group-item-success.active:hover,button.list-group-item-success.active:hover,a.list-group-item-success.active:focus,button.list-group-item-success.active:focus{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info,button.list-group-item-info{color:#31708f}a.list-group-item-info .list-group-item-heading,button.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:hover,button.list-group-item-info:hover,a.list-group-item-info:focus,button.list-group-item-info:focus{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,button.list-group-item-info.active,a.list-group-item-info.active:hover,button.list-group-item-info.active:hover,a.list-group-item-info.active:focus,button.list-group-item-info.active:focus{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning,button.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading,button.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:hover,button.list-group-item-warning:hover,a.list-group-item-warning:focus,button.list-group-item-warning:focus{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,button.list-group-item-warning.active,a.list-group-item-warning.active:hover,button.list-group-item-warning.active:hover,a.list-group-item-warning.active:focus,button.list-group-item-warning.active:focus{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger,button.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading,button.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:hover,button.list-group-item-danger:hover,a.list-group-item-danger:focus,button.list-group-item-danger:focus{color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,button.list-group-item-danger.active,a.list-group-item-danger.active:hover,button.list-group-item-danger.active:hover,a.list-group-item-danger.active:focus,button.list-group-item-danger.active:focus{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.05);box-shadow:0 1px 1px rgba(0,0,0,0.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-right-radius:3px;border-top-left-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit}.panel-title>a,.panel-title>small,.panel-title>.small,.panel-title>small>a,.panel-title>.small>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group,.panel>.panel-collapse>.list-group{margin-bottom:0}.panel>.list-group .list-group-item,.panel>.panel-collapse>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child,.panel>.panel-collapse>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-right-radius:3px;border-top-left-radius:3px}.panel>.list-group:last-child .list-group-item:last-child,.panel>.panel-collapse>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.panel-heading+.panel-collapse>.list-group .list-group-item:first-child{border-top-right-radius:0;border-top-left-radius:0}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.list-group+.panel-footer{border-top-width:0}.panel>.table,.panel>.table-responsive>.table,.panel>.panel-collapse>.table{margin-bottom:0}.panel>.table caption,.panel>.table-responsive>.table caption,.panel>.panel-collapse>.table caption{padding-left:15px;padding-right:15px}.panel>.table:first-child,.panel>.table-responsive:first-child>.table:first-child{border-top-right-radius:3px;border-top-left-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table:last-child,.panel>.table-responsive:last-child>.table:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child{border-bottom-left-radius:3px;border-bottom-right-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive,.panel>.table+.panel-body,.panel>.table-responsive+.panel-body{border-top:1px solid #ddd}.panel>.table>tbody:first-child>tr:first-child th,.panel>.table>tbody:first-child>tr:first-child td{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{border:0;margin-bottom:0}.panel-group{margin-bottom:20px}.panel-group .panel{margin-bottom:0;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse>.panel-body,.panel-group .panel-heading+.panel-collapse>.list-group{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ddd}.panel-default>.panel-heading .badge{color:#f5f5f5;background-color:#333}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#337ab7}.panel-primary>.panel-heading{color:#fff;background-color:#337ab7;border-color:#337ab7}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#337ab7}.panel-primary>.panel-heading .badge{color:#337ab7;background-color:#fff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#337ab7}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#d6e9c6}.panel-success>.panel-heading .badge{color:#dff0d8;background-color:#3c763d}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#d6e9c6}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#bce8f1}.panel-info>.panel-heading .badge{color:#d9edf7;background-color:#31708f}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#bce8f1}.panel-warning{border-color:#faebcc}.panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#faebcc}.panel-warning>.panel-heading .badge{color:#fcf8e3;background-color:#8a6d3b}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#faebcc}.panel-danger{border-color:#ebccd1}.panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ebccd1}.panel-danger>.panel-heading .badge{color:#f2dede;background-color:#a94442}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ebccd1}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive iframe,.embed-responsive embed,.embed-responsive object,.embed-responsive video{position:absolute;top:0;left:0;bottom:0;height:100%;width:100%;border:0}.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);box-shadow:inset 0 1px 1px rgba(0,0,0,0.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,0.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:21px;font-weight:bold;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.close:hover,.close:focus{color:#000;text-decoration:none;cursor:pointer;opacity:.5;filter:alpha(opacity=50)}button.close{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}.modal-open{overflow:hidden}.modal{display:none;overflow:hidden;position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transform:translate(0, -25%);-ms-transform:translate(0, -25%);-o-transform:translate(0, -25%);transform:translate(0, -25%);-webkit-transition:-webkit-transform 0.3s ease-out;-o-transition:-o-transform 0.3s ease-out;transition:transform 0.3s ease-out}.modal.in .modal-dialog{-webkit-transform:translate(0, 0);-ms-transform:translate(0, 0);-o-transform:translate(0, 0);transform:translate(0, 0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;border:1px solid #999;border:1px solid rgba(0,0,0,0.2);border-radius:6px;-webkit-box-shadow:0 3px 9px rgba(0,0,0,0.5);box-shadow:0 3px 9px rgba(0,0,0,0.5);-webkit-background-clip:padding-box;background-clip:padding-box;outline:0}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{opacity:0;filter:alpha(opacity=0)}.modal-backdrop.in{opacity:.5;filter:alpha(opacity=50)}.modal-header{padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:15px}.modal-footer{padding:15px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-left:5px;margin-bottom:0}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,0.5);box-shadow:0 5px 15px rgba(0,0,0,0.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-style:normal;font-weight:normal;letter-spacing:normal;line-break:auto;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;font-size:12px;opacity:0;filter:alpha(opacity=0)}.tooltip.in{opacity:.9;filter:alpha(opacity=90)}.tooltip.top{margin-top:-3px;padding:5px 0}.tooltip.right{margin-left:3px;padding:0 5px}.tooltip.bottom{margin-top:3px;padding:5px 0}.tooltip.left{margin-left:-3px;padding:0 5px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;background-color:#000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{bottom:0;right:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-right .tooltip-arrow{bottom:0;left:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-left .tooltip-arrow{top:0;right:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-right .tooltip-arrow{top:0;left:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-style:normal;font-weight:normal;letter-spacing:normal;line-break:auto;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;font-size:14px;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2)}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{margin:0;padding:8px 14px;font-size:14px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow{border-width:11px}.popover>.arrow:after{border-width:10px;content:""}.popover.top>.arrow{left:50%;margin-left:-11px;border-bottom-width:0;border-top-color:#999;border-top-color:rgba(0,0,0,0.25);bottom:-11px}.popover.top>.arrow:after{content:" ";bottom:1px;margin-left:-10px;border-bottom-width:0;border-top-color:#fff}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-left-width:0;border-right-color:#999;border-right-color:rgba(0,0,0,0.25)}.popover.right>.arrow:after{content:" ";left:1px;bottom:-10px;border-left-width:0;border-right-color:#fff}.popover.bottom>.arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,0.25);top:-11px}.popover.bottom>.arrow:after{content:" ";top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#fff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,0.25)}.popover.left>.arrow:after{content:" ";right:1px;border-right-width:0;border-left-color:#fff;bottom:-10px}.carousel{position:relative}.carousel-inner{position:relative;overflow:hidden;width:100%}.carousel-inner>.item{display:none;position:relative;-webkit-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>img,.carousel-inner>.item>a>img{line-height:1}@media all and (transform-3d),(-webkit-transform-3d){.carousel-inner>.item{-webkit-transition:-webkit-transform 0.6s ease-in-out;-o-transition:-o-transform 0.6s ease-in-out;transition:transform 0.6s ease-in-out;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000px;perspective:1000px}.carousel-inner>.item.next,.carousel-inner>.item.active.right{-webkit-transform:translate3d(100%, 0, 0);transform:translate3d(100%, 0, 0);left:0}.carousel-inner>.item.prev,.carousel-inner>.item.active.left{-webkit-transform:translate3d(-100%, 0, 0);transform:translate3d(-100%, 0, 0);left:0}.carousel-inner>.item.next.left,.carousel-inner>.item.prev.right,.carousel-inner>.item.active{-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);left:0}}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;left:0;bottom:0;width:15%;opacity:.5;filter:alpha(opacity=50);font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,0.6);background-color:rgba(0,0,0,0)}.carousel-control.left{background-image:-webkit-linear-gradient(left, rgba(0,0,0,0.5) 0, rgba(0,0,0,0.0001) 100%);background-image:-o-linear-gradient(left, rgba(0,0,0,0.5) 0, rgba(0,0,0,0.0001) 100%);background-image:-webkit-gradient(linear, left top, right top, color-stop(0, rgba(0,0,0,0.5)), to(rgba(0,0,0,0.0001)));background-image:linear-gradient(to right, rgba(0,0,0,0.5) 0, rgba(0,0,0,0.0001) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1)}.carousel-control.right{left:auto;right:0;background-image:-webkit-linear-gradient(left, rgba(0,0,0,0.0001) 0, rgba(0,0,0,0.5) 100%);background-image:-o-linear-gradient(left, rgba(0,0,0,0.0001) 0, rgba(0,0,0,0.5) 100%);background-image:-webkit-gradient(linear, left top, right top, color-stop(0, rgba(0,0,0,0.0001)), to(rgba(0,0,0,0.5)));background-image:linear-gradient(to right, rgba(0,0,0,0.0001) 0, rgba(0,0,0,0.5) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1)}.carousel-control:hover,.carousel-control:focus{outline:0;color:#fff;text-decoration:none;opacity:.9;filter:alpha(opacity=90)}.carousel-control .icon-prev,.carousel-control .icon-next,.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right{position:absolute;top:50%;margin-top:-10px;z-index:5;display:inline-block}.carousel-control .icon-prev,.carousel-control .glyphicon-chevron-left{left:50%;margin-left:-10px}.carousel-control .icon-next,.carousel-control .glyphicon-chevron-right{right:50%;margin-right:-10px}.carousel-control .icon-prev,.carousel-control .icon-next{width:20px;height:20px;line-height:1;font-family:serif}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;margin-left:-30%;padding-left:0;list-style:none;text-align:center}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;border:1px solid #fff;border-radius:10px;cursor:pointer;background-color:#000 \9;background-color:rgba(0,0,0,0)}.carousel-indicators .active{margin:0;width:12px;height:12px;background-color:#fff}.carousel-caption{position:absolute;left:15%;right:15%;bottom:20px;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,0.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-prev,.carousel-control .icon-next{width:30px;height:30px;margin-top:-10px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-10px}.carousel-caption{left:20%;right:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.clearfix:before,.clearfix:after,.dl-horizontal dd:before,.dl-horizontal dd:after,.container:before,.container:after,.container-fluid:before,.container-fluid:after,.row:before,.row:after,.form-horizontal .form-group:before,.form-horizontal .form-group:after,.btn-toolbar:before,.btn-toolbar:after,.btn-group-vertical>.btn-group:before,.btn-group-vertical>.btn-group:after,.nav:before,.nav:after,.navbar:before,.navbar:after,.navbar-header:before,.navbar-header:after,.navbar-collapse:before,.navbar-collapse:after,.pager:before,.pager:after,.panel-body:before,.panel-body:after,.modal-header:before,.modal-header:after,.modal-footer:before,.modal-footer:after{content:" ";display:table}.clearfix:after,.dl-horizontal dd:after,.container:after,.container-fluid:after,.row:after,.form-horizontal .form-group:after,.btn-toolbar:after,.btn-group-vertical>.btn-group:after,.nav:after,.navbar:after,.navbar-header:after,.navbar-collapse:after,.pager:after,.panel-body:after,.modal-header:after,.modal-footer:after{clear:both}.center-block{display:block;margin-left:auto;margin-right:auto}.pull-right{float:right !important}.pull-left{float:left !important}.hide{display:none !important}.show{display:block !important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none !important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-xs,.visible-sm,.visible-md,.visible-lg{display:none !important}.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block{display:none !important}@media (max-width:767px){.visible-xs{display:block !important}table.visible-xs{display:table !important}tr.visible-xs{display:table-row !important}th.visible-xs,td.visible-xs{display:table-cell !important}}@media (max-width:767px){.visible-xs-block{display:block !important}}@media (max-width:767px){.visible-xs-inline{display:inline !important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block !important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block !important}table.visible-sm{display:table !important}tr.visible-sm{display:table-row !important}th.visible-sm,td.visible-sm{display:table-cell !important}}@media (min-width:768px) and (max-width:991px){.visible-sm-block{display:block !important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline{display:inline !important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline-block{display:inline-block !important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block !important}table.visible-md{display:table !important}tr.visible-md{display:table-row !important}th.visible-md,td.visible-md{display:table-cell !important}}@media (min-width:992px) and (max-width:1199px){.visible-md-block{display:block !important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline{display:inline !important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline-block{display:inline-block !important}}@media (min-width:1200px){.visible-lg{display:block !important}table.visible-lg{display:table !important}tr.visible-lg{display:table-row !important}th.visible-lg,td.visible-lg{display:table-cell !important}}@media (min-width:1200px){.visible-lg-block{display:block !important}}@media (min-width:1200px){.visible-lg-inline{display:inline !important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block !important}}@media (max-width:767px){.hidden-xs{display:none !important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none !important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none !important}}@media (min-width:1200px){.hidden-lg{display:none !important}}.visible-print{display:none !important}@media print{.visible-print{display:block !important}table.visible-print{display:table !important}tr.visible-print{display:table-row !important}th.visible-print,td.visible-print{display:table-cell !important}}.visible-print-block{display:none !important}@media print{.visible-print-block{display:block !important}}.visible-print-inline{display:none !important}@media print{.visible-print-inline{display:inline !important}}.visible-print-inline-block{display:none !important}@media print{.visible-print-inline-block{display:inline-block !important}}@media print{.hidden-print{display:none !important}} \ No newline at end of file
diff --git a/public_html/data/css/colorbox.css b/public_html/data/css/colorbox.css
new file mode 100644
index 000000000..a647f73b6
--- /dev/null
+++ b/public_html/data/css/colorbox.css
@@ -0,0 +1,73 @@
+/*
+ Colorbox Core Style:
+ The following CSS is consistent between example themes and should not be altered.
+*/
+#colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}
+#cboxWrapper {max-width:none;}
+#cboxOverlay{position:fixed; width:100%; height:100%;}
+#cboxMiddleLeft, #cboxBottomLeft{clear:left;}
+#cboxContent{position:relative;}
+#cboxLoadedContent{overflow:auto; -webkit-overflow-scrolling: touch;}
+#cboxTitle{margin:0;}
+#cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;}
+#cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
+.cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none; -ms-interpolation-mode:bicubic;}
+.cboxIframe{width:100%; height:100%; display:block; border:0; padding:0; margin:0;}
+#colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;}
+
+/*
+ User Style:
+ Change the following styles to modify the appearance of Colorbox. They are
+ ordered & tabbed in a way that represents the nesting of the generated HTML.
+*/
+#cboxOverlay{background:#000; opacity: 0.9; filter: alpha(opacity = 90);}
+#colorbox{outline:0;}
+ #cboxContent{margin-top:32px; overflow:visible; background:#000;}
+ .cboxIframe{background:#fff;}
+ #cboxError{padding:50px; border:1px solid #ccc;}
+ #cboxLoadedContent{background:#000; padding:1px;overflow:hidden !important;}
+ .cboxPhoto{float:left !important; background: #fff;}
+ #cboxLoadingGraphic{background:url(/data/img/colorbox/loading.gif) no-repeat center center;}
+ #cboxLoadingOverlay{background:#000;}
+ #cboxTitle{position:fixed; top:0; left:6px; color:#fff;}
+ #cboxCurrent{position:fixed; top:0; right:66px; display: none; color:#fff;}
+
+ /* these elements are buttons, and may need to have additional styles reset to avoid unwanted base styles */
+ /*#cboxPrevious, #cboxNext, #cboxSlideshow, #cboxClose {border:0; padding:0; margin:0; overflow:visible; text-indent:-9999px; width:20px; height:20px; position:absolute; top:-20px; background:url(/data/img/colorbox/controls.png) no-repeat 0 0;}*/
+
+ #cboxPrevious, #cboxNext, #cboxSlideshow, #cboxClose {
+ border:0;
+ padding:0;
+ margin:0;
+ overflow:visible;
+ width:20px;
+ height:20px;
+ position:fixed;
+ top:0;
+ background: transparent;
+ color: #fff;
+ }
+
+ #cboxPrevious{right:44px;}
+ #cboxNext{right:22px;}
+ #cboxClose{right:0;}
+ .cboxSlideshow_on #cboxSlideshow, .cboxSlideshow_off #cboxSlideshow{right:44px;}
+ .cboxSlideshow_on #cboxPrevious, .cboxSlideshow_off #cboxPrevious{right:66px;}
+
+ /* avoid outlines on :active (mouseclick), but preserve outlines on :focus (tabbed navigating) */
+ /*#cboxPrevious:active, #cboxNext:active, #cboxSlideshow:active, #cboxClose:active {outline:0;}*/
+
+ /*#cboxPrevious{background-position:0px 0px; right:44px;}*/
+ /*#cboxPrevious:hover{background-position:0px -25px;}*/
+ /*#cboxNext{background-position:-25px 0px; right:22px;}*/
+ /*#cboxNext:hover{background-position:-25px -25px;}*/
+ /*#cboxClose{background-position:-50px 0px; right:0;}*/
+ /*#cboxClose:hover{background-position:-50px -25px;}*/
+ /*.cboxSlideshow_on #cboxPrevious, .cboxSlideshow_off #cboxPrevious{right:66px;}*/
+ /*.cboxSlideshow_on #cboxSlideshow{background-position:-75px -25px; right:44px;}*/
+ /*.cboxSlideshow_on #cboxSlideshow:hover{background-position:-100px -25px;}*/
+ /*.cboxSlideshow_off #cboxSlideshow{background-position:-100px 0px; right:44px;}*/
+ /*.cboxSlideshow_off #cboxSlideshow:hover{background-position:-75px -25px;}*/
+
+
+
diff --git a/public_html/data/css/style.css b/public_html/data/css/style.css
new file mode 100644
index 000000000..166a00c12
--- /dev/null
+++ b/public_html/data/css/style.css
@@ -0,0 +1,1114 @@
+.form-signin input[type="text"] {
+ margin-bottom: -1px;
+ border-bottom-left-radius: 0;
+ border-bottom-right-radius: 0;
+}
+
+.form-signin input[type="password"] {
+ margin-bottom: 10px;
+ border-top-left-radius: 0;
+ border-top-right-radius: 0;
+}
+
+.form-signin a,
+.form-signin a:visited,
+.form-signin a:active {
+ color: inherit !important;
+}
+
+.brand-icon {
+ vertical-align: bottom;
+}
+
+.navbar-brand > img {
+ display: inline-block;
+}
+
+.login-page {
+ max-width: 300px;
+}
+
+.lazyload {
+ background: #C3C3C3;
+}
+
+.divider {
+ height:50px;
+ margin:0 9px;
+ border-left:1px solid #e1e1e1;
+}
+
+.vertical-space-small {
+ height: 50px;
+}
+
+.multipasteQueue .items>div {
+ height: 190px;
+ display: inline-block;
+ width: 150px;
+ vertical-align: top;
+ margin: 0 1px 20px 1px;
+}
+
+.multipasteQueue .items .item {
+ height: 160px;
+}
+
+.nav li.multipaste_button a {
+ color: #fff;
+}
+
+.ajaxFeedback {
+ display: inline-block;
+}
+
+/* Source: http://stackoverflow.com/a/26283602 */
+.glyphicon.spinning {
+ animation: spin 1s infinite linear;
+ -webkit-animation: spin2 1s infinite linear;
+}
+
+@keyframes spin {
+ from { transform: scale(1) rotate(0deg); }
+ to { transform: scale(1) rotate(360deg); }
+}
+
+@-webkit-keyframes spin2 {
+ from { -webkit-transform: rotate(0deg); }
+ to { -webkit-transform: rotate(360deg); }
+}
+
+@media (max-width: 768px) {
+ .dont-float {
+ float: left;
+ margin-top: 0;
+ margin-bottom: 0;
+ }
+ .dont-float > li {
+ float: left;
+ }
+ .dont-float > li > a {
+ padding-top: 15px;
+ padding-bottom: 15px;
+ }
+ .dont-float:first-child {
+ margin-left: 0px;
+ }
+ .dont-float.navbar-right:last-child {
+ margin-right: -15px;
+ }
+}
+
+.nav-history {
+ height: 63px;
+}
+
+.nav-history .container {
+ padding-top: 20px;
+ margin-bottom: 1em;
+ position: fixed;
+ background: #fff;
+ left: 0;
+ right: 0;
+ margin-top: -19px;
+}
+
+.navbar-paste {
+ margin-bottom: 0;
+}
+
+.inline-input {
+ width: 200px;
+}
+
+.file-upload {
+ width: 100%;
+}
+
+.navbar-nav > li > .dropdown-menu {
+ margin-top: 2px;
+}
+
+.anchor {
+ visibility: hidden;
+ padding-top: 20px;
+ margin-top: -20px;
+}
+
+@media (max-width: 767px) {
+ .navbar-fixed-top {
+ position: relative;
+ }
+ .nav-history .container {
+ position: relative;
+ }
+ .nav-history {
+ height: auto;
+ }
+}
+
+@media (min-width: 768px) {
+ .anchor {
+ visibility: hidden;
+ padding-top: 70px;
+ margin-top: -70px;
+ }
+
+ #navbar-height {
+ height: 70px;
+ }
+}
+
+textarea.text-upload {
+ height: 200px;
+}
+
+@media (min-height: 700px) {
+ textarea.text-upload {
+ height: 300px;
+ }
+}
+
+@media (min-height: 800px) {
+ textarea.text-upload {
+ height: 400px;
+ }
+}
+
+.error h1 {
+ font-size: 19px;
+}
+
+.nowrap {
+ white-space: nowrap;
+}
+
+.wrap {
+ word-break: break-word;
+ word-wrap: normal;
+}
+
+.alert-wide {
+ text-align: center;
+ border-radius: 0;
+}
+
+code, pre, textarea {
+ font-family: "Dejavu sans mono", Monaco, monospace;
+}
+
+.content {
+ width: 100%;
+ background: #fff;
+}
+
+/* Sticky footer styles
+ * Source: http://twitter.github.io/bootstrap/examples/sticky-footer.html
+ -------------------------------------------------- */
+.footer {
+ background-color: #f5f5f5;
+ border-top: 1px solid #e5e5e5;
+ /*padding: 30px 0;*/
+ /*margin-top: 70px;*/
+ text-align: center;
+}
+
+
+html,
+body {
+ height: 100%;
+ /* The html and body elements cannot have any padding or margin. */
+}
+
+/* Wrapper for page content to push down footer */
+#wrap {
+ min-height: 100%;
+ height: auto !important;
+ height: 100%;
+ /* Negative indent footer by it's height */
+ margin: 0 auto -83px;
+}
+
+/* Set the fixed height of the footer here */
+#footer {
+ height: 83px;
+ font-size: 12px;
+ padding: 15px 0;
+}
+
+#footer,
+#footer li {
+ line-height: 12px;
+}
+
+/* Set to footer height + 70px "padding" */
+#push {
+ height: 153px;
+}
+
+#footer p,
+.footer-links {
+ margin: 4px 0;
+}
+.footer-links li {
+ display: inline;
+ padding: 0 2px;
+}
+.footer-links li:first-child {
+ padding-left: 0;
+}
+
+.container-wide {
+ padding: 0;
+ max-width: 100%;
+ margin-left: 20px;
+ margin-right: 20px;
+ margin-bottom: 20px;
+}
+
+.simple-container {
+ margin-left: 20px;
+ margin-right: 20px;
+ margin-bottom: 20px;
+}
+
+.paste-container {
+ padding: 3px;
+ background: #eee;
+}
+
+.code .code-container {
+ counter-reset: line-numbering;
+}
+
+.code {display: table; margin: 0;}
+.code .table-row {display: table-row;}
+.code .table-cell {display: table-cell;}
+
+.code .code-container a.linenumber {
+ -webkit-touch-callout: none;
+ -webkit-user-select: none;
+ -khtml-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+.code .code-container a.linenumber::before {
+ content: counter(line-numbering);
+ counter-increment: line-numbering;
+}
+
+.code .code-container a.linenumber {
+ padding: 0 6px 0 16px;
+ text-align: right;
+ background: #ececec;
+ border-right: 1px solid #ddd;
+ text-align: right;
+ margin-left: -2px;
+ color: #aaa;
+ word-break: normal;
+}
+
+.code .code-container :last-child a {
+ padding-bottom: 10px;
+}
+
+.code .code-container :first-child a {
+ padding-top: 10px;
+}
+
+.code .code-container .table-row .line {
+ padding-left: 10px;
+ width: 100%
+}
+
+.content .highlight > .code-container {
+ background-color: transparent;
+ border: 0;
+ border-radius: 0;
+ margin: 0;
+ padding: 0;
+ font-size: 12px;
+ line-height: 1.4;
+ white-space: pre-wrap;
+ word-break: break-word;
+ word-wrap: normal;
+}
+.code {
+ width: 100%;
+ padding-top: 0;
+}
+.code .highlight {
+ position: relative;
+ padding-left: 0;
+}
+.code .highlight .code-container {
+ position: relative;
+ display: table;
+ color: inherit;
+}
+.highlight_line {
+ background: #ffffcc;
+}
+
+.ui-autocomplete {
+ z-index: 1500;
+}
+
+.popover {
+ word-break: break-word;
+ word-wrap: normal;
+ max-width: 400px;
+ min-width: 250px
+}
+
+#upload_history .popover {
+ max-width: 100%;
+}
+
+#upload_history .popover pre {
+ background-color: transparent;
+ border: 0;
+ margin: 0;
+ line-height: 1.4;
+}
+
+.upload_thumbnails {
+ margin: 0 auto;
+ width: 152px;
+}
+
+/* min-width and width increase by 152px each step (one more image per line)
+ * Take care to align to bootstrap's viewport breakpoints */
+@media (min-width: 389px) {
+ .upload_thumbnails {
+ width: 304px;
+ }
+}
+
+@media (min-width: 541px) {
+ .upload_thumbnails {
+ width: 456px;
+ }
+}
+
+@media (min-width: 693px) {
+ .upload_thumbnails {
+ width: 608px;
+ }
+}
+
+/* bootstrap viewport breakpoint @768px */
+/* bootstrap viewport breakpoint @992px */
+@media (min-width: 992px) {
+ .upload_thumbnails {
+ width: 760px;
+ }
+}
+
+/* bootstrap viewport breakpoint @1220px */
+@media (min-width: 1200px) {
+ .upload_thumbnails {
+ width: 1064px;
+ }
+}
+
+/* XXX: change values above if img width chanegs */
+.upload_thumbnails img.thumb,
+.upload_thumbnails a {
+ width: 150px;
+ height: 150px;
+}
+
+.upload_thumbnails a {
+ margin: 1px;
+ display: inline-block;
+}
+
+.upload_thumbnails .marked {
+ background: red;
+}
+
+.upload_thumbnails .marked img {
+ opacity: 0.4;
+}
+
+.tabwidth-dropdown { padding: 15px; }
+input[type="number"]::-webkit-outer-spin-button,
+input[type="number"]::-webkit-inner-spin-button {
+ -webkit-appearance: none;
+ margin: 0;
+}
+input[type="number"] { -moz-appearance: textfield; }
+
+video {
+ max-width: 100%;
+}
+
+/* highlighting theme */
+.hll { background-color: #ffffcc }
+.c { color: #999988; font-style: italic } /* Comment */
+.err { color: #a61717; background-color: #e3d2d2 } /* Error */
+.k { color: #000000; font-weight: bold } /* Keyword */
+.o { color: #000000; font-weight: bold } /* Operator */
+.cm { color: #999988; font-style: italic } /* Comment.Multiline */
+.cp { color: #999999; font-weight: bold; font-style: italic } /* Comment.Preproc */
+.c1 { color: #999988; font-style: italic } /* Comment.Single */
+.cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */
+.gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
+.ge { color: #000000; font-style: italic } /* Generic.Emph */
+.gr { color: #aa0000 } /* Generic.Error */
+.gh { color: #999999 } /* Generic.Heading */
+.gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
+.go { color: #888888 } /* Generic.Output */
+.gp { color: #555555 } /* Generic.Prompt */
+.gs { font-weight: bold } /* Generic.Strong */
+.gu { color: #aaaaaa } /* Generic.Subheading */
+.gt { color: #aa0000 } /* Generic.Traceback */
+.kc { color: #000000; font-weight: bold } /* Keyword.Constant */
+.kd { color: #000000; font-weight: bold } /* Keyword.Declaration */
+.kn { color: #000000; font-weight: bold } /* Keyword.Namespace */
+.kp { color: #000000; font-weight: bold } /* Keyword.Pseudo */
+.kr { color: #000000; font-weight: bold } /* Keyword.Reserved */
+.kt { color: #445588; font-weight: bold } /* Keyword.Type */
+.m { color: #009999 } /* Literal.Number */
+.s { color: #d01040 } /* Literal.String */
+.na { color: #008080 } /* Name.Attribute */
+.nb { color: #0086B3 } /* Name.Builtin */
+.nc { color: #445588; font-weight: bold } /* Name.Class */
+.no { color: #008080 } /* Name.Constant */
+.nd { color: #3c5d5d; font-weight: bold } /* Name.Decorator */
+.ni { color: #800080 } /* Name.Entity */
+.ne { color: #990000; font-weight: bold } /* Name.Exception */
+.nf { color: #990000; font-weight: bold } /* Name.Function */
+.nl { color: #990000; font-weight: bold } /* Name.Label */
+.nn { color: #555555 } /* Name.Namespace */
+.nt { color: #000080 } /* Name.Tag */
+.nv { color: #008080 } /* Name.Variable */
+.ow { color: #000000; font-weight: bold } /* Operator.Word */
+.w { color: #bbbbbb } /* Text.Whitespace */
+.mf { color: #009999 } /* Literal.Number.Float */
+.mh { color: #009999 } /* Literal.Number.Hex */
+.mi { color: #009999 } /* Literal.Number.Integer */
+.mo { color: #009999 } /* Literal.Number.Oct */
+.sb { color: #d01040 } /* Literal.String.Backtick */
+.sc { color: #d01040 } /* Literal.String.Char */
+.sd { color: #d01040 } /* Literal.String.Doc */
+.s2 { color: #d01040 } /* Literal.String.Double */
+.se { color: #d01040 } /* Literal.String.Escape */
+.sh { color: #d01040 } /* Literal.String.Heredoc */
+.si { color: #d01040 } /* Literal.String.Interpol */
+.sx { color: #d01040 } /* Literal.String.Other */
+.sr { color: #009926 } /* Literal.String.Regex */
+.s1 { color: #d01040 } /* Literal.String.Single */
+.ss { color: #990073 } /* Literal.String.Symbol */
+.bp { color: #999999 } /* Name.Builtin.Pseudo */
+.vc { color: #008080 } /* Name.Variable.Class */
+.vg { color: #008080 } /* Name.Variable.Global */
+.vi { color: #008080 } /* Name.Variable.Instance */
+.il { color: #009999 } /* Literal.Number.Integer.Long */
+
+/* based on https://bitbucket.org/kevinburke/markdowncss/overview */
+.markdownrender {
+ padding: 0 12px;
+}
+.markdownrender h1, .markdownrender h2, .markdownrender h3, .markdownrender h4 {
+ color: #111111;
+ font-weight: 400;
+}
+.markdownrender h1, .markdownrender h2, .markdownrender h3, .markdownrender h4, .markdownrender p {
+ margin-bottom: 24px;
+ padding: 0;
+}
+.markdownrender h1 {
+ font-size: 2.5em;
+}
+.markdownrender h2 {
+ font-size: 2em;
+ margin: 24px 0 6px;
+}
+.markdownrender h3 {
+ font-size: 1.7em;
+}
+.markdownrender h4 {
+ font-size: 1.5em;
+}
+.markdownrender h5 {
+ font-size: 1.3em;
+}
+.markdownrender li {
+ line-height: 1.5em;
+}
+.markdownrender li ul, .markdownrender li ul {
+ margin-left: 24px;
+}
+.markdownrender p, .markdownrender ul, .markdownrender ol {
+ font-size: 0.9em;
+ line-height: 1.5em;
+ max-width: 740px;
+}
+.markdownrender pre {
+ padding: 0px 24px;
+ max-width: 800px;
+ white-space: pre-wrap;
+}
+.markdownrender code {
+ font-family: Consolas, Monaco, Andale Mono, monospace;
+ line-height: 1.2em;
+ font-size: 0.85em;
+}
+.markdownrender aside {
+ display: block;
+ float: right;
+ width: 390px;
+}
+.markdownrender blockquote {
+ border-left: 0.5em solid #d6d6d6;
+ padding: 0 1em;
+ margin-left:0;
+ max-width: 676px;
+ background: #f6f6f6;
+}
+.markdownrender blockquote cite {
+ font-size:0.85em;
+ line-height:1.3em;
+ color:#bfbfbf;
+}
+.markdownrender blockquote p {
+ color: #666;
+ max-width: 660px;
+}
+.markdownrender hr {
+ width: 740px;
+ text-align: left;
+ margin: 0 auto 0 0;
+ color: #999;
+}
+
+/* tables */
+table.tablesorter thead tr th, table.tablesorter tfoot tr th {
+ background-color: #e6EEEE;
+ padding-right: 20px;
+}
+table.tablesorter thead tr .header {
+ background-image: url(../img/bg.gif);
+ background-repeat: no-repeat;
+ background-position: center right;
+ cursor: pointer;
+}
+table.tablesorter tbody td {
+ color: #3D3D3D;
+ vertical-align: top;
+}
+table.tablesorter thead tr .headerSortUp {
+ background-image: url(../img/asc.gif);
+}
+table.tablesorter thead tr .headerSortDown {
+ background-image: url(../img/desc.gif);
+}
+table.tablesorter thead tr .headerSortDown, table.tablesorter thead tr .headerSortUp {
+ background-color: #8dbdd8;
+}
+
+/* ansi2html */
+.ansi1 { font-weight: bold; }
+.ansi3 { font-weight: italic; }
+.ansi4 { text-decoration: underline; }
+.ansi9 { text-decoration: line-through; }
+.ansi30 { color: #000316; }
+.ansi31 { color: #aa0000; }
+.ansi32 { color: #00aa00; }
+.ansi33 { color: #aa5500; }
+.ansi34 { color: #0000aa; }
+.ansi35 { color: #E850A8; }
+.ansi36 { color: #00aaaa; }
+.ansi37 { color: #F5F1DE; }
+.ansi40 { background-color: #000316; }
+.ansi41 { background-color: #aa0000; }
+.ansi42 { background-color: #00aa00; }
+.ansi43 { background-color: #aa5500; }
+.ansi44 { background-color: #0000aa; }
+.ansi45 { background-color: #E850A8; }
+.ansi46 { background-color: #00aaaa; }
+.ansi47 { background-color: #F5F1DE; }
+.ansi38-16 { color: #000000; }
+.ansi48-16 { background: #000000; }
+.ansi38-17 { color: #00002a; }
+.ansi48-17 { background: #00002a; }
+.ansi38-18 { color: #000054; }
+.ansi48-18 { background: #000054; }
+.ansi38-19 { color: #00007e; }
+.ansi48-19 { background: #00007e; }
+.ansi38-20 { color: #0000a8; }
+.ansi48-20 { background: #0000a8; }
+.ansi38-21 { color: #0000d2; }
+.ansi48-21 { background: #0000d2; }
+.ansi38-52 { color: #2a0000; }
+.ansi48-52 { background: #2a0000; }
+.ansi38-53 { color: #2a002a; }
+.ansi48-53 { background: #2a002a; }
+.ansi38-54 { color: #2a0054; }
+.ansi48-54 { background: #2a0054; }
+.ansi38-55 { color: #2a007e; }
+.ansi48-55 { background: #2a007e; }
+.ansi38-56 { color: #2a00a8; }
+.ansi48-56 { background: #2a00a8; }
+.ansi38-57 { color: #2a00d2; }
+.ansi48-57 { background: #2a00d2; }
+.ansi38-88 { color: #540000; }
+.ansi48-88 { background: #540000; }
+.ansi38-89 { color: #54002a; }
+.ansi48-89 { background: #54002a; }
+.ansi38-90 { color: #540054; }
+.ansi48-90 { background: #540054; }
+.ansi38-91 { color: #54007e; }
+.ansi48-91 { background: #54007e; }
+.ansi38-92 { color: #5400a8; }
+.ansi48-92 { background: #5400a8; }
+.ansi38-93 { color: #5400d2; }
+.ansi48-93 { background: #5400d2; }
+.ansi38-124 { color: #7e0000; }
+.ansi48-124 { background: #7e0000; }
+.ansi38-125 { color: #7e002a; }
+.ansi48-125 { background: #7e002a; }
+.ansi38-126 { color: #7e0054; }
+.ansi48-126 { background: #7e0054; }
+.ansi38-127 { color: #7e007e; }
+.ansi48-127 { background: #7e007e; }
+.ansi38-128 { color: #7e00a8; }
+.ansi48-128 { background: #7e00a8; }
+.ansi38-129 { color: #7e00d2; }
+.ansi48-129 { background: #7e00d2; }
+.ansi38-160 { color: #a80000; }
+.ansi48-160 { background: #a80000; }
+.ansi38-161 { color: #a8002a; }
+.ansi48-161 { background: #a8002a; }
+.ansi38-162 { color: #a80054; }
+.ansi48-162 { background: #a80054; }
+.ansi38-163 { color: #a8007e; }
+.ansi48-163 { background: #a8007e; }
+.ansi38-164 { color: #a800a8; }
+.ansi48-164 { background: #a800a8; }
+.ansi38-165 { color: #a800d2; }
+.ansi48-165 { background: #a800d2; }
+.ansi38-196 { color: #d20000; }
+.ansi48-196 { background: #d20000; }
+.ansi38-197 { color: #d2002a; }
+.ansi48-197 { background: #d2002a; }
+.ansi38-198 { color: #d20054; }
+.ansi48-198 { background: #d20054; }
+.ansi38-199 { color: #d2007e; }
+.ansi48-199 { background: #d2007e; }
+.ansi38-200 { color: #d200a8; }
+.ansi48-200 { background: #d200a8; }
+.ansi38-201 { color: #d200d2; }
+.ansi48-201 { background: #d200d2; }
+.ansi38-22 { color: #002a00; }
+.ansi48-22 { background: #002a00; }
+.ansi38-23 { color: #002a2a; }
+.ansi48-23 { background: #002a2a; }
+.ansi38-24 { color: #002a54; }
+.ansi48-24 { background: #002a54; }
+.ansi38-25 { color: #002a7e; }
+.ansi48-25 { background: #002a7e; }
+.ansi38-26 { color: #002aa8; }
+.ansi48-26 { background: #002aa8; }
+.ansi38-27 { color: #002ad2; }
+.ansi48-27 { background: #002ad2; }
+.ansi38-58 { color: #2a2a00; }
+.ansi48-58 { background: #2a2a00; }
+.ansi38-59 { color: #2a2a2a; }
+.ansi48-59 { background: #2a2a2a; }
+.ansi38-60 { color: #2a2a54; }
+.ansi48-60 { background: #2a2a54; }
+.ansi38-61 { color: #2a2a7e; }
+.ansi48-61 { background: #2a2a7e; }
+.ansi38-62 { color: #2a2aa8; }
+.ansi48-62 { background: #2a2aa8; }
+.ansi38-63 { color: #2a2ad2; }
+.ansi48-63 { background: #2a2ad2; }
+.ansi38-94 { color: #542a00; }
+.ansi48-94 { background: #542a00; }
+.ansi38-95 { color: #542a2a; }
+.ansi48-95 { background: #542a2a; }
+.ansi38-96 { color: #542a54; }
+.ansi48-96 { background: #542a54; }
+.ansi38-97 { color: #542a7e; }
+.ansi48-97 { background: #542a7e; }
+.ansi38-98 { color: #542aa8; }
+.ansi48-98 { background: #542aa8; }
+.ansi38-99 { color: #542ad2; }
+.ansi48-99 { background: #542ad2; }
+.ansi38-130 { color: #7e2a00; }
+.ansi48-130 { background: #7e2a00; }
+.ansi38-131 { color: #7e2a2a; }
+.ansi48-131 { background: #7e2a2a; }
+.ansi38-132 { color: #7e2a54; }
+.ansi48-132 { background: #7e2a54; }
+.ansi38-133 { color: #7e2a7e; }
+.ansi48-133 { background: #7e2a7e; }
+.ansi38-134 { color: #7e2aa8; }
+.ansi48-134 { background: #7e2aa8; }
+.ansi38-135 { color: #7e2ad2; }
+.ansi48-135 { background: #7e2ad2; }
+.ansi38-166 { color: #a82a00; }
+.ansi48-166 { background: #a82a00; }
+.ansi38-167 { color: #a82a2a; }
+.ansi48-167 { background: #a82a2a; }
+.ansi38-168 { color: #a82a54; }
+.ansi48-168 { background: #a82a54; }
+.ansi38-169 { color: #a82a7e; }
+.ansi48-169 { background: #a82a7e; }
+.ansi38-170 { color: #a82aa8; }
+.ansi48-170 { background: #a82aa8; }
+.ansi38-171 { color: #a82ad2; }
+.ansi48-171 { background: #a82ad2; }
+.ansi38-202 { color: #d22a00; }
+.ansi48-202 { background: #d22a00; }
+.ansi38-203 { color: #d22a2a; }
+.ansi48-203 { background: #d22a2a; }
+.ansi38-204 { color: #d22a54; }
+.ansi48-204 { background: #d22a54; }
+.ansi38-205 { color: #d22a7e; }
+.ansi48-205 { background: #d22a7e; }
+.ansi38-206 { color: #d22aa8; }
+.ansi48-206 { background: #d22aa8; }
+.ansi38-207 { color: #d22ad2; }
+.ansi48-207 { background: #d22ad2; }
+.ansi38-28 { color: #005400; }
+.ansi48-28 { background: #005400; }
+.ansi38-29 { color: #00542a; }
+.ansi48-29 { background: #00542a; }
+.ansi38-30 { color: #005454; }
+.ansi48-30 { background: #005454; }
+.ansi38-31 { color: #00547e; }
+.ansi48-31 { background: #00547e; }
+.ansi38-32 { color: #0054a8; }
+.ansi48-32 { background: #0054a8; }
+.ansi38-33 { color: #0054d2; }
+.ansi48-33 { background: #0054d2; }
+.ansi38-64 { color: #2a5400; }
+.ansi48-64 { background: #2a5400; }
+.ansi38-65 { color: #2a542a; }
+.ansi48-65 { background: #2a542a; }
+.ansi38-66 { color: #2a5454; }
+.ansi48-66 { background: #2a5454; }
+.ansi38-67 { color: #2a547e; }
+.ansi48-67 { background: #2a547e; }
+.ansi38-68 { color: #2a54a8; }
+.ansi48-68 { background: #2a54a8; }
+.ansi38-69 { color: #2a54d2; }
+.ansi48-69 { background: #2a54d2; }
+.ansi38-100 { color: #545400; }
+.ansi48-100 { background: #545400; }
+.ansi38-101 { color: #54542a; }
+.ansi48-101 { background: #54542a; }
+.ansi38-102 { color: #545454; }
+.ansi48-102 { background: #545454; }
+.ansi38-103 { color: #54547e; }
+.ansi48-103 { background: #54547e; }
+.ansi38-104 { color: #5454a8; }
+.ansi48-104 { background: #5454a8; }
+.ansi38-105 { color: #5454d2; }
+.ansi48-105 { background: #5454d2; }
+.ansi38-136 { color: #7e5400; }
+.ansi48-136 { background: #7e5400; }
+.ansi38-137 { color: #7e542a; }
+.ansi48-137 { background: #7e542a; }
+.ansi38-138 { color: #7e5454; }
+.ansi48-138 { background: #7e5454; }
+.ansi38-139 { color: #7e547e; }
+.ansi48-139 { background: #7e547e; }
+.ansi38-140 { color: #7e54a8; }
+.ansi48-140 { background: #7e54a8; }
+.ansi38-141 { color: #7e54d2; }
+.ansi48-141 { background: #7e54d2; }
+.ansi38-172 { color: #a85400; }
+.ansi48-172 { background: #a85400; }
+.ansi38-173 { color: #a8542a; }
+.ansi48-173 { background: #a8542a; }
+.ansi38-174 { color: #a85454; }
+.ansi48-174 { background: #a85454; }
+.ansi38-175 { color: #a8547e; }
+.ansi48-175 { background: #a8547e; }
+.ansi38-176 { color: #a854a8; }
+.ansi48-176 { background: #a854a8; }
+.ansi38-177 { color: #a854d2; }
+.ansi48-177 { background: #a854d2; }
+.ansi38-208 { color: #d25400; }
+.ansi48-208 { background: #d25400; }
+.ansi38-209 { color: #d2542a; }
+.ansi48-209 { background: #d2542a; }
+.ansi38-210 { color: #d25454; }
+.ansi48-210 { background: #d25454; }
+.ansi38-211 { color: #d2547e; }
+.ansi48-211 { background: #d2547e; }
+.ansi38-212 { color: #d254a8; }
+.ansi48-212 { background: #d254a8; }
+.ansi38-213 { color: #d254d2; }
+.ansi48-213 { background: #d254d2; }
+.ansi38-34 { color: #007e00; }
+.ansi48-34 { background: #007e00; }
+.ansi38-35 { color: #007e2a; }
+.ansi48-35 { background: #007e2a; }
+.ansi38-36 { color: #007e54; }
+.ansi48-36 { background: #007e54; }
+.ansi38-37 { color: #007e7e; }
+.ansi48-37 { background: #007e7e; }
+.ansi38-38 { color: #007ea8; }
+.ansi48-38 { background: #007ea8; }
+.ansi38-39 { color: #007ed2; }
+.ansi48-39 { background: #007ed2; }
+.ansi38-70 { color: #2a7e00; }
+.ansi48-70 { background: #2a7e00; }
+.ansi38-71 { color: #2a7e2a; }
+.ansi48-71 { background: #2a7e2a; }
+.ansi38-72 { color: #2a7e54; }
+.ansi48-72 { background: #2a7e54; }
+.ansi38-73 { color: #2a7e7e; }
+.ansi48-73 { background: #2a7e7e; }
+.ansi38-74 { color: #2a7ea8; }
+.ansi48-74 { background: #2a7ea8; }
+.ansi38-75 { color: #2a7ed2; }
+.ansi48-75 { background: #2a7ed2; }
+.ansi38-106 { color: #547e00; }
+.ansi48-106 { background: #547e00; }
+.ansi38-107 { color: #547e2a; }
+.ansi48-107 { background: #547e2a; }
+.ansi38-108 { color: #547e54; }
+.ansi48-108 { background: #547e54; }
+.ansi38-109 { color: #547e7e; }
+.ansi48-109 { background: #547e7e; }
+.ansi38-110 { color: #547ea8; }
+.ansi48-110 { background: #547ea8; }
+.ansi38-111 { color: #547ed2; }
+.ansi48-111 { background: #547ed2; }
+.ansi38-142 { color: #7e7e00; }
+.ansi48-142 { background: #7e7e00; }
+.ansi38-143 { color: #7e7e2a; }
+.ansi48-143 { background: #7e7e2a; }
+.ansi38-144 { color: #7e7e54; }
+.ansi48-144 { background: #7e7e54; }
+.ansi38-145 { color: #7e7e7e; }
+.ansi48-145 { background: #7e7e7e; }
+.ansi38-146 { color: #7e7ea8; }
+.ansi48-146 { background: #7e7ea8; }
+.ansi38-147 { color: #7e7ed2; }
+.ansi48-147 { background: #7e7ed2; }
+.ansi38-178 { color: #a87e00; }
+.ansi48-178 { background: #a87e00; }
+.ansi38-179 { color: #a87e2a; }
+.ansi48-179 { background: #a87e2a; }
+.ansi38-180 { color: #a87e54; }
+.ansi48-180 { background: #a87e54; }
+.ansi38-181 { color: #a87e7e; }
+.ansi48-181 { background: #a87e7e; }
+.ansi38-182 { color: #a87ea8; }
+.ansi48-182 { background: #a87ea8; }
+.ansi38-183 { color: #a87ed2; }
+.ansi48-183 { background: #a87ed2; }
+.ansi38-214 { color: #d27e00; }
+.ansi48-214 { background: #d27e00; }
+.ansi38-215 { color: #d27e2a; }
+.ansi48-215 { background: #d27e2a; }
+.ansi38-216 { color: #d27e54; }
+.ansi48-216 { background: #d27e54; }
+.ansi38-217 { color: #d27e7e; }
+.ansi48-217 { background: #d27e7e; }
+.ansi38-218 { color: #d27ea8; }
+.ansi48-218 { background: #d27ea8; }
+.ansi38-219 { color: #d27ed2; }
+.ansi48-219 { background: #d27ed2; }
+.ansi38-40 { color: #00a800; }
+.ansi48-40 { background: #00a800; }
+.ansi38-41 { color: #00a82a; }
+.ansi48-41 { background: #00a82a; }
+.ansi38-42 { color: #00a854; }
+.ansi48-42 { background: #00a854; }
+.ansi38-43 { color: #00a87e; }
+.ansi48-43 { background: #00a87e; }
+.ansi38-44 { color: #00a8a8; }
+.ansi48-44 { background: #00a8a8; }
+.ansi38-45 { color: #00a8d2; }
+.ansi48-45 { background: #00a8d2; }
+.ansi38-76 { color: #2aa800; }
+.ansi48-76 { background: #2aa800; }
+.ansi38-77 { color: #2aa82a; }
+.ansi48-77 { background: #2aa82a; }
+.ansi38-78 { color: #2aa854; }
+.ansi48-78 { background: #2aa854; }
+.ansi38-79 { color: #2aa87e; }
+.ansi48-79 { background: #2aa87e; }
+.ansi38-80 { color: #2aa8a8; }
+.ansi48-80 { background: #2aa8a8; }
+.ansi38-81 { color: #2aa8d2; }
+.ansi48-81 { background: #2aa8d2; }
+.ansi38-112 { color: #54a800; }
+.ansi48-112 { background: #54a800; }
+.ansi38-113 { color: #54a82a; }
+.ansi48-113 { background: #54a82a; }
+.ansi38-114 { color: #54a854; }
+.ansi48-114 { background: #54a854; }
+.ansi38-115 { color: #54a87e; }
+.ansi48-115 { background: #54a87e; }
+.ansi38-116 { color: #54a8a8; }
+.ansi48-116 { background: #54a8a8; }
+.ansi38-117 { color: #54a8d2; }
+.ansi48-117 { background: #54a8d2; }
+.ansi38-148 { color: #7ea800; }
+.ansi48-148 { background: #7ea800; }
+.ansi38-149 { color: #7ea82a; }
+.ansi48-149 { background: #7ea82a; }
+.ansi38-150 { color: #7ea854; }
+.ansi48-150 { background: #7ea854; }
+.ansi38-151 { color: #7ea87e; }
+.ansi48-151 { background: #7ea87e; }
+.ansi38-152 { color: #7ea8a8; }
+.ansi48-152 { background: #7ea8a8; }
+.ansi38-153 { color: #7ea8d2; }
+.ansi48-153 { background: #7ea8d2; }
+.ansi38-184 { color: #a8a800; }
+.ansi48-184 { background: #a8a800; }
+.ansi38-185 { color: #a8a82a; }
+.ansi48-185 { background: #a8a82a; }
+.ansi38-186 { color: #a8a854; }
+.ansi48-186 { background: #a8a854; }
+.ansi38-187 { color: #a8a87e; }
+.ansi48-187 { background: #a8a87e; }
+.ansi38-188 { color: #a8a8a8; }
+.ansi48-188 { background: #a8a8a8; }
+.ansi38-189 { color: #a8a8d2; }
+.ansi48-189 { background: #a8a8d2; }
+.ansi38-220 { color: #d2a800; }
+.ansi48-220 { background: #d2a800; }
+.ansi38-221 { color: #d2a82a; }
+.ansi48-221 { background: #d2a82a; }
+.ansi38-222 { color: #d2a854; }
+.ansi48-222 { background: #d2a854; }
+.ansi38-223 { color: #d2a87e; }
+.ansi48-223 { background: #d2a87e; }
+.ansi38-224 { color: #d2a8a8; }
+.ansi48-224 { background: #d2a8a8; }
+.ansi38-225 { color: #d2a8d2; }
+.ansi48-225 { background: #d2a8d2; }
+.ansi38-46 { color: #00d200; }
+.ansi48-46 { background: #00d200; }
+.ansi38-47 { color: #00d22a; }
+.ansi48-47 { background: #00d22a; }
+.ansi38-48 { color: #00d254; }
+.ansi48-48 { background: #00d254; }
+.ansi38-49 { color: #00d27e; }
+.ansi48-49 { background: #00d27e; }
+.ansi38-50 { color: #00d2a8; }
+.ansi48-50 { background: #00d2a8; }
+.ansi38-51 { color: #00d2d2; }
+.ansi48-51 { background: #00d2d2; }
+.ansi38-82 { color: #2ad200; }
+.ansi48-82 { background: #2ad200; }
+.ansi38-83 { color: #2ad22a; }
+.ansi48-83 { background: #2ad22a; }
+.ansi38-84 { color: #2ad254; }
+.ansi48-84 { background: #2ad254; }
+.ansi38-85 { color: #2ad27e; }
+.ansi48-85 { background: #2ad27e; }
+.ansi38-86 { color: #2ad2a8; }
+.ansi48-86 { background: #2ad2a8; }
+.ansi38-87 { color: #2ad2d2; }
+.ansi48-87 { background: #2ad2d2; }
+.ansi38-118 { color: #54d200; }
+.ansi48-118 { background: #54d200; }
+.ansi38-119 { color: #54d22a; }
+.ansi48-119 { background: #54d22a; }
+.ansi38-120 { color: #54d254; }
+.ansi48-120 { background: #54d254; }
+.ansi38-121 { color: #54d27e; }
+.ansi48-121 { background: #54d27e; }
+.ansi38-122 { color: #54d2a8; }
+.ansi48-122 { background: #54d2a8; }
+.ansi38-123 { color: #54d2d2; }
+.ansi48-123 { background: #54d2d2; }
+.ansi38-154 { color: #7ed200; }
+.ansi48-154 { background: #7ed200; }
+.ansi38-155 { color: #7ed22a; }
+.ansi48-155 { background: #7ed22a; }
+.ansi38-156 { color: #7ed254; }
+.ansi48-156 { background: #7ed254; }
+.ansi38-157 { color: #7ed27e; }
+.ansi48-157 { background: #7ed27e; }
+.ansi38-158 { color: #7ed2a8; }
+.ansi48-158 { background: #7ed2a8; }
+.ansi38-159 { color: #7ed2d2; }
+.ansi48-159 { background: #7ed2d2; }
+.ansi38-190 { color: #a8d200; }
+.ansi48-190 { background: #a8d200; }
+.ansi38-191 { color: #a8d22a; }
+.ansi48-191 { background: #a8d22a; }
+.ansi38-192 { color: #a8d254; }
+.ansi48-192 { background: #a8d254; }
+.ansi38-193 { color: #a8d27e; }
+.ansi48-193 { background: #a8d27e; }
+.ansi38-194 { color: #a8d2a8; }
+.ansi48-194 { background: #a8d2a8; }
+.ansi38-195 { color: #a8d2d2; }
+.ansi48-195 { background: #a8d2d2; }
+.ansi38-226 { color: #d2d200; }
+.ansi48-226 { background: #d2d200; }
+.ansi38-227 { color: #d2d22a; }
+.ansi48-227 { background: #d2d22a; }
+.ansi38-228 { color: #d2d254; }
+.ansi48-228 { background: #d2d254; }
+.ansi38-229 { color: #d2d27e; }
+.ansi48-229 { background: #d2d27e; }
+.ansi38-230 { color: #d2d2a8; }
+.ansi48-230 { background: #d2d2a8; }
+.ansi38-231 { color: #d2d2d2; }
+.ansi48-231 { background: #d2d2d2; }
+.ansi38-232 { color: #080808; }
+.ansi48-232 { background: #080808; }
+.ansi38-233 { color: #121212; }
+.ansi48-233 { background: #121212; }
+.ansi38-234 { color: #1c1c1c; }
+.ansi48-234 { background: #1c1c1c; }
+.ansi38-235 { color: #262626; }
+.ansi48-235 { background: #262626; }
+.ansi38-236 { color: #303030; }
+.ansi48-236 { background: #303030; }
+.ansi38-237 { color: #3a3a3a; }
+.ansi48-237 { background: #3a3a3a; }
+.ansi38-238 { color: #444444; }
+.ansi48-238 { background: #444444; }
+.ansi38-239 { color: #4e4e4e; }
+.ansi48-239 { background: #4e4e4e; }
+.ansi38-240 { color: #585858; }
+.ansi48-240 { background: #585858; }
+.ansi38-241 { color: #626262; }
+.ansi48-241 { background: #626262; }
+.ansi38-242 { color: #6c6c6c; }
+.ansi48-242 { background: #6c6c6c; }
+.ansi38-243 { color: #767676; }
+.ansi48-243 { background: #767676; }
+.ansi38-244 { color: #808080; }
+.ansi48-244 { background: #808080; }
+.ansi38-245 { color: #8a8a8a; }
+.ansi48-245 { background: #8a8a8a; }
+.ansi38-246 { color: #949494; }
+.ansi48-246 { background: #949494; }
+.ansi38-247 { color: #9e9e9e; }
+.ansi48-247 { background: #9e9e9e; }
+.ansi38-248 { color: #a8a8a8; }
+.ansi48-248 { background: #a8a8a8; }
+.ansi38-249 { color: #b2b2b2; }
+.ansi48-249 { background: #b2b2b2; }
+.ansi38-250 { color: #bcbcbc; }
+.ansi48-250 { background: #bcbcbc; }
+.ansi38-251 { color: #c6c6c6; }
+.ansi48-251 { background: #c6c6c6; }
+.ansi38-252 { color: #d0d0d0; }
+.ansi48-252 { background: #d0d0d0; }
+.ansi38-253 { color: #dadada; }
+.ansi48-253 { background: #dadada; }
+.ansi38-254 { color: #e4e4e4; }
+.ansi48-254 { background: #e4e4e4; }
+.ansi38-255 { color: #eeeeee; }
+.ansi48-255 { background: #eeeeee; }
diff --git a/public_html/data/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png b/public_html/data/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png
new file mode 100644
index 000000000..646d3a126
--- /dev/null
+++ b/public_html/data/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png
Binary files differ
diff --git a/public_html/data/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png b/public_html/data/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png
new file mode 100644
index 000000000..7776601c9
--- /dev/null
+++ b/public_html/data/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png
Binary files differ
diff --git a/public_html/data/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png b/public_html/data/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png
new file mode 100644
index 000000000..7939f8840
--- /dev/null
+++ b/public_html/data/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png
Binary files differ
diff --git a/public_html/data/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png b/public_html/data/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png
new file mode 100644
index 000000000..b4b00f33f
--- /dev/null
+++ b/public_html/data/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png
Binary files differ
diff --git a/public_html/data/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png b/public_html/data/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png
new file mode 100644
index 000000000..e1b9d1c8b
--- /dev/null
+++ b/public_html/data/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png
Binary files differ
diff --git a/public_html/data/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png b/public_html/data/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png
new file mode 100644
index 000000000..936f0c501
--- /dev/null
+++ b/public_html/data/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png
Binary files differ
diff --git a/public_html/data/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png b/public_html/data/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png
new file mode 100644
index 000000000..0142e833e
--- /dev/null
+++ b/public_html/data/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png
Binary files differ
diff --git a/public_html/data/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png b/public_html/data/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png
new file mode 100644
index 000000000..11ef1daa0
--- /dev/null
+++ b/public_html/data/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png
Binary files differ
diff --git a/public_html/data/css/ui-lightness/images/ui-icons_222222_256x240.png b/public_html/data/css/ui-lightness/images/ui-icons_222222_256x240.png
new file mode 100644
index 000000000..e723e17cb
--- /dev/null
+++ b/public_html/data/css/ui-lightness/images/ui-icons_222222_256x240.png
Binary files differ
diff --git a/public_html/data/css/ui-lightness/images/ui-icons_228ef1_256x240.png b/public_html/data/css/ui-lightness/images/ui-icons_228ef1_256x240.png
new file mode 100644
index 000000000..ab0da63d7
--- /dev/null
+++ b/public_html/data/css/ui-lightness/images/ui-icons_228ef1_256x240.png
Binary files differ
diff --git a/public_html/data/css/ui-lightness/images/ui-icons_ef8c08_256x240.png b/public_html/data/css/ui-lightness/images/ui-icons_ef8c08_256x240.png
new file mode 100644
index 000000000..145007924
--- /dev/null
+++ b/public_html/data/css/ui-lightness/images/ui-icons_ef8c08_256x240.png
Binary files differ
diff --git a/public_html/data/css/ui-lightness/images/ui-icons_ffd27a_256x240.png b/public_html/data/css/ui-lightness/images/ui-icons_ffd27a_256x240.png
new file mode 100644
index 000000000..d92e3bd6d
--- /dev/null
+++ b/public_html/data/css/ui-lightness/images/ui-icons_ffd27a_256x240.png
Binary files differ
diff --git a/public_html/data/css/ui-lightness/images/ui-icons_ffffff_256x240.png b/public_html/data/css/ui-lightness/images/ui-icons_ffffff_256x240.png
new file mode 100644
index 000000000..fe41d2d0f
--- /dev/null
+++ b/public_html/data/css/ui-lightness/images/ui-icons_ffffff_256x240.png
Binary files differ
diff --git a/public_html/data/css/ui-lightness/jquery-ui.css b/public_html/data/css/ui-lightness/jquery-ui.css
new file mode 100644
index 000000000..cbe056ac0
--- /dev/null
+++ b/public_html/data/css/ui-lightness/jquery-ui.css
@@ -0,0 +1,586 @@
+/*! jQuery UI - v1.12.1 - 2016-09-19
+* http://jqueryui.com
+* Includes: sortable.css, core.css, autocomplete.css, menu.css, theme.css
+* To view and modify this theme, visit http://jqueryui.com/themeroller/?scope=&folderName=ui-lightness&cornerRadiusShadow=5px&offsetLeftShadow=-5px&offsetTopShadow=-5px&thicknessShadow=5px&opacityShadow=20&bgImgOpacityShadow=10&bgTextureShadow=flat&bgColorShadow=000000&opacityOverlay=50&bgImgOpacityOverlay=20&bgTextureOverlay=diagonals_thick&bgColorOverlay=666666&iconColorError=ffd27a&fcError=ffffff&borderColorError=cd0a0a&bgImgOpacityError=18&bgTextureError=diagonals_thick&bgColorError=b81900&iconColorHighlight=228ef1&fcHighlight=363636&borderColorHighlight=fed22f&bgImgOpacityHighlight=75&bgTextureHighlight=highlight_soft&bgColorHighlight=ffe45c&iconColorActive=ef8c08&fcActive=eb8f00&borderColorActive=fbd850&bgImgOpacityActive=65&bgTextureActive=glass&bgColorActive=ffffff&iconColorHover=ef8c08&fcHover=c77405&borderColorHover=fbcb09&bgImgOpacityHover=100&bgTextureHover=glass&bgColorHover=fdf5ce&iconColorDefault=ef8c08&fcDefault=1c94c4&borderColorDefault=cccccc&bgImgOpacityDefault=100&bgTextureDefault=glass&bgColorDefault=f6f6f6&iconColorContent=222222&fcContent=333333&borderColorContent=dddddd&bgImgOpacityContent=100&bgTextureContent=highlight_soft&bgColorContent=eeeeee&iconColorHeader=ffffff&fcHeader=ffffff&borderColorHeader=e78f08&bgImgOpacityHeader=35&bgTextureHeader=gloss_wave&bgColorHeader=f6a828&cornerRadius=4px&fsDefault=1.1em&fwDefault=bold&ffDefault=Trebuchet%20MS%2CTahoma%2CVerdana%2CArial%2Csans-serif
+* Copyright jQuery Foundation and other contributors; Licensed MIT */
+
+.ui-sortable-handle {
+ -ms-touch-action: none;
+ touch-action: none;
+}
+/* Layout helpers
+----------------------------------*/
+.ui-helper-hidden {
+ display: none;
+}
+.ui-helper-hidden-accessible {
+ border: 0;
+ clip: rect(0 0 0 0);
+ height: 1px;
+ margin: -1px;
+ overflow: hidden;
+ padding: 0;
+ position: absolute;
+ width: 1px;
+}
+.ui-helper-reset {
+ margin: 0;
+ padding: 0;
+ border: 0;
+ outline: 0;
+ line-height: 1.3;
+ text-decoration: none;
+ font-size: 100%;
+ list-style: none;
+}
+.ui-helper-clearfix:before,
+.ui-helper-clearfix:after {
+ content: "";
+ display: table;
+ border-collapse: collapse;
+}
+.ui-helper-clearfix:after {
+ clear: both;
+}
+.ui-helper-zfix {
+ width: 100%;
+ height: 100%;
+ top: 0;
+ left: 0;
+ position: absolute;
+ opacity: 0;
+ filter:Alpha(Opacity=0); /* support: IE8 */
+}
+
+.ui-front {
+ z-index: 100;
+}
+
+
+/* Interaction Cues
+----------------------------------*/
+.ui-state-disabled {
+ cursor: default !important;
+ pointer-events: none;
+}
+
+
+/* Icons
+----------------------------------*/
+.ui-icon {
+ display: inline-block;
+ vertical-align: middle;
+ margin-top: -.25em;
+ position: relative;
+ text-indent: -99999px;
+ overflow: hidden;
+ background-repeat: no-repeat;
+}
+
+.ui-widget-icon-block {
+ left: 50%;
+ margin-left: -8px;
+ display: block;
+}
+
+/* Misc visuals
+----------------------------------*/
+
+/* Overlays */
+.ui-widget-overlay {
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+}
+.ui-autocomplete {
+ position: absolute;
+ top: 0;
+ left: 0;
+ cursor: default;
+}
+.ui-menu {
+ list-style: none;
+ padding: 0;
+ margin: 0;
+ display: block;
+ outline: 0;
+}
+.ui-menu .ui-menu {
+ position: absolute;
+}
+.ui-menu .ui-menu-item {
+ margin: 0;
+ cursor: pointer;
+ /* support: IE10, see #8844 */
+ list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");
+}
+.ui-menu .ui-menu-item-wrapper {
+ position: relative;
+ padding: 3px 1em 3px .4em;
+}
+.ui-menu .ui-menu-divider {
+ margin: 5px 0;
+ height: 0;
+ font-size: 0;
+ line-height: 0;
+ border-width: 1px 0 0 0;
+}
+.ui-menu .ui-state-focus,
+.ui-menu .ui-state-active {
+ margin: -1px;
+}
+
+/* icon support */
+.ui-menu-icons {
+ position: relative;
+}
+.ui-menu-icons .ui-menu-item-wrapper {
+ padding-left: 2em;
+}
+
+/* left-aligned */
+.ui-menu .ui-icon {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: .2em;
+ margin: auto 0;
+}
+
+/* right-aligned */
+.ui-menu .ui-menu-icon {
+ left: auto;
+ right: 0;
+}
+
+/* Component containers
+----------------------------------*/
+.ui-widget {
+ font-family: Trebuchet MS,Tahoma,Verdana,Arial,sans-serif;
+ font-size: 1.1em;
+}
+.ui-widget .ui-widget {
+ font-size: 1em;
+}
+.ui-widget input,
+.ui-widget select,
+.ui-widget textarea,
+.ui-widget button {
+ font-family: Trebuchet MS,Tahoma,Verdana,Arial,sans-serif;
+ font-size: 1em;
+}
+.ui-widget.ui-widget-content {
+ border: 1px solid #cccccc;
+}
+.ui-widget-content {
+ border: 1px solid #dddddd;
+ background: #eeeeee url("images/ui-bg_highlight-soft_100_eeeeee_1x100.png") 50% top repeat-x;
+ color: #333333;
+}
+.ui-widget-content a {
+ color: #333333;
+}
+.ui-widget-header {
+ border: 1px solid #e78f08;
+ background: #f6a828 url("images/ui-bg_gloss-wave_35_f6a828_500x100.png") 50% 50% repeat-x;
+ color: #ffffff;
+ font-weight: bold;
+}
+.ui-widget-header a {
+ color: #ffffff;
+}
+
+/* Interaction states
+----------------------------------*/
+.ui-state-default,
+.ui-widget-content .ui-state-default,
+.ui-widget-header .ui-state-default,
+.ui-button,
+
+/* We use html here because we need a greater specificity to make sure disabled
+works properly when clicked or hovered */
+html .ui-button.ui-state-disabled:hover,
+html .ui-button.ui-state-disabled:active {
+ border: 1px solid #cccccc;
+ background: #f6f6f6 url("images/ui-bg_glass_100_f6f6f6_1x400.png") 50% 50% repeat-x;
+ font-weight: bold;
+ color: #1c94c4;
+}
+.ui-state-default a,
+.ui-state-default a:link,
+.ui-state-default a:visited,
+a.ui-button,
+a:link.ui-button,
+a:visited.ui-button,
+.ui-button {
+ color: #1c94c4;
+ text-decoration: none;
+}
+.ui-state-hover,
+.ui-widget-content .ui-state-hover,
+.ui-widget-header .ui-state-hover,
+.ui-state-focus,
+.ui-widget-content .ui-state-focus,
+.ui-widget-header .ui-state-focus,
+.ui-button:hover,
+.ui-button:focus {
+ border: 1px solid #fbcb09;
+ background: #fdf5ce url("images/ui-bg_glass_100_fdf5ce_1x400.png") 50% 50% repeat-x;
+ font-weight: bold;
+ color: #c77405;
+}
+.ui-state-hover a,
+.ui-state-hover a:hover,
+.ui-state-hover a:link,
+.ui-state-hover a:visited,
+.ui-state-focus a,
+.ui-state-focus a:hover,
+.ui-state-focus a:link,
+.ui-state-focus a:visited,
+a.ui-button:hover,
+a.ui-button:focus {
+ color: #c77405;
+ text-decoration: none;
+}
+
+.ui-visual-focus {
+ box-shadow: 0 0 3px 1px rgb(94, 158, 214);
+}
+.ui-state-active,
+.ui-widget-content .ui-state-active,
+.ui-widget-header .ui-state-active,
+a.ui-button:active,
+.ui-button:active,
+.ui-button.ui-state-active:hover {
+ border: 1px solid #fbd850;
+ background: #ffffff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x;
+ font-weight: bold;
+ color: #eb8f00;
+}
+.ui-icon-background,
+.ui-state-active .ui-icon-background {
+ border: #fbd850;
+ background-color: #eb8f00;
+}
+.ui-state-active a,
+.ui-state-active a:link,
+.ui-state-active a:visited {
+ color: #eb8f00;
+ text-decoration: none;
+}
+
+/* Interaction Cues
+----------------------------------*/
+.ui-state-highlight,
+.ui-widget-content .ui-state-highlight,
+.ui-widget-header .ui-state-highlight {
+ border: 1px solid #fed22f;
+ background: #ffe45c url("images/ui-bg_highlight-soft_75_ffe45c_1x100.png") 50% top repeat-x;
+ color: #363636;
+}
+.ui-state-checked {
+ border: 1px solid #fed22f;
+ background: #ffe45c;
+}
+.ui-state-highlight a,
+.ui-widget-content .ui-state-highlight a,
+.ui-widget-header .ui-state-highlight a {
+ color: #363636;
+}
+.ui-state-error,
+.ui-widget-content .ui-state-error,
+.ui-widget-header .ui-state-error {
+ border: 1px solid #cd0a0a;
+ background: #b81900 url("images/ui-bg_diagonals-thick_18_b81900_40x40.png") 50% 50% repeat;
+ color: #ffffff;
+}
+.ui-state-error a,
+.ui-widget-content .ui-state-error a,
+.ui-widget-header .ui-state-error a {
+ color: #ffffff;
+}
+.ui-state-error-text,
+.ui-widget-content .ui-state-error-text,
+.ui-widget-header .ui-state-error-text {
+ color: #ffffff;
+}
+.ui-priority-primary,
+.ui-widget-content .ui-priority-primary,
+.ui-widget-header .ui-priority-primary {
+ font-weight: bold;
+}
+.ui-priority-secondary,
+.ui-widget-content .ui-priority-secondary,
+.ui-widget-header .ui-priority-secondary {
+ opacity: .7;
+ filter:Alpha(Opacity=70); /* support: IE8 */
+ font-weight: normal;
+}
+.ui-state-disabled,
+.ui-widget-content .ui-state-disabled,
+.ui-widget-header .ui-state-disabled {
+ opacity: .35;
+ filter:Alpha(Opacity=35); /* support: IE8 */
+ background-image: none;
+}
+.ui-state-disabled .ui-icon {
+ filter:Alpha(Opacity=35); /* support: IE8 - See #6059 */
+}
+
+/* Icons
+----------------------------------*/
+
+/* states and images */
+.ui-icon {
+ width: 16px;
+ height: 16px;
+}
+.ui-icon,
+.ui-widget-content .ui-icon {
+ background-image: url("images/ui-icons_222222_256x240.png");
+}
+.ui-widget-header .ui-icon {
+ background-image: url("images/ui-icons_ffffff_256x240.png");
+}
+.ui-state-hover .ui-icon,
+.ui-state-focus .ui-icon,
+.ui-button:hover .ui-icon,
+.ui-button:focus .ui-icon {
+ background-image: url("images/ui-icons_ef8c08_256x240.png");
+}
+.ui-state-active .ui-icon,
+.ui-button:active .ui-icon {
+ background-image: url("images/ui-icons_ef8c08_256x240.png");
+}
+.ui-state-highlight .ui-icon,
+.ui-button .ui-state-highlight.ui-icon {
+ background-image: url("images/ui-icons_228ef1_256x240.png");
+}
+.ui-state-error .ui-icon,
+.ui-state-error-text .ui-icon {
+ background-image: url("images/ui-icons_ffd27a_256x240.png");
+}
+.ui-button .ui-icon {
+ background-image: url("images/ui-icons_ef8c08_256x240.png");
+}
+
+/* positioning */
+.ui-icon-blank { background-position: 16px 16px; }
+.ui-icon-caret-1-n { background-position: 0 0; }
+.ui-icon-caret-1-ne { background-position: -16px 0; }
+.ui-icon-caret-1-e { background-position: -32px 0; }
+.ui-icon-caret-1-se { background-position: -48px 0; }
+.ui-icon-caret-1-s { background-position: -65px 0; }
+.ui-icon-caret-1-sw { background-position: -80px 0; }
+.ui-icon-caret-1-w { background-position: -96px 0; }
+.ui-icon-caret-1-nw { background-position: -112px 0; }
+.ui-icon-caret-2-n-s { background-position: -128px 0; }
+.ui-icon-caret-2-e-w { background-position: -144px 0; }
+.ui-icon-triangle-1-n { background-position: 0 -16px; }
+.ui-icon-triangle-1-ne { background-position: -16px -16px; }
+.ui-icon-triangle-1-e { background-position: -32px -16px; }
+.ui-icon-triangle-1-se { background-position: -48px -16px; }
+.ui-icon-triangle-1-s { background-position: -65px -16px; }
+.ui-icon-triangle-1-sw { background-position: -80px -16px; }
+.ui-icon-triangle-1-w { background-position: -96px -16px; }
+.ui-icon-triangle-1-nw { background-position: -112px -16px; }
+.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
+.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
+.ui-icon-arrow-1-n { background-position: 0 -32px; }
+.ui-icon-arrow-1-ne { background-position: -16px -32px; }
+.ui-icon-arrow-1-e { background-position: -32px -32px; }
+.ui-icon-arrow-1-se { background-position: -48px -32px; }
+.ui-icon-arrow-1-s { background-position: -65px -32px; }
+.ui-icon-arrow-1-sw { background-position: -80px -32px; }
+.ui-icon-arrow-1-w { background-position: -96px -32px; }
+.ui-icon-arrow-1-nw { background-position: -112px -32px; }
+.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
+.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
+.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
+.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
+.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
+.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
+.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
+.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
+.ui-icon-arrowthick-1-n { background-position: 1px -48px; }
+.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
+.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
+.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
+.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
+.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
+.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
+.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
+.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
+.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
+.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
+.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
+.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
+.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
+.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
+.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
+.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
+.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
+.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
+.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
+.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
+.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
+.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
+.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
+.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
+.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
+.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
+.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
+.ui-icon-arrow-4 { background-position: 0 -80px; }
+.ui-icon-arrow-4-diag { background-position: -16px -80px; }
+.ui-icon-extlink { background-position: -32px -80px; }
+.ui-icon-newwin { background-position: -48px -80px; }
+.ui-icon-refresh { background-position: -64px -80px; }
+.ui-icon-shuffle { background-position: -80px -80px; }
+.ui-icon-transfer-e-w { background-position: -96px -80px; }
+.ui-icon-transferthick-e-w { background-position: -112px -80px; }
+.ui-icon-folder-collapsed { background-position: 0 -96px; }
+.ui-icon-folder-open { background-position: -16px -96px; }
+.ui-icon-document { background-position: -32px -96px; }
+.ui-icon-document-b { background-position: -48px -96px; }
+.ui-icon-note { background-position: -64px -96px; }
+.ui-icon-mail-closed { background-position: -80px -96px; }
+.ui-icon-mail-open { background-position: -96px -96px; }
+.ui-icon-suitcase { background-position: -112px -96px; }
+.ui-icon-comment { background-position: -128px -96px; }
+.ui-icon-person { background-position: -144px -96px; }
+.ui-icon-print { background-position: -160px -96px; }
+.ui-icon-trash { background-position: -176px -96px; }
+.ui-icon-locked { background-position: -192px -96px; }
+.ui-icon-unlocked { background-position: -208px -96px; }
+.ui-icon-bookmark { background-position: -224px -96px; }
+.ui-icon-tag { background-position: -240px -96px; }
+.ui-icon-home { background-position: 0 -112px; }
+.ui-icon-flag { background-position: -16px -112px; }
+.ui-icon-calendar { background-position: -32px -112px; }
+.ui-icon-cart { background-position: -48px -112px; }
+.ui-icon-pencil { background-position: -64px -112px; }
+.ui-icon-clock { background-position: -80px -112px; }
+.ui-icon-disk { background-position: -96px -112px; }
+.ui-icon-calculator { background-position: -112px -112px; }
+.ui-icon-zoomin { background-position: -128px -112px; }
+.ui-icon-zoomout { background-position: -144px -112px; }
+.ui-icon-search { background-position: -160px -112px; }
+.ui-icon-wrench { background-position: -176px -112px; }
+.ui-icon-gear { background-position: -192px -112px; }
+.ui-icon-heart { background-position: -208px -112px; }
+.ui-icon-star { background-position: -224px -112px; }
+.ui-icon-link { background-position: -240px -112px; }
+.ui-icon-cancel { background-position: 0 -128px; }
+.ui-icon-plus { background-position: -16px -128px; }
+.ui-icon-plusthick { background-position: -32px -128px; }
+.ui-icon-minus { background-position: -48px -128px; }
+.ui-icon-minusthick { background-position: -64px -128px; }
+.ui-icon-close { background-position: -80px -128px; }
+.ui-icon-closethick { background-position: -96px -128px; }
+.ui-icon-key { background-position: -112px -128px; }
+.ui-icon-lightbulb { background-position: -128px -128px; }
+.ui-icon-scissors { background-position: -144px -128px; }
+.ui-icon-clipboard { background-position: -160px -128px; }
+.ui-icon-copy { background-position: -176px -128px; }
+.ui-icon-contact { background-position: -192px -128px; }
+.ui-icon-image { background-position: -208px -128px; }
+.ui-icon-video { background-position: -224px -128px; }
+.ui-icon-script { background-position: -240px -128px; }
+.ui-icon-alert { background-position: 0 -144px; }
+.ui-icon-info { background-position: -16px -144px; }
+.ui-icon-notice { background-position: -32px -144px; }
+.ui-icon-help { background-position: -48px -144px; }
+.ui-icon-check { background-position: -64px -144px; }
+.ui-icon-bullet { background-position: -80px -144px; }
+.ui-icon-radio-on { background-position: -96px -144px; }
+.ui-icon-radio-off { background-position: -112px -144px; }
+.ui-icon-pin-w { background-position: -128px -144px; }
+.ui-icon-pin-s { background-position: -144px -144px; }
+.ui-icon-play { background-position: 0 -160px; }
+.ui-icon-pause { background-position: -16px -160px; }
+.ui-icon-seek-next { background-position: -32px -160px; }
+.ui-icon-seek-prev { background-position: -48px -160px; }
+.ui-icon-seek-end { background-position: -64px -160px; }
+.ui-icon-seek-start { background-position: -80px -160px; }
+/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
+.ui-icon-seek-first { background-position: -80px -160px; }
+.ui-icon-stop { background-position: -96px -160px; }
+.ui-icon-eject { background-position: -112px -160px; }
+.ui-icon-volume-off { background-position: -128px -160px; }
+.ui-icon-volume-on { background-position: -144px -160px; }
+.ui-icon-power { background-position: 0 -176px; }
+.ui-icon-signal-diag { background-position: -16px -176px; }
+.ui-icon-signal { background-position: -32px -176px; }
+.ui-icon-battery-0 { background-position: -48px -176px; }
+.ui-icon-battery-1 { background-position: -64px -176px; }
+.ui-icon-battery-2 { background-position: -80px -176px; }
+.ui-icon-battery-3 { background-position: -96px -176px; }
+.ui-icon-circle-plus { background-position: 0 -192px; }
+.ui-icon-circle-minus { background-position: -16px -192px; }
+.ui-icon-circle-close { background-position: -32px -192px; }
+.ui-icon-circle-triangle-e { background-position: -48px -192px; }
+.ui-icon-circle-triangle-s { background-position: -64px -192px; }
+.ui-icon-circle-triangle-w { background-position: -80px -192px; }
+.ui-icon-circle-triangle-n { background-position: -96px -192px; }
+.ui-icon-circle-arrow-e { background-position: -112px -192px; }
+.ui-icon-circle-arrow-s { background-position: -128px -192px; }
+.ui-icon-circle-arrow-w { background-position: -144px -192px; }
+.ui-icon-circle-arrow-n { background-position: -160px -192px; }
+.ui-icon-circle-zoomin { background-position: -176px -192px; }
+.ui-icon-circle-zoomout { background-position: -192px -192px; }
+.ui-icon-circle-check { background-position: -208px -192px; }
+.ui-icon-circlesmall-plus { background-position: 0 -208px; }
+.ui-icon-circlesmall-minus { background-position: -16px -208px; }
+.ui-icon-circlesmall-close { background-position: -32px -208px; }
+.ui-icon-squaresmall-plus { background-position: -48px -208px; }
+.ui-icon-squaresmall-minus { background-position: -64px -208px; }
+.ui-icon-squaresmall-close { background-position: -80px -208px; }
+.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
+.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
+.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
+.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
+.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
+.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
+
+
+/* Misc visuals
+----------------------------------*/
+
+/* Corner radius */
+.ui-corner-all,
+.ui-corner-top,
+.ui-corner-left,
+.ui-corner-tl {
+ border-top-left-radius: 4px;
+}
+.ui-corner-all,
+.ui-corner-top,
+.ui-corner-right,
+.ui-corner-tr {
+ border-top-right-radius: 4px;
+}
+.ui-corner-all,
+.ui-corner-bottom,
+.ui-corner-left,
+.ui-corner-bl {
+ border-bottom-left-radius: 4px;
+}
+.ui-corner-all,
+.ui-corner-bottom,
+.ui-corner-right,
+.ui-corner-br {
+ border-bottom-right-radius: 4px;
+}
+
+/* Overlays */
+.ui-widget-overlay {
+ background: #666666 url("images/ui-bg_diagonals-thick_20_666666_40x40.png") 50% 50% repeat;
+ opacity: .5;
+ filter: Alpha(Opacity=50); /* support: IE8 */
+}
+.ui-widget-shadow {
+ -webkit-box-shadow: -5px -5px 5px #000000;
+ box-shadow: -5px -5px 5px #000000;
+}
diff --git a/public_html/data/css/ui-lightness/jquery-ui.min.css b/public_html/data/css/ui-lightness/jquery-ui.min.css
new file mode 100644
index 000000000..6b9f7c2dc
--- /dev/null
+++ b/public_html/data/css/ui-lightness/jquery-ui.min.css
@@ -0,0 +1,7 @@
+/*! jQuery UI - v1.12.1 - 2016-09-19
+* http://jqueryui.com
+* Includes: sortable.css, core.css, autocomplete.css, menu.css, theme.css
+* To view and modify this theme, visit http://jqueryui.com/themeroller/?scope=&folderName=ui-lightness&cornerRadiusShadow=5px&offsetLeftShadow=-5px&offsetTopShadow=-5px&thicknessShadow=5px&opacityShadow=20&bgImgOpacityShadow=10&bgTextureShadow=flat&bgColorShadow=000000&opacityOverlay=50&bgImgOpacityOverlay=20&bgTextureOverlay=diagonals_thick&bgColorOverlay=666666&iconColorError=ffd27a&fcError=ffffff&borderColorError=cd0a0a&bgImgOpacityError=18&bgTextureError=diagonals_thick&bgColorError=b81900&iconColorHighlight=228ef1&fcHighlight=363636&borderColorHighlight=fed22f&bgImgOpacityHighlight=75&bgTextureHighlight=highlight_soft&bgColorHighlight=ffe45c&iconColorActive=ef8c08&fcActive=eb8f00&borderColorActive=fbd850&bgImgOpacityActive=65&bgTextureActive=glass&bgColorActive=ffffff&iconColorHover=ef8c08&fcHover=c77405&borderColorHover=fbcb09&bgImgOpacityHover=100&bgTextureHover=glass&bgColorHover=fdf5ce&iconColorDefault=ef8c08&fcDefault=1c94c4&borderColorDefault=cccccc&bgImgOpacityDefault=100&bgTextureDefault=glass&bgColorDefault=f6f6f6&iconColorContent=222222&fcContent=333333&borderColorContent=dddddd&bgImgOpacityContent=100&bgTextureContent=highlight_soft&bgColorContent=eeeeee&iconColorHeader=ffffff&fcHeader=ffffff&borderColorHeader=e78f08&bgImgOpacityHeader=35&bgTextureHeader=gloss_wave&bgColorHeader=f6a828&cornerRadius=4px&fsDefault=1.1em&fwDefault=bold&ffDefault=Trebuchet%20MS%2CTahoma%2CVerdana%2CArial%2Csans-serif
+* Copyright jQuery Foundation and other contributors; Licensed MIT */
+
+.ui-sortable-handle{-ms-touch-action:none;touch-action:none}.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important;pointer-events:none}.ui-icon{display:inline-block;vertical-align:middle;margin-top:-.25em;position:relative;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-icon-block{left:50%;margin-left:-8px;display:block}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-menu{list-style:none;padding:0;margin:0;display:block;outline:0}.ui-menu .ui-menu{position:absolute}.ui-menu .ui-menu-item{margin:0;cursor:pointer;list-style-image:url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7")}.ui-menu .ui-menu-item-wrapper{position:relative;padding:3px 1em 3px .4em}.ui-menu .ui-menu-divider{margin:5px 0;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-state-focus,.ui-menu .ui-state-active{margin:-1px}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item-wrapper{padding-left:2em}.ui-menu .ui-icon{position:absolute;top:0;bottom:0;left:.2em;margin:auto 0}.ui-menu .ui-menu-icon{left:auto;right:0}.ui-widget{font-family:Trebuchet MS,Tahoma,Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Trebuchet MS,Tahoma,Verdana,Arial,sans-serif;font-size:1em}.ui-widget.ui-widget-content{border:1px solid #ccc}.ui-widget-content{border:1px solid #ddd;background:#eee url("images/ui-bg_highlight-soft_100_eeeeee_1x100.png") 50% top repeat-x;color:#333}.ui-widget-content a{color:#333}.ui-widget-header{border:1px solid #e78f08;background:#f6a828 url("images/ui-bg_gloss-wave_35_f6a828_500x100.png") 50% 50% repeat-x;color:#fff;font-weight:bold}.ui-widget-header a{color:#fff}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default,.ui-button,html .ui-button.ui-state-disabled:hover,html .ui-button.ui-state-disabled:active{border:1px solid #ccc;background:#f6f6f6 url("images/ui-bg_glass_100_f6f6f6_1x400.png") 50% 50% repeat-x;font-weight:bold;color:#1c94c4}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited,a.ui-button,a:link.ui-button,a:visited.ui-button,.ui-button{color:#1c94c4;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus,.ui-button:hover,.ui-button:focus{border:1px solid #fbcb09;background:#fdf5ce url("images/ui-bg_glass_100_fdf5ce_1x400.png") 50% 50% repeat-x;font-weight:bold;color:#c77405}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited,a.ui-button:hover,a.ui-button:focus{color:#c77405;text-decoration:none}.ui-visual-focus{box-shadow:0 0 3px 1px rgb(94,158,214)}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active,a.ui-button:active,.ui-button:active,.ui-button.ui-state-active:hover{border:1px solid #fbd850;background:#fff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x;font-weight:bold;color:#eb8f00}.ui-icon-background,.ui-state-active .ui-icon-background{border:#fbd850;background-color:#eb8f00}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#eb8f00;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fed22f;background:#ffe45c url("images/ui-bg_highlight-soft_75_ffe45c_1x100.png") 50% top repeat-x;color:#363636}.ui-state-checked{border:1px solid #fed22f;background:#ffe45c}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#b81900 url("images/ui-bg_diagonals-thick_18_b81900_40x40.png") 50% 50% repeat;color:#fff}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#fff}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#fff}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url("images/ui-icons_222222_256x240.png")}.ui-widget-header .ui-icon{background-image:url("images/ui-icons_ffffff_256x240.png")}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon,.ui-button:hover .ui-icon,.ui-button:focus .ui-icon{background-image:url("images/ui-icons_ef8c08_256x240.png")}.ui-state-active .ui-icon,.ui-button:active .ui-icon{background-image:url("images/ui-icons_ef8c08_256x240.png")}.ui-state-highlight .ui-icon,.ui-button .ui-state-highlight.ui-icon{background-image:url("images/ui-icons_228ef1_256x240.png")}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url("images/ui-icons_ffd27a_256x240.png")}.ui-button .ui-icon{background-image:url("images/ui-icons_ef8c08_256x240.png")}.ui-icon-blank{background-position:16px 16px}.ui-icon-caret-1-n{background-position:0 0}.ui-icon-caret-1-ne{background-position:-16px 0}.ui-icon-caret-1-e{background-position:-32px 0}.ui-icon-caret-1-se{background-position:-48px 0}.ui-icon-caret-1-s{background-position:-65px 0}.ui-icon-caret-1-sw{background-position:-80px 0}.ui-icon-caret-1-w{background-position:-96px 0}.ui-icon-caret-1-nw{background-position:-112px 0}.ui-icon-caret-2-n-s{background-position:-128px 0}.ui-icon-caret-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-65px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-65px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:1px -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:4px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:4px}.ui-widget-overlay{background:#666 url("images/ui-bg_diagonals-thick_20_666666_40x40.png") 50% 50% repeat;opacity:.5;filter:Alpha(Opacity=50)}.ui-widget-shadow{-webkit-box-shadow:-5px -5px 5px #000;box-shadow:-5px -5px 5px #000} \ No newline at end of file
diff --git a/public_html/data/css/ui-lightness/jquery-ui.structure.css b/public_html/data/css/ui-lightness/jquery-ui.structure.css
new file mode 100644
index 000000000..a6411fa6d
--- /dev/null
+++ b/public_html/data/css/ui-lightness/jquery-ui.structure.css
@@ -0,0 +1,160 @@
+/*!
+ * jQuery UI CSS Framework 1.12.1
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/category/theming/
+ */
+.ui-sortable-handle {
+ -ms-touch-action: none;
+ touch-action: none;
+}
+/* Layout helpers
+----------------------------------*/
+.ui-helper-hidden {
+ display: none;
+}
+.ui-helper-hidden-accessible {
+ border: 0;
+ clip: rect(0 0 0 0);
+ height: 1px;
+ margin: -1px;
+ overflow: hidden;
+ padding: 0;
+ position: absolute;
+ width: 1px;
+}
+.ui-helper-reset {
+ margin: 0;
+ padding: 0;
+ border: 0;
+ outline: 0;
+ line-height: 1.3;
+ text-decoration: none;
+ font-size: 100%;
+ list-style: none;
+}
+.ui-helper-clearfix:before,
+.ui-helper-clearfix:after {
+ content: "";
+ display: table;
+ border-collapse: collapse;
+}
+.ui-helper-clearfix:after {
+ clear: both;
+}
+.ui-helper-zfix {
+ width: 100%;
+ height: 100%;
+ top: 0;
+ left: 0;
+ position: absolute;
+ opacity: 0;
+ filter:Alpha(Opacity=0); /* support: IE8 */
+}
+
+.ui-front {
+ z-index: 100;
+}
+
+
+/* Interaction Cues
+----------------------------------*/
+.ui-state-disabled {
+ cursor: default !important;
+ pointer-events: none;
+}
+
+
+/* Icons
+----------------------------------*/
+.ui-icon {
+ display: inline-block;
+ vertical-align: middle;
+ margin-top: -.25em;
+ position: relative;
+ text-indent: -99999px;
+ overflow: hidden;
+ background-repeat: no-repeat;
+}
+
+.ui-widget-icon-block {
+ left: 50%;
+ margin-left: -8px;
+ display: block;
+}
+
+/* Misc visuals
+----------------------------------*/
+
+/* Overlays */
+.ui-widget-overlay {
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+}
+.ui-autocomplete {
+ position: absolute;
+ top: 0;
+ left: 0;
+ cursor: default;
+}
+.ui-menu {
+ list-style: none;
+ padding: 0;
+ margin: 0;
+ display: block;
+ outline: 0;
+}
+.ui-menu .ui-menu {
+ position: absolute;
+}
+.ui-menu .ui-menu-item {
+ margin: 0;
+ cursor: pointer;
+ /* support: IE10, see #8844 */
+ list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");
+}
+.ui-menu .ui-menu-item-wrapper {
+ position: relative;
+ padding: 3px 1em 3px .4em;
+}
+.ui-menu .ui-menu-divider {
+ margin: 5px 0;
+ height: 0;
+ font-size: 0;
+ line-height: 0;
+ border-width: 1px 0 0 0;
+}
+.ui-menu .ui-state-focus,
+.ui-menu .ui-state-active {
+ margin: -1px;
+}
+
+/* icon support */
+.ui-menu-icons {
+ position: relative;
+}
+.ui-menu-icons .ui-menu-item-wrapper {
+ padding-left: 2em;
+}
+
+/* left-aligned */
+.ui-menu .ui-icon {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: .2em;
+ margin: auto 0;
+}
+
+/* right-aligned */
+.ui-menu .ui-menu-icon {
+ left: auto;
+ right: 0;
+}
diff --git a/public_html/data/css/ui-lightness/jquery-ui.structure.min.css b/public_html/data/css/ui-lightness/jquery-ui.structure.min.css
new file mode 100644
index 000000000..906d61e13
--- /dev/null
+++ b/public_html/data/css/ui-lightness/jquery-ui.structure.min.css
@@ -0,0 +1,5 @@
+/*! jQuery UI - v1.12.1 - 2016-09-19
+* http://jqueryui.com
+* Copyright jQuery Foundation and other contributors; Licensed MIT */
+
+.ui-sortable-handle{-ms-touch-action:none;touch-action:none}.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important;pointer-events:none}.ui-icon{display:inline-block;vertical-align:middle;margin-top:-.25em;position:relative;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-icon-block{left:50%;margin-left:-8px;display:block}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-menu{list-style:none;padding:0;margin:0;display:block;outline:0}.ui-menu .ui-menu{position:absolute}.ui-menu .ui-menu-item{margin:0;cursor:pointer;list-style-image:url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7")}.ui-menu .ui-menu-item-wrapper{position:relative;padding:3px 1em 3px .4em}.ui-menu .ui-menu-divider{margin:5px 0;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-state-focus,.ui-menu .ui-state-active{margin:-1px}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item-wrapper{padding-left:2em}.ui-menu .ui-icon{position:absolute;top:0;bottom:0;left:.2em;margin:auto 0}.ui-menu .ui-menu-icon{left:auto;right:0} \ No newline at end of file
diff --git a/public_html/data/css/ui-lightness/jquery-ui.theme.css b/public_html/data/css/ui-lightness/jquery-ui.theme.css
new file mode 100644
index 000000000..5699503af
--- /dev/null
+++ b/public_html/data/css/ui-lightness/jquery-ui.theme.css
@@ -0,0 +1,443 @@
+/*!
+ * jQuery UI CSS Framework 1.12.1
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/category/theming/
+ *
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/?scope=&folderName=ui-lightness&cornerRadiusShadow=5px&offsetLeftShadow=-5px&offsetTopShadow=-5px&thicknessShadow=5px&opacityShadow=20&bgImgOpacityShadow=10&bgTextureShadow=flat&bgColorShadow=000000&opacityOverlay=50&bgImgOpacityOverlay=20&bgTextureOverlay=diagonals_thick&bgColorOverlay=666666&iconColorError=ffd27a&fcError=ffffff&borderColorError=cd0a0a&bgImgOpacityError=18&bgTextureError=diagonals_thick&bgColorError=b81900&iconColorHighlight=228ef1&fcHighlight=363636&borderColorHighlight=fed22f&bgImgOpacityHighlight=75&bgTextureHighlight=highlight_soft&bgColorHighlight=ffe45c&iconColorActive=ef8c08&fcActive=eb8f00&borderColorActive=fbd850&bgImgOpacityActive=65&bgTextureActive=glass&bgColorActive=ffffff&iconColorHover=ef8c08&fcHover=c77405&borderColorHover=fbcb09&bgImgOpacityHover=100&bgTextureHover=glass&bgColorHover=fdf5ce&iconColorDefault=ef8c08&fcDefault=1c94c4&borderColorDefault=cccccc&bgImgOpacityDefault=100&bgTextureDefault=glass&bgColorDefault=f6f6f6&iconColorContent=222222&fcContent=333333&borderColorContent=dddddd&bgImgOpacityContent=100&bgTextureContent=highlight_soft&bgColorContent=eeeeee&iconColorHeader=ffffff&fcHeader=ffffff&borderColorHeader=e78f08&bgImgOpacityHeader=35&bgTextureHeader=gloss_wave&bgColorHeader=f6a828&cornerRadius=4px&fsDefault=1.1em&fwDefault=bold&ffDefault=Trebuchet%20MS%2CTahoma%2CVerdana%2CArial%2Csans-serif
+ */
+
+
+/* Component containers
+----------------------------------*/
+.ui-widget {
+ font-family: Trebuchet MS,Tahoma,Verdana,Arial,sans-serif;
+ font-size: 1.1em;
+}
+.ui-widget .ui-widget {
+ font-size: 1em;
+}
+.ui-widget input,
+.ui-widget select,
+.ui-widget textarea,
+.ui-widget button {
+ font-family: Trebuchet MS,Tahoma,Verdana,Arial,sans-serif;
+ font-size: 1em;
+}
+.ui-widget.ui-widget-content {
+ border: 1px solid #cccccc;
+}
+.ui-widget-content {
+ border: 1px solid #dddddd;
+ background: #eeeeee url("images/ui-bg_highlight-soft_100_eeeeee_1x100.png") 50% top repeat-x;
+ color: #333333;
+}
+.ui-widget-content a {
+ color: #333333;
+}
+.ui-widget-header {
+ border: 1px solid #e78f08;
+ background: #f6a828 url("images/ui-bg_gloss-wave_35_f6a828_500x100.png") 50% 50% repeat-x;
+ color: #ffffff;
+ font-weight: bold;
+}
+.ui-widget-header a {
+ color: #ffffff;
+}
+
+/* Interaction states
+----------------------------------*/
+.ui-state-default,
+.ui-widget-content .ui-state-default,
+.ui-widget-header .ui-state-default,
+.ui-button,
+
+/* We use html here because we need a greater specificity to make sure disabled
+works properly when clicked or hovered */
+html .ui-button.ui-state-disabled:hover,
+html .ui-button.ui-state-disabled:active {
+ border: 1px solid #cccccc;
+ background: #f6f6f6 url("images/ui-bg_glass_100_f6f6f6_1x400.png") 50% 50% repeat-x;
+ font-weight: bold;
+ color: #1c94c4;
+}
+.ui-state-default a,
+.ui-state-default a:link,
+.ui-state-default a:visited,
+a.ui-button,
+a:link.ui-button,
+a:visited.ui-button,
+.ui-button {
+ color: #1c94c4;
+ text-decoration: none;
+}
+.ui-state-hover,
+.ui-widget-content .ui-state-hover,
+.ui-widget-header .ui-state-hover,
+.ui-state-focus,
+.ui-widget-content .ui-state-focus,
+.ui-widget-header .ui-state-focus,
+.ui-button:hover,
+.ui-button:focus {
+ border: 1px solid #fbcb09;
+ background: #fdf5ce url("images/ui-bg_glass_100_fdf5ce_1x400.png") 50% 50% repeat-x;
+ font-weight: bold;
+ color: #c77405;
+}
+.ui-state-hover a,
+.ui-state-hover a:hover,
+.ui-state-hover a:link,
+.ui-state-hover a:visited,
+.ui-state-focus a,
+.ui-state-focus a:hover,
+.ui-state-focus a:link,
+.ui-state-focus a:visited,
+a.ui-button:hover,
+a.ui-button:focus {
+ color: #c77405;
+ text-decoration: none;
+}
+
+.ui-visual-focus {
+ box-shadow: 0 0 3px 1px rgb(94, 158, 214);
+}
+.ui-state-active,
+.ui-widget-content .ui-state-active,
+.ui-widget-header .ui-state-active,
+a.ui-button:active,
+.ui-button:active,
+.ui-button.ui-state-active:hover {
+ border: 1px solid #fbd850;
+ background: #ffffff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x;
+ font-weight: bold;
+ color: #eb8f00;
+}
+.ui-icon-background,
+.ui-state-active .ui-icon-background {
+ border: #fbd850;
+ background-color: #eb8f00;
+}
+.ui-state-active a,
+.ui-state-active a:link,
+.ui-state-active a:visited {
+ color: #eb8f00;
+ text-decoration: none;
+}
+
+/* Interaction Cues
+----------------------------------*/
+.ui-state-highlight,
+.ui-widget-content .ui-state-highlight,
+.ui-widget-header .ui-state-highlight {
+ border: 1px solid #fed22f;
+ background: #ffe45c url("images/ui-bg_highlight-soft_75_ffe45c_1x100.png") 50% top repeat-x;
+ color: #363636;
+}
+.ui-state-checked {
+ border: 1px solid #fed22f;
+ background: #ffe45c;
+}
+.ui-state-highlight a,
+.ui-widget-content .ui-state-highlight a,
+.ui-widget-header .ui-state-highlight a {
+ color: #363636;
+}
+.ui-state-error,
+.ui-widget-content .ui-state-error,
+.ui-widget-header .ui-state-error {
+ border: 1px solid #cd0a0a;
+ background: #b81900 url("images/ui-bg_diagonals-thick_18_b81900_40x40.png") 50% 50% repeat;
+ color: #ffffff;
+}
+.ui-state-error a,
+.ui-widget-content .ui-state-error a,
+.ui-widget-header .ui-state-error a {
+ color: #ffffff;
+}
+.ui-state-error-text,
+.ui-widget-content .ui-state-error-text,
+.ui-widget-header .ui-state-error-text {
+ color: #ffffff;
+}
+.ui-priority-primary,
+.ui-widget-content .ui-priority-primary,
+.ui-widget-header .ui-priority-primary {
+ font-weight: bold;
+}
+.ui-priority-secondary,
+.ui-widget-content .ui-priority-secondary,
+.ui-widget-header .ui-priority-secondary {
+ opacity: .7;
+ filter:Alpha(Opacity=70); /* support: IE8 */
+ font-weight: normal;
+}
+.ui-state-disabled,
+.ui-widget-content .ui-state-disabled,
+.ui-widget-header .ui-state-disabled {
+ opacity: .35;
+ filter:Alpha(Opacity=35); /* support: IE8 */
+ background-image: none;
+}
+.ui-state-disabled .ui-icon {
+ filter:Alpha(Opacity=35); /* support: IE8 - See #6059 */
+}
+
+/* Icons
+----------------------------------*/
+
+/* states and images */
+.ui-icon {
+ width: 16px;
+ height: 16px;
+}
+.ui-icon,
+.ui-widget-content .ui-icon {
+ background-image: url("images/ui-icons_222222_256x240.png");
+}
+.ui-widget-header .ui-icon {
+ background-image: url("images/ui-icons_ffffff_256x240.png");
+}
+.ui-state-hover .ui-icon,
+.ui-state-focus .ui-icon,
+.ui-button:hover .ui-icon,
+.ui-button:focus .ui-icon {
+ background-image: url("images/ui-icons_ef8c08_256x240.png");
+}
+.ui-state-active .ui-icon,
+.ui-button:active .ui-icon {
+ background-image: url("images/ui-icons_ef8c08_256x240.png");
+}
+.ui-state-highlight .ui-icon,
+.ui-button .ui-state-highlight.ui-icon {
+ background-image: url("images/ui-icons_228ef1_256x240.png");
+}
+.ui-state-error .ui-icon,
+.ui-state-error-text .ui-icon {
+ background-image: url("images/ui-icons_ffd27a_256x240.png");
+}
+.ui-button .ui-icon {
+ background-image: url("images/ui-icons_ef8c08_256x240.png");
+}
+
+/* positioning */
+.ui-icon-blank { background-position: 16px 16px; }
+.ui-icon-caret-1-n { background-position: 0 0; }
+.ui-icon-caret-1-ne { background-position: -16px 0; }
+.ui-icon-caret-1-e { background-position: -32px 0; }
+.ui-icon-caret-1-se { background-position: -48px 0; }
+.ui-icon-caret-1-s { background-position: -65px 0; }
+.ui-icon-caret-1-sw { background-position: -80px 0; }
+.ui-icon-caret-1-w { background-position: -96px 0; }
+.ui-icon-caret-1-nw { background-position: -112px 0; }
+.ui-icon-caret-2-n-s { background-position: -128px 0; }
+.ui-icon-caret-2-e-w { background-position: -144px 0; }
+.ui-icon-triangle-1-n { background-position: 0 -16px; }
+.ui-icon-triangle-1-ne { background-position: -16px -16px; }
+.ui-icon-triangle-1-e { background-position: -32px -16px; }
+.ui-icon-triangle-1-se { background-position: -48px -16px; }
+.ui-icon-triangle-1-s { background-position: -65px -16px; }
+.ui-icon-triangle-1-sw { background-position: -80px -16px; }
+.ui-icon-triangle-1-w { background-position: -96px -16px; }
+.ui-icon-triangle-1-nw { background-position: -112px -16px; }
+.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
+.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
+.ui-icon-arrow-1-n { background-position: 0 -32px; }
+.ui-icon-arrow-1-ne { background-position: -16px -32px; }
+.ui-icon-arrow-1-e { background-position: -32px -32px; }
+.ui-icon-arrow-1-se { background-position: -48px -32px; }
+.ui-icon-arrow-1-s { background-position: -65px -32px; }
+.ui-icon-arrow-1-sw { background-position: -80px -32px; }
+.ui-icon-arrow-1-w { background-position: -96px -32px; }
+.ui-icon-arrow-1-nw { background-position: -112px -32px; }
+.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
+.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
+.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
+.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
+.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
+.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
+.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
+.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
+.ui-icon-arrowthick-1-n { background-position: 1px -48px; }
+.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
+.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
+.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
+.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
+.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
+.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
+.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
+.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
+.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
+.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
+.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
+.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
+.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
+.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
+.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
+.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
+.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
+.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
+.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
+.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
+.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
+.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
+.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
+.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
+.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
+.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
+.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
+.ui-icon-arrow-4 { background-position: 0 -80px; }
+.ui-icon-arrow-4-diag { background-position: -16px -80px; }
+.ui-icon-extlink { background-position: -32px -80px; }
+.ui-icon-newwin { background-position: -48px -80px; }
+.ui-icon-refresh { background-position: -64px -80px; }
+.ui-icon-shuffle { background-position: -80px -80px; }
+.ui-icon-transfer-e-w { background-position: -96px -80px; }
+.ui-icon-transferthick-e-w { background-position: -112px -80px; }
+.ui-icon-folder-collapsed { background-position: 0 -96px; }
+.ui-icon-folder-open { background-position: -16px -96px; }
+.ui-icon-document { background-position: -32px -96px; }
+.ui-icon-document-b { background-position: -48px -96px; }
+.ui-icon-note { background-position: -64px -96px; }
+.ui-icon-mail-closed { background-position: -80px -96px; }
+.ui-icon-mail-open { background-position: -96px -96px; }
+.ui-icon-suitcase { background-position: -112px -96px; }
+.ui-icon-comment { background-position: -128px -96px; }
+.ui-icon-person { background-position: -144px -96px; }
+.ui-icon-print { background-position: -160px -96px; }
+.ui-icon-trash { background-position: -176px -96px; }
+.ui-icon-locked { background-position: -192px -96px; }
+.ui-icon-unlocked { background-position: -208px -96px; }
+.ui-icon-bookmark { background-position: -224px -96px; }
+.ui-icon-tag { background-position: -240px -96px; }
+.ui-icon-home { background-position: 0 -112px; }
+.ui-icon-flag { background-position: -16px -112px; }
+.ui-icon-calendar { background-position: -32px -112px; }
+.ui-icon-cart { background-position: -48px -112px; }
+.ui-icon-pencil { background-position: -64px -112px; }
+.ui-icon-clock { background-position: -80px -112px; }
+.ui-icon-disk { background-position: -96px -112px; }
+.ui-icon-calculator { background-position: -112px -112px; }
+.ui-icon-zoomin { background-position: -128px -112px; }
+.ui-icon-zoomout { background-position: -144px -112px; }
+.ui-icon-search { background-position: -160px -112px; }
+.ui-icon-wrench { background-position: -176px -112px; }
+.ui-icon-gear { background-position: -192px -112px; }
+.ui-icon-heart { background-position: -208px -112px; }
+.ui-icon-star { background-position: -224px -112px; }
+.ui-icon-link { background-position: -240px -112px; }
+.ui-icon-cancel { background-position: 0 -128px; }
+.ui-icon-plus { background-position: -16px -128px; }
+.ui-icon-plusthick { background-position: -32px -128px; }
+.ui-icon-minus { background-position: -48px -128px; }
+.ui-icon-minusthick { background-position: -64px -128px; }
+.ui-icon-close { background-position: -80px -128px; }
+.ui-icon-closethick { background-position: -96px -128px; }
+.ui-icon-key { background-position: -112px -128px; }
+.ui-icon-lightbulb { background-position: -128px -128px; }
+.ui-icon-scissors { background-position: -144px -128px; }
+.ui-icon-clipboard { background-position: -160px -128px; }
+.ui-icon-copy { background-position: -176px -128px; }
+.ui-icon-contact { background-position: -192px -128px; }
+.ui-icon-image { background-position: -208px -128px; }
+.ui-icon-video { background-position: -224px -128px; }
+.ui-icon-script { background-position: -240px -128px; }
+.ui-icon-alert { background-position: 0 -144px; }
+.ui-icon-info { background-position: -16px -144px; }
+.ui-icon-notice { background-position: -32px -144px; }
+.ui-icon-help { background-position: -48px -144px; }
+.ui-icon-check { background-position: -64px -144px; }
+.ui-icon-bullet { background-position: -80px -144px; }
+.ui-icon-radio-on { background-position: -96px -144px; }
+.ui-icon-radio-off { background-position: -112px -144px; }
+.ui-icon-pin-w { background-position: -128px -144px; }
+.ui-icon-pin-s { background-position: -144px -144px; }
+.ui-icon-play { background-position: 0 -160px; }
+.ui-icon-pause { background-position: -16px -160px; }
+.ui-icon-seek-next { background-position: -32px -160px; }
+.ui-icon-seek-prev { background-position: -48px -160px; }
+.ui-icon-seek-end { background-position: -64px -160px; }
+.ui-icon-seek-start { background-position: -80px -160px; }
+/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
+.ui-icon-seek-first { background-position: -80px -160px; }
+.ui-icon-stop { background-position: -96px -160px; }
+.ui-icon-eject { background-position: -112px -160px; }
+.ui-icon-volume-off { background-position: -128px -160px; }
+.ui-icon-volume-on { background-position: -144px -160px; }
+.ui-icon-power { background-position: 0 -176px; }
+.ui-icon-signal-diag { background-position: -16px -176px; }
+.ui-icon-signal { background-position: -32px -176px; }
+.ui-icon-battery-0 { background-position: -48px -176px; }
+.ui-icon-battery-1 { background-position: -64px -176px; }
+.ui-icon-battery-2 { background-position: -80px -176px; }
+.ui-icon-battery-3 { background-position: -96px -176px; }
+.ui-icon-circle-plus { background-position: 0 -192px; }
+.ui-icon-circle-minus { background-position: -16px -192px; }
+.ui-icon-circle-close { background-position: -32px -192px; }
+.ui-icon-circle-triangle-e { background-position: -48px -192px; }
+.ui-icon-circle-triangle-s { background-position: -64px -192px; }
+.ui-icon-circle-triangle-w { background-position: -80px -192px; }
+.ui-icon-circle-triangle-n { background-position: -96px -192px; }
+.ui-icon-circle-arrow-e { background-position: -112px -192px; }
+.ui-icon-circle-arrow-s { background-position: -128px -192px; }
+.ui-icon-circle-arrow-w { background-position: -144px -192px; }
+.ui-icon-circle-arrow-n { background-position: -160px -192px; }
+.ui-icon-circle-zoomin { background-position: -176px -192px; }
+.ui-icon-circle-zoomout { background-position: -192px -192px; }
+.ui-icon-circle-check { background-position: -208px -192px; }
+.ui-icon-circlesmall-plus { background-position: 0 -208px; }
+.ui-icon-circlesmall-minus { background-position: -16px -208px; }
+.ui-icon-circlesmall-close { background-position: -32px -208px; }
+.ui-icon-squaresmall-plus { background-position: -48px -208px; }
+.ui-icon-squaresmall-minus { background-position: -64px -208px; }
+.ui-icon-squaresmall-close { background-position: -80px -208px; }
+.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
+.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
+.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
+.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
+.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
+.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
+
+
+/* Misc visuals
+----------------------------------*/
+
+/* Corner radius */
+.ui-corner-all,
+.ui-corner-top,
+.ui-corner-left,
+.ui-corner-tl {
+ border-top-left-radius: 4px;
+}
+.ui-corner-all,
+.ui-corner-top,
+.ui-corner-right,
+.ui-corner-tr {
+ border-top-right-radius: 4px;
+}
+.ui-corner-all,
+.ui-corner-bottom,
+.ui-corner-left,
+.ui-corner-bl {
+ border-bottom-left-radius: 4px;
+}
+.ui-corner-all,
+.ui-corner-bottom,
+.ui-corner-right,
+.ui-corner-br {
+ border-bottom-right-radius: 4px;
+}
+
+/* Overlays */
+.ui-widget-overlay {
+ background: #666666 url("images/ui-bg_diagonals-thick_20_666666_40x40.png") 50% 50% repeat;
+ opacity: .5;
+ filter: Alpha(Opacity=50); /* support: IE8 */
+}
+.ui-widget-shadow {
+ -webkit-box-shadow: -5px -5px 5px #000000;
+ box-shadow: -5px -5px 5px #000000;
+}
diff --git a/public_html/data/css/ui-lightness/jquery-ui.theme.min.css b/public_html/data/css/ui-lightness/jquery-ui.theme.min.css
new file mode 100644
index 000000000..cb959496d
--- /dev/null
+++ b/public_html/data/css/ui-lightness/jquery-ui.theme.min.css
@@ -0,0 +1,5 @@
+/*! jQuery UI - v1.12.1 - 2016-09-19
+* http://jqueryui.com
+* Copyright jQuery Foundation and other contributors; Licensed MIT */
+
+.ui-widget{font-family:Trebuchet MS,Tahoma,Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Trebuchet MS,Tahoma,Verdana,Arial,sans-serif;font-size:1em}.ui-widget.ui-widget-content{border:1px solid #ccc}.ui-widget-content{border:1px solid #ddd;background:#eee url("images/ui-bg_highlight-soft_100_eeeeee_1x100.png") 50% top repeat-x;color:#333}.ui-widget-content a{color:#333}.ui-widget-header{border:1px solid #e78f08;background:#f6a828 url("images/ui-bg_gloss-wave_35_f6a828_500x100.png") 50% 50% repeat-x;color:#fff;font-weight:bold}.ui-widget-header a{color:#fff}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default,.ui-button,html .ui-button.ui-state-disabled:hover,html .ui-button.ui-state-disabled:active{border:1px solid #ccc;background:#f6f6f6 url("images/ui-bg_glass_100_f6f6f6_1x400.png") 50% 50% repeat-x;font-weight:bold;color:#1c94c4}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited,a.ui-button,a:link.ui-button,a:visited.ui-button,.ui-button{color:#1c94c4;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus,.ui-button:hover,.ui-button:focus{border:1px solid #fbcb09;background:#fdf5ce url("images/ui-bg_glass_100_fdf5ce_1x400.png") 50% 50% repeat-x;font-weight:bold;color:#c77405}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited,a.ui-button:hover,a.ui-button:focus{color:#c77405;text-decoration:none}.ui-visual-focus{box-shadow:0 0 3px 1px rgb(94,158,214)}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active,a.ui-button:active,.ui-button:active,.ui-button.ui-state-active:hover{border:1px solid #fbd850;background:#fff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x;font-weight:bold;color:#eb8f00}.ui-icon-background,.ui-state-active .ui-icon-background{border:#fbd850;background-color:#eb8f00}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#eb8f00;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fed22f;background:#ffe45c url("images/ui-bg_highlight-soft_75_ffe45c_1x100.png") 50% top repeat-x;color:#363636}.ui-state-checked{border:1px solid #fed22f;background:#ffe45c}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#b81900 url("images/ui-bg_diagonals-thick_18_b81900_40x40.png") 50% 50% repeat;color:#fff}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#fff}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#fff}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url("images/ui-icons_222222_256x240.png")}.ui-widget-header .ui-icon{background-image:url("images/ui-icons_ffffff_256x240.png")}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon,.ui-button:hover .ui-icon,.ui-button:focus .ui-icon{background-image:url("images/ui-icons_ef8c08_256x240.png")}.ui-state-active .ui-icon,.ui-button:active .ui-icon{background-image:url("images/ui-icons_ef8c08_256x240.png")}.ui-state-highlight .ui-icon,.ui-button .ui-state-highlight.ui-icon{background-image:url("images/ui-icons_228ef1_256x240.png")}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url("images/ui-icons_ffd27a_256x240.png")}.ui-button .ui-icon{background-image:url("images/ui-icons_ef8c08_256x240.png")}.ui-icon-blank{background-position:16px 16px}.ui-icon-caret-1-n{background-position:0 0}.ui-icon-caret-1-ne{background-position:-16px 0}.ui-icon-caret-1-e{background-position:-32px 0}.ui-icon-caret-1-se{background-position:-48px 0}.ui-icon-caret-1-s{background-position:-65px 0}.ui-icon-caret-1-sw{background-position:-80px 0}.ui-icon-caret-1-w{background-position:-96px 0}.ui-icon-caret-1-nw{background-position:-112px 0}.ui-icon-caret-2-n-s{background-position:-128px 0}.ui-icon-caret-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-65px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-65px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:1px -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:4px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:4px}.ui-widget-overlay{background:#666 url("images/ui-bg_diagonals-thick_20_666666_40x40.png") 50% 50% repeat;opacity:.5;filter:Alpha(Opacity=50)}.ui-widget-shadow{-webkit-box-shadow:-5px -5px 5px #000;box-shadow:-5px -5px 5px #000} \ No newline at end of file
diff --git a/public_html/data/fonts/glyphicons-halflings-regular.eot b/public_html/data/fonts/glyphicons-halflings-regular.eot
new file mode 100644
index 000000000..b93a4953f
--- /dev/null
+++ b/public_html/data/fonts/glyphicons-halflings-regular.eot
Binary files differ
diff --git a/public_html/data/fonts/glyphicons-halflings-regular.svg b/public_html/data/fonts/glyphicons-halflings-regular.svg
new file mode 100644
index 000000000..94fb5490a
--- /dev/null
+++ b/public_html/data/fonts/glyphicons-halflings-regular.svg
@@ -0,0 +1,288 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
+<svg xmlns="http://www.w3.org/2000/svg">
+<metadata></metadata>
+<defs>
+<font id="glyphicons_halflingsregular" horiz-adv-x="1200" >
+<font-face units-per-em="1200" ascent="960" descent="-240" />
+<missing-glyph horiz-adv-x="500" />
+<glyph horiz-adv-x="0" />
+<glyph horiz-adv-x="400" />
+<glyph unicode=" " />
+<glyph unicode="*" d="M600 1100q15 0 34 -1.5t30 -3.5l11 -1q10 -2 17.5 -10.5t7.5 -18.5v-224l158 158q7 7 18 8t19 -6l106 -106q7 -8 6 -19t-8 -18l-158 -158h224q10 0 18.5 -7.5t10.5 -17.5q6 -41 6 -75q0 -15 -1.5 -34t-3.5 -30l-1 -11q-2 -10 -10.5 -17.5t-18.5 -7.5h-224l158 -158 q7 -7 8 -18t-6 -19l-106 -106q-8 -7 -19 -6t-18 8l-158 158v-224q0 -10 -7.5 -18.5t-17.5 -10.5q-41 -6 -75 -6q-15 0 -34 1.5t-30 3.5l-11 1q-10 2 -17.5 10.5t-7.5 18.5v224l-158 -158q-7 -7 -18 -8t-19 6l-106 106q-7 8 -6 19t8 18l158 158h-224q-10 0 -18.5 7.5 t-10.5 17.5q-6 41 -6 75q0 15 1.5 34t3.5 30l1 11q2 10 10.5 17.5t18.5 7.5h224l-158 158q-7 7 -8 18t6 19l106 106q8 7 19 6t18 -8l158 -158v224q0 10 7.5 18.5t17.5 10.5q41 6 75 6z" />
+<glyph unicode="+" d="M450 1100h200q21 0 35.5 -14.5t14.5 -35.5v-350h350q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-350v-350q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v350h-350q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5 h350v350q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xa0;" />
+<glyph unicode="&#xa5;" d="M825 1100h250q10 0 12.5 -5t-5.5 -13l-364 -364q-6 -6 -11 -18h268q10 0 13 -6t-3 -14l-120 -160q-6 -8 -18 -14t-22 -6h-125v-100h275q10 0 13 -6t-3 -14l-120 -160q-6 -8 -18 -14t-22 -6h-125v-174q0 -11 -7.5 -18.5t-18.5 -7.5h-148q-11 0 -18.5 7.5t-7.5 18.5v174 h-275q-10 0 -13 6t3 14l120 160q6 8 18 14t22 6h125v100h-275q-10 0 -13 6t3 14l120 160q6 8 18 14t22 6h118q-5 12 -11 18l-364 364q-8 8 -5.5 13t12.5 5h250q25 0 43 -18l164 -164q8 -8 18 -8t18 8l164 164q18 18 43 18z" />
+<glyph unicode="&#x2000;" horiz-adv-x="650" />
+<glyph unicode="&#x2001;" horiz-adv-x="1300" />
+<glyph unicode="&#x2002;" horiz-adv-x="650" />
+<glyph unicode="&#x2003;" horiz-adv-x="1300" />
+<glyph unicode="&#x2004;" horiz-adv-x="433" />
+<glyph unicode="&#x2005;" horiz-adv-x="325" />
+<glyph unicode="&#x2006;" horiz-adv-x="216" />
+<glyph unicode="&#x2007;" horiz-adv-x="216" />
+<glyph unicode="&#x2008;" horiz-adv-x="162" />
+<glyph unicode="&#x2009;" horiz-adv-x="260" />
+<glyph unicode="&#x200a;" horiz-adv-x="72" />
+<glyph unicode="&#x202f;" horiz-adv-x="260" />
+<glyph unicode="&#x205f;" horiz-adv-x="325" />
+<glyph unicode="&#x20ac;" d="M744 1198q242 0 354 -189q60 -104 66 -209h-181q0 45 -17.5 82.5t-43.5 61.5t-58 40.5t-60.5 24t-51.5 7.5q-19 0 -40.5 -5.5t-49.5 -20.5t-53 -38t-49 -62.5t-39 -89.5h379l-100 -100h-300q-6 -50 -6 -100h406l-100 -100h-300q9 -74 33 -132t52.5 -91t61.5 -54.5t59 -29 t47 -7.5q22 0 50.5 7.5t60.5 24.5t58 41t43.5 61t17.5 80h174q-30 -171 -128 -278q-107 -117 -274 -117q-206 0 -324 158q-36 48 -69 133t-45 204h-217l100 100h112q1 47 6 100h-218l100 100h134q20 87 51 153.5t62 103.5q117 141 297 141z" />
+<glyph unicode="&#x20bd;" d="M428 1200h350q67 0 120 -13t86 -31t57 -49.5t35 -56.5t17 -64.5t6.5 -60.5t0.5 -57v-16.5v-16.5q0 -36 -0.5 -57t-6.5 -61t-17 -65t-35 -57t-57 -50.5t-86 -31.5t-120 -13h-178l-2 -100h288q10 0 13 -6t-3 -14l-120 -160q-6 -8 -18 -14t-22 -6h-138v-175q0 -11 -5.5 -18 t-15.5 -7h-149q-10 0 -17.5 7.5t-7.5 17.5v175h-267q-10 0 -13 6t3 14l120 160q6 8 18 14t22 6h117v100h-267q-10 0 -13 6t3 14l120 160q6 8 18 14t22 6h117v475q0 10 7.5 17.5t17.5 7.5zM600 1000v-300h203q64 0 86.5 33t22.5 119q0 84 -22.5 116t-86.5 32h-203z" />
+<glyph unicode="&#x2212;" d="M250 700h800q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-800q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#x231b;" d="M1000 1200v-150q0 -21 -14.5 -35.5t-35.5 -14.5h-50v-100q0 -91 -49.5 -165.5t-130.5 -109.5q81 -35 130.5 -109.5t49.5 -165.5v-150h50q21 0 35.5 -14.5t14.5 -35.5v-150h-800v150q0 21 14.5 35.5t35.5 14.5h50v150q0 91 49.5 165.5t130.5 109.5q-81 35 -130.5 109.5 t-49.5 165.5v100h-50q-21 0 -35.5 14.5t-14.5 35.5v150h800zM400 1000v-100q0 -60 32.5 -109.5t87.5 -73.5q28 -12 44 -37t16 -55t-16 -55t-44 -37q-55 -24 -87.5 -73.5t-32.5 -109.5v-150h400v150q0 60 -32.5 109.5t-87.5 73.5q-28 12 -44 37t-16 55t16 55t44 37 q55 24 87.5 73.5t32.5 109.5v100h-400z" />
+<glyph unicode="&#x25fc;" horiz-adv-x="500" d="M0 0z" />
+<glyph unicode="&#x2601;" d="M503 1089q110 0 200.5 -59.5t134.5 -156.5q44 14 90 14q120 0 205 -86.5t85 -206.5q0 -121 -85 -207.5t-205 -86.5h-750q-79 0 -135.5 57t-56.5 137q0 69 42.5 122.5t108.5 67.5q-2 12 -2 37q0 153 108 260.5t260 107.5z" />
+<glyph unicode="&#x26fa;" d="M774 1193.5q16 -9.5 20.5 -27t-5.5 -33.5l-136 -187l467 -746h30q20 0 35 -18.5t15 -39.5v-42h-1200v42q0 21 15 39.5t35 18.5h30l468 746l-135 183q-10 16 -5.5 34t20.5 28t34 5.5t28 -20.5l111 -148l112 150q9 16 27 20.5t34 -5zM600 200h377l-182 112l-195 534v-646z " />
+<glyph unicode="&#x2709;" d="M25 1100h1150q10 0 12.5 -5t-5.5 -13l-564 -567q-8 -8 -18 -8t-18 8l-564 567q-8 8 -5.5 13t12.5 5zM18 882l264 -264q8 -8 8 -18t-8 -18l-264 -264q-8 -8 -13 -5.5t-5 12.5v550q0 10 5 12.5t13 -5.5zM918 618l264 264q8 8 13 5.5t5 -12.5v-550q0 -10 -5 -12.5t-13 5.5 l-264 264q-8 8 -8 18t8 18zM818 482l364 -364q8 -8 5.5 -13t-12.5 -5h-1150q-10 0 -12.5 5t5.5 13l364 364q8 8 18 8t18 -8l164 -164q8 -8 18 -8t18 8l164 164q8 8 18 8t18 -8z" />
+<glyph unicode="&#x270f;" d="M1011 1210q19 0 33 -13l153 -153q13 -14 13 -33t-13 -33l-99 -92l-214 214l95 96q13 14 32 14zM1013 800l-615 -614l-214 214l614 614zM317 96l-333 -112l110 335z" />
+<glyph unicode="&#xe001;" d="M700 650v-550h250q21 0 35.5 -14.5t14.5 -35.5v-50h-800v50q0 21 14.5 35.5t35.5 14.5h250v550l-500 550h1200z" />
+<glyph unicode="&#xe002;" d="M368 1017l645 163q39 15 63 0t24 -49v-831q0 -55 -41.5 -95.5t-111.5 -63.5q-79 -25 -147 -4.5t-86 75t25.5 111.5t122.5 82q72 24 138 8v521l-600 -155v-606q0 -42 -44 -90t-109 -69q-79 -26 -147 -5.5t-86 75.5t25.5 111.5t122.5 82.5q72 24 138 7v639q0 38 14.5 59 t53.5 34z" />
+<glyph unicode="&#xe003;" d="M500 1191q100 0 191 -39t156.5 -104.5t104.5 -156.5t39 -191l-1 -2l1 -5q0 -141 -78 -262l275 -274q23 -26 22.5 -44.5t-22.5 -42.5l-59 -58q-26 -20 -46.5 -20t-39.5 20l-275 274q-119 -77 -261 -77l-5 1l-2 -1q-100 0 -191 39t-156.5 104.5t-104.5 156.5t-39 191 t39 191t104.5 156.5t156.5 104.5t191 39zM500 1022q-88 0 -162 -43t-117 -117t-43 -162t43 -162t117 -117t162 -43t162 43t117 117t43 162t-43 162t-117 117t-162 43z" />
+<glyph unicode="&#xe005;" d="M649 949q48 68 109.5 104t121.5 38.5t118.5 -20t102.5 -64t71 -100.5t27 -123q0 -57 -33.5 -117.5t-94 -124.5t-126.5 -127.5t-150 -152.5t-146 -174q-62 85 -145.5 174t-150 152.5t-126.5 127.5t-93.5 124.5t-33.5 117.5q0 64 28 123t73 100.5t104 64t119 20 t120.5 -38.5t104.5 -104z" />
+<glyph unicode="&#xe006;" d="M407 800l131 353q7 19 17.5 19t17.5 -19l129 -353h421q21 0 24 -8.5t-14 -20.5l-342 -249l130 -401q7 -20 -0.5 -25.5t-24.5 6.5l-343 246l-342 -247q-17 -12 -24.5 -6.5t-0.5 25.5l130 400l-347 251q-17 12 -14 20.5t23 8.5h429z" />
+<glyph unicode="&#xe007;" d="M407 800l131 353q7 19 17.5 19t17.5 -19l129 -353h421q21 0 24 -8.5t-14 -20.5l-342 -249l130 -401q7 -20 -0.5 -25.5t-24.5 6.5l-343 246l-342 -247q-17 -12 -24.5 -6.5t-0.5 25.5l130 400l-347 251q-17 12 -14 20.5t23 8.5h429zM477 700h-240l197 -142l-74 -226 l193 139l195 -140l-74 229l192 140h-234l-78 211z" />
+<glyph unicode="&#xe008;" d="M600 1200q124 0 212 -88t88 -212v-250q0 -46 -31 -98t-69 -52v-75q0 -10 6 -21.5t15 -17.5l358 -230q9 -5 15 -16.5t6 -21.5v-93q0 -10 -7.5 -17.5t-17.5 -7.5h-1150q-10 0 -17.5 7.5t-7.5 17.5v93q0 10 6 21.5t15 16.5l358 230q9 6 15 17.5t6 21.5v75q-38 0 -69 52 t-31 98v250q0 124 88 212t212 88z" />
+<glyph unicode="&#xe009;" d="M25 1100h1150q10 0 17.5 -7.5t7.5 -17.5v-1050q0 -10 -7.5 -17.5t-17.5 -7.5h-1150q-10 0 -17.5 7.5t-7.5 17.5v1050q0 10 7.5 17.5t17.5 7.5zM100 1000v-100h100v100h-100zM875 1000h-550q-10 0 -17.5 -7.5t-7.5 -17.5v-350q0 -10 7.5 -17.5t17.5 -7.5h550 q10 0 17.5 7.5t7.5 17.5v350q0 10 -7.5 17.5t-17.5 7.5zM1000 1000v-100h100v100h-100zM100 800v-100h100v100h-100zM1000 800v-100h100v100h-100zM100 600v-100h100v100h-100zM1000 600v-100h100v100h-100zM875 500h-550q-10 0 -17.5 -7.5t-7.5 -17.5v-350q0 -10 7.5 -17.5 t17.5 -7.5h550q10 0 17.5 7.5t7.5 17.5v350q0 10 -7.5 17.5t-17.5 7.5zM100 400v-100h100v100h-100zM1000 400v-100h100v100h-100zM100 200v-100h100v100h-100zM1000 200v-100h100v100h-100z" />
+<glyph unicode="&#xe010;" d="M50 1100h400q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-400q-21 0 -35.5 14.5t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5zM650 1100h400q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-400q-21 0 -35.5 14.5t-14.5 35.5v400 q0 21 14.5 35.5t35.5 14.5zM50 500h400q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-400q-21 0 -35.5 14.5t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5zM650 500h400q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-400 q-21 0 -35.5 14.5t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe011;" d="M50 1100h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM450 1100h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200 q0 21 14.5 35.5t35.5 14.5zM850 1100h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM50 700h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200 q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM450 700h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM850 700h200q21 0 35.5 -14.5t14.5 -35.5v-200 q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM50 300h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM450 300h200 q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM850 300h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5 t35.5 14.5z" />
+<glyph unicode="&#xe012;" d="M50 1100h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM450 1100h700q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-700q-21 0 -35.5 14.5t-14.5 35.5v200 q0 21 14.5 35.5t35.5 14.5zM50 700h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM450 700h700q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-700 q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM50 300h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM450 300h700q21 0 35.5 -14.5t14.5 -35.5v-200 q0 -21 -14.5 -35.5t-35.5 -14.5h-700q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe013;" d="M465 477l571 571q8 8 18 8t17 -8l177 -177q8 -7 8 -17t-8 -18l-783 -784q-7 -8 -17.5 -8t-17.5 8l-384 384q-8 8 -8 18t8 17l177 177q7 8 17 8t18 -8l171 -171q7 -7 18 -7t18 7z" />
+<glyph unicode="&#xe014;" d="M904 1083l178 -179q8 -8 8 -18.5t-8 -17.5l-267 -268l267 -268q8 -7 8 -17.5t-8 -18.5l-178 -178q-8 -8 -18.5 -8t-17.5 8l-268 267l-268 -267q-7 -8 -17.5 -8t-18.5 8l-178 178q-8 8 -8 18.5t8 17.5l267 268l-267 268q-8 7 -8 17.5t8 18.5l178 178q8 8 18.5 8t17.5 -8 l268 -267l268 268q7 7 17.5 7t18.5 -7z" />
+<glyph unicode="&#xe015;" d="M507 1177q98 0 187.5 -38.5t154.5 -103.5t103.5 -154.5t38.5 -187.5q0 -141 -78 -262l300 -299q8 -8 8 -18.5t-8 -18.5l-109 -108q-7 -8 -17.5 -8t-18.5 8l-300 299q-119 -77 -261 -77q-98 0 -188 38.5t-154.5 103t-103 154.5t-38.5 188t38.5 187.5t103 154.5 t154.5 103.5t188 38.5zM506.5 1023q-89.5 0 -165.5 -44t-120 -120.5t-44 -166t44 -165.5t120 -120t165.5 -44t166 44t120.5 120t44 165.5t-44 166t-120.5 120.5t-166 44zM425 900h150q10 0 17.5 -7.5t7.5 -17.5v-75h75q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5 t-17.5 -7.5h-75v-75q0 -10 -7.5 -17.5t-17.5 -7.5h-150q-10 0 -17.5 7.5t-7.5 17.5v75h-75q-10 0 -17.5 7.5t-7.5 17.5v150q0 10 7.5 17.5t17.5 7.5h75v75q0 10 7.5 17.5t17.5 7.5z" />
+<glyph unicode="&#xe016;" d="M507 1177q98 0 187.5 -38.5t154.5 -103.5t103.5 -154.5t38.5 -187.5q0 -141 -78 -262l300 -299q8 -8 8 -18.5t-8 -18.5l-109 -108q-7 -8 -17.5 -8t-18.5 8l-300 299q-119 -77 -261 -77q-98 0 -188 38.5t-154.5 103t-103 154.5t-38.5 188t38.5 187.5t103 154.5 t154.5 103.5t188 38.5zM506.5 1023q-89.5 0 -165.5 -44t-120 -120.5t-44 -166t44 -165.5t120 -120t165.5 -44t166 44t120.5 120t44 165.5t-44 166t-120.5 120.5t-166 44zM325 800h350q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-350q-10 0 -17.5 7.5 t-7.5 17.5v150q0 10 7.5 17.5t17.5 7.5z" />
+<glyph unicode="&#xe017;" d="M550 1200h100q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5zM800 975v166q167 -62 272 -209.5t105 -331.5q0 -117 -45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5 t-184.5 123t-123 184.5t-45.5 224q0 184 105 331.5t272 209.5v-166q-103 -55 -165 -155t-62 -220q0 -116 57 -214.5t155.5 -155.5t214.5 -57t214.5 57t155.5 155.5t57 214.5q0 120 -62 220t-165 155z" />
+<glyph unicode="&#xe018;" d="M1025 1200h150q10 0 17.5 -7.5t7.5 -17.5v-1150q0 -10 -7.5 -17.5t-17.5 -7.5h-150q-10 0 -17.5 7.5t-7.5 17.5v1150q0 10 7.5 17.5t17.5 7.5zM725 800h150q10 0 17.5 -7.5t7.5 -17.5v-750q0 -10 -7.5 -17.5t-17.5 -7.5h-150q-10 0 -17.5 7.5t-7.5 17.5v750 q0 10 7.5 17.5t17.5 7.5zM425 500h150q10 0 17.5 -7.5t7.5 -17.5v-450q0 -10 -7.5 -17.5t-17.5 -7.5h-150q-10 0 -17.5 7.5t-7.5 17.5v450q0 10 7.5 17.5t17.5 7.5zM125 300h150q10 0 17.5 -7.5t7.5 -17.5v-250q0 -10 -7.5 -17.5t-17.5 -7.5h-150q-10 0 -17.5 7.5t-7.5 17.5 v250q0 10 7.5 17.5t17.5 7.5z" />
+<glyph unicode="&#xe019;" d="M600 1174q33 0 74 -5l38 -152l5 -1q49 -14 94 -39l5 -2l134 80q61 -48 104 -105l-80 -134l3 -5q25 -44 39 -93l1 -6l152 -38q5 -43 5 -73q0 -34 -5 -74l-152 -38l-1 -6q-15 -49 -39 -93l-3 -5l80 -134q-48 -61 -104 -105l-134 81l-5 -3q-44 -25 -94 -39l-5 -2l-38 -151 q-43 -5 -74 -5q-33 0 -74 5l-38 151l-5 2q-49 14 -94 39l-5 3l-134 -81q-60 48 -104 105l80 134l-3 5q-25 45 -38 93l-2 6l-151 38q-6 42 -6 74q0 33 6 73l151 38l2 6q13 48 38 93l3 5l-80 134q47 61 105 105l133 -80l5 2q45 25 94 39l5 1l38 152q43 5 74 5zM600 815 q-89 0 -152 -63t-63 -151.5t63 -151.5t152 -63t152 63t63 151.5t-63 151.5t-152 63z" />
+<glyph unicode="&#xe020;" d="M500 1300h300q41 0 70.5 -29.5t29.5 -70.5v-100h275q10 0 17.5 -7.5t7.5 -17.5v-75h-1100v75q0 10 7.5 17.5t17.5 7.5h275v100q0 41 29.5 70.5t70.5 29.5zM500 1200v-100h300v100h-300zM1100 900v-800q0 -41 -29.5 -70.5t-70.5 -29.5h-700q-41 0 -70.5 29.5t-29.5 70.5 v800h900zM300 800v-700h100v700h-100zM500 800v-700h100v700h-100zM700 800v-700h100v700h-100zM900 800v-700h100v700h-100z" />
+<glyph unicode="&#xe021;" d="M18 618l620 608q8 7 18.5 7t17.5 -7l608 -608q8 -8 5.5 -13t-12.5 -5h-175v-575q0 -10 -7.5 -17.5t-17.5 -7.5h-250q-10 0 -17.5 7.5t-7.5 17.5v375h-300v-375q0 -10 -7.5 -17.5t-17.5 -7.5h-250q-10 0 -17.5 7.5t-7.5 17.5v575h-175q-10 0 -12.5 5t5.5 13z" />
+<glyph unicode="&#xe022;" d="M600 1200v-400q0 -41 29.5 -70.5t70.5 -29.5h300v-650q0 -21 -14.5 -35.5t-35.5 -14.5h-800q-21 0 -35.5 14.5t-14.5 35.5v1100q0 21 14.5 35.5t35.5 14.5h450zM1000 800h-250q-21 0 -35.5 14.5t-14.5 35.5v250z" />
+<glyph unicode="&#xe023;" d="M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM600 1027q-116 0 -214.5 -57t-155.5 -155.5t-57 -214.5t57 -214.5 t155.5 -155.5t214.5 -57t214.5 57t155.5 155.5t57 214.5t-57 214.5t-155.5 155.5t-214.5 57zM525 900h50q10 0 17.5 -7.5t7.5 -17.5v-275h175q10 0 17.5 -7.5t7.5 -17.5v-50q0 -10 -7.5 -17.5t-17.5 -7.5h-250q-10 0 -17.5 7.5t-7.5 17.5v350q0 10 7.5 17.5t17.5 7.5z" />
+<glyph unicode="&#xe024;" d="M1300 0h-538l-41 400h-242l-41 -400h-538l431 1200h209l-21 -300h162l-20 300h208zM515 800l-27 -300h224l-27 300h-170z" />
+<glyph unicode="&#xe025;" d="M550 1200h200q21 0 35.5 -14.5t14.5 -35.5v-450h191q20 0 25.5 -11.5t-7.5 -27.5l-327 -400q-13 -16 -32 -16t-32 16l-327 400q-13 16 -7.5 27.5t25.5 11.5h191v450q0 21 14.5 35.5t35.5 14.5zM1125 400h50q10 0 17.5 -7.5t7.5 -17.5v-350q0 -10 -7.5 -17.5t-17.5 -7.5 h-1050q-10 0 -17.5 7.5t-7.5 17.5v350q0 10 7.5 17.5t17.5 7.5h50q10 0 17.5 -7.5t7.5 -17.5v-175h900v175q0 10 7.5 17.5t17.5 7.5z" />
+<glyph unicode="&#xe026;" d="M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM600 1027q-116 0 -214.5 -57t-155.5 -155.5t-57 -214.5t57 -214.5 t155.5 -155.5t214.5 -57t214.5 57t155.5 155.5t57 214.5t-57 214.5t-155.5 155.5t-214.5 57zM525 900h150q10 0 17.5 -7.5t7.5 -17.5v-275h137q21 0 26 -11.5t-8 -27.5l-223 -275q-13 -16 -32 -16t-32 16l-223 275q-13 16 -8 27.5t26 11.5h137v275q0 10 7.5 17.5t17.5 7.5z " />
+<glyph unicode="&#xe027;" d="M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM600 1027q-116 0 -214.5 -57t-155.5 -155.5t-57 -214.5t57 -214.5 t155.5 -155.5t214.5 -57t214.5 57t155.5 155.5t57 214.5t-57 214.5t-155.5 155.5t-214.5 57zM632 914l223 -275q13 -16 8 -27.5t-26 -11.5h-137v-275q0 -10 -7.5 -17.5t-17.5 -7.5h-150q-10 0 -17.5 7.5t-7.5 17.5v275h-137q-21 0 -26 11.5t8 27.5l223 275q13 16 32 16 t32 -16z" />
+<glyph unicode="&#xe028;" d="M225 1200h750q10 0 19.5 -7t12.5 -17l186 -652q7 -24 7 -49v-425q0 -12 -4 -27t-9 -17q-12 -6 -37 -6h-1100q-12 0 -27 4t-17 8q-6 13 -6 38l1 425q0 25 7 49l185 652q3 10 12.5 17t19.5 7zM878 1000h-556q-10 0 -19 -7t-11 -18l-87 -450q-2 -11 4 -18t16 -7h150 q10 0 19.5 -7t11.5 -17l38 -152q2 -10 11.5 -17t19.5 -7h250q10 0 19.5 7t11.5 17l38 152q2 10 11.5 17t19.5 7h150q10 0 16 7t4 18l-87 450q-2 11 -11 18t-19 7z" />
+<glyph unicode="&#xe029;" d="M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM600 1027q-116 0 -214.5 -57t-155.5 -155.5t-57 -214.5t57 -214.5 t155.5 -155.5t214.5 -57t214.5 57t155.5 155.5t57 214.5t-57 214.5t-155.5 155.5t-214.5 57zM540 820l253 -190q17 -12 17 -30t-17 -30l-253 -190q-16 -12 -28 -6.5t-12 26.5v400q0 21 12 26.5t28 -6.5z" />
+<glyph unicode="&#xe030;" d="M947 1060l135 135q7 7 12.5 5t5.5 -13v-362q0 -10 -7.5 -17.5t-17.5 -7.5h-362q-11 0 -13 5.5t5 12.5l133 133q-109 76 -238 76q-116 0 -214.5 -57t-155.5 -155.5t-57 -214.5t57 -214.5t155.5 -155.5t214.5 -57t214.5 57t155.5 155.5t57 214.5h150q0 -117 -45.5 -224 t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5q192 0 347 -117z" />
+<glyph unicode="&#xe031;" d="M947 1060l135 135q7 7 12.5 5t5.5 -13v-361q0 -11 -7.5 -18.5t-18.5 -7.5h-361q-11 0 -13 5.5t5 12.5l134 134q-110 75 -239 75q-116 0 -214.5 -57t-155.5 -155.5t-57 -214.5h-150q0 117 45.5 224t123 184.5t184.5 123t224 45.5q192 0 347 -117zM1027 600h150 q0 -117 -45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5q-192 0 -348 118l-134 -134q-7 -8 -12.5 -5.5t-5.5 12.5v360q0 11 7.5 18.5t18.5 7.5h360q10 0 12.5 -5.5t-5.5 -12.5l-133 -133q110 -76 240 -76q116 0 214.5 57t155.5 155.5t57 214.5z" />
+<glyph unicode="&#xe032;" d="M125 1200h1050q10 0 17.5 -7.5t7.5 -17.5v-1150q0 -10 -7.5 -17.5t-17.5 -7.5h-1050q-10 0 -17.5 7.5t-7.5 17.5v1150q0 10 7.5 17.5t17.5 7.5zM1075 1000h-850q-10 0 -17.5 -7.5t-7.5 -17.5v-850q0 -10 7.5 -17.5t17.5 -7.5h850q10 0 17.5 7.5t7.5 17.5v850 q0 10 -7.5 17.5t-17.5 7.5zM325 900h50q10 0 17.5 -7.5t7.5 -17.5v-50q0 -10 -7.5 -17.5t-17.5 -7.5h-50q-10 0 -17.5 7.5t-7.5 17.5v50q0 10 7.5 17.5t17.5 7.5zM525 900h450q10 0 17.5 -7.5t7.5 -17.5v-50q0 -10 -7.5 -17.5t-17.5 -7.5h-450q-10 0 -17.5 7.5t-7.5 17.5v50 q0 10 7.5 17.5t17.5 7.5zM325 700h50q10 0 17.5 -7.5t7.5 -17.5v-50q0 -10 -7.5 -17.5t-17.5 -7.5h-50q-10 0 -17.5 7.5t-7.5 17.5v50q0 10 7.5 17.5t17.5 7.5zM525 700h450q10 0 17.5 -7.5t7.5 -17.5v-50q0 -10 -7.5 -17.5t-17.5 -7.5h-450q-10 0 -17.5 7.5t-7.5 17.5v50 q0 10 7.5 17.5t17.5 7.5zM325 500h50q10 0 17.5 -7.5t7.5 -17.5v-50q0 -10 -7.5 -17.5t-17.5 -7.5h-50q-10 0 -17.5 7.5t-7.5 17.5v50q0 10 7.5 17.5t17.5 7.5zM525 500h450q10 0 17.5 -7.5t7.5 -17.5v-50q0 -10 -7.5 -17.5t-17.5 -7.5h-450q-10 0 -17.5 7.5t-7.5 17.5v50 q0 10 7.5 17.5t17.5 7.5zM325 300h50q10 0 17.5 -7.5t7.5 -17.5v-50q0 -10 -7.5 -17.5t-17.5 -7.5h-50q-10 0 -17.5 7.5t-7.5 17.5v50q0 10 7.5 17.5t17.5 7.5zM525 300h450q10 0 17.5 -7.5t7.5 -17.5v-50q0 -10 -7.5 -17.5t-17.5 -7.5h-450q-10 0 -17.5 7.5t-7.5 17.5v50 q0 10 7.5 17.5t17.5 7.5z" />
+<glyph unicode="&#xe033;" d="M900 800v200q0 83 -58.5 141.5t-141.5 58.5h-300q-82 0 -141 -59t-59 -141v-200h-100q-41 0 -70.5 -29.5t-29.5 -70.5v-600q0 -41 29.5 -70.5t70.5 -29.5h900q41 0 70.5 29.5t29.5 70.5v600q0 41 -29.5 70.5t-70.5 29.5h-100zM400 800v150q0 21 15 35.5t35 14.5h200 q20 0 35 -14.5t15 -35.5v-150h-300z" />
+<glyph unicode="&#xe034;" d="M125 1100h50q10 0 17.5 -7.5t7.5 -17.5v-1075h-100v1075q0 10 7.5 17.5t17.5 7.5zM1075 1052q4 0 9 -2q16 -6 16 -23v-421q0 -6 -3 -12q-33 -59 -66.5 -99t-65.5 -58t-56.5 -24.5t-52.5 -6.5q-26 0 -57.5 6.5t-52.5 13.5t-60 21q-41 15 -63 22.5t-57.5 15t-65.5 7.5 q-85 0 -160 -57q-7 -5 -15 -5q-6 0 -11 3q-14 7 -14 22v438q22 55 82 98.5t119 46.5q23 2 43 0.5t43 -7t32.5 -8.5t38 -13t32.5 -11q41 -14 63.5 -21t57 -14t63.5 -7q103 0 183 87q7 8 18 8z" />
+<glyph unicode="&#xe035;" d="M600 1175q116 0 227 -49.5t192.5 -131t131 -192.5t49.5 -227v-300q0 -10 -7.5 -17.5t-17.5 -7.5h-50q-10 0 -17.5 7.5t-7.5 17.5v300q0 127 -70.5 231.5t-184.5 161.5t-245 57t-245 -57t-184.5 -161.5t-70.5 -231.5v-300q0 -10 -7.5 -17.5t-17.5 -7.5h-50 q-10 0 -17.5 7.5t-7.5 17.5v300q0 116 49.5 227t131 192.5t192.5 131t227 49.5zM220 500h160q8 0 14 -6t6 -14v-460q0 -8 -6 -14t-14 -6h-160q-8 0 -14 6t-6 14v460q0 8 6 14t14 6zM820 500h160q8 0 14 -6t6 -14v-460q0 -8 -6 -14t-14 -6h-160q-8 0 -14 6t-6 14v460 q0 8 6 14t14 6z" />
+<glyph unicode="&#xe036;" d="M321 814l258 172q9 6 15 2.5t6 -13.5v-750q0 -10 -6 -13.5t-15 2.5l-258 172q-21 14 -46 14h-250q-10 0 -17.5 7.5t-7.5 17.5v350q0 10 7.5 17.5t17.5 7.5h250q25 0 46 14zM900 668l120 120q7 7 17 7t17 -7l34 -34q7 -7 7 -17t-7 -17l-120 -120l120 -120q7 -7 7 -17 t-7 -17l-34 -34q-7 -7 -17 -7t-17 7l-120 119l-120 -119q-7 -7 -17 -7t-17 7l-34 34q-7 7 -7 17t7 17l119 120l-119 120q-7 7 -7 17t7 17l34 34q7 8 17 8t17 -8z" />
+<glyph unicode="&#xe037;" d="M321 814l258 172q9 6 15 2.5t6 -13.5v-750q0 -10 -6 -13.5t-15 2.5l-258 172q-21 14 -46 14h-250q-10 0 -17.5 7.5t-7.5 17.5v350q0 10 7.5 17.5t17.5 7.5h250q25 0 46 14zM766 900h4q10 -1 16 -10q96 -129 96 -290q0 -154 -90 -281q-6 -9 -17 -10l-3 -1q-9 0 -16 6 l-29 23q-7 7 -8.5 16.5t4.5 17.5q72 103 72 229q0 132 -78 238q-6 8 -4.5 18t9.5 17l29 22q7 5 15 5z" />
+<glyph unicode="&#xe038;" d="M967 1004h3q11 -1 17 -10q135 -179 135 -396q0 -105 -34 -206.5t-98 -185.5q-7 -9 -17 -10h-3q-9 0 -16 6l-42 34q-8 6 -9 16t5 18q111 150 111 328q0 90 -29.5 176t-84.5 157q-6 9 -5 19t10 16l42 33q7 5 15 5zM321 814l258 172q9 6 15 2.5t6 -13.5v-750q0 -10 -6 -13.5 t-15 2.5l-258 172q-21 14 -46 14h-250q-10 0 -17.5 7.5t-7.5 17.5v350q0 10 7.5 17.5t17.5 7.5h250q25 0 46 14zM766 900h4q10 -1 16 -10q96 -129 96 -290q0 -154 -90 -281q-6 -9 -17 -10l-3 -1q-9 0 -16 6l-29 23q-7 7 -8.5 16.5t4.5 17.5q72 103 72 229q0 132 -78 238 q-6 8 -4.5 18.5t9.5 16.5l29 22q7 5 15 5z" />
+<glyph unicode="&#xe039;" d="M500 900h100v-100h-100v-100h-400v-100h-100v600h500v-300zM1200 700h-200v-100h200v-200h-300v300h-200v300h-100v200h600v-500zM100 1100v-300h300v300h-300zM800 1100v-300h300v300h-300zM300 900h-100v100h100v-100zM1000 900h-100v100h100v-100zM300 500h200v-500 h-500v500h200v100h100v-100zM800 300h200v-100h-100v-100h-200v100h-100v100h100v200h-200v100h300v-300zM100 400v-300h300v300h-300zM300 200h-100v100h100v-100zM1200 200h-100v100h100v-100zM700 0h-100v100h100v-100zM1200 0h-300v100h300v-100z" />
+<glyph unicode="&#xe040;" d="M100 200h-100v1000h100v-1000zM300 200h-100v1000h100v-1000zM700 200h-200v1000h200v-1000zM900 200h-100v1000h100v-1000zM1200 200h-200v1000h200v-1000zM400 0h-300v100h300v-100zM600 0h-100v91h100v-91zM800 0h-100v91h100v-91zM1100 0h-200v91h200v-91z" />
+<glyph unicode="&#xe041;" d="M500 1200l682 -682q8 -8 8 -18t-8 -18l-464 -464q-8 -8 -18 -8t-18 8l-682 682l1 475q0 10 7.5 17.5t17.5 7.5h474zM319.5 1024.5q-29.5 29.5 -71 29.5t-71 -29.5t-29.5 -71.5t29.5 -71.5t71 -29.5t71 29.5t29.5 71.5t-29.5 71.5z" />
+<glyph unicode="&#xe042;" d="M500 1200l682 -682q8 -8 8 -18t-8 -18l-464 -464q-8 -8 -18 -8t-18 8l-682 682l1 475q0 10 7.5 17.5t17.5 7.5h474zM800 1200l682 -682q8 -8 8 -18t-8 -18l-464 -464q-8 -8 -18 -8t-18 8l-56 56l424 426l-700 700h150zM319.5 1024.5q-29.5 29.5 -71 29.5t-71 -29.5 t-29.5 -71.5t29.5 -71.5t71 -29.5t71 29.5t29.5 71.5t-29.5 71.5z" />
+<glyph unicode="&#xe043;" d="M300 1200h825q75 0 75 -75v-900q0 -25 -18 -43l-64 -64q-8 -8 -13 -5.5t-5 12.5v950q0 10 -7.5 17.5t-17.5 7.5h-700q-25 0 -43 -18l-64 -64q-8 -8 -5.5 -13t12.5 -5h700q10 0 17.5 -7.5t7.5 -17.5v-950q0 -10 -7.5 -17.5t-17.5 -7.5h-850q-10 0 -17.5 7.5t-7.5 17.5v975 q0 25 18 43l139 139q18 18 43 18z" />
+<glyph unicode="&#xe044;" d="M250 1200h800q21 0 35.5 -14.5t14.5 -35.5v-1150l-450 444l-450 -445v1151q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe045;" d="M822 1200h-444q-11 0 -19 -7.5t-9 -17.5l-78 -301q-7 -24 7 -45l57 -108q6 -9 17.5 -15t21.5 -6h450q10 0 21.5 6t17.5 15l62 108q14 21 7 45l-83 301q-1 10 -9 17.5t-19 7.5zM1175 800h-150q-10 0 -21 -6.5t-15 -15.5l-78 -156q-4 -9 -15 -15.5t-21 -6.5h-550 q-10 0 -21 6.5t-15 15.5l-78 156q-4 9 -15 15.5t-21 6.5h-150q-10 0 -17.5 -7.5t-7.5 -17.5v-650q0 -10 7.5 -17.5t17.5 -7.5h150q10 0 17.5 7.5t7.5 17.5v150q0 10 7.5 17.5t17.5 7.5h750q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 7.5 -17.5t17.5 -7.5h150q10 0 17.5 7.5 t7.5 17.5v650q0 10 -7.5 17.5t-17.5 7.5zM850 200h-500q-10 0 -19.5 -7t-11.5 -17l-38 -152q-2 -10 3.5 -17t15.5 -7h600q10 0 15.5 7t3.5 17l-38 152q-2 10 -11.5 17t-19.5 7z" />
+<glyph unicode="&#xe046;" d="M500 1100h200q56 0 102.5 -20.5t72.5 -50t44 -59t25 -50.5l6 -20h150q41 0 70.5 -29.5t29.5 -70.5v-600q0 -41 -29.5 -70.5t-70.5 -29.5h-1000q-41 0 -70.5 29.5t-29.5 70.5v600q0 41 29.5 70.5t70.5 29.5h150q2 8 6.5 21.5t24 48t45 61t72 48t102.5 21.5zM900 800v-100 h100v100h-100zM600 730q-95 0 -162.5 -67.5t-67.5 -162.5t67.5 -162.5t162.5 -67.5t162.5 67.5t67.5 162.5t-67.5 162.5t-162.5 67.5zM600 603q43 0 73 -30t30 -73t-30 -73t-73 -30t-73 30t-30 73t30 73t73 30z" />
+<glyph unicode="&#xe047;" d="M681 1199l385 -998q20 -50 60 -92q18 -19 36.5 -29.5t27.5 -11.5l10 -2v-66h-417v66q53 0 75 43.5t5 88.5l-82 222h-391q-58 -145 -92 -234q-11 -34 -6.5 -57t25.5 -37t46 -20t55 -6v-66h-365v66q56 24 84 52q12 12 25 30.5t20 31.5l7 13l399 1006h93zM416 521h340 l-162 457z" />
+<glyph unicode="&#xe048;" d="M753 641q5 -1 14.5 -4.5t36 -15.5t50.5 -26.5t53.5 -40t50.5 -54.5t35.5 -70t14.5 -87q0 -67 -27.5 -125.5t-71.5 -97.5t-98.5 -66.5t-108.5 -40.5t-102 -13h-500v89q41 7 70.5 32.5t29.5 65.5v827q0 24 -0.5 34t-3.5 24t-8.5 19.5t-17 13.5t-28 12.5t-42.5 11.5v71 l471 -1q57 0 115.5 -20.5t108 -57t80.5 -94t31 -124.5q0 -51 -15.5 -96.5t-38 -74.5t-45 -50.5t-38.5 -30.5zM400 700h139q78 0 130.5 48.5t52.5 122.5q0 41 -8.5 70.5t-29.5 55.5t-62.5 39.5t-103.5 13.5h-118v-350zM400 200h216q80 0 121 50.5t41 130.5q0 90 -62.5 154.5 t-156.5 64.5h-159v-400z" />
+<glyph unicode="&#xe049;" d="M877 1200l2 -57q-83 -19 -116 -45.5t-40 -66.5l-132 -839q-9 -49 13 -69t96 -26v-97h-500v97q186 16 200 98l173 832q3 17 3 30t-1.5 22.5t-9 17.5t-13.5 12.5t-21.5 10t-26 8.5t-33.5 10q-13 3 -19 5v57h425z" />
+<glyph unicode="&#xe050;" d="M1300 900h-50q0 21 -4 37t-9.5 26.5t-18 17.5t-22 11t-28.5 5.5t-31 2t-37 0.5h-200v-850q0 -22 25 -34.5t50 -13.5l25 -2v-100h-400v100q4 0 11 0.5t24 3t30 7t24 15t11 24.5v850h-200q-25 0 -37 -0.5t-31 -2t-28.5 -5.5t-22 -11t-18 -17.5t-9.5 -26.5t-4 -37h-50v300 h1000v-300zM175 1000h-75v-800h75l-125 -167l-125 167h75v800h-75l125 167z" />
+<glyph unicode="&#xe051;" d="M1100 900h-50q0 21 -4 37t-9.5 26.5t-18 17.5t-22 11t-28.5 5.5t-31 2t-37 0.5h-200v-650q0 -22 25 -34.5t50 -13.5l25 -2v-100h-400v100q4 0 11 0.5t24 3t30 7t24 15t11 24.5v650h-200q-25 0 -37 -0.5t-31 -2t-28.5 -5.5t-22 -11t-18 -17.5t-9.5 -26.5t-4 -37h-50v300 h1000v-300zM1167 50l-167 -125v75h-800v-75l-167 125l167 125v-75h800v75z" />
+<glyph unicode="&#xe052;" d="M50 1100h600q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-600q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM50 800h1000q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-1000q-21 0 -35.5 14.5t-14.5 35.5v100 q0 21 14.5 35.5t35.5 14.5zM50 500h800q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-800q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM50 200h1100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-1100 q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe053;" d="M250 1100h700q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-700q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM50 800h1100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-1100q-21 0 -35.5 14.5t-14.5 35.5v100 q0 21 14.5 35.5t35.5 14.5zM250 500h700q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-700q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM50 200h1100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-1100 q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe054;" d="M500 950v100q0 21 14.5 35.5t35.5 14.5h600q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-600q-21 0 -35.5 14.5t-14.5 35.5zM100 650v100q0 21 14.5 35.5t35.5 14.5h1000q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-1000 q-21 0 -35.5 14.5t-14.5 35.5zM300 350v100q0 21 14.5 35.5t35.5 14.5h800q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-800q-21 0 -35.5 14.5t-14.5 35.5zM0 50v100q0 21 14.5 35.5t35.5 14.5h1100q21 0 35.5 -14.5t14.5 -35.5v-100 q0 -21 -14.5 -35.5t-35.5 -14.5h-1100q-21 0 -35.5 14.5t-14.5 35.5z" />
+<glyph unicode="&#xe055;" d="M50 1100h1100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-1100q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM50 800h1100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-1100q-21 0 -35.5 14.5t-14.5 35.5v100 q0 21 14.5 35.5t35.5 14.5zM50 500h1100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-1100q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM50 200h1100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-1100 q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe056;" d="M50 1100h100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM350 1100h800q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-800q-21 0 -35.5 14.5t-14.5 35.5v100 q0 21 14.5 35.5t35.5 14.5zM50 800h100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM350 800h800q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-800 q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM50 500h100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM350 500h800q21 0 35.5 -14.5t14.5 -35.5v-100 q0 -21 -14.5 -35.5t-35.5 -14.5h-800q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM50 200h100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM350 200h800 q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-800q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe057;" d="M400 0h-100v1100h100v-1100zM550 1100h100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM550 800h500q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-500 q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM267 550l-167 -125v75h-200v100h200v75zM550 500h300q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-300q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM550 200h600 q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-600q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe058;" d="M50 1100h100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM900 0h-100v1100h100v-1100zM50 800h500q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-500 q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM1100 600h200v-100h-200v-75l-167 125l167 125v-75zM50 500h300q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-300q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM50 200h600 q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-600q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe059;" d="M75 1000h750q31 0 53 -22t22 -53v-650q0 -31 -22 -53t-53 -22h-750q-31 0 -53 22t-22 53v650q0 31 22 53t53 22zM1200 300l-300 300l300 300v-600z" />
+<glyph unicode="&#xe060;" d="M44 1100h1112q18 0 31 -13t13 -31v-1012q0 -18 -13 -31t-31 -13h-1112q-18 0 -31 13t-13 31v1012q0 18 13 31t31 13zM100 1000v-737l247 182l298 -131l-74 156l293 318l236 -288v500h-1000zM342 884q56 0 95 -39t39 -94.5t-39 -95t-95 -39.5t-95 39.5t-39 95t39 94.5 t95 39z" />
+<glyph unicode="&#xe062;" d="M648 1169q117 0 216 -60t156.5 -161t57.5 -218q0 -115 -70 -258q-69 -109 -158 -225.5t-143 -179.5l-54 -62q-9 8 -25.5 24.5t-63.5 67.5t-91 103t-98.5 128t-95.5 148q-60 132 -60 249q0 88 34 169.5t91.5 142t137 96.5t166.5 36zM652.5 974q-91.5 0 -156.5 -65 t-65 -157t65 -156.5t156.5 -64.5t156.5 64.5t65 156.5t-65 157t-156.5 65z" />
+<glyph unicode="&#xe063;" d="M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM600 173v854q-116 0 -214.5 -57t-155.5 -155.5t-57 -214.5t57 -214.5 t155.5 -155.5t214.5 -57z" />
+<glyph unicode="&#xe064;" d="M554 1295q21 -72 57.5 -143.5t76 -130t83 -118t82.5 -117t70 -116t49.5 -126t18.5 -136.5q0 -71 -25.5 -135t-68.5 -111t-99 -82t-118.5 -54t-125.5 -23q-84 5 -161.5 34t-139.5 78.5t-99 125t-37 164.5q0 69 18 136.5t49.5 126.5t69.5 116.5t81.5 117.5t83.5 119 t76.5 131t58.5 143zM344 710q-23 -33 -43.5 -70.5t-40.5 -102.5t-17 -123q1 -37 14.5 -69.5t30 -52t41 -37t38.5 -24.5t33 -15q21 -7 32 -1t13 22l6 34q2 10 -2.5 22t-13.5 19q-5 4 -14 12t-29.5 40.5t-32.5 73.5q-26 89 6 271q2 11 -6 11q-8 1 -15 -10z" />
+<glyph unicode="&#xe065;" d="M1000 1013l108 115q2 1 5 2t13 2t20.5 -1t25 -9.5t28.5 -21.5q22 -22 27 -43t0 -32l-6 -10l-108 -115zM350 1100h400q50 0 105 -13l-187 -187h-368q-41 0 -70.5 -29.5t-29.5 -70.5v-500q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5v182l200 200v-332 q0 -165 -93.5 -257.5t-256.5 -92.5h-400q-165 0 -257.5 92.5t-92.5 257.5v400q0 165 92.5 257.5t257.5 92.5zM1009 803l-362 -362l-161 -50l55 170l355 355z" />
+<glyph unicode="&#xe066;" d="M350 1100h361q-164 -146 -216 -200h-195q-41 0 -70.5 -29.5t-29.5 -70.5v-500q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5l200 153v-103q0 -165 -92.5 -257.5t-257.5 -92.5h-400q-165 0 -257.5 92.5t-92.5 257.5v400q0 165 92.5 257.5t257.5 92.5z M824 1073l339 -301q8 -7 8 -17.5t-8 -17.5l-340 -306q-7 -6 -12.5 -4t-6.5 11v203q-26 1 -54.5 0t-78.5 -7.5t-92 -17.5t-86 -35t-70 -57q10 59 33 108t51.5 81.5t65 58.5t68.5 40.5t67 24.5t56 13.5t40 4.5v210q1 10 6.5 12.5t13.5 -4.5z" />
+<glyph unicode="&#xe067;" d="M350 1100h350q60 0 127 -23l-178 -177h-349q-41 0 -70.5 -29.5t-29.5 -70.5v-500q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5v69l200 200v-219q0 -165 -92.5 -257.5t-257.5 -92.5h-400q-165 0 -257.5 92.5t-92.5 257.5v400q0 165 92.5 257.5t257.5 92.5z M643 639l395 395q7 7 17.5 7t17.5 -7l101 -101q7 -7 7 -17.5t-7 -17.5l-531 -532q-7 -7 -17.5 -7t-17.5 7l-248 248q-7 7 -7 17.5t7 17.5l101 101q7 7 17.5 7t17.5 -7l111 -111q8 -7 18 -7t18 7z" />
+<glyph unicode="&#xe068;" d="M318 918l264 264q8 8 18 8t18 -8l260 -264q7 -8 4.5 -13t-12.5 -5h-170v-200h200v173q0 10 5 12t13 -5l264 -260q8 -7 8 -17.5t-8 -17.5l-264 -265q-8 -7 -13 -5t-5 12v173h-200v-200h170q10 0 12.5 -5t-4.5 -13l-260 -264q-8 -8 -18 -8t-18 8l-264 264q-8 8 -5.5 13 t12.5 5h175v200h-200v-173q0 -10 -5 -12t-13 5l-264 265q-8 7 -8 17.5t8 17.5l264 260q8 7 13 5t5 -12v-173h200v200h-175q-10 0 -12.5 5t5.5 13z" />
+<glyph unicode="&#xe069;" d="M250 1100h100q21 0 35.5 -14.5t14.5 -35.5v-438l464 453q15 14 25.5 10t10.5 -25v-1000q0 -21 -10.5 -25t-25.5 10l-464 453v-438q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v1000q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe070;" d="M50 1100h100q21 0 35.5 -14.5t14.5 -35.5v-438l464 453q15 14 25.5 10t10.5 -25v-438l464 453q15 14 25.5 10t10.5 -25v-1000q0 -21 -10.5 -25t-25.5 10l-464 453v-438q0 -21 -10.5 -25t-25.5 10l-464 453v-438q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5 t-14.5 35.5v1000q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe071;" d="M1200 1050v-1000q0 -21 -10.5 -25t-25.5 10l-464 453v-438q0 -21 -10.5 -25t-25.5 10l-492 480q-15 14 -15 35t15 35l492 480q15 14 25.5 10t10.5 -25v-438l464 453q15 14 25.5 10t10.5 -25z" />
+<glyph unicode="&#xe072;" d="M243 1074l814 -498q18 -11 18 -26t-18 -26l-814 -498q-18 -11 -30.5 -4t-12.5 28v1000q0 21 12.5 28t30.5 -4z" />
+<glyph unicode="&#xe073;" d="M250 1000h200q21 0 35.5 -14.5t14.5 -35.5v-800q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v800q0 21 14.5 35.5t35.5 14.5zM650 1000h200q21 0 35.5 -14.5t14.5 -35.5v-800q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v800 q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe074;" d="M1100 950v-800q0 -21 -14.5 -35.5t-35.5 -14.5h-800q-21 0 -35.5 14.5t-14.5 35.5v800q0 21 14.5 35.5t35.5 14.5h800q21 0 35.5 -14.5t14.5 -35.5z" />
+<glyph unicode="&#xe075;" d="M500 612v438q0 21 10.5 25t25.5 -10l492 -480q15 -14 15 -35t-15 -35l-492 -480q-15 -14 -25.5 -10t-10.5 25v438l-464 -453q-15 -14 -25.5 -10t-10.5 25v1000q0 21 10.5 25t25.5 -10z" />
+<glyph unicode="&#xe076;" d="M1048 1102l100 1q20 0 35 -14.5t15 -35.5l5 -1000q0 -21 -14.5 -35.5t-35.5 -14.5l-100 -1q-21 0 -35.5 14.5t-14.5 35.5l-2 437l-463 -454q-14 -15 -24.5 -10.5t-10.5 25.5l-2 437l-462 -455q-15 -14 -25.5 -9.5t-10.5 24.5l-5 1000q0 21 10.5 25.5t25.5 -10.5l466 -450 l-2 438q0 20 10.5 24.5t25.5 -9.5l466 -451l-2 438q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe077;" d="M850 1100h100q21 0 35.5 -14.5t14.5 -35.5v-1000q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v438l-464 -453q-15 -14 -25.5 -10t-10.5 25v1000q0 21 10.5 25t25.5 -10l464 -453v438q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe078;" d="M686 1081l501 -540q15 -15 10.5 -26t-26.5 -11h-1042q-22 0 -26.5 11t10.5 26l501 540q15 15 36 15t36 -15zM150 400h1000q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-1000q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe079;" d="M885 900l-352 -353l352 -353l-197 -198l-552 552l552 550z" />
+<glyph unicode="&#xe080;" d="M1064 547l-551 -551l-198 198l353 353l-353 353l198 198z" />
+<glyph unicode="&#xe081;" d="M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM650 900h-100q-21 0 -35.5 -14.5t-14.5 -35.5v-150h-150 q-21 0 -35.5 -14.5t-14.5 -35.5v-100q0 -21 14.5 -35.5t35.5 -14.5h150v-150q0 -21 14.5 -35.5t35.5 -14.5h100q21 0 35.5 14.5t14.5 35.5v150h150q21 0 35.5 14.5t14.5 35.5v100q0 21 -14.5 35.5t-35.5 14.5h-150v150q0 21 -14.5 35.5t-35.5 14.5z" />
+<glyph unicode="&#xe082;" d="M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM850 700h-500q-21 0 -35.5 -14.5t-14.5 -35.5v-100q0 -21 14.5 -35.5 t35.5 -14.5h500q21 0 35.5 14.5t14.5 35.5v100q0 21 -14.5 35.5t-35.5 14.5z" />
+<glyph unicode="&#xe083;" d="M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM741.5 913q-12.5 0 -21.5 -9l-120 -120l-120 120q-9 9 -21.5 9 t-21.5 -9l-141 -141q-9 -9 -9 -21.5t9 -21.5l120 -120l-120 -120q-9 -9 -9 -21.5t9 -21.5l141 -141q9 -9 21.5 -9t21.5 9l120 120l120 -120q9 -9 21.5 -9t21.5 9l141 141q9 9 9 21.5t-9 21.5l-120 120l120 120q9 9 9 21.5t-9 21.5l-141 141q-9 9 -21.5 9z" />
+<glyph unicode="&#xe084;" d="M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM546 623l-84 85q-7 7 -17.5 7t-18.5 -7l-139 -139q-7 -8 -7 -18t7 -18 l242 -241q7 -8 17.5 -8t17.5 8l375 375q7 7 7 17.5t-7 18.5l-139 139q-7 7 -17.5 7t-17.5 -7z" />
+<glyph unicode="&#xe085;" d="M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM588 941q-29 0 -59 -5.5t-63 -20.5t-58 -38.5t-41.5 -63t-16.5 -89.5 q0 -25 20 -25h131q30 -5 35 11q6 20 20.5 28t45.5 8q20 0 31.5 -10.5t11.5 -28.5q0 -23 -7 -34t-26 -18q-1 0 -13.5 -4t-19.5 -7.5t-20 -10.5t-22 -17t-18.5 -24t-15.5 -35t-8 -46q-1 -8 5.5 -16.5t20.5 -8.5h173q7 0 22 8t35 28t37.5 48t29.5 74t12 100q0 47 -17 83 t-42.5 57t-59.5 34.5t-64 18t-59 4.5zM675 400h-150q-10 0 -17.5 -7.5t-7.5 -17.5v-150q0 -10 7.5 -17.5t17.5 -7.5h150q10 0 17.5 7.5t7.5 17.5v150q0 10 -7.5 17.5t-17.5 7.5z" />
+<glyph unicode="&#xe086;" d="M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM675 1000h-150q-10 0 -17.5 -7.5t-7.5 -17.5v-150q0 -10 7.5 -17.5 t17.5 -7.5h150q10 0 17.5 7.5t7.5 17.5v150q0 10 -7.5 17.5t-17.5 7.5zM675 700h-250q-10 0 -17.5 -7.5t-7.5 -17.5v-50q0 -10 7.5 -17.5t17.5 -7.5h75v-200h-75q-10 0 -17.5 -7.5t-7.5 -17.5v-50q0 -10 7.5 -17.5t17.5 -7.5h350q10 0 17.5 7.5t7.5 17.5v50q0 10 -7.5 17.5 t-17.5 7.5h-75v275q0 10 -7.5 17.5t-17.5 7.5z" />
+<glyph unicode="&#xe087;" d="M525 1200h150q10 0 17.5 -7.5t7.5 -17.5v-194q103 -27 178.5 -102.5t102.5 -178.5h194q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-194q-27 -103 -102.5 -178.5t-178.5 -102.5v-194q0 -10 -7.5 -17.5t-17.5 -7.5h-150q-10 0 -17.5 7.5t-7.5 17.5v194 q-103 27 -178.5 102.5t-102.5 178.5h-194q-10 0 -17.5 7.5t-7.5 17.5v150q0 10 7.5 17.5t17.5 7.5h194q27 103 102.5 178.5t178.5 102.5v194q0 10 7.5 17.5t17.5 7.5zM700 893v-168q0 -10 -7.5 -17.5t-17.5 -7.5h-150q-10 0 -17.5 7.5t-7.5 17.5v168q-68 -23 -119 -74 t-74 -119h168q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-168q23 -68 74 -119t119 -74v168q0 10 7.5 17.5t17.5 7.5h150q10 0 17.5 -7.5t7.5 -17.5v-168q68 23 119 74t74 119h-168q-10 0 -17.5 7.5t-7.5 17.5v150q0 10 7.5 17.5t17.5 7.5h168 q-23 68 -74 119t-119 74z" />
+<glyph unicode="&#xe088;" d="M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM600 1027q-116 0 -214.5 -57t-155.5 -155.5t-57 -214.5t57 -214.5 t155.5 -155.5t214.5 -57t214.5 57t155.5 155.5t57 214.5t-57 214.5t-155.5 155.5t-214.5 57zM759 823l64 -64q7 -7 7 -17.5t-7 -17.5l-124 -124l124 -124q7 -7 7 -17.5t-7 -17.5l-64 -64q-7 -7 -17.5 -7t-17.5 7l-124 124l-124 -124q-7 -7 -17.5 -7t-17.5 7l-64 64 q-7 7 -7 17.5t7 17.5l124 124l-124 124q-7 7 -7 17.5t7 17.5l64 64q7 7 17.5 7t17.5 -7l124 -124l124 124q7 7 17.5 7t17.5 -7z" />
+<glyph unicode="&#xe089;" d="M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM600 1027q-116 0 -214.5 -57t-155.5 -155.5t-57 -214.5t57 -214.5 t155.5 -155.5t214.5 -57t214.5 57t155.5 155.5t57 214.5t-57 214.5t-155.5 155.5t-214.5 57zM782 788l106 -106q7 -7 7 -17.5t-7 -17.5l-320 -321q-8 -7 -18 -7t-18 7l-202 203q-8 7 -8 17.5t8 17.5l106 106q7 8 17.5 8t17.5 -8l79 -79l197 197q7 7 17.5 7t17.5 -7z" />
+<glyph unicode="&#xe090;" d="M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM600 1027q-116 0 -214.5 -57t-155.5 -155.5t-57 -214.5q0 -120 65 -225 l587 587q-105 65 -225 65zM965 819l-584 -584q104 -62 219 -62q116 0 214.5 57t155.5 155.5t57 214.5q0 115 -62 219z" />
+<glyph unicode="&#xe091;" d="M39 582l522 427q16 13 27.5 8t11.5 -26v-291h550q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-550v-291q0 -21 -11.5 -26t-27.5 8l-522 427q-16 13 -16 32t16 32z" />
+<glyph unicode="&#xe092;" d="M639 1009l522 -427q16 -13 16 -32t-16 -32l-522 -427q-16 -13 -27.5 -8t-11.5 26v291h-550q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5h550v291q0 21 11.5 26t27.5 -8z" />
+<glyph unicode="&#xe093;" d="M682 1161l427 -522q13 -16 8 -27.5t-26 -11.5h-291v-550q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v550h-291q-21 0 -26 11.5t8 27.5l427 522q13 16 32 16t32 -16z" />
+<glyph unicode="&#xe094;" d="M550 1200h200q21 0 35.5 -14.5t14.5 -35.5v-550h291q21 0 26 -11.5t-8 -27.5l-427 -522q-13 -16 -32 -16t-32 16l-427 522q-13 16 -8 27.5t26 11.5h291v550q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe095;" d="M639 1109l522 -427q16 -13 16 -32t-16 -32l-522 -427q-16 -13 -27.5 -8t-11.5 26v291q-94 -2 -182 -20t-170.5 -52t-147 -92.5t-100.5 -135.5q5 105 27 193.5t67.5 167t113 135t167 91.5t225.5 42v262q0 21 11.5 26t27.5 -8z" />
+<glyph unicode="&#xe096;" d="M850 1200h300q21 0 35.5 -14.5t14.5 -35.5v-300q0 -21 -10.5 -25t-24.5 10l-94 94l-249 -249q-8 -7 -18 -7t-18 7l-106 106q-7 8 -7 18t7 18l249 249l-94 94q-14 14 -10 24.5t25 10.5zM350 0h-300q-21 0 -35.5 14.5t-14.5 35.5v300q0 21 10.5 25t24.5 -10l94 -94l249 249 q8 7 18 7t18 -7l106 -106q7 -8 7 -18t-7 -18l-249 -249l94 -94q14 -14 10 -24.5t-25 -10.5z" />
+<glyph unicode="&#xe097;" d="M1014 1120l106 -106q7 -8 7 -18t-7 -18l-249 -249l94 -94q14 -14 10 -24.5t-25 -10.5h-300q-21 0 -35.5 14.5t-14.5 35.5v300q0 21 10.5 25t24.5 -10l94 -94l249 249q8 7 18 7t18 -7zM250 600h300q21 0 35.5 -14.5t14.5 -35.5v-300q0 -21 -10.5 -25t-24.5 10l-94 94 l-249 -249q-8 -7 -18 -7t-18 7l-106 106q-7 8 -7 18t7 18l249 249l-94 94q-14 14 -10 24.5t25 10.5z" />
+<glyph unicode="&#xe101;" d="M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM704 900h-208q-20 0 -32 -14.5t-8 -34.5l58 -302q4 -20 21.5 -34.5 t37.5 -14.5h54q20 0 37.5 14.5t21.5 34.5l58 302q4 20 -8 34.5t-32 14.5zM675 400h-150q-10 0 -17.5 -7.5t-7.5 -17.5v-150q0 -10 7.5 -17.5t17.5 -7.5h150q10 0 17.5 7.5t7.5 17.5v150q0 10 -7.5 17.5t-17.5 7.5z" />
+<glyph unicode="&#xe102;" d="M260 1200q9 0 19 -2t15 -4l5 -2q22 -10 44 -23l196 -118q21 -13 36 -24q29 -21 37 -12q11 13 49 35l196 118q22 13 45 23q17 7 38 7q23 0 47 -16.5t37 -33.5l13 -16q14 -21 18 -45l25 -123l8 -44q1 -9 8.5 -14.5t17.5 -5.5h61q10 0 17.5 -7.5t7.5 -17.5v-50 q0 -10 -7.5 -17.5t-17.5 -7.5h-50q-10 0 -17.5 -7.5t-7.5 -17.5v-175h-400v300h-200v-300h-400v175q0 10 -7.5 17.5t-17.5 7.5h-50q-10 0 -17.5 7.5t-7.5 17.5v50q0 10 7.5 17.5t17.5 7.5h61q11 0 18 3t7 8q0 4 9 52l25 128q5 25 19 45q2 3 5 7t13.5 15t21.5 19.5t26.5 15.5 t29.5 7zM915 1079l-166 -162q-7 -7 -5 -12t12 -5h219q10 0 15 7t2 17l-51 149q-3 10 -11 12t-15 -6zM463 917l-177 157q-8 7 -16 5t-11 -12l-51 -143q-3 -10 2 -17t15 -7h231q11 0 12.5 5t-5.5 12zM500 0h-375q-10 0 -17.5 7.5t-7.5 17.5v375h400v-400zM1100 400v-375 q0 -10 -7.5 -17.5t-17.5 -7.5h-375v400h400z" />
+<glyph unicode="&#xe103;" d="M1165 1190q8 3 21 -6.5t13 -17.5q-2 -178 -24.5 -323.5t-55.5 -245.5t-87 -174.5t-102.5 -118.5t-118 -68.5t-118.5 -33t-120 -4.5t-105 9.5t-90 16.5q-61 12 -78 11q-4 1 -12.5 0t-34 -14.5t-52.5 -40.5l-153 -153q-26 -24 -37 -14.5t-11 43.5q0 64 42 102q8 8 50.5 45 t66.5 58q19 17 35 47t13 61q-9 55 -10 102.5t7 111t37 130t78 129.5q39 51 80 88t89.5 63.5t94.5 45t113.5 36t129 31t157.5 37t182 47.5zM1116 1098q-8 9 -22.5 -3t-45.5 -50q-38 -47 -119 -103.5t-142 -89.5l-62 -33q-56 -30 -102 -57t-104 -68t-102.5 -80.5t-85.5 -91 t-64 -104.5q-24 -56 -31 -86t2 -32t31.5 17.5t55.5 59.5q25 30 94 75.5t125.5 77.5t147.5 81q70 37 118.5 69t102 79.5t99 111t86.5 148.5q22 50 24 60t-6 19z" />
+<glyph unicode="&#xe104;" d="M653 1231q-39 -67 -54.5 -131t-10.5 -114.5t24.5 -96.5t47.5 -80t63.5 -62.5t68.5 -46.5t65 -30q-4 7 -17.5 35t-18.5 39.5t-17 39.5t-17 43t-13 42t-9.5 44.5t-2 42t4 43t13.5 39t23 38.5q96 -42 165 -107.5t105 -138t52 -156t13 -159t-19 -149.5q-13 -55 -44 -106.5 t-68 -87t-78.5 -64.5t-72.5 -45t-53 -22q-72 -22 -127 -11q-31 6 -13 19q6 3 17 7q13 5 32.5 21t41 44t38.5 63.5t21.5 81.5t-6.5 94.5t-50 107t-104 115.5q10 -104 -0.5 -189t-37 -140.5t-65 -93t-84 -52t-93.5 -11t-95 24.5q-80 36 -131.5 114t-53.5 171q-2 23 0 49.5 t4.5 52.5t13.5 56t27.5 60t46 64.5t69.5 68.5q-8 -53 -5 -102.5t17.5 -90t34 -68.5t44.5 -39t49 -2q31 13 38.5 36t-4.5 55t-29 64.5t-36 75t-26 75.5q-15 85 2 161.5t53.5 128.5t85.5 92.5t93.5 61t81.5 25.5z" />
+<glyph unicode="&#xe105;" d="M600 1094q82 0 160.5 -22.5t140 -59t116.5 -82.5t94.5 -95t68 -95t42.5 -82.5t14 -57.5t-14 -57.5t-43 -82.5t-68.5 -95t-94.5 -95t-116.5 -82.5t-140 -59t-159.5 -22.5t-159.5 22.5t-140 59t-116.5 82.5t-94.5 95t-68.5 95t-43 82.5t-14 57.5t14 57.5t42.5 82.5t68 95 t94.5 95t116.5 82.5t140 59t160.5 22.5zM888 829q-15 15 -18 12t5 -22q25 -57 25 -119q0 -124 -88 -212t-212 -88t-212 88t-88 212q0 59 23 114q8 19 4.5 22t-17.5 -12q-70 -69 -160 -184q-13 -16 -15 -40.5t9 -42.5q22 -36 47 -71t70 -82t92.5 -81t113 -58.5t133.5 -24.5 t133.5 24t113 58.5t92.5 81.5t70 81.5t47 70.5q11 18 9 42.5t-14 41.5q-90 117 -163 189zM448 727l-35 -36q-15 -15 -19.5 -38.5t4.5 -41.5q37 -68 93 -116q16 -13 38.5 -11t36.5 17l35 34q14 15 12.5 33.5t-16.5 33.5q-44 44 -89 117q-11 18 -28 20t-32 -12z" />
+<glyph unicode="&#xe106;" d="M592 0h-148l31 120q-91 20 -175.5 68.5t-143.5 106.5t-103.5 119t-66.5 110t-22 76q0 21 14 57.5t42.5 82.5t68 95t94.5 95t116.5 82.5t140 59t160.5 22.5q61 0 126 -15l32 121h148zM944 770l47 181q108 -85 176.5 -192t68.5 -159q0 -26 -19.5 -71t-59.5 -102t-93 -112 t-129 -104.5t-158 -75.5l46 173q77 49 136 117t97 131q11 18 9 42.5t-14 41.5q-54 70 -107 130zM310 824q-70 -69 -160 -184q-13 -16 -15 -40.5t9 -42.5q18 -30 39 -60t57 -70.5t74 -73t90 -61t105 -41.5l41 154q-107 18 -178.5 101.5t-71.5 193.5q0 59 23 114q8 19 4.5 22 t-17.5 -12zM448 727l-35 -36q-15 -15 -19.5 -38.5t4.5 -41.5q37 -68 93 -116q16 -13 38.5 -11t36.5 17l12 11l22 86l-3 4q-44 44 -89 117q-11 18 -28 20t-32 -12z" />
+<glyph unicode="&#xe107;" d="M-90 100l642 1066q20 31 48 28.5t48 -35.5l642 -1056q21 -32 7.5 -67.5t-50.5 -35.5h-1294q-37 0 -50.5 34t7.5 66zM155 200h345v75q0 10 7.5 17.5t17.5 7.5h150q10 0 17.5 -7.5t7.5 -17.5v-75h345l-445 723zM496 700h208q20 0 32 -14.5t8 -34.5l-58 -252 q-4 -20 -21.5 -34.5t-37.5 -14.5h-54q-20 0 -37.5 14.5t-21.5 34.5l-58 252q-4 20 8 34.5t32 14.5z" />
+<glyph unicode="&#xe108;" d="M650 1200q62 0 106 -44t44 -106v-339l363 -325q15 -14 26 -38.5t11 -44.5v-41q0 -20 -12 -26.5t-29 5.5l-359 249v-263q100 -93 100 -113v-64q0 -21 -13 -29t-32 1l-205 128l-205 -128q-19 -9 -32 -1t-13 29v64q0 20 100 113v263l-359 -249q-17 -12 -29 -5.5t-12 26.5v41 q0 20 11 44.5t26 38.5l363 325v339q0 62 44 106t106 44z" />
+<glyph unicode="&#xe109;" d="M850 1200h100q21 0 35.5 -14.5t14.5 -35.5v-50h50q21 0 35.5 -14.5t14.5 -35.5v-150h-1100v150q0 21 14.5 35.5t35.5 14.5h50v50q0 21 14.5 35.5t35.5 14.5h100q21 0 35.5 -14.5t14.5 -35.5v-50h500v50q0 21 14.5 35.5t35.5 14.5zM1100 800v-750q0 -21 -14.5 -35.5 t-35.5 -14.5h-1000q-21 0 -35.5 14.5t-14.5 35.5v750h1100zM100 600v-100h100v100h-100zM300 600v-100h100v100h-100zM500 600v-100h100v100h-100zM700 600v-100h100v100h-100zM900 600v-100h100v100h-100zM100 400v-100h100v100h-100zM300 400v-100h100v100h-100zM500 400 v-100h100v100h-100zM700 400v-100h100v100h-100zM900 400v-100h100v100h-100zM100 200v-100h100v100h-100zM300 200v-100h100v100h-100zM500 200v-100h100v100h-100zM700 200v-100h100v100h-100zM900 200v-100h100v100h-100z" />
+<glyph unicode="&#xe110;" d="M1135 1165l249 -230q15 -14 15 -35t-15 -35l-249 -230q-14 -14 -24.5 -10t-10.5 25v150h-159l-600 -600h-291q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5h209l600 600h241v150q0 21 10.5 25t24.5 -10zM522 819l-141 -141l-122 122h-209q-21 0 -35.5 14.5 t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5h291zM1135 565l249 -230q15 -14 15 -35t-15 -35l-249 -230q-14 -14 -24.5 -10t-10.5 25v150h-241l-181 181l141 141l122 -122h159v150q0 21 10.5 25t24.5 -10z" />
+<glyph unicode="&#xe111;" d="M100 1100h1000q41 0 70.5 -29.5t29.5 -70.5v-600q0 -41 -29.5 -70.5t-70.5 -29.5h-596l-304 -300v300h-100q-41 0 -70.5 29.5t-29.5 70.5v600q0 41 29.5 70.5t70.5 29.5z" />
+<glyph unicode="&#xe112;" d="M150 1200h200q21 0 35.5 -14.5t14.5 -35.5v-250h-300v250q0 21 14.5 35.5t35.5 14.5zM850 1200h200q21 0 35.5 -14.5t14.5 -35.5v-250h-300v250q0 21 14.5 35.5t35.5 14.5zM1100 800v-300q0 -41 -3 -77.5t-15 -89.5t-32 -96t-58 -89t-89 -77t-129 -51t-174 -20t-174 20 t-129 51t-89 77t-58 89t-32 96t-15 89.5t-3 77.5v300h300v-250v-27v-42.5t1.5 -41t5 -38t10 -35t16.5 -30t25.5 -24.5t35 -19t46.5 -12t60 -4t60 4.5t46.5 12.5t35 19.5t25 25.5t17 30.5t10 35t5 38t2 40.5t-0.5 42v25v250h300z" />
+<glyph unicode="&#xe113;" d="M1100 411l-198 -199l-353 353l-353 -353l-197 199l551 551z" />
+<glyph unicode="&#xe114;" d="M1101 789l-550 -551l-551 551l198 199l353 -353l353 353z" />
+<glyph unicode="&#xe115;" d="M404 1000h746q21 0 35.5 -14.5t14.5 -35.5v-551h150q21 0 25 -10.5t-10 -24.5l-230 -249q-14 -15 -35 -15t-35 15l-230 249q-14 14 -10 24.5t25 10.5h150v401h-381zM135 984l230 -249q14 -14 10 -24.5t-25 -10.5h-150v-400h385l215 -200h-750q-21 0 -35.5 14.5 t-14.5 35.5v550h-150q-21 0 -25 10.5t10 24.5l230 249q14 15 35 15t35 -15z" />
+<glyph unicode="&#xe116;" d="M56 1200h94q17 0 31 -11t18 -27l38 -162h896q24 0 39 -18.5t10 -42.5l-100 -475q-5 -21 -27 -42.5t-55 -21.5h-633l48 -200h535q21 0 35.5 -14.5t14.5 -35.5t-14.5 -35.5t-35.5 -14.5h-50v-50q0 -21 -14.5 -35.5t-35.5 -14.5t-35.5 14.5t-14.5 35.5v50h-300v-50 q0 -21 -14.5 -35.5t-35.5 -14.5t-35.5 14.5t-14.5 35.5v50h-31q-18 0 -32.5 10t-20.5 19l-5 10l-201 961h-54q-20 0 -35 14.5t-15 35.5t15 35.5t35 14.5z" />
+<glyph unicode="&#xe117;" d="M1200 1000v-100h-1200v100h200q0 41 29.5 70.5t70.5 29.5h300q41 0 70.5 -29.5t29.5 -70.5h500zM0 800h1200v-800h-1200v800z" />
+<glyph unicode="&#xe118;" d="M200 800l-200 -400v600h200q0 41 29.5 70.5t70.5 29.5h300q42 0 71 -29.5t29 -70.5h500v-200h-1000zM1500 700l-300 -700h-1200l300 700h1200z" />
+<glyph unicode="&#xe119;" d="M635 1184l230 -249q14 -14 10 -24.5t-25 -10.5h-150v-601h150q21 0 25 -10.5t-10 -24.5l-230 -249q-14 -15 -35 -15t-35 15l-230 249q-14 14 -10 24.5t25 10.5h150v601h-150q-21 0 -25 10.5t10 24.5l230 249q14 15 35 15t35 -15z" />
+<glyph unicode="&#xe120;" d="M936 864l249 -229q14 -15 14 -35.5t-14 -35.5l-249 -229q-15 -15 -25.5 -10.5t-10.5 24.5v151h-600v-151q0 -20 -10.5 -24.5t-25.5 10.5l-249 229q-14 15 -14 35.5t14 35.5l249 229q15 15 25.5 10.5t10.5 -25.5v-149h600v149q0 21 10.5 25.5t25.5 -10.5z" />
+<glyph unicode="&#xe121;" d="M1169 400l-172 732q-5 23 -23 45.5t-38 22.5h-672q-20 0 -38 -20t-23 -41l-172 -739h1138zM1100 300h-1000q-41 0 -70.5 -29.5t-29.5 -70.5v-100q0 -41 29.5 -70.5t70.5 -29.5h1000q41 0 70.5 29.5t29.5 70.5v100q0 41 -29.5 70.5t-70.5 29.5zM800 100v100h100v-100h-100 zM1000 100v100h100v-100h-100z" />
+<glyph unicode="&#xe122;" d="M1150 1100q21 0 35.5 -14.5t14.5 -35.5v-850q0 -21 -14.5 -35.5t-35.5 -14.5t-35.5 14.5t-14.5 35.5v850q0 21 14.5 35.5t35.5 14.5zM1000 200l-675 200h-38l47 -276q3 -16 -5.5 -20t-29.5 -4h-7h-84q-20 0 -34.5 14t-18.5 35q-55 337 -55 351v250v6q0 16 1 23.5t6.5 14 t17.5 6.5h200l675 250v-850zM0 750v-250q-4 0 -11 0.5t-24 6t-30 15t-24 30t-11 48.5v50q0 26 10.5 46t25 30t29 16t25.5 7z" />
+<glyph unicode="&#xe123;" d="M553 1200h94q20 0 29 -10.5t3 -29.5l-18 -37q83 -19 144 -82.5t76 -140.5l63 -327l118 -173h17q19 0 33 -14.5t14 -35t-13 -40.5t-31 -27q-8 -4 -23 -9.5t-65 -19.5t-103 -25t-132.5 -20t-158.5 -9q-57 0 -115 5t-104 12t-88.5 15.5t-73.5 17.5t-54.5 16t-35.5 12l-11 4 q-18 8 -31 28t-13 40.5t14 35t33 14.5h17l118 173l63 327q15 77 76 140t144 83l-18 32q-6 19 3.5 32t28.5 13zM498 110q50 -6 102 -6q53 0 102 6q-12 -49 -39.5 -79.5t-62.5 -30.5t-63 30.5t-39 79.5z" />
+<glyph unicode="&#xe124;" d="M800 946l224 78l-78 -224l234 -45l-180 -155l180 -155l-234 -45l78 -224l-224 78l-45 -234l-155 180l-155 -180l-45 234l-224 -78l78 224l-234 45l180 155l-180 155l234 45l-78 224l224 -78l45 234l155 -180l155 180z" />
+<glyph unicode="&#xe125;" d="M650 1200h50q40 0 70 -40.5t30 -84.5v-150l-28 -125h328q40 0 70 -40.5t30 -84.5v-100q0 -45 -29 -74l-238 -344q-16 -24 -38 -40.5t-45 -16.5h-250q-7 0 -42 25t-66 50l-31 25h-61q-45 0 -72.5 18t-27.5 57v400q0 36 20 63l145 196l96 198q13 28 37.5 48t51.5 20z M650 1100l-100 -212l-150 -213v-375h100l136 -100h214l250 375v125h-450l50 225v175h-50zM50 800h100q21 0 35.5 -14.5t14.5 -35.5v-500q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v500q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe126;" d="M600 1100h250q23 0 45 -16.5t38 -40.5l238 -344q29 -29 29 -74v-100q0 -44 -30 -84.5t-70 -40.5h-328q28 -118 28 -125v-150q0 -44 -30 -84.5t-70 -40.5h-50q-27 0 -51.5 20t-37.5 48l-96 198l-145 196q-20 27 -20 63v400q0 39 27.5 57t72.5 18h61q124 100 139 100z M50 1000h100q21 0 35.5 -14.5t14.5 -35.5v-500q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v500q0 21 14.5 35.5t35.5 14.5zM636 1000l-136 -100h-100v-375l150 -213l100 -212h50v175l-50 225h450v125l-250 375h-214z" />
+<glyph unicode="&#xe127;" d="M356 873l363 230q31 16 53 -6l110 -112q13 -13 13.5 -32t-11.5 -34l-84 -121h302q84 0 138 -38t54 -110t-55 -111t-139 -39h-106l-131 -339q-6 -21 -19.5 -41t-28.5 -20h-342q-7 0 -90 81t-83 94v525q0 17 14 35.5t28 28.5zM400 792v-503l100 -89h293l131 339 q6 21 19.5 41t28.5 20h203q21 0 30.5 25t0.5 50t-31 25h-456h-7h-6h-5.5t-6 0.5t-5 1.5t-5 2t-4 2.5t-4 4t-2.5 4.5q-12 25 5 47l146 183l-86 83zM50 800h100q21 0 35.5 -14.5t14.5 -35.5v-500q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v500 q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe128;" d="M475 1103l366 -230q2 -1 6 -3.5t14 -10.5t18 -16.5t14.5 -20t6.5 -22.5v-525q0 -13 -86 -94t-93 -81h-342q-15 0 -28.5 20t-19.5 41l-131 339h-106q-85 0 -139.5 39t-54.5 111t54 110t138 38h302l-85 121q-11 15 -10.5 34t13.5 32l110 112q22 22 53 6zM370 945l146 -183 q17 -22 5 -47q-2 -2 -3.5 -4.5t-4 -4t-4 -2.5t-5 -2t-5 -1.5t-6 -0.5h-6h-6.5h-6h-475v-100h221q15 0 29 -20t20 -41l130 -339h294l106 89v503l-342 236zM1050 800h100q21 0 35.5 -14.5t14.5 -35.5v-500q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5 v500q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe129;" d="M550 1294q72 0 111 -55t39 -139v-106l339 -131q21 -6 41 -19.5t20 -28.5v-342q0 -7 -81 -90t-94 -83h-525q-17 0 -35.5 14t-28.5 28l-9 14l-230 363q-16 31 6 53l112 110q13 13 32 13.5t34 -11.5l121 -84v302q0 84 38 138t110 54zM600 972v203q0 21 -25 30.5t-50 0.5 t-25 -31v-456v-7v-6v-5.5t-0.5 -6t-1.5 -5t-2 -5t-2.5 -4t-4 -4t-4.5 -2.5q-25 -12 -47 5l-183 146l-83 -86l236 -339h503l89 100v293l-339 131q-21 6 -41 19.5t-20 28.5zM450 200h500q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-500 q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe130;" d="M350 1100h500q21 0 35.5 14.5t14.5 35.5v100q0 21 -14.5 35.5t-35.5 14.5h-500q-21 0 -35.5 -14.5t-14.5 -35.5v-100q0 -21 14.5 -35.5t35.5 -14.5zM600 306v-106q0 -84 -39 -139t-111 -55t-110 54t-38 138v302l-121 -84q-15 -12 -34 -11.5t-32 13.5l-112 110 q-22 22 -6 53l230 363q1 2 3.5 6t10.5 13.5t16.5 17t20 13.5t22.5 6h525q13 0 94 -83t81 -90v-342q0 -15 -20 -28.5t-41 -19.5zM308 900l-236 -339l83 -86l183 146q22 17 47 5q2 -1 4.5 -2.5t4 -4t2.5 -4t2 -5t1.5 -5t0.5 -6v-5.5v-6v-7v-456q0 -22 25 -31t50 0.5t25 30.5 v203q0 15 20 28.5t41 19.5l339 131v293l-89 100h-503z" />
+<glyph unicode="&#xe131;" d="M600 1178q118 0 225 -45.5t184.5 -123t123 -184.5t45.5 -225t-45.5 -225t-123 -184.5t-184.5 -123t-225 -45.5t-225 45.5t-184.5 123t-123 184.5t-45.5 225t45.5 225t123 184.5t184.5 123t225 45.5zM914 632l-275 223q-16 13 -27.5 8t-11.5 -26v-137h-275 q-10 0 -17.5 -7.5t-7.5 -17.5v-150q0 -10 7.5 -17.5t17.5 -7.5h275v-137q0 -21 11.5 -26t27.5 8l275 223q16 13 16 32t-16 32z" />
+<glyph unicode="&#xe132;" d="M600 1178q118 0 225 -45.5t184.5 -123t123 -184.5t45.5 -225t-45.5 -225t-123 -184.5t-184.5 -123t-225 -45.5t-225 45.5t-184.5 123t-123 184.5t-45.5 225t45.5 225t123 184.5t184.5 123t225 45.5zM561 855l-275 -223q-16 -13 -16 -32t16 -32l275 -223q16 -13 27.5 -8 t11.5 26v137h275q10 0 17.5 7.5t7.5 17.5v150q0 10 -7.5 17.5t-17.5 7.5h-275v137q0 21 -11.5 26t-27.5 -8z" />
+<glyph unicode="&#xe133;" d="M600 1178q118 0 225 -45.5t184.5 -123t123 -184.5t45.5 -225t-45.5 -225t-123 -184.5t-184.5 -123t-225 -45.5t-225 45.5t-184.5 123t-123 184.5t-45.5 225t45.5 225t123 184.5t184.5 123t225 45.5zM855 639l-223 275q-13 16 -32 16t-32 -16l-223 -275q-13 -16 -8 -27.5 t26 -11.5h137v-275q0 -10 7.5 -17.5t17.5 -7.5h150q10 0 17.5 7.5t7.5 17.5v275h137q21 0 26 11.5t-8 27.5z" />
+<glyph unicode="&#xe134;" d="M600 1178q118 0 225 -45.5t184.5 -123t123 -184.5t45.5 -225t-45.5 -225t-123 -184.5t-184.5 -123t-225 -45.5t-225 45.5t-184.5 123t-123 184.5t-45.5 225t45.5 225t123 184.5t184.5 123t225 45.5zM675 900h-150q-10 0 -17.5 -7.5t-7.5 -17.5v-275h-137q-21 0 -26 -11.5 t8 -27.5l223 -275q13 -16 32 -16t32 16l223 275q13 16 8 27.5t-26 11.5h-137v275q0 10 -7.5 17.5t-17.5 7.5z" />
+<glyph unicode="&#xe135;" d="M600 1176q116 0 222.5 -46t184 -123.5t123.5 -184t46 -222.5t-46 -222.5t-123.5 -184t-184 -123.5t-222.5 -46t-222.5 46t-184 123.5t-123.5 184t-46 222.5t46 222.5t123.5 184t184 123.5t222.5 46zM627 1101q-15 -12 -36.5 -20.5t-35.5 -12t-43 -8t-39 -6.5 q-15 -3 -45.5 0t-45.5 -2q-20 -7 -51.5 -26.5t-34.5 -34.5q-3 -11 6.5 -22.5t8.5 -18.5q-3 -34 -27.5 -91t-29.5 -79q-9 -34 5 -93t8 -87q0 -9 17 -44.5t16 -59.5q12 0 23 -5t23.5 -15t19.5 -14q16 -8 33 -15t40.5 -15t34.5 -12q21 -9 52.5 -32t60 -38t57.5 -11 q7 -15 -3 -34t-22.5 -40t-9.5 -38q13 -21 23 -34.5t27.5 -27.5t36.5 -18q0 -7 -3.5 -16t-3.5 -14t5 -17q104 -2 221 112q30 29 46.5 47t34.5 49t21 63q-13 8 -37 8.5t-36 7.5q-15 7 -49.5 15t-51.5 19q-18 0 -41 -0.5t-43 -1.5t-42 -6.5t-38 -16.5q-51 -35 -66 -12 q-4 1 -3.5 25.5t0.5 25.5q-6 13 -26.5 17.5t-24.5 6.5q1 15 -0.5 30.5t-7 28t-18.5 11.5t-31 -21q-23 -25 -42 4q-19 28 -8 58q6 16 22 22q6 -1 26 -1.5t33.5 -4t19.5 -13.5q7 -12 18 -24t21.5 -20.5t20 -15t15.5 -10.5l5 -3q2 12 7.5 30.5t8 34.5t-0.5 32q-3 18 3.5 29 t18 22.5t15.5 24.5q6 14 10.5 35t8 31t15.5 22.5t34 22.5q-6 18 10 36q8 0 24 -1.5t24.5 -1.5t20 4.5t20.5 15.5q-10 23 -31 42.5t-37.5 29.5t-49 27t-43.5 23q0 1 2 8t3 11.5t1.5 10.5t-1 9.5t-4.5 4.5q31 -13 58.5 -14.5t38.5 2.5l12 5q5 28 -9.5 46t-36.5 24t-50 15 t-41 20q-18 -4 -37 0zM613 994q0 -17 8 -42t17 -45t9 -23q-8 1 -39.5 5.5t-52.5 10t-37 16.5q3 11 16 29.5t16 25.5q10 -10 19 -10t14 6t13.5 14.5t16.5 12.5z" />
+<glyph unicode="&#xe136;" d="M756 1157q164 92 306 -9l-259 -138l145 -232l251 126q6 -89 -34 -156.5t-117 -110.5q-60 -34 -127 -39.5t-126 16.5l-596 -596q-15 -16 -36.5 -16t-36.5 16l-111 110q-15 15 -15 36.5t15 37.5l600 599q-34 101 5.5 201.5t135.5 154.5z" />
+<glyph unicode="&#xe137;" horiz-adv-x="1220" d="M100 1196h1000q41 0 70.5 -29.5t29.5 -70.5v-100q0 -41 -29.5 -70.5t-70.5 -29.5h-1000q-41 0 -70.5 29.5t-29.5 70.5v100q0 41 29.5 70.5t70.5 29.5zM1100 1096h-200v-100h200v100zM100 796h1000q41 0 70.5 -29.5t29.5 -70.5v-100q0 -41 -29.5 -70.5t-70.5 -29.5h-1000 q-41 0 -70.5 29.5t-29.5 70.5v100q0 41 29.5 70.5t70.5 29.5zM1100 696h-500v-100h500v100zM100 396h1000q41 0 70.5 -29.5t29.5 -70.5v-100q0 -41 -29.5 -70.5t-70.5 -29.5h-1000q-41 0 -70.5 29.5t-29.5 70.5v100q0 41 29.5 70.5t70.5 29.5zM1100 296h-300v-100h300v100z " />
+<glyph unicode="&#xe138;" d="M150 1200h900q21 0 35.5 -14.5t14.5 -35.5t-14.5 -35.5t-35.5 -14.5h-900q-21 0 -35.5 14.5t-14.5 35.5t14.5 35.5t35.5 14.5zM700 500v-300l-200 -200v500l-350 500h900z" />
+<glyph unicode="&#xe139;" d="M500 1200h200q41 0 70.5 -29.5t29.5 -70.5v-100h300q41 0 70.5 -29.5t29.5 -70.5v-400h-500v100h-200v-100h-500v400q0 41 29.5 70.5t70.5 29.5h300v100q0 41 29.5 70.5t70.5 29.5zM500 1100v-100h200v100h-200zM1200 400v-200q0 -41 -29.5 -70.5t-70.5 -29.5h-1000 q-41 0 -70.5 29.5t-29.5 70.5v200h1200z" />
+<glyph unicode="&#xe140;" d="M50 1200h300q21 0 25 -10.5t-10 -24.5l-94 -94l199 -199q7 -8 7 -18t-7 -18l-106 -106q-8 -7 -18 -7t-18 7l-199 199l-94 -94q-14 -14 -24.5 -10t-10.5 25v300q0 21 14.5 35.5t35.5 14.5zM850 1200h300q21 0 35.5 -14.5t14.5 -35.5v-300q0 -21 -10.5 -25t-24.5 10l-94 94 l-199 -199q-8 -7 -18 -7t-18 7l-106 106q-7 8 -7 18t7 18l199 199l-94 94q-14 14 -10 24.5t25 10.5zM364 470l106 -106q7 -8 7 -18t-7 -18l-199 -199l94 -94q14 -14 10 -24.5t-25 -10.5h-300q-21 0 -35.5 14.5t-14.5 35.5v300q0 21 10.5 25t24.5 -10l94 -94l199 199 q8 7 18 7t18 -7zM1071 271l94 94q14 14 24.5 10t10.5 -25v-300q0 -21 -14.5 -35.5t-35.5 -14.5h-300q-21 0 -25 10.5t10 24.5l94 94l-199 199q-7 8 -7 18t7 18l106 106q8 7 18 7t18 -7z" />
+<glyph unicode="&#xe141;" d="M596 1192q121 0 231.5 -47.5t190 -127t127 -190t47.5 -231.5t-47.5 -231.5t-127 -190.5t-190 -127t-231.5 -47t-231.5 47t-190.5 127t-127 190.5t-47 231.5t47 231.5t127 190t190.5 127t231.5 47.5zM596 1010q-112 0 -207.5 -55.5t-151 -151t-55.5 -207.5t55.5 -207.5 t151 -151t207.5 -55.5t207.5 55.5t151 151t55.5 207.5t-55.5 207.5t-151 151t-207.5 55.5zM454.5 905q22.5 0 38.5 -16t16 -38.5t-16 -39t-38.5 -16.5t-38.5 16.5t-16 39t16 38.5t38.5 16zM754.5 905q22.5 0 38.5 -16t16 -38.5t-16 -39t-38 -16.5q-14 0 -29 10l-55 -145 q17 -23 17 -51q0 -36 -25.5 -61.5t-61.5 -25.5t-61.5 25.5t-25.5 61.5q0 32 20.5 56.5t51.5 29.5l122 126l1 1q-9 14 -9 28q0 23 16 39t38.5 16zM345.5 709q22.5 0 38.5 -16t16 -38.5t-16 -38.5t-38.5 -16t-38.5 16t-16 38.5t16 38.5t38.5 16zM854.5 709q22.5 0 38.5 -16 t16 -38.5t-16 -38.5t-38.5 -16t-38.5 16t-16 38.5t16 38.5t38.5 16z" />
+<glyph unicode="&#xe142;" d="M546 173l469 470q91 91 99 192q7 98 -52 175.5t-154 94.5q-22 4 -47 4q-34 0 -66.5 -10t-56.5 -23t-55.5 -38t-48 -41.5t-48.5 -47.5q-376 -375 -391 -390q-30 -27 -45 -41.5t-37.5 -41t-32 -46.5t-16 -47.5t-1.5 -56.5q9 -62 53.5 -95t99.5 -33q74 0 125 51l548 548 q36 36 20 75q-7 16 -21.5 26t-32.5 10q-26 0 -50 -23q-13 -12 -39 -38l-341 -338q-15 -15 -35.5 -15.5t-34.5 13.5t-14 34.5t14 34.5q327 333 361 367q35 35 67.5 51.5t78.5 16.5q14 0 29 -1q44 -8 74.5 -35.5t43.5 -68.5q14 -47 2 -96.5t-47 -84.5q-12 -11 -32 -32 t-79.5 -81t-114.5 -115t-124.5 -123.5t-123 -119.5t-96.5 -89t-57 -45q-56 -27 -120 -27q-70 0 -129 32t-93 89q-48 78 -35 173t81 163l511 511q71 72 111 96q91 55 198 55q80 0 152 -33q78 -36 129.5 -103t66.5 -154q17 -93 -11 -183.5t-94 -156.5l-482 -476 q-15 -15 -36 -16t-37 14t-17.5 34t14.5 35z" />
+<glyph unicode="&#xe143;" d="M649 949q48 68 109.5 104t121.5 38.5t118.5 -20t102.5 -64t71 -100.5t27 -123q0 -57 -33.5 -117.5t-94 -124.5t-126.5 -127.5t-150 -152.5t-146 -174q-62 85 -145.5 174t-150 152.5t-126.5 127.5t-93.5 124.5t-33.5 117.5q0 64 28 123t73 100.5t104 64t119 20 t120.5 -38.5t104.5 -104zM896 972q-33 0 -64.5 -19t-56.5 -46t-47.5 -53.5t-43.5 -45.5t-37.5 -19t-36 19t-40 45.5t-43 53.5t-54 46t-65.5 19q-67 0 -122.5 -55.5t-55.5 -132.5q0 -23 13.5 -51t46 -65t57.5 -63t76 -75l22 -22q15 -14 44 -44t50.5 -51t46 -44t41 -35t23 -12 t23.5 12t42.5 36t46 44t52.5 52t44 43q4 4 12 13q43 41 63.5 62t52 55t46 55t26 46t11.5 44q0 79 -53 133.5t-120 54.5z" />
+<glyph unicode="&#xe144;" d="M776.5 1214q93.5 0 159.5 -66l141 -141q66 -66 66 -160q0 -42 -28 -95.5t-62 -87.5l-29 -29q-31 53 -77 99l-18 18l95 95l-247 248l-389 -389l212 -212l-105 -106l-19 18l-141 141q-66 66 -66 159t66 159l283 283q65 66 158.5 66zM600 706l105 105q10 -8 19 -17l141 -141 q66 -66 66 -159t-66 -159l-283 -283q-66 -66 -159 -66t-159 66l-141 141q-66 66 -66 159.5t66 159.5l55 55q29 -55 75 -102l18 -17l-95 -95l247 -248l389 389z" />
+<glyph unicode="&#xe145;" d="M603 1200q85 0 162 -15t127 -38t79 -48t29 -46v-953q0 -41 -29.5 -70.5t-70.5 -29.5h-600q-41 0 -70.5 29.5t-29.5 70.5v953q0 21 30 46.5t81 48t129 37.5t163 15zM300 1000v-700h600v700h-600zM600 254q-43 0 -73.5 -30.5t-30.5 -73.5t30.5 -73.5t73.5 -30.5t73.5 30.5 t30.5 73.5t-30.5 73.5t-73.5 30.5z" />
+<glyph unicode="&#xe146;" d="M902 1185l283 -282q15 -15 15 -36t-14.5 -35.5t-35.5 -14.5t-35 15l-36 35l-279 -267v-300l-212 210l-308 -307l-280 -203l203 280l307 308l-210 212h300l267 279l-35 36q-15 14 -15 35t14.5 35.5t35.5 14.5t35 -15z" />
+<glyph unicode="&#xe148;" d="M700 1248v-78q38 -5 72.5 -14.5t75.5 -31.5t71 -53.5t52 -84t24 -118.5h-159q-4 36 -10.5 59t-21 45t-40 35.5t-64.5 20.5v-307l64 -13q34 -7 64 -16.5t70 -32t67.5 -52.5t47.5 -80t20 -112q0 -139 -89 -224t-244 -97v-77h-100v79q-150 16 -237 103q-40 40 -52.5 93.5 t-15.5 139.5h139q5 -77 48.5 -126t117.5 -65v335l-27 8q-46 14 -79 26.5t-72 36t-63 52t-40 72.5t-16 98q0 70 25 126t67.5 92t94.5 57t110 27v77h100zM600 754v274q-29 -4 -50 -11t-42 -21.5t-31.5 -41.5t-10.5 -65q0 -29 7 -50.5t16.5 -34t28.5 -22.5t31.5 -14t37.5 -10 q9 -3 13 -4zM700 547v-310q22 2 42.5 6.5t45 15.5t41.5 27t29 42t12 59.5t-12.5 59.5t-38 44.5t-53 31t-66.5 24.5z" />
+<glyph unicode="&#xe149;" d="M561 1197q84 0 160.5 -40t123.5 -109.5t47 -147.5h-153q0 40 -19.5 71.5t-49.5 48.5t-59.5 26t-55.5 9q-37 0 -79 -14.5t-62 -35.5q-41 -44 -41 -101q0 -26 13.5 -63t26.5 -61t37 -66q6 -9 9 -14h241v-100h-197q8 -50 -2.5 -115t-31.5 -95q-45 -62 -99 -112 q34 10 83 17.5t71 7.5q32 1 102 -16t104 -17q83 0 136 30l50 -147q-31 -19 -58 -30.5t-55 -15.5t-42 -4.5t-46 -0.5q-23 0 -76 17t-111 32.5t-96 11.5q-39 -3 -82 -16t-67 -25l-23 -11l-55 145q4 3 16 11t15.5 10.5t13 9t15.5 12t14.5 14t17.5 18.5q48 55 54 126.5 t-30 142.5h-221v100h166q-23 47 -44 104q-7 20 -12 41.5t-6 55.5t6 66.5t29.5 70.5t58.5 71q97 88 263 88z" />
+<glyph unicode="&#xe150;" d="M400 300h150q21 0 25 -11t-10 -25l-230 -250q-14 -15 -35 -15t-35 15l-230 250q-14 14 -10 25t25 11h150v900h200v-900zM935 1184l230 -249q14 -14 10 -24.5t-25 -10.5h-150v-900h-200v900h-150q-21 0 -25 10.5t10 24.5l230 249q14 15 35 15t35 -15z" />
+<glyph unicode="&#xe151;" d="M1000 700h-100v100h-100v-100h-100v500h300v-500zM400 300h150q21 0 25 -11t-10 -25l-230 -250q-14 -15 -35 -15t-35 15l-230 250q-14 14 -10 25t25 11h150v900h200v-900zM801 1100v-200h100v200h-100zM1000 350l-200 -250h200v-100h-300v150l200 250h-200v100h300v-150z " />
+<glyph unicode="&#xe152;" d="M400 300h150q21 0 25 -11t-10 -25l-230 -250q-14 -15 -35 -15t-35 15l-230 250q-14 14 -10 25t25 11h150v900h200v-900zM1000 1050l-200 -250h200v-100h-300v150l200 250h-200v100h300v-150zM1000 0h-100v100h-100v-100h-100v500h300v-500zM801 400v-200h100v200h-100z " />
+<glyph unicode="&#xe153;" d="M400 300h150q21 0 25 -11t-10 -25l-230 -250q-14 -15 -35 -15t-35 15l-230 250q-14 14 -10 25t25 11h150v900h200v-900zM1000 700h-100v400h-100v100h200v-500zM1100 0h-100v100h-200v400h300v-500zM901 400v-200h100v200h-100z" />
+<glyph unicode="&#xe154;" d="M400 300h150q21 0 25 -11t-10 -25l-230 -250q-14 -15 -35 -15t-35 15l-230 250q-14 14 -10 25t25 11h150v900h200v-900zM1100 700h-100v100h-200v400h300v-500zM901 1100v-200h100v200h-100zM1000 0h-100v400h-100v100h200v-500z" />
+<glyph unicode="&#xe155;" d="M400 300h150q21 0 25 -11t-10 -25l-230 -250q-14 -15 -35 -15t-35 15l-230 250q-14 14 -10 25t25 11h150v900h200v-900zM900 1000h-200v200h200v-200zM1000 700h-300v200h300v-200zM1100 400h-400v200h400v-200zM1200 100h-500v200h500v-200z" />
+<glyph unicode="&#xe156;" d="M400 300h150q21 0 25 -11t-10 -25l-230 -250q-14 -15 -35 -15t-35 15l-230 250q-14 14 -10 25t25 11h150v900h200v-900zM1200 1000h-500v200h500v-200zM1100 700h-400v200h400v-200zM1000 400h-300v200h300v-200zM900 100h-200v200h200v-200z" />
+<glyph unicode="&#xe157;" d="M350 1100h400q162 0 256 -93.5t94 -256.5v-400q0 -165 -93.5 -257.5t-256.5 -92.5h-400q-165 0 -257.5 92.5t-92.5 257.5v400q0 165 92.5 257.5t257.5 92.5zM800 900h-500q-41 0 -70.5 -29.5t-29.5 -70.5v-500q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5 v500q0 41 -29.5 70.5t-70.5 29.5z" />
+<glyph unicode="&#xe158;" d="M350 1100h400q165 0 257.5 -92.5t92.5 -257.5v-400q0 -165 -92.5 -257.5t-257.5 -92.5h-400q-163 0 -256.5 92.5t-93.5 257.5v400q0 163 94 256.5t256 93.5zM800 900h-500q-41 0 -70.5 -29.5t-29.5 -70.5v-500q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5 v500q0 41 -29.5 70.5t-70.5 29.5zM440 770l253 -190q17 -12 17 -30t-17 -30l-253 -190q-16 -12 -28 -6.5t-12 26.5v400q0 21 12 26.5t28 -6.5z" />
+<glyph unicode="&#xe159;" d="M350 1100h400q163 0 256.5 -94t93.5 -256v-400q0 -165 -92.5 -257.5t-257.5 -92.5h-400q-165 0 -257.5 92.5t-92.5 257.5v400q0 163 92.5 256.5t257.5 93.5zM800 900h-500q-41 0 -70.5 -29.5t-29.5 -70.5v-500q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5 v500q0 41 -29.5 70.5t-70.5 29.5zM350 700h400q21 0 26.5 -12t-6.5 -28l-190 -253q-12 -17 -30 -17t-30 17l-190 253q-12 16 -6.5 28t26.5 12z" />
+<glyph unicode="&#xe160;" d="M350 1100h400q165 0 257.5 -92.5t92.5 -257.5v-400q0 -163 -92.5 -256.5t-257.5 -93.5h-400q-163 0 -256.5 94t-93.5 256v400q0 165 92.5 257.5t257.5 92.5zM800 900h-500q-41 0 -70.5 -29.5t-29.5 -70.5v-500q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5 v500q0 41 -29.5 70.5t-70.5 29.5zM580 693l190 -253q12 -16 6.5 -28t-26.5 -12h-400q-21 0 -26.5 12t6.5 28l190 253q12 17 30 17t30 -17z" />
+<glyph unicode="&#xe161;" d="M550 1100h400q165 0 257.5 -92.5t92.5 -257.5v-400q0 -165 -92.5 -257.5t-257.5 -92.5h-400q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5h450q41 0 70.5 29.5t29.5 70.5v500q0 41 -29.5 70.5t-70.5 29.5h-450q-21 0 -35.5 14.5t-14.5 35.5v100 q0 21 14.5 35.5t35.5 14.5zM338 867l324 -284q16 -14 16 -33t-16 -33l-324 -284q-16 -14 -27 -9t-11 26v150h-250q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5h250v150q0 21 11 26t27 -9z" />
+<glyph unicode="&#xe162;" d="M793 1182l9 -9q8 -10 5 -27q-3 -11 -79 -225.5t-78 -221.5l300 1q24 0 32.5 -17.5t-5.5 -35.5q-1 0 -133.5 -155t-267 -312.5t-138.5 -162.5q-12 -15 -26 -15h-9l-9 8q-9 11 -4 32q2 9 42 123.5t79 224.5l39 110h-302q-23 0 -31 19q-10 21 6 41q75 86 209.5 237.5 t228 257t98.5 111.5q9 16 25 16h9z" />
+<glyph unicode="&#xe163;" d="M350 1100h400q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-450q-41 0 -70.5 -29.5t-29.5 -70.5v-500q0 -41 29.5 -70.5t70.5 -29.5h450q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-400q-165 0 -257.5 92.5t-92.5 257.5v400 q0 165 92.5 257.5t257.5 92.5zM938 867l324 -284q16 -14 16 -33t-16 -33l-324 -284q-16 -14 -27 -9t-11 26v150h-250q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5h250v150q0 21 11 26t27 -9z" />
+<glyph unicode="&#xe164;" d="M750 1200h400q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -10.5 -25t-24.5 10l-109 109l-312 -312q-15 -15 -35.5 -15t-35.5 15l-141 141q-15 15 -15 35.5t15 35.5l312 312l-109 109q-14 14 -10 24.5t25 10.5zM456 900h-156q-41 0 -70.5 -29.5t-29.5 -70.5v-500 q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5v148l200 200v-298q0 -165 -93.5 -257.5t-256.5 -92.5h-400q-165 0 -257.5 92.5t-92.5 257.5v400q0 165 92.5 257.5t257.5 92.5h300z" />
+<glyph unicode="&#xe165;" d="M600 1186q119 0 227.5 -46.5t187 -125t125 -187t46.5 -227.5t-46.5 -227.5t-125 -187t-187 -125t-227.5 -46.5t-227.5 46.5t-187 125t-125 187t-46.5 227.5t46.5 227.5t125 187t187 125t227.5 46.5zM600 1022q-115 0 -212 -56.5t-153.5 -153.5t-56.5 -212t56.5 -212 t153.5 -153.5t212 -56.5t212 56.5t153.5 153.5t56.5 212t-56.5 212t-153.5 153.5t-212 56.5zM600 794q80 0 137 -57t57 -137t-57 -137t-137 -57t-137 57t-57 137t57 137t137 57z" />
+<glyph unicode="&#xe166;" d="M450 1200h200q21 0 35.5 -14.5t14.5 -35.5v-350h245q20 0 25 -11t-9 -26l-383 -426q-14 -15 -33.5 -15t-32.5 15l-379 426q-13 15 -8.5 26t25.5 11h250v350q0 21 14.5 35.5t35.5 14.5zM50 300h1000q21 0 35.5 -14.5t14.5 -35.5v-250h-1100v250q0 21 14.5 35.5t35.5 14.5z M900 200v-50h100v50h-100z" />
+<glyph unicode="&#xe167;" d="M583 1182l378 -435q14 -15 9 -31t-26 -16h-244v-250q0 -20 -17 -35t-39 -15h-200q-20 0 -32 14.5t-12 35.5v250h-250q-20 0 -25.5 16.5t8.5 31.5l383 431q14 16 33.5 17t33.5 -14zM50 300h1000q21 0 35.5 -14.5t14.5 -35.5v-250h-1100v250q0 21 14.5 35.5t35.5 14.5z M900 200v-50h100v50h-100z" />
+<glyph unicode="&#xe168;" d="M396 723l369 369q7 7 17.5 7t17.5 -7l139 -139q7 -8 7 -18.5t-7 -17.5l-525 -525q-7 -8 -17.5 -8t-17.5 8l-292 291q-7 8 -7 18t7 18l139 139q8 7 18.5 7t17.5 -7zM50 300h1000q21 0 35.5 -14.5t14.5 -35.5v-250h-1100v250q0 21 14.5 35.5t35.5 14.5zM900 200v-50h100v50 h-100z" />
+<glyph unicode="&#xe169;" d="M135 1023l142 142q14 14 35 14t35 -14l77 -77l-212 -212l-77 76q-14 15 -14 36t14 35zM655 855l210 210q14 14 24.5 10t10.5 -25l-2 -599q-1 -20 -15.5 -35t-35.5 -15l-597 -1q-21 0 -25 10.5t10 24.5l208 208l-154 155l212 212zM50 300h1000q21 0 35.5 -14.5t14.5 -35.5 v-250h-1100v250q0 21 14.5 35.5t35.5 14.5zM900 200v-50h100v50h-100z" />
+<glyph unicode="&#xe170;" d="M350 1200l599 -2q20 -1 35 -15.5t15 -35.5l1 -597q0 -21 -10.5 -25t-24.5 10l-208 208l-155 -154l-212 212l155 154l-210 210q-14 14 -10 24.5t25 10.5zM524 512l-76 -77q-15 -14 -36 -14t-35 14l-142 142q-14 14 -14 35t14 35l77 77zM50 300h1000q21 0 35.5 -14.5 t14.5 -35.5v-250h-1100v250q0 21 14.5 35.5t35.5 14.5zM900 200v-50h100v50h-100z" />
+<glyph unicode="&#xe171;" d="M1200 103l-483 276l-314 -399v423h-399l1196 796v-1096zM483 424v-230l683 953z" />
+<glyph unicode="&#xe172;" d="M1100 1000v-850q0 -21 -14.5 -35.5t-35.5 -14.5h-150v400h-700v-400h-150q-21 0 -35.5 14.5t-14.5 35.5v1000q0 20 14.5 35t35.5 15h250v-300h500v300h100zM700 1000h-100v200h100v-200z" />
+<glyph unicode="&#xe173;" d="M1100 1000l-2 -149l-299 -299l-95 95q-9 9 -21.5 9t-21.5 -9l-149 -147h-312v-400h-150q-21 0 -35.5 14.5t-14.5 35.5v1000q0 20 14.5 35t35.5 15h250v-300h500v300h100zM700 1000h-100v200h100v-200zM1132 638l106 -106q7 -7 7 -17.5t-7 -17.5l-420 -421q-8 -7 -18 -7 t-18 7l-202 203q-8 7 -8 17.5t8 17.5l106 106q7 8 17.5 8t17.5 -8l79 -79l297 297q7 7 17.5 7t17.5 -7z" />
+<glyph unicode="&#xe174;" d="M1100 1000v-269l-103 -103l-134 134q-15 15 -33.5 16.5t-34.5 -12.5l-266 -266h-329v-400h-150q-21 0 -35.5 14.5t-14.5 35.5v1000q0 20 14.5 35t35.5 15h250v-300h500v300h100zM700 1000h-100v200h100v-200zM1202 572l70 -70q15 -15 15 -35.5t-15 -35.5l-131 -131 l131 -131q15 -15 15 -35.5t-15 -35.5l-70 -70q-15 -15 -35.5 -15t-35.5 15l-131 131l-131 -131q-15 -15 -35.5 -15t-35.5 15l-70 70q-15 15 -15 35.5t15 35.5l131 131l-131 131q-15 15 -15 35.5t15 35.5l70 70q15 15 35.5 15t35.5 -15l131 -131l131 131q15 15 35.5 15 t35.5 -15z" />
+<glyph unicode="&#xe175;" d="M1100 1000v-300h-350q-21 0 -35.5 -14.5t-14.5 -35.5v-150h-500v-400h-150q-21 0 -35.5 14.5t-14.5 35.5v1000q0 20 14.5 35t35.5 15h250v-300h500v300h100zM700 1000h-100v200h100v-200zM850 600h100q21 0 35.5 -14.5t14.5 -35.5v-250h150q21 0 25 -10.5t-10 -24.5 l-230 -230q-14 -14 -35 -14t-35 14l-230 230q-14 14 -10 24.5t25 10.5h150v250q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe176;" d="M1100 1000v-400l-165 165q-14 15 -35 15t-35 -15l-263 -265h-402v-400h-150q-21 0 -35.5 14.5t-14.5 35.5v1000q0 20 14.5 35t35.5 15h250v-300h500v300h100zM700 1000h-100v200h100v-200zM935 565l230 -229q14 -15 10 -25.5t-25 -10.5h-150v-250q0 -20 -14.5 -35 t-35.5 -15h-100q-21 0 -35.5 15t-14.5 35v250h-150q-21 0 -25 10.5t10 25.5l230 229q14 15 35 15t35 -15z" />
+<glyph unicode="&#xe177;" d="M50 1100h1100q21 0 35.5 -14.5t14.5 -35.5v-150h-1200v150q0 21 14.5 35.5t35.5 14.5zM1200 800v-550q0 -21 -14.5 -35.5t-35.5 -14.5h-1100q-21 0 -35.5 14.5t-14.5 35.5v550h1200zM100 500v-200h400v200h-400z" />
+<glyph unicode="&#xe178;" d="M935 1165l248 -230q14 -14 14 -35t-14 -35l-248 -230q-14 -14 -24.5 -10t-10.5 25v150h-400v200h400v150q0 21 10.5 25t24.5 -10zM200 800h-50q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5h50v-200zM400 800h-100v200h100v-200zM18 435l247 230 q14 14 24.5 10t10.5 -25v-150h400v-200h-400v-150q0 -21 -10.5 -25t-24.5 10l-247 230q-15 14 -15 35t15 35zM900 300h-100v200h100v-200zM1000 500h51q20 0 34.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-34.5 -14.5h-51v200z" />
+<glyph unicode="&#xe179;" d="M862 1073l276 116q25 18 43.5 8t18.5 -41v-1106q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v397q-4 1 -11 5t-24 17.5t-30 29t-24 42t-11 56.5v359q0 31 18.5 65t43.5 52zM550 1200q22 0 34.5 -12.5t14.5 -24.5l1 -13v-450q0 -28 -10.5 -59.5 t-25 -56t-29 -45t-25.5 -31.5l-10 -11v-447q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v447q-4 4 -11 11.5t-24 30.5t-30 46t-24 55t-11 60v450q0 2 0.5 5.5t4 12t8.5 15t14.5 12t22.5 5.5q20 0 32.5 -12.5t14.5 -24.5l3 -13v-350h100v350v5.5t2.5 12 t7 15t15 12t25.5 5.5q23 0 35.5 -12.5t13.5 -24.5l1 -13v-350h100v350q0 2 0.5 5.5t3 12t7 15t15 12t24.5 5.5z" />
+<glyph unicode="&#xe180;" d="M1200 1100v-56q-4 0 -11 -0.5t-24 -3t-30 -7.5t-24 -15t-11 -24v-888q0 -22 25 -34.5t50 -13.5l25 -2v-56h-400v56q75 0 87.5 6.5t12.5 43.5v394h-500v-394q0 -37 12.5 -43.5t87.5 -6.5v-56h-400v56q4 0 11 0.5t24 3t30 7.5t24 15t11 24v888q0 22 -25 34.5t-50 13.5 l-25 2v56h400v-56q-75 0 -87.5 -6.5t-12.5 -43.5v-394h500v394q0 37 -12.5 43.5t-87.5 6.5v56h400z" />
+<glyph unicode="&#xe181;" d="M675 1000h375q21 0 35.5 -14.5t14.5 -35.5v-150h-105l-295 -98v98l-200 200h-400l100 100h375zM100 900h300q41 0 70.5 -29.5t29.5 -70.5v-500q0 -41 -29.5 -70.5t-70.5 -29.5h-300q-41 0 -70.5 29.5t-29.5 70.5v500q0 41 29.5 70.5t70.5 29.5zM100 800v-200h300v200 h-300zM1100 535l-400 -133v163l400 133v-163zM100 500v-200h300v200h-300zM1100 398v-248q0 -21 -14.5 -35.5t-35.5 -14.5h-375l-100 -100h-375l-100 100h400l200 200h105z" />
+<glyph unicode="&#xe182;" d="M17 1007l162 162q17 17 40 14t37 -22l139 -194q14 -20 11 -44.5t-20 -41.5l-119 -118q102 -142 228 -268t267 -227l119 118q17 17 42.5 19t44.5 -12l192 -136q19 -14 22.5 -37.5t-13.5 -40.5l-163 -162q-3 -1 -9.5 -1t-29.5 2t-47.5 6t-62.5 14.5t-77.5 26.5t-90 42.5 t-101.5 60t-111 83t-119 108.5q-74 74 -133.5 150.5t-94.5 138.5t-60 119.5t-34.5 100t-15 74.5t-4.5 48z" />
+<glyph unicode="&#xe183;" d="M600 1100q92 0 175 -10.5t141.5 -27t108.5 -36.5t81.5 -40t53.5 -37t31 -27l9 -10v-200q0 -21 -14.5 -33t-34.5 -9l-202 34q-20 3 -34.5 20t-14.5 38v146q-141 24 -300 24t-300 -24v-146q0 -21 -14.5 -38t-34.5 -20l-202 -34q-20 -3 -34.5 9t-14.5 33v200q3 4 9.5 10.5 t31 26t54 37.5t80.5 39.5t109 37.5t141 26.5t175 10.5zM600 795q56 0 97 -9.5t60 -23.5t30 -28t12 -24l1 -10v-50l365 -303q14 -15 24.5 -40t10.5 -45v-212q0 -21 -14.5 -35.5t-35.5 -14.5h-1100q-21 0 -35.5 14.5t-14.5 35.5v212q0 20 10.5 45t24.5 40l365 303v50 q0 4 1 10.5t12 23t30 29t60 22.5t97 10z" />
+<glyph unicode="&#xe184;" d="M1100 700l-200 -200h-600l-200 200v500h200v-200h200v200h200v-200h200v200h200v-500zM250 400h700q21 0 35.5 -14.5t14.5 -35.5t-14.5 -35.5t-35.5 -14.5h-12l137 -100h-950l137 100h-12q-21 0 -35.5 14.5t-14.5 35.5t14.5 35.5t35.5 14.5zM50 100h1100q21 0 35.5 -14.5 t14.5 -35.5v-50h-1200v50q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe185;" d="M700 1100h-100q-41 0 -70.5 -29.5t-29.5 -70.5v-1000h300v1000q0 41 -29.5 70.5t-70.5 29.5zM1100 800h-100q-41 0 -70.5 -29.5t-29.5 -70.5v-700h300v700q0 41 -29.5 70.5t-70.5 29.5zM400 0h-300v400q0 41 29.5 70.5t70.5 29.5h100q41 0 70.5 -29.5t29.5 -70.5v-400z " />
+<glyph unicode="&#xe186;" d="M200 1100h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212v500q0 124 88 212t212 88zM100 900v-700h900v700h-900zM500 700h-200v-100h200v-300h-300v100h200v100h-200v300h300v-100zM900 700v-300l-100 -100h-200v500h200z M700 700v-300h100v300h-100z" />
+<glyph unicode="&#xe187;" d="M200 1100h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212v500q0 124 88 212t212 88zM100 900v-700h900v700h-900zM500 300h-100v200h-100v-200h-100v500h100v-200h100v200h100v-500zM900 700v-300l-100 -100h-200v500h200z M700 700v-300h100v300h-100z" />
+<glyph unicode="&#xe188;" d="M200 1100h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212v500q0 124 88 212t212 88zM100 900v-700h900v700h-900zM500 700h-200v-300h200v-100h-300v500h300v-100zM900 700h-200v-300h200v-100h-300v500h300v-100z" />
+<glyph unicode="&#xe189;" d="M200 1100h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212v500q0 124 88 212t212 88zM100 900v-700h900v700h-900zM500 400l-300 150l300 150v-300zM900 550l-300 -150v300z" />
+<glyph unicode="&#xe190;" d="M200 1100h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212v500q0 124 88 212t212 88zM100 900v-700h900v700h-900zM900 300h-700v500h700v-500zM800 700h-130q-38 0 -66.5 -43t-28.5 -108t27 -107t68 -42h130v300zM300 700v-300 h130q41 0 68 42t27 107t-28.5 108t-66.5 43h-130z" />
+<glyph unicode="&#xe191;" d="M200 1100h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212v500q0 124 88 212t212 88zM100 900v-700h900v700h-900zM500 700h-200v-100h200v-300h-300v100h200v100h-200v300h300v-100zM900 300h-100v400h-100v100h200v-500z M700 300h-100v100h100v-100z" />
+<glyph unicode="&#xe192;" d="M200 1100h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212v500q0 124 88 212t212 88zM100 900v-700h900v700h-900zM300 700h200v-400h-300v500h100v-100zM900 300h-100v400h-100v100h200v-500zM300 600v-200h100v200h-100z M700 300h-100v100h100v-100z" />
+<glyph unicode="&#xe193;" d="M200 1100h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212v500q0 124 88 212t212 88zM100 900v-700h900v700h-900zM500 500l-199 -200h-100v50l199 200v150h-200v100h300v-300zM900 300h-100v400h-100v100h200v-500zM701 300h-100 v100h100v-100z" />
+<glyph unicode="&#xe194;" d="M600 1191q120 0 229.5 -47t188.5 -126t126 -188.5t47 -229.5t-47 -229.5t-126 -188.5t-188.5 -126t-229.5 -47t-229.5 47t-188.5 126t-126 188.5t-47 229.5t47 229.5t126 188.5t188.5 126t229.5 47zM600 1021q-114 0 -211 -56.5t-153.5 -153.5t-56.5 -211t56.5 -211 t153.5 -153.5t211 -56.5t211 56.5t153.5 153.5t56.5 211t-56.5 211t-153.5 153.5t-211 56.5zM800 700h-300v-200h300v-100h-300l-100 100v200l100 100h300v-100z" />
+<glyph unicode="&#xe195;" d="M600 1191q120 0 229.5 -47t188.5 -126t126 -188.5t47 -229.5t-47 -229.5t-126 -188.5t-188.5 -126t-229.5 -47t-229.5 47t-188.5 126t-126 188.5t-47 229.5t47 229.5t126 188.5t188.5 126t229.5 47zM600 1021q-114 0 -211 -56.5t-153.5 -153.5t-56.5 -211t56.5 -211 t153.5 -153.5t211 -56.5t211 56.5t153.5 153.5t56.5 211t-56.5 211t-153.5 153.5t-211 56.5zM800 700v-100l-50 -50l100 -100v-50h-100l-100 100h-150v-100h-100v400h300zM500 700v-100h200v100h-200z" />
+<glyph unicode="&#xe197;" d="M503 1089q110 0 200.5 -59.5t134.5 -156.5q44 14 90 14q120 0 205 -86.5t85 -207t-85 -207t-205 -86.5h-128v250q0 21 -14.5 35.5t-35.5 14.5h-300q-21 0 -35.5 -14.5t-14.5 -35.5v-250h-222q-80 0 -136 57.5t-56 136.5q0 69 43 122.5t108 67.5q-2 19 -2 37q0 100 49 185 t134 134t185 49zM525 500h150q10 0 17.5 -7.5t7.5 -17.5v-275h137q21 0 26 -11.5t-8 -27.5l-223 -244q-13 -16 -32 -16t-32 16l-223 244q-13 16 -8 27.5t26 11.5h137v275q0 10 7.5 17.5t17.5 7.5z" />
+<glyph unicode="&#xe198;" d="M502 1089q110 0 201 -59.5t135 -156.5q43 15 89 15q121 0 206 -86.5t86 -206.5q0 -99 -60 -181t-150 -110l-378 360q-13 16 -31.5 16t-31.5 -16l-381 -365h-9q-79 0 -135.5 57.5t-56.5 136.5q0 69 43 122.5t108 67.5q-2 19 -2 38q0 100 49 184.5t133.5 134t184.5 49.5z M632 467l223 -228q13 -16 8 -27.5t-26 -11.5h-137v-275q0 -10 -7.5 -17.5t-17.5 -7.5h-150q-10 0 -17.5 7.5t-7.5 17.5v275h-137q-21 0 -26 11.5t8 27.5q199 204 223 228q19 19 31.5 19t32.5 -19z" />
+<glyph unicode="&#xe199;" d="M700 100v100h400l-270 300h170l-270 300h170l-300 333l-300 -333h170l-270 -300h170l-270 -300h400v-100h-50q-21 0 -35.5 -14.5t-14.5 -35.5v-50h400v50q0 21 -14.5 35.5t-35.5 14.5h-50z" />
+<glyph unicode="&#xe200;" d="M600 1179q94 0 167.5 -56.5t99.5 -145.5q89 -6 150.5 -71.5t61.5 -155.5q0 -61 -29.5 -112.5t-79.5 -82.5q9 -29 9 -55q0 -74 -52.5 -126.5t-126.5 -52.5q-55 0 -100 30v-251q21 0 35.5 -14.5t14.5 -35.5v-50h-300v50q0 21 14.5 35.5t35.5 14.5v251q-45 -30 -100 -30 q-74 0 -126.5 52.5t-52.5 126.5q0 18 4 38q-47 21 -75.5 65t-28.5 97q0 74 52.5 126.5t126.5 52.5q5 0 23 -2q0 2 -1 10t-1 13q0 116 81.5 197.5t197.5 81.5z" />
+<glyph unicode="&#xe201;" d="M1010 1010q111 -111 150.5 -260.5t0 -299t-150.5 -260.5q-83 -83 -191.5 -126.5t-218.5 -43.5t-218.5 43.5t-191.5 126.5q-111 111 -150.5 260.5t0 299t150.5 260.5q83 83 191.5 126.5t218.5 43.5t218.5 -43.5t191.5 -126.5zM476 1065q-4 0 -8 -1q-121 -34 -209.5 -122.5 t-122.5 -209.5q-4 -12 2.5 -23t18.5 -14l36 -9q3 -1 7 -1q23 0 29 22q27 96 98 166q70 71 166 98q11 3 17.5 13.5t3.5 22.5l-9 35q-3 13 -14 19q-7 4 -15 4zM512 920q-4 0 -9 -2q-80 -24 -138.5 -82.5t-82.5 -138.5q-4 -13 2 -24t19 -14l34 -9q4 -1 8 -1q22 0 28 21 q18 58 58.5 98.5t97.5 58.5q12 3 18 13.5t3 21.5l-9 35q-3 12 -14 19q-7 4 -15 4zM719.5 719.5q-49.5 49.5 -119.5 49.5t-119.5 -49.5t-49.5 -119.5t49.5 -119.5t119.5 -49.5t119.5 49.5t49.5 119.5t-49.5 119.5zM855 551q-22 0 -28 -21q-18 -58 -58.5 -98.5t-98.5 -57.5 q-11 -4 -17 -14.5t-3 -21.5l9 -35q3 -12 14 -19q7 -4 15 -4q4 0 9 2q80 24 138.5 82.5t82.5 138.5q4 13 -2.5 24t-18.5 14l-34 9q-4 1 -8 1zM1000 515q-23 0 -29 -22q-27 -96 -98 -166q-70 -71 -166 -98q-11 -3 -17.5 -13.5t-3.5 -22.5l9 -35q3 -13 14 -19q7 -4 15 -4 q4 0 8 1q121 34 209.5 122.5t122.5 209.5q4 12 -2.5 23t-18.5 14l-36 9q-3 1 -7 1z" />
+<glyph unicode="&#xe202;" d="M700 800h300v-380h-180v200h-340v-200h-380v755q0 10 7.5 17.5t17.5 7.5h575v-400zM1000 900h-200v200zM700 300h162l-212 -212l-212 212h162v200h100v-200zM520 0h-395q-10 0 -17.5 7.5t-7.5 17.5v395zM1000 220v-195q0 -10 -7.5 -17.5t-17.5 -7.5h-195z" />
+<glyph unicode="&#xe203;" d="M700 800h300v-520l-350 350l-550 -550v1095q0 10 7.5 17.5t17.5 7.5h575v-400zM1000 900h-200v200zM862 200h-162v-200h-100v200h-162l212 212zM480 0h-355q-10 0 -17.5 7.5t-7.5 17.5v55h380v-80zM1000 80v-55q0 -10 -7.5 -17.5t-17.5 -7.5h-155v80h180z" />
+<glyph unicode="&#xe204;" d="M1162 800h-162v-200h100l100 -100h-300v300h-162l212 212zM200 800h200q27 0 40 -2t29.5 -10.5t23.5 -30t7 -57.5h300v-100h-600l-200 -350v450h100q0 36 7 57.5t23.5 30t29.5 10.5t40 2zM800 400h240l-240 -400h-800l300 500h500v-100z" />
+<glyph unicode="&#xe205;" d="M650 1100h100q21 0 35.5 -14.5t14.5 -35.5v-50h50q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-300q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5h50v50q0 21 14.5 35.5t35.5 14.5zM1000 850v150q41 0 70.5 -29.5t29.5 -70.5v-800 q0 -41 -29.5 -70.5t-70.5 -29.5h-600q-1 0 -20 4l246 246l-326 326v324q0 41 29.5 70.5t70.5 29.5v-150q0 -62 44 -106t106 -44h300q62 0 106 44t44 106zM412 250l-212 -212v162h-200v100h200v162z" />
+<glyph unicode="&#xe206;" d="M450 1100h100q21 0 35.5 -14.5t14.5 -35.5v-50h50q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-300q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5h50v50q0 21 14.5 35.5t35.5 14.5zM800 850v150q41 0 70.5 -29.5t29.5 -70.5v-500 h-200v-300h200q0 -36 -7 -57.5t-23.5 -30t-29.5 -10.5t-40 -2h-600q-41 0 -70.5 29.5t-29.5 70.5v800q0 41 29.5 70.5t70.5 29.5v-150q0 -62 44 -106t106 -44h300q62 0 106 44t44 106zM1212 250l-212 -212v162h-200v100h200v162z" />
+<glyph unicode="&#xe209;" d="M658 1197l637 -1104q23 -38 7 -65.5t-60 -27.5h-1276q-44 0 -60 27.5t7 65.5l637 1104q22 39 54 39t54 -39zM704 800h-208q-20 0 -32 -14.5t-8 -34.5l58 -302q4 -20 21.5 -34.5t37.5 -14.5h54q20 0 37.5 14.5t21.5 34.5l58 302q4 20 -8 34.5t-32 14.5zM500 300v-100h200 v100h-200z" />
+<glyph unicode="&#xe210;" d="M425 1100h250q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-250q-10 0 -17.5 7.5t-7.5 17.5v150q0 10 7.5 17.5t17.5 7.5zM425 800h250q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-250q-10 0 -17.5 7.5t-7.5 17.5v150q0 10 7.5 17.5 t17.5 7.5zM825 800h250q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-250q-10 0 -17.5 7.5t-7.5 17.5v150q0 10 7.5 17.5t17.5 7.5zM25 500h250q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-250q-10 0 -17.5 7.5t-7.5 17.5v150 q0 10 7.5 17.5t17.5 7.5zM425 500h250q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-250q-10 0 -17.5 7.5t-7.5 17.5v150q0 10 7.5 17.5t17.5 7.5zM825 500h250q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-250q-10 0 -17.5 7.5t-7.5 17.5 v150q0 10 7.5 17.5t17.5 7.5zM25 200h250q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-250q-10 0 -17.5 7.5t-7.5 17.5v150q0 10 7.5 17.5t17.5 7.5zM425 200h250q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-250q-10 0 -17.5 7.5 t-7.5 17.5v150q0 10 7.5 17.5t17.5 7.5zM825 200h250q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-250q-10 0 -17.5 7.5t-7.5 17.5v150q0 10 7.5 17.5t17.5 7.5z" />
+<glyph unicode="&#xe211;" d="M700 1200h100v-200h-100v-100h350q62 0 86.5 -39.5t-3.5 -94.5l-66 -132q-41 -83 -81 -134h-772q-40 51 -81 134l-66 132q-28 55 -3.5 94.5t86.5 39.5h350v100h-100v200h100v100h200v-100zM250 400h700q21 0 35.5 -14.5t14.5 -35.5t-14.5 -35.5t-35.5 -14.5h-12l137 -100 h-950l138 100h-13q-21 0 -35.5 14.5t-14.5 35.5t14.5 35.5t35.5 14.5zM50 100h1100q21 0 35.5 -14.5t14.5 -35.5v-50h-1200v50q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe212;" d="M600 1300q40 0 68.5 -29.5t28.5 -70.5h-194q0 41 28.5 70.5t68.5 29.5zM443 1100h314q18 -37 18 -75q0 -8 -3 -25h328q41 0 44.5 -16.5t-30.5 -38.5l-175 -145h-678l-178 145q-34 22 -29 38.5t46 16.5h328q-3 17 -3 25q0 38 18 75zM250 700h700q21 0 35.5 -14.5 t14.5 -35.5t-14.5 -35.5t-35.5 -14.5h-150v-200l275 -200h-950l275 200v200h-150q-21 0 -35.5 14.5t-14.5 35.5t14.5 35.5t35.5 14.5zM50 100h1100q21 0 35.5 -14.5t14.5 -35.5v-50h-1200v50q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe213;" d="M600 1181q75 0 128 -53t53 -128t-53 -128t-128 -53t-128 53t-53 128t53 128t128 53zM602 798h46q34 0 55.5 -28.5t21.5 -86.5q0 -76 39 -183h-324q39 107 39 183q0 58 21.5 86.5t56.5 28.5h45zM250 400h700q21 0 35.5 -14.5t14.5 -35.5t-14.5 -35.5t-35.5 -14.5h-13 l138 -100h-950l137 100h-12q-21 0 -35.5 14.5t-14.5 35.5t14.5 35.5t35.5 14.5zM50 100h1100q21 0 35.5 -14.5t14.5 -35.5v-50h-1200v50q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe214;" d="M600 1300q47 0 92.5 -53.5t71 -123t25.5 -123.5q0 -78 -55.5 -133.5t-133.5 -55.5t-133.5 55.5t-55.5 133.5q0 62 34 143l144 -143l111 111l-163 163q34 26 63 26zM602 798h46q34 0 55.5 -28.5t21.5 -86.5q0 -76 39 -183h-324q39 107 39 183q0 58 21.5 86.5t56.5 28.5h45 zM250 400h700q21 0 35.5 -14.5t14.5 -35.5t-14.5 -35.5t-35.5 -14.5h-13l138 -100h-950l137 100h-12q-21 0 -35.5 14.5t-14.5 35.5t14.5 35.5t35.5 14.5zM50 100h1100q21 0 35.5 -14.5t14.5 -35.5v-50h-1200v50q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe215;" d="M600 1200l300 -161v-139h-300q0 -57 18.5 -108t50 -91.5t63 -72t70 -67.5t57.5 -61h-530q-60 83 -90.5 177.5t-30.5 178.5t33 164.5t87.5 139.5t126 96.5t145.5 41.5v-98zM250 400h700q21 0 35.5 -14.5t14.5 -35.5t-14.5 -35.5t-35.5 -14.5h-13l138 -100h-950l137 100 h-12q-21 0 -35.5 14.5t-14.5 35.5t14.5 35.5t35.5 14.5zM50 100h1100q21 0 35.5 -14.5t14.5 -35.5v-50h-1200v50q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe216;" d="M600 1300q41 0 70.5 -29.5t29.5 -70.5v-78q46 -26 73 -72t27 -100v-50h-400v50q0 54 27 100t73 72v78q0 41 29.5 70.5t70.5 29.5zM400 800h400q54 0 100 -27t72 -73h-172v-100h200v-100h-200v-100h200v-100h-200v-100h200q0 -83 -58.5 -141.5t-141.5 -58.5h-400 q-83 0 -141.5 58.5t-58.5 141.5v400q0 83 58.5 141.5t141.5 58.5z" />
+<glyph unicode="&#xe218;" d="M150 1100h900q21 0 35.5 -14.5t14.5 -35.5v-500q0 -21 -14.5 -35.5t-35.5 -14.5h-900q-21 0 -35.5 14.5t-14.5 35.5v500q0 21 14.5 35.5t35.5 14.5zM125 400h950q10 0 17.5 -7.5t7.5 -17.5v-50q0 -10 -7.5 -17.5t-17.5 -7.5h-283l224 -224q13 -13 13 -31.5t-13 -32 t-31.5 -13.5t-31.5 13l-88 88h-524l-87 -88q-13 -13 -32 -13t-32 13.5t-13 32t13 31.5l224 224h-289q-10 0 -17.5 7.5t-7.5 17.5v50q0 10 7.5 17.5t17.5 7.5zM541 300l-100 -100h324l-100 100h-124z" />
+<glyph unicode="&#xe219;" d="M200 1100h800q83 0 141.5 -58.5t58.5 -141.5v-200h-100q0 41 -29.5 70.5t-70.5 29.5h-250q-41 0 -70.5 -29.5t-29.5 -70.5h-100q0 41 -29.5 70.5t-70.5 29.5h-250q-41 0 -70.5 -29.5t-29.5 -70.5h-100v200q0 83 58.5 141.5t141.5 58.5zM100 600h1000q41 0 70.5 -29.5 t29.5 -70.5v-300h-1200v300q0 41 29.5 70.5t70.5 29.5zM300 100v-50q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v50h200zM1100 100v-50q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v50h200z" />
+<glyph unicode="&#xe221;" d="M480 1165l682 -683q31 -31 31 -75.5t-31 -75.5l-131 -131h-481l-517 518q-32 31 -32 75.5t32 75.5l295 296q31 31 75.5 31t76.5 -31zM108 794l342 -342l303 304l-341 341zM250 100h800q21 0 35.5 -14.5t14.5 -35.5v-50h-900v50q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe223;" d="M1057 647l-189 506q-8 19 -27.5 33t-40.5 14h-400q-21 0 -40.5 -14t-27.5 -33l-189 -506q-8 -19 1.5 -33t30.5 -14h625v-150q0 -21 14.5 -35.5t35.5 -14.5t35.5 14.5t14.5 35.5v150h125q21 0 30.5 14t1.5 33zM897 0h-595v50q0 21 14.5 35.5t35.5 14.5h50v50 q0 21 14.5 35.5t35.5 14.5h48v300h200v-300h47q21 0 35.5 -14.5t14.5 -35.5v-50h50q21 0 35.5 -14.5t14.5 -35.5v-50z" />
+<glyph unicode="&#xe224;" d="M900 800h300v-575q0 -10 -7.5 -17.5t-17.5 -7.5h-375v591l-300 300v84q0 10 7.5 17.5t17.5 7.5h375v-400zM1200 900h-200v200zM400 600h300v-575q0 -10 -7.5 -17.5t-17.5 -7.5h-650q-10 0 -17.5 7.5t-7.5 17.5v950q0 10 7.5 17.5t17.5 7.5h375v-400zM700 700h-200v200z " />
+<glyph unicode="&#xe225;" d="M484 1095h195q75 0 146 -32.5t124 -86t89.5 -122.5t48.5 -142q18 -14 35 -20q31 -10 64.5 6.5t43.5 48.5q10 34 -15 71q-19 27 -9 43q5 8 12.5 11t19 -1t23.5 -16q41 -44 39 -105q-3 -63 -46 -106.5t-104 -43.5h-62q-7 -55 -35 -117t-56 -100l-39 -234q-3 -20 -20 -34.5 t-38 -14.5h-100q-21 0 -33 14.5t-9 34.5l12 70q-49 -14 -91 -14h-195q-24 0 -65 8l-11 -64q-3 -20 -20 -34.5t-38 -14.5h-100q-21 0 -33 14.5t-9 34.5l26 157q-84 74 -128 175l-159 53q-19 7 -33 26t-14 40v50q0 21 14.5 35.5t35.5 14.5h124q11 87 56 166l-111 95 q-16 14 -12.5 23.5t24.5 9.5h203q116 101 250 101zM675 1000h-250q-10 0 -17.5 -7.5t-7.5 -17.5v-50q0 -10 7.5 -17.5t17.5 -7.5h250q10 0 17.5 7.5t7.5 17.5v50q0 10 -7.5 17.5t-17.5 7.5z" />
+<glyph unicode="&#xe226;" d="M641 900l423 247q19 8 42 2.5t37 -21.5l32 -38q14 -15 12.5 -36t-17.5 -34l-139 -120h-390zM50 1100h106q67 0 103 -17t66 -71l102 -212h823q21 0 35.5 -14.5t14.5 -35.5v-50q0 -21 -14 -40t-33 -26l-737 -132q-23 -4 -40 6t-26 25q-42 67 -100 67h-300q-62 0 -106 44 t-44 106v200q0 62 44 106t106 44zM173 928h-80q-19 0 -28 -14t-9 -35v-56q0 -51 42 -51h134q16 0 21.5 8t5.5 24q0 11 -16 45t-27 51q-18 28 -43 28zM550 727q-32 0 -54.5 -22.5t-22.5 -54.5t22.5 -54.5t54.5 -22.5t54.5 22.5t22.5 54.5t-22.5 54.5t-54.5 22.5zM130 389 l152 130q18 19 34 24t31 -3.5t24.5 -17.5t25.5 -28q28 -35 50.5 -51t48.5 -13l63 5l48 -179q13 -61 -3.5 -97.5t-67.5 -79.5l-80 -69q-47 -40 -109 -35.5t-103 51.5l-130 151q-40 47 -35.5 109.5t51.5 102.5zM380 377l-102 -88q-31 -27 2 -65l37 -43q13 -15 27.5 -19.5 t31.5 6.5l61 53q19 16 14 49q-2 20 -12 56t-17 45q-11 12 -19 14t-23 -8z" />
+<glyph unicode="&#xe227;" d="M625 1200h150q10 0 17.5 -7.5t7.5 -17.5v-109q79 -33 131 -87.5t53 -128.5q1 -46 -15 -84.5t-39 -61t-46 -38t-39 -21.5l-17 -6q6 0 15 -1.5t35 -9t50 -17.5t53 -30t50 -45t35.5 -64t14.5 -84q0 -59 -11.5 -105.5t-28.5 -76.5t-44 -51t-49.5 -31.5t-54.5 -16t-49.5 -6.5 t-43.5 -1v-75q0 -10 -7.5 -17.5t-17.5 -7.5h-150q-10 0 -17.5 7.5t-7.5 17.5v75h-100v-75q0 -10 -7.5 -17.5t-17.5 -7.5h-150q-10 0 -17.5 7.5t-7.5 17.5v75h-175q-10 0 -17.5 7.5t-7.5 17.5v150q0 10 7.5 17.5t17.5 7.5h75v600h-75q-10 0 -17.5 7.5t-7.5 17.5v150 q0 10 7.5 17.5t17.5 7.5h175v75q0 10 7.5 17.5t17.5 7.5h150q10 0 17.5 -7.5t7.5 -17.5v-75h100v75q0 10 7.5 17.5t17.5 7.5zM400 900v-200h263q28 0 48.5 10.5t30 25t15 29t5.5 25.5l1 10q0 4 -0.5 11t-6 24t-15 30t-30 24t-48.5 11h-263zM400 500v-200h363q28 0 48.5 10.5 t30 25t15 29t5.5 25.5l1 10q0 4 -0.5 11t-6 24t-15 30t-30 24t-48.5 11h-363z" />
+<glyph unicode="&#xe230;" d="M212 1198h780q86 0 147 -61t61 -147v-416q0 -51 -18 -142.5t-36 -157.5l-18 -66q-29 -87 -93.5 -146.5t-146.5 -59.5h-572q-82 0 -147 59t-93 147q-8 28 -20 73t-32 143.5t-20 149.5v416q0 86 61 147t147 61zM600 1045q-70 0 -132.5 -11.5t-105.5 -30.5t-78.5 -41.5 t-57 -45t-36 -41t-20.5 -30.5l-6 -12l156 -243h560l156 243q-2 5 -6 12.5t-20 29.5t-36.5 42t-57 44.5t-79 42t-105 29.5t-132.5 12zM762 703h-157l195 261z" />
+<glyph unicode="&#xe231;" d="M475 1300h150q103 0 189 -86t86 -189v-500q0 -41 -42 -83t-83 -42h-450q-41 0 -83 42t-42 83v500q0 103 86 189t189 86zM700 300v-225q0 -21 -27 -48t-48 -27h-150q-21 0 -48 27t-27 48v225h300z" />
+<glyph unicode="&#xe232;" d="M475 1300h96q0 -150 89.5 -239.5t239.5 -89.5v-446q0 -41 -42 -83t-83 -42h-450q-41 0 -83 42t-42 83v500q0 103 86 189t189 86zM700 300v-225q0 -21 -27 -48t-48 -27h-150q-21 0 -48 27t-27 48v225h300z" />
+<glyph unicode="&#xe233;" d="M1294 767l-638 -283l-378 170l-78 -60v-224l100 -150v-199l-150 148l-150 -149v200l100 150v250q0 4 -0.5 10.5t0 9.5t1 8t3 8t6.5 6l47 40l-147 65l642 283zM1000 380l-350 -166l-350 166v147l350 -165l350 165v-147z" />
+<glyph unicode="&#xe234;" d="M250 800q62 0 106 -44t44 -106t-44 -106t-106 -44t-106 44t-44 106t44 106t106 44zM650 800q62 0 106 -44t44 -106t-44 -106t-106 -44t-106 44t-44 106t44 106t106 44zM1050 800q62 0 106 -44t44 -106t-44 -106t-106 -44t-106 44t-44 106t44 106t106 44z" />
+<glyph unicode="&#xe235;" d="M550 1100q62 0 106 -44t44 -106t-44 -106t-106 -44t-106 44t-44 106t44 106t106 44zM550 700q62 0 106 -44t44 -106t-44 -106t-106 -44t-106 44t-44 106t44 106t106 44zM550 300q62 0 106 -44t44 -106t-44 -106t-106 -44t-106 44t-44 106t44 106t106 44z" />
+<glyph unicode="&#xe236;" d="M125 1100h950q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-950q-10 0 -17.5 7.5t-7.5 17.5v150q0 10 7.5 17.5t17.5 7.5zM125 700h950q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-950q-10 0 -17.5 7.5t-7.5 17.5v150q0 10 7.5 17.5 t17.5 7.5zM125 300h950q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-950q-10 0 -17.5 7.5t-7.5 17.5v150q0 10 7.5 17.5t17.5 7.5z" />
+<glyph unicode="&#xe237;" d="M350 1200h500q162 0 256 -93.5t94 -256.5v-500q0 -165 -93.5 -257.5t-256.5 -92.5h-500q-165 0 -257.5 92.5t-92.5 257.5v500q0 165 92.5 257.5t257.5 92.5zM900 1000h-600q-41 0 -70.5 -29.5t-29.5 -70.5v-600q0 -41 29.5 -70.5t70.5 -29.5h600q41 0 70.5 29.5 t29.5 70.5v600q0 41 -29.5 70.5t-70.5 29.5zM350 900h500q21 0 35.5 -14.5t14.5 -35.5v-300q0 -21 -14.5 -35.5t-35.5 -14.5h-500q-21 0 -35.5 14.5t-14.5 35.5v300q0 21 14.5 35.5t35.5 14.5zM400 800v-200h400v200h-400z" />
+<glyph unicode="&#xe238;" d="M150 1100h1000q21 0 35.5 -14.5t14.5 -35.5t-14.5 -35.5t-35.5 -14.5h-50v-200h50q21 0 35.5 -14.5t14.5 -35.5t-14.5 -35.5t-35.5 -14.5h-50v-200h50q21 0 35.5 -14.5t14.5 -35.5t-14.5 -35.5t-35.5 -14.5h-50v-200h50q21 0 35.5 -14.5t14.5 -35.5t-14.5 -35.5 t-35.5 -14.5h-1000q-21 0 -35.5 14.5t-14.5 35.5t14.5 35.5t35.5 14.5h50v200h-50q-21 0 -35.5 14.5t-14.5 35.5t14.5 35.5t35.5 14.5h50v200h-50q-21 0 -35.5 14.5t-14.5 35.5t14.5 35.5t35.5 14.5h50v200h-50q-21 0 -35.5 14.5t-14.5 35.5t14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe239;" d="M650 1187q87 -67 118.5 -156t0 -178t-118.5 -155q-87 66 -118.5 155t0 178t118.5 156zM300 800q124 0 212 -88t88 -212q-124 0 -212 88t-88 212zM1000 800q0 -124 -88 -212t-212 -88q0 124 88 212t212 88zM300 500q124 0 212 -88t88 -212q-124 0 -212 88t-88 212z M1000 500q0 -124 -88 -212t-212 -88q0 124 88 212t212 88zM700 199v-144q0 -21 -14.5 -35.5t-35.5 -14.5t-35.5 14.5t-14.5 35.5v142q40 -4 43 -4q17 0 57 6z" />
+<glyph unicode="&#xe240;" d="M745 878l69 19q25 6 45 -12l298 -295q11 -11 15 -26.5t-2 -30.5q-5 -14 -18 -23.5t-28 -9.5h-8q1 0 1 -13q0 -29 -2 -56t-8.5 -62t-20 -63t-33 -53t-51 -39t-72.5 -14h-146q-184 0 -184 288q0 24 10 47q-20 4 -62 4t-63 -4q11 -24 11 -47q0 -288 -184 -288h-142 q-48 0 -84.5 21t-56 51t-32 71.5t-16 75t-3.5 68.5q0 13 2 13h-7q-15 0 -27.5 9.5t-18.5 23.5q-6 15 -2 30.5t15 25.5l298 296q20 18 46 11l76 -19q20 -5 30.5 -22.5t5.5 -37.5t-22.5 -31t-37.5 -5l-51 12l-182 -193h891l-182 193l-44 -12q-20 -5 -37.5 6t-22.5 31t6 37.5 t31 22.5z" />
+<glyph unicode="&#xe241;" d="M1200 900h-50q0 21 -4 37t-9.5 26.5t-18 17.5t-22 11t-28.5 5.5t-31 2t-37 0.5h-200v-850q0 -22 25 -34.5t50 -13.5l25 -2v-100h-400v100q4 0 11 0.5t24 3t30 7t24 15t11 24.5v850h-200q-25 0 -37 -0.5t-31 -2t-28.5 -5.5t-22 -11t-18 -17.5t-9.5 -26.5t-4 -37h-50v300 h1000v-300zM500 450h-25q0 15 -4 24.5t-9 14.5t-17 7.5t-20 3t-25 0.5h-100v-425q0 -11 12.5 -17.5t25.5 -7.5h12v-50h-200v50q50 0 50 25v425h-100q-17 0 -25 -0.5t-20 -3t-17 -7.5t-9 -14.5t-4 -24.5h-25v150h500v-150z" />
+<glyph unicode="&#xe242;" d="M1000 300v50q-25 0 -55 32q-14 14 -25 31t-16 27l-4 11l-289 747h-69l-300 -754q-18 -35 -39 -56q-9 -9 -24.5 -18.5t-26.5 -14.5l-11 -5v-50h273v50q-49 0 -78.5 21.5t-11.5 67.5l69 176h293l61 -166q13 -34 -3.5 -66.5t-55.5 -32.5v-50h312zM412 691l134 342l121 -342 h-255zM1100 150v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-1000q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5h1000q21 0 35.5 -14.5t14.5 -35.5z" />
+<glyph unicode="&#xe243;" d="M50 1200h1100q21 0 35.5 -14.5t14.5 -35.5v-1100q0 -21 -14.5 -35.5t-35.5 -14.5h-1100q-21 0 -35.5 14.5t-14.5 35.5v1100q0 21 14.5 35.5t35.5 14.5zM611 1118h-70q-13 0 -18 -12l-299 -753q-17 -32 -35 -51q-18 -18 -56 -34q-12 -5 -12 -18v-50q0 -8 5.5 -14t14.5 -6 h273q8 0 14 6t6 14v50q0 8 -6 14t-14 6q-55 0 -71 23q-10 14 0 39l63 163h266l57 -153q11 -31 -6 -55q-12 -17 -36 -17q-8 0 -14 -6t-6 -14v-50q0 -8 6 -14t14 -6h313q8 0 14 6t6 14v50q0 7 -5.5 13t-13.5 7q-17 0 -42 25q-25 27 -40 63h-1l-288 748q-5 12 -19 12zM639 611 h-197l103 264z" />
+<glyph unicode="&#xe244;" d="M1200 1100h-1200v100h1200v-100zM50 1000h400q21 0 35.5 -14.5t14.5 -35.5v-900q0 -21 -14.5 -35.5t-35.5 -14.5h-400q-21 0 -35.5 14.5t-14.5 35.5v900q0 21 14.5 35.5t35.5 14.5zM650 1000h400q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-400 q-21 0 -35.5 14.5t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5zM700 900v-300h300v300h-300z" />
+<glyph unicode="&#xe245;" d="M50 1200h400q21 0 35.5 -14.5t14.5 -35.5v-900q0 -21 -14.5 -35.5t-35.5 -14.5h-400q-21 0 -35.5 14.5t-14.5 35.5v900q0 21 14.5 35.5t35.5 14.5zM650 700h400q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-400q-21 0 -35.5 14.5t-14.5 35.5v400 q0 21 14.5 35.5t35.5 14.5zM700 600v-300h300v300h-300zM1200 0h-1200v100h1200v-100z" />
+<glyph unicode="&#xe246;" d="M50 1000h400q21 0 35.5 -14.5t14.5 -35.5v-350h100v150q0 21 14.5 35.5t35.5 14.5h400q21 0 35.5 -14.5t14.5 -35.5v-150h100v-100h-100v-150q0 -21 -14.5 -35.5t-35.5 -14.5h-400q-21 0 -35.5 14.5t-14.5 35.5v150h-100v-350q0 -21 -14.5 -35.5t-35.5 -14.5h-400 q-21 0 -35.5 14.5t-14.5 35.5v800q0 21 14.5 35.5t35.5 14.5zM700 700v-300h300v300h-300z" />
+<glyph unicode="&#xe247;" d="M100 0h-100v1200h100v-1200zM250 1100h400q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-400q-21 0 -35.5 14.5t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5zM300 1000v-300h300v300h-300zM250 500h900q21 0 35.5 -14.5t14.5 -35.5v-400 q0 -21 -14.5 -35.5t-35.5 -14.5h-900q-21 0 -35.5 14.5t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe248;" d="M600 1100h150q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-150v-100h450q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-900q-21 0 -35.5 14.5t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5h350v100h-150q-21 0 -35.5 14.5 t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5h150v100h100v-100zM400 1000v-300h300v300h-300z" />
+<glyph unicode="&#xe249;" d="M1200 0h-100v1200h100v-1200zM550 1100h400q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-400q-21 0 -35.5 14.5t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5zM600 1000v-300h300v300h-300zM50 500h900q21 0 35.5 -14.5t14.5 -35.5v-400 q0 -21 -14.5 -35.5t-35.5 -14.5h-900q-21 0 -35.5 14.5t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe250;" d="M865 565l-494 -494q-23 -23 -41 -23q-14 0 -22 13.5t-8 38.5v1000q0 25 8 38.5t22 13.5q18 0 41 -23l494 -494q14 -14 14 -35t-14 -35z" />
+<glyph unicode="&#xe251;" d="M335 635l494 494q29 29 50 20.5t21 -49.5v-1000q0 -41 -21 -49.5t-50 20.5l-494 494q-14 14 -14 35t14 35z" />
+<glyph unicode="&#xe252;" d="M100 900h1000q41 0 49.5 -21t-20.5 -50l-494 -494q-14 -14 -35 -14t-35 14l-494 494q-29 29 -20.5 50t49.5 21z" />
+<glyph unicode="&#xe253;" d="M635 865l494 -494q29 -29 20.5 -50t-49.5 -21h-1000q-41 0 -49.5 21t20.5 50l494 494q14 14 35 14t35 -14z" />
+<glyph unicode="&#xe254;" d="M700 741v-182l-692 -323v221l413 193l-413 193v221zM1200 0h-800v200h800v-200z" />
+<glyph unicode="&#xe255;" d="M1200 900h-200v-100h200v-100h-300v300h200v100h-200v100h300v-300zM0 700h50q0 21 4 37t9.5 26.5t18 17.5t22 11t28.5 5.5t31 2t37 0.5h100v-550q0 -22 -25 -34.5t-50 -13.5l-25 -2v-100h400v100q-4 0 -11 0.5t-24 3t-30 7t-24 15t-11 24.5v550h100q25 0 37 -0.5t31 -2 t28.5 -5.5t22 -11t18 -17.5t9.5 -26.5t4 -37h50v300h-800v-300z" />
+<glyph unicode="&#xe256;" d="M800 700h-50q0 21 -4 37t-9.5 26.5t-18 17.5t-22 11t-28.5 5.5t-31 2t-37 0.5h-100v-550q0 -22 25 -34.5t50 -14.5l25 -1v-100h-400v100q4 0 11 0.5t24 3t30 7t24 15t11 24.5v550h-100q-25 0 -37 -0.5t-31 -2t-28.5 -5.5t-22 -11t-18 -17.5t-9.5 -26.5t-4 -37h-50v300 h800v-300zM1100 200h-200v-100h200v-100h-300v300h200v100h-200v100h300v-300z" />
+<glyph unicode="&#xe257;" d="M701 1098h160q16 0 21 -11t-7 -23l-464 -464l464 -464q12 -12 7 -23t-21 -11h-160q-13 0 -23 9l-471 471q-7 8 -7 18t7 18l471 471q10 9 23 9z" />
+<glyph unicode="&#xe258;" d="M339 1098h160q13 0 23 -9l471 -471q7 -8 7 -18t-7 -18l-471 -471q-10 -9 -23 -9h-160q-16 0 -21 11t7 23l464 464l-464 464q-12 12 -7 23t21 11z" />
+<glyph unicode="&#xe259;" d="M1087 882q11 -5 11 -21v-160q0 -13 -9 -23l-471 -471q-8 -7 -18 -7t-18 7l-471 471q-9 10 -9 23v160q0 16 11 21t23 -7l464 -464l464 464q12 12 23 7z" />
+<glyph unicode="&#xe260;" d="M618 993l471 -471q9 -10 9 -23v-160q0 -16 -11 -21t-23 7l-464 464l-464 -464q-12 -12 -23 -7t-11 21v160q0 13 9 23l471 471q8 7 18 7t18 -7z" />
+<glyph unicode="&#xf8ff;" d="M1000 1200q0 -124 -88 -212t-212 -88q0 124 88 212t212 88zM450 1000h100q21 0 40 -14t26 -33l79 -194q5 1 16 3q34 6 54 9.5t60 7t65.5 1t61 -10t56.5 -23t42.5 -42t29 -64t5 -92t-19.5 -121.5q-1 -7 -3 -19.5t-11 -50t-20.5 -73t-32.5 -81.5t-46.5 -83t-64 -70 t-82.5 -50q-13 -5 -42 -5t-65.5 2.5t-47.5 2.5q-14 0 -49.5 -3.5t-63 -3.5t-43.5 7q-57 25 -104.5 78.5t-75 111.5t-46.5 112t-26 90l-7 35q-15 63 -18 115t4.5 88.5t26 64t39.5 43.5t52 25.5t58.5 13t62.5 2t59.5 -4.5t55.5 -8l-147 192q-12 18 -5.5 30t27.5 12z" />
+<glyph unicode="&#x1f511;" d="M250 1200h600q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-150v-500l-255 -178q-19 -9 -32 -1t-13 29v650h-150q-21 0 -35.5 14.5t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5zM400 1100v-100h300v100h-300z" />
+<glyph unicode="&#x1f6aa;" d="M250 1200h750q39 0 69.5 -40.5t30.5 -84.5v-933l-700 -117v950l600 125h-700v-1000h-100v1025q0 23 15.5 49t34.5 26zM500 525v-100l100 20v100z" />
+</font>
+</defs></svg> \ No newline at end of file
diff --git a/public_html/data/fonts/glyphicons-halflings-regular.ttf b/public_html/data/fonts/glyphicons-halflings-regular.ttf
new file mode 100644
index 000000000..1413fc609
--- /dev/null
+++ b/public_html/data/fonts/glyphicons-halflings-regular.ttf
Binary files differ
diff --git a/public_html/data/fonts/glyphicons-halflings-regular.woff b/public_html/data/fonts/glyphicons-halflings-regular.woff
new file mode 100644
index 000000000..9e612858f
--- /dev/null
+++ b/public_html/data/fonts/glyphicons-halflings-regular.woff
Binary files differ
diff --git a/public_html/data/fonts/glyphicons-halflings-regular.woff2 b/public_html/data/fonts/glyphicons-halflings-regular.woff2
new file mode 100644
index 000000000..64539b54c
--- /dev/null
+++ b/public_html/data/fonts/glyphicons-halflings-regular.woff2
Binary files differ
diff --git a/public_html/data/img/asc.gif b/public_html/data/img/asc.gif
new file mode 100644
index 000000000..74157867f
--- /dev/null
+++ b/public_html/data/img/asc.gif
Binary files differ
diff --git a/public_html/data/img/bg.gif b/public_html/data/img/bg.gif
new file mode 100644
index 000000000..fac668fcf
--- /dev/null
+++ b/public_html/data/img/bg.gif
Binary files differ
diff --git a/public_html/data/img/colorbox/loading.gif b/public_html/data/img/colorbox/loading.gif
new file mode 100644
index 000000000..a32df5c08
--- /dev/null
+++ b/public_html/data/img/colorbox/loading.gif
Binary files differ
diff --git a/public_html/data/img/desc.gif b/public_html/data/img/desc.gif
new file mode 100644
index 000000000..3b30b3c58
--- /dev/null
+++ b/public_html/data/img/desc.gif
Binary files differ
diff --git a/public_html/data/img/glyphicons-halflings-white.png b/public_html/data/img/glyphicons-halflings-white.png
new file mode 100644
index 000000000..3bf6484a2
--- /dev/null
+++ b/public_html/data/img/glyphicons-halflings-white.png
Binary files differ
diff --git a/public_html/data/img/glyphicons-halflings.png b/public_html/data/img/glyphicons-halflings.png
new file mode 100644
index 000000000..a99699932
--- /dev/null
+++ b/public_html/data/img/glyphicons-halflings.png
Binary files differ
diff --git a/public_html/data/js/application.js b/public_html/data/js/application.js
new file mode 100644
index 000000000..d212ce04c
--- /dev/null
+++ b/public_html/data/js/application.js
@@ -0,0 +1,130 @@
+(function () {
+'use strict';
+define(
+ [
+ 'require',
+ 'util',
+ 'lexer-input',
+ 'tabwidth-input',
+ 'thumbnail-view',
+ 'multipaste',
+ 'uploader',
+ 'tablesorter',
+ 'jquery',
+ 'jquery.lazyload',
+ 'bootstrap',
+ 'jquery.checkboxes',
+ ],
+ function (
+ require,
+ Util,
+ LexerInput,
+ TabwidthInput,
+ ThumbnailView,
+ Multipaste,
+ Uploader,
+ TableSorter,
+ $
+ ) {
+ var ui = {
+ lazyLoadingImages: 'img.lazyload'
+ };
+
+ var App = {
+ // Gets called for every request (before page load)
+ initialize: function () {
+ this.setupLineHighlight();
+ },
+
+ /*
+ * Gets called for every request after page load
+ * config contains app config attributes passed from php
+ */
+ onPageLoaded: function () {
+ Util.highlightLineFromHash();
+ Util.setTabwidthFromLocalStorage();
+ TabwidthInput.initialize();
+ LexerInput.initialize();
+ ThumbnailView.initialize();
+ Multipaste.initialize();
+ Uploader.initialize();
+ TableSorter.initialize();
+ this.configureTooltips();
+ this.setupHistoryPopovers();
+ this.setupToggleSelectAllEvent();
+ this.setupLineWrapToggle();
+ this.setupLazyLoadingImages();
+ this.setupTableRangeSelect();
+ this.setupAsciinema();
+ this.focusLoginFormOnClick();
+ },
+
+ setupTableRangeSelect: function () {
+ $('#upload_history').checkboxes('range', true);
+ },
+
+ setupLineHighlight: function () {
+ $(window).on('hashchange', Util.highlightLineFromHash);
+ },
+
+ configureTooltips: function () {
+ $('[rel="tooltip"]').tooltip({
+ placement: 'bottom',
+ container: 'body',
+ });
+ },
+
+ setupHistoryPopovers: function () {
+ $('#upload_history a').popover({
+ trigger: 'hover',
+ placement: 'bottom',
+ html: true,
+ viewport: '#upload_history',
+ template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><pre class="popover-content"></pre></div>'
+ });
+ },
+
+ setupToggleSelectAllEvent: function () {
+ $('#history-all').on('click', function(event) {
+ // Suppress click event on table heading
+ event.stopImmediatePropagation();
+ });
+ $('#history-all').on('change', function(event) {
+ var checked = $(event.target).prop('checked');
+ $('.delete-history').prop('checked', checked);
+ });
+ },
+
+ setupLineWrapToggle: function () {
+ var linesWrapped = localStorage.getItem('lines_wrapped') || 'true';
+ Util.setLineWrap(linesWrapped === 'true');
+
+ $('.linewrap-toggle').on('click', _.bind(Util.toggleLineWrap, Util));
+ },
+
+ setupLazyLoadingImages: function () {
+ if ($(ui.lazyLoadingImages).length > 0) {
+ $(ui.lazyLoadingImages).lazyload({treshold: 200});
+ }
+ },
+
+ setupAsciinema: function () {
+ _.each($('.asciinema_player'), function (item) {
+ item = $(item);
+ asciinema.player.js.CreatePlayer(item.attr("id"), item.data("url"));
+ });
+ },
+
+ focusLoginFormOnClick: function () {
+ $('.dropdown-toggle').on('click', function (e) {
+ setTimeout(function() {
+ $(e.target).parent().find(".dropdown-menu input.form-control").first().focus();
+ }, 0);
+ });
+ },
+ };
+
+ return App;
+ }
+);
+})();
diff --git a/public_html/data/js/lexer-input.js b/public_html/data/js/lexer-input.js
new file mode 100644
index 000000000..02dda36dd
--- /dev/null
+++ b/public_html/data/js/lexer-input.js
@@ -0,0 +1,48 @@
+(function () {
+'use strict';
+define(['util', 'underscore', 'jquery', 'jquery-ui'], function (Util, _, $) {
+ var PrivateFunctions = {
+ switchLexer: function (lexer, baseUrl) {
+ var url = baseUrl + '/' + Util.fixedEncodeURIComponent(lexer);
+ window.location = url;
+ },
+ lexerSelected: function (event, ui) {
+ event.preventDefault();
+ var baseUrl = $(event.target).data('base-url');
+ this.switchLexer(ui.item.value, baseUrl);
+ },
+ setupAutocomplete: function () {
+ var lexerSource = [];
+ for (var key in appConfig.lexers) {
+ lexerSource.push({ label: appConfig.lexers[key], value: key });
+ }
+
+ $('.lexer-form input').autocomplete({
+ source: lexerSource,
+ select: _.bind(PrivateFunctions.lexerSelected, PrivateFunctions)
+ });
+ },
+ setupEvents: function () {
+ $('.lexer-form').on('submit', _.bind(function (event) {
+ event.preventDefault();
+ var input = $(event.target).find('input');
+ var lexer = input.val();
+ var baseUrl = input.data('base-url');
+ this.switchLexer(lexer, baseUrl);
+ }, this));
+
+ $('.lexer-toggle').on('click', _.bind(function(event) {
+ Util.focusDropdownInput(event.target);
+ }, Util));
+ }
+ };
+ var LexerInput = {
+ initialize: function () {
+ PrivateFunctions.setupAutocomplete();
+ PrivateFunctions.setupEvents();
+ }
+ };
+
+ return LexerInput;
+});
+})();
diff --git a/public_html/data/js/main.js b/public_html/data/js/main.js
new file mode 100644
index 000000000..85ba0b389
--- /dev/null
+++ b/public_html/data/js/main.js
@@ -0,0 +1,30 @@
+(function () {
+'use strict';
+requirejs.config({
+ shim: {
+ 'jquery-ui': ['jquery'],
+ 'bootstrap': ['jquery'],
+ 'jquery.tablesorter': ['jquery'],
+ 'jquery.lazyload': ['jquery'],
+ 'jquery.colorbox': ['jquery'],
+ 'jquery.checkboxes': ['jquery']
+ },
+ paths: {
+ 'jquery': 'vendor/jquery-2.0.3.min',
+ 'jquery-ui': 'vendor/jquery-ui.min',
+ 'bootstrap': 'vendor/bootstrap.min',
+ 'jquery.tablesorter': 'vendor/jquery.tablesorter.min',
+ 'jquery.lazyload': 'vendor/jquery.lazyload',
+ 'jquery.colorbox': 'vendor/jquery.colorbox',
+ 'jquery.checkboxes': 'vendor/jquery.checkboxes-1.0.6.min',
+ 'underscore': 'vendor/underscore'
+ }
+});
+
+require(['application', 'jquery'], function (App, $) {
+ App.initialize();
+ $(document).ready(function () {
+ App.onPageLoaded();
+ });
+});
+})();
diff --git a/public_html/data/js/multipaste.js b/public_html/data/js/multipaste.js
new file mode 100644
index 000000000..21434ab0d
--- /dev/null
+++ b/public_html/data/js/multipaste.js
@@ -0,0 +1,86 @@
+(function () {
+'use strict';
+define(['underscore', 'util', 'jquery', 'jquery-ui'], function (_, Util, $) {
+ var ui = {
+ itemsContainer: ".multipasteQueue .items",
+ queueDeleteButton: ".multipaste_queue_delete",
+ submitButton: ".multipasteQueue button[type=submit]",
+ itemImages: ".multipasteQueue .items img",
+ form: ".multipasteQueue form",
+ csrfToken: "form input[name=csrf_test_name]",
+ ajaxFeedback: "form .ajaxFeedback",
+ };
+
+ var timer = 0;
+
+ var PrivateFunctions = {
+ setupQueueDeleteButtons: function() {
+ $(ui.queueDeleteButton).on('click', function(event) {
+ event.stopImmediatePropagation();
+ var id = $(event.target).data('id');
+ $(event.target).parent().remove();
+ PrivateFunctions.saveQueue();
+ });
+ },
+ setupTooltips: function() {
+ $(ui.itemImages).popover({
+ trigger: 'hover',
+ placement: 'auto bottom',
+ html: true
+ });
+ },
+ setupButtons: function() {
+ this.setupQueueDeleteButtons();
+ },
+ setupSortable: function() {
+ $(ui.itemsContainer).sortable({
+ revert: 100,
+ placeholder: "ui-state-highlight",
+ tolerance: "pointer",
+ stop: function(e, u) {
+ u.item.find("img").first().popover("show");
+ },
+ start: function(e, u) {
+ u.item.find("img").first().popover("show");
+ },
+ update: function(e, u) {
+ PrivateFunctions.saveQueue();
+ },
+ });
+
+ $(ui.itemsContainer).disableSelection();
+ },
+ saveQueue: function() {
+ var queue = $(ui.itemsContainer).sortable("toArray", {attribute: "data-id"});
+ console.log("queue changed ", queue);
+ clearTimeout(timer);
+ timer = setTimeout(function() {
+ var url = $(ui.form).data("ajax_url");
+ var csrf_token = $(ui.csrfToken).attr("value");
+ $(ui.ajaxFeedback).show();
+ $.ajax({
+ method: "POST",
+ url: url,
+ data: {
+ csrf_test_name: csrf_token,
+ ids: queue
+ },
+ complete: function() {
+ $(ui.ajaxFeedback).hide();
+ },
+ });
+ }, 2000);
+ },
+ };
+
+ var Multipaste = {
+ initialize: function () {
+ PrivateFunctions.setupButtons();
+ PrivateFunctions.setupSortable();
+ PrivateFunctions.setupTooltips();
+ },
+ };
+
+ return Multipaste;
+});
+})();
diff --git a/public_html/data/js/tablesorter.js b/public_html/data/js/tablesorter.js
new file mode 100644
index 000000000..d500f2ade
--- /dev/null
+++ b/public_html/data/js/tablesorter.js
@@ -0,0 +1,82 @@
+(function () {
+'use strict';
+define(['jquery', 'jquery.tablesorter'], function ($) {
+ var PrivateFunctions = {
+ setupParser: function () {
+ // source: https://projects.archlinux.org/archweb.git/tree/sitestatic/archweb.js
+ $.tablesorter.addParser({
+ id: 'filesize',
+ re: /^(\d+(?:\.\d+)?)(bytes?|[KMGTPEZY]i?B|B)$/,
+ is: function(s) {
+ return this.re.test(s);
+ },
+ format: function(s) {
+ var matches = this.re.exec(s);
+ if (!matches) {
+ return 0;
+ }
+ var size = parseFloat(matches[1]),
+ suffix = matches[2];
+
+ switch(suffix) {
+ /* intentional fall-through at each level */
+ case 'YB':
+ case 'YiB':
+ size *= 1024;
+ case 'ZB':
+ case 'ZiB':
+ size *= 1024;
+ case 'EB':
+ case 'EiB':
+ size *= 1024;
+ case 'PB':
+ case 'PiB':
+ size *= 1024;
+ case 'TB':
+ case 'TiB':
+ size *= 1024;
+ case 'GB':
+ case 'GiB':
+ size *= 1024;
+ case 'MB':
+ case 'MiB':
+ size *= 1024;
+ case 'KB':
+ case 'KiB':
+ size *= 1024;
+ }
+ return size;
+ },
+ type: 'numeric'
+ });
+ },
+
+ textExtraction: function (node) {
+ var attr = $(node).attr('data-sort-value');
+ if (!_.isUndefined(attr) && attr !== false) {
+ var intAttr = parseInt(attr);
+ if (!_.isNaN(intAttr)) {
+ return intAttr;
+ }
+ return attr;
+ }
+ return $(node).text();
+ },
+
+ setupTableSorter: function () {
+ $(".tablesorter").tablesorter({
+ textExtraction: this.textExtraction
+ });
+ }
+ };
+
+ var TableSorter = {
+ initialize: function () {
+ PrivateFunctions.setupParser();
+ PrivateFunctions.setupTableSorter();
+ }
+ };
+
+ return TableSorter;
+});
+})();
diff --git a/public_html/data/js/tabwidth-input.js b/public_html/data/js/tabwidth-input.js
new file mode 100644
index 000000000..9cc37516d
--- /dev/null
+++ b/public_html/data/js/tabwidth-input.js
@@ -0,0 +1,37 @@
+(function () {
+'use strict';
+define(['jquery', 'underscore', 'util'], function ($, _, Util) {
+ var PrivateFunctions = {
+ setupEvents: function () {
+ $('.tabwidth-toggle').on('click', _.bind(function (event) {
+ Util.focusDropdownInput(event.target);
+ }, Util));
+
+ $('form.tabwidth-form input').on('click', function (event) {
+ // Suppress blur event on dropdown toggle
+ event.stopImmediatePropagation();
+ });
+
+ $('form.tabwidth-form').on('submit', function (event) {
+ var value = $(event.target).find('input').val();
+ Util.setTabwidth(value);
+ $(event.target).parents('.open').removeClass('open');
+ event.preventDefault();
+ });
+
+ $('form.tabwidth-form input').on('change', function (event) {
+ var value = $(event.target).val();
+ Util.setTabwidth(value);
+ event.preventDefault();
+ });
+ }
+ };
+ var TabwidthInput = {
+ initialize: function () {
+ PrivateFunctions.setupEvents();
+ }
+ };
+
+ return TabwidthInput;
+});
+})();
diff --git a/public_html/data/js/thumbnail-view.js b/public_html/data/js/thumbnail-view.js
new file mode 100644
index 000000000..eb9ee33ce
--- /dev/null
+++ b/public_html/data/js/thumbnail-view.js
@@ -0,0 +1,148 @@
+(function () {
+'use strict';
+define(['jquery', 'underscore', 'multipaste', 'jquery.colorbox'], function ($, _, Multipaste) {
+ var ui = {
+ thumbnailLinks: '.upload_thumbnails a',
+ formButtons: '#submit_form button[type=submit]',
+ submitForm: '#submit_form',
+ markedThumbnails: '.upload_thumbnails .marked',
+ colorbox: '.colorbox',
+ thumbnails: '.upload_thumbnails',
+ toggleSelectModeButton: '#toggle_select_mode',
+ };
+
+ var PrivateFunctions = {
+ inSelectMode: false,
+
+ setupEvents: function () {
+ $(ui.toggleSelectModeButton).on('click', _.bind(this.toggleSelectMode, this));
+ $(ui.thumbnailLinks).on('click', _.bind(this.thumbnailClick, this));
+ $(window).resize(_.bind(this.onResize, this));
+ },
+
+ browserHandlesImageOrientation: function () {
+ var testImg = $('<img>');
+ $('body').append(testImg);
+ var style = window.getComputedStyle(testImg.get(0));
+ var result = style.getPropertyValue('image-orientation')
+ console.log('Browser default image-orientation: ', result)
+ testImg.remove();
+ return result == 'from-image';
+ },
+
+ setupColorbox: function () {
+ var browserHandlesImageOrientation = PrivateFunctions.browserHandlesImageOrientation();
+
+ $(ui.colorbox).colorbox({
+ transistion: "none",
+ speed: 0,
+ initialWidth: "100%",
+ initialHeight: "100%",
+ photo: true,
+ retinaImage: true,
+ maxHeight: "100%",
+ maxWidth: "100%",
+ current: 'Image {current} of {total}. Use h/l or right/left arrow keys or these buttons:',
+ next: '<span class="glyphicon glyphicon-chevron-right"></span>',
+ previous: '<span class="glyphicon glyphicon-chevron-left"></span>',
+ close: '<span class="glyphicon glyphicon-remove"></span>',
+ loop: false,
+ orientation: function() {
+ if (browserHandlesImageOrientation) {
+ return 1;
+ } else {
+ return $(this).data('orientation');
+ }
+ },
+ });
+ },
+
+ removeColorbox: function () {
+ $.colorbox.remove();
+ },
+
+ setupPopovers: function () {
+ $(ui.thumbnailLinks).popover({
+ trigger: 'hover',
+ placement: 'auto bottom',
+ html: true
+ });
+ },
+
+ toggleSelectMode: function () {
+ if (this.inSelectMode) {
+ $(ui.formButtons).hide();
+ $(ui.submitForm).find('input').remove();
+ $(ui.markedThumbnails).removeClass('marked');
+ this.setupColorbox();
+ } else {
+ $(ui.formButtons).show();
+ this.removeColorbox();
+ }
+ this.inSelectMode = !this.inSelectMode;
+ },
+
+ submitInput: function (id) {
+ return $('<input>').attr({
+ type: 'hidden',
+ name: 'ids[' + id + ']',
+ value: id,
+ id: 'submit_' +id
+ });
+ },
+
+ thumbnailClick: function (event) {
+ if (!this.inSelectMode) { return; }
+ event.preventDefault();
+ var id = $(event.target).closest('a').data('id');
+
+ var submitInput = $(ui.submitForm).find('input#submit_' + id);
+
+ if (submitInput.length === 0) {
+ $(ui.submitForm).append(this.submitInput(id));
+ } else {
+ submitInput.remove();
+ }
+ $(event.target).closest('a').toggleClass('marked');
+ },
+
+ needMultipleLines: function (thumbnailContainer) {
+ var containerWidth, thumbsWidth, thumbs, thumbsCount;
+ containerWidth = thumbnailContainer.parent().width();
+ thumbs = thumbnailContainer.find('a');
+ thumbsCount = thumbs.length;
+ thumbsWidth = thumbs.outerWidth(true) * thumbsCount;
+
+ return containerWidth < thumbsWidth;
+ },
+
+ thumbnailsWidth: function (thumbnailContainer) {
+ var containerWidth, thumbs, thumbWidth;
+ containerWidth = thumbnailContainer.parent().width();
+ thumbs = thumbnailContainer.find('a');
+ thumbWidth = thumbs.outerWidth(true);
+ return containerWidth - (containerWidth % thumbWidth);
+ },
+
+ onResize: function () {
+ _.each($(ui.thumbnails), function (thumbnailContainer) {
+ thumbnailContainer = $(thumbnailContainer);
+ var margin = this.needMultipleLines(thumbnailContainer) ? 'auto' : '0';
+ thumbnailContainer.css('margin-left', margin);
+ thumbnailContainer.width(this.thumbnailsWidth(thumbnailContainer));
+ }, this);
+ }
+ };
+
+ var ThumbnailView = {
+ initialize: function () {
+ PrivateFunctions.setupEvents();
+ PrivateFunctions.onResize();
+ PrivateFunctions.setupColorbox();
+ PrivateFunctions.setupPopovers();
+ }
+ };
+
+ return ThumbnailView;
+});
+})();
diff --git a/public_html/data/js/uploader.js b/public_html/data/js/uploader.js
new file mode 100644
index 000000000..0eed3334f
--- /dev/null
+++ b/public_html/data/js/uploader.js
@@ -0,0 +1,133 @@
+(function () {
+'use strict';
+define(['jquery', 'underscore'], function ($, _) {
+ var ui = {
+ uploadButton: '#upload_button',
+ uploadInputs: 'input.file-upload',
+ textAreas: '#textboxes textarea.text-upload',
+ filenameInputs: '#textboxes input[name^=filename]',
+ textAreaTabsContainer: '#textboxes .tab-content',
+ textAreaTabs: '#textboxes .tab-content .tab-pane',
+ tabNavigation: '#textboxes ul.nav',
+ tabPane: '.tab-pane',
+ panelBody: '.panel-body'
+ };
+ var PrivateFunctions = {
+ filesForInput: function (input, callback) {
+ var files = $(input).prop('files');
+ for (var i = 0; i < files.length; i++) {
+ callback(files[i]);
+ }
+ },
+
+ filesForInputs: function (callback) {
+ _.each($(ui.uploadInputs), function (input) {
+ this.filesForInput(input, callback);
+ }, this);
+ },
+
+ checkFileUpload: function (event) {
+ var totalSize = 0;
+ var filesCount = 0;
+ this.filesForInputs(function (file) {
+ filesCount++;
+ totalSize += file.size;
+ });
+
+ var uploadButton = $(ui.uploadButton);
+ if (filesCount > appConfig.maxFilesPerUpload) {
+ uploadButton.html('Too many files').attr('disabled', true);
+ } else if (totalSize > appConfig.maxUploadSize) {
+ uploadButton.html('File(s) too big').attr('disabled', true);
+ } else {
+ uploadButton.html('Upload/Paste it!').attr('disabled', false);
+ }
+ },
+
+ hasNoFiles: function (input) {
+ return $(input).prop('files').length === 0;
+ },
+
+ appendUploadInput: function (event) {
+ if (_.any($(ui.uploadInputs), this.hasNoFiles)) { return; }
+ $(event.target).parent().append($(event.target).clone().val(""), $('<br>'));
+ },
+
+ hasNoText: function (textArea) {
+ return !$(textArea).val();
+ },
+
+ setAttributeIndices: function (tab, index) {
+ tab.attr('id', tab.attr('id').replace(/\d+$/, index));
+ _.each(tab.find('input,textarea'), function (input) {
+ var name = $(input).attr('name');
+ $(input).attr('name', name.replace(/\[\d+\]/, '[' + index + ']'));
+ });
+ },
+
+ clearValues: function (tab) {
+ tab.find('input,textarea').val('');
+ },
+
+ tabNavigationItem: function (index) {
+ var link = $('<a data-toggle="tab">').attr({
+ href: '#text-upload-tab-' + index,
+ }).html('Paste ' + index);
+
+ return $('<li>').append(link);
+ },
+
+ appendTextField: function (event) {
+ if (_.any($(ui.textAreas), this.hasNoText)) { return; }
+
+ var newTab = $(ui.textAreaTabs).last().clone();
+ var index = parseInt(newTab.attr('id').match(/\d+$/)[0]) + 1;
+ this.setAttributeIndices(newTab, index);
+ this.clearValues(newTab);
+ newTab.toggleClass('active', false);
+ $(ui.textAreaTabsContainer).append(newTab);
+ $(ui.tabNavigation).append(this.tabNavigationItem(index));
+ },
+
+ setTabHeader: function (event) {
+ var name = $(event.target).val();
+ if (_.isEmpty(name)) {
+ var tabPane = $(event.target).closest(ui.tabPane);
+ var index = tabPane.attr('id').match(/\d+$/)[0];
+ name = 'Paste ' + index;
+ }
+ $(ui.tabNavigation).find('li.active a').html(name);
+ },
+
+ setupEvents: function () {
+ if (window.File && window.FileList) {
+ $(document).on(
+ 'change', ui.uploadInputs,
+ _.bind(this.checkFileUpload, this)
+ );
+ }
+ $(document).on(
+ 'change', ui.uploadInputs,
+ _.bind(this.appendUploadInput, this)
+ );
+ $(document).on(
+ 'input propertychange', ui.textAreas,
+ _.bind(this.appendTextField, this)
+ );
+ $(document).on(
+ 'input propertychange', ui.filenameInputs,
+ _.bind(this.setTabHeader, this)
+ );
+ }
+ };
+
+ var Uploader = {
+ initialize: function () {
+ PrivateFunctions.setupEvents();
+ $(ui.textAreas).trigger("propertychange");
+ }
+ };
+
+ return Uploader;
+});
+})();
diff --git a/public_html/data/js/util.js b/public_html/data/js/util.js
new file mode 100644
index 000000000..c00bb1785
--- /dev/null
+++ b/public_html/data/js/util.js
@@ -0,0 +1,60 @@
+(function () {
+'use strict';
+define(['jquery'], function () {
+ var PrivateFunctions = {
+ highlightLine: function (id) {
+ this.clearLineHighlights();
+ var line = $(id).parents('.table-row');
+ line.addClass("highlight_line");
+ },
+ clearLineHighlights: function () {
+ $('.highlight_line').removeClass('highlight_line');
+ }
+ };
+ var Util = {
+ fixedEncodeURIComponent: function (string) {
+ var encodedString = encodeURIComponent(string);
+ encodedString = encodedString.replace(/[!'()]/g, escape);
+ encodedString = encodedString.replace(/\*/g, "%2A");
+
+ return encodedString;
+ },
+ highlightLineFromHash: function () {
+ var hash = window.location.hash;
+ if (hash.match(/^#n(?:-.+-)?\d+$/) === null) {
+ PrivateFunctions.clearLineHighlights();
+ return;
+ }
+
+ PrivateFunctions.highlightLine(hash);
+ },
+ focusDropdownInput: function (target) {
+ setTimeout(function () {
+ var dropDown = $(target).siblings('.dropdown-menu');
+ dropDown.find('input').trigger('focus');
+ }, 0);
+ },
+ setTabwidth: function (value) {
+ value = value || 8;
+ $('span.tabwidth-value').html(value);
+ $('.tabwidth-form input').val(value);
+ $('.highlight .code-container').css('tab-size', value);
+ localStorage.setItem('tabwidth', value);
+ },
+ setTabwidthFromLocalStorage: function () {
+ this.setTabwidth(localStorage.getItem('tabwidth'));
+ },
+ setLineWrap: function (lines_wrapped) {
+ var whitespaceMode = lines_wrapped ? 'pre-wrap' : 'pre';
+ $('.highlight > .code-container').css('white-space', whitespaceMode);
+ localStorage.setItem('lines_wrapped', lines_wrapped);
+ },
+ toggleLineWrap: function() {
+ this.setLineWrap(
+ localStorage.getItem('lines_wrapped') !== 'true'
+ );
+ }
+ };
+ return Util;
+});
+})();
diff --git a/public_html/data/js/vendor/asciinema-player.js b/public_html/data/js/vendor/asciinema-player.js
new file mode 100644
index 000000000..5ad47e08b
--- /dev/null
+++ b/public_html/data/js/vendor/asciinema-player.js
@@ -0,0 +1,1213 @@
+/**
+ * asciinema-player v2.6.1
+ *
+ * Copyright 2011-2018, Marcin Kulik
+ *
+ */
+
+// CustomEvent polyfill from MDN (https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent)
+
+(function () {
+ if (typeof window.CustomEvent === "function") return false;
+
+ function CustomEvent ( event, params ) {
+ params = params || { bubbles: false, cancelable: false, detail: undefined };
+ var evt = document.createEvent( 'CustomEvent');
+ evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
+ return evt;
+ }
+
+ CustomEvent.prototype = window.Event.prototype;
+
+ window.CustomEvent = CustomEvent;
+})();
+
+/**
+ * @license
+ * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
+ * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
+ * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
+ * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
+ * Code distributed by Google as part of the polymer project is also
+ * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
+ */
+// @version 0.7.22
+"undefined"==typeof WeakMap&&!function(){var e=Object.defineProperty,t=Date.now()%1e9,n=function(){this.name="__st"+(1e9*Math.random()>>>0)+(t++ +"__")};n.prototype={set:function(t,n){var o=t[this.name];return o&&o[0]===t?o[1]=n:e(t,this.name,{value:[t,n],writable:!0}),this},get:function(e){var t;return(t=e[this.name])&&t[0]===e?t[1]:void 0},"delete":function(e){var t=e[this.name];return t&&t[0]===e?(t[0]=t[1]=void 0,!0):!1},has:function(e){var t=e[this.name];return t?t[0]===e:!1}},window.WeakMap=n}(),function(e){function t(e){E.push(e),b||(b=!0,w(o))}function n(e){return window.ShadowDOMPolyfill&&window.ShadowDOMPolyfill.wrapIfNeeded(e)||e}function o(){b=!1;var e=E;E=[],e.sort(function(e,t){return e.uid_-t.uid_});var t=!1;e.forEach(function(e){var n=e.takeRecords();r(e),n.length&&(e.callback_(n,e),t=!0)}),t&&o()}function r(e){e.nodes_.forEach(function(t){var n=v.get(t);n&&n.forEach(function(t){t.observer===e&&t.removeTransientObservers()})})}function i(e,t){for(var n=e;n;n=n.parentNode){var o=v.get(n);if(o)for(var r=0;r<o.length;r++){var i=o[r],a=i.options;if(n===e||a.subtree){var d=t(a);d&&i.enqueue(d)}}}}function a(e){this.callback_=e,this.nodes_=[],this.records_=[],this.uid_=++_}function d(e,t){this.type=e,this.target=t,this.addedNodes=[],this.removedNodes=[],this.previousSibling=null,this.nextSibling=null,this.attributeName=null,this.attributeNamespace=null,this.oldValue=null}function s(e){var t=new d(e.type,e.target);return t.addedNodes=e.addedNodes.slice(),t.removedNodes=e.removedNodes.slice(),t.previousSibling=e.previousSibling,t.nextSibling=e.nextSibling,t.attributeName=e.attributeName,t.attributeNamespace=e.attributeNamespace,t.oldValue=e.oldValue,t}function u(e,t){return y=new d(e,t)}function c(e){return N?N:(N=s(y),N.oldValue=e,N)}function l(){y=N=void 0}function f(e){return e===N||e===y}function p(e,t){return e===t?e:N&&f(e)?N:null}function m(e,t,n){this.observer=e,this.target=t,this.options=n,this.transientObservedNodes=[]}if(!e.JsMutationObserver){var w,v=new WeakMap;if(/Trident|Edge/.test(navigator.userAgent))w=setTimeout;else if(window.setImmediate)w=window.setImmediate;else{var h=[],g=String(Math.random());window.addEventListener("message",function(e){if(e.data===g){var t=h;h=[],t.forEach(function(e){e()})}}),w=function(e){h.push(e),window.postMessage(g,"*")}}var b=!1,E=[],_=0;a.prototype={observe:function(e,t){if(e=n(e),!t.childList&&!t.attributes&&!t.characterData||t.attributeOldValue&&!t.attributes||t.attributeFilter&&t.attributeFilter.length&&!t.attributes||t.characterDataOldValue&&!t.characterData)throw new SyntaxError;var o=v.get(e);o||v.set(e,o=[]);for(var r,i=0;i<o.length;i++)if(o[i].observer===this){r=o[i],r.removeListeners(),r.options=t;break}r||(r=new m(this,e,t),o.push(r),this.nodes_.push(e)),r.addListeners()},disconnect:function(){this.nodes_.forEach(function(e){for(var t=v.get(e),n=0;n<t.length;n++){var o=t[n];if(o.observer===this){o.removeListeners(),t.splice(n,1);break}}},this),this.records_=[]},takeRecords:function(){var e=this.records_;return this.records_=[],e}};var y,N;m.prototype={enqueue:function(e){var n=this.observer.records_,o=n.length;if(n.length>0){var r=n[o-1],i=p(r,e);if(i)return void(n[o-1]=i)}else t(this.observer);n[o]=e},addListeners:function(){this.addListeners_(this.target)},addListeners_:function(e){var t=this.options;t.attributes&&e.addEventListener("DOMAttrModified",this,!0),t.characterData&&e.addEventListener("DOMCharacterDataModified",this,!0),t.childList&&e.addEventListener("DOMNodeInserted",this,!0),(t.childList||t.subtree)&&e.addEventListener("DOMNodeRemoved",this,!0)},removeListeners:function(){this.removeListeners_(this.target)},removeListeners_:function(e){var t=this.options;t.attributes&&e.removeEventListener("DOMAttrModified",this,!0),t.characterData&&e.removeEventListener("DOMCharacterDataModified",this,!0),t.childList&&e.removeEventListener("DOMNodeInserted",this,!0),(t.childList||t.subtree)&&e.removeEventListener("DOMNodeRemoved",this,!0)},addTransientObserver:function(e){if(e!==this.target){this.addListeners_(e),this.transientObservedNodes.push(e);var t=v.get(e);t||v.set(e,t=[]),t.push(this)}},removeTransientObservers:function(){var e=this.transientObservedNodes;this.transientObservedNodes=[],e.forEach(function(e){this.removeListeners_(e);for(var t=v.get(e),n=0;n<t.length;n++)if(t[n]===this){t.splice(n,1);break}},this)},handleEvent:function(e){switch(e.stopImmediatePropagation(),e.type){case"DOMAttrModified":var t=e.attrName,n=e.relatedNode.namespaceURI,o=e.target,r=new u("attributes",o);r.attributeName=t,r.attributeNamespace=n;var a=e.attrChange===MutationEvent.ADDITION?null:e.prevValue;i(o,function(e){return!e.attributes||e.attributeFilter&&e.attributeFilter.length&&-1===e.attributeFilter.indexOf(t)&&-1===e.attributeFilter.indexOf(n)?void 0:e.attributeOldValue?c(a):r});break;case"DOMCharacterDataModified":var o=e.target,r=u("characterData",o),a=e.prevValue;i(o,function(e){return e.characterData?e.characterDataOldValue?c(a):r:void 0});break;case"DOMNodeRemoved":this.addTransientObserver(e.target);case"DOMNodeInserted":var d,s,f=e.target;"DOMNodeInserted"===e.type?(d=[f],s=[]):(d=[],s=[f]);var p=f.previousSibling,m=f.nextSibling,r=u("childList",e.target.parentNode);r.addedNodes=d,r.removedNodes=s,r.previousSibling=p,r.nextSibling=m,i(e.relatedNode,function(e){return e.childList?r:void 0})}l()}},e.JsMutationObserver=a,e.MutationObserver||(e.MutationObserver=a,a._isPolyfilled=!0)}}(self),function(e){"use strict";if(!window.performance){var t=Date.now();window.performance={now:function(){return Date.now()-t}}}window.requestAnimationFrame||(window.requestAnimationFrame=function(){var e=window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame;return e?function(t){return e(function(){t(performance.now())})}:function(e){return window.setTimeout(e,1e3/60)}}()),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(){return window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||function(e){clearTimeout(e)}}());var n=function(){var e=document.createEvent("Event");return e.initEvent("foo",!0,!0),e.preventDefault(),e.defaultPrevented}();if(!n){var o=Event.prototype.preventDefault;Event.prototype.preventDefault=function(){this.cancelable&&(o.call(this),Object.defineProperty(this,"defaultPrevented",{get:function(){return!0},configurable:!0}))}}var r=/Trident/.test(navigator.userAgent);if((!window.CustomEvent||r&&"function"!=typeof window.CustomEvent)&&(window.CustomEvent=function(e,t){t=t||{};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,Boolean(t.bubbles),Boolean(t.cancelable),t.detail),n},window.CustomEvent.prototype=window.Event.prototype),!window.Event||r&&"function"!=typeof window.Event){var i=window.Event;window.Event=function(e,t){t=t||{};var n=document.createEvent("Event");return n.initEvent(e,Boolean(t.bubbles),Boolean(t.cancelable)),n},window.Event.prototype=i.prototype}}(window.WebComponents),window.CustomElements=window.CustomElements||{flags:{}},function(e){var t=e.flags,n=[],o=function(e){n.push(e)},r=function(){n.forEach(function(t){t(e)})};e.addModule=o,e.initializeModules=r,e.hasNative=Boolean(document.registerElement),e.isIE=/Trident/.test(navigator.userAgent),e.useNative=!t.register&&e.hasNative&&!window.ShadowDOMPolyfill&&(!window.HTMLImports||window.HTMLImports.useNative)}(window.CustomElements),window.CustomElements.addModule(function(e){function t(e,t){n(e,function(e){return t(e)?!0:void o(e,t)}),o(e,t)}function n(e,t,o){var r=e.firstElementChild;if(!r)for(r=e.firstChild;r&&r.nodeType!==Node.ELEMENT_NODE;)r=r.nextSibling;for(;r;)t(r,o)!==!0&&n(r,t,o),r=r.nextElementSibling;return null}function o(e,n){for(var o=e.shadowRoot;o;)t(o,n),o=o.olderShadowRoot}function r(e,t){i(e,t,[])}function i(e,t,n){if(e=window.wrap(e),!(n.indexOf(e)>=0)){n.push(e);for(var o,r=e.querySelectorAll("link[rel="+a+"]"),d=0,s=r.length;s>d&&(o=r[d]);d++)o["import"]&&i(o["import"],t,n);t(e)}}var a=window.HTMLImports?window.HTMLImports.IMPORT_LINK_TYPE:"none";e.forDocumentTree=r,e.forSubtree=t}),window.CustomElements.addModule(function(e){function t(e,t){return n(e,t)||o(e,t)}function n(t,n){return e.upgrade(t,n)?!0:void(n&&a(t))}function o(e,t){b(e,function(e){return n(e,t)?!0:void 0})}function r(e){N.push(e),y||(y=!0,setTimeout(i))}function i(){y=!1;for(var e,t=N,n=0,o=t.length;o>n&&(e=t[n]);n++)e();N=[]}function a(e){_?r(function(){d(e)}):d(e)}function d(e){e.__upgraded__&&!e.__attached&&(e.__attached=!0,e.attachedCallback&&e.attachedCallback())}function s(e){u(e),b(e,function(e){u(e)})}function u(e){_?r(function(){c(e)}):c(e)}function c(e){e.__upgraded__&&e.__attached&&(e.__attached=!1,e.detachedCallback&&e.detachedCallback())}function l(e){for(var t=e,n=window.wrap(document);t;){if(t==n)return!0;t=t.parentNode||t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&t.host}}function f(e){if(e.shadowRoot&&!e.shadowRoot.__watched){g.dom&&console.log("watching shadow-root for: ",e.localName);for(var t=e.shadowRoot;t;)w(t),t=t.olderShadowRoot}}function p(e,n){if(g.dom){var o=n[0];if(o&&"childList"===o.type&&o.addedNodes&&o.addedNodes){for(var r=o.addedNodes[0];r&&r!==document&&!r.host;)r=r.parentNode;var i=r&&(r.URL||r._URL||r.host&&r.host.localName)||"";i=i.split("/?").shift().split("/").pop()}console.group("mutations (%d) [%s]",n.length,i||"")}var a=l(e);n.forEach(function(e){"childList"===e.type&&(M(e.addedNodes,function(e){e.localName&&t(e,a)}),M(e.removedNodes,function(e){e.localName&&s(e)}))}),g.dom&&console.groupEnd()}function m(e){for(e=window.wrap(e),e||(e=window.wrap(document));e.parentNode;)e=e.parentNode;var t=e.__observer;t&&(p(e,t.takeRecords()),i())}function w(e){if(!e.__observer){var t=new MutationObserver(p.bind(this,e));t.observe(e,{childList:!0,subtree:!0}),e.__observer=t}}function v(e){e=window.wrap(e),g.dom&&console.group("upgradeDocument: ",e.baseURI.split("/").pop());var n=e===window.wrap(document);t(e,n),w(e),g.dom&&console.groupEnd()}function h(e){E(e,v)}var g=e.flags,b=e.forSubtree,E=e.forDocumentTree,_=window.MutationObserver._isPolyfilled&&g["throttle-attached"];e.hasPolyfillMutations=_,e.hasThrottledAttached=_;var y=!1,N=[],M=Array.prototype.forEach.call.bind(Array.prototype.forEach),O=Element.prototype.createShadowRoot;O&&(Element.prototype.createShadowRoot=function(){var e=O.call(this);return window.CustomElements.watchShadow(this),e}),e.watchShadow=f,e.upgradeDocumentTree=h,e.upgradeDocument=v,e.upgradeSubtree=o,e.upgradeAll=t,e.attached=a,e.takeRecords=m}),window.CustomElements.addModule(function(e){function t(t,o){if("template"===t.localName&&window.HTMLTemplateElement&&HTMLTemplateElement.decorate&&HTMLTemplateElement.decorate(t),!t.__upgraded__&&t.nodeType===Node.ELEMENT_NODE){var r=t.getAttribute("is"),i=e.getRegisteredDefinition(t.localName)||e.getRegisteredDefinition(r);if(i&&(r&&i.tag==t.localName||!r&&!i["extends"]))return n(t,i,o)}}function n(t,n,r){return a.upgrade&&console.group("upgrade:",t.localName),n.is&&t.setAttribute("is",n.is),o(t,n),t.__upgraded__=!0,i(t),r&&e.attached(t),e.upgradeSubtree(t,r),a.upgrade&&console.groupEnd(),t}function o(e,t){Object.__proto__?e.__proto__=t.prototype:(r(e,t.prototype,t["native"]),e.__proto__=t.prototype)}function r(e,t,n){for(var o={},r=t;r!==n&&r!==HTMLElement.prototype;){for(var i,a=Object.getOwnPropertyNames(r),d=0;i=a[d];d++)o[i]||(Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i)),o[i]=1);r=Object.getPrototypeOf(r)}}function i(e){e.createdCallback&&e.createdCallback()}var a=e.flags;e.upgrade=t,e.upgradeWithDefinition=n,e.implementPrototype=o}),window.CustomElements.addModule(function(e){function t(t,o){var s=o||{};if(!t)throw new Error("document.registerElement: first argument `name` must not be empty");if(t.indexOf("-")<0)throw new Error("document.registerElement: first argument ('name') must contain a dash ('-'). Argument provided was '"+String(t)+"'.");if(r(t))throw new Error("Failed to execute 'registerElement' on 'Document': Registration failed for type '"+String(t)+"'. The type name is invalid.");if(u(t))throw new Error("DuplicateDefinitionError: a type with name '"+String(t)+"' is already registered");return s.prototype||(s.prototype=Object.create(HTMLElement.prototype)),s.__name=t.toLowerCase(),s["extends"]&&(s["extends"]=s["extends"].toLowerCase()),s.lifecycle=s.lifecycle||{},s.ancestry=i(s["extends"]),a(s),d(s),n(s.prototype),c(s.__name,s),s.ctor=l(s),s.ctor.prototype=s.prototype,s.prototype.constructor=s.ctor,e.ready&&v(document),s.ctor}function n(e){if(!e.setAttribute._polyfilled){var t=e.setAttribute;e.setAttribute=function(e,n){o.call(this,e,n,t)};var n=e.removeAttribute;e.removeAttribute=function(e){o.call(this,e,null,n)},e.setAttribute._polyfilled=!0}}function o(e,t,n){e=e.toLowerCase();var o=this.getAttribute(e);n.apply(this,arguments);var r=this.getAttribute(e);this.attributeChangedCallback&&r!==o&&this.attributeChangedCallback(e,o,r)}function r(e){for(var t=0;t<_.length;t++)if(e===_[t])return!0}function i(e){var t=u(e);return t?i(t["extends"]).concat([t]):[]}function a(e){for(var t,n=e["extends"],o=0;t=e.ancestry[o];o++)n=t.is&&t.tag;e.tag=n||e.__name,n&&(e.is=e.__name)}function d(e){if(!Object.__proto__){var t=HTMLElement.prototype;if(e.is){var n=document.createElement(e.tag);t=Object.getPrototypeOf(n)}for(var o,r=e.prototype,i=!1;r;)r==t&&(i=!0),o=Object.getPrototypeOf(r),o&&(r.__proto__=o),r=o;i||console.warn(e.tag+" prototype not found in prototype chain for "+e.is),e["native"]=t}}function s(e){return g(M(e.tag),e)}function u(e){return e?y[e.toLowerCase()]:void 0}function c(e,t){y[e]=t}function l(e){return function(){return s(e)}}function f(e,t,n){return e===N?p(t,n):O(e,t)}function p(e,t){e&&(e=e.toLowerCase()),t&&(t=t.toLowerCase());var n=u(t||e);if(n){if(e==n.tag&&t==n.is)return new n.ctor;if(!t&&!n.is)return new n.ctor}var o;return t?(o=p(e),o.setAttribute("is",t),o):(o=M(e),e.indexOf("-")>=0&&b(o,HTMLElement),o)}function m(e,t){var n=e[t];e[t]=function(){var e=n.apply(this,arguments);return h(e),e}}var w,v=(e.isIE,e.upgradeDocumentTree),h=e.upgradeAll,g=e.upgradeWithDefinition,b=e.implementPrototype,E=e.useNative,_=["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"],y={},N="http://www.w3.org/1999/xhtml",M=document.createElement.bind(document),O=document.createElementNS.bind(document);w=Object.__proto__||E?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;for(var n=e;n;){if(n===t.prototype)return!0;n=n.__proto__}return!1},m(Node.prototype,"cloneNode"),m(document,"importNode"),document.registerElement=t,document.createElement=p,document.createElementNS=f,e.registry=y,e["instanceof"]=w,e.reservedTagList=_,e.getRegisteredDefinition=u,document.register=document.registerElement}),function(e){function t(){i(window.wrap(document)),window.CustomElements.ready=!0;var e=window.requestAnimationFrame||function(e){setTimeout(e,16)};e(function(){setTimeout(function(){window.CustomElements.readyTime=Date.now(),window.HTMLImports&&(window.CustomElements.elapsed=window.CustomElements.readyTime-window.HTMLImports.readyTime),document.dispatchEvent(new CustomEvent("WebComponentsReady",{bubbles:!0}))})})}var n=e.useNative,o=e.initializeModules;e.isIE;if(n){var r=function(){};e.watchShadow=r,e.upgrade=r,e.upgradeAll=r,e.upgradeDocumentTree=r,e.upgradeSubtree=r,e.takeRecords=r,e["instanceof"]=function(e,t){return e instanceof t}}else o();var i=e.upgradeDocumentTree,a=e.upgradeDocument;if(window.wrap||(window.ShadowDOMPolyfill?(window.wrap=window.ShadowDOMPolyfill.wrapIfNeeded,window.unwrap=window.ShadowDOMPolyfill.unwrapIfNeeded):window.wrap=window.unwrap=function(e){return e}),window.HTMLImports&&(window.HTMLImports.__importsParsingHook=function(e){e["import"]&&a(wrap(e["import"]))}),"complete"===document.readyState||e.flags.eager)t();else if("interactive"!==document.readyState||window.attachEvent||window.HTMLImports&&!window.HTMLImports.ready){var d=window.HTMLImports&&!window.HTMLImports.ready?"HTMLImportsLoaded":"DOMContentLoaded";window.addEventListener(d,t)}else t()}(window.CustomElements);
+if(typeof Math.imul == "undefined" || (Math.imul(0xffffffff,5) == 0)) {
+ Math.imul = function (a, b) {
+ var ah = (a >>> 16) & 0xffff;
+ var al = a & 0xffff;
+ var bh = (b >>> 16) & 0xffff;
+ var bl = b & 0xffff;
+ // the shift by 0 fixes the sign on the high part
+ // the final |0 converts the unsigned value into a signed value
+ return ((al * bl) + (((ah * bl + al * bh) << 16) >>> 0)|0);
+ }
+}
+
+/**
+ * React v15.5.4
+ *
+ * Copyright 2013-present, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ */
+!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.React=t()}}(function(){return function t(e,n,r){function o(u,a){if(!n[u]){if(!e[u]){var s="function"==typeof require&&require;if(!a&&s)return s(u,!0);if(i)return i(u,!0);var c=new Error("Cannot find module '"+u+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[u]={exports:{}};e[u][0].call(l.exports,function(t){var n=e[u][1][t];return o(n||t)},l,l.exports,t,e,n,r)}return n[u].exports}for(var i="function"==typeof require&&require,u=0;u<r.length;u++)o(r[u]);return o}({1:[function(t,e,n){"use strict";function r(t){var e={"=":"=0",":":"=2"};return"$"+(""+t).replace(/[=:]/g,function(t){return e[t]})}function o(t){var e={"=0":"=","=2":":"};return(""+("."===t[0]&&"$"===t[1]?t.substring(2):t.substring(1))).replace(/(=0|=2)/g,function(t){return e[t]})}var i={escape:r,unescape:o};e.exports=i},{}],2:[function(t,e,n){"use strict";var r=t(20),o=(t(24),function(t){var e=this;if(e.instancePool.length){var n=e.instancePool.pop();return e.call(n,t),n}return new e(t)}),i=function(t,e){var n=this;if(n.instancePool.length){var r=n.instancePool.pop();return n.call(r,t,e),r}return new n(t,e)},u=function(t,e,n){var r=this;if(r.instancePool.length){var o=r.instancePool.pop();return r.call(o,t,e,n),o}return new r(t,e,n)},a=function(t,e,n,r){var o=this;if(o.instancePool.length){var i=o.instancePool.pop();return o.call(i,t,e,n,r),i}return new o(t,e,n,r)},s=function(t){var e=this;t instanceof e||r("25"),t.destructor(),e.instancePool.length<e.poolSize&&e.instancePool.push(t)},c=o,l=function(t,e){var n=t;return n.instancePool=[],n.getPooled=e||c,n.poolSize||(n.poolSize=10),n.release=s,n},f={addPoolingTo:l,oneArgumentPooler:o,twoArgumentPooler:i,threeArgumentPooler:u,fourArgumentPooler:a};e.exports=f},{20:20,24:24}],3:[function(t,e,n){"use strict";var r=t(26),o=t(4),i=t(6),u=t(14),a=t(5),s=t(8),c=t(9),l=t(13),f=t(16),p=t(19),d=(t(25),c.createElement),y=c.createFactory,h=c.cloneElement,v=r,m={Children:{map:o.map,forEach:o.forEach,count:o.count,toArray:o.toArray,only:p},Component:i,PureComponent:u,createElement:d,cloneElement:h,isValidElement:c.isValidElement,PropTypes:l,createClass:a.createClass,createFactory:y,createMixin:function(t){return t},DOM:s,version:f,__spread:v};e.exports=m},{13:13,14:14,16:16,19:19,25:25,26:26,4:4,5:5,6:6,8:8,9:9}],4:[function(t,e,n){"use strict";function r(t){return(""+t).replace(E,"$&/")}function o(t,e){this.func=t,this.context=e,this.count=0}function i(t,e,n){var r=t.func,o=t.context;r.call(o,e,t.count++)}function u(t,e,n){if(null==t)return t;var r=o.getPooled(e,n);m(t,i,r),o.release(r)}function a(t,e,n,r){this.result=t,this.keyPrefix=e,this.func=n,this.context=r,this.count=0}function s(t,e,n){var o=t.result,i=t.keyPrefix,u=t.func,a=t.context,s=u.call(a,e,t.count++);Array.isArray(s)?c(s,o,n,v.thatReturnsArgument):null!=s&&(h.isValidElement(s)&&(s=h.cloneAndReplaceKey(s,i+(!s.key||e&&e.key===s.key?"":r(s.key)+"/")+n)),o.push(s))}function c(t,e,n,o,i){var u="";null!=n&&(u=r(n)+"/");var c=a.getPooled(e,u,o,i);m(t,s,c),a.release(c)}function l(t,e,n){if(null==t)return t;var r=[];return c(t,r,null,e,n),r}function f(t,e,n){return null}function p(t,e){return m(t,f,null)}function d(t){var e=[];return c(t,e,null,v.thatReturnsArgument),e}var y=t(2),h=t(9),v=t(22),m=t(21),b=y.twoArgumentPooler,g=y.fourArgumentPooler,E=/\/+/g;o.prototype.destructor=function(){this.func=null,this.context=null,this.count=0},y.addPoolingTo(o,b),a.prototype.destructor=function(){this.result=null,this.keyPrefix=null,this.func=null,this.context=null,this.count=0},y.addPoolingTo(a,g);var x={forEach:u,map:l,mapIntoWithKeyPrefixInternal:c,count:p,toArray:d};e.exports=x},{2:2,21:21,22:22,9:9}],5:[function(t,e,n){"use strict";function r(t){return t}function o(t,e){var n=E.hasOwnProperty(e)?E[e]:null;_.hasOwnProperty(e)&&"OVERRIDE_BASE"!==n&&p("73",e),t&&"DEFINE_MANY"!==n&&"DEFINE_MANY_MERGED"!==n&&p("74",e)}function i(t,e){if(e){"function"==typeof e&&p("75"),h.isValidElement(e)&&p("76");var n=t.prototype,r=n.__reactAutoBindPairs;e.hasOwnProperty(b)&&x.mixins(t,e.mixins);for(var i in e)if(e.hasOwnProperty(i)&&i!==b){var u=e[i],a=n.hasOwnProperty(i);if(o(a,i),x.hasOwnProperty(i))x[i](t,u);else{var l=E.hasOwnProperty(i),f="function"==typeof u,d=f&&!l&&!a&&!1!==e.autobind;if(d)r.push(i,u),n[i]=u;else if(a){var y=E[i];(!l||"DEFINE_MANY_MERGED"!==y&&"DEFINE_MANY"!==y)&&p("77",y,i),"DEFINE_MANY_MERGED"===y?n[i]=s(n[i],u):"DEFINE_MANY"===y&&(n[i]=c(n[i],u))}else n[i]=u}}}}function u(t,e){if(e)for(var n in e){var r=e[n];if(e.hasOwnProperty(n)){var o=n in x;o&&p("78",n);var i=n in t;i&&p("79",n),t[n]=r}}}function a(t,e){t&&e&&"object"==typeof t&&"object"==typeof e||p("80");for(var n in e)e.hasOwnProperty(n)&&(void 0!==t[n]&&p("81",n),t[n]=e[n]);return t}function s(t,e){return function(){var n=t.apply(this,arguments),r=e.apply(this,arguments);if(null==n)return r;if(null==r)return n;var o={};return a(o,n),a(o,r),o}}function c(t,e){return function(){t.apply(this,arguments),e.apply(this,arguments)}}function l(t,e){return e.bind(t)}function f(t){for(var e=t.__reactAutoBindPairs,n=0;n<e.length;n+=2){var r=e[n],o=e[n+1];t[r]=l(t,o)}}var p=t(20),d=t(26),y=t(6),h=t(9),v=(t(12),t(11)),m=t(23),b=(t(24),t(25),"mixins"),g=[],E={mixins:"DEFINE_MANY",statics:"DEFINE_MANY",propTypes:"DEFINE_MANY",contextTypes:"DEFINE_MANY",childContextTypes:"DEFINE_MANY",getDefaultProps:"DEFINE_MANY_MERGED",getInitialState:"DEFINE_MANY_MERGED",getChildContext:"DEFINE_MANY_MERGED",render:"DEFINE_ONCE",componentWillMount:"DEFINE_MANY",componentDidMount:"DEFINE_MANY",componentWillReceiveProps:"DEFINE_MANY",shouldComponentUpdate:"DEFINE_ONCE",componentWillUpdate:"DEFINE_MANY",componentDidUpdate:"DEFINE_MANY",componentWillUnmount:"DEFINE_MANY",updateComponent:"OVERRIDE_BASE"},x={displayName:function(t,e){t.displayName=e},mixins:function(t,e){if(e)for(var n=0;n<e.length;n++)i(t,e[n])},childContextTypes:function(t,e){t.childContextTypes=d({},t.childContextTypes,e)},contextTypes:function(t,e){t.contextTypes=d({},t.contextTypes,e)},getDefaultProps:function(t,e){t.getDefaultProps?t.getDefaultProps=s(t.getDefaultProps,e):t.getDefaultProps=e},propTypes:function(t,e){t.propTypes=d({},t.propTypes,e)},statics:function(t,e){u(t,e)},autobind:function(){}},_={replaceState:function(t,e){this.updater.enqueueReplaceState(this,t),e&&this.updater.enqueueCallback(this,e,"replaceState")},isMounted:function(){return this.updater.isMounted(this)}},P=function(){};d(P.prototype,y.prototype,_);var w={createClass:function(t){var e=r(function(t,n,r){this.__reactAutoBindPairs.length&&f(this),this.props=t,this.context=n,this.refs=m,this.updater=r||v,this.state=null;var o=this.getInitialState?this.getInitialState():null;("object"!=typeof o||Array.isArray(o))&&p("82",e.displayName||"ReactCompositeComponent"),this.state=o});e.prototype=new P,e.prototype.constructor=e,e.prototype.__reactAutoBindPairs=[],g.forEach(i.bind(null,e)),i(e,t),e.getDefaultProps&&(e.defaultProps=e.getDefaultProps()),e.prototype.render||p("83");for(var n in E)e.prototype[n]||(e.prototype[n]=null);return e},injection:{injectMixin:function(t){g.push(t)}}};e.exports=w},{11:11,12:12,20:20,23:23,24:24,25:25,26:26,6:6,9:9}],6:[function(t,e,n){"use strict";function r(t,e,n){this.props=t,this.context=e,this.refs=u,this.updater=n||i}var o=t(20),i=t(11),u=(t(17),t(23));t(24),t(25);r.prototype.isReactComponent={},r.prototype.setState=function(t,e){"object"!=typeof t&&"function"!=typeof t&&null!=t&&o("85"),this.updater.enqueueSetState(this,t),e&&this.updater.enqueueCallback(this,e,"setState")},r.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this),t&&this.updater.enqueueCallback(this,t,"forceUpdate")};e.exports=r},{11:11,17:17,20:20,23:23,24:24,25:25}],7:[function(t,e,n){"use strict";var r={current:null};e.exports=r},{}],8:[function(t,e,n){"use strict";var r=t(9),o=r.createFactory,i={a:o("a"),abbr:o("abbr"),address:o("address"),area:o("area"),article:o("article"),aside:o("aside"),audio:o("audio"),b:o("b"),base:o("base"),bdi:o("bdi"),bdo:o("bdo"),big:o("big"),blockquote:o("blockquote"),body:o("body"),br:o("br"),button:o("button"),canvas:o("canvas"),caption:o("caption"),cite:o("cite"),code:o("code"),col:o("col"),colgroup:o("colgroup"),data:o("data"),datalist:o("datalist"),dd:o("dd"),del:o("del"),details:o("details"),dfn:o("dfn"),dialog:o("dialog"),div:o("div"),dl:o("dl"),dt:o("dt"),em:o("em"),embed:o("embed"),fieldset:o("fieldset"),figcaption:o("figcaption"),figure:o("figure"),footer:o("footer"),form:o("form"),h1:o("h1"),h2:o("h2"),h3:o("h3"),h4:o("h4"),h5:o("h5"),h6:o("h6"),head:o("head"),header:o("header"),hgroup:o("hgroup"),hr:o("hr"),html:o("html"),i:o("i"),iframe:o("iframe"),img:o("img"),input:o("input"),ins:o("ins"),kbd:o("kbd"),keygen:o("keygen"),label:o("label"),legend:o("legend"),li:o("li"),link:o("link"),main:o("main"),map:o("map"),mark:o("mark"),menu:o("menu"),menuitem:o("menuitem"),meta:o("meta"),meter:o("meter"),nav:o("nav"),noscript:o("noscript"),object:o("object"),ol:o("ol"),optgroup:o("optgroup"),option:o("option"),output:o("output"),p:o("p"),param:o("param"),picture:o("picture"),pre:o("pre"),progress:o("progress"),q:o("q"),rp:o("rp"),rt:o("rt"),ruby:o("ruby"),s:o("s"),samp:o("samp"),script:o("script"),section:o("section"),select:o("select"),small:o("small"),source:o("source"),span:o("span"),strong:o("strong"),style:o("style"),sub:o("sub"),summary:o("summary"),sup:o("sup"),table:o("table"),tbody:o("tbody"),td:o("td"),textarea:o("textarea"),tfoot:o("tfoot"),th:o("th"),thead:o("thead"),time:o("time"),title:o("title"),tr:o("tr"),track:o("track"),u:o("u"),ul:o("ul"),var:o("var"),video:o("video"),wbr:o("wbr"),circle:o("circle"),clipPath:o("clipPath"),defs:o("defs"),ellipse:o("ellipse"),g:o("g"),image:o("image"),line:o("line"),linearGradient:o("linearGradient"),mask:o("mask"),path:o("path"),pattern:o("pattern"),polygon:o("polygon"),polyline:o("polyline"),radialGradient:o("radialGradient"),rect:o("rect"),stop:o("stop"),svg:o("svg"),text:o("text"),tspan:o("tspan")};e.exports=i},{9:9}],9:[function(t,e,n){"use strict";function r(t){return void 0!==t.ref}function o(t){return void 0!==t.key}var i=t(26),u=t(7),a=(t(25),t(17),Object.prototype.hasOwnProperty),s=t(10),c={key:!0,ref:!0,__self:!0,__source:!0},l=function(t,e,n,r,o,i,u){return{$$typeof:s,type:t,key:e,ref:n,props:u,_owner:i}};l.createElement=function(t,e,n){var i,s={},f=null,p=null;if(null!=e){r(e)&&(p=e.ref),o(e)&&(f=""+e.key),void 0===e.__self?null:e.__self,void 0===e.__source?null:e.__source;for(i in e)a.call(e,i)&&!c.hasOwnProperty(i)&&(s[i]=e[i])}var d=arguments.length-2;if(1===d)s.children=n;else if(d>1){for(var y=Array(d),h=0;h<d;h++)y[h]=arguments[h+2];s.children=y}if(t&&t.defaultProps){var v=t.defaultProps;for(i in v)void 0===s[i]&&(s[i]=v[i])}return l(t,f,p,0,0,u.current,s)},l.createFactory=function(t){var e=l.createElement.bind(null,t);return e.type=t,e},l.cloneAndReplaceKey=function(t,e){return l(t.type,e,t.ref,t._self,t._source,t._owner,t.props)},l.cloneElement=function(t,e,n){var s,f=i({},t.props),p=t.key,d=t.ref,y=(t._self,t._source,t._owner);if(null!=e){r(e)&&(d=e.ref,y=u.current),o(e)&&(p=""+e.key);var h;t.type&&t.type.defaultProps&&(h=t.type.defaultProps);for(s in e)a.call(e,s)&&!c.hasOwnProperty(s)&&(void 0===e[s]&&void 0!==h?f[s]=h[s]:f[s]=e[s])}var v=arguments.length-2;if(1===v)f.children=n;else if(v>1){for(var m=Array(v),b=0;b<v;b++)m[b]=arguments[b+2];f.children=m}return l(t.type,p,d,0,0,y,f)},l.isValidElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===s},e.exports=l},{10:10,17:17,25:25,26:26,7:7}],10:[function(t,e,n){"use strict";var r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;e.exports=r},{}],11:[function(t,e,n){"use strict";var r=(t(25),{isMounted:function(t){return!1},enqueueCallback:function(t,e){},enqueueForceUpdate:function(t){},enqueueReplaceState:function(t,e){},enqueueSetState:function(t,e){}});e.exports=r},{25:25}],12:[function(t,e,n){"use strict";var r={};e.exports=r},{}],13:[function(t,e,n){"use strict";var r=t(9),o=r.isValidElement,i=t(28);e.exports=i(o)},{28:28,9:9}],14:[function(t,e,n){"use strict";function r(t,e,n){this.props=t,this.context=e,this.refs=s,this.updater=n||a}function o(){}var i=t(26),u=t(6),a=t(11),s=t(23);o.prototype=u.prototype,r.prototype=new o,r.prototype.constructor=r,i(r.prototype,u.prototype),r.prototype.isPureReactComponent=!0,e.exports=r},{11:11,23:23,26:26,6:6}],15:[function(t,e,n){"use strict";var r=t(26),o=t(3),i=r(o,{__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:t(7)}});e.exports=i},{26:26,3:3,7:7}],16:[function(t,e,n){"use strict";e.exports="15.5.4"},{}],17:[function(t,e,n){"use strict";e.exports=!1},{}],18:[function(t,e,n){"use strict";function r(t){var e=t&&(o&&t[o]||t[i]);if("function"==typeof e)return e}var o="function"==typeof Symbol&&Symbol.iterator,i="@@iterator";e.exports=r},{}],19:[function(t,e,n){"use strict";function r(t){return i.isValidElement(t)||o("143"),t}var o=t(20),i=t(9);t(24);e.exports=r},{20:20,24:24,9:9}],20:[function(t,e,n){"use strict";function r(t){for(var e=arguments.length-1,n="Minified React error #"+t+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+t,r=0;r<e;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);n+=" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";var o=new Error(n);throw o.name="Invariant Violation",o.framesToPop=1,o}e.exports=r},{}],21:[function(t,e,n){"use strict";function r(t,e){return t&&"object"==typeof t&&null!=t.key?c.escape(t.key):e.toString(36)}function o(t,e,n,i){var p=typeof t;if("undefined"!==p&&"boolean"!==p||(t=null),null===t||"string"===p||"number"===p||"object"===p&&t.$$typeof===a)return n(i,t,""===e?l+r(t,0):e),1;var d,y,h=0,v=""===e?l:e+f;if(Array.isArray(t))for(var m=0;m<t.length;m++)d=t[m],y=v+r(d,m),h+=o(d,y,n,i);else{var b=s(t);if(b){var g,E=b.call(t);if(b!==t.entries)for(var x=0;!(g=E.next()).done;)d=g.value,y=v+r(d,x++),h+=o(d,y,n,i);else for(;!(g=E.next()).done;){var _=g.value;_&&(d=_[1],y=v+c.escape(_[0])+f+r(d,0),h+=o(d,y,n,i))}}else if("object"===p){var P=String(t);u("31","[object Object]"===P?"object with keys {"+Object.keys(t).join(", ")+"}":P,"")}}return h}function i(t,e,n){return null==t?0:o(t,"",e,n)}var u=t(20),a=(t(7),t(10)),s=t(18),c=(t(24),t(1)),l=(t(25),"."),f=":";e.exports=i},{1:1,10:10,18:18,20:20,24:24,25:25,7:7}],22:[function(t,e,n){"use strict";function r(t){return function(){return t}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(t){return t},e.exports=o},{}],23:[function(t,e,n){"use strict";var r={};e.exports=r},{}],24:[function(t,e,n){"use strict";function r(t,e,n,r,i,u,a,s){if(o(e),!t){var c;if(void 0===e)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,i,u,a,s],f=0;c=new Error(e.replace(/%s/g,function(){return l[f++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}}var o=function(t){};e.exports=r},{}],25:[function(t,e,n){"use strict";var r=t(22),o=r;e.exports=o},{22:22}],26:[function(t,e,n){"use strict";function r(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}var o=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(t){r[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var n,a,s=r(t),c=1;c<arguments.length;c++){n=Object(arguments[c]);for(var l in n)i.call(n,l)&&(s[l]=n[l]);if(o){a=o(n);for(var f=0;f<a.length;f++)u.call(n,a[f])&&(s[a[f]]=n[a[f]])}}return s}},{}],27:[function(t,e,n){"use strict";function r(t,e,n,r,o){}e.exports=r},{24:24,25:25,30:30}],28:[function(t,e,n){"use strict";var r=t(29);e.exports=function(t){return r(t,!1)}},{29:29}],29:[function(t,e,n){"use strict";var r=t(22),o=t(24),i=(t(25),t(30)),u=t(27);e.exports=function(t,e){function n(t){var e=t&&(_&&t[_]||t[P]);if("function"==typeof e)return e}function a(t,e){return t===e?0!==t||1/t==1/e:t!==t&&e!==e}function s(t){this.message=t,this.stack=""}function c(t){function n(n,r,u,a,c,l,f){if(a=a||w,l=l||u,f!==i)if(e)o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");else;return null==r[u]?n?new s(null===r[u]?"The "+c+" `"+l+"` is marked as required in `"+a+"`, but its value is `null`.":"The "+c+" `"+l+"` is marked as required in `"+a+"`, but its value is `undefined`."):null:t(r,u,a,c,l)}var r=n.bind(null,!1);return r.isRequired=n.bind(null,!0),r}function l(t){function e(e,n,r,o,i,u){var a=e[n];if(g(a)!==t)return new s("Invalid "+o+" `"+i+"` of type `"+E(a)+"` supplied to `"+r+"`, expected `"+t+"`.");return null}return c(e)}function f(t){function e(e,n,r,o,u){if("function"!=typeof t)return new s("Property `"+u+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var a=e[n];if(!Array.isArray(a)){return new s("Invalid "+o+" `"+u+"` of type `"+g(a)+"` supplied to `"+r+"`, expected an array.")}for(var c=0;c<a.length;c++){var l=t(a,c,r,o,u+"["+c+"]",i);if(l instanceof Error)return l}return null}return c(e)}function p(t){function e(e,n,r,o,i){if(!(e[n]instanceof t)){var u=t.name||w;return new s("Invalid "+o+" `"+i+"` of type `"+x(e[n])+"` supplied to `"+r+"`, expected instance of `"+u+"`.")}return null}return c(e)}function d(t){function e(e,n,r,o,i){for(var u=e[n],c=0;c<t.length;c++)if(a(u,t[c]))return null;return new s("Invalid "+o+" `"+i+"` of value `"+u+"` supplied to `"+r+"`, expected one of "+JSON.stringify(t)+".")}return Array.isArray(t)?c(e):r.thatReturnsNull}function y(t){function e(e,n,r,o,u){if("function"!=typeof t)return new s("Property `"+u+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var a=e[n],c=g(a);if("object"!==c)return new s("Invalid "+o+" `"+u+"` of type `"+c+"` supplied to `"+r+"`, expected an object.");for(var l in a)if(a.hasOwnProperty(l)){var f=t(a,l,r,o,u+"."+l,i);if(f instanceof Error)return f}return null}return c(e)}function h(t){function e(e,n,r,o,u){for(var a=0;a<t.length;a++){if(null==(0,t[a])(e,n,r,o,u,i))return null}return new s("Invalid "+o+" `"+u+"` supplied to `"+r+"`.")}return Array.isArray(t)?c(e):r.thatReturnsNull}function v(t){function e(e,n,r,o,u){var a=e[n],c=g(a);if("object"!==c)return new s("Invalid "+o+" `"+u+"` of type `"+c+"` supplied to `"+r+"`, expected `object`.");for(var l in t){var f=t[l];if(f){var p=f(a,l,r,o,u+"."+l,i);if(p)return p}}return null}return c(e)}function m(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(m);if(null===e||t(e))return!0;var r=n(e);if(!r)return!1;var o,i=r.call(e);if(r!==e.entries){for(;!(o=i.next()).done;)if(!m(o.value))return!1}else for(;!(o=i.next()).done;){var u=o.value;if(u&&!m(u[1]))return!1}return!0;default:return!1}}function b(t,e){return"symbol"===t||("Symbol"===e["@@toStringTag"]||"function"==typeof Symbol&&e instanceof Symbol)}function g(t){var e=typeof t;return Array.isArray(t)?"array":t instanceof RegExp?"object":b(e,t)?"symbol":e}function E(t){var e=g(t);if("object"===e){if(t instanceof Date)return"date";if(t instanceof RegExp)return"regexp"}return e}function x(t){return t.constructor&&t.constructor.name?t.constructor.name:w}var _="function"==typeof Symbol&&Symbol.iterator,P="@@iterator",w="<<anonymous>>",N={array:l("array"),bool:l("boolean"),func:l("function"),number:l("number"),object:l("object"),string:l("string"),symbol:l("symbol"),any:function(){return c(r.thatReturnsNull)}(),arrayOf:f,element:function(){function e(e,n,r,o,i){var u=e[n];if(!t(u)){return new s("Invalid "+o+" `"+i+"` of type `"+g(u)+"` supplied to `"+r+"`, expected a single ReactElement.")}return null}return c(e)}(),instanceOf:p,node:function(){function t(t,e,n,r,o){return m(t[e])?null:new s("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")}return c(t)}(),objectOf:y,oneOf:d,oneOfType:h,shape:v};return s.prototype=Error.prototype,N.checkPropTypes=u,N.PropTypes=N,N}},{22:22,24:24,25:25,27:27,30:30}],30:[function(t,e,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},{}]},{},[15])(15)});
+!function(f){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=f();else if("function"==typeof define&&define.amd)define([],f);else{var g;if(g="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,void 0===g.React)throw Error("React module should be required before createClass");g.createReactClass=f()}}(function(){return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n||e)},l,l.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){"use strict";function identity(fn){return fn}function factory(ReactComponent,isValidElement,ReactNoopUpdateQueue){function validateMethodOverride(isAlreadyDefined,name){var specPolicy=ReactClassInterface.hasOwnProperty(name)?ReactClassInterface[name]:null;ReactClassMixin.hasOwnProperty(name)&&_invariant("OVERRIDE_BASE"===specPolicy,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",name),isAlreadyDefined&&_invariant("DEFINE_MANY"===specPolicy||"DEFINE_MANY_MERGED"===specPolicy,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",name)}function mixSpecIntoComponent(Constructor,spec){if(spec){_invariant("function"!=typeof spec,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),_invariant(!isValidElement(spec),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var proto=Constructor.prototype,autoBindPairs=proto.__reactAutoBindPairs;spec.hasOwnProperty(MIXINS_KEY)&&RESERVED_SPEC_KEYS.mixins(Constructor,spec.mixins);for(var name in spec)if(spec.hasOwnProperty(name)&&name!==MIXINS_KEY){var property=spec[name],isAlreadyDefined=proto.hasOwnProperty(name);if(validateMethodOverride(isAlreadyDefined,name),RESERVED_SPEC_KEYS.hasOwnProperty(name))RESERVED_SPEC_KEYS[name](Constructor,property);else{var isReactClassMethod=ReactClassInterface.hasOwnProperty(name),isFunction="function"==typeof property,shouldAutoBind=isFunction&&!isReactClassMethod&&!isAlreadyDefined&&!1!==spec.autobind;if(shouldAutoBind)autoBindPairs.push(name,property),proto[name]=property;else if(isAlreadyDefined){var specPolicy=ReactClassInterface[name];_invariant(isReactClassMethod&&("DEFINE_MANY_MERGED"===specPolicy||"DEFINE_MANY"===specPolicy),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",specPolicy,name),"DEFINE_MANY_MERGED"===specPolicy?proto[name]=createMergedResultFunction(proto[name],property):"DEFINE_MANY"===specPolicy&&(proto[name]=createChainedFunction(proto[name],property))}else proto[name]=property}}}else;}function mixStaticSpecIntoComponent(Constructor,statics){if(statics)for(var name in statics){var property=statics[name];if(statics.hasOwnProperty(name)){var isReserved=name in RESERVED_SPEC_KEYS;_invariant(!isReserved,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',name);var isInherited=name in Constructor;_invariant(!isInherited,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",name),Constructor[name]=property}}}function mergeIntoWithNoDuplicateKeys(one,two){_invariant(one&&two&&"object"==typeof one&&"object"==typeof two,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var key in two)two.hasOwnProperty(key)&&(_invariant(void 0===one[key],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",key),one[key]=two[key]);return one}function createMergedResultFunction(one,two){return function(){var a=one.apply(this,arguments),b=two.apply(this,arguments);if(null==a)return b;if(null==b)return a;var c={};return mergeIntoWithNoDuplicateKeys(c,a),mergeIntoWithNoDuplicateKeys(c,b),c}}function createChainedFunction(one,two){return function(){one.apply(this,arguments),two.apply(this,arguments)}}function bindAutoBindMethod(component,method){var boundMethod=method.bind(component);return boundMethod}function bindAutoBindMethods(component){for(var pairs=component.__reactAutoBindPairs,i=0;i<pairs.length;i+=2){var autoBindKey=pairs[i],method=pairs[i+1];component[autoBindKey]=bindAutoBindMethod(component,method)}}function createClass(spec){var Constructor=identity(function(props,context,updater){this.__reactAutoBindPairs.length&&bindAutoBindMethods(this),this.props=props,this.context=context,this.refs=emptyObject,this.updater=updater||ReactNoopUpdateQueue,this.state=null;var initialState=this.getInitialState?this.getInitialState():null;_invariant("object"==typeof initialState&&!Array.isArray(initialState),"%s.getInitialState(): must return an object or null",Constructor.displayName||"ReactCompositeComponent"),this.state=initialState});Constructor.prototype=new ReactClassComponent,Constructor.prototype.constructor=Constructor,Constructor.prototype.__reactAutoBindPairs=[],injectedMixins.forEach(mixSpecIntoComponent.bind(null,Constructor)),mixSpecIntoComponent(Constructor,IsMountedMixin),mixSpecIntoComponent(Constructor,spec),Constructor.getDefaultProps&&(Constructor.defaultProps=Constructor.getDefaultProps()),_invariant(Constructor.prototype.render,"createClass(...): Class specification must implement a `render` method.");for(var methodName in ReactClassInterface)Constructor.prototype[methodName]||(Constructor.prototype[methodName]=null);return Constructor}var injectedMixins=[],ReactClassInterface={mixins:"DEFINE_MANY",statics:"DEFINE_MANY",propTypes:"DEFINE_MANY",contextTypes:"DEFINE_MANY",childContextTypes:"DEFINE_MANY",getDefaultProps:"DEFINE_MANY_MERGED",getInitialState:"DEFINE_MANY_MERGED",getChildContext:"DEFINE_MANY_MERGED",render:"DEFINE_ONCE",componentWillMount:"DEFINE_MANY",componentDidMount:"DEFINE_MANY",componentWillReceiveProps:"DEFINE_MANY",shouldComponentUpdate:"DEFINE_ONCE",componentWillUpdate:"DEFINE_MANY",componentDidUpdate:"DEFINE_MANY",componentWillUnmount:"DEFINE_MANY",updateComponent:"OVERRIDE_BASE"},RESERVED_SPEC_KEYS={displayName:function(Constructor,displayName){Constructor.displayName=displayName},mixins:function(Constructor,mixins){if(mixins)for(var i=0;i<mixins.length;i++)mixSpecIntoComponent(Constructor,mixins[i])},childContextTypes:function(Constructor,childContextTypes){Constructor.childContextTypes=_assign({},Constructor.childContextTypes,childContextTypes)},contextTypes:function(Constructor,contextTypes){Constructor.contextTypes=_assign({},Constructor.contextTypes,contextTypes)},getDefaultProps:function(Constructor,getDefaultProps){Constructor.getDefaultProps?Constructor.getDefaultProps=createMergedResultFunction(Constructor.getDefaultProps,getDefaultProps):Constructor.getDefaultProps=getDefaultProps},propTypes:function(Constructor,propTypes){Constructor.propTypes=_assign({},Constructor.propTypes,propTypes)},statics:function(Constructor,statics){mixStaticSpecIntoComponent(Constructor,statics)},autobind:function(){}},IsMountedMixin={componentDidMount:function(){this.__isMounted=!0},componentWillUnmount:function(){this.__isMounted=!1}},ReactClassMixin={replaceState:function(newState,callback){this.updater.enqueueReplaceState(this,newState,callback)},isMounted:function(){return!!this.__isMounted}},ReactClassComponent=function(){};return _assign(ReactClassComponent.prototype,ReactComponent.prototype,ReactClassMixin),createClass}var _assign=require(7),emptyObject=require(4),_invariant=require(5),MIXINS_KEY="mixins";module.exports=factory},{4:4,5:5,6:6,7:7}],2:[function(require,module,exports){"use strict";var factory=require(1),ReactNoopUpdateQueue=(new React.Component).updater;module.exports=factory(React.Component,React.isValidElement,ReactNoopUpdateQueue)},{1:1}],3:[function(require,module,exports){"use strict";function makeEmptyFunction(arg){return function(){return arg}}var emptyFunction=function(){};emptyFunction.thatReturns=makeEmptyFunction,emptyFunction.thatReturnsFalse=makeEmptyFunction(!1),emptyFunction.thatReturnsTrue=makeEmptyFunction(!0),emptyFunction.thatReturnsNull=makeEmptyFunction(null),emptyFunction.thatReturnsThis=function(){return this},emptyFunction.thatReturnsArgument=function(arg){return arg},module.exports=emptyFunction},{}],4:[function(require,module,exports){"use strict";var emptyObject={};module.exports=emptyObject},{}],5:[function(require,module,exports){"use strict";function invariant(condition,format,a,b,c,d,e,f){if(validateFormat(format),!condition){var error;if(void 0===format)error=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var args=[a,b,c,d,e,f],argIndex=0;error=new Error(format.replace(/%s/g,function(){return args[argIndex++]})),error.name="Invariant Violation"}throw error.framesToPop=1,error}}var validateFormat=function(format){};module.exports=invariant},{}],6:[function(require,module,exports){"use strict";var emptyFunction=require(3),warning=emptyFunction;module.exports=warning},{3:3}],7:[function(require,module,exports){"use strict";function toObject(val){if(null===val||void 0===val)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(val)}var getOwnPropertySymbols=Object.getOwnPropertySymbols,hasOwnProperty=Object.prototype.hasOwnProperty,propIsEnumerable=Object.prototype.propertyIsEnumerable;module.exports=function(){try{if(!Object.assign)return!1;var test1=new String("abc");if(test1[5]="de","5"===Object.getOwnPropertyNames(test1)[0])return!1;for(var test2={},i=0;i<10;i++)test2["_"+String.fromCharCode(i)]=i;if("0123456789"!==Object.getOwnPropertyNames(test2).map(function(n){return test2[n]}).join(""))return!1;var test3={};return"abcdefghijklmnopqrst".split("").forEach(function(letter){test3[letter]=letter}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},test3)).join("")}catch(err){return!1}}()?Object.assign:function(target,source){for(var from,symbols,to=toObject(target),s=1;s<arguments.length;s++){from=Object(arguments[s]);for(var key in from)hasOwnProperty.call(from,key)&&(to[key]=from[key]);if(getOwnPropertySymbols){symbols=getOwnPropertySymbols(from);for(var i=0;i<symbols.length;i++)propIsEnumerable.call(from,symbols[i])&&(to[symbols[i]]=from[symbols[i]])}}return to}},{}]},{},[2])(2)});
+
+/**
+ * ReactDOM v15.5.4
+ *
+ * Copyright 2013-present, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ */
+!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e(require("react"));else if("function"==typeof define&&define.amd)define(["react"],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.ReactDOM=e(t.React)}}(function(e){return function(t){return function(){return function e(t,n,r){function o(a,s){if(!n[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(i)return i(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[a]={exports:{}};t[a][0].call(c.exports,function(e){var n=t[a][1][e];return o(n||e)},c,c.exports,e,t,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(e,t,n){"use strict";var r={Properties:{"aria-current":0,"aria-details":0,"aria-disabled":0,"aria-hidden":0,"aria-invalid":0,"aria-keyshortcuts":0,"aria-label":0,"aria-roledescription":0,"aria-autocomplete":0,"aria-checked":0,"aria-expanded":0,"aria-haspopup":0,"aria-level":0,"aria-modal":0,"aria-multiline":0,"aria-multiselectable":0,"aria-orientation":0,"aria-placeholder":0,"aria-pressed":0,"aria-readonly":0,"aria-required":0,"aria-selected":0,"aria-sort":0,"aria-valuemax":0,"aria-valuemin":0,"aria-valuenow":0,"aria-valuetext":0,"aria-atomic":0,"aria-busy":0,"aria-live":0,"aria-relevant":0,"aria-dropeffect":0,"aria-grabbed":0,"aria-activedescendant":0,"aria-colcount":0,"aria-colindex":0,"aria-colspan":0,"aria-controls":0,"aria-describedby":0,"aria-errormessage":0,"aria-flowto":0,"aria-labelledby":0,"aria-owns":0,"aria-posinset":0,"aria-rowcount":0,"aria-rowindex":0,"aria-rowspan":0,"aria-setsize":0},DOMAttributeNames:{},DOMPropertyNames:{}};t.exports=r},{}],2:[function(e,t,n){"use strict";var r=e(33),o=e(131),i={focusDOMComponent:function(){o(r.getNodeFromInstance(this))}};t.exports=i},{131:131,33:33}],3:[function(e,t,n){"use strict";function r(e){return(e.ctrlKey||e.altKey||e.metaKey)&&!(e.ctrlKey&&e.altKey)}function o(e){switch(e){case"topCompositionStart":return T.compositionStart;case"topCompositionEnd":return T.compositionEnd;case"topCompositionUpdate":return T.compositionUpdate}}function i(e,t){return"topKeyDown"===e&&t.keyCode===y}function a(e,t){switch(e){case"topKeyUp":return-1!==g.indexOf(t.keyCode);case"topKeyDown":return t.keyCode!==y;case"topKeyPress":case"topMouseDown":case"topBlur":return!0;default:return!1}}function s(e){var t=e.detail;return"object"==typeof t&&"data"in t?t.data:null}function u(e,t,n,r){var u,l;if(_?u=o(e):P?a(e,n)&&(u=T.compositionEnd):i(e,n)&&(u=T.compositionStart),!u)return null;E&&(P||u!==T.compositionStart?u===T.compositionEnd&&P&&(l=P.getData()):P=h.getPooled(r));var c=m.getPooled(u,t,n,r);if(l)c.data=l;else{var p=s(n);null!==p&&(c.data=p)}return d.accumulateTwoPhaseDispatches(c),c}function l(e,t){switch(e){case"topCompositionEnd":return s(t);case"topKeyPress":return t.which!==x?null:(k=!0,w);case"topTextInput":var n=t.data;return n===w&&k?null:n;default:return null}}function c(e,t){if(P){if("topCompositionEnd"===e||!_&&a(e,t)){var n=P.getData();return h.release(P),P=null,n}return null}switch(e){case"topPaste":return null;case"topKeyPress":return t.which&&!r(t)?String.fromCharCode(t.which):null;case"topCompositionEnd":return E?null:t.data;default:return null}}function p(e,t,n,r){var o;if(!(o=b?l(e,n):c(e,n)))return null;var i=v.getPooled(T.beforeInput,t,n,r);return i.data=o,d.accumulateTwoPhaseDispatches(i),i}var d=e(19),f=e(123),h=e(20),m=e(78),v=e(82),g=[9,13,27,32],y=229,_=f.canUseDOM&&"CompositionEvent"in window,C=null;f.canUseDOM&&"documentMode"in document&&(C=document.documentMode);var b=f.canUseDOM&&"TextEvent"in window&&!C&&!function(){var e=window.opera;return"object"==typeof e&&"function"==typeof e.version&&parseInt(e.version(),10)<=12}(),E=f.canUseDOM&&(!_||C&&C>8&&C<=11),x=32,w=String.fromCharCode(x),T={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["topCompositionEnd","topKeyPress","topTextInput","topPaste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:["topBlur","topCompositionEnd","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:["topBlur","topCompositionStart","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:["topBlur","topCompositionUpdate","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]}},k=!1,P=null,S={eventTypes:T,extractEvents:function(e,t,n,r){return[u(e,t,n,r),p(e,t,n,r)]}};t.exports=S},{123:123,19:19,20:20,78:78,82:82}],4:[function(e,t,n){"use strict";function r(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}var o={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridColumn:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},i=["Webkit","ms","Moz","O"];Object.keys(o).forEach(function(e){i.forEach(function(t){o[r(t,e)]=o[e]})});var a={background:{backgroundAttachment:!0,backgroundColor:!0,backgroundImage:!0,backgroundPositionX:!0,backgroundPositionY:!0,backgroundRepeat:!0},backgroundPosition:{backgroundPositionX:!0,backgroundPositionY:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},font:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0},outline:{outlineWidth:!0,outlineStyle:!0,outlineColor:!0}},s={isUnitlessNumber:o,shorthandPropertyExpansions:a};t.exports=s},{}],5:[function(e,t,n){"use strict";var r=e(4),o=e(123),i=(e(58),e(125),e(94)),a=e(136),s=e(140),u=(e(142),s(function(e){return a(e)})),l=!1,c="cssFloat";if(o.canUseDOM){var p=document.createElement("div").style;try{p.font=""}catch(e){l=!0}void 0===document.documentElement.style.cssFloat&&(c="styleFloat")}var d={createMarkupForStyles:function(e,t){var n="";for(var r in e)if(e.hasOwnProperty(r)){var o=e[r];null!=o&&(n+=u(r)+":",n+=i(r,o,t)+";")}return n||null},setValueForStyles:function(e,t,n){var o=e.style;for(var a in t)if(t.hasOwnProperty(a)){var s=i(a,t[a],n);if("float"!==a&&"cssFloat"!==a||(a=c),s)o[a]=s;else{var u=l&&r.shorthandPropertyExpansions[a];if(u)for(var p in u)o[p]="";else o[a]=""}}}};t.exports=d},{123:123,125:125,136:136,140:140,142:142,4:4,58:58,94:94}],6:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=e(112),i=e(24),a=(e(137),function(){function e(t){r(this,e),this._callbacks=null,this._contexts=null,this._arg=t}return e.prototype.enqueue=function(e,t){this._callbacks=this._callbacks||[],this._callbacks.push(e),this._contexts=this._contexts||[],this._contexts.push(t)},e.prototype.notifyAll=function(){var e=this._callbacks,t=this._contexts,n=this._arg;if(e&&t){e.length!==t.length&&o("24"),this._callbacks=null,this._contexts=null;for(var r=0;r<e.length;r++)e[r].call(t[r],n);e.length=0,t.length=0}},e.prototype.checkpoint=function(){return this._callbacks?this._callbacks.length:0},e.prototype.rollback=function(e){this._callbacks&&this._contexts&&(this._callbacks.length=e,this._contexts.length=e)},e.prototype.reset=function(){this._callbacks=null,this._contexts=null},e.prototype.destructor=function(){this.reset()},e}());t.exports=i.addPoolingTo(a)},{112:112,137:137,24:24}],7:[function(e,t,n){"use strict";function r(e){var t=e.nodeName&&e.nodeName.toLowerCase();return"select"===t||"input"===t&&"file"===e.type}function o(e){var t=w.getPooled(S.change,M,e,T(e));C.accumulateTwoPhaseDispatches(t),x.batchedUpdates(i,t)}function i(e){_.enqueueEvents(e),_.processEventQueue(!1)}function a(e,t){N=e,M=t,N.attachEvent("onchange",o)}function s(){N&&(N.detachEvent("onchange",o),N=null,M=null)}function u(e,t){if("topChange"===e)return t}function l(e,t,n){"topFocus"===e?(s(),a(t,n)):"topBlur"===e&&s()}function c(e,t){N=e,M=t,I=e.value,O=Object.getOwnPropertyDescriptor(e.constructor.prototype,"value"),Object.defineProperty(N,"value",D),N.attachEvent?N.attachEvent("onpropertychange",d):N.addEventListener("propertychange",d,!1)}function p(){N&&(delete N.value,N.detachEvent?N.detachEvent("onpropertychange",d):N.removeEventListener("propertychange",d,!1),N=null,M=null,I=null,O=null)}function d(e){if("value"===e.propertyName){var t=e.srcElement.value;t!==I&&(I=t,o(e))}}function f(e,t){if("topInput"===e)return t}function h(e,t,n){"topFocus"===e?(p(),c(t,n)):"topBlur"===e&&p()}function m(e,t){if(("topSelectionChange"===e||"topKeyUp"===e||"topKeyDown"===e)&&N&&N.value!==I)return I=N.value,M}function v(e){return e.nodeName&&"input"===e.nodeName.toLowerCase()&&("checkbox"===e.type||"radio"===e.type)}function g(e,t){if("topClick"===e)return t}function y(e,t){if(null!=e){var n=e._wrapperState||t._wrapperState;if(n&&n.controlled&&"number"===t.type){var r=""+t.value;t.getAttribute("value")!==r&&t.setAttribute("value",r)}}}var _=e(16),C=e(19),b=e(123),E=e(33),x=e(71),w=e(80),T=e(102),k=e(109),P=e(110),S={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:["topBlur","topChange","topClick","topFocus","topInput","topKeyDown","topKeyUp","topSelectionChange"]}},N=null,M=null,I=null,O=null,R=!1;b.canUseDOM&&(R=k("change")&&(!document.documentMode||document.documentMode>8));var A=!1;b.canUseDOM&&(A=k("input")&&(!document.documentMode||document.documentMode>11));var D={get:function(){return O.get.call(this)},set:function(e){I=""+e,O.set.call(this,e)}},L={eventTypes:S,extractEvents:function(e,t,n,o){var i,a,s=t?E.getNodeFromInstance(t):window;if(r(s)?R?i=u:a=l:P(s)?A?i=f:(i=m,a=h):v(s)&&(i=g),i){var c=i(e,t);if(c){var p=w.getPooled(S.change,c,n,o);return p.type="change",C.accumulateTwoPhaseDispatches(p),p}}a&&a(e,s,t),"topBlur"===e&&y(t,s)}};t.exports=L},{102:102,109:109,110:110,123:123,16:16,19:19,33:33,71:71,80:80}],8:[function(e,t,n){"use strict";function r(e,t){return Array.isArray(t)&&(t=t[1]),t?t.nextSibling:e.firstChild}function o(e,t,n){c.insertTreeBefore(e,t,n)}function i(e,t,n){Array.isArray(t)?s(e,t[0],t[1],n):m(e,t,n)}function a(e,t){if(Array.isArray(t)){var n=t[1];t=t[0],u(e,t,n),e.removeChild(n)}e.removeChild(t)}function s(e,t,n,r){for(var o=t;;){var i=o.nextSibling;if(m(e,o,r),o===n)break;o=i}}function u(e,t,n){for(;;){var r=t.nextSibling;if(r===n)break;e.removeChild(r)}}function l(e,t,n){var r=e.parentNode,o=e.nextSibling;o===t?n&&m(r,document.createTextNode(n),o):n?(h(o,n),u(r,o,t)):u(r,e,t)}var c=e(9),p=e(13),d=(e(33),e(58),e(93)),f=e(114),h=e(115),m=d(function(e,t,n){e.insertBefore(t,n)}),v=p.dangerouslyReplaceNodeWithMarkup,g={dangerouslyReplaceNodeWithMarkup:v,replaceDelimitedText:l,processUpdates:function(e,t){for(var n=0;n<t.length;n++){var s=t[n];switch(s.type){case"INSERT_MARKUP":o(e,s.content,r(e,s.afterNode));break;case"MOVE_EXISTING":i(e,s.fromNode,r(e,s.afterNode));break;case"SET_MARKUP":f(e,s.content);break;case"TEXT_CONTENT":h(e,s.content);break;case"REMOVE_NODE":a(e,s.fromNode)}}}};t.exports=g},{114:114,115:115,13:13,33:33,58:58,9:9,93:93}],9:[function(e,t,n){"use strict";function r(e){if(h){var t=e.node,n=e.children;if(n.length)for(var r=0;r<n.length;r++)m(t,n[r],null);else null!=e.html?p(t,e.html):null!=e.text&&f(t,e.text)}}function o(e,t){e.parentNode.replaceChild(t.node,e),r(t)}function i(e,t){h?e.children.push(t):e.node.appendChild(t.node)}function a(e,t){h?e.html=t:p(e.node,t)}function s(e,t){h?e.text=t:f(e.node,t)}function u(){return this.node.nodeName}function l(e){return{node:e,children:[],html:null,text:null,toString:u}}var c=e(10),p=e(114),d=e(93),f=e(115),h="undefined"!=typeof document&&"number"==typeof document.documentMode||"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent&&/\bEdge\/\d/.test(navigator.userAgent),m=d(function(e,t,n){11===t.node.nodeType||1===t.node.nodeType&&"object"===t.node.nodeName.toLowerCase()&&(null==t.node.namespaceURI||t.node.namespaceURI===c.html)?(r(t),e.insertBefore(t.node,n)):(e.insertBefore(t.node,n),r(t))});l.insertTreeBefore=m,l.replaceChildWithTree=o,l.queueChild=i,l.queueHTML=a,l.queueText=s,t.exports=l},{10:10,114:114,115:115,93:93}],10:[function(e,t,n){"use strict";var r={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};t.exports=r},{}],11:[function(e,t,n){"use strict";function r(e,t){return(e&t)===t}var o=e(112),i=(e(137),{MUST_USE_PROPERTY:1,HAS_BOOLEAN_VALUE:4,HAS_NUMERIC_VALUE:8,HAS_POSITIVE_NUMERIC_VALUE:24,HAS_OVERLOADED_BOOLEAN_VALUE:32,injectDOMPropertyConfig:function(e){var t=i,n=e.Properties||{},a=e.DOMAttributeNamespaces||{},u=e.DOMAttributeNames||{},l=e.DOMPropertyNames||{},c=e.DOMMutationMethods||{};e.isCustomAttribute&&s._isCustomAttributeFunctions.push(e.isCustomAttribute);for(var p in n){s.properties.hasOwnProperty(p)&&o("48",p);var d=p.toLowerCase(),f=n[p],h={attributeName:d,attributeNamespace:null,propertyName:p,mutationMethod:null,mustUseProperty:r(f,t.MUST_USE_PROPERTY),hasBooleanValue:r(f,t.HAS_BOOLEAN_VALUE),hasNumericValue:r(f,t.HAS_NUMERIC_VALUE),hasPositiveNumericValue:r(f,t.HAS_POSITIVE_NUMERIC_VALUE),hasOverloadedBooleanValue:r(f,t.HAS_OVERLOADED_BOOLEAN_VALUE)};if(h.hasBooleanValue+h.hasNumericValue+h.hasOverloadedBooleanValue<=1||o("50",p),u.hasOwnProperty(p)){var m=u[p];h.attributeName=m}a.hasOwnProperty(p)&&(h.attributeNamespace=a[p]),l.hasOwnProperty(p)&&(h.propertyName=l[p]),c.hasOwnProperty(p)&&(h.mutationMethod=c[p]),s.properties[p]=h}}}),a=":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",s={ID_ATTRIBUTE_NAME:"data-reactid",ROOT_ATTRIBUTE_NAME:"data-reactroot",ATTRIBUTE_NAME_START_CHAR:a,ATTRIBUTE_NAME_CHAR:a+"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",properties:{},getPossibleStandardName:null,_isCustomAttributeFunctions:[],isCustomAttribute:function(e){for(var t=0;t<s._isCustomAttributeFunctions.length;t++)if((0,s._isCustomAttributeFunctions[t])(e))return!0;return!1},injection:i};t.exports=s},{112:112,137:137}],12:[function(e,t,n){"use strict";function r(e){return!!l.hasOwnProperty(e)||!u.hasOwnProperty(e)&&(s.test(e)?(l[e]=!0,!0):(u[e]=!0,!1))}function o(e,t){return null==t||e.hasBooleanValue&&!t||e.hasNumericValue&&isNaN(t)||e.hasPositiveNumericValue&&t<1||e.hasOverloadedBooleanValue&&!1===t}var i=e(11),a=(e(33),e(58),e(111)),s=(e(142),new RegExp("^["+i.ATTRIBUTE_NAME_START_CHAR+"]["+i.ATTRIBUTE_NAME_CHAR+"]*$")),u={},l={},c={createMarkupForID:function(e){return i.ID_ATTRIBUTE_NAME+"="+a(e)},setAttributeForID:function(e,t){e.setAttribute(i.ID_ATTRIBUTE_NAME,t)},createMarkupForRoot:function(){return i.ROOT_ATTRIBUTE_NAME+'=""'},setAttributeForRoot:function(e){e.setAttribute(i.ROOT_ATTRIBUTE_NAME,"")},createMarkupForProperty:function(e,t){var n=i.properties.hasOwnProperty(e)?i.properties[e]:null;if(n){if(o(n,t))return"";var r=n.attributeName;return n.hasBooleanValue||n.hasOverloadedBooleanValue&&!0===t?r+'=""':r+"="+a(t)}return i.isCustomAttribute(e)?null==t?"":e+"="+a(t):null},createMarkupForCustomAttribute:function(e,t){return r(e)&&null!=t?e+"="+a(t):""},setValueForProperty:function(e,t,n){var r=i.properties.hasOwnProperty(t)?i.properties[t]:null;if(r){var a=r.mutationMethod;if(a)a(e,n);else{if(o(r,n))return void this.deleteValueForProperty(e,t);if(r.mustUseProperty)e[r.propertyName]=n;else{var s=r.attributeName,u=r.attributeNamespace;u?e.setAttributeNS(u,s,""+n):r.hasBooleanValue||r.hasOverloadedBooleanValue&&!0===n?e.setAttribute(s,""):e.setAttribute(s,""+n)}}}else if(i.isCustomAttribute(t))return void c.setValueForAttribute(e,t,n)},setValueForAttribute:function(e,t,n){r(t)&&(null==n?e.removeAttribute(t):e.setAttribute(t,""+n))},deleteValueForAttribute:function(e,t){e.removeAttribute(t)},deleteValueForProperty:function(e,t){var n=i.properties.hasOwnProperty(t)?i.properties[t]:null;if(n){var r=n.mutationMethod;if(r)r(e,void 0);else if(n.mustUseProperty){var o=n.propertyName;n.hasBooleanValue?e[o]=!1:e[o]=""}else e.removeAttribute(n.attributeName)}else i.isCustomAttribute(t)&&e.removeAttribute(t)}};t.exports=c},{11:11,111:111,142:142,33:33,58:58}],13:[function(e,t,n){"use strict";var r=e(112),o=e(9),i=e(123),a=e(128),s=e(129),u=(e(137),{dangerouslyReplaceNodeWithMarkup:function(e,t){if(i.canUseDOM||r("56"),t||r("57"),"HTML"===e.nodeName&&r("58"),"string"==typeof t){var n=a(t,s)[0];e.parentNode.replaceChild(n,e)}else o.replaceChildWithTree(e,t)}});t.exports=u},{112:112,123:123,128:128,129:129,137:137,9:9}],14:[function(e,t,n){"use strict";var r=["ResponderEventPlugin","SimpleEventPlugin","TapEventPlugin","EnterLeaveEventPlugin","ChangeEventPlugin","SelectEventPlugin","BeforeInputEventPlugin"];t.exports=r},{}],15:[function(e,t,n){"use strict";var r=e(19),o=e(33),i=e(84),a={mouseEnter:{registrationName:"onMouseEnter",dependencies:["topMouseOut","topMouseOver"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["topMouseOut","topMouseOver"]}},s={eventTypes:a,extractEvents:function(e,t,n,s){if("topMouseOver"===e&&(n.relatedTarget||n.fromElement))return null;if("topMouseOut"!==e&&"topMouseOver"!==e)return null;var u;if(s.window===s)u=s;else{var l=s.ownerDocument;u=l?l.defaultView||l.parentWindow:window}var c,p;if("topMouseOut"===e){c=t;var d=n.relatedTarget||n.toElement;p=d?o.getClosestInstanceFromNode(d):null}else c=null,p=t;if(c===p)return null;var f=null==c?u:o.getNodeFromInstance(c),h=null==p?u:o.getNodeFromInstance(p),m=i.getPooled(a.mouseLeave,c,n,s);m.type="mouseleave",m.target=f,m.relatedTarget=h;var v=i.getPooled(a.mouseEnter,p,n,s);return v.type="mouseenter",v.target=h,v.relatedTarget=f,r.accumulateEnterLeaveDispatches(m,v,c,p),[m,v]}};t.exports=s},{19:19,33:33,84:84}],16:[function(e,t,n){"use strict";function r(e){return"button"===e||"input"===e||"select"===e||"textarea"===e}function o(e,t,n){switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":return!(!n.disabled||!r(t));default:return!1}}var i=e(112),a=e(17),s=e(18),u=e(50),l=e(91),c=e(98),p=(e(137),{}),d=null,f=function(e,t){e&&(s.executeDispatchesInOrder(e,t),e.isPersistent()||e.constructor.release(e))},h=function(e){return f(e,!0)},m=function(e){return f(e,!1)},v=function(e){return"."+e._rootNodeID},g={injection:{injectEventPluginOrder:a.injectEventPluginOrder,injectEventPluginsByName:a.injectEventPluginsByName},putListener:function(e,t,n){"function"!=typeof n&&i("94",t,typeof n);var r=v(e);(p[t]||(p[t]={}))[r]=n;var o=a.registrationNameModules[t];o&&o.didPutListener&&o.didPutListener(e,t,n)},getListener:function(e,t){var n=p[t];if(o(t,e._currentElement.type,e._currentElement.props))return null;var r=v(e);return n&&n[r]},deleteListener:function(e,t){var n=a.registrationNameModules[t];n&&n.willDeleteListener&&n.willDeleteListener(e,t);var r=p[t];r&&delete r[v(e)]},deleteAllListeners:function(e){var t=v(e);for(var n in p)if(p.hasOwnProperty(n)&&p[n][t]){var r=a.registrationNameModules[n];r&&r.willDeleteListener&&r.willDeleteListener(e,n),delete p[n][t]}},extractEvents:function(e,t,n,r){for(var o,i=a.plugins,s=0;s<i.length;s++){var u=i[s];if(u){var c=u.extractEvents(e,t,n,r);c&&(o=l(o,c))}}return o},enqueueEvents:function(e){e&&(d=l(d,e))},processEventQueue:function(e){var t=d;d=null,e?c(t,h):c(t,m),d&&i("95"),u.rethrowCaughtError()},__purge:function(){p={}},__getListenerBank:function(){return p}};t.exports=g},{112:112,137:137,17:17,18:18,50:50,91:91,98:98}],17:[function(e,t,n){"use strict";function r(){if(s)for(var e in u){var t=u[e],n=s.indexOf(e);if(n>-1||a("96",e),!l.plugins[n]){t.extractEvents||a("97",e),l.plugins[n]=t;var r=t.eventTypes;for(var i in r)o(r[i],t,i)||a("98",i,e)}}}function o(e,t,n){l.eventNameDispatchConfigs.hasOwnProperty(n)&&a("99",n),l.eventNameDispatchConfigs[n]=e;var r=e.phasedRegistrationNames;if(r){for(var o in r)if(r.hasOwnProperty(o)){var s=r[o];i(s,t,n)}return!0}return!!e.registrationName&&(i(e.registrationName,t,n),!0)}function i(e,t,n){l.registrationNameModules[e]&&a("100",e),l.registrationNameModules[e]=t,l.registrationNameDependencies[e]=t.eventTypes[n].dependencies}var a=e(112),s=(e(137),null),u={},l={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},possibleRegistrationNames:null,injectEventPluginOrder:function(e){s&&a("101"),s=Array.prototype.slice.call(e),r()},injectEventPluginsByName:function(e){var t=!1;for(var n in e)if(e.hasOwnProperty(n)){var o=e[n];u.hasOwnProperty(n)&&u[n]===o||(u[n]&&a("102",n),u[n]=o,t=!0)}t&&r()},getPluginModuleForEvent:function(e){var t=e.dispatchConfig;if(t.registrationName)return l.registrationNameModules[t.registrationName]||null;if(void 0!==t.phasedRegistrationNames){var n=t.phasedRegistrationNames;for(var r in n)if(n.hasOwnProperty(r)){var o=l.registrationNameModules[n[r]];if(o)return o}}return null},_resetEventPlugins:function(){s=null;for(var e in u)u.hasOwnProperty(e)&&delete u[e];l.plugins.length=0;var t=l.eventNameDispatchConfigs;for(var n in t)t.hasOwnProperty(n)&&delete t[n];var r=l.registrationNameModules;for(var o in r)r.hasOwnProperty(o)&&delete r[o]}};t.exports=l},{112:112,137:137}],18:[function(e,t,n){"use strict";function r(e){return"topMouseUp"===e||"topTouchEnd"===e||"topTouchCancel"===e}function o(e){return"topMouseMove"===e||"topTouchMove"===e}function i(e){return"topMouseDown"===e||"topTouchStart"===e}function a(e,t,n,r){var o=e.type||"unknown-event";e.currentTarget=g.getNodeFromInstance(r),t?m.invokeGuardedCallbackWithCatch(o,n,e):m.invokeGuardedCallback(o,n,e),e.currentTarget=null}function s(e,t){var n=e._dispatchListeners,r=e._dispatchInstances;if(Array.isArray(n))for(var o=0;o<n.length&&!e.isPropagationStopped();o++)a(e,t,n[o],r[o]);else n&&a(e,t,n,r);e._dispatchListeners=null,e._dispatchInstances=null}function u(e){var t=e._dispatchListeners,n=e._dispatchInstances;if(Array.isArray(t)){for(var r=0;r<t.length&&!e.isPropagationStopped();r++)if(t[r](e,n[r]))return n[r]}else if(t&&t(e,n))return n;return null}function l(e){var t=u(e);return e._dispatchInstances=null,e._dispatchListeners=null,t}function c(e){var t=e._dispatchListeners,n=e._dispatchInstances;Array.isArray(t)&&h("103"),e.currentTarget=t?g.getNodeFromInstance(n):null;var r=t?t(e):null;return e.currentTarget=null,e._dispatchListeners=null,e._dispatchInstances=null,r}function p(e){return!!e._dispatchListeners}var d,f,h=e(112),m=e(50),v=(e(137),e(142),{injectComponentTree:function(e){d=e},injectTreeTraversal:function(e){f=e}}),g={isEndish:r,isMoveish:o,isStartish:i,executeDirectDispatch:c,executeDispatchesInOrder:s,executeDispatchesInOrderStopAtTrue:l,hasDispatches:p,getInstanceFromNode:function(e){return d.getInstanceFromNode(e)},getNodeFromInstance:function(e){return d.getNodeFromInstance(e)},isAncestor:function(e,t){return f.isAncestor(e,t)},getLowestCommonAncestor:function(e,t){return f.getLowestCommonAncestor(e,t)},getParentInstance:function(e){return f.getParentInstance(e)},traverseTwoPhase:function(e,t,n){return f.traverseTwoPhase(e,t,n)},traverseEnterLeave:function(e,t,n,r,o){return f.traverseEnterLeave(e,t,n,r,o)},injection:v};t.exports=g},{112:112,137:137,142:142,50:50}],19:[function(e,t,n){"use strict";function r(e,t,n){var r=t.dispatchConfig.phasedRegistrationNames[n];return g(e,r)}function o(e,t,n){var o=r(e,n,t);o&&(n._dispatchListeners=m(n._dispatchListeners,o),n._dispatchInstances=m(n._dispatchInstances,e))}function i(e){e&&e.dispatchConfig.phasedRegistrationNames&&h.traverseTwoPhase(e._targetInst,o,e)}function a(e){if(e&&e.dispatchConfig.phasedRegistrationNames){var t=e._targetInst,n=t?h.getParentInstance(t):null;h.traverseTwoPhase(n,o,e)}}function s(e,t,n){if(n&&n.dispatchConfig.registrationName){var r=n.dispatchConfig.registrationName,o=g(e,r);o&&(n._dispatchListeners=m(n._dispatchListeners,o),n._dispatchInstances=m(n._dispatchInstances,e))}}function u(e){e&&e.dispatchConfig.registrationName&&s(e._targetInst,null,e)}function l(e){v(e,i)}function c(e){v(e,a)}function p(e,t,n,r){h.traverseEnterLeave(n,r,s,e,t)}function d(e){v(e,u)}var f=e(16),h=e(18),m=e(91),v=e(98),g=(e(142),f.getListener),y={accumulateTwoPhaseDispatches:l,accumulateTwoPhaseDispatchesSkipTarget:c,accumulateDirectDispatches:d,accumulateEnterLeaveDispatches:p};t.exports=y},{142:142,16:16,18:18,91:91,98:98}],20:[function(e,t,n){"use strict";function r(e){this._root=e,this._startText=this.getText(),this._fallbackText=null}var o=e(143),i=e(24),a=e(106);o(r.prototype,{destructor:function(){this._root=null,this._startText=null,this._fallbackText=null},getText:function(){return"value"in this._root?this._root.value:this._root[a()]},getData:function(){if(this._fallbackText)return this._fallbackText;var e,t,n=this._startText,r=n.length,o=this.getText(),i=o.length;for(e=0;e<r&&n[e]===o[e];e++);var a=r-e;for(t=1;t<=a&&n[r-t]===o[i-t];t++);var s=t>1?1-t:void 0;return this._fallbackText=o.slice(e,s),this._fallbackText}}),i.addPoolingTo(r),t.exports=r},{106:106,143:143,24:24}],21:[function(e,t,n){"use strict";var r=e(11),o=r.injection.MUST_USE_PROPERTY,i=r.injection.HAS_BOOLEAN_VALUE,a=r.injection.HAS_NUMERIC_VALUE,s=r.injection.HAS_POSITIVE_NUMERIC_VALUE,u=r.injection.HAS_OVERLOADED_BOOLEAN_VALUE,l={isCustomAttribute:RegExp.prototype.test.bind(new RegExp("^(data|aria)-["+r.ATTRIBUTE_NAME_CHAR+"]*$")),Properties:{accept:0,acceptCharset:0,accessKey:0,action:0,allowFullScreen:i,allowTransparency:0,alt:0,as:0,async:i,autoComplete:0,autoPlay:i,capture:i,cellPadding:0,cellSpacing:0,charSet:0,challenge:0,checked:o|i,cite:0,classID:0,className:0,cols:s,colSpan:0,content:0,contentEditable:0,contextMenu:0,controls:i,coords:0,crossOrigin:0,data:0,dateTime:0,default:i,defer:i,dir:0,disabled:i,download:u,draggable:0,encType:0,form:0,formAction:0,formEncType:0,formMethod:0,formNoValidate:i,formTarget:0,frameBorder:0,headers:0,height:0,hidden:i,high:0,href:0,hrefLang:0,htmlFor:0,httpEquiv:0,icon:0,id:0,inputMode:0,integrity:0,is:0,keyParams:0,keyType:0,kind:0,label:0,lang:0,list:0,loop:i,low:0,manifest:0,marginHeight:0,marginWidth:0,max:0,maxLength:0,media:0,mediaGroup:0,method:0,min:0,minLength:0,multiple:o|i,muted:o|i,name:0,nonce:0,noValidate:i,open:i,optimum:0,pattern:0,placeholder:0,playsInline:i,poster:0,preload:0,profile:0,radioGroup:0,readOnly:i,referrerPolicy:0,rel:0,required:i,reversed:i,role:0,rows:s,rowSpan:a,sandbox:0,scope:0,scoped:i,scrolling:0,seamless:i,selected:o|i,shape:0,size:s,sizes:0,span:s,spellCheck:0,src:0,srcDoc:0,srcLang:0,srcSet:0,start:a,step:0,style:0,summary:0,tabIndex:0,target:0,title:0,type:0,useMap:0,value:0,width:0,wmode:0,wrap:0,about:0,datatype:0,inlist:0,prefix:0,property:0,resource:0,typeof:0,vocab:0,autoCapitalize:0,autoCorrect:0,autoSave:0,color:0,itemProp:0,itemScope:i,itemType:0,itemID:0,itemRef:0,results:0,security:0,unselectable:0},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMPropertyNames:{},DOMMutationMethods:{value:function(e,t){if(null==t)return e.removeAttribute("value");"number"!==e.type||!1===e.hasAttribute("value")?e.setAttribute("value",""+t):e.validity&&!e.validity.badInput&&e.ownerDocument.activeElement!==e&&e.setAttribute("value",""+t)}}};t.exports=l},{11:11}],22:[function(e,t,n){"use strict";function r(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(e){return t[e]})}function o(e){var t={"=0":"=","=2":":"};return(""+("."===e[0]&&"$"===e[1]?e.substring(2):e.substring(1))).replace(/(=0|=2)/g,function(e){return t[e]})}var i={escape:r,unescape:o};t.exports=i},{}],23:[function(e,t,n){"use strict";function r(e){null!=e.checkedLink&&null!=e.valueLink&&s("87")}function o(e){r(e),(null!=e.value||null!=e.onChange)&&s("88")}function i(e){r(e),(null!=e.checked||null!=e.onChange)&&s("89")}function a(e){if(e){var t=e.getName();if(t)return" Check the render method of `"+t+"`."}return""}var s=e(112),u=e(64),l=e(145),c=e(120),p=l(c.isValidElement),d=(e(137),e(142),{button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0}),f={value:function(e,t,n){return!e[t]||d[e.type]||e.onChange||e.readOnly||e.disabled?null:new Error("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.")},checked:function(e,t,n){return!e[t]||e.onChange||e.readOnly||e.disabled?null:new Error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.")},onChange:p.func},h={},m={checkPropTypes:function(e,t,n){for(var r in f){if(f.hasOwnProperty(r))var o=f[r](t,r,e,"prop",null,u);o instanceof Error&&!(o.message in h)&&(h[o.message]=!0,a(n))}},getValue:function(e){return e.valueLink?(o(e),e.valueLink.value):e.value},getChecked:function(e){return e.checkedLink?(i(e),e.checkedLink.value):e.checked},executeOnChange:function(e,t){return e.valueLink?(o(e),e.valueLink.requestChange(t.target.value)):e.checkedLink?(i(e),e.checkedLink.requestChange(t.target.checked)):e.onChange?e.onChange.call(void 0,t):void 0}};t.exports=m},{112:112,120:120,137:137,142:142,145:145,64:64}],24:[function(e,t,n){"use strict";var r=e(112),o=(e(137),function(e){var t=this;if(t.instancePool.length){var n=t.instancePool.pop();return t.call(n,e),n}return new t(e)}),i=function(e,t){var n=this;if(n.instancePool.length){var r=n.instancePool.pop();return n.call(r,e,t),r}return new n(e,t)},a=function(e,t,n){var r=this;if(r.instancePool.length){var o=r.instancePool.pop();return r.call(o,e,t,n),o}return new r(e,t,n)},s=function(e,t,n,r){var o=this;if(o.instancePool.length){var i=o.instancePool.pop();return o.call(i,e,t,n,r),i}return new o(e,t,n,r)},u=function(e){var t=this;e instanceof t||r("25"),e.destructor(),t.instancePool.length<t.poolSize&&t.instancePool.push(e)},l=o,c=function(e,t){var n=e;return n.instancePool=[],n.getPooled=t||l,n.poolSize||(n.poolSize=10),n.release=u,n},p={addPoolingTo:c,oneArgumentPooler:o,twoArgumentPooler:i,threeArgumentPooler:a,fourArgumentPooler:s};t.exports=p},{112:112,137:137}],25:[function(e,t,n){"use strict";function r(e){return Object.prototype.hasOwnProperty.call(e,m)||(e[m]=f++,p[e[m]]={}),p[e[m]]}var o,i=e(143),a=e(17),s=e(51),u=e(90),l=e(107),c=e(109),p={},d=!1,f=0,h={topAbort:"abort",topAnimationEnd:l("animationend")||"animationend",topAnimationIteration:l("animationiteration")||"animationiteration",topAnimationStart:l("animationstart")||"animationstart",topBlur:"blur",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topChange:"change",topClick:"click",topCompositionEnd:"compositionend",topCompositionStart:"compositionstart",topCompositionUpdate:"compositionupdate",topContextMenu:"contextmenu",topCopy:"copy",topCut:"cut",topDoubleClick:"dblclick",topDrag:"drag",topDragEnd:"dragend",topDragEnter:"dragenter",topDragExit:"dragexit",topDragLeave:"dragleave",topDragOver:"dragover",topDragStart:"dragstart",topDrop:"drop",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",
+topFocus:"focus",topInput:"input",topKeyDown:"keydown",topKeyPress:"keypress",topKeyUp:"keyup",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topMouseDown:"mousedown",topMouseMove:"mousemove",topMouseOut:"mouseout",topMouseOver:"mouseover",topMouseUp:"mouseup",topPaste:"paste",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topScroll:"scroll",topSeeked:"seeked",topSeeking:"seeking",topSelectionChange:"selectionchange",topStalled:"stalled",topSuspend:"suspend",topTextInput:"textInput",topTimeUpdate:"timeupdate",topTouchCancel:"touchcancel",topTouchEnd:"touchend",topTouchMove:"touchmove",topTouchStart:"touchstart",topTransitionEnd:l("transitionend")||"transitionend",topVolumeChange:"volumechange",topWaiting:"waiting",topWheel:"wheel"},m="_reactListenersID"+String(Math.random()).slice(2),v=i({},s,{ReactEventListener:null,injection:{injectReactEventListener:function(e){e.setHandleTopLevel(v.handleTopLevel),v.ReactEventListener=e}},setEnabled:function(e){v.ReactEventListener&&v.ReactEventListener.setEnabled(e)},isEnabled:function(){return!(!v.ReactEventListener||!v.ReactEventListener.isEnabled())},listenTo:function(e,t){for(var n=t,o=r(n),i=a.registrationNameDependencies[e],s=0;s<i.length;s++){var u=i[s];o.hasOwnProperty(u)&&o[u]||("topWheel"===u?c("wheel")?v.ReactEventListener.trapBubbledEvent("topWheel","wheel",n):c("mousewheel")?v.ReactEventListener.trapBubbledEvent("topWheel","mousewheel",n):v.ReactEventListener.trapBubbledEvent("topWheel","DOMMouseScroll",n):"topScroll"===u?c("scroll",!0)?v.ReactEventListener.trapCapturedEvent("topScroll","scroll",n):v.ReactEventListener.trapBubbledEvent("topScroll","scroll",v.ReactEventListener.WINDOW_HANDLE):"topFocus"===u||"topBlur"===u?(c("focus",!0)?(v.ReactEventListener.trapCapturedEvent("topFocus","focus",n),v.ReactEventListener.trapCapturedEvent("topBlur","blur",n)):c("focusin")&&(v.ReactEventListener.trapBubbledEvent("topFocus","focusin",n),v.ReactEventListener.trapBubbledEvent("topBlur","focusout",n)),o.topBlur=!0,o.topFocus=!0):h.hasOwnProperty(u)&&v.ReactEventListener.trapBubbledEvent(u,h[u],n),o[u]=!0)}},trapBubbledEvent:function(e,t,n){return v.ReactEventListener.trapBubbledEvent(e,t,n)},trapCapturedEvent:function(e,t,n){return v.ReactEventListener.trapCapturedEvent(e,t,n)},supportsEventPageXY:function(){if(!document.createEvent)return!1;var e=document.createEvent("MouseEvent");return null!=e&&"pageX"in e},ensureScrollValueMonitoring:function(){if(void 0===o&&(o=v.supportsEventPageXY()),!o&&!d){var e=u.refreshScrollValues;v.ReactEventListener.monitorScrollValue(e),d=!0}}});t.exports=v},{107:107,109:109,143:143,17:17,51:51,90:90}],26:[function(e,t,n){(function(n){"use strict";function r(e,t,n,r){var o=void 0===e[n];null!=t&&o&&(e[n]=i(t,!0))}var o=e(66),i=e(108),a=(e(22),e(116)),s=e(117);e(142);void 0!==n&&n.env;var u={instantiateChildren:function(e,t,n,o){if(null==e)return null;var i={};return s(e,r,i),i},updateChildren:function(e,t,n,r,s,u,l,c,p){if(t||e){var d,f;for(d in t)if(t.hasOwnProperty(d)){f=e&&e[d];var h=f&&f._currentElement,m=t[d];if(null!=f&&a(h,m))o.receiveComponent(f,m,s,c),t[d]=f;else{f&&(r[d]=o.getHostNode(f),o.unmountComponent(f,!1));var v=i(m,!0);t[d]=v;var g=o.mountComponent(v,s,u,l,c,p);n.push(g)}}for(d in e)!e.hasOwnProperty(d)||t&&t.hasOwnProperty(d)||(f=e[d],r[d]=o.getHostNode(f),o.unmountComponent(f,!1))}},unmountChildren:function(e,t){for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];o.unmountComponent(r,t)}}};t.exports=u}).call(this,void 0)},{108:108,116:116,117:117,142:142,22:22,66:66}],27:[function(e,t,n){"use strict";var r=e(8),o=e(37),i={processChildrenUpdates:o.dangerouslyProcessChildrenUpdates,replaceNodeWithMarkup:r.dangerouslyReplaceNodeWithMarkup};t.exports=i},{37:37,8:8}],28:[function(e,t,n){"use strict";var r=e(112),o=(e(137),!1),i={replaceNodeWithMarkup:null,processChildrenUpdates:null,injection:{injectEnvironment:function(e){o&&r("104"),i.replaceNodeWithMarkup=e.replaceNodeWithMarkup,i.processChildrenUpdates=e.processChildrenUpdates,o=!0}}};t.exports=i},{112:112,137:137}],29:[function(e,t,n){"use strict";function r(e){}function o(e){return!(!e.prototype||!e.prototype.isReactComponent)}function i(e){return!(!e.prototype||!e.prototype.isPureReactComponent)}var a=e(112),s=e(143),u=e(120),l=e(28),c=e(119),p=e(50),d=e(57),f=(e(58),e(62)),h=e(66),m=e(130),v=(e(137),e(141)),g=e(116),y=(e(142),{ImpureClass:0,PureClass:1,StatelessFunctional:2});r.prototype.render=function(){var e=d.get(this)._currentElement.type,t=e(this.props,this.context,this.updater);return t};var _=1,C={construct:function(e){this._currentElement=e,this._rootNodeID=0,this._compositeType=null,this._instance=null,this._hostParent=null,this._hostContainerInfo=null,this._updateBatchNumber=null,this._pendingElement=null,this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._renderedNodeType=null,this._renderedComponent=null,this._context=null,this._mountOrder=0,this._topLevelWrapper=null,this._pendingCallbacks=null,this._calledComponentWillUnmount=!1},mountComponent:function(e,t,n,s){this._context=s,this._mountOrder=_++,this._hostParent=t,this._hostContainerInfo=n;var l,c=this._currentElement.props,p=this._processContext(s),f=this._currentElement.type,h=e.getUpdateQueue(),v=o(f),g=this._constructComponent(v,c,p,h);v||null!=g&&null!=g.render?i(f)?this._compositeType=y.PureClass:this._compositeType=y.ImpureClass:(l=g,null===g||!1===g||u.isValidElement(g)||a("105",f.displayName||f.name||"Component"),g=new r(f),this._compositeType=y.StatelessFunctional),g.props=c,g.context=p,g.refs=m,g.updater=h,this._instance=g,d.set(g,this);var C=g.state;void 0===C&&(g.state=C=null),("object"!=typeof C||Array.isArray(C))&&a("106",this.getName()||"ReactCompositeComponent"),this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1;var b;return b=g.unstable_handleError?this.performInitialMountWithErrorHandling(l,t,n,e,s):this.performInitialMount(l,t,n,e,s),g.componentDidMount&&e.getReactMountReady().enqueue(g.componentDidMount,g),b},_constructComponent:function(e,t,n,r){return this._constructComponentWithoutOwner(e,t,n,r)},_constructComponentWithoutOwner:function(e,t,n,r){var o=this._currentElement.type;return e?new o(t,n,r):o(t,n,r)},performInitialMountWithErrorHandling:function(e,t,n,r,o){var i,a=r.checkpoint();try{i=this.performInitialMount(e,t,n,r,o)}catch(s){r.rollback(a),this._instance.unstable_handleError(s),this._pendingStateQueue&&(this._instance.state=this._processPendingState(this._instance.props,this._instance.context)),a=r.checkpoint(),this._renderedComponent.unmountComponent(!0),r.rollback(a),i=this.performInitialMount(e,t,n,r,o)}return i},performInitialMount:function(e,t,n,r,o){var i=this._instance;i.componentWillMount&&(i.componentWillMount(),this._pendingStateQueue&&(i.state=this._processPendingState(i.props,i.context))),void 0===e&&(e=this._renderValidatedComponent());var a=f.getType(e);this._renderedNodeType=a;var s=this._instantiateReactComponent(e,a!==f.EMPTY);return this._renderedComponent=s,h.mountComponent(s,r,t,n,this._processChildContext(o),0)},getHostNode:function(){return h.getHostNode(this._renderedComponent)},unmountComponent:function(e){if(this._renderedComponent){var t=this._instance;if(t.componentWillUnmount&&!t._calledComponentWillUnmount)if(t._calledComponentWillUnmount=!0,e){var n=this.getName()+".componentWillUnmount()";p.invokeGuardedCallback(n,t.componentWillUnmount.bind(t))}else t.componentWillUnmount();this._renderedComponent&&(h.unmountComponent(this._renderedComponent,e),this._renderedNodeType=null,this._renderedComponent=null,this._instance=null),this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._pendingCallbacks=null,this._pendingElement=null,this._context=null,this._rootNodeID=0,this._topLevelWrapper=null,d.remove(t)}},_maskContext:function(e){var t=this._currentElement.type,n=t.contextTypes;if(!n)return m;var r={};for(var o in n)r[o]=e[o];return r},_processContext:function(e){return this._maskContext(e)},_processChildContext:function(e){var t,n=this._currentElement.type,r=this._instance;if(r.getChildContext&&(t=r.getChildContext()),t){"object"!=typeof n.childContextTypes&&a("107",this.getName()||"ReactCompositeComponent");for(var o in t)o in n.childContextTypes||a("108",this.getName()||"ReactCompositeComponent",o);return s({},e,t)}return e},_checkContextTypes:function(e,t,n){},receiveComponent:function(e,t,n){var r=this._currentElement,o=this._context;this._pendingElement=null,this.updateComponent(t,r,e,o,n)},performUpdateIfNecessary:function(e){null!=this._pendingElement?h.receiveComponent(this,this._pendingElement,e,this._context):null!==this._pendingStateQueue||this._pendingForceUpdate?this.updateComponent(e,this._currentElement,this._currentElement,this._context,this._context):this._updateBatchNumber=null},updateComponent:function(e,t,n,r,o){var i=this._instance;null==i&&a("136",this.getName()||"ReactCompositeComponent");var s,u=!1;this._context===o?s=i.context:(s=this._processContext(o),u=!0);var l=t.props,c=n.props;t!==n&&(u=!0),u&&i.componentWillReceiveProps&&i.componentWillReceiveProps(c,s);var p=this._processPendingState(c,s),d=!0;this._pendingForceUpdate||(i.shouldComponentUpdate?d=i.shouldComponentUpdate(c,p,s):this._compositeType===y.PureClass&&(d=!v(l,c)||!v(i.state,p))),this._updateBatchNumber=null,d?(this._pendingForceUpdate=!1,this._performComponentUpdate(n,c,p,s,e,o)):(this._currentElement=n,this._context=o,i.props=c,i.state=p,i.context=s)},_processPendingState:function(e,t){var n=this._instance,r=this._pendingStateQueue,o=this._pendingReplaceState;if(this._pendingReplaceState=!1,this._pendingStateQueue=null,!r)return n.state;if(o&&1===r.length)return r[0];for(var i=s({},o?r[0]:n.state),a=o?1:0;a<r.length;a++){var u=r[a];s(i,"function"==typeof u?u.call(n,i,e,t):u)}return i},_performComponentUpdate:function(e,t,n,r,o,i){var a,s,u,l=this._instance,c=Boolean(l.componentDidUpdate);c&&(a=l.props,s=l.state,u=l.context),l.componentWillUpdate&&l.componentWillUpdate(t,n,r),this._currentElement=e,this._context=i,l.props=t,l.state=n,l.context=r,this._updateRenderedComponent(o,i),c&&o.getReactMountReady().enqueue(l.componentDidUpdate.bind(l,a,s,u),l)},_updateRenderedComponent:function(e,t){var n=this._renderedComponent,r=n._currentElement,o=this._renderValidatedComponent();if(g(r,o))h.receiveComponent(n,o,e,this._processChildContext(t));else{var i=h.getHostNode(n);h.unmountComponent(n,!1);var a=f.getType(o);this._renderedNodeType=a;var s=this._instantiateReactComponent(o,a!==f.EMPTY);this._renderedComponent=s;var u=h.mountComponent(s,e,this._hostParent,this._hostContainerInfo,this._processChildContext(t),0);this._replaceNodeWithMarkup(i,u,n)}},_replaceNodeWithMarkup:function(e,t,n){l.replaceNodeWithMarkup(e,t,n)},_renderValidatedComponentWithoutOwnerOrContext:function(){return this._instance.render()},_renderValidatedComponent:function(){var e;if(this._compositeType!==y.StatelessFunctional){c.current=this;try{e=this._renderValidatedComponentWithoutOwnerOrContext()}finally{c.current=null}}else e=this._renderValidatedComponentWithoutOwnerOrContext();return null===e||!1===e||u.isValidElement(e)||a("109",this.getName()||"ReactCompositeComponent"),e},attachRef:function(e,t){var n=this.getPublicInstance();null==n&&a("110");var r=t.getPublicInstance();(n.refs===m?n.refs={}:n.refs)[e]=r},detachRef:function(e){delete this.getPublicInstance().refs[e]},getName:function(){var e=this._currentElement.type,t=this._instance&&this._instance.constructor;return e.displayName||t&&t.displayName||e.name||t&&t.name||null},getPublicInstance:function(){var e=this._instance;return this._compositeType===y.StatelessFunctional?null:e},_instantiateReactComponent:null};t.exports=C},{112:112,116:116,119:119,120:120,130:130,137:137,141:141,142:142,143:143,28:28,50:50,57:57,58:58,62:62,66:66}],30:[function(e,t,n){"use strict";var r=e(33),o=e(47),i=e(60),a=e(66),s=e(71),u=e(72),l=e(96),c=e(103),p=e(113);e(142);o.inject();var d={findDOMNode:l,render:i.render,unmountComponentAtNode:i.unmountComponentAtNode,version:u,unstable_batchedUpdates:s.batchedUpdates,unstable_renderSubtreeIntoContainer:p};"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject&&__REACT_DEVTOOLS_GLOBAL_HOOK__.inject({ComponentTree:{getClosestInstanceFromNode:r.getClosestInstanceFromNode,getNodeFromInstance:function(e){return e._renderedComponent&&(e=c(e)),e?r.getNodeFromInstance(e):null}},Mount:i,Reconciler:a});t.exports=d},{103:103,113:113,142:142,33:33,47:47,60:60,66:66,71:71,72:72,96:96}],31:[function(e,t,n){"use strict";function r(e){if(e){var t=e._currentElement._owner||null;if(t){var n=t.getName();if(n)return" This DOM node was rendered by `"+n+"`."}}return""}function o(e,t){t&&(Y[e._tag]&&(null!=t.children||null!=t.dangerouslySetInnerHTML)&&m("137",e._tag,e._currentElement._owner?" Check the render method of "+e._currentElement._owner.getName()+".":""),null!=t.dangerouslySetInnerHTML&&(null!=t.children&&m("60"),"object"==typeof t.dangerouslySetInnerHTML&&B in t.dangerouslySetInnerHTML||m("61")),null!=t.style&&"object"!=typeof t.style&&m("62",r(e)))}function i(e,t,n,r){if(!(r instanceof R)){var o=e._hostContainerInfo,i=o._node&&o._node.nodeType===H,s=i?o._node:o._ownerDocument;F(t,s),r.getReactMountReady().enqueue(a,{inst:e,registrationName:t,listener:n})}}function a(){var e=this;x.putListener(e.inst,e.registrationName,e.listener)}function s(){var e=this;S.postMountWrapper(e)}function u(){var e=this;I.postMountWrapper(e)}function l(){var e=this;N.postMountWrapper(e)}function c(){var e=this;e._rootNodeID||m("63");var t=U(e);switch(t||m("64"),e._tag){case"iframe":case"object":e._wrapperState.listeners=[T.trapBubbledEvent("topLoad","load",t)];break;case"video":case"audio":e._wrapperState.listeners=[];for(var n in q)q.hasOwnProperty(n)&&e._wrapperState.listeners.push(T.trapBubbledEvent(n,q[n],t));break;case"source":e._wrapperState.listeners=[T.trapBubbledEvent("topError","error",t)];break;case"img":e._wrapperState.listeners=[T.trapBubbledEvent("topError","error",t),T.trapBubbledEvent("topLoad","load",t)];break;case"form":e._wrapperState.listeners=[T.trapBubbledEvent("topReset","reset",t),T.trapBubbledEvent("topSubmit","submit",t)];break;case"input":case"select":case"textarea":e._wrapperState.listeners=[T.trapBubbledEvent("topInvalid","invalid",t)]}}function p(){M.postUpdateWrapper(this)}function d(e){G.call(Q,e)||(X.test(e)||m("65",e),Q[e]=!0)}function f(e,t){return e.indexOf("-")>=0||null!=t.is}function h(e){var t=e.type;d(t),this._currentElement=e,this._tag=t.toLowerCase(),this._namespaceURI=null,this._renderedChildren=null,this._previousStyle=null,this._previousStyleCopy=null,this._hostNode=null,this._hostParent=null,this._rootNodeID=0,this._domID=0,this._hostContainerInfo=null,this._wrapperState=null,this._topLevelWrapper=null,this._flags=0}var m=e(112),v=e(143),g=e(2),y=e(5),_=e(9),C=e(10),b=e(11),E=e(12),x=e(16),w=e(17),T=e(25),k=e(32),P=e(33),S=e(38),N=e(39),M=e(40),I=e(43),O=(e(58),e(61)),R=e(68),A=(e(129),e(95)),D=(e(137),e(109),e(141),e(118),e(142),k),L=x.deleteListener,U=P.getNodeFromInstance,F=T.listenTo,j=w.registrationNameModules,V={string:!0,number:!0},B="__html",W={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null},H=11,q={topAbort:"abort",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topSeeked:"seeked",topSeeking:"seeking",topStalled:"stalled",topSuspend:"suspend",topTimeUpdate:"timeupdate",topVolumeChange:"volumechange",topWaiting:"waiting"},K={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},z={listing:!0,pre:!0,textarea:!0},Y=v({menuitem:!0},K),X=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,Q={},G={}.hasOwnProperty,$=1;h.displayName="ReactDOMComponent",h.Mixin={mountComponent:function(e,t,n,r){this._rootNodeID=$++,this._domID=n._idCounter++,this._hostParent=t,this._hostContainerInfo=n;var i=this._currentElement.props;switch(this._tag){case"audio":case"form":case"iframe":case"img":case"link":case"object":case"source":case"video":this._wrapperState={listeners:null},e.getReactMountReady().enqueue(c,this);break;case"input":S.mountWrapper(this,i,t),i=S.getHostProps(this,i),e.getReactMountReady().enqueue(c,this);break;case"option":N.mountWrapper(this,i,t),i=N.getHostProps(this,i);break;case"select":M.mountWrapper(this,i,t),i=M.getHostProps(this,i),e.getReactMountReady().enqueue(c,this);break;case"textarea":I.mountWrapper(this,i,t),i=I.getHostProps(this,i),e.getReactMountReady().enqueue(c,this)}o(this,i);var a,p;null!=t?(a=t._namespaceURI,p=t._tag):n._tag&&(a=n._namespaceURI,p=n._tag),(null==a||a===C.svg&&"foreignobject"===p)&&(a=C.html),a===C.html&&("svg"===this._tag?a=C.svg:"math"===this._tag&&(a=C.mathml)),this._namespaceURI=a;var d;if(e.useCreateElement){var f,h=n._ownerDocument;if(a===C.html)if("script"===this._tag){var m=h.createElement("div"),v=this._currentElement.type;m.innerHTML="<"+v+"></"+v+">",f=m.removeChild(m.firstChild)}else f=i.is?h.createElement(this._currentElement.type,i.is):h.createElement(this._currentElement.type);else f=h.createElementNS(a,this._currentElement.type);P.precacheNode(this,f),this._flags|=D.hasCachedChildNodes,this._hostParent||E.setAttributeForRoot(f),this._updateDOMProperties(null,i,e);var y=_(f);this._createInitialChildren(e,i,r,y),d=y}else{var b=this._createOpenTagMarkupAndPutListeners(e,i),x=this._createContentMarkup(e,i,r);d=!x&&K[this._tag]?b+"/>":b+">"+x+"</"+this._currentElement.type+">"}switch(this._tag){case"input":e.getReactMountReady().enqueue(s,this),i.autoFocus&&e.getReactMountReady().enqueue(g.focusDOMComponent,this);break;case"textarea":e.getReactMountReady().enqueue(u,this),i.autoFocus&&e.getReactMountReady().enqueue(g.focusDOMComponent,this);break;case"select":case"button":i.autoFocus&&e.getReactMountReady().enqueue(g.focusDOMComponent,this);break;case"option":e.getReactMountReady().enqueue(l,this)}return d},_createOpenTagMarkupAndPutListeners:function(e,t){var n="<"+this._currentElement.type;for(var r in t)if(t.hasOwnProperty(r)){var o=t[r];if(null!=o)if(j.hasOwnProperty(r))o&&i(this,r,o,e);else{"style"===r&&(o&&(o=this._previousStyleCopy=v({},t.style)),o=y.createMarkupForStyles(o,this));var a=null;null!=this._tag&&f(this._tag,t)?W.hasOwnProperty(r)||(a=E.createMarkupForCustomAttribute(r,o)):a=E.createMarkupForProperty(r,o),a&&(n+=" "+a)}}return e.renderToStaticMarkup?n:(this._hostParent||(n+=" "+E.createMarkupForRoot()),n+=" "+E.createMarkupForID(this._domID))},_createContentMarkup:function(e,t,n){var r="",o=t.dangerouslySetInnerHTML;if(null!=o)null!=o.__html&&(r=o.__html);else{var i=V[typeof t.children]?t.children:null,a=null!=i?null:t.children;if(null!=i)r=A(i);else if(null!=a){var s=this.mountChildren(a,e,n);r=s.join("")}}return z[this._tag]&&"\n"===r.charAt(0)?"\n"+r:r},_createInitialChildren:function(e,t,n,r){var o=t.dangerouslySetInnerHTML;if(null!=o)null!=o.__html&&_.queueHTML(r,o.__html);else{var i=V[typeof t.children]?t.children:null,a=null!=i?null:t.children;if(null!=i)""!==i&&_.queueText(r,i);else if(null!=a)for(var s=this.mountChildren(a,e,n),u=0;u<s.length;u++)_.queueChild(r,s[u])}},receiveComponent:function(e,t,n){var r=this._currentElement;this._currentElement=e,this.updateComponent(t,r,e,n)},updateComponent:function(e,t,n,r){var i=t.props,a=this._currentElement.props;switch(this._tag){case"input":i=S.getHostProps(this,i),a=S.getHostProps(this,a);break;case"option":i=N.getHostProps(this,i),a=N.getHostProps(this,a);break;case"select":i=M.getHostProps(this,i),a=M.getHostProps(this,a);break;case"textarea":i=I.getHostProps(this,i),a=I.getHostProps(this,a)}switch(o(this,a),this._updateDOMProperties(i,a,e),this._updateDOMChildren(i,a,e,r),this._tag){case"input":S.updateWrapper(this);break;case"textarea":I.updateWrapper(this);break;case"select":e.getReactMountReady().enqueue(p,this)}},_updateDOMProperties:function(e,t,n){var r,o,a;for(r in e)if(!t.hasOwnProperty(r)&&e.hasOwnProperty(r)&&null!=e[r])if("style"===r){var s=this._previousStyleCopy;for(o in s)s.hasOwnProperty(o)&&(a=a||{},a[o]="");this._previousStyleCopy=null}else j.hasOwnProperty(r)?e[r]&&L(this,r):f(this._tag,e)?W.hasOwnProperty(r)||E.deleteValueForAttribute(U(this),r):(b.properties[r]||b.isCustomAttribute(r))&&E.deleteValueForProperty(U(this),r);for(r in t){var u=t[r],l="style"===r?this._previousStyleCopy:null!=e?e[r]:void 0;if(t.hasOwnProperty(r)&&u!==l&&(null!=u||null!=l))if("style"===r)if(u?u=this._previousStyleCopy=v({},u):this._previousStyleCopy=null,l){for(o in l)!l.hasOwnProperty(o)||u&&u.hasOwnProperty(o)||(a=a||{},a[o]="");for(o in u)u.hasOwnProperty(o)&&l[o]!==u[o]&&(a=a||{},a[o]=u[o])}else a=u;else if(j.hasOwnProperty(r))u?i(this,r,u,n):l&&L(this,r);else if(f(this._tag,t))W.hasOwnProperty(r)||E.setValueForAttribute(U(this),r,u);else if(b.properties[r]||b.isCustomAttribute(r)){var c=U(this);null!=u?E.setValueForProperty(c,r,u):E.deleteValueForProperty(c,r)}}a&&y.setValueForStyles(U(this),a,this)},_updateDOMChildren:function(e,t,n,r){var o=V[typeof e.children]?e.children:null,i=V[typeof t.children]?t.children:null,a=e.dangerouslySetInnerHTML&&e.dangerouslySetInnerHTML.__html,s=t.dangerouslySetInnerHTML&&t.dangerouslySetInnerHTML.__html,u=null!=o?null:e.children,l=null!=i?null:t.children,c=null!=o||null!=a,p=null!=i||null!=s;null!=u&&null==l?this.updateChildren(null,n,r):c&&!p&&this.updateTextContent(""),null!=i?o!==i&&this.updateTextContent(""+i):null!=s?a!==s&&this.updateMarkup(""+s):null!=l&&this.updateChildren(l,n,r)},getHostNode:function(){return U(this)},unmountComponent:function(e){switch(this._tag){case"audio":case"form":case"iframe":case"img":case"link":case"object":case"source":case"video":var t=this._wrapperState.listeners;if(t)for(var n=0;n<t.length;n++)t[n].remove();break;case"html":case"head":case"body":m("66",this._tag)}this.unmountChildren(e),P.uncacheNode(this),x.deleteAllListeners(this),this._rootNodeID=0,this._domID=0,this._wrapperState=null},getPublicInstance:function(){return U(this)}},v(h.prototype,h.Mixin,O.Mixin),t.exports=h},{10:10,109:109,11:11,112:112,118:118,12:12,129:129,137:137,141:141,142:142,143:143,16:16,17:17,2:2,25:25,32:32,33:33,38:38,39:39,40:40,43:43,5:5,58:58,61:61,68:68,9:9,95:95}],32:[function(e,t,n){"use strict";var r={hasCachedChildNodes:1};t.exports=r},{}],33:[function(e,t,n){"use strict";function r(e,t){return 1===e.nodeType&&e.getAttribute(h)===String(t)||8===e.nodeType&&e.nodeValue===" react-text: "+t+" "||8===e.nodeType&&e.nodeValue===" react-empty: "+t+" "}function o(e){for(var t;t=e._renderedComponent;)e=t;return e}function i(e,t){var n=o(e);n._hostNode=t,t[v]=n}function a(e){var t=e._hostNode;t&&(delete t[v],e._hostNode=null)}function s(e,t){if(!(e._flags&m.hasCachedChildNodes)){var n=e._renderedChildren,a=t.firstChild;e:for(var s in n)if(n.hasOwnProperty(s)){var u=n[s],l=o(u)._domID;if(0!==l){for(;null!==a;a=a.nextSibling)if(r(a,l)){i(u,a);continue e}p("32",l)}}e._flags|=m.hasCachedChildNodes}}function u(e){if(e[v])return e[v];for(var t=[];!e[v];){if(t.push(e),!e.parentNode)return null;e=e.parentNode}for(var n,r;e&&(r=e[v]);e=t.pop())n=r,t.length&&s(r,e);return n}function l(e){var t=u(e);return null!=t&&t._hostNode===e?t:null}function c(e){if(void 0===e._hostNode&&p("33"),e._hostNode)return e._hostNode;for(var t=[];!e._hostNode;)t.push(e),e._hostParent||p("34"),e=e._hostParent;for(;t.length;e=t.pop())s(e,e._hostNode);return e._hostNode}var p=e(112),d=e(11),f=e(32),h=(e(137),d.ID_ATTRIBUTE_NAME),m=f,v="__reactInternalInstance$"+Math.random().toString(36).slice(2),g={getClosestInstanceFromNode:u,getInstanceFromNode:l,getNodeFromInstance:c,precacheChildNodes:s,precacheNode:i,uncacheNode:a};t.exports=g},{11:11,112:112,137:137,32:32}],34:[function(e,t,n){"use strict";function r(e,t){return{_topLevelWrapper:e,_idCounter:1,_ownerDocument:t?t.nodeType===o?t:t.ownerDocument:null,_node:t,_tag:t?t.nodeName.toLowerCase():null,_namespaceURI:t?t.namespaceURI:null}}var o=(e(118),9);t.exports=r},{118:118}],35:[function(e,t,n){"use strict";var r=e(143),o=e(9),i=e(33),a=function(e){this._currentElement=null,this._hostNode=null,this._hostParent=null,this._hostContainerInfo=null,this._domID=0};r(a.prototype,{mountComponent:function(e,t,n,r){var a=n._idCounter++;this._domID=a,this._hostParent=t,this._hostContainerInfo=n;var s=" react-empty: "+this._domID+" ";if(e.useCreateElement){var u=n._ownerDocument,l=u.createComment(s);return i.precacheNode(this,l),o(l)}return e.renderToStaticMarkup?"":"<!--"+s+"-->"},receiveComponent:function(){},getHostNode:function(){return i.getNodeFromInstance(this)},unmountComponent:function(){i.uncacheNode(this)}}),t.exports=a},{143:143,33:33,9:9}],36:[function(e,t,n){"use strict";var r={useCreateElement:!0,useFiber:!1};t.exports=r},{}],37:[function(e,t,n){"use strict";var r=e(8),o=e(33),i={dangerouslyProcessChildrenUpdates:function(e,t){var n=o.getNodeFromInstance(e);r.processUpdates(n,t)}};t.exports=i},{33:33,8:8}],38:[function(e,t,n){"use strict";function r(){this._rootNodeID&&d.updateWrapper(this)}function o(e){return"checkbox"===e.type||"radio"===e.type?null!=e.checked:null!=e.value}function i(e){var t=this._currentElement.props,n=l.executeOnChange(t,e);p.asap(r,this);var o=t.name;if("radio"===t.type&&null!=o){for(var i=c.getNodeFromInstance(this),s=i;s.parentNode;)s=s.parentNode;for(var u=s.querySelectorAll("input[name="+JSON.stringify(""+o)+'][type="radio"]'),d=0;d<u.length;d++){var f=u[d];if(f!==i&&f.form===i.form){var h=c.getInstanceFromNode(f);h||a("90"),p.asap(r,h)}}}return n}var a=e(112),s=e(143),u=e(12),l=e(23),c=e(33),p=e(71),d=(e(137),e(142),{getHostProps:function(e,t){var n=l.getValue(t),r=l.getChecked(t);return s({type:void 0,step:void 0,min:void 0,max:void 0},t,{defaultChecked:void 0,defaultValue:void 0,value:null!=n?n:e._wrapperState.initialValue,checked:null!=r?r:e._wrapperState.initialChecked,onChange:e._wrapperState.onChange})},mountWrapper:function(e,t){var n=t.defaultValue;e._wrapperState={initialChecked:null!=t.checked?t.checked:t.defaultChecked,initialValue:null!=t.value?t.value:n,listeners:null,onChange:i.bind(e),controlled:o(t)}},updateWrapper:function(e){var t=e._currentElement.props,n=t.checked;null!=n&&u.setValueForProperty(c.getNodeFromInstance(e),"checked",n||!1);var r=c.getNodeFromInstance(e),o=l.getValue(t);if(null!=o)if(0===o&&""===r.value)r.value="0";else if("number"===t.type){var i=parseFloat(r.value,10)||0;o!=i&&(r.value=""+o)}else o!=r.value&&(r.value=""+o);else null==t.value&&null!=t.defaultValue&&r.defaultValue!==""+t.defaultValue&&(r.defaultValue=""+t.defaultValue),null==t.checked&&null!=t.defaultChecked&&(r.defaultChecked=!!t.defaultChecked)},postMountWrapper:function(e){var t=e._currentElement.props,n=c.getNodeFromInstance(e);switch(t.type){case"submit":case"reset":break;case"color":case"date":case"datetime":case"datetime-local":case"month":case"time":case"week":n.value="",n.value=n.defaultValue;break;default:n.value=n.value}var r=n.name;""!==r&&(n.name=""),n.defaultChecked=!n.defaultChecked,n.defaultChecked=!n.defaultChecked,""!==r&&(n.name=r)}});t.exports=d},{112:112,12:12,137:137,142:142,143:143,23:23,33:33,71:71}],39:[function(e,t,n){"use strict";function r(e){var t="";return i.Children.forEach(e,function(e){null!=e&&("string"==typeof e||"number"==typeof e?t+=e:u||(u=!0))}),t}var o=e(143),i=e(120),a=e(33),s=e(40),u=(e(142),!1),l={mountWrapper:function(e,t,n){var o=null;if(null!=n){var i=n;"optgroup"===i._tag&&(i=i._hostParent),null!=i&&"select"===i._tag&&(o=s.getSelectValueContext(i))}var a=null;if(null!=o){var u;if(u=null!=t.value?t.value+"":r(t.children),a=!1,Array.isArray(o)){for(var l=0;l<o.length;l++)if(""+o[l]===u){a=!0;break}}else a=""+o===u}e._wrapperState={selected:a}},postMountWrapper:function(e){var t=e._currentElement.props;null!=t.value&&a.getNodeFromInstance(e).setAttribute("value",t.value)},getHostProps:function(e,t){var n=o({selected:void 0,children:void 0},t);null!=e._wrapperState.selected&&(n.selected=e._wrapperState.selected);var i=r(t.children);return i&&(n.children=i),n}};t.exports=l},{120:120,142:142,143:143,33:33,40:40}],40:[function(e,t,n){"use strict";function r(){if(this._rootNodeID&&this._wrapperState.pendingUpdate){this._wrapperState.pendingUpdate=!1;var e=this._currentElement.props,t=s.getValue(e);null!=t&&o(this,Boolean(e.multiple),t)}}function o(e,t,n){var r,o,i=u.getNodeFromInstance(e).options;if(t){for(r={},o=0;o<n.length;o++)r[""+n[o]]=!0;for(o=0;o<i.length;o++){var a=r.hasOwnProperty(i[o].value);i[o].selected!==a&&(i[o].selected=a)}}else{for(r=""+n,o=0;o<i.length;o++)if(i[o].value===r)return void(i[o].selected=!0);i.length&&(i[0].selected=!0)}}function i(e){var t=this._currentElement.props,n=s.executeOnChange(t,e);return this._rootNodeID&&(this._wrapperState.pendingUpdate=!0),l.asap(r,this),n}var a=e(143),s=e(23),u=e(33),l=e(71),c=(e(142),!1),p={getHostProps:function(e,t){return a({},t,{onChange:e._wrapperState.onChange,value:void 0})},mountWrapper:function(e,t){var n=s.getValue(t);e._wrapperState={pendingUpdate:!1,initialValue:null!=n?n:t.defaultValue,listeners:null,onChange:i.bind(e),wasMultiple:Boolean(t.multiple)},void 0===t.value||void 0===t.defaultValue||c||(c=!0)},getSelectValueContext:function(e){return e._wrapperState.initialValue},postUpdateWrapper:function(e){var t=e._currentElement.props;e._wrapperState.initialValue=void 0;var n=e._wrapperState.wasMultiple;e._wrapperState.wasMultiple=Boolean(t.multiple);var r=s.getValue(t);null!=r?(e._wrapperState.pendingUpdate=!1,o(e,Boolean(t.multiple),r)):n!==Boolean(t.multiple)&&(null!=t.defaultValue?o(e,Boolean(t.multiple),t.defaultValue):o(e,Boolean(t.multiple),t.multiple?[]:""))}};t.exports=p},{142:142,143:143,23:23,33:33,71:71}],41:[function(e,t,n){"use strict";function r(e,t,n,r){return e===n&&t===r}function o(e){var t=document.selection,n=t.createRange(),r=n.text.length,o=n.duplicate();o.moveToElementText(e),o.setEndPoint("EndToStart",n);var i=o.text.length;return{start:i,end:i+r}}function i(e){var t=window.getSelection&&window.getSelection();if(!t||0===t.rangeCount)return null;var n=t.anchorNode,o=t.anchorOffset,i=t.focusNode,a=t.focusOffset,s=t.getRangeAt(0);try{s.startContainer.nodeType,s.endContainer.nodeType}catch(e){return null}var u=r(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset),l=u?0:s.toString().length,c=s.cloneRange();c.selectNodeContents(e),c.setEnd(s.startContainer,s.startOffset);var p=r(c.startContainer,c.startOffset,c.endContainer,c.endOffset),d=p?0:c.toString().length,f=d+l,h=document.createRange();h.setStart(n,o),h.setEnd(i,a);var m=h.collapsed;return{start:m?f:d,end:m?d:f}}function a(e,t){var n,r,o=document.selection.createRange().duplicate();void 0===t.end?(n=t.start,r=n):t.start>t.end?(n=t.end,r=t.start):(n=t.start,r=t.end),o.moveToElementText(e),o.moveStart("character",n),o.setEndPoint("EndToStart",o),o.moveEnd("character",r-n),o.select()}function s(e,t){if(window.getSelection){var n=window.getSelection(),r=e[c()].length,o=Math.min(t.start,r),i=void 0===t.end?o:Math.min(t.end,r);if(!n.extend&&o>i){var a=i;i=o,o=a}var s=l(e,o),u=l(e,i);if(s&&u){var p=document.createRange();p.setStart(s.node,s.offset),n.removeAllRanges(),o>i?(n.addRange(p),n.extend(u.node,u.offset)):(p.setEnd(u.node,u.offset),n.addRange(p))}}}var u=e(123),l=e(105),c=e(106),p=u.canUseDOM&&"selection"in document&&!("getSelection"in window),d={getOffsets:p?o:i,setOffsets:p?a:s};t.exports=d},{105:105,106:106,123:123}],42:[function(e,t,n){"use strict";var r=e(112),o=e(143),i=e(8),a=e(9),s=e(33),u=e(95),l=(e(137),e(118),function(e){this._currentElement=e,this._stringText=""+e,
+this._hostNode=null,this._hostParent=null,this._domID=0,this._mountIndex=0,this._closingComment=null,this._commentNodes=null});o(l.prototype,{mountComponent:function(e,t,n,r){var o=n._idCounter++,i=" react-text: "+o+" ";if(this._domID=o,this._hostParent=t,e.useCreateElement){var l=n._ownerDocument,c=l.createComment(i),p=l.createComment(" /react-text "),d=a(l.createDocumentFragment());return a.queueChild(d,a(c)),this._stringText&&a.queueChild(d,a(l.createTextNode(this._stringText))),a.queueChild(d,a(p)),s.precacheNode(this,c),this._closingComment=p,d}var f=u(this._stringText);return e.renderToStaticMarkup?f:"<!--"+i+"-->"+f+"<!-- /react-text -->"},receiveComponent:function(e,t){if(e!==this._currentElement){this._currentElement=e;var n=""+e;if(n!==this._stringText){this._stringText=n;var r=this.getHostNode();i.replaceDelimitedText(r[0],r[1],n)}}},getHostNode:function(){var e=this._commentNodes;if(e)return e;if(!this._closingComment)for(var t=s.getNodeFromInstance(this),n=t.nextSibling;;){if(null==n&&r("67",this._domID),8===n.nodeType&&" /react-text "===n.nodeValue){this._closingComment=n;break}n=n.nextSibling}return e=[this._hostNode,this._closingComment],this._commentNodes=e,e},unmountComponent:function(){this._closingComment=null,this._commentNodes=null,s.uncacheNode(this)}}),t.exports=l},{112:112,118:118,137:137,143:143,33:33,8:8,9:9,95:95}],43:[function(e,t,n){"use strict";function r(){this._rootNodeID&&c.updateWrapper(this)}function o(e){var t=this._currentElement.props,n=s.executeOnChange(t,e);return l.asap(r,this),n}var i=e(112),a=e(143),s=e(23),u=e(33),l=e(71),c=(e(137),e(142),{getHostProps:function(e,t){return null!=t.dangerouslySetInnerHTML&&i("91"),a({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue,onChange:e._wrapperState.onChange})},mountWrapper:function(e,t){var n=s.getValue(t),r=n;if(null==n){var a=t.defaultValue,u=t.children;null!=u&&(null!=a&&i("92"),Array.isArray(u)&&(u.length<=1||i("93"),u=u[0]),a=""+u),null==a&&(a=""),r=a}e._wrapperState={initialValue:""+r,listeners:null,onChange:o.bind(e)}},updateWrapper:function(e){var t=e._currentElement.props,n=u.getNodeFromInstance(e),r=s.getValue(t);if(null!=r){var o=""+r;o!==n.value&&(n.value=o),null==t.defaultValue&&(n.defaultValue=o)}null!=t.defaultValue&&(n.defaultValue=t.defaultValue)},postMountWrapper:function(e){var t=u.getNodeFromInstance(e),n=t.textContent;n===e._wrapperState.initialValue&&(t.value=n)}});t.exports=c},{112:112,137:137,142:142,143:143,23:23,33:33,71:71}],44:[function(e,t,n){"use strict";function r(e,t){"_hostNode"in e||u("33"),"_hostNode"in t||u("33");for(var n=0,r=e;r;r=r._hostParent)n++;for(var o=0,i=t;i;i=i._hostParent)o++;for(;n-o>0;)e=e._hostParent,n--;for(;o-n>0;)t=t._hostParent,o--;for(var a=n;a--;){if(e===t)return e;e=e._hostParent,t=t._hostParent}return null}function o(e,t){"_hostNode"in e||u("35"),"_hostNode"in t||u("35");for(;t;){if(t===e)return!0;t=t._hostParent}return!1}function i(e){return"_hostNode"in e||u("36"),e._hostParent}function a(e,t,n){for(var r=[];e;)r.push(e),e=e._hostParent;var o;for(o=r.length;o-- >0;)t(r[o],"captured",n);for(o=0;o<r.length;o++)t(r[o],"bubbled",n)}function s(e,t,n,o,i){for(var a=e&&t?r(e,t):null,s=[];e&&e!==a;)s.push(e),e=e._hostParent;for(var u=[];t&&t!==a;)u.push(t),t=t._hostParent;var l;for(l=0;l<s.length;l++)n(s[l],"bubbled",o);for(l=u.length;l-- >0;)n(u[l],"captured",i)}var u=e(112);e(137);t.exports={isAncestor:o,getLowestCommonAncestor:r,getParentInstance:i,traverseTwoPhase:a,traverseEnterLeave:s}},{112:112,137:137}],45:[function(e,t,n){"use strict";var r=e(120),o=e(30),i=o;r.addons&&(r.__SECRET_INJECTED_REACT_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=i),t.exports=i},{120:120,30:30}],46:[function(e,t,n){"use strict";function r(){this.reinitializeTransaction()}var o=e(143),i=e(71),a=e(89),s=e(129),u={initialize:s,close:function(){d.isBatchingUpdates=!1}},l={initialize:s,close:i.flushBatchedUpdates.bind(i)},c=[l,u];o(r.prototype,a,{getTransactionWrappers:function(){return c}});var p=new r,d={isBatchingUpdates:!1,batchedUpdates:function(e,t,n,r,o,i){var a=d.isBatchingUpdates;return d.isBatchingUpdates=!0,a?e(t,n,r,o,i):p.perform(e,null,t,n,r,o,i)}};t.exports=d},{129:129,143:143,71:71,89:89}],47:[function(e,t,n){"use strict";function r(){x||(x=!0,y.EventEmitter.injectReactEventListener(g),y.EventPluginHub.injectEventPluginOrder(s),y.EventPluginUtils.injectComponentTree(d),y.EventPluginUtils.injectTreeTraversal(h),y.EventPluginHub.injectEventPluginsByName({SimpleEventPlugin:E,EnterLeaveEventPlugin:u,ChangeEventPlugin:a,SelectEventPlugin:b,BeforeInputEventPlugin:i}),y.HostComponent.injectGenericComponentClass(p),y.HostComponent.injectTextComponentClass(m),y.DOMProperty.injectDOMPropertyConfig(o),y.DOMProperty.injectDOMPropertyConfig(l),y.DOMProperty.injectDOMPropertyConfig(C),y.EmptyComponent.injectEmptyComponentFactory(function(e){return new f(e)}),y.Updates.injectReconcileTransaction(_),y.Updates.injectBatchingStrategy(v),y.Component.injectEnvironment(c))}var o=e(1),i=e(3),a=e(7),s=e(14),u=e(15),l=e(21),c=e(27),p=e(31),d=e(33),f=e(35),h=e(44),m=e(42),v=e(46),g=e(52),y=e(55),_=e(65),C=e(73),b=e(74),E=e(75),x=!1;t.exports={inject:r}},{1:1,14:14,15:15,21:21,27:27,3:3,31:31,33:33,35:35,42:42,44:44,46:46,52:52,55:55,65:65,7:7,73:73,74:74,75:75}],48:[function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;t.exports=r},{}],49:[function(e,t,n){"use strict";var r,o={injectEmptyComponentFactory:function(e){r=e}},i={create:function(e){return r(e)}};i.injection=o,t.exports=i},{}],50:[function(e,t,n){"use strict";function r(e,t,n){try{t(n)}catch(e){null===o&&(o=e)}}var o=null,i={invokeGuardedCallback:r,invokeGuardedCallbackWithCatch:r,rethrowCaughtError:function(){if(o){var e=o;throw o=null,e}}};t.exports=i},{}],51:[function(e,t,n){"use strict";function r(e){o.enqueueEvents(e),o.processEventQueue(!1)}var o=e(16),i={handleTopLevel:function(e,t,n,i){r(o.extractEvents(e,t,n,i))}};t.exports=i},{16:16}],52:[function(e,t,n){"use strict";function r(e){for(;e._hostParent;)e=e._hostParent;var t=p.getNodeFromInstance(e),n=t.parentNode;return p.getClosestInstanceFromNode(n)}function o(e,t){this.topLevelType=e,this.nativeEvent=t,this.ancestors=[]}function i(e){var t=f(e.nativeEvent),n=p.getClosestInstanceFromNode(t),o=n;do{e.ancestors.push(o),o=o&&r(o)}while(o);for(var i=0;i<e.ancestors.length;i++)n=e.ancestors[i],m._handleTopLevel(e.topLevelType,n,e.nativeEvent,f(e.nativeEvent))}function a(e){e(h(window))}var s=e(143),u=e(122),l=e(123),c=e(24),p=e(33),d=e(71),f=e(102),h=e(134);s(o.prototype,{destructor:function(){this.topLevelType=null,this.nativeEvent=null,this.ancestors.length=0}}),c.addPoolingTo(o,c.twoArgumentPooler);var m={_enabled:!0,_handleTopLevel:null,WINDOW_HANDLE:l.canUseDOM?window:null,setHandleTopLevel:function(e){m._handleTopLevel=e},setEnabled:function(e){m._enabled=!!e},isEnabled:function(){return m._enabled},trapBubbledEvent:function(e,t,n){return n?u.listen(n,t,m.dispatchEvent.bind(null,e)):null},trapCapturedEvent:function(e,t,n){return n?u.capture(n,t,m.dispatchEvent.bind(null,e)):null},monitorScrollValue:function(e){var t=a.bind(null,e);u.listen(window,"scroll",t)},dispatchEvent:function(e,t){if(m._enabled){var n=o.getPooled(e,t);try{d.batchedUpdates(i,n)}finally{o.release(n)}}}};t.exports=m},{102:102,122:122,123:123,134:134,143:143,24:24,33:33,71:71}],53:[function(e,t,n){"use strict";var r={logTopLevelRenders:!1};t.exports=r},{}],54:[function(e,t,n){"use strict";function r(e){return s||a("111",e.type),new s(e)}function o(e){return new u(e)}function i(e){return e instanceof u}var a=e(112),s=(e(137),null),u=null,l={injectGenericComponentClass:function(e){s=e},injectTextComponentClass:function(e){u=e}},c={createInternalComponent:r,createInstanceForText:o,isTextComponent:i,injection:l};t.exports=c},{112:112,137:137}],55:[function(e,t,n){"use strict";var r=e(11),o=e(16),i=e(18),a=e(28),s=e(49),u=e(25),l=e(54),c=e(71),p={Component:a.injection,DOMProperty:r.injection,EmptyComponent:s.injection,EventPluginHub:o.injection,EventPluginUtils:i.injection,EventEmitter:u.injection,HostComponent:l.injection,Updates:c.injection};t.exports=p},{11:11,16:16,18:18,25:25,28:28,49:49,54:54,71:71}],56:[function(e,t,n){"use strict";function r(e){return i(document.documentElement,e)}var o=e(41),i=e(126),a=e(131),s=e(132),u={hasSelectionCapabilities:function(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&"text"===e.type||"textarea"===t||"true"===e.contentEditable)},getSelectionInformation:function(){var e=s();return{focusedElem:e,selectionRange:u.hasSelectionCapabilities(e)?u.getSelection(e):null}},restoreSelection:function(e){var t=s(),n=e.focusedElem,o=e.selectionRange;t!==n&&r(n)&&(u.hasSelectionCapabilities(n)&&u.setSelection(n,o),a(n))},getSelection:function(e){var t;if("selectionStart"in e)t={start:e.selectionStart,end:e.selectionEnd};else if(document.selection&&e.nodeName&&"input"===e.nodeName.toLowerCase()){var n=document.selection.createRange();n.parentElement()===e&&(t={start:-n.moveStart("character",-e.value.length),end:-n.moveEnd("character",-e.value.length)})}else t=o.getOffsets(e);return t||{start:0,end:0}},setSelection:function(e,t){var n=t.start,r=t.end;if(void 0===r&&(r=n),"selectionStart"in e)e.selectionStart=n,e.selectionEnd=Math.min(r,e.value.length);else if(document.selection&&e.nodeName&&"input"===e.nodeName.toLowerCase()){var i=e.createTextRange();i.collapse(!0),i.moveStart("character",n),i.moveEnd("character",r-n),i.select()}else o.setOffsets(e,t)}};t.exports=u},{126:126,131:131,132:132,41:41}],57:[function(e,t,n){"use strict";var r={remove:function(e){e._reactInternalInstance=void 0},get:function(e){return e._reactInternalInstance},has:function(e){return void 0!==e._reactInternalInstance},set:function(e,t){e._reactInternalInstance=t}};t.exports=r},{}],58:[function(e,t,n){"use strict";t.exports={debugTool:null}},{}],59:[function(e,t,n){"use strict";var r=e(92),o=/^<\!\-\-/,i={CHECKSUM_ATTR_NAME:"data-react-checksum",addChecksumToMarkup:function(e){var t=r(e);return o.test(e)?e:e.replace(/\/?>/," "+i.CHECKSUM_ATTR_NAME+'="'+t+'"$&')},canReuseMarkup:function(e,t){var n=t.getAttribute(i.CHECKSUM_ATTR_NAME);return n=n&&parseInt(n,10),r(e)===n}};t.exports=i},{92:92}],60:[function(e,t,n){"use strict";function r(e,t){for(var n=Math.min(e.length,t.length),r=0;r<n;r++)if(e.charAt(r)!==t.charAt(r))return r;return e.length===t.length?-1:n}function o(e){return e?e.nodeType===A?e.documentElement:e.firstChild:null}function i(e){return e.getAttribute&&e.getAttribute(I)||""}function a(e,t,n,r,o){var i;if(b.logTopLevelRenders){var a=e._currentElement.props.child,s=a.type;i="React mount: "+("string"==typeof s?s:s.displayName||s.name),console.time(i)}var u=w.mountComponent(e,n,null,_(e,t),o,0);i&&console.timeEnd(i),e._renderedComponent._topLevelWrapper=e,j._mountImageIntoNode(u,t,e,r,n)}function s(e,t,n,r){var o=k.ReactReconcileTransaction.getPooled(!n&&C.useCreateElement);o.perform(a,null,e,t,o,n,r),k.ReactReconcileTransaction.release(o)}function u(e,t,n){for(w.unmountComponent(e,n),t.nodeType===A&&(t=t.documentElement);t.lastChild;)t.removeChild(t.lastChild)}function l(e){var t=o(e);if(t){var n=y.getInstanceFromNode(t);return!(!n||!n._hostParent)}}function c(e){return!(!e||e.nodeType!==R&&e.nodeType!==A&&e.nodeType!==D)}function p(e){var t=o(e),n=t&&y.getInstanceFromNode(t);return n&&!n._hostParent?n:null}function d(e){var t=p(e);return t?t._hostContainerInfo._topLevelWrapper:null}var f=e(112),h=e(9),m=e(11),v=e(120),g=e(25),y=(e(119),e(33)),_=e(34),C=e(36),b=e(53),E=e(57),x=(e(58),e(59)),w=e(66),T=e(70),k=e(71),P=e(130),S=e(108),N=(e(137),e(114)),M=e(116),I=(e(142),m.ID_ATTRIBUTE_NAME),O=m.ROOT_ATTRIBUTE_NAME,R=1,A=9,D=11,L={},U=1,F=function(){this.rootID=U++};F.prototype.isReactComponent={},F.prototype.render=function(){return this.props.child},F.isReactTopLevelWrapper=!0;var j={TopLevelWrapper:F,_instancesByReactRootID:L,scrollMonitor:function(e,t){t()},_updateRootComponent:function(e,t,n,r,o){return j.scrollMonitor(r,function(){T.enqueueElementInternal(e,t,n),o&&T.enqueueCallbackInternal(e,o)}),e},_renderNewRootComponent:function(e,t,n,r){c(t)||f("37"),g.ensureScrollValueMonitoring();var o=S(e,!1);k.batchedUpdates(s,o,t,n,r);var i=o._instance.rootID;return L[i]=o,o},renderSubtreeIntoContainer:function(e,t,n,r){return null!=e&&E.has(e)||f("38"),j._renderSubtreeIntoContainer(e,t,n,r)},_renderSubtreeIntoContainer:function(e,t,n,r){T.validateCallback(r,"ReactDOM.render"),v.isValidElement(t)||f("39","string"==typeof t?" Instead of passing a string like 'div', pass React.createElement('div') or <div />.":"function"==typeof t?" Instead of passing a class like Foo, pass React.createElement(Foo) or <Foo />.":null!=t&&void 0!==t.props?" This may be caused by unintentionally loading two independent copies of React.":"");var a,s=v.createElement(F,{child:t});if(e){var u=E.get(e);a=u._processChildContext(u._context)}else a=P;var c=d(n);if(c){var p=c._currentElement,h=p.props.child;if(M(h,t)){var m=c._renderedComponent.getPublicInstance(),g=r&&function(){r.call(m)};return j._updateRootComponent(c,s,a,n,g),m}j.unmountComponentAtNode(n)}var y=o(n),_=y&&!!i(y),C=l(n),b=_&&!c&&!C,x=j._renderNewRootComponent(s,n,b,a)._renderedComponent.getPublicInstance();return r&&r.call(x),x},render:function(e,t,n){return j._renderSubtreeIntoContainer(null,e,t,n)},unmountComponentAtNode:function(e){c(e)||f("40");var t=d(e);return t?(delete L[t._instance.rootID],k.batchedUpdates(u,t,e,!1),!0):(l(e),1===e.nodeType&&e.hasAttribute(O),!1)},_mountImageIntoNode:function(e,t,n,i,a){if(c(t)||f("41"),i){var s=o(t);if(x.canReuseMarkup(e,s))return void y.precacheNode(n,s);var u=s.getAttribute(x.CHECKSUM_ATTR_NAME);s.removeAttribute(x.CHECKSUM_ATTR_NAME);var l=s.outerHTML;s.setAttribute(x.CHECKSUM_ATTR_NAME,u);var p=e,d=r(p,l),m=" (client) "+p.substring(d-20,d+20)+"\n (server) "+l.substring(d-20,d+20);t.nodeType===A&&f("42",m)}if(t.nodeType===A&&f("43"),a.useCreateElement){for(;t.lastChild;)t.removeChild(t.lastChild);h.insertTreeBefore(t,e,null)}else N(t,e),y.precacheNode(n,t.firstChild)}};t.exports=j},{108:108,11:11,112:112,114:114,116:116,119:119,120:120,130:130,137:137,142:142,25:25,33:33,34:34,36:36,53:53,57:57,58:58,59:59,66:66,70:70,71:71,9:9}],61:[function(e,t,n){"use strict";function r(e,t,n){return{type:"INSERT_MARKUP",content:e,fromIndex:null,fromNode:null,toIndex:n,afterNode:t}}function o(e,t,n){return{type:"MOVE_EXISTING",content:null,fromIndex:e._mountIndex,fromNode:d.getHostNode(e),toIndex:n,afterNode:t}}function i(e,t){return{type:"REMOVE_NODE",content:null,fromIndex:e._mountIndex,fromNode:t,toIndex:null,afterNode:null}}function a(e){return{type:"SET_MARKUP",content:e,fromIndex:null,fromNode:null,toIndex:null,afterNode:null}}function s(e){return{type:"TEXT_CONTENT",content:e,fromIndex:null,fromNode:null,toIndex:null,afterNode:null}}function u(e,t){return t&&(e=e||[],e.push(t)),e}function l(e,t){p.processChildrenUpdates(e,t)}var c=e(112),p=e(28),d=(e(57),e(58),e(119),e(66)),f=e(26),h=(e(129),e(97)),m=(e(137),{Mixin:{_reconcilerInstantiateChildren:function(e,t,n){return f.instantiateChildren(e,t,n)},_reconcilerUpdateChildren:function(e,t,n,r,o,i){var a;return a=h(t,0),f.updateChildren(e,a,n,r,o,this,this._hostContainerInfo,i,0),a},mountChildren:function(e,t,n){var r=this._reconcilerInstantiateChildren(e,t,n);this._renderedChildren=r;var o=[],i=0;for(var a in r)if(r.hasOwnProperty(a)){var s=r[a],u=d.mountComponent(s,t,this,this._hostContainerInfo,n,0);s._mountIndex=i++,o.push(u)}return o},updateTextContent:function(e){var t=this._renderedChildren;f.unmountChildren(t,!1);for(var n in t)t.hasOwnProperty(n)&&c("118");l(this,[s(e)])},updateMarkup:function(e){var t=this._renderedChildren;f.unmountChildren(t,!1);for(var n in t)t.hasOwnProperty(n)&&c("118");l(this,[a(e)])},updateChildren:function(e,t,n){this._updateChildren(e,t,n)},_updateChildren:function(e,t,n){var r=this._renderedChildren,o={},i=[],a=this._reconcilerUpdateChildren(r,e,i,o,t,n);if(a||r){var s,c=null,p=0,f=0,h=0,m=null;for(s in a)if(a.hasOwnProperty(s)){var v=r&&r[s],g=a[s];v===g?(c=u(c,this.moveChild(v,m,p,f)),f=Math.max(v._mountIndex,f),v._mountIndex=p):(v&&(f=Math.max(v._mountIndex,f)),c=u(c,this._mountChildAtIndex(g,i[h],m,p,t,n)),h++),p++,m=d.getHostNode(g)}for(s in o)o.hasOwnProperty(s)&&(c=u(c,this._unmountChild(r[s],o[s])));c&&l(this,c),this._renderedChildren=a}},unmountChildren:function(e){var t=this._renderedChildren;f.unmountChildren(t,e),this._renderedChildren=null},moveChild:function(e,t,n,r){if(e._mountIndex<r)return o(e,t,n)},createChild:function(e,t,n){return r(n,t,e._mountIndex)},removeChild:function(e,t){return i(e,t)},_mountChildAtIndex:function(e,t,n,r,o,i){return e._mountIndex=r,this.createChild(e,n,t)},_unmountChild:function(e,t){var n=this.removeChild(e,t);return e._mountIndex=null,n}}});t.exports=m},{112:112,119:119,129:129,137:137,26:26,28:28,57:57,58:58,66:66,97:97}],62:[function(e,t,n){"use strict";var r=e(112),o=e(120),i=(e(137),{HOST:0,COMPOSITE:1,EMPTY:2,getType:function(e){return null===e||!1===e?i.EMPTY:o.isValidElement(e)?"function"==typeof e.type?i.COMPOSITE:i.HOST:void r("26",e)}});t.exports=i},{112:112,120:120,137:137}],63:[function(e,t,n){"use strict";function r(e){return!(!e||"function"!=typeof e.attachRef||"function"!=typeof e.detachRef)}var o=e(112),i=(e(137),{addComponentAsRefTo:function(e,t,n){r(n)||o("119"),n.attachRef(t,e)},removeComponentAsRefFrom:function(e,t,n){r(n)||o("120");var i=n.getPublicInstance();i&&i.refs[t]===e.getPublicInstance()&&n.detachRef(t)}});t.exports=i},{112:112,137:137}],64:[function(e,t,n){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},{}],65:[function(e,t,n){"use strict";function r(e){this.reinitializeTransaction(),this.renderToStaticMarkup=!1,this.reactMountReady=i.getPooled(null),this.useCreateElement=e}var o=e(143),i=e(6),a=e(24),s=e(25),u=e(56),l=(e(58),e(89)),c=e(70),p={initialize:u.getSelectionInformation,close:u.restoreSelection},d={initialize:function(){var e=s.isEnabled();return s.setEnabled(!1),e},close:function(e){s.setEnabled(e)}},f={initialize:function(){this.reactMountReady.reset()},close:function(){this.reactMountReady.notifyAll()}},h=[p,d,f],m={getTransactionWrappers:function(){return h},getReactMountReady:function(){return this.reactMountReady},getUpdateQueue:function(){return c},checkpoint:function(){return this.reactMountReady.checkpoint()},rollback:function(e){this.reactMountReady.rollback(e)},destructor:function(){i.release(this.reactMountReady),this.reactMountReady=null}};o(r.prototype,l,m),a.addPoolingTo(r),t.exports=r},{143:143,24:24,25:25,56:56,58:58,6:6,70:70,89:89}],66:[function(e,t,n){"use strict";function r(){o.attachRefs(this,this._currentElement)}var o=e(67),i=(e(58),e(142),{mountComponent:function(e,t,n,o,i,a){var s=e.mountComponent(t,n,o,i,a);return e._currentElement&&null!=e._currentElement.ref&&t.getReactMountReady().enqueue(r,e),s},getHostNode:function(e){return e.getHostNode()},unmountComponent:function(e,t){o.detachRefs(e,e._currentElement),e.unmountComponent(t)},receiveComponent:function(e,t,n,i){var a=e._currentElement;if(t!==a||i!==e._context){var s=o.shouldUpdateRefs(a,t);s&&o.detachRefs(e,a),e.receiveComponent(t,n,i),s&&e._currentElement&&null!=e._currentElement.ref&&n.getReactMountReady().enqueue(r,e)}},performUpdateIfNecessary:function(e,t,n){e._updateBatchNumber===n&&e.performUpdateIfNecessary(t)}});t.exports=i},{142:142,58:58,67:67}],67:[function(e,t,n){"use strict";function r(e,t,n){"function"==typeof e?e(t.getPublicInstance()):i.addComponentAsRefTo(t,e,n)}function o(e,t,n){"function"==typeof e?e(null):i.removeComponentAsRefFrom(t,e,n)}var i=e(63),a={};a.attachRefs=function(e,t){if(null!==t&&"object"==typeof t){var n=t.ref;null!=n&&r(n,e,t._owner)}},a.shouldUpdateRefs=function(e,t){var n=null,r=null;null!==e&&"object"==typeof e&&(n=e.ref,r=e._owner);var o=null,i=null;return null!==t&&"object"==typeof t&&(o=t.ref,i=t._owner),n!==o||"string"==typeof o&&i!==r},a.detachRefs=function(e,t){if(null!==t&&"object"==typeof t){var n=t.ref;null!=n&&o(n,e,t._owner)}},t.exports=a},{63:63}],68:[function(e,t,n){"use strict";function r(e){this.reinitializeTransaction(),this.renderToStaticMarkup=e,this.useCreateElement=!1,this.updateQueue=new s(this)}var o=e(143),i=e(24),a=e(89),s=(e(58),e(69)),u=[],l={enqueue:function(){}},c={getTransactionWrappers:function(){return u},getReactMountReady:function(){return l},getUpdateQueue:function(){return this.updateQueue},destructor:function(){},checkpoint:function(){},rollback:function(){}};o(r.prototype,a,c),i.addPoolingTo(r),t.exports=r},{143:143,24:24,58:58,69:69,89:89}],69:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=e(70),i=(e(142),function(){function e(t){r(this,e),this.transaction=t}return e.prototype.isMounted=function(e){return!1},e.prototype.enqueueCallback=function(e,t,n){this.transaction.isInTransaction()&&o.enqueueCallback(e,t,n)},e.prototype.enqueueForceUpdate=function(e){this.transaction.isInTransaction()&&o.enqueueForceUpdate(e)},e.prototype.enqueueReplaceState=function(e,t){this.transaction.isInTransaction()&&o.enqueueReplaceState(e,t)},e.prototype.enqueueSetState=function(e,t){this.transaction.isInTransaction()&&o.enqueueSetState(e,t)},e}());t.exports=i},{142:142,70:70}],70:[function(e,t,n){"use strict";function r(e){u.enqueueUpdate(e)}function o(e){var t=typeof e;if("object"!==t)return t;var n=e.constructor&&e.constructor.name||t,r=Object.keys(e);return r.length>0&&r.length<20?n+" (keys: "+r.join(", ")+")":n}function i(e,t){var n=s.get(e);return n||null}var a=e(112),s=(e(119),e(57)),u=(e(58),e(71)),l=(e(137),e(142),{isMounted:function(e){var t=s.get(e);return!!t&&!!t._renderedComponent},enqueueCallback:function(e,t,n){l.validateCallback(t,n);var o=i(e);if(!o)return null;o._pendingCallbacks?o._pendingCallbacks.push(t):o._pendingCallbacks=[t],r(o)},enqueueCallbackInternal:function(e,t){e._pendingCallbacks?e._pendingCallbacks.push(t):e._pendingCallbacks=[t],r(e)},enqueueForceUpdate:function(e){var t=i(e,"forceUpdate");t&&(t._pendingForceUpdate=!0,r(t))},enqueueReplaceState:function(e,t,n){var o=i(e,"replaceState");o&&(o._pendingStateQueue=[t],o._pendingReplaceState=!0,void 0!==n&&null!==n&&(l.validateCallback(n,"replaceState"),o._pendingCallbacks?o._pendingCallbacks.push(n):o._pendingCallbacks=[n]),r(o))},enqueueSetState:function(e,t){var n=i(e,"setState");n&&((n._pendingStateQueue||(n._pendingStateQueue=[])).push(t),r(n))},enqueueElementInternal:function(e,t,n){e._pendingElement=t,e._context=n,r(e)},validateCallback:function(e,t){e&&"function"!=typeof e&&a("122",t,o(e))}});t.exports=l},{112:112,119:119,137:137,142:142,57:57,58:58,71:71}],71:[function(e,t,n){"use strict";function r(){P.ReactReconcileTransaction&&b||c("123")}function o(){this.reinitializeTransaction(),this.dirtyComponentsLength=null,this.callbackQueue=d.getPooled(),this.reconcileTransaction=P.ReactReconcileTransaction.getPooled(!0)}function i(e,t,n,o,i,a){return r(),b.batchedUpdates(e,t,n,o,i,a)}function a(e,t){return e._mountOrder-t._mountOrder}function s(e){var t=e.dirtyComponentsLength;t!==g.length&&c("124",t,g.length),g.sort(a),y++;for(var n=0;n<t;n++){var r=g[n],o=r._pendingCallbacks;r._pendingCallbacks=null;var i;if(h.logTopLevelRenders){var s=r;r._currentElement.type.isReactTopLevelWrapper&&(s=r._renderedComponent),i="React update: "+s.getName(),console.time(i)}if(m.performUpdateIfNecessary(r,e.reconcileTransaction,y),i&&console.timeEnd(i),o)for(var u=0;u<o.length;u++)e.callbackQueue.enqueue(o[u],r.getPublicInstance())}}function u(e){if(r(),!b.isBatchingUpdates)return void b.batchedUpdates(u,e);g.push(e),null==e._updateBatchNumber&&(e._updateBatchNumber=y+1)}function l(e,t){b.isBatchingUpdates||c("125"),_.enqueue(e,t),C=!0}var c=e(112),p=e(143),d=e(6),f=e(24),h=e(53),m=e(66),v=e(89),g=(e(137),[]),y=0,_=d.getPooled(),C=!1,b=null,E={initialize:function(){this.dirtyComponentsLength=g.length},close:function(){this.dirtyComponentsLength!==g.length?(g.splice(0,this.dirtyComponentsLength),T()):g.length=0}},x={initialize:function(){this.callbackQueue.reset()},close:function(){this.callbackQueue.notifyAll()}},w=[E,x];p(o.prototype,v,{getTransactionWrappers:function(){return w},destructor:function(){this.dirtyComponentsLength=null,d.release(this.callbackQueue),this.callbackQueue=null,P.ReactReconcileTransaction.release(this.reconcileTransaction),this.reconcileTransaction=null},perform:function(e,t,n){return v.perform.call(this,this.reconcileTransaction.perform,this.reconcileTransaction,e,t,n)}}),f.addPoolingTo(o);var T=function(){for(;g.length||C;){if(g.length){var e=o.getPooled();e.perform(s,null,e),o.release(e)}if(C){C=!1;var t=_;_=d.getPooled(),t.notifyAll(),d.release(t)}}},k={injectReconcileTransaction:function(e){e||c("126"),P.ReactReconcileTransaction=e},injectBatchingStrategy:function(e){e||c("127"),"function"!=typeof e.batchedUpdates&&c("128"),"boolean"!=typeof e.isBatchingUpdates&&c("129"),b=e}},P={ReactReconcileTransaction:null,batchedUpdates:i,enqueueUpdate:u,flushBatchedUpdates:T,injection:k,asap:l};t.exports=P},{112:112,137:137,143:143,24:24,53:53,6:6,66:66,89:89}],72:[function(e,t,n){"use strict";t.exports="15.5.4"},{}],73:[function(e,t,n){"use strict";var r={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},o={accentHeight:"accent-height",accumulate:0,additive:0,alignmentBaseline:"alignment-baseline",allowReorder:"allowReorder",alphabetic:0,amplitude:0,arabicForm:"arabic-form",ascent:0,attributeName:"attributeName",attributeType:"attributeType",autoReverse:"autoReverse",azimuth:0,baseFrequency:"baseFrequency",baseProfile:"baseProfile",baselineShift:"baseline-shift",bbox:0,begin:0,bias:0,by:0,calcMode:"calcMode",capHeight:"cap-height",clip:0,clipPath:"clip-path",clipRule:"clip-rule",clipPathUnits:"clipPathUnits",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",contentScriptType:"contentScriptType",contentStyleType:"contentStyleType",cursor:0,cx:0,cy:0,d:0,decelerate:0,descent:0,diffuseConstant:"diffuseConstant",direction:0,display:0,divisor:0,dominantBaseline:"dominant-baseline",dur:0,dx:0,dy:0,edgeMode:"edgeMode",elevation:0,enableBackground:"enable-background",end:0,exponent:0,externalResourcesRequired:"externalResourcesRequired",fill:0,fillOpacity:"fill-opacity",fillRule:"fill-rule",filter:0,filterRes:"filterRes",filterUnits:"filterUnits",floodColor:"flood-color",floodOpacity:"flood-opacity",focusable:0,fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",glyphRef:"glyphRef",gradientTransform:"gradientTransform",gradientUnits:"gradientUnits",hanging:0,horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",ideographic:0,imageRendering:"image-rendering",in:0,in2:0,intercept:0,k:0,k1:0,k2:0,k3:0,k4:0,kernelMatrix:"kernelMatrix",kernelUnitLength:"kernelUnitLength",kerning:0,keyPoints:"keyPoints",keySplines:"keySplines",keyTimes:"keyTimes",lengthAdjust:"lengthAdjust",letterSpacing:"letter-spacing",lightingColor:"lighting-color",limitingConeAngle:"limitingConeAngle",local:0,markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",markerHeight:"markerHeight",markerUnits:"markerUnits",markerWidth:"markerWidth",mask:0,maskContentUnits:"maskContentUnits",maskUnits:"maskUnits",mathematical:0,mode:0,numOctaves:"numOctaves",offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pathLength:"pathLength",patternContentUnits:"patternContentUnits",patternTransform:"patternTransform",patternUnits:"patternUnits",pointerEvents:"pointer-events",points:0,pointsAtX:"pointsAtX",pointsAtY:"pointsAtY",pointsAtZ:"pointsAtZ",preserveAlpha:"preserveAlpha",preserveAspectRatio:"preserveAspectRatio",primitiveUnits:"primitiveUnits",r:0,radius:0,refX:"refX",refY:"refY",renderingIntent:"rendering-intent",repeatCount:"repeatCount",repeatDur:"repeatDur",requiredExtensions:"requiredExtensions",requiredFeatures:"requiredFeatures",restart:0,result:0,rotate:0,rx:0,ry:0,scale:0,seed:0,shapeRendering:"shape-rendering",slope:0,spacing:0,specularConstant:"specularConstant",specularExponent:"specularExponent",speed:0,spreadMethod:"spreadMethod",startOffset:"startOffset",stdDeviation:"stdDeviation",stemh:0,stemv:0,stitchTiles:"stitchTiles",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",string:0,stroke:0,strokeDasharray:"stroke-dasharray",strokeDashoffset:"stroke-dashoffset",strokeLinecap:"stroke-linecap",strokeLinejoin:"stroke-linejoin",strokeMiterlimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",surfaceScale:"surfaceScale",systemLanguage:"systemLanguage",tableValues:"tableValues",targetX:"targetX",targetY:"targetY",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",textLength:"textLength",to:0,transform:0,u1:0,u2:0,underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicode:0,unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",values:0,vectorEffect:"vector-effect",version:0,vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",viewBox:"viewBox",viewTarget:"viewTarget",visibility:0,widths:0,wordSpacing:"word-spacing",writingMode:"writing-mode",x:0,xHeight:"x-height",x1:0,x2:0,xChannelSelector:"xChannelSelector",xlinkActuate:"xlink:actuate",xlinkArcrole:"xlink:arcrole",xlinkHref:"xlink:href",xlinkRole:"xlink:role",xlinkShow:"xlink:show",xlinkTitle:"xlink:title",xlinkType:"xlink:type",xmlBase:"xml:base",xmlns:0,xmlnsXlink:"xmlns:xlink",xmlLang:"xml:lang",xmlSpace:"xml:space",y:0,y1:0,y2:0,yChannelSelector:"yChannelSelector",z:0,zoomAndPan:"zoomAndPan"},i={Properties:{},DOMAttributeNamespaces:{xlinkActuate:r.xlink,xlinkArcrole:r.xlink,xlinkHref:r.xlink,xlinkRole:r.xlink,xlinkShow:r.xlink,xlinkTitle:r.xlink,xlinkType:r.xlink,xmlBase:r.xml,xmlLang:r.xml,xmlSpace:r.xml},DOMAttributeNames:{}};Object.keys(o).forEach(function(e){i.Properties[e]=0,o[e]&&(i.DOMAttributeNames[e]=o[e])}),t.exports=i},{}],74:[function(e,t,n){"use strict";function r(e){if("selectionStart"in e&&u.hasSelectionCapabilities(e))return{start:e.selectionStart,end:e.selectionEnd};if(window.getSelection){var t=window.getSelection();return{anchorNode:t.anchorNode,anchorOffset:t.anchorOffset,focusNode:t.focusNode,focusOffset:t.focusOffset}}if(document.selection){var n=document.selection.createRange();return{parentElement:n.parentElement(),text:n.text,top:n.boundingTop,left:n.boundingLeft}}}function o(e,t){if(y||null==m||m!==c())return null;var n=r(m);if(!g||!d(g,n)){g=n;var o=l.getPooled(h.select,v,e,t);return o.type="select",o.target=m,i.accumulateTwoPhaseDispatches(o),o}return null}var i=e(19),a=e(123),s=e(33),u=e(56),l=e(80),c=e(132),p=e(110),d=e(141),f=a.canUseDOM&&"documentMode"in document&&document.documentMode<=11,h={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:["topBlur","topContextMenu","topFocus","topKeyDown","topKeyUp","topMouseDown","topMouseUp","topSelectionChange"]}},m=null,v=null,g=null,y=!1,_=!1,C={eventTypes:h,extractEvents:function(e,t,n,r){if(!_)return null;var i=t?s.getNodeFromInstance(t):window;switch(e){case"topFocus":(p(i)||"true"===i.contentEditable)&&(m=i,v=t,g=null);break
+;case"topBlur":m=null,v=null,g=null;break;case"topMouseDown":y=!0;break;case"topContextMenu":case"topMouseUp":return y=!1,o(n,r);case"topSelectionChange":if(f)break;case"topKeyDown":case"topKeyUp":return o(n,r)}return null},didPutListener:function(e,t,n){"onSelect"===t&&(_=!0)}};t.exports=C},{110:110,123:123,132:132,141:141,19:19,33:33,56:56,80:80}],75:[function(e,t,n){"use strict";function r(e){return"."+e._rootNodeID}function o(e){return"button"===e||"input"===e||"select"===e||"textarea"===e}var i=e(112),a=e(122),s=e(19),u=e(33),l=e(76),c=e(77),p=e(80),d=e(81),f=e(83),h=e(84),m=e(79),v=e(85),g=e(86),y=e(87),_=e(88),C=e(129),b=e(99),E=(e(137),{}),x={};["abort","animationEnd","animationIteration","animationStart","blur","canPlay","canPlayThrough","click","contextMenu","copy","cut","doubleClick","drag","dragEnd","dragEnter","dragExit","dragLeave","dragOver","dragStart","drop","durationChange","emptied","encrypted","ended","error","focus","input","invalid","keyDown","keyPress","keyUp","load","loadedData","loadedMetadata","loadStart","mouseDown","mouseMove","mouseOut","mouseOver","mouseUp","paste","pause","play","playing","progress","rateChange","reset","scroll","seeked","seeking","stalled","submit","suspend","timeUpdate","touchCancel","touchEnd","touchMove","touchStart","transitionEnd","volumeChange","waiting","wheel"].forEach(function(e){var t=e[0].toUpperCase()+e.slice(1),n="on"+t,r="top"+t,o={phasedRegistrationNames:{bubbled:n,captured:n+"Capture"},dependencies:[r]};E[e]=o,x[r]=o});var w={},T={eventTypes:E,extractEvents:function(e,t,n,r){var o=x[e];if(!o)return null;var a;switch(e){case"topAbort":case"topCanPlay":case"topCanPlayThrough":case"topDurationChange":case"topEmptied":case"topEncrypted":case"topEnded":case"topError":case"topInput":case"topInvalid":case"topLoad":case"topLoadedData":case"topLoadedMetadata":case"topLoadStart":case"topPause":case"topPlay":case"topPlaying":case"topProgress":case"topRateChange":case"topReset":case"topSeeked":case"topSeeking":case"topStalled":case"topSubmit":case"topSuspend":case"topTimeUpdate":case"topVolumeChange":case"topWaiting":a=p;break;case"topKeyPress":if(0===b(n))return null;case"topKeyDown":case"topKeyUp":a=f;break;case"topBlur":case"topFocus":a=d;break;case"topClick":if(2===n.button)return null;case"topDoubleClick":case"topMouseDown":case"topMouseMove":case"topMouseUp":case"topMouseOut":case"topMouseOver":case"topContextMenu":a=h;break;case"topDrag":case"topDragEnd":case"topDragEnter":case"topDragExit":case"topDragLeave":case"topDragOver":case"topDragStart":case"topDrop":a=m;break;case"topTouchCancel":case"topTouchEnd":case"topTouchMove":case"topTouchStart":a=v;break;case"topAnimationEnd":case"topAnimationIteration":case"topAnimationStart":a=l;break;case"topTransitionEnd":a=g;break;case"topScroll":a=y;break;case"topWheel":a=_;break;case"topCopy":case"topCut":case"topPaste":a=c}a||i("86",e);var u=a.getPooled(o,t,n,r);return s.accumulateTwoPhaseDispatches(u),u},didPutListener:function(e,t,n){if("onClick"===t&&!o(e._tag)){var i=r(e),s=u.getNodeFromInstance(e);w[i]||(w[i]=a.listen(s,"click",C))}},willDeleteListener:function(e,t){if("onClick"===t&&!o(e._tag)){var n=r(e);w[n].remove(),delete w[n]}}};t.exports=T},{112:112,122:122,129:129,137:137,19:19,33:33,76:76,77:77,79:79,80:80,81:81,83:83,84:84,85:85,86:86,87:87,88:88,99:99}],76:[function(e,t,n){"use strict";function r(e,t,n,r){return o.call(this,e,t,n,r)}var o=e(80),i={animationName:null,elapsedTime:null,pseudoElement:null};o.augmentClass(r,i),t.exports=r},{80:80}],77:[function(e,t,n){"use strict";function r(e,t,n,r){return o.call(this,e,t,n,r)}var o=e(80),i={clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}};o.augmentClass(r,i),t.exports=r},{80:80}],78:[function(e,t,n){"use strict";function r(e,t,n,r){return o.call(this,e,t,n,r)}var o=e(80),i={data:null};o.augmentClass(r,i),t.exports=r},{80:80}],79:[function(e,t,n){"use strict";function r(e,t,n,r){return o.call(this,e,t,n,r)}var o=e(84),i={dataTransfer:null};o.augmentClass(r,i),t.exports=r},{84:84}],80:[function(e,t,n){"use strict";function r(e,t,n,r){this.dispatchConfig=e,this._targetInst=t,this.nativeEvent=n;var o=this.constructor.Interface;for(var i in o)if(o.hasOwnProperty(i)){var s=o[i];s?this[i]=s(n):"target"===i?this.target=r:this[i]=n[i]}var u=null!=n.defaultPrevented?n.defaultPrevented:!1===n.returnValue;return this.isDefaultPrevented=u?a.thatReturnsTrue:a.thatReturnsFalse,this.isPropagationStopped=a.thatReturnsFalse,this}var o=e(143),i=e(24),a=e(129),s=(e(142),["dispatchConfig","_targetInst","nativeEvent","isDefaultPrevented","isPropagationStopped","_dispatchListeners","_dispatchInstances"]),u={type:null,target:null,currentTarget:a.thatReturnsNull,eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};o(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=a.thatReturnsTrue)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=a.thatReturnsTrue)},persist:function(){this.isPersistent=a.thatReturnsTrue},isPersistent:a.thatReturnsFalse,destructor:function(){var e=this.constructor.Interface;for(var t in e)this[t]=null;for(var n=0;n<s.length;n++)this[s[n]]=null}}),r.Interface=u,r.augmentClass=function(e,t){var n=this,r=function(){};r.prototype=n.prototype;var a=new r;o(a,e.prototype),e.prototype=a,e.prototype.constructor=e,e.Interface=o({},n.Interface,t),e.augmentClass=n.augmentClass,i.addPoolingTo(e,i.fourArgumentPooler)},i.addPoolingTo(r,i.fourArgumentPooler),t.exports=r},{129:129,142:142,143:143,24:24}],81:[function(e,t,n){"use strict";function r(e,t,n,r){return o.call(this,e,t,n,r)}var o=e(87),i={relatedTarget:null};o.augmentClass(r,i),t.exports=r},{87:87}],82:[function(e,t,n){"use strict";function r(e,t,n,r){return o.call(this,e,t,n,r)}var o=e(80),i={data:null};o.augmentClass(r,i),t.exports=r},{80:80}],83:[function(e,t,n){"use strict";function r(e,t,n,r){return o.call(this,e,t,n,r)}var o=e(87),i=e(99),a=e(100),s=e(101),u={key:a,location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:s,charCode:function(e){return"keypress"===e.type?i(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?i(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}};o.augmentClass(r,u),t.exports=r},{100:100,101:101,87:87,99:99}],84:[function(e,t,n){"use strict";function r(e,t,n,r){return o.call(this,e,t,n,r)}var o=e(87),i=e(90),a=e(101),s={screenX:null,screenY:null,clientX:null,clientY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:a,button:function(e){var t=e.button;return"which"in e?t:2===t?2:4===t?1:0},buttons:null,relatedTarget:function(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)},pageX:function(e){return"pageX"in e?e.pageX:e.clientX+i.currentScrollLeft},pageY:function(e){return"pageY"in e?e.pageY:e.clientY+i.currentScrollTop}};o.augmentClass(r,s),t.exports=r},{101:101,87:87,90:90}],85:[function(e,t,n){"use strict";function r(e,t,n,r){return o.call(this,e,t,n,r)}var o=e(87),i=e(101),a={touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:i};o.augmentClass(r,a),t.exports=r},{101:101,87:87}],86:[function(e,t,n){"use strict";function r(e,t,n,r){return o.call(this,e,t,n,r)}var o=e(80),i={propertyName:null,elapsedTime:null,pseudoElement:null};o.augmentClass(r,i),t.exports=r},{80:80}],87:[function(e,t,n){"use strict";function r(e,t,n,r){return o.call(this,e,t,n,r)}var o=e(80),i=e(102),a={view:function(e){if(e.view)return e.view;var t=i(e);if(t.window===t)return t;var n=t.ownerDocument;return n?n.defaultView||n.parentWindow:window},detail:function(e){return e.detail||0}};o.augmentClass(r,a),t.exports=r},{102:102,80:80}],88:[function(e,t,n){"use strict";function r(e,t,n,r){return o.call(this,e,t,n,r)}var o=e(84),i={deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:null,deltaMode:null};o.augmentClass(r,i),t.exports=r},{84:84}],89:[function(e,t,n){"use strict";var r=e(112),o=(e(137),{}),i={reinitializeTransaction:function(){this.transactionWrappers=this.getTransactionWrappers(),this.wrapperInitData?this.wrapperInitData.length=0:this.wrapperInitData=[],this._isInTransaction=!1},_isInTransaction:!1,getTransactionWrappers:null,isInTransaction:function(){return!!this._isInTransaction},perform:function(e,t,n,o,i,a,s,u){this.isInTransaction()&&r("27");var l,c;try{this._isInTransaction=!0,l=!0,this.initializeAll(0),c=e.call(t,n,o,i,a,s,u),l=!1}finally{try{if(l)try{this.closeAll(0)}catch(e){}else this.closeAll(0)}finally{this._isInTransaction=!1}}return c},initializeAll:function(e){for(var t=this.transactionWrappers,n=e;n<t.length;n++){var r=t[n];try{this.wrapperInitData[n]=o,this.wrapperInitData[n]=r.initialize?r.initialize.call(this):null}finally{if(this.wrapperInitData[n]===o)try{this.initializeAll(n+1)}catch(e){}}}},closeAll:function(e){this.isInTransaction()||r("28");for(var t=this.transactionWrappers,n=e;n<t.length;n++){var i,a=t[n],s=this.wrapperInitData[n];try{i=!0,s!==o&&a.close&&a.close.call(this,s),i=!1}finally{if(i)try{this.closeAll(n+1)}catch(e){}}}this.wrapperInitData.length=0}};t.exports=i},{112:112,137:137}],90:[function(e,t,n){"use strict";var r={currentScrollLeft:0,currentScrollTop:0,refreshScrollValues:function(e){r.currentScrollLeft=e.x,r.currentScrollTop=e.y}};t.exports=r},{}],91:[function(e,t,n){"use strict";function r(e,t){return null==t&&o("30"),null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}var o=e(112);e(137);t.exports=r},{112:112,137:137}],92:[function(e,t,n){"use strict";function r(e){for(var t=1,n=0,r=0,i=e.length,a=-4&i;r<a;){for(var s=Math.min(r+4096,a);r<s;r+=4)n+=(t+=e.charCodeAt(r))+(t+=e.charCodeAt(r+1))+(t+=e.charCodeAt(r+2))+(t+=e.charCodeAt(r+3));t%=o,n%=o}for(;r<i;r++)n+=t+=e.charCodeAt(r);return t%=o,n%=o,t|n<<16}var o=65521;t.exports=r},{}],93:[function(e,t,n){"use strict";var r=function(e){return"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e};t.exports=r},{}],94:[function(e,t,n){"use strict";function r(e,t,n){return null==t||"boolean"==typeof t||""===t?"":isNaN(t)||0===t||i.hasOwnProperty(e)&&i[e]?""+t:("string"==typeof t&&(t=t.trim()),t+"px")}var o=e(4),i=(e(142),o.isUnitlessNumber);t.exports=r},{142:142,4:4}],95:[function(e,t,n){"use strict";function r(e){var t=""+e,n=i.exec(t);if(!n)return t;var r,o="",a=0,s=0;for(a=n.index;a<t.length;a++){switch(t.charCodeAt(a)){case 34:r="&quot;";break;case 38:r="&amp;";break;case 39:r="&#x27;";break;case 60:r="&lt;";break;case 62:r="&gt;";break;default:continue}s!==a&&(o+=t.substring(s,a)),s=a+1,o+=r}return s!==a?o+t.substring(s,a):o}function o(e){return"boolean"==typeof e||"number"==typeof e?""+e:r(e)}var i=/["'&<>]/;t.exports=o},{}],96:[function(e,t,n){"use strict";function r(e){if(null==e)return null;if(1===e.nodeType)return e;var t=a.get(e);if(t)return t=s(t),t?i.getNodeFromInstance(t):null;"function"==typeof e.render?o("44"):o("45",Object.keys(e))}var o=e(112),i=(e(119),e(33)),a=e(57),s=e(103);e(137),e(142);t.exports=r},{103:103,112:112,119:119,137:137,142:142,33:33,57:57}],97:[function(e,t,n){(function(n){"use strict";function r(e,t,n,r){if(e&&"object"==typeof e){var o=e;void 0===o[n]&&null!=t&&(o[n]=t)}}function o(e,t){if(null==e)return e;var n={};return i(e,r,n),n}var i=(e(22),e(117));e(142);void 0!==n&&n.env,t.exports=o}).call(this,void 0)},{117:117,142:142,22:22}],98:[function(e,t,n){"use strict";function r(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}t.exports=r},{}],99:[function(e,t,n){"use strict";function r(e){var t,n=e.keyCode;return"charCode"in e?0===(t=e.charCode)&&13===n&&(t=13):t=n,t>=32||13===t?t:0}t.exports=r},{}],100:[function(e,t,n){"use strict";function r(e){if(e.key){var t=i[e.key]||e.key;if("Unidentified"!==t)return t}if("keypress"===e.type){var n=o(e);return 13===n?"Enter":String.fromCharCode(n)}return"keydown"===e.type||"keyup"===e.type?a[e.keyCode]||"Unidentified":""}var o=e(99),i={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},a={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"};t.exports=r},{99:99}],101:[function(e,t,n){"use strict";function r(e){var t=this,n=t.nativeEvent;if(n.getModifierState)return n.getModifierState(e);var r=i[e];return!!r&&!!n[r]}function o(e){return r}var i={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};t.exports=o},{}],102:[function(e,t,n){"use strict";function r(e){var t=e.target||e.srcElement||window;return t.correspondingUseElement&&(t=t.correspondingUseElement),3===t.nodeType?t.parentNode:t}t.exports=r},{}],103:[function(e,t,n){"use strict";function r(e){for(var t;(t=e._renderedNodeType)===o.COMPOSITE;)e=e._renderedComponent;return t===o.HOST?e._renderedComponent:t===o.EMPTY?null:void 0}var o=e(62);t.exports=r},{62:62}],104:[function(e,t,n){"use strict";function r(e){var t=e&&(o&&e[o]||e[i]);if("function"==typeof t)return t}var o="function"==typeof Symbol&&Symbol.iterator,i="@@iterator";t.exports=r},{}],105:[function(e,t,n){"use strict";function r(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function o(e){for(;e;){if(e.nextSibling)return e.nextSibling;e=e.parentNode}}function i(e,t){for(var n=r(e),i=0,a=0;n;){if(3===n.nodeType){if(a=i+n.textContent.length,i<=t&&a>=t)return{node:n,offset:t-i};i=a}n=r(o(n))}}t.exports=i},{}],106:[function(e,t,n){"use strict";function r(){return!i&&o.canUseDOM&&(i="textContent"in document.documentElement?"textContent":"innerText"),i}var o=e(123),i=null;t.exports=r},{123:123}],107:[function(e,t,n){"use strict";function r(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n["ms"+e]="MS"+t,n["O"+e]="o"+t.toLowerCase(),n}function o(e){if(s[e])return s[e];if(!a[e])return e;var t=a[e];for(var n in t)if(t.hasOwnProperty(n)&&n in u)return s[e]=t[n];return""}var i=e(123),a={animationend:r("Animation","AnimationEnd"),animationiteration:r("Animation","AnimationIteration"),animationstart:r("Animation","AnimationStart"),transitionend:r("Transition","TransitionEnd")},s={},u={};i.canUseDOM&&(u=document.createElement("div").style,"AnimationEvent"in window||(delete a.animationend.animation,delete a.animationiteration.animation,delete a.animationstart.animation),"TransitionEvent"in window||delete a.transitionend.transition),t.exports=o},{123:123}],108:[function(e,t,n){"use strict";function r(e){if(e){var t=e.getName();if(t)return" Check the render method of `"+t+"`."}return""}function o(e){return"function"==typeof e&&void 0!==e.prototype&&"function"==typeof e.prototype.mountComponent&&"function"==typeof e.prototype.receiveComponent}function i(e,t){var n;if(null===e||!1===e)n=l.create(i);else if("object"==typeof e){var s=e,u=s.type;if("function"!=typeof u&&"string"!=typeof u){var d="";d+=r(s._owner),a("130",null==u?u:typeof u,d)}"string"==typeof s.type?n=c.createInternalComponent(s):o(s.type)?(n=new s.type(s),n.getHostNode||(n.getHostNode=n.getNativeNode)):n=new p(s)}else"string"==typeof e||"number"==typeof e?n=c.createInstanceForText(e):a("131",typeof e);return n._mountIndex=0,n._mountImage=null,n}var a=e(112),s=e(143),u=e(29),l=e(49),c=e(54),p=(e(121),e(137),e(142),function(e){this.construct(e)});s(p.prototype,u,{_instantiateReactComponent:i}),t.exports=i},{112:112,121:121,137:137,142:142,143:143,29:29,49:49,54:54}],109:[function(e,t,n){"use strict";function r(e,t){if(!i.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,r=n in document;if(!r){var a=document.createElement("div");a.setAttribute(n,"return;"),r="function"==typeof a[n]}return!r&&o&&"wheel"===e&&(r=document.implementation.hasFeature("Events.wheel","3.0")),r}var o,i=e(123);i.canUseDOM&&(o=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")),t.exports=r},{123:123}],110:[function(e,t,n){"use strict";function r(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!o[e.type]:"textarea"===t}var o={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};t.exports=r},{}],111:[function(e,t,n){"use strict";function r(e){return'"'+o(e)+'"'}var o=e(95);t.exports=r},{95:95}],112:[function(e,t,n){"use strict";function r(e){for(var t=arguments.length-1,n="Minified React error #"+e+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);n+=" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";var o=new Error(n);throw o.name="Invariant Violation",o.framesToPop=1,o}t.exports=r},{}],113:[function(e,t,n){"use strict";var r=e(60);t.exports=r.renderSubtreeIntoContainer},{60:60}],114:[function(e,t,n){"use strict";var r,o=e(123),i=e(10),a=/^[ \r\n\t\f]/,s=/<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/,u=e(93),l=u(function(e,t){if(e.namespaceURI!==i.svg||"innerHTML"in e)e.innerHTML=t;else{r=r||document.createElement("div"),r.innerHTML="<svg>"+t+"</svg>";for(var n=r.firstChild;n.firstChild;)e.appendChild(n.firstChild)}});if(o.canUseDOM){var c=document.createElement("div");c.innerHTML=" ",""===c.innerHTML&&(l=function(e,t){if(e.parentNode&&e.parentNode.replaceChild(e,e),a.test(t)||"<"===t[0]&&s.test(t)){e.innerHTML=String.fromCharCode(65279)+t;var n=e.firstChild;1===n.data.length?e.removeChild(n):n.deleteData(0,1)}else e.innerHTML=t}),c=null}t.exports=l},{10:10,123:123,93:93}],115:[function(e,t,n){"use strict";var r=e(123),o=e(95),i=e(114),a=function(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t};r.canUseDOM&&("textContent"in document.documentElement||(a=function(e,t){if(3===e.nodeType)return void(e.nodeValue=t);i(e,o(t))})),t.exports=a},{114:114,123:123,95:95}],116:[function(e,t,n){"use strict";function r(e,t){var n=null===e||!1===e,r=null===t||!1===t;if(n||r)return n===r;var o=typeof e,i=typeof t;return"string"===o||"number"===o?"string"===i||"number"===i:"object"===i&&e.type===t.type&&e.key===t.key}t.exports=r},{}],117:[function(e,t,n){"use strict";function r(e,t){return e&&"object"==typeof e&&null!=e.key?l.escape(e.key):t.toString(36)}function o(e,t,n,i){var d=typeof e;if("undefined"!==d&&"boolean"!==d||(e=null),null===e||"string"===d||"number"===d||"object"===d&&e.$$typeof===s)return n(i,e,""===t?c+r(e,0):t),1;var f,h,m=0,v=""===t?c:t+p;if(Array.isArray(e))for(var g=0;g<e.length;g++)f=e[g],h=v+r(f,g),m+=o(f,h,n,i);else{var y=u(e);if(y){var _,C=y.call(e);if(y!==e.entries)for(var b=0;!(_=C.next()).done;)f=_.value,h=v+r(f,b++),m+=o(f,h,n,i);else for(;!(_=C.next()).done;){var E=_.value;E&&(f=E[1],h=v+l.escape(E[0])+p+r(f,0),m+=o(f,h,n,i))}}else if("object"===d){var x=String(e);a("31","[object Object]"===x?"object with keys {"+Object.keys(e).join(", ")+"}":x,"")}}return m}function i(e,t,n){return null==e?0:o(e,"",t,n)}var a=e(112),s=(e(119),e(48)),u=e(104),l=(e(137),e(22)),c=(e(142),"."),p=":";t.exports=i},{104:104,112:112,119:119,137:137,142:142,22:22,48:48}],118:[function(e,t,n){"use strict";var r=(e(143),e(129)),o=(e(142),r);t.exports=o},{129:129,142:142,143:143}],119:[function(t,n,r){"use strict";var o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;n.exports=o.ReactCurrentOwner},{}],120:[function(t,n,r){"use strict";n.exports=e},{}],121:[function(t,n,r){"use strict";var o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;n.exports=o.getNextDebugID},{}],122:[function(e,t,n){"use strict";var r=e(129),o={listen:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!1),{remove:function(){e.removeEventListener(t,n,!1)}}):e.attachEvent?(e.attachEvent("on"+t,n),{remove:function(){e.detachEvent("on"+t,n)}}):void 0},capture:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!0),{remove:function(){e.removeEventListener(t,n,!0)}}):{remove:r}},registerDefault:function(){}};t.exports=o},{129:129}],123:[function(e,t,n){"use strict";var r=!("undefined"==typeof window||!window.document||!window.document.createElement),o={canUseDOM:r,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:r&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:r&&!!window.screen,isInWorker:!r};t.exports=o},{}],124:[function(e,t,n){"use strict";function r(e){return e.replace(o,function(e,t){return t.toUpperCase()})}var o=/-(.)/g;t.exports=r},{}],125:[function(e,t,n){"use strict";function r(e){return o(e.replace(i,"ms-"))}var o=e(124),i=/^-ms-/;t.exports=r},{124:124}],126:[function(e,t,n){"use strict";function r(e,t){return!(!e||!t)&&(e===t||!o(e)&&(o(t)?r(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}var o=e(139);t.exports=r},{139:139}],127:[function(e,t,n){"use strict";function r(e){var t=e.length;if((Array.isArray(e)||"object"!=typeof e&&"function"!=typeof e)&&a(!1),"number"!=typeof t&&a(!1),0===t||t-1 in e||a(!1),"function"==typeof e.callee&&a(!1),e.hasOwnProperty)try{return Array.prototype.slice.call(e)}catch(e){}for(var n=Array(t),r=0;r<t;r++)n[r]=e[r];return n}function o(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"length"in e&&!("setInterval"in e)&&"number"!=typeof e.nodeType&&(Array.isArray(e)||"callee"in e||"item"in e)}function i(e){return o(e)?Array.isArray(e)?e.slice():r(e):[e]}var a=e(137);t.exports=i},{137:137}],128:[function(e,t,n){"use strict";function r(e){var t=e.match(c);return t&&t[1].toLowerCase()}function o(e,t){var n=l;l||u(!1);var o=r(e),i=o&&s(o);if(i){n.innerHTML=i[1]+e+i[2];for(var c=i[0];c--;)n=n.lastChild}else n.innerHTML=e;var p=n.getElementsByTagName("script");p.length&&(t||u(!1),a(p).forEach(t));for(var d=Array.from(n.childNodes);n.lastChild;)n.removeChild(n.lastChild);return d}var i=e(123),a=e(127),s=e(133),u=e(137),l=i.canUseDOM?document.createElement("div"):null,c=/^\s*<(\w+)/;t.exports=o},{123:123,127:127,133:133,137:137}],129:[function(e,t,n){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},t.exports=o},{}],130:[function(e,t,n){"use strict";var r={};t.exports=r},{}],131:[function(e,t,n){"use strict";function r(e){try{e.focus()}catch(e){}}t.exports=r},{}],132:[function(e,t,n){"use strict";function r(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}t.exports=r},{}],133:[function(e,t,n){"use strict";function r(e){return a||i(!1),d.hasOwnProperty(e)||(e="*"),s.hasOwnProperty(e)||(a.innerHTML="*"===e?"<link />":"<"+e+"></"+e+">",s[e]=!a.firstChild),s[e]?d[e]:null}var o=e(123),i=e(137),a=o.canUseDOM?document.createElement("div"):null,s={},u=[1,'<select multiple="true">',"</select>"],l=[1,"<table>","</table>"],c=[3,"<table><tbody><tr>","</tr></tbody></table>"],p=[1,'<svg xmlns="http://www.w3.org/2000/svg">',"</svg>"],d={"*":[1,"?<div>","</div>"],area:[1,"<map>","</map>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],legend:[1,"<fieldset>","</fieldset>"],param:[1,"<object>","</object>"],tr:[2,"<table><tbody>","</tbody></table>"],optgroup:u,option:u,caption:l,colgroup:l,tbody:l,tfoot:l,thead:l,td:c,th:c};["circle","clipPath","defs","ellipse","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","text","tspan"].forEach(function(e){d[e]=p,s[e]=!0}),t.exports=r},{123:123,137:137}],134:[function(e,t,n){"use strict";function r(e){return e.Window&&e instanceof e.Window?{x:e.pageXOffset||e.document.documentElement.scrollLeft,y:e.pageYOffset||e.document.documentElement.scrollTop}:{x:e.scrollLeft,y:e.scrollTop}}t.exports=r},{}],135:[function(e,t,n){"use strict";function r(e){return e.replace(o,"-$1").toLowerCase()}var o=/([A-Z])/g;t.exports=r},{}],136:[function(e,t,n){"use strict";function r(e){return o(e).replace(i,"-ms-")}var o=e(135),i=/^ms-/;t.exports=r},{135:135}],137:[function(e,t,n){"use strict";function r(e,t,n,r,i,a,s,u){if(o(t),!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,i,a,s,u],p=0;l=new Error(t.replace(/%s/g,function(){return c[p++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}}var o=function(e){};t.exports=r},{}],138:[function(e,t,n){"use strict";function r(e){var t=e?e.ownerDocument||e:document,n=t.defaultView||window;return!(!e||!("function"==typeof n.Node?e instanceof n.Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}t.exports=r},{}],139:[function(e,t,n){"use strict";function r(e){return o(e)&&3==e.nodeType}var o=e(138);t.exports=r},{138:138}],140:[function(e,t,n){"use strict";function r(e){var t={};return function(n){return t.hasOwnProperty(n)||(t[n]=e.call(this,n)),t[n]}}t.exports=r},{}],141:[function(e,t,n){"use strict";function r(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!==e&&t!==t}function o(e,t){if(r(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(var a=0;a<n.length;a++)if(!i.call(t,n[a])||!r(e[n[a]],t[n[a]]))return!1;return!0}var i=Object.prototype.hasOwnProperty;t.exports=o},{}],142:[function(e,t,n){"use strict";var r=e(129),o=r;t.exports=o},{129:129}],143:[function(e,t,n){"use strict";function r(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var o=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;t.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,s,u=r(e),l=1;l<arguments.length;l++){n=Object(arguments[l]);for(var c in n)i.call(n,c)&&(u[c]=n[c]);if(o){s=o(n);for(var p=0;p<s.length;p++)a.call(n,s[p])&&(u[s[p]]=n[s[p]])}}return u}},{}],144:[function(e,t,n){"use strict";function r(e,t,n,r,o){}t.exports=r},{137:137,142:142,147:147}],145:[function(e,t,n){"use strict";var r=e(146);t.exports=function(e){return r(e,!1)}},{146:146}],146:[function(e,t,n){"use strict";var r=e(129),o=e(137),i=(e(142),e(147)),a=e(144);t.exports=function(e,t){function n(e){var t=e&&(E&&e[E]||e[x]);if("function"==typeof t)return t}function s(e,t){return e===t?0!==e||1/e==1/t:e!==e&&t!==t}function u(e){this.message=e,this.stack=""}function l(e){function n(n,r,a,s,l,c,p){if(s=s||w,c=c||a,p!==i)if(t)o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");else;return null==r[a]?n?new u(null===r[a]?"The "+l+" `"+c+"` is marked as required in `"+s+"`, but its value is `null`.":"The "+l+" `"+c+"` is marked as required in `"+s+"`, but its value is `undefined`."):null:e(r,a,s,l,c)}var r=n.bind(null,!1);return r.isRequired=n.bind(null,!0),r}function c(e){function t(t,n,r,o,i,a){var s=t[n];if(_(s)!==e)return new u("Invalid "+o+" `"+i+"` of type `"+C(s)+"` supplied to `"+r+"`, expected `"+e+"`.");return null}return l(t)}function p(e){function t(t,n,r,o,a){if("function"!=typeof e)return new u("Property `"+a+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var s=t[n];if(!Array.isArray(s)){return new u("Invalid "+o+" `"+a+"` of type `"+_(s)+"` supplied to `"+r+"`, expected an array.")}for(var l=0;l<s.length;l++){var c=e(s,l,r,o,a+"["+l+"]",i);if(c instanceof Error)return c}return null}return l(t)}function d(e){function t(t,n,r,o,i){if(!(t[n]instanceof e)){var a=e.name||w;return new u("Invalid "+o+" `"+i+"` of type `"+b(t[n])+"` supplied to `"+r+"`, expected instance of `"+a+"`.")}return null}return l(t)}function f(e){function t(t,n,r,o,i){for(var a=t[n],l=0;l<e.length;l++)if(s(a,e[l]))return null;return new u("Invalid "+o+" `"+i+"` of value `"+a+"` supplied to `"+r+"`, expected one of "+JSON.stringify(e)+".")}return Array.isArray(e)?l(t):r.thatReturnsNull}function h(e){function t(t,n,r,o,a){if("function"!=typeof e)return new u("Property `"+a+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var s=t[n],l=_(s);if("object"!==l)return new u("Invalid "+o+" `"+a+"` of type `"+l+"` supplied to `"+r+"`, expected an object.");for(var c in s)if(s.hasOwnProperty(c)){var p=e(s,c,r,o,a+"."+c,i);if(p instanceof Error)return p}return null}return l(t)}function m(e){function t(t,n,r,o,a){for(var s=0;s<e.length;s++){if(null==(0,e[s])(t,n,r,o,a,i))return null}return new u("Invalid "+o+" `"+a+"` supplied to `"+r+"`.")}return Array.isArray(e)?l(t):r.thatReturnsNull}function v(e){function t(t,n,r,o,a){var s=t[n],l=_(s);if("object"!==l)return new u("Invalid "+o+" `"+a+"` of type `"+l+"` supplied to `"+r+"`, expected `object`.");for(var c in e){var p=e[c];if(p){var d=p(s,c,r,o,a+"."+c,i);if(d)return d}}return null}return l(t)}function g(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(g);if(null===t||e(t))return!0;var r=n(t);if(!r)return!1;var o,i=r.call(t);if(r!==t.entries){for(;!(o=i.next()).done;)if(!g(o.value))return!1}else for(;!(o=i.next()).done;){var a=o.value;if(a&&!g(a[1]))return!1}return!0;default:return!1}}function y(e,t){return"symbol"===e||("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}function _(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":y(t,e)?"symbol":t}function C(e){var t=_(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function b(e){return e.constructor&&e.constructor.name?e.constructor.name:w}var E="function"==typeof Symbol&&Symbol.iterator,x="@@iterator",w="<<anonymous>>",T={array:c("array"),bool:c("boolean"),func:c("function"),number:c("number"),object:c("object"),string:c("string"),symbol:c("symbol"),any:function(){return l(r.thatReturnsNull)}(),arrayOf:p,element:function(){function t(t,n,r,o,i){var a=t[n];if(!e(a)){return new u("Invalid "+o+" `"+i+"` of type `"+_(a)+"` supplied to `"+r+"`, expected a single ReactElement.")}return null}return l(t)}(),instanceOf:d,node:function(){function e(e,t,n,r,o){return g(e[t])?null:new u("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")}return l(e)}(),objectOf:h,oneOf:f,oneOfType:m,shape:v}
+;return u.prototype=Error.prototype,T.checkPropTypes=a,T.PropTypes=T,T}},{129:129,137:137,142:142,144:144,147:147}],147:[function(e,t,n){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},{}]},{},[45])(45)}()}()});
+/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */
+if (!String.fromCodePoint) {
+ (function() {
+ var defineProperty = (function() {
+ // IE 8 only supports `Object.defineProperty` on DOM elements
+ try {
+ var object = {};
+ var $defineProperty = Object.defineProperty;
+ var result = $defineProperty(object, object, object) && $defineProperty;
+ } catch(error) {}
+ return result;
+ }());
+ var stringFromCharCode = String.fromCharCode;
+ var floor = Math.floor;
+ var fromCodePoint = function() {
+ var MAX_SIZE = 0x4000;
+ var codeUnits = [];
+ var highSurrogate;
+ var lowSurrogate;
+ var index = -1;
+ var length = arguments.length;
+ if (!length) {
+ return '';
+ }
+ var result = '';
+ while (++index < length) {
+ var codePoint = Number(arguments[index]);
+ if (
+ !isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`
+ codePoint < 0 || // not a valid Unicode code point
+ codePoint > 0x10FFFF || // not a valid Unicode code point
+ floor(codePoint) != codePoint // not an integer
+ ) {
+ throw RangeError('Invalid code point: ' + codePoint);
+ }
+ if (codePoint <= 0xFFFF) { // BMP code point
+ codeUnits.push(codePoint);
+ } else { // Astral code point; split in surrogate halves
+ // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
+ codePoint -= 0x10000;
+ highSurrogate = (codePoint >> 10) + 0xD800;
+ lowSurrogate = (codePoint % 0x400) + 0xDC00;
+ codeUnits.push(highSurrogate, lowSurrogate);
+ }
+ if (index + 1 == length || codeUnits.length > MAX_SIZE) {
+ result += stringFromCharCode.apply(null, codeUnits);
+ codeUnits.length = 0;
+ }
+ }
+ return result;
+ };
+ if (defineProperty) {
+ defineProperty(String, 'fromCodePoint', {
+ 'value': fromCodePoint,
+ 'configurable': true,
+ 'writable': true
+ });
+ } else {
+ String.fromCodePoint = fromCodePoint;
+ }
+ }());
+}
+
+/*! http://mths.be/codepointat v0.1.0 by @mathias */
+if (!String.prototype.codePointAt) {
+ (function() {
+ 'use strict'; // needed to support `apply`/`call` with `undefined`/`null`
+ var codePointAt = function(position) {
+ if (this == null) {
+ throw TypeError();
+ }
+ var string = String(this);
+ var size = string.length;
+ // `ToInteger`
+ var index = position ? Number(position) : 0;
+ if (index != index) { // better `isNaN`
+ index = 0;
+ }
+ // Account for out-of-bounds indices:
+ if (index < 0 || index >= size) {
+ return undefined;
+ }
+ // Get the first code unit
+ var first = string.charCodeAt(index);
+ var second;
+ if ( // check if it’s the start of a surrogate pair
+ first >= 0xD800 && first <= 0xDBFF && // high surrogate
+ size > index + 1 // there is a next code unit
+ ) {
+ second = string.charCodeAt(index + 1);
+ if (second >= 0xDC00 && second <= 0xDFFF) { // low surrogate
+ // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
+ return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;
+ }
+ }
+ return first;
+ };
+ if (Object.defineProperty) {
+ Object.defineProperty(String.prototype, 'codePointAt', {
+ 'value': codePointAt,
+ 'configurable': true,
+ 'writable': true
+ });
+ } else {
+ String.prototype.codePointAt = codePointAt;
+ }
+ }());
+}
+
+function registerAsciinemaPlayerElement() {
+ var AsciinemaPlayerProto = Object.create(HTMLElement.prototype);
+
+ function merge() {
+ var merged = {};
+ for (var i=0; i<arguments.length; i++) {
+ var obj = arguments[i];
+ for (var attrname in obj) {
+ merged[attrname] = obj[attrname];
+ }
+ }
+ return merged;
+ }
+
+ function attribute(element, attrName, optName, defaultValue, coerceFn) {
+ var obj = {};
+ var value = element.getAttribute(attrName);
+ if (value !== null) {
+ if (value === '' && defaultValue !== undefined) {
+ value = defaultValue;
+ } else if (coerceFn) {
+ value = coerceFn(value);
+ }
+ obj[optName] = value;
+ }
+ return obj;
+ };
+
+ function fixEscapeCodes(text) {
+ if (text) {
+ var f = function(match, p1, offset, string) {
+ return String.fromCodePoint(parseInt(p1, 16));
+ };
+
+ return text.
+ replace(/\\u([a-z0-9]{4})/gi, f).
+ replace(/\\x([a-z0-9]{2})/gi, f).
+ replace(/\\e/g, "\x1b");
+ } else {
+ return text;
+ }
+ }
+
+ AsciinemaPlayerProto.createdCallback = function() {
+ var self = this;
+
+ var opts = merge(
+ attribute(this, 'cols', 'width', 0, parseInt),
+ attribute(this, 'rows', 'height', 0, parseInt),
+ attribute(this, 'autoplay', 'autoPlay', true, Boolean),
+ attribute(this, 'preload', 'preload', true, Boolean),
+ attribute(this, 'loop', 'loop', true, Boolean),
+ attribute(this, 'start-at', 'startAt', 0, parseInt),
+ attribute(this, 'speed', 'speed', 1, parseFloat),
+ attribute(this, 'idle-time-limit', 'idleTimeLimit', null, parseFloat),
+ attribute(this, 'poster', 'poster', null, fixEscapeCodes),
+ attribute(this, 'font-size', 'fontSize'),
+ attribute(this, 'theme', 'theme'),
+ attribute(this, 'title', 'title'),
+ attribute(this, 'author', 'author'),
+ attribute(this, 'author-url', 'authorURL'),
+ attribute(this, 'author-img-url', 'authorImgURL'),
+ {
+ onCanPlay: function() {
+ self.dispatchEvent(new CustomEvent("loadedmetadata"));
+ self.dispatchEvent(new CustomEvent("loadeddata"));
+ self.dispatchEvent(new CustomEvent("canplay"));
+ self.dispatchEvent(new CustomEvent("canplaythrough"));
+ },
+
+ onPlay: function() {
+ self.dispatchEvent(new CustomEvent("play"));
+ },
+
+ onPause: function() {
+ self.dispatchEvent(new CustomEvent("pause"));
+ }
+ }
+ );
+
+ this.player = asciinema.player.js.CreatePlayer(this, this.getAttribute('src'), opts);
+ };
+
+ AsciinemaPlayerProto.attachedCallback = function() {
+ var self = this;
+ setTimeout(function() {
+ self.dispatchEvent(new CustomEvent("attached"));
+ }, 0);
+ };
+
+ AsciinemaPlayerProto.detachedCallback = function() {
+ asciinema.player.js.UnmountPlayer(this);
+ this.player = undefined;
+ };
+
+ AsciinemaPlayerProto.play = function() {
+ this.player.play();
+ };
+
+ AsciinemaPlayerProto.pause = function() {
+ this.player.pause();
+ };
+
+ Object.defineProperty(AsciinemaPlayerProto, "duration", {
+ get: function() {
+ return this.player.getDuration() || 0;
+ },
+
+ set: function(value) {}
+ });
+
+ Object.defineProperty(AsciinemaPlayerProto, "currentTime", {
+ get: function() {
+ return this.player.getCurrentTime();
+ },
+
+ set: function(value) {
+ this.player.setCurrentTime(value);
+ }
+ });
+
+ document.registerElement('asciinema-player', { prototype: AsciinemaPlayerProto });
+};
+
+;(function(){
+var g,aa=aa||{},ba=this;function ca(a){return"string"==typeof a}function da(a,b){var c=a.split("."),d=ba;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)c.length||void 0===b?d=d[e]&&d[e]!==Object.prototype[e]?d[e]:d[e]={}:d[e]=b}function ea(){}
+function n(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
+else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function fa(a){var b=n(a);return"array"==b||"object"==b&&"number"==typeof a.length}function ha(a){return"function"==n(a)}function ia(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}function ja(a){return a[la]||(a[la]=++ma)}var la="closure_uid_"+(1E9*Math.random()>>>0),ma=0;function na(a,b,c){return a.call.apply(a.bind,arguments)}
+function oa(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}function pa(a,b,c){pa=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?na:oa;return pa.apply(null,arguments)}
+function qa(a,b){function c(){}c.prototype=b.prototype;a.Zd=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.base=function(a,c,f){for(var d=Array(arguments.length-2),e=2;e<arguments.length;e++)d[e-2]=arguments[e];return b.prototype[c].apply(a,d)}};var ra=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},sa=String.prototype.repeat?function(a,b){return a.repeat(b)}:function(a,b){return Array(b+1).join(a)};function ta(a,b){return a<b?-1:a>b?1:0};var ua=Array.prototype.indexOf?function(a,b,c){return Array.prototype.indexOf.call(a,b,c)}:function(a,b,c){c=null==c?0:0>c?Math.max(0,a.length+c):c;if(ca(a))return ca(b)&&1==b.length?a.indexOf(b,c):-1;for(;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1},va=Array.prototype.forEach?function(a,b,c){Array.prototype.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=ca(a)?a.split(""):a,f=0;f<d;f++)f in e&&b.call(c,e[f],f,a)};
+function wa(a){a:{var b=xa;for(var c=a.length,d=ca(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){b=e;break a}b=-1}return 0>b?null:ca(a)?a.charAt(b):a[b]}function ya(a,b){var c=ua(a,b),d;(d=0<=c)&&Array.prototype.splice.call(a,c,1);return d}function za(a,b){a.sort(b||Aa)}function Ca(a,b){for(var c=Array(a.length),d=0;d<a.length;d++)c[d]={index:d,value:a[d]};var e=b||Aa;za(c,function(a,b){return e(a.value,b.value)||a.index-b.index});for(d=0;d<a.length;d++)a[d]=c[d].value}
+function Aa(a,b){return a>b?1:a<b?-1:0};function Da(a){var b=[],c=0,d;for(d in a)b[c++]=a[d];return b}function Ea(a){var b=[],c=0,d;for(d in a)b[c++]=d;return b}var Fa="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function Ia(a,b){for(var c,d,e=1;e<arguments.length;e++){d=arguments[e];for(c in d)a[c]=d[c];for(var f=0;f<Fa.length;f++)c=Fa[f],Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c])}};function Ka(a){if(a.Yc&&"function"==typeof a.Yc)return a.Yc();if(ca(a))return a.split("");if(fa(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}return Da(a)}
+function La(a,b){if(a.forEach&&"function"==typeof a.forEach)a.forEach(b,void 0);else if(fa(a)||ca(a))va(a,b,void 0);else{if(a.Xc&&"function"==typeof a.Xc)var c=a.Xc();else if(a.Yc&&"function"==typeof a.Yc)c=void 0;else if(fa(a)||ca(a)){c=[];for(var d=a.length,e=0;e<d;e++)c.push(e)}else c=Ea(a);d=Ka(a);e=d.length;for(var f=0;f<e;f++)b.call(void 0,d[f],c&&c[f],a)}};function Ma(a,b){this.ic={};this.ib=[];this.Fc=0;var c=arguments.length;if(1<c){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1])}else a&&this.addAll(a)}g=Ma.prototype;g.Yc=function(){Na(this);for(var a=[],b=0;b<this.ib.length;b++)a.push(this.ic[this.ib[b]]);return a};g.Xc=function(){Na(this);return this.ib.concat()};g.Td=function(){return 0==this.Fc};g.clear=function(){this.ic={};this.Fc=this.ib.length=0};
+g.remove=function(a){return Object.prototype.hasOwnProperty.call(this.ic,a)?(delete this.ic[a],this.Fc--,this.ib.length>2*this.Fc&&Na(this),!0):!1};function Na(a){if(a.Fc!=a.ib.length){for(var b=0,c=0;b<a.ib.length;){var d=a.ib[b];Object.prototype.hasOwnProperty.call(a.ic,d)&&(a.ib[c++]=d);b++}a.ib.length=c}if(a.Fc!=a.ib.length){var e={};for(c=b=0;b<a.ib.length;)d=a.ib[b],Object.prototype.hasOwnProperty.call(e,d)||(a.ib[c++]=d,e[d]=1),b++;a.ib.length=c}}
+g.get=function(a,b){return Object.prototype.hasOwnProperty.call(this.ic,a)?this.ic[a]:b};g.set=function(a,b){Object.prototype.hasOwnProperty.call(this.ic,a)||(this.Fc++,this.ib.push(a));this.ic[a]=b};g.addAll=function(a){if(a instanceof Ma){var b=a.Xc();a=a.Yc()}else b=Ea(a),a=Da(a);for(var c=0;c<b.length;c++)this.set(b[c],a[c])};g.forEach=function(a,b){for(var c=this.Xc(),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this)}};g.clone=function(){return new Ma(this)};var Pa=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;function Qa(a,b){this.Ma=[];this.Lc=b;for(var c=!0,d=a.length-1;0<=d;d--){var e=a[d]|0;c&&e==b||(this.Ma[d]=e,c=!1)}}var Ra={};function Sa(a){if(-128<=a&&128>a){var b=Ra[a];if(b)return b}b=new Qa([a|0],0>a?-1:0);-128<=a&&128>a&&(Ra[a]=b);return b}function Ta(a){if(isNaN(a)||!isFinite(a))return Ua;if(0>a)return Ta(-a).kb();for(var b=[],c=1,d=0;a>=c;d++)b[d]=a/c|0,c*=Va;return new Qa(b,0)}var Va=4294967296,Ua=Sa(0),Wa=Sa(1),Xa=Sa(16777216);g=Qa.prototype;
+g.Of=function(){return 0<this.Ma.length?this.Ma[0]:this.Lc};g.vd=function(){if(this.Eb())return-this.kb().vd();for(var a=0,b=1,c=0;c<this.Ma.length;c++){var d=Ya(this,c);a+=(0<=d?d:Va+d)*b;b*=Va}return a};
+g.toString=function(a){a=a||10;if(2>a||36<a)throw Error("radix out of range: "+a);if(this.hc())return"0";if(this.Eb())return"-"+this.kb().toString(a);for(var b=Ta(Math.pow(a,6)),c=this,d="";;){var e=Za(c,b),f=(c.ze(e.multiply(b)).Of()>>>0).toString(a);c=e;if(c.hc())return f+d;for(;6>f.length;)f="0"+f;d=""+f+d}};function Ya(a,b){return 0>b?0:b<a.Ma.length?a.Ma[b]:a.Lc}g.hc=function(){if(0!=this.Lc)return!1;for(var a=0;a<this.Ma.length;a++)if(0!=this.Ma[a])return!1;return!0};
+g.Eb=function(){return-1==this.Lc};g.xf=function(a){return 0<this.compare(a)};g.yf=function(a){return 0<=this.compare(a)};g.Ue=function(){return 0>this.compare(Xa)};g.Ve=function(a){return 0>=this.compare(a)};g.compare=function(a){a=this.ze(a);return a.Eb()?-1:a.hc()?0:1};g.kb=function(){return this.Hf().add(Wa)};
+g.add=function(a){for(var b=Math.max(this.Ma.length,a.Ma.length),c=[],d=0,e=0;e<=b;e++){var f=d+(Ya(this,e)&65535)+(Ya(a,e)&65535),h=(f>>>16)+(Ya(this,e)>>>16)+(Ya(a,e)>>>16);d=h>>>16;f&=65535;h&=65535;c[e]=h<<16|f}return new Qa(c,c[c.length-1]&-2147483648?-1:0)};g.ze=function(a){return this.add(a.kb())};
+g.multiply=function(a){if(this.hc()||a.hc())return Ua;if(this.Eb())return a.Eb()?this.kb().multiply(a.kb()):this.kb().multiply(a).kb();if(a.Eb())return this.multiply(a.kb()).kb();if(this.Ue()&&a.Ue())return Ta(this.vd()*a.vd());for(var b=this.Ma.length+a.Ma.length,c=[],d=0;d<2*b;d++)c[d]=0;for(d=0;d<this.Ma.length;d++)for(var e=0;e<a.Ma.length;e++){var f=Ya(this,d)>>>16,h=Ya(this,d)&65535,k=Ya(a,e)>>>16,l=Ya(a,e)&65535;c[2*d+2*e]+=h*l;ab(c,2*d+2*e);c[2*d+2*e+1]+=f*l;ab(c,2*d+2*e+1);c[2*d+2*e+1]+=
+h*k;ab(c,2*d+2*e+1);c[2*d+2*e+2]+=f*k;ab(c,2*d+2*e+2)}for(d=0;d<b;d++)c[d]=c[2*d+1]<<16|c[2*d];for(d=b;d<2*b;d++)c[d]=0;return new Qa(c,0)};function ab(a,b){for(;(a[b]&65535)!=a[b];)a[b+1]+=a[b]>>>16,a[b]&=65535,b++}
+function Za(a,b){if(b.hc())throw Error("division by zero");if(a.hc())return Ua;if(a.Eb())return b.Eb()?Za(a.kb(),b.kb()):Za(a.kb(),b).kb();if(b.Eb())return Za(a,b.kb()).kb();if(30<a.Ma.length){if(a.Eb()||b.Eb())throw Error("slowDivide_ only works with positive integers.");for(var c=Wa,d=b;d.Ve(a);)c=c.shiftLeft(1),d=d.shiftLeft(1);var e=c.ad(1),f=d.ad(1);d=d.ad(2);for(c=c.ad(2);!d.hc();){var h=f.add(d);h.Ve(a)&&(e=e.add(c),f=h);d=d.ad(1);c=c.ad(1)}return e}c=Ua;for(d=a;d.yf(b);){e=Math.max(1,Math.floor(d.vd()/
+b.vd()));f=Math.ceil(Math.log(e)/Math.LN2);f=48>=f?1:Math.pow(2,f-48);h=Ta(e);for(var k=h.multiply(b);k.Eb()||k.xf(d);)e-=f,h=Ta(e),k=h.multiply(b);h.hc()&&(h=Wa);c=c.add(h);d=d.ze(k)}return c}g.Hf=function(){for(var a=this.Ma.length,b=[],c=0;c<a;c++)b[c]=~this.Ma[c];return new Qa(b,~this.Lc)};g.shiftLeft=function(a){var b=a>>5;a%=32;for(var c=this.Ma.length+b+(0<a?1:0),d=[],e=0;e<c;e++)d[e]=0<a?Ya(this,e-b)<<a|Ya(this,e-b-1)>>>32-a:Ya(this,e-b);return new Qa(d,this.Lc)};
+g.ad=function(a){var b=a>>5;a%=32;for(var c=this.Ma.length-b,d=[],e=0;e<c;e++)d[e]=0<a?Ya(this,e+b)>>>a|Ya(this,e+b+1)<<32-a:Ya(this,e+b);return new Qa(d,this.Lc)};function cb(a,b){null!=a&&this.append.apply(this,arguments)}g=cb.prototype;g.xc="";g.set=function(a){this.xc=""+a};g.append=function(a,b,c){this.xc+=String(a);if(null!=b)for(var d=1;d<arguments.length;d++)this.xc+=arguments[d];return this};g.clear=function(){this.xc=""};g.toString=function(){return this.xc};function eb(a){eb[" "](a);return a}eb[" "]=ea;function fb(a,b){var c=gb;return Object.prototype.hasOwnProperty.call(c,a)?c[a]:c[a]=b(a)};var hb;if("undefined"===typeof q)var q={};if("undefined"===typeof ib)var ib=null;if("undefined"===typeof kb)var kb=null;var lb=null;if("undefined"===typeof mb)var mb=null;function ob(){return new r(null,5,[pb,!0,qb,!0,rb,!1,sb,!1,tb,null],null)}function t(a){return null!=a&&!1!==a}function ub(a){return null==a}function vb(a){return a instanceof Array}function wb(a){return null==a?!0:!1===a?!0:!1}function yb(a){return ca(a)}function Ab(a,b){return a[n(null==b?null:b)]?!0:a._?!0:!1}
+function Bb(a){return null==a?null:a.constructor}function Cb(a,b){var c=Bb(b);c=t(t(c)?c.qc:c)?c.Tb:n(b);return Error(["No protocol method ",a," defined for type ",c,": ",b].join(""))}function Db(a){var b=a.Tb;return t(b)?b:""+v.h(a)}var Fb="undefined"!==typeof Symbol&&"function"===n(Symbol)?Symbol.iterator:"@@iterator";function Gb(a){for(var b=a.length,c=Array(b),d=0;;)if(d<b)c[d]=a[d],d+=1;else break;return c}
+var Hb=function Hb(a){switch(arguments.length){case 2:return Hb.c(arguments[0],arguments[1]);default:for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;return Hb.A(arguments[0],arguments[1],new Jb(c.slice(2),0,null))}};Hb.c=function(a,b){return a[b]};Hb.A=function(a,b,c){return Kb(Hb,a[b],c)};Hb.N=function(a){var b=y(a),c=z(a);a=y(c);c=z(c);return Hb.A(b,a,c)};Hb.L=2;function Lb(a){return Mb(function(a,c){a.push(c);return a},[],a)}function Nb(){}function Ob(){}
+function Pb(){}var Qb=function Qb(a){if(null!=a&&null!=a.W)return a.W(a);var c=Qb[n(null==a?null:a)];if(null!=c)return c.h?c.h(a):c.call(null,a);c=Qb._;if(null!=c)return c.h?c.h(a):c.call(null,a);throw Cb("ICounted.-count",a);},Rb=function Rb(a){if(null!=a&&null!=a.oa)return a.oa(a);var c=Rb[n(null==a?null:a)];if(null!=c)return c.h?c.h(a):c.call(null,a);c=Rb._;if(null!=c)return c.h?c.h(a):c.call(null,a);throw Cb("IEmptyableCollection.-empty",a);};function Sb(){}
+var Tb=function Tb(a,b){if(null!=a&&null!=a.X)return a.X(a,b);var d=Tb[n(null==a?null:a)];if(null!=d)return d.c?d.c(a,b):d.call(null,a,b);d=Tb._;if(null!=d)return d.c?d.c(a,b):d.call(null,a,b);throw Cb("ICollection.-conj",a);};function Ub(){}var A=function A(a){switch(arguments.length){case 2:return A.c(arguments[0],arguments[1]);case 3:return A.l(arguments[0],arguments[1],arguments[2]);default:throw Error(["Invalid arity: ",v.h(arguments.length)].join(""));}};
+A.c=function(a,b){if(null!=a&&null!=a.$)return a.$(a,b);var c=A[n(null==a?null:a)];if(null!=c)return c.c?c.c(a,b):c.call(null,a,b);c=A._;if(null!=c)return c.c?c.c(a,b):c.call(null,a,b);throw Cb("IIndexed.-nth",a);};A.l=function(a,b,c){if(null!=a&&null!=a.ka)return a.ka(a,b,c);var d=A[n(null==a?null:a)];if(null!=d)return d.l?d.l(a,b,c):d.call(null,a,b,c);d=A._;if(null!=d)return d.l?d.l(a,b,c):d.call(null,a,b,c);throw Cb("IIndexed.-nth",a);};A.L=3;function Vb(){}
+var Wb=function Wb(a){if(null!=a&&null!=a.Ia)return a.Ia(a);var c=Wb[n(null==a?null:a)];if(null!=c)return c.h?c.h(a):c.call(null,a);c=Wb._;if(null!=c)return c.h?c.h(a):c.call(null,a);throw Cb("ISeq.-first",a);},Yb=function Yb(a){if(null!=a&&null!=a.bb)return a.bb(a);var c=Yb[n(null==a?null:a)];if(null!=c)return c.h?c.h(a):c.call(null,a);c=Yb._;if(null!=c)return c.h?c.h(a):c.call(null,a);throw Cb("ISeq.-rest",a);};function Zb(){}function $b(){}
+var cc=function cc(a){switch(arguments.length){case 2:return cc.c(arguments[0],arguments[1]);case 3:return cc.l(arguments[0],arguments[1],arguments[2]);default:throw Error(["Invalid arity: ",v.h(arguments.length)].join(""));}};cc.c=function(a,b){if(null!=a&&null!=a.V)return a.V(a,b);var c=cc[n(null==a?null:a)];if(null!=c)return c.c?c.c(a,b):c.call(null,a,b);c=cc._;if(null!=c)return c.c?c.c(a,b):c.call(null,a,b);throw Cb("ILookup.-lookup",a);};
+cc.l=function(a,b,c){if(null!=a&&null!=a.I)return a.I(a,b,c);var d=cc[n(null==a?null:a)];if(null!=d)return d.l?d.l(a,b,c):d.call(null,a,b,c);d=cc._;if(null!=d)return d.l?d.l(a,b,c):d.call(null,a,b,c);throw Cb("ILookup.-lookup",a);};cc.L=3;
+var dc=function dc(a,b){if(null!=a&&null!=a.yc)return a.yc(a,b);var d=dc[n(null==a?null:a)];if(null!=d)return d.c?d.c(a,b):d.call(null,a,b);d=dc._;if(null!=d)return d.c?d.c(a,b):d.call(null,a,b);throw Cb("IAssociative.-contains-key?",a);},ec=function ec(a,b,c){if(null!=a&&null!=a.O)return a.O(a,b,c);var e=ec[n(null==a?null:a)];if(null!=e)return e.l?e.l(a,b,c):e.call(null,a,b,c);e=ec._;if(null!=e)return e.l?e.l(a,b,c):e.call(null,a,b,c);throw Cb("IAssociative.-assoc",a);};function fc(){}
+var gc=function gc(a,b){if(null!=a&&null!=a.ga)return a.ga(a,b);var d=gc[n(null==a?null:a)];if(null!=d)return d.c?d.c(a,b):d.call(null,a,b);d=gc._;if(null!=d)return d.c?d.c(a,b):d.call(null,a,b);throw Cb("IMap.-dissoc",a);};function hc(){}
+var jc=function jc(a){if(null!=a&&null!=a.fd)return a.fd(a);var c=jc[n(null==a?null:a)];if(null!=c)return c.h?c.h(a):c.call(null,a);c=jc._;if(null!=c)return c.h?c.h(a):c.call(null,a);throw Cb("IMapEntry.-key",a);},kc=function kc(a){if(null!=a&&null!=a.gd)return a.gd(a);var c=kc[n(null==a?null:a)];if(null!=c)return c.h?c.h(a):c.call(null,a);c=kc._;if(null!=c)return c.h?c.h(a):c.call(null,a);throw Cb("IMapEntry.-val",a);};function lc(){}
+var mc=function mc(a,b){if(null!=a&&null!=a.ie)return a.ie(a,b);var d=mc[n(null==a?null:a)];if(null!=d)return d.c?d.c(a,b):d.call(null,a,b);d=mc._;if(null!=d)return d.c?d.c(a,b):d.call(null,a,b);throw Cb("ISet.-disjoin",a);},nc=function nc(a){if(null!=a&&null!=a.Ac)return a.Ac(a);var c=nc[n(null==a?null:a)];if(null!=c)return c.h?c.h(a):c.call(null,a);c=nc._;if(null!=c)return c.h?c.h(a):c.call(null,a);throw Cb("IStack.-peek",a);},oc=function oc(a){if(null!=a&&null!=a.Bc)return a.Bc(a);var c=oc[n(null==
+a?null:a)];if(null!=c)return c.h?c.h(a):c.call(null,a);c=oc._;if(null!=c)return c.h?c.h(a):c.call(null,a);throw Cb("IStack.-pop",a);};function pc(){}
+var qc=function qc(a,b,c){if(null!=a&&null!=a.dc)return a.dc(a,b,c);var e=qc[n(null==a?null:a)];if(null!=e)return e.l?e.l(a,b,c):e.call(null,a,b,c);e=qc._;if(null!=e)return e.l?e.l(a,b,c):e.call(null,a,b,c);throw Cb("IVector.-assoc-n",a);},B=function B(a){if(null!=a&&null!=a.pc)return a.pc(a);var c=B[n(null==a?null:a)];if(null!=c)return c.h?c.h(a):c.call(null,a);c=B._;if(null!=c)return c.h?c.h(a):c.call(null,a);throw Cb("IDeref.-deref",a);};function rc(){}
+var sc=function sc(a){if(null!=a&&null!=a.P)return a.P(a);var c=sc[n(null==a?null:a)];if(null!=c)return c.h?c.h(a):c.call(null,a);c=sc._;if(null!=c)return c.h?c.h(a):c.call(null,a);throw Cb("IMeta.-meta",a);},tc=function tc(a,b){if(null!=a&&null!=a.T)return a.T(a,b);var d=tc[n(null==a?null:a)];if(null!=d)return d.c?d.c(a,b):d.call(null,a,b);d=tc._;if(null!=d)return d.c?d.c(a,b):d.call(null,a,b);throw Cb("IWithMeta.-with-meta",a);};function uc(){}
+var vc=function vc(a){switch(arguments.length){case 2:return vc.c(arguments[0],arguments[1]);case 3:return vc.l(arguments[0],arguments[1],arguments[2]);default:throw Error(["Invalid arity: ",v.h(arguments.length)].join(""));}};vc.c=function(a,b){if(null!=a&&null!=a.Fa)return a.Fa(a,b);var c=vc[n(null==a?null:a)];if(null!=c)return c.c?c.c(a,b):c.call(null,a,b);c=vc._;if(null!=c)return c.c?c.c(a,b):c.call(null,a,b);throw Cb("IReduce.-reduce",a);};
+vc.l=function(a,b,c){if(null!=a&&null!=a.Ga)return a.Ga(a,b,c);var d=vc[n(null==a?null:a)];if(null!=d)return d.l?d.l(a,b,c):d.call(null,a,b,c);d=vc._;if(null!=d)return d.l?d.l(a,b,c):d.call(null,a,b,c);throw Cb("IReduce.-reduce",a);};vc.L=3;function wc(){}
+var yc=function yc(a,b,c){if(null!=a&&null!=a.Qc)return a.Qc(a,b,c);var e=yc[n(null==a?null:a)];if(null!=e)return e.l?e.l(a,b,c):e.call(null,a,b,c);e=yc._;if(null!=e)return e.l?e.l(a,b,c):e.call(null,a,b,c);throw Cb("IKVReduce.-kv-reduce",a);},zc=function zc(a,b){if(null!=a&&null!=a.K)return a.K(a,b);var d=zc[n(null==a?null:a)];if(null!=d)return d.c?d.c(a,b):d.call(null,a,b);d=zc._;if(null!=d)return d.c?d.c(a,b):d.call(null,a,b);throw Cb("IEquiv.-equiv",a);},Ac=function Ac(a){if(null!=a&&null!=a.U)return a.U(a);
+var c=Ac[n(null==a?null:a)];if(null!=c)return c.h?c.h(a):c.call(null,a);c=Ac._;if(null!=c)return c.h?c.h(a):c.call(null,a);throw Cb("IHash.-hash",a);};function Bc(){}var Cc=function Cc(a){if(null!=a&&null!=a.S)return a.S(a);var c=Cc[n(null==a?null:a)];if(null!=c)return c.h?c.h(a):c.call(null,a);c=Cc._;if(null!=c)return c.h?c.h(a):c.call(null,a);throw Cb("ISeqable.-seq",a);};function Ec(){}function Fc(){}function Gc(){}function Hc(){}
+var Ic=function Ic(a){if(null!=a&&null!=a.Rc)return a.Rc(a);var c=Ic[n(null==a?null:a)];if(null!=c)return c.h?c.h(a):c.call(null,a);c=Ic._;if(null!=c)return c.h?c.h(a):c.call(null,a);throw Cb("IReversible.-rseq",a);},Jc=function Jc(a,b){if(null!=a&&null!=a.Re)return a.Re(0,b);var d=Jc[n(null==a?null:a)];if(null!=d)return d.c?d.c(a,b):d.call(null,a,b);d=Jc._;if(null!=d)return d.c?d.c(a,b):d.call(null,a,b);throw Cb("IWriter.-write",a);};function Kc(){}
+var Lc=function Lc(a,b,c){if(null!=a&&null!=a.Kd)return a.Kd(a,b,c);var e=Lc[n(null==a?null:a)];if(null!=e)return e.l?e.l(a,b,c):e.call(null,a,b,c);e=Lc._;if(null!=e)return e.l?e.l(a,b,c):e.call(null,a,b,c);throw Cb("IWatchable.-notify-watches",a);},Mc=function Mc(a,b,c){if(null!=a&&null!=a.Jd)return a.Jd(a,b,c);var e=Mc[n(null==a?null:a)];if(null!=e)return e.l?e.l(a,b,c):e.call(null,a,b,c);e=Mc._;if(null!=e)return e.l?e.l(a,b,c):e.call(null,a,b,c);throw Cb("IWatchable.-add-watch",a);},Nc=function Nc(a,
+b){if(null!=a&&null!=a.Ld)return a.Ld(a,b);var d=Nc[n(null==a?null:a)];if(null!=d)return d.c?d.c(a,b):d.call(null,a,b);d=Nc._;if(null!=d)return d.c?d.c(a,b):d.call(null,a,b);throw Cb("IWatchable.-remove-watch",a);},Oc=function Oc(a){if(null!=a&&null!=a.Pc)return a.Pc(a);var c=Oc[n(null==a?null:a)];if(null!=c)return c.h?c.h(a):c.call(null,a);c=Oc._;if(null!=c)return c.h?c.h(a):c.call(null,a);throw Cb("IEditableCollection.-as-transient",a);},Pc=function Pc(a,b){if(null!=a&&null!=a.Dc)return a.Dc(a,
+b);var d=Pc[n(null==a?null:a)];if(null!=d)return d.c?d.c(a,b):d.call(null,a,b);d=Pc._;if(null!=d)return d.c?d.c(a,b):d.call(null,a,b);throw Cb("ITransientCollection.-conj!",a);},Qc=function Qc(a){if(null!=a&&null!=a.kd)return a.kd(a);var c=Qc[n(null==a?null:a)];if(null!=c)return c.h?c.h(a):c.call(null,a);c=Qc._;if(null!=c)return c.h?c.h(a):c.call(null,a);throw Cb("ITransientCollection.-persistent!",a);},Rc=function Rc(a,b,c){if(null!=a&&null!=a.Cc)return a.Cc(a,b,c);var e=Rc[n(null==a?null:a)];if(null!=
+e)return e.l?e.l(a,b,c):e.call(null,a,b,c);e=Rc._;if(null!=e)return e.l?e.l(a,b,c):e.call(null,a,b,c);throw Cb("ITransientAssociative.-assoc!",a);};function Tc(){}
+var Uc=function Uc(a,b){if(null!=a&&null!=a.cc)return a.cc(a,b);var d=Uc[n(null==a?null:a)];if(null!=d)return d.c?d.c(a,b):d.call(null,a,b);d=Uc._;if(null!=d)return d.c?d.c(a,b):d.call(null,a,b);throw Cb("IComparable.-compare",a);},Vc=function Vc(a){if(null!=a&&null!=a.Le)return a.Le();var c=Vc[n(null==a?null:a)];if(null!=c)return c.h?c.h(a):c.call(null,a);c=Vc._;if(null!=c)return c.h?c.h(a):c.call(null,a);throw Cb("IChunk.-drop-first",a);},Wc=function Wc(a){if(null!=a&&null!=a.ge)return a.ge(a);
+var c=Wc[n(null==a?null:a)];if(null!=c)return c.h?c.h(a):c.call(null,a);c=Wc._;if(null!=c)return c.h?c.h(a):c.call(null,a);throw Cb("IChunkedSeq.-chunked-first",a);},Xc=function Xc(a){if(null!=a&&null!=a.Hd)return a.Hd(a);var c=Xc[n(null==a?null:a)];if(null!=c)return c.h?c.h(a):c.call(null,a);c=Xc._;if(null!=c)return c.h?c.h(a):c.call(null,a);throw Cb("IChunkedSeq.-chunked-rest",a);},Yc=function Yc(a){if(null!=a&&null!=a.hd)return a.hd(a);var c=Yc[n(null==a?null:a)];if(null!=c)return c.h?c.h(a):c.call(null,
+a);c=Yc._;if(null!=c)return c.h?c.h(a):c.call(null,a);throw Cb("INamed.-name",a);},Zc=function Zc(a){if(null!=a&&null!=a.jd)return a.jd(a);var c=Zc[n(null==a?null:a)];if(null!=c)return c.h?c.h(a):c.call(null,a);c=Zc._;if(null!=c)return c.h?c.h(a):c.call(null,a);throw Cb("INamed.-namespace",a);},$c=function $c(a,b){if(null!=a&&null!=a.Gb)return a.Gb(a,b);var d=$c[n(null==a?null:a)];if(null!=d)return d.c?d.c(a,b):d.call(null,a,b);d=$c._;if(null!=d)return d.c?d.c(a,b):d.call(null,a,b);throw Cb("IReset.-reset!",
+a);},ad=function ad(a){switch(arguments.length){case 2:return ad.c(arguments[0],arguments[1]);case 3:return ad.l(arguments[0],arguments[1],arguments[2]);case 4:return ad.M(arguments[0],arguments[1],arguments[2],arguments[3]);case 5:return ad.Z(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4]);default:throw Error(["Invalid arity: ",v.h(arguments.length)].join(""));}};
+ad.c=function(a,b){if(null!=a&&null!=a.je)return a.je(a,b);var c=ad[n(null==a?null:a)];if(null!=c)return c.c?c.c(a,b):c.call(null,a,b);c=ad._;if(null!=c)return c.c?c.c(a,b):c.call(null,a,b);throw Cb("ISwap.-swap!",a);};ad.l=function(a,b,c){if(null!=a&&null!=a.ke)return a.ke(a,b,c);var d=ad[n(null==a?null:a)];if(null!=d)return d.l?d.l(a,b,c):d.call(null,a,b,c);d=ad._;if(null!=d)return d.l?d.l(a,b,c):d.call(null,a,b,c);throw Cb("ISwap.-swap!",a);};
+ad.M=function(a,b,c,d){if(null!=a&&null!=a.le)return a.le(a,b,c,d);var e=ad[n(null==a?null:a)];if(null!=e)return e.M?e.M(a,b,c,d):e.call(null,a,b,c,d);e=ad._;if(null!=e)return e.M?e.M(a,b,c,d):e.call(null,a,b,c,d);throw Cb("ISwap.-swap!",a);};ad.Z=function(a,b,c,d,e){if(null!=a&&null!=a.me)return a.me(a,b,c,d,e);var f=ad[n(null==a?null:a)];if(null!=f)return f.Z?f.Z(a,b,c,d,e):f.call(null,a,b,c,d,e);f=ad._;if(null!=f)return f.Z?f.Z(a,b,c,d,e):f.call(null,a,b,c,d,e);throw Cb("ISwap.-swap!",a);};
+ad.L=5;var bd=function bd(a,b){if(null!=a&&null!=a.Qe)return a.Qe(0,b);var d=bd[n(null==a?null:a)];if(null!=d)return d.c?d.c(a,b):d.call(null,a,b);d=bd._;if(null!=d)return d.c?d.c(a,b):d.call(null,a,b);throw Cb("IVolatile.-vreset!",a);};function cd(){}var dd=function dd(a){if(null!=a&&null!=a.ba)return a.ba(a);var c=dd[n(null==a?null:a)];if(null!=c)return c.h?c.h(a):c.call(null,a);c=dd._;if(null!=c)return c.h?c.h(a):c.call(null,a);throw Cb("IIterable.-iterator",a);};
+function ed(a){this.Nf=a;this.m=1073741824;this.J=0}ed.prototype.Re=function(a,b){return this.Nf.append(b)};function fd(a){var b=new cb;a.R(null,new ed(b),ob());return""+v.h(b)}var gd="undefined"!==typeof Math.imul&&0!==Math.imul(4294967295,5)?function(a,b){return Math.imul(a,b)}:function(a,b){var c=a&65535,d=b&65535;return c*d+((a>>>16&65535)*d+c*(b>>>16&65535)<<16>>>0)|0};function hd(a){a=gd(a|0,-862048943);return gd(a<<15|a>>>-15,461845907)}
+function id(a,b){var c=(a|0)^(b|0);return gd(c<<13|c>>>-13,5)+-430675100|0}function jd(a,b){var c=(a|0)^b;c=gd(c^c>>>16,-2048144789);c=gd(c^c>>>13,-1028477387);return c^c>>>16}function kd(a){a:{var b=1;for(var c=0;;)if(b<a.length){var d=b+2;c=id(c,hd(a.charCodeAt(b-1)|a.charCodeAt(b)<<16));b=d}else{b=c;break a}}b=1===(a.length&1)?b^hd(a.charCodeAt(a.length-1)):b;return jd(b,gd(2,a.length))}var ld={},md=0;
+function nd(a){255<md&&(ld={},md=0);if(null==a)return 0;var b=ld[a];if("number"!==typeof b){a:if(null!=a)if(b=a.length,0<b)for(var c=0,d=0;;)if(c<b){var e=c+1;d=gd(31,d)+a.charCodeAt(c);c=e}else{b=d;break a}else b=0;else b=0;ld[a]=b;md+=1}return a=b}
+function od(a){if(null!=a&&(a.m&4194304||q===a.Sf))return a.U(null)^0;if("number"===typeof a){if(t(isFinite(a)))return Math.floor(a)%2147483647;switch(a){case Infinity:return 2146435072;case -Infinity:return-1048576;default:return 2146959360}}else return!0===a?a=1231:!1===a?a=1237:"string"===typeof a?(a=nd(a),0!==a&&(a=hd(a),a=id(0,a),a=jd(a,4))):a=a instanceof Date?a.valueOf()^0:null==a?0:Ac(a)^0,a}function pd(a,b){return a^b+2654435769+(a<<6)+(a>>2)}function qd(a){return a instanceof rd}
+function sd(a,b){if(a.Zb===b.Zb)return 0;var c=wb(a.fb);if(t(c?b.fb:c))return-1;if(t(a.fb)){if(wb(b.fb))return 1;c=Aa(a.fb,b.fb);return 0===c?Aa(a.name,b.name):c}return Aa(a.name,b.name)}function rd(a,b,c,d,e){this.fb=a;this.name=b;this.Zb=c;this.Oc=d;this.hb=e;this.m=2154168321;this.J=4096}g=rd.prototype;g.toString=function(){return this.Zb};g.equiv=function(a){return this.K(null,a)};g.K=function(a,b){return b instanceof rd?this.Zb===b.Zb:!1};
+g.call=function(){var a=null;a=function(a,c,d){switch(arguments.length){case 2:return D.c(c,this);case 3:return D.l(c,this,d)}throw Error("Invalid arity: "+(arguments.length-1));};a.c=function(a,c){return D.c(c,this)};a.l=function(a,c,d){return D.l(c,this,d)};return a}();g.apply=function(a,b){return this.call.apply(this,[this].concat(Gb(b)))};g.h=function(a){return D.c(a,this)};g.c=function(a,b){return D.l(a,this,b)};g.P=function(){return this.hb};
+g.T=function(a,b){return new rd(this.fb,this.name,this.Zb,this.Oc,b)};g.U=function(){var a=this.Oc;return null!=a?a:this.Oc=a=pd(kd(this.name),nd(this.fb))};g.hd=function(){return this.name};g.jd=function(){return this.fb};g.R=function(a,b){return Jc(b,this.Zb)};var td=function td(a){switch(arguments.length){case 1:return td.h(arguments[0]);case 2:return td.c(arguments[0],arguments[1]);default:throw Error(["Invalid arity: ",v.h(arguments.length)].join(""));}};
+td.h=function(a){if(a instanceof rd)return a;var b=a.indexOf("/");return 1>b?td.c(null,a):td.c(a.substring(0,b),a.substring(b+1,a.length))};td.c=function(a,b){var c=null!=a?[v.h(a),"/",v.h(b)].join(""):b;return new rd(a,b,c,null,null)};td.L=2;function ud(a){return null!=a?a.J&131072||q===a.Tf?!0:a.J?!1:Ab(cd,a):Ab(cd,a)}
+function E(a){if(null==a)return null;if(null!=a&&(a.m&8388608||q===a.Pe))return a.S(null);if(vb(a)||"string"===typeof a)return 0===a.length?null:new Jb(a,0,null);if(Ab(Bc,a))return Cc(a);throw Error([v.h(a)," is not ISeqable"].join(""));}function y(a){if(null==a)return null;if(null!=a&&(a.m&64||q===a.G))return a.Ia(null);a=E(a);return null==a?null:Wb(a)}function vd(a){return null!=a?null!=a&&(a.m&64||q===a.G)?a.bb(null):(a=E(a))?Yb(a):wd:wd}
+function z(a){return null==a?null:null!=a&&(a.m&128||q===a.Id)?a.Ka(null):E(vd(a))}var G=function G(a){switch(arguments.length){case 1:return G.h(arguments[0]);case 2:return G.c(arguments[0],arguments[1]);default:for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;return G.A(arguments[0],arguments[1],new Jb(c.slice(2),0,null))}};G.h=function(){return!0};G.c=function(a,b){return null==a?null==b:a===b||zc(a,b)};
+G.A=function(a,b,c){for(;;)if(G.c(a,b))if(z(c))a=b,b=y(c),c=z(c);else return G.c(b,y(c));else return!1};G.N=function(a){var b=y(a),c=z(a);a=y(c);c=z(c);return G.A(b,a,c)};G.L=2;function xd(a){this.s=a}xd.prototype.next=function(){if(null!=this.s){var a=y(this.s);this.s=z(this.s);return{value:a,done:!1}}return{value:null,done:!0}};function yd(a){return new xd(E(a))}function zd(a,b){var c=hd(a);c=id(0,c);return jd(c,b)}
+function Ad(a){var b=0,c=1;for(a=E(a);;)if(null!=a)b+=1,c=gd(31,c)+od(y(a))|0,a=z(a);else return zd(c,b)}var Cd=zd(1,0);function Dd(a){var b=0,c=0;for(a=E(a);;)if(null!=a)b+=1,c=c+od(y(a))|0,a=z(a);else return zd(c,b)}var Ed=zd(0,0);Pb["null"]=!0;Qb["null"]=function(){return 0};Date.prototype.K=function(a,b){return b instanceof Date&&this.valueOf()===b.valueOf()};Date.prototype.zc=q;
+Date.prototype.cc=function(a,b){if(b instanceof Date)return Aa(this.valueOf(),b.valueOf());throw Error(["Cannot compare ",v.h(this)," to ",v.h(b)].join(""));};zc.number=function(a,b){return a===b};Nb["function"]=!0;rc["function"]=!0;sc["function"]=function(){return null};Ac._=function(a){return ja(a)};function Fd(a){return a+1}function Gd(a){this.H=a;this.m=32768;this.J=0}Gd.prototype.pc=function(){return this.H};function Hd(a){return a instanceof Gd}function Id(a){return Hd(a)?a:new Gd(a)}
+function Jd(a){return Hd(a)?B(a):a}function Kd(a,b){var c=Qb(a);if(0===c)return b.B?b.B():b.call(null);for(var d=A.c(a,0),e=1;;)if(e<c){var f=A.c(a,e);d=b.c?b.c(d,f):b.call(null,d,f);if(Hd(d))return B(d);e+=1}else return d}function Ld(a,b,c){var d=Qb(a),e=c;for(c=0;;)if(c<d){var f=A.c(a,c);e=b.c?b.c(e,f):b.call(null,e,f);if(Hd(e))return B(e);c+=1}else return e}
+function Md(a,b){var c=a.length;if(0===a.length)return b.B?b.B():b.call(null);for(var d=a[0],e=1;;)if(e<c){var f=a[e];d=b.c?b.c(d,f):b.call(null,d,f);if(Hd(d))return B(d);e+=1}else return d}function Nd(a,b,c){var d=a.length,e=c;for(c=0;;)if(c<d){var f=a[c];e=b.c?b.c(e,f):b.call(null,e,f);if(Hd(e))return B(e);c+=1}else return e}function Od(a,b,c,d){for(var e=a.length;;)if(d<e){var f=a[d];c=b.c?b.c(c,f):b.call(null,c,f);if(Hd(c))return B(c);d+=1}else return c}
+function Pd(a){return null!=a?a.m&2||q===a.jf?!0:a.m?!1:Ab(Pb,a):Ab(Pb,a)}function Qd(a){return null!=a?a.m&16||q===a.Ne?!0:a.m?!1:Ab(Ub,a):Ab(Ub,a)}function Ud(a,b,c){var d=H(a);if(c>=d)return-1;!(0<c)&&0>c&&(c+=d,c=0>c?0:c);for(;;)if(c<d){if(G.c(Vd(a,c),b))return c;c+=1}else return-1}function Xd(a,b,c){var d=H(a);if(0===d)return-1;0<c?(--d,c=d<c?d:c):c=0>c?d+c:c;for(;;)if(0<=c){if(G.c(Vd(a,c),b))return c;--c}else return-1}function Yd(a,b){this.o=a;this.i=b}
+Yd.prototype.ja=function(){return this.i<this.o.length};Yd.prototype.next=function(){var a=this.o[this.i];this.i+=1;return a};function Jb(a,b,c){this.o=a;this.i=b;this.meta=c;this.m=166592766;this.J=139264}g=Jb.prototype;g.toString=function(){return fd(this)};g.equiv=function(a){return this.K(null,a)};
+g.indexOf=function(){var a=null;a=function(a,c){switch(arguments.length){case 1:return Ud(this,a,0);case 2:return Ud(this,a,c)}throw Error("Invalid arity: "+(arguments.length-1));};a.h=function(a){return Ud(this,a,0)};a.c=function(a,c){return Ud(this,a,c)};return a}();
+g.lastIndexOf=function(){function a(a){return Xd(this,a,H(this))}var b=null;b=function(b,d){switch(arguments.length){case 1:return a.call(this,b);case 2:return Xd(this,b,d)}throw Error("Invalid arity: "+(arguments.length-1));};b.h=a;b.c=function(a,b){return Xd(this,a,b)};return b}();g.$=function(a,b){var c=b+this.i;if(0<=c&&c<this.o.length)return this.o[c];throw Error("Index out of bounds");};g.ka=function(a,b,c){a=b+this.i;return 0<=a&&a<this.o.length?this.o[a]:c};
+g.ba=function(){return new Yd(this.o,this.i)};g.P=function(){return this.meta};g.Ka=function(){return this.i+1<this.o.length?new Jb(this.o,this.i+1,null):null};g.W=function(){var a=this.o.length-this.i;return 0>a?0:a};g.Rc=function(){var a=this.W(null);return 0<a?new Zd(this,a-1,null):null};g.U=function(){return Ad(this)};g.K=function(a,b){return $d(this,b)};g.oa=function(){return wd};g.Fa=function(a,b){return Od(this.o,b,this.o[this.i],this.i+1)};g.Ga=function(a,b,c){return Od(this.o,b,c,this.i)};
+g.Ia=function(){return this.o[this.i]};g.bb=function(){return this.i+1<this.o.length?new Jb(this.o,this.i+1,null):wd};g.S=function(){return this.i<this.o.length?this:null};g.T=function(a,b){return new Jb(this.o,this.i,b)};g.X=function(a,b){return ae(b,this)};Jb.prototype[Fb]=function(){return yd(this)};function be(a){return 0<a.length?new Jb(a,0,null):null}function Zd(a,b,c){this.Gd=a;this.i=b;this.meta=c;this.m=32374990;this.J=8192}g=Zd.prototype;g.toString=function(){return fd(this)};
+g.equiv=function(a){return this.K(null,a)};g.indexOf=function(){var a=null;a=function(a,c){switch(arguments.length){case 1:return Ud(this,a,0);case 2:return Ud(this,a,c)}throw Error("Invalid arity: "+(arguments.length-1));};a.h=function(a){return Ud(this,a,0)};a.c=function(a,c){return Ud(this,a,c)};return a}();
+g.lastIndexOf=function(){function a(a){return Xd(this,a,H(this))}var b=null;b=function(b,d){switch(arguments.length){case 1:return a.call(this,b);case 2:return Xd(this,b,d)}throw Error("Invalid arity: "+(arguments.length-1));};b.h=a;b.c=function(a,b){return Xd(this,a,b)};return b}();g.P=function(){return this.meta};g.Ka=function(){return 0<this.i?new Zd(this.Gd,this.i-1,null):null};g.W=function(){return this.i+1};g.U=function(){return Ad(this)};g.K=function(a,b){return $d(this,b)};
+g.oa=function(){return tc(wd,this.meta)};g.Fa=function(a,b){return ce(b,this)};g.Ga=function(a,b,c){return de(b,c,this)};g.Ia=function(){return A.c(this.Gd,this.i)};g.bb=function(){return 0<this.i?new Zd(this.Gd,this.i-1,null):wd};g.S=function(){return this};g.T=function(a,b){return new Zd(this.Gd,this.i,b)};g.X=function(a,b){return ae(b,this)};Zd.prototype[Fb]=function(){return yd(this)};function ee(a){return y(z(a))}function fe(a){for(;;){var b=z(a);if(null!=b)a=b;else return y(a)}}
+zc._=function(a,b){return a===b};var ge=function ge(a){switch(arguments.length){case 0:return ge.B();case 1:return ge.h(arguments[0]);case 2:return ge.c(arguments[0],arguments[1]);default:for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;return ge.A(arguments[0],arguments[1],new Jb(c.slice(2),0,null))}};ge.B=function(){return he};ge.h=function(a){return a};ge.c=function(a,b){return null!=a?Tb(a,b):Tb(wd,b)};
+ge.A=function(a,b,c){for(;;)if(t(c))a=ge.c(a,b),b=y(c),c=z(c);else return ge.c(a,b)};ge.N=function(a){var b=y(a),c=z(a);a=y(c);c=z(c);return ge.A(b,a,c)};ge.L=2;function ie(a){return null==a?null:Rb(a)}function H(a){if(null!=a)if(null!=a&&(a.m&2||q===a.jf))a=a.W(null);else if(vb(a))a=a.length;else if("string"===typeof a)a=a.length;else if(null!=a&&(a.m&8388608||q===a.Pe))a:{a=E(a);for(var b=0;;){if(Pd(a)){a=b+Qb(a);break a}a=z(a);b+=1}}else a=Qb(a);else a=0;return a}
+function je(a,b,c){for(;;){if(null==a)return c;if(0===b)return E(a)?y(a):c;if(Qd(a))return A.l(a,b,c);if(E(a))a=z(a),--b;else return c}}
+function Vd(a,b){if("number"!==typeof b)throw Error("Index argument to nth must be a number");if(null==a)return a;if(null!=a&&(a.m&16||q===a.Ne))return a.$(null,b);if(vb(a)){if(0<=b&&b<a.length)return a[b];throw Error("Index out of bounds");}if("string"===typeof a){if(0<=b&&b<a.length)return a.charAt(b);throw Error("Index out of bounds");}if(null!=a&&(a.m&64||q===a.G)){a:{var c=a;for(var d=b;;){if(null==c)throw Error("Index out of bounds");if(0===d){if(E(c)){c=y(c);break a}throw Error("Index out of bounds");
+}if(Qd(c)){c=A.c(c,d);break a}if(E(c))c=z(c),--d;else throw Error("Index out of bounds");}}return c}if(Ab(Ub,a))return A.c(a,b);throw Error(["nth not supported on this type ",v.h(Db(Bb(a)))].join(""));}
+function J(a,b,c){if("number"!==typeof b)throw Error("Index argument to nth must be a number.");if(null==a)return c;if(null!=a&&(a.m&16||q===a.Ne))return a.ka(null,b,c);if(vb(a))return 0<=b&&b<a.length?a[b]:c;if("string"===typeof a)return 0<=b&&b<a.length?a.charAt(b):c;if(null!=a&&(a.m&64||q===a.G))return je(a,b,c);if(Ab(Ub,a))return A.l(a,b,c);throw Error(["nth not supported on this type ",v.h(Db(Bb(a)))].join(""));}
+var D=function D(a){switch(arguments.length){case 2:return D.c(arguments[0],arguments[1]);case 3:return D.l(arguments[0],arguments[1],arguments[2]);default:throw Error(["Invalid arity: ",v.h(arguments.length)].join(""));}};D.c=function(a,b){return null==a?null:null!=a&&(a.m&256||q===a.rf)?a.V(null,b):vb(a)?null!=b&&b<a.length?a[b|0]:null:"string"===typeof a?null!=b&&b<a.length?a.charAt(b|0):null:Ab($b,a)?cc.c(a,b):null};
+D.l=function(a,b,c){return null!=a?null!=a&&(a.m&256||q===a.rf)?a.I(null,b,c):vb(a)?null!=b&&0<=b&&b<a.length?a[b|0]:c:"string"===typeof a?null!=b&&0<=b&&b<a.length?a.charAt(b|0):c:Ab($b,a)?cc.l(a,b,c):c:c};D.L=3;var K=function K(a){switch(arguments.length){case 3:return K.l(arguments[0],arguments[1],arguments[2]);default:for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;return K.A(arguments[0],arguments[1],arguments[2],new Jb(c.slice(3),0,null))}};
+K.l=function(a,b,c){return null!=a?ec(a,b,c):ke([b,c])};K.A=function(a,b,c,d){for(;;)if(a=K.l(a,b,c),t(d))b=y(d),c=ee(d),d=z(z(d));else return a};K.N=function(a){var b=y(a),c=z(a);a=y(c);var d=z(c);c=y(d);d=z(d);return K.A(b,a,c,d)};K.L=3;
+var le=function le(a){switch(arguments.length){case 1:return le.h(arguments[0]);case 2:return le.c(arguments[0],arguments[1]);default:for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;return le.A(arguments[0],arguments[1],new Jb(c.slice(2),0,null))}};le.h=function(a){return a};le.c=function(a,b){return null==a?null:gc(a,b)};le.A=function(a,b,c){for(;;){if(null==a)return null;a=le.c(a,b);if(t(c))b=y(c),c=z(c);else return a}};
+le.N=function(a){var b=y(a),c=z(a);a=y(c);c=z(c);return le.A(b,a,c)};le.L=2;function me(a){var b=ha(a);return b?b:null!=a?q===a.hf?!0:a.Tc?!1:Ab(Nb,a):Ab(Nb,a)}function ne(a,b){this.C=a;this.meta=b;this.m=393217;this.J=0}g=ne.prototype;g.P=function(){return this.meta};g.T=function(a,b){return new ne(this.C,b)};g.hf=q;
+g.call=function(){function a(a,b,c,d,e,f,h,k,m,l,p,u,w,x,C,F,I,M,S,X,Q,Ga){return oe(this.C,b,c,d,e,be([f,h,k,m,l,p,u,w,x,C,F,I,M,S,X,Q,Ga]))}function b(a,b,c,d,e,f,h,k,m,l,p,u,w,x,C,F,I,M,S,X,Q){a=this;return a.C.Xa?a.C.Xa(b,c,d,e,f,h,k,m,l,p,u,w,x,C,F,I,M,S,X,Q):a.C.call(null,b,c,d,e,f,h,k,m,l,p,u,w,x,C,F,I,M,S,X,Q)}function c(a,b,c,d,e,f,h,k,m,l,p,u,w,x,C,F,I,M,S,X){a=this;return a.C.Wa?a.C.Wa(b,c,d,e,f,h,k,m,l,p,u,w,x,C,F,I,M,S,X):a.C.call(null,b,c,d,e,f,h,k,m,l,p,u,w,x,C,F,I,M,S,X)}function d(a,
+b,c,d,e,f,h,k,m,l,p,u,w,x,C,F,I,M,S){a=this;return a.C.Va?a.C.Va(b,c,d,e,f,h,k,m,l,p,u,w,x,C,F,I,M,S):a.C.call(null,b,c,d,e,f,h,k,m,l,p,u,w,x,C,F,I,M,S)}function e(a,b,c,d,e,f,h,k,m,l,p,u,w,x,C,F,I,M){a=this;return a.C.Ua?a.C.Ua(b,c,d,e,f,h,k,m,l,p,u,w,x,C,F,I,M):a.C.call(null,b,c,d,e,f,h,k,m,l,p,u,w,x,C,F,I,M)}function f(a,b,c,d,e,f,h,k,m,l,p,u,w,x,C,F,I){a=this;return a.C.Ta?a.C.Ta(b,c,d,e,f,h,k,m,l,p,u,w,x,C,F,I):a.C.call(null,b,c,d,e,f,h,k,m,l,p,u,w,x,C,F,I)}function h(a,b,c,d,e,f,h,k,m,l,p,u,
+w,x,C,F){a=this;return a.C.Sa?a.C.Sa(b,c,d,e,f,h,k,m,l,p,u,w,x,C,F):a.C.call(null,b,c,d,e,f,h,k,m,l,p,u,w,x,C,F)}function k(a,b,c,d,e,f,h,k,m,l,p,u,w,x,C){a=this;return a.C.Ra?a.C.Ra(b,c,d,e,f,h,k,m,l,p,u,w,x,C):a.C.call(null,b,c,d,e,f,h,k,m,l,p,u,w,x,C)}function l(a,b,c,d,e,f,h,k,m,l,p,u,w,x){a=this;return a.C.Qa?a.C.Qa(b,c,d,e,f,h,k,m,l,p,u,w,x):a.C.call(null,b,c,d,e,f,h,k,m,l,p,u,w,x)}function p(a,b,c,d,e,f,h,k,m,l,p,u,w){a=this;return a.C.Pa?a.C.Pa(b,c,d,e,f,h,k,m,l,p,u,w):a.C.call(null,b,c,d,
+e,f,h,k,m,l,p,u,w)}function m(a,b,c,d,e,f,h,k,m,l,p,u){a=this;return a.C.Oa?a.C.Oa(b,c,d,e,f,h,k,m,l,p,u):a.C.call(null,b,c,d,e,f,h,k,m,l,p,u)}function u(a,b,c,d,e,f,h,k,m,l,p){a=this;return a.C.Na?a.C.Na(b,c,d,e,f,h,k,m,l,p):a.C.call(null,b,c,d,e,f,h,k,m,l,p)}function w(a,b,c,d,e,f,h,k,m,l){a=this;return a.C.Za?a.C.Za(b,c,d,e,f,h,k,m,l):a.C.call(null,b,c,d,e,f,h,k,m,l)}function x(a,b,c,d,e,f,h,k,m){a=this;return a.C.Ha?a.C.Ha(b,c,d,e,f,h,k,m):a.C.call(null,b,c,d,e,f,h,k,m)}function C(a,b,c,d,e,f,
+h,k){a=this;return a.C.Ya?a.C.Ya(b,c,d,e,f,h,k):a.C.call(null,b,c,d,e,f,h,k)}function F(a,b,c,d,e,f,h){a=this;return a.C.Ca?a.C.Ca(b,c,d,e,f,h):a.C.call(null,b,c,d,e,f,h)}function I(a,b,c,d,e,f){a=this;return a.C.Z?a.C.Z(b,c,d,e,f):a.C.call(null,b,c,d,e,f)}function M(a,b,c,d,e){a=this;return a.C.M?a.C.M(b,c,d,e):a.C.call(null,b,c,d,e)}function S(a,b,c,d){a=this;return a.C.l?a.C.l(b,c,d):a.C.call(null,b,c,d)}function X(a,b,c){a=this;return a.C.c?a.C.c(b,c):a.C.call(null,b,c)}function Ga(a,b){a=this;
+return a.C.h?a.C.h(b):a.C.call(null,b)}function db(a){a=this;return a.C.B?a.C.B():a.C.call(null)}var Q=null;Q=function(xb,Ha,Ja,Oa,Ba,W,$a,ka,jb,nb,zb,Ib,Q,Xb,ic,xc,Sc,Bd,se,Lf,Ih,kl){switch(arguments.length){case 1:return db.call(this,xb);case 2:return Ga.call(this,xb,Ha);case 3:return X.call(this,xb,Ha,Ja);case 4:return S.call(this,xb,Ha,Ja,Oa);case 5:return M.call(this,xb,Ha,Ja,Oa,Ba);case 6:return I.call(this,xb,Ha,Ja,Oa,Ba,W);case 7:return F.call(this,xb,Ha,Ja,Oa,Ba,W,$a);case 8:return C.call(this,
+xb,Ha,Ja,Oa,Ba,W,$a,ka);case 9:return x.call(this,xb,Ha,Ja,Oa,Ba,W,$a,ka,jb);case 10:return w.call(this,xb,Ha,Ja,Oa,Ba,W,$a,ka,jb,nb);case 11:return u.call(this,xb,Ha,Ja,Oa,Ba,W,$a,ka,jb,nb,zb);case 12:return m.call(this,xb,Ha,Ja,Oa,Ba,W,$a,ka,jb,nb,zb,Ib);case 13:return p.call(this,xb,Ha,Ja,Oa,Ba,W,$a,ka,jb,nb,zb,Ib,Q);case 14:return l.call(this,xb,Ha,Ja,Oa,Ba,W,$a,ka,jb,nb,zb,Ib,Q,Xb);case 15:return k.call(this,xb,Ha,Ja,Oa,Ba,W,$a,ka,jb,nb,zb,Ib,Q,Xb,ic);case 16:return h.call(this,xb,Ha,Ja,Oa,Ba,
+W,$a,ka,jb,nb,zb,Ib,Q,Xb,ic,xc);case 17:return f.call(this,xb,Ha,Ja,Oa,Ba,W,$a,ka,jb,nb,zb,Ib,Q,Xb,ic,xc,Sc);case 18:return e.call(this,xb,Ha,Ja,Oa,Ba,W,$a,ka,jb,nb,zb,Ib,Q,Xb,ic,xc,Sc,Bd);case 19:return d.call(this,xb,Ha,Ja,Oa,Ba,W,$a,ka,jb,nb,zb,Ib,Q,Xb,ic,xc,Sc,Bd,se);case 20:return c.call(this,xb,Ha,Ja,Oa,Ba,W,$a,ka,jb,nb,zb,Ib,Q,Xb,ic,xc,Sc,Bd,se,Lf);case 21:return b.call(this,xb,Ha,Ja,Oa,Ba,W,$a,ka,jb,nb,zb,Ib,Q,Xb,ic,xc,Sc,Bd,se,Lf,Ih);case 22:return a.call(this,0,Ha,Ja,Oa,Ba,W,$a,ka,jb,nb,
+zb,Ib,Q,Xb,ic,xc,Sc,Bd,se,Lf,Ih,kl)}throw Error("Invalid arity: "+(arguments.length-1));};Q.h=db;Q.c=Ga;Q.l=X;Q.M=S;Q.Z=M;Q.Ca=I;Q.Ya=F;Q.Ha=C;Q.Za=x;Q.Na=w;Q.Oa=u;Q.Pa=m;Q.Qa=p;Q.Ra=l;Q.Sa=k;Q.Ta=h;Q.Ua=f;Q.Va=e;Q.Wa=d;Q.Xa=c;Q.he=b;Q.qf=a;return Q}();g.apply=function(a,b){return this.call.apply(this,[this].concat(Gb(b)))};g.B=function(){return this.C.B?this.C.B():this.C.call(null)};g.h=function(a){return this.C.h?this.C.h(a):this.C.call(null,a)};
+g.c=function(a,b){return this.C.c?this.C.c(a,b):this.C.call(null,a,b)};g.l=function(a,b,c){return this.C.l?this.C.l(a,b,c):this.C.call(null,a,b,c)};g.M=function(a,b,c,d){return this.C.M?this.C.M(a,b,c,d):this.C.call(null,a,b,c,d)};g.Z=function(a,b,c,d,e){return this.C.Z?this.C.Z(a,b,c,d,e):this.C.call(null,a,b,c,d,e)};g.Ca=function(a,b,c,d,e,f){return this.C.Ca?this.C.Ca(a,b,c,d,e,f):this.C.call(null,a,b,c,d,e,f)};
+g.Ya=function(a,b,c,d,e,f,h){return this.C.Ya?this.C.Ya(a,b,c,d,e,f,h):this.C.call(null,a,b,c,d,e,f,h)};g.Ha=function(a,b,c,d,e,f,h,k){return this.C.Ha?this.C.Ha(a,b,c,d,e,f,h,k):this.C.call(null,a,b,c,d,e,f,h,k)};g.Za=function(a,b,c,d,e,f,h,k,l){return this.C.Za?this.C.Za(a,b,c,d,e,f,h,k,l):this.C.call(null,a,b,c,d,e,f,h,k,l)};g.Na=function(a,b,c,d,e,f,h,k,l,p){return this.C.Na?this.C.Na(a,b,c,d,e,f,h,k,l,p):this.C.call(null,a,b,c,d,e,f,h,k,l,p)};
+g.Oa=function(a,b,c,d,e,f,h,k,l,p,m){return this.C.Oa?this.C.Oa(a,b,c,d,e,f,h,k,l,p,m):this.C.call(null,a,b,c,d,e,f,h,k,l,p,m)};g.Pa=function(a,b,c,d,e,f,h,k,l,p,m,u){return this.C.Pa?this.C.Pa(a,b,c,d,e,f,h,k,l,p,m,u):this.C.call(null,a,b,c,d,e,f,h,k,l,p,m,u)};g.Qa=function(a,b,c,d,e,f,h,k,l,p,m,u,w){return this.C.Qa?this.C.Qa(a,b,c,d,e,f,h,k,l,p,m,u,w):this.C.call(null,a,b,c,d,e,f,h,k,l,p,m,u,w)};
+g.Ra=function(a,b,c,d,e,f,h,k,l,p,m,u,w,x){return this.C.Ra?this.C.Ra(a,b,c,d,e,f,h,k,l,p,m,u,w,x):this.C.call(null,a,b,c,d,e,f,h,k,l,p,m,u,w,x)};g.Sa=function(a,b,c,d,e,f,h,k,l,p,m,u,w,x,C){return this.C.Sa?this.C.Sa(a,b,c,d,e,f,h,k,l,p,m,u,w,x,C):this.C.call(null,a,b,c,d,e,f,h,k,l,p,m,u,w,x,C)};g.Ta=function(a,b,c,d,e,f,h,k,l,p,m,u,w,x,C,F){return this.C.Ta?this.C.Ta(a,b,c,d,e,f,h,k,l,p,m,u,w,x,C,F):this.C.call(null,a,b,c,d,e,f,h,k,l,p,m,u,w,x,C,F)};
+g.Ua=function(a,b,c,d,e,f,h,k,l,p,m,u,w,x,C,F,I){return this.C.Ua?this.C.Ua(a,b,c,d,e,f,h,k,l,p,m,u,w,x,C,F,I):this.C.call(null,a,b,c,d,e,f,h,k,l,p,m,u,w,x,C,F,I)};g.Va=function(a,b,c,d,e,f,h,k,l,p,m,u,w,x,C,F,I,M){return this.C.Va?this.C.Va(a,b,c,d,e,f,h,k,l,p,m,u,w,x,C,F,I,M):this.C.call(null,a,b,c,d,e,f,h,k,l,p,m,u,w,x,C,F,I,M)};
+g.Wa=function(a,b,c,d,e,f,h,k,l,p,m,u,w,x,C,F,I,M,S){return this.C.Wa?this.C.Wa(a,b,c,d,e,f,h,k,l,p,m,u,w,x,C,F,I,M,S):this.C.call(null,a,b,c,d,e,f,h,k,l,p,m,u,w,x,C,F,I,M,S)};g.Xa=function(a,b,c,d,e,f,h,k,l,p,m,u,w,x,C,F,I,M,S,X){return this.C.Xa?this.C.Xa(a,b,c,d,e,f,h,k,l,p,m,u,w,x,C,F,I,M,S,X):this.C.call(null,a,b,c,d,e,f,h,k,l,p,m,u,w,x,C,F,I,M,S,X)};g.he=function(a,b,c,d,e,f,h,k,l,p,m,u,w,x,C,F,I,M,S,X,Ga){return oe(this.C,a,b,c,d,be([e,f,h,k,l,p,m,u,w,x,C,F,I,M,S,X,Ga]))};
+function pe(a,b){return ha(a)?new ne(a,b):null==a?null:tc(a,b)}function qe(a){var b=null!=a;return(b?null!=a?a.m&131072||q===a.tf||(a.m?0:Ab(rc,a)):Ab(rc,a):b)?sc(a):null}var re=function re(a){switch(arguments.length){case 1:return re.h(arguments[0]);case 2:return re.c(arguments[0],arguments[1]);default:for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;return re.A(arguments[0],arguments[1],new Jb(c.slice(2),0,null))}};re.h=function(a){return a};
+re.c=function(a,b){return null==a?null:mc(a,b)};re.A=function(a,b,c){for(;;){if(null==a)return null;a=re.c(a,b);if(t(c))b=y(c),c=z(c);else return a}};re.N=function(a){var b=y(a),c=z(a);a=y(c);c=z(c);return re.A(b,a,c)};re.L=2;function te(a){return null==a||wb(E(a))}function ue(a){return null==a?!1:null!=a?a.m&8||q===a.Qf?!0:a.m?!1:Ab(Sb,a):Ab(Sb,a)}function ve(a){return null==a?!1:null!=a?a.m&4096||q===a.$f?!0:a.m?!1:Ab(lc,a):Ab(lc,a)}
+function we(a){return null!=a?a.m&16777216||q===a.Zf?!0:a.m?!1:Ab(Ec,a):Ab(Ec,a)}function xe(a){return null==a?!1:null!=a?a.m&1024||q===a.Wf?!0:a.m?!1:Ab(fc,a):Ab(fc,a)}function ye(a){return null!=a?a.m&67108864||q===a.Xf?!0:a.m?!1:Ab(Gc,a):Ab(Gc,a)}function ze(a){return null!=a?a.m&16384||q===a.ag?!0:a.m?!1:Ab(pc,a):Ab(pc,a)}function Ae(a){return null!=a?a.J&512||q===a.Pf?!0:!1:!1}function Be(a,b,c,d,e){for(;0!==e;)c[d]=a[b],d+=1,--e,b+=1}var Ce={};
+function De(a){return null==a?!1:null!=a?a.m&64||q===a.G?!0:a.m?!1:Ab(Vb,a):Ab(Vb,a)}function Ee(a){return null==a?!1:!1===a?!1:!0}function Fe(a){var b=me(a);return b?b:null!=a?a.m&1||q===a.Rf?!0:a.m?!1:Ab(Ob,a):Ab(Ob,a)}function Ge(a){return"number"===typeof a&&!isNaN(a)&&Infinity!==a&&parseFloat(a)===parseInt(a,10)}function He(a,b){return D.l(a,b,Ce)===Ce?!1:!0}
+var Ie=function Ie(a){switch(arguments.length){case 1:return Ie.h(arguments[0]);case 2:return Ie.c(arguments[0],arguments[1]);default:for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;return Ie.A(arguments[0],arguments[1],new Jb(c.slice(2),0,null))}};Ie.h=function(){return!0};Ie.c=function(a,b){return!G.c(a,b)};Ie.A=function(a,b,c){if(G.c(a,b))return!1;a=Je([a,b]);for(b=c;;){var d=y(b);c=z(b);if(t(b)){if(He(a,d))return!1;a=ge.c(a,d);b=c}else return!0}};
+Ie.N=function(a){var b=y(a),c=z(a);a=y(c);c=z(c);return Ie.A(b,a,c)};Ie.L=2;function Ke(a,b){if(a===b)return 0;if(null==a)return-1;if(null==b)return 1;if("number"===typeof a){if("number"===typeof b)return Aa(a,b);throw Error(["Cannot compare ",v.h(a)," to ",v.h(b)].join(""));}if(null!=a?a.J&2048||q===a.zc||(a.J?0:Ab(Tc,a)):Ab(Tc,a))return Uc(a,b);if("string"!==typeof a&&!vb(a)&&!0!==a&&!1!==a||Bb(a)!==Bb(b))throw Error(["Cannot compare ",v.h(a)," to ",v.h(b)].join(""));return Aa(a,b)}
+function Le(a,b){var c=H(a),d=H(b);if(c<d)c=-1;else if(c>d)c=1;else if(0===c)c=0;else a:for(d=0;;){var e=Ke(Vd(a,d),Vd(b,d));if(0===e&&d+1<c)d+=1;else{c=e;break a}}return c}function Me(a){return G.c(a,Ke)?Ke:function(b,c){var d=a.c?a.c(b,c):a.call(null,b,c);return"number"===typeof d?d:t(d)?-1:t(a.c?a.c(c,b):a.call(null,c,b))?1:0}}function Ne(a,b){if(E(b)){a:{var c=[];for(var d=E(b);;)if(null!=d)c.push(y(d)),d=z(d);else break a}d=Me(a);Ca(c,d);return E(c)}return wd}
+function Oe(a){var b=Pe("@!\"#%\x26'*+-/:[{\x3c\\|\x3d]}\x3e^~?".split(""),"_CIRCA_ _BANG_ _DOUBLEQUOTE_ _SHARP_ _PERCENT_ _AMPERSAND_ _SINGLEQUOTE_ _STAR_ _PLUS_ _ _SLASH_ _COLON_ _LBRACK_ _LBRACE_ _LT_ _BSLASH_ _BAR_ _EQ_ _RBRACK_ _RBRACE_ _GT_ _CARET_ _TILDE_ _QMARK_".split(" "));return Qe(a,b)}function Qe(a,b){return Ne(function(b,d){var c=a.h?a.h(b):a.call(null,b),f=a.h?a.h(d):a.call(null,d),h=Me(Ke);return h.c?h.c(c,f):h.call(null,c,f)},b)}
+function ce(a,b){var c=E(b);return c?Mb(a,y(c),z(c)):a.B?a.B():a.call(null)}function de(a,b,c){for(c=E(c);;)if(c){var d=y(c);b=a.c?a.c(b,d):a.call(null,b,d);if(Hd(b))return B(b);c=z(c)}else return b}function Re(a,b){var c=dd(a);if(t(c.ja()))for(var d=c.next();;)if(c.ja()){var e=c.next();d=b.c?b.c(d,e):b.call(null,d,e);if(Hd(d))return B(d)}else return d;else return b.B?b.B():b.call(null)}
+function Se(a,b,c){for(a=dd(a);;)if(a.ja()){var d=a.next();c=b.c?b.c(c,d):b.call(null,c,d);if(Hd(c))return B(c)}else return c}function Te(a,b){return null!=b&&(b.m&524288||q===b.uf)?b.Fa(null,a):vb(b)?Md(b,a):"string"===typeof b?Md(b,a):Ab(uc,b)?vc.c(b,a):ud(b)?Re(b,a):ce(a,b)}function Mb(a,b,c){return null!=c&&(c.m&524288||q===c.uf)?c.Ga(null,a,b):vb(c)?Nd(c,a,b):"string"===typeof c?Nd(c,a,b):Ab(uc,c)?vc.l(c,a,b):ud(c)?Se(c,a,b):de(a,b,c)}function Ue(a,b,c){return null!=c?yc(c,a,b):b}
+function Ve(a){return a}function We(a,b,c,d){a=a.h?a.h(b):a.call(null,b);c=Mb(a,c,d);return a.h?a.h(c):a.call(null,c)}var Xe=function Xe(a){switch(arguments.length){case 0:return Xe.B();case 1:return Xe.h(arguments[0]);case 2:return Xe.c(arguments[0],arguments[1]);default:for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;return Xe.A(arguments[0],arguments[1],new Jb(c.slice(2),0,null))}};Xe.B=function(){return 0};Xe.h=function(a){return a};
+Xe.c=function(a,b){return a+b};Xe.A=function(a,b,c){return Mb(Xe,a+b,c)};Xe.N=function(a){var b=y(a),c=z(a);a=y(c);c=z(c);return Xe.A(b,a,c)};Xe.L=2;var Ye=function Ye(a){switch(arguments.length){case 0:return Ye.B();case 1:return Ye.h(arguments[0]);case 2:return Ye.c(arguments[0],arguments[1]);default:for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;return Ye.A(arguments[0],arguments[1],new Jb(c.slice(2),0,null))}};Ye.B=function(){return 1};Ye.h=function(a){return a};
+Ye.c=function(a,b){return a*b};Ye.A=function(a,b,c){return Mb(Ye,a*b,c)};Ye.N=function(a){var b=y(a),c=z(a);a=y(c);c=z(c);return Ye.A(b,a,c)};Ye.L=2;function Ze(a){a=(a-a%2)/2;return 0<=a?Math.floor(a):Math.ceil(a)}function $e(a){a-=a>>1&1431655765;a=(a&858993459)+(a>>2&858993459);return 16843009*(a+(a>>4)&252645135)>>24}
+var v=function v(a){switch(arguments.length){case 0:return v.B();case 1:return v.h(arguments[0]);default:for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;return v.A(arguments[0],new Jb(c.slice(1),0,null))}};v.B=function(){return""};v.h=function(a){return null==a?"":""+a};v.A=function(a,b){for(var c=new cb(""+v.h(a)),d=b;;)if(t(d))c=c.append(""+v.h(y(d))),d=z(d);else return c.toString()};v.N=function(a){var b=y(a);a=z(a);return v.A(b,a)};v.L=1;
+function $d(a,b){if(we(b))if(Pd(a)&&Pd(b)&&H(a)!==H(b))var c=!1;else a:{c=E(a);for(var d=E(b);;){if(null==c){c=null==d;break a}if(null!=d&&G.c(y(c),y(d)))c=z(c),d=z(d);else{c=!1;break a}}}else c=null;return Ee(c)}function af(a,b,c,d,e){this.meta=a;this.first=b;this.kc=c;this.count=d;this.w=e;this.m=65937646;this.J=8192}g=af.prototype;g.toString=function(){return fd(this)};g.equiv=function(a){return this.K(null,a)};
+g.indexOf=function(){var a=null;a=function(a,c){switch(arguments.length){case 1:return Ud(this,a,0);case 2:return Ud(this,a,c)}throw Error("Invalid arity: "+(arguments.length-1));};a.h=function(a){return Ud(this,a,0)};a.c=function(a,c){return Ud(this,a,c)};return a}();
+g.lastIndexOf=function(){function a(a){return Xd(this,a,this.count)}var b=null;b=function(b,d){switch(arguments.length){case 1:return a.call(this,b);case 2:return Xd(this,b,d)}throw Error("Invalid arity: "+(arguments.length-1));};b.h=a;b.c=function(a,b){return Xd(this,a,b)};return b}();g.P=function(){return this.meta};g.Ka=function(){return 1===this.count?null:this.kc};g.W=function(){return this.count};g.Ac=function(){return this.first};g.Bc=function(){return this.bb(null)};
+g.U=function(){var a=this.w;return null!=a?a:this.w=a=Ad(this)};g.K=function(a,b){return $d(this,b)};g.oa=function(){return tc(wd,this.meta)};g.Fa=function(a,b){return ce(b,this)};g.Ga=function(a,b,c){return de(b,c,this)};g.Ia=function(){return this.first};g.bb=function(){return 1===this.count?wd:this.kc};g.S=function(){return this};g.T=function(a,b){return new af(b,this.first,this.kc,this.count,this.w)};g.X=function(a,b){return new af(this.meta,b,this,this.count+1,null)};af.prototype[Fb]=function(){return yd(this)};
+function bf(a){this.meta=a;this.m=65937614;this.J=8192}g=bf.prototype;g.toString=function(){return fd(this)};g.equiv=function(a){return this.K(null,a)};g.indexOf=function(){var a=null;a=function(a,c){switch(arguments.length){case 1:return Ud(this,a,0);case 2:return Ud(this,a,c)}throw Error("Invalid arity: "+(arguments.length-1));};a.h=function(a){return Ud(this,a,0)};a.c=function(a,c){return Ud(this,a,c)};return a}();
+g.lastIndexOf=function(){function a(a){return Xd(this,a,H(this))}var b=null;b=function(b,d){switch(arguments.length){case 1:return a.call(this,b);case 2:return Xd(this,b,d)}throw Error("Invalid arity: "+(arguments.length-1));};b.h=a;b.c=function(a,b){return Xd(this,a,b)};return b}();g.P=function(){return this.meta};g.Ka=function(){return null};g.W=function(){return 0};g.Ac=function(){return null};g.Bc=function(){throw Error("Can't pop empty list");};g.U=function(){return Cd};
+g.K=function(a,b){return(null!=b?b.m&33554432||q===b.Vf||(b.m?0:Ab(Fc,b)):Ab(Fc,b))||we(b)?null==E(b):!1};g.oa=function(){return this};g.Fa=function(a,b){return ce(b,this)};g.Ga=function(a,b,c){return de(b,c,this)};g.Ia=function(){return null};g.bb=function(){return wd};g.S=function(){return null};g.T=function(a,b){return new bf(b)};g.X=function(a,b){return new af(this.meta,b,null,1,null)};var wd=new bf(null);bf.prototype[Fb]=function(){return yd(this)};
+function cf(a){return(null!=a?a.m&134217728||q===a.Yf||(a.m?0:Ab(Hc,a)):Ab(Hc,a))?Ic(a):Mb(ge,wd,a)}var df=function df(a){for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;return df.A(0<c.length?new Jb(c.slice(0),0,null):null)};df.A=function(a){if(a instanceof Jb&&0===a.i)var b=a.o;else a:for(b=[];;)if(null!=a)b.push(a.Ia(null)),a=a.Ka(null);else break a;a=b.length;for(var c=wd;;)if(0<a){var d=a-1;c=c.X(null,b[a-1]);a=d}else return c};df.L=0;df.N=function(a){return df.A(E(a))};
+function ef(a,b,c,d){this.meta=a;this.first=b;this.kc=c;this.w=d;this.m=65929452;this.J=8192}g=ef.prototype;g.toString=function(){return fd(this)};g.equiv=function(a){return this.K(null,a)};g.indexOf=function(){var a=null;a=function(a,c){switch(arguments.length){case 1:return Ud(this,a,0);case 2:return Ud(this,a,c)}throw Error("Invalid arity: "+(arguments.length-1));};a.h=function(a){return Ud(this,a,0)};a.c=function(a,c){return Ud(this,a,c)};return a}();
+g.lastIndexOf=function(){function a(a){return Xd(this,a,H(this))}var b=null;b=function(b,d){switch(arguments.length){case 1:return a.call(this,b);case 2:return Xd(this,b,d)}throw Error("Invalid arity: "+(arguments.length-1));};b.h=a;b.c=function(a,b){return Xd(this,a,b)};return b}();g.P=function(){return this.meta};g.Ka=function(){return null==this.kc?null:E(this.kc)};g.U=function(){var a=this.w;return null!=a?a:this.w=a=Ad(this)};g.K=function(a,b){return $d(this,b)};
+g.oa=function(){return tc(wd,this.meta)};g.Fa=function(a,b){return ce(b,this)};g.Ga=function(a,b,c){return de(b,c,this)};g.Ia=function(){return this.first};g.bb=function(){return null==this.kc?wd:this.kc};g.S=function(){return this};g.T=function(a,b){return new ef(b,this.first,this.kc,this.w)};g.X=function(a,b){return new ef(null,b,this,null)};ef.prototype[Fb]=function(){return yd(this)};function ae(a,b){return null==b||null!=b&&(b.m&64||q===b.G)?new ef(null,a,b,null):new ef(null,a,E(b),null)}
+function ff(a,b){if(a.ea===b.ea)return 0;var c=wb(a.fb);if(t(c?b.fb:c))return-1;if(t(a.fb)){if(wb(b.fb))return 1;c=Aa(a.fb,b.fb);return 0===c?Aa(a.name,b.name):c}return Aa(a.name,b.name)}function L(a,b,c,d){this.fb=a;this.name=b;this.ea=c;this.Oc=d;this.m=2153775105;this.J=4096}g=L.prototype;g.toString=function(){return[":",v.h(this.ea)].join("")};g.equiv=function(a){return this.K(null,a)};g.K=function(a,b){return b instanceof L?this.ea===b.ea:!1};
+g.call=function(){var a=null;a=function(a,c,d){switch(arguments.length){case 2:return D.c(c,this);case 3:return D.l(c,this,d)}throw Error("Invalid arity: "+(arguments.length-1));};a.c=function(a,c){return D.c(c,this)};a.l=function(a,c,d){return D.l(c,this,d)};return a}();g.apply=function(a,b){return this.call.apply(this,[this].concat(Gb(b)))};g.h=function(a){return D.c(a,this)};g.c=function(a,b){return D.l(a,this,b)};
+g.U=function(){var a=this.Oc;return null!=a?a:this.Oc=a=pd(kd(this.name),nd(this.fb))+2654435769|0};g.hd=function(){return this.name};g.jd=function(){return this.fb};g.R=function(a,b){return Jc(b,[":",v.h(this.ea)].join(""))};function gf(a){return a instanceof L}function N(a,b){return a===b?!0:a instanceof L&&b instanceof L?a.ea===b.ea:!1}
+var hf=function hf(a){switch(arguments.length){case 1:return hf.h(arguments[0]);case 2:return hf.c(arguments[0],arguments[1]);default:throw Error(["Invalid arity: ",v.h(arguments.length)].join(""));}};
+hf.h=function(a){if(a instanceof L)return a;if(a instanceof rd){if(null!=a&&(a.J&4096||q===a.Oe))var b=a.jd(null);else throw Error(["Doesn't support namespace: ",v.h(a)].join(""));return new L(b,jf(a),a.Zb,null)}return"string"===typeof a?(b=a.split("/"),2===b.length?new L(b[0],b[1],a,null):new L(null,b[0],a,null)):null};
+hf.c=function(a,b){var c=a instanceof L?jf(a):a instanceof rd?jf(a):a,d=b instanceof L?jf(b):b instanceof rd?jf(b):b;return new L(c,d,[v.h(t(c)?[v.h(c),"/"].join(""):null),v.h(d)].join(""),null)};hf.L=2;function kf(a,b,c,d){this.meta=a;this.Vc=b;this.s=c;this.w=d;this.m=32374988;this.J=1}g=kf.prototype;g.toString=function(){return fd(this)};g.equiv=function(a){return this.K(null,a)};function lf(a){null!=a.Vc&&(a.s=a.Vc.B?a.Vc.B():a.Vc.call(null),a.Vc=null);return a.s}
+g.indexOf=function(){var a=null;a=function(a,c){switch(arguments.length){case 1:return Ud(this,a,0);case 2:return Ud(this,a,c)}throw Error("Invalid arity: "+(arguments.length-1));};a.h=function(a){return Ud(this,a,0)};a.c=function(a,c){return Ud(this,a,c)};return a}();
+g.lastIndexOf=function(){function a(a){return Xd(this,a,H(this))}var b=null;b=function(b,d){switch(arguments.length){case 1:return a.call(this,b);case 2:return Xd(this,b,d)}throw Error("Invalid arity: "+(arguments.length-1));};b.h=a;b.c=function(a,b){return Xd(this,a,b)};return b}();g.P=function(){return this.meta};g.Ka=function(){this.S(null);return null==this.s?null:z(this.s)};g.U=function(){var a=this.w;return null!=a?a:this.w=a=Ad(this)};g.K=function(a,b){return $d(this,b)};
+g.oa=function(){return tc(wd,this.meta)};g.Fa=function(a,b){return ce(b,this)};g.Ga=function(a,b,c){return de(b,c,this)};g.Ia=function(){this.S(null);return null==this.s?null:y(this.s)};g.bb=function(){this.S(null);return null!=this.s?vd(this.s):wd};g.S=function(){lf(this);if(null==this.s)return null;for(var a=this.s;;)if(a instanceof kf)a=lf(a);else return this.s=a,E(this.s)};g.T=function(a,b){return new kf(b,this.Vc,this.s,this.w)};g.X=function(a,b){return ae(b,this)};kf.prototype[Fb]=function(){return yd(this)};
+function mf(a,b){this.aa=a;this.end=b;this.m=2;this.J=0}mf.prototype.add=function(a){this.aa[this.end]=a;return this.end+=1};mf.prototype.Da=function(){var a=new nf(this.aa,0,this.end);this.aa=null;return a};mf.prototype.W=function(){return this.end};function of(a){return new mf(Array(a),0)}function nf(a,b,c){this.o=a;this.ab=b;this.end=c;this.m=524306;this.J=0}g=nf.prototype;g.W=function(){return this.end-this.ab};g.$=function(a,b){return this.o[this.ab+b]};
+g.ka=function(a,b,c){return 0<=b&&b<this.end-this.ab?this.o[this.ab+b]:c};g.Le=function(){if(this.ab===this.end)throw Error("-drop-first of empty chunk");return new nf(this.o,this.ab+1,this.end)};g.Fa=function(a,b){return Od(this.o,b,this.o[this.ab],this.ab+1)};g.Ga=function(a,b,c){return Od(this.o,b,c,this.ab)};function pf(a,b,c,d){this.Da=a;this.Wb=b;this.meta=c;this.w=d;this.m=31850732;this.J=1536}g=pf.prototype;g.toString=function(){return fd(this)};g.equiv=function(a){return this.K(null,a)};
+g.indexOf=function(){var a=null;a=function(a,c){switch(arguments.length){case 1:return Ud(this,a,0);case 2:return Ud(this,a,c)}throw Error("Invalid arity: "+(arguments.length-1));};a.h=function(a){return Ud(this,a,0)};a.c=function(a,c){return Ud(this,a,c)};return a}();
+g.lastIndexOf=function(){function a(a){return Xd(this,a,H(this))}var b=null;b=function(b,d){switch(arguments.length){case 1:return a.call(this,b);case 2:return Xd(this,b,d)}throw Error("Invalid arity: "+(arguments.length-1));};b.h=a;b.c=function(a,b){return Xd(this,a,b)};return b}();g.P=function(){return this.meta};g.Ka=function(){if(1<Qb(this.Da))return new pf(Vc(this.Da),this.Wb,this.meta,null);var a=Cc(this.Wb);return null==a?null:a};g.U=function(){var a=this.w;return null!=a?a:this.w=a=Ad(this)};
+g.K=function(a,b){return $d(this,b)};g.oa=function(){return tc(wd,this.meta)};g.Ia=function(){return A.c(this.Da,0)};g.bb=function(){return 1<Qb(this.Da)?new pf(Vc(this.Da),this.Wb,this.meta,null):null==this.Wb?wd:this.Wb};g.S=function(){return this};g.ge=function(){return this.Da};g.Hd=function(){return null==this.Wb?wd:this.Wb};g.T=function(a,b){return new pf(this.Da,this.Wb,b,this.w)};g.X=function(a,b){return ae(b,this)};g.Me=function(){return null==this.Wb?null:this.Wb};pf.prototype[Fb]=function(){return yd(this)};
+function qf(a,b){return 0===Qb(a)?b:new pf(a,b,null,null)}function rf(a,b){a.add(b)}function sf(a,b){if(Pd(b))return H(b);for(var c=0,d=E(b);;)if(null!=d&&c<a)c+=1,d=z(d);else return c}
+var tf=function tf(a){if(null==a)return null;var c=z(a);return null==c?E(y(a)):ae(y(a),tf.h?tf.h(c):tf.call(null,c))},O=function O(a){switch(arguments.length){case 0:return O.B();case 1:return O.h(arguments[0]);case 2:return O.c(arguments[0],arguments[1]);default:for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;return O.A(arguments[0],arguments[1],new Jb(c.slice(2),0,null))}};O.B=function(){return new kf(null,function(){return null},null,null)};
+O.h=function(a){return new kf(null,function(){return a},null,null)};O.c=function(a,b){return new kf(null,function(){var c=E(a);return c?Ae(c)?qf(Wc(c),O.c(Xc(c),b)):ae(y(c),O.c(vd(c),b)):b},null,null)};O.A=function(a,b,c){return function h(a,b){return new kf(null,function(){var c=E(a);return c?Ae(c)?qf(Wc(c),h(Xc(c),b)):ae(y(c),h(vd(c),b)):t(b)?h(y(b),z(b)):null},null,null)}(O.c(a,b),c)};O.N=function(a){var b=y(a),c=z(a);a=y(c);c=z(c);return O.A(b,a,c)};O.L=2;
+var uf=function uf(a){switch(arguments.length){case 0:return uf.B();case 1:return uf.h(arguments[0]);case 2:return uf.c(arguments[0],arguments[1]);default:for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;return uf.A(arguments[0],arguments[1],new Jb(c.slice(2),0,null))}};uf.B=function(){return Oc(he)};uf.h=function(a){return a};uf.c=function(a,b){return Pc(a,b)};uf.A=function(a,b,c){for(;;)if(a=Pc(a,b),t(c))b=y(c),c=z(c);else return a};
+uf.N=function(a){var b=y(a),c=z(a);a=y(c);c=z(c);return uf.A(b,a,c)};uf.L=2;
+function vf(a,b,c){var d=E(c);if(0===b)return a.B?a.B():a.call(null);c=Wb(d);var e=Yb(d);if(1===b)return a.h?a.h(c):a.call(null,c);d=Wb(e);var f=Yb(e);if(2===b)return a.c?a.c(c,d):a.call(null,c,d);e=Wb(f);var h=Yb(f);if(3===b)return a.l?a.l(c,d,e):a.call(null,c,d,e);f=Wb(h);var k=Yb(h);if(4===b)return a.M?a.M(c,d,e,f):a.call(null,c,d,e,f);h=Wb(k);var l=Yb(k);if(5===b)return a.Z?a.Z(c,d,e,f,h):a.call(null,c,d,e,f,h);k=Wb(l);var p=Yb(l);if(6===b)return a.Ca?a.Ca(c,d,e,f,h,k):a.call(null,c,d,e,f,h,k);
+l=Wb(p);var m=Yb(p);if(7===b)return a.Ya?a.Ya(c,d,e,f,h,k,l):a.call(null,c,d,e,f,h,k,l);p=Wb(m);var u=Yb(m);if(8===b)return a.Ha?a.Ha(c,d,e,f,h,k,l,p):a.call(null,c,d,e,f,h,k,l,p);m=Wb(u);var w=Yb(u);if(9===b)return a.Za?a.Za(c,d,e,f,h,k,l,p,m):a.call(null,c,d,e,f,h,k,l,p,m);u=Wb(w);var x=Yb(w);if(10===b)return a.Na?a.Na(c,d,e,f,h,k,l,p,m,u):a.call(null,c,d,e,f,h,k,l,p,m,u);w=Wb(x);var C=Yb(x);if(11===b)return a.Oa?a.Oa(c,d,e,f,h,k,l,p,m,u,w):a.call(null,c,d,e,f,h,k,l,p,m,u,w);x=Wb(C);var F=Yb(C);
+if(12===b)return a.Pa?a.Pa(c,d,e,f,h,k,l,p,m,u,w,x):a.call(null,c,d,e,f,h,k,l,p,m,u,w,x);C=Wb(F);var I=Yb(F);if(13===b)return a.Qa?a.Qa(c,d,e,f,h,k,l,p,m,u,w,x,C):a.call(null,c,d,e,f,h,k,l,p,m,u,w,x,C);F=Wb(I);var M=Yb(I);if(14===b)return a.Ra?a.Ra(c,d,e,f,h,k,l,p,m,u,w,x,C,F):a.call(null,c,d,e,f,h,k,l,p,m,u,w,x,C,F);I=Wb(M);var S=Yb(M);if(15===b)return a.Sa?a.Sa(c,d,e,f,h,k,l,p,m,u,w,x,C,F,I):a.call(null,c,d,e,f,h,k,l,p,m,u,w,x,C,F,I);M=Wb(S);var X=Yb(S);if(16===b)return a.Ta?a.Ta(c,d,e,f,h,k,l,
+p,m,u,w,x,C,F,I,M):a.call(null,c,d,e,f,h,k,l,p,m,u,w,x,C,F,I,M);S=Wb(X);var Ga=Yb(X);if(17===b)return a.Ua?a.Ua(c,d,e,f,h,k,l,p,m,u,w,x,C,F,I,M,S):a.call(null,c,d,e,f,h,k,l,p,m,u,w,x,C,F,I,M,S);X=Wb(Ga);var db=Yb(Ga);if(18===b)return a.Va?a.Va(c,d,e,f,h,k,l,p,m,u,w,x,C,F,I,M,S,X):a.call(null,c,d,e,f,h,k,l,p,m,u,w,x,C,F,I,M,S,X);Ga=Wb(db);db=Yb(db);if(19===b)return a.Wa?a.Wa(c,d,e,f,h,k,l,p,m,u,w,x,C,F,I,M,S,X,Ga):a.call(null,c,d,e,f,h,k,l,p,m,u,w,x,C,F,I,M,S,X,Ga);var Q=Wb(db);Yb(db);if(20===b)return a.Xa?
+a.Xa(c,d,e,f,h,k,l,p,m,u,w,x,C,F,I,M,S,X,Ga,Q):a.call(null,c,d,e,f,h,k,l,p,m,u,w,x,C,F,I,M,S,X,Ga,Q);throw Error("Only up to 20 arguments supported on functions");}function wf(a,b,c){return null==c?a.h?a.h(b):a.call(a,b):xf(a,b,Wb(c),z(c))}function xf(a,b,c,d){return null==d?a.c?a.c(b,c):a.call(a,b,c):yf(a,b,c,Wb(d),z(d))}function yf(a,b,c,d,e){return null==e?a.l?a.l(b,c,d):a.call(a,b,c,d):zf(a,b,c,d,Wb(e),z(e))}
+function zf(a,b,c,d,e,f){if(null==f)return a.M?a.M(b,c,d,e):a.call(a,b,c,d,e);var h=Wb(f),k=z(f);if(null==k)return a.Z?a.Z(b,c,d,e,h):a.call(a,b,c,d,e,h);f=Wb(k);var l=z(k);if(null==l)return a.Ca?a.Ca(b,c,d,e,h,f):a.call(a,b,c,d,e,h,f);k=Wb(l);var p=z(l);if(null==p)return a.Ya?a.Ya(b,c,d,e,h,f,k):a.call(a,b,c,d,e,h,f,k);l=Wb(p);var m=z(p);if(null==m)return a.Ha?a.Ha(b,c,d,e,h,f,k,l):a.call(a,b,c,d,e,h,f,k,l);p=Wb(m);var u=z(m);if(null==u)return a.Za?a.Za(b,c,d,e,h,f,k,l,p):a.call(a,b,c,d,e,h,f,k,
+l,p);m=Wb(u);var w=z(u);if(null==w)return a.Na?a.Na(b,c,d,e,h,f,k,l,p,m):a.call(a,b,c,d,e,h,f,k,l,p,m);u=Wb(w);var x=z(w);if(null==x)return a.Oa?a.Oa(b,c,d,e,h,f,k,l,p,m,u):a.call(a,b,c,d,e,h,f,k,l,p,m,u);w=Wb(x);var C=z(x);if(null==C)return a.Pa?a.Pa(b,c,d,e,h,f,k,l,p,m,u,w):a.call(a,b,c,d,e,h,f,k,l,p,m,u,w);x=Wb(C);var F=z(C);if(null==F)return a.Qa?a.Qa(b,c,d,e,h,f,k,l,p,m,u,w,x):a.call(a,b,c,d,e,h,f,k,l,p,m,u,w,x);C=Wb(F);var I=z(F);if(null==I)return a.Ra?a.Ra(b,c,d,e,h,f,k,l,p,m,u,w,x,C):a.call(a,
+b,c,d,e,h,f,k,l,p,m,u,w,x,C);F=Wb(I);var M=z(I);if(null==M)return a.Sa?a.Sa(b,c,d,e,h,f,k,l,p,m,u,w,x,C,F):a.call(a,b,c,d,e,h,f,k,l,p,m,u,w,x,C,F);I=Wb(M);var S=z(M);if(null==S)return a.Ta?a.Ta(b,c,d,e,h,f,k,l,p,m,u,w,x,C,F,I):a.call(a,b,c,d,e,h,f,k,l,p,m,u,w,x,C,F,I);M=Wb(S);var X=z(S);if(null==X)return a.Ua?a.Ua(b,c,d,e,h,f,k,l,p,m,u,w,x,C,F,I,M):a.call(a,b,c,d,e,h,f,k,l,p,m,u,w,x,C,F,I,M);S=Wb(X);var Ga=z(X);if(null==Ga)return a.Va?a.Va(b,c,d,e,h,f,k,l,p,m,u,w,x,C,F,I,M,S):a.call(a,b,c,d,e,h,f,
+k,l,p,m,u,w,x,C,F,I,M,S);X=Wb(Ga);var db=z(Ga);if(null==db)return a.Wa?a.Wa(b,c,d,e,h,f,k,l,p,m,u,w,x,C,F,I,M,S,X):a.call(a,b,c,d,e,h,f,k,l,p,m,u,w,x,C,F,I,M,S,X);Ga=Wb(db);db=z(db);if(null==db)return a.Xa?a.Xa(b,c,d,e,h,f,k,l,p,m,u,w,x,C,F,I,M,S,X,Ga):a.call(a,b,c,d,e,h,f,k,l,p,m,u,w,x,C,F,I,M,S,X,Ga);b=[b,c,d,e,h,f,k,l,p,m,u,w,x,C,F,I,M,S,X,Ga];for(c=db;;)if(c)b.push(Wb(c)),c=z(c);else break;return a.apply(a,b)}
+function P(a,b){if(a.N){var c=a.L,d=sf(c+1,b);return d<=c?vf(a,d,b):a.N(b)}c=E(b);return null==c?a.B?a.B():a.call(a):wf(a,Wb(c),z(c))}function Kb(a,b,c){if(a.N){b=ae(b,c);var d=a.L;c=sf(d,c)+1;return c<=d?vf(a,c,b):a.N(b)}return wf(a,b,E(c))}function Af(a,b,c,d,e){return a.N?(b=ae(b,ae(c,ae(d,e))),c=a.L,e=3+sf(c-2,e),e<=c?vf(a,e,b):a.N(b)):yf(a,b,c,d,E(e))}function oe(a,b,c,d,e,f){return a.N?(f=tf(f),b=ae(b,ae(c,ae(d,ae(e,f)))),c=a.L,f=4+sf(c-3,f),f<=c?vf(a,f,b):a.N(b)):zf(a,b,c,d,e,tf(f))}
+function Bf(a){return E(a)?a:null}
+function Cf(){"undefined"===typeof hb&&(hb=function(a){this.zf=a;this.m=393216;this.J=0},hb.prototype.T=function(a,b){return new hb(b)},hb.prototype.P=function(){return this.zf},hb.prototype.ja=function(){return!1},hb.prototype.next=function(){return Error("No such element")},hb.prototype.remove=function(){return Error("Unsupported operation")},hb.Wc=function(){return new R(null,1,5,T,[Df],null)},hb.qc=!0,hb.Tb="cljs.core/t_cljs$core34616",hb.Ec=function(a,b){return Jc(b,"cljs.core/t_cljs$core34616")});
+return new hb(Ef)}function Ff(a,b){this.s=a;this.i=b}Ff.prototype.ja=function(){return this.i<this.s.length};Ff.prototype.next=function(){var a=this.s.charAt(this.i);this.i+=1;return a};Ff.prototype.remove=function(){return Error("Unsupported operation")};function Gf(a,b){this.o=a;this.i=b}Gf.prototype.ja=function(){return this.i<this.o.length};Gf.prototype.next=function(){var a=this.o[this.i];this.i+=1;return a};Gf.prototype.remove=function(){return Error("Unsupported operation")};var Hf={},If={};
+function Jf(a,b){this.cd=a;this.ub=b}Jf.prototype.ja=function(){this.cd===Hf?(this.cd=If,this.ub=E(this.ub)):this.cd===this.ub&&(this.ub=z(this.cd));return null!=this.ub};Jf.prototype.next=function(){if(this.ja())return this.cd=this.ub,y(this.ub);throw Error("No such element");};Jf.prototype.remove=function(){return Error("Unsupported operation")};
+function Kf(a){if(ud(a))return dd(a);if(null==a)return Cf();if("string"===typeof a)return new Ff(a,0);if(vb(a))return new Gf(a,0);if((null!=a?a.m&8388608||q===a.Pe||(a.m?0:Ab(Bc,a)):Ab(Bc,a))||vb(a)||"string"===typeof a)return new Jf(Hf,a);throw Error(["Cannot create iterator from ",v.h(a)].join(""));}function Mf(a){this.ae=a}Mf.prototype.add=function(a){this.ae.push(a);return this};Mf.prototype.remove=function(){return this.ae.shift()};Mf.prototype.Td=function(){return 0===this.ae.length};
+Mf.prototype.toString=function(){return["Many: ",v.h(this.ae)].join("")};var Nf={};function Of(a){this.H=a}Of.prototype.add=function(a){return this.H===Nf?(this.H=a,this):new Mf([this.H,a])};Of.prototype.remove=function(){if(this.H===Nf)throw Error("Removing object from empty buffer");var a=this.H;this.H=Nf;return a};Of.prototype.Td=function(){return this.H===Nf};Of.prototype.toString=function(){return["Single: ",v.h(this.H)].join("")};function Pf(){}Pf.prototype.add=function(a){return new Of(a)};
+Pf.prototype.remove=function(){throw Error("Removing object from empty buffer");};Pf.prototype.Td=function(){return!0};Pf.prototype.toString=function(){return"Empty"};var Qf=new Pf,Rf=function Rf(a){return new kf(null,function(){if(a.ja())for(var c=[],d=0;;){var e=a.ja();if(t(t(e)?32>d:e))c[d]=a.next(),d+=1;else return qf(new nf(c,0,d),Rf.h?Rf.h(a):Rf.call(null,a))}else return null},null,null)};function Sf(a,b,c,d,e,f){this.buffer=a;this.ub=b;this.pe=c;this.Rb=d;this.ye=e;this.Gf=f}
+Sf.prototype.step=function(){if(this.ub!==Nf)return!0;for(;;)if(this.ub===Nf)if(this.buffer.Td()){if(this.pe)return!1;if(this.ye.ja()){if(this.Gf)var a=P(this.Rb,ae(null,this.ye.next()));else a=this.ye.next(),a=this.Rb.c?this.Rb.c(null,a):this.Rb.call(null,null,a);Hd(a)&&(this.Rb.h?this.Rb.h(null):this.Rb.call(null,null),this.pe=!0)}else this.Rb.h?this.Rb.h(null):this.Rb.call(null,null),this.pe=!0}else this.ub=this.buffer.remove();else return!0};Sf.prototype.ja=function(){return this.step()};
+Sf.prototype.next=function(){if(this.ja()){var a=this.ub;this.ub=Nf;return a}throw Error("No such element");};Sf.prototype.remove=function(){return Error("Unsupported operation")};Sf.prototype[Fb]=function(){return yd(this)};
+function Tf(a,b){var c=new Sf(Qf,Nf,!1,null,b,!1);c.Rb=function(){var b=function(a){return function(){function b(b,c){a.buffer=a.buffer.add(c);return b}var c=null;c=function(a,c){switch(arguments.length){case 0:return null;case 1:return a;case 2:return b.call(this,a,c)}throw Error("Invalid arity: "+(arguments.length-1));};c.B=function(){return null};c.h=function(a){return a};c.c=b;return c}()}(c);return a.h?a.h(b):a.call(null,b)}();return c}
+function Uf(a,b){var c=Kf(b);c=Tf(a,c);c=Rf(c);return t(c)?c:wd}function Vf(a,b){for(;;){if(null==E(b))return!0;var c=y(b);c=a.h?a.h(c):a.call(null,c);if(t(c)){c=a;var d=z(b);a=c;b=d}else return!1}}function Wf(a,b){for(;;)if(E(b)){var c=y(b);c=a.h?a.h(c):a.call(null,c);if(t(c))return c;c=a;var d=z(b);a=c;b=d}else return null}function Xf(a){if(Ge(a))return 0===(a&1);throw Error(["Argument must be an integer: ",v.h(a)].join(""));}
+function Yf(a){return function(){function b(b,c){return wb(a.c?a.c(b,c):a.call(null,b,c))}function c(b){return wb(a.h?a.h(b):a.call(null,b))}function d(){return wb(a.B?a.B():a.call(null))}var e=null,f=function(){function b(a,b,d){var e=null;if(2<arguments.length){e=0;for(var f=Array(arguments.length-2);e<f.length;)f[e]=arguments[e+2],++e;e=new Jb(f,0,null)}return c.call(this,a,b,e)}function c(b,c,d){a.N?(b=ae(b,ae(c,d)),c=a.L,d=2+sf(c-1,d),d=d<=c?vf(a,d,b):a.N(b)):d=xf(a,b,c,E(d));return wb(d)}b.L=
+2;b.N=function(a){var b=y(a);a=z(a);var d=y(a);a=vd(a);return c(b,d,a)};b.A=c;return b}();e=function(a,e,l){switch(arguments.length){case 0:return d.call(this);case 1:return c.call(this,a);case 2:return b.call(this,a,e);default:var h=null;if(2<arguments.length){h=0;for(var k=Array(arguments.length-2);h<k.length;)k[h]=arguments[h+2],++h;h=new Jb(k,0,null)}return f.A(a,e,h)}throw Error("Invalid arity: "+(arguments.length-1));};e.L=2;e.N=f.N;e.B=d;e.h=c;e.c=b;e.A=f.A;return e}()}
+function Zf(a){return function(){function b(b){if(0<arguments.length)for(var c=0,e=Array(arguments.length-0);c<e.length;)e[c]=arguments[c+0],++c;return a}b.L=0;b.N=function(b){E(b);return a};b.A=function(){return a};return b}()}
+var $f=function $f(a){switch(arguments.length){case 0:return $f.B();case 1:return $f.h(arguments[0]);case 2:return $f.c(arguments[0],arguments[1]);case 3:return $f.l(arguments[0],arguments[1],arguments[2]);default:for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;return $f.A(arguments[0],arguments[1],arguments[2],new Jb(c.slice(3),0,null))}};$f.B=function(){return Ve};$f.h=function(a){return a};
+$f.c=function(a,b){return function(){function c(c,d,e){c=b.l?b.l(c,d,e):b.call(null,c,d,e);return a.h?a.h(c):a.call(null,c)}function d(c,d){var e=b.c?b.c(c,d):b.call(null,c,d);return a.h?a.h(e):a.call(null,e)}function e(c){c=b.h?b.h(c):b.call(null,c);return a.h?a.h(c):a.call(null,c)}function f(){var c=b.B?b.B():b.call(null);return a.h?a.h(c):a.call(null,c)}var h=null,k=function(){function c(a,b,c,e){var f=null;if(3<arguments.length){f=0;for(var h=Array(arguments.length-3);f<h.length;)h[f]=arguments[f+
+3],++f;f=new Jb(h,0,null)}return d.call(this,a,b,c,f)}function d(c,d,e,f){c=Af(b,c,d,e,f);return a.h?a.h(c):a.call(null,c)}c.L=3;c.N=function(a){var b=y(a);a=z(a);var c=y(a);a=z(a);var e=y(a);a=vd(a);return d(b,c,e,a)};c.A=d;return c}();h=function(a,b,h,u){switch(arguments.length){case 0:return f.call(this);case 1:return e.call(this,a);case 2:return d.call(this,a,b);case 3:return c.call(this,a,b,h);default:var m=null;if(3<arguments.length){m=0;for(var p=Array(arguments.length-3);m<p.length;)p[m]=
+arguments[m+3],++m;m=new Jb(p,0,null)}return k.A(a,b,h,m)}throw Error("Invalid arity: "+(arguments.length-1));};h.L=3;h.N=k.N;h.B=f;h.h=e;h.c=d;h.l=c;h.A=k.A;return h}()};
+$f.l=function(a,b,c){return function(){function d(d,e,f){d=c.l?c.l(d,e,f):c.call(null,d,e,f);d=b.h?b.h(d):b.call(null,d);return a.h?a.h(d):a.call(null,d)}function e(d,e){var f=c.c?c.c(d,e):c.call(null,d,e);f=b.h?b.h(f):b.call(null,f);return a.h?a.h(f):a.call(null,f)}function f(d){d=c.h?c.h(d):c.call(null,d);d=b.h?b.h(d):b.call(null,d);return a.h?a.h(d):a.call(null,d)}function h(){var d=c.B?c.B():c.call(null);d=b.h?b.h(d):b.call(null,d);return a.h?a.h(d):a.call(null,d)}var k=null,l=function(){function d(a,
+b,c,d){var f=null;if(3<arguments.length){f=0;for(var h=Array(arguments.length-3);f<h.length;)h[f]=arguments[f+3],++f;f=new Jb(h,0,null)}return e.call(this,a,b,c,f)}function e(d,e,f,h){d=Af(c,d,e,f,h);d=b.h?b.h(d):b.call(null,d);return a.h?a.h(d):a.call(null,d)}d.L=3;d.N=function(a){var b=y(a);a=z(a);var c=y(a);a=z(a);var d=y(a);a=vd(a);return e(b,c,d,a)};d.A=e;return d}();k=function(a,b,c,k){switch(arguments.length){case 0:return h.call(this);case 1:return f.call(this,a);case 2:return e.call(this,
+a,b);case 3:return d.call(this,a,b,c);default:var m=null;if(3<arguments.length){m=0;for(var p=Array(arguments.length-3);m<p.length;)p[m]=arguments[m+3],++m;m=new Jb(p,0,null)}return l.A(a,b,c,m)}throw Error("Invalid arity: "+(arguments.length-1));};k.L=3;k.N=l.N;k.B=h;k.h=f;k.c=e;k.l=d;k.A=l.A;return k}()};
+$f.A=function(a,b,c,d){return function(a){return function(){function b(a){var b=null;if(0<arguments.length){b=0;for(var d=Array(arguments.length-0);b<d.length;)d[b]=arguments[b+0],++b;b=new Jb(d,0,null)}return c.call(this,b)}function c(b){b=P(y(a),b);for(var c=z(a);;)if(c){var d=y(c);b=d.h?d.h(b):d.call(null,b);c=z(c)}else return b}b.L=0;b.N=function(a){a=E(a);return c(a)};b.A=c;return b}()}(cf(ae(a,ae(b,ae(c,d)))))};
+$f.N=function(a){var b=y(a),c=z(a);a=y(c);var d=z(c);c=y(d);d=z(d);return $f.A(b,a,c,d)};$f.L=3;
+var ag=function ag(a){switch(arguments.length){case 1:return ag.h(arguments[0]);case 2:return ag.c(arguments[0],arguments[1]);case 3:return ag.l(arguments[0],arguments[1],arguments[2]);case 4:return ag.M(arguments[0],arguments[1],arguments[2],arguments[3]);default:for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;return ag.A(arguments[0],arguments[1],arguments[2],arguments[3],new Jb(c.slice(4),0,null))}};ag.h=function(a){return a};
+ag.c=function(a,b){return function(){function c(c,d,e){return a.M?a.M(b,c,d,e):a.call(null,b,c,d,e)}function d(c,d){return a.l?a.l(b,c,d):a.call(null,b,c,d)}function e(c){return a.c?a.c(b,c):a.call(null,b,c)}function f(){return a.h?a.h(b):a.call(null,b)}var h=null,k=function(){function c(a,b,c,e){var f=null;if(3<arguments.length){f=0;for(var h=Array(arguments.length-3);f<h.length;)h[f]=arguments[f+3],++f;f=new Jb(h,0,null)}return d.call(this,a,b,c,f)}function d(c,d,e,f){return oe(a,b,c,d,e,be([f]))}
+c.L=3;c.N=function(a){var b=y(a);a=z(a);var c=y(a);a=z(a);var e=y(a);a=vd(a);return d(b,c,e,a)};c.A=d;return c}();h=function(a,b,h,u){switch(arguments.length){case 0:return f.call(this);case 1:return e.call(this,a);case 2:return d.call(this,a,b);case 3:return c.call(this,a,b,h);default:var m=null;if(3<arguments.length){m=0;for(var l=Array(arguments.length-3);m<l.length;)l[m]=arguments[m+3],++m;m=new Jb(l,0,null)}return k.A(a,b,h,m)}throw Error("Invalid arity: "+(arguments.length-1));};h.L=3;h.N=k.N;
+h.B=f;h.h=e;h.c=d;h.l=c;h.A=k.A;return h}()};
+ag.l=function(a,b,c){return function(){function d(d,e,f){return a.Z?a.Z(b,c,d,e,f):a.call(null,b,c,d,e,f)}function e(d,e){return a.M?a.M(b,c,d,e):a.call(null,b,c,d,e)}function f(d){return a.l?a.l(b,c,d):a.call(null,b,c,d)}function h(){return a.c?a.c(b,c):a.call(null,b,c)}var k=null,l=function(){function d(a,b,c,d){var f=null;if(3<arguments.length){f=0;for(var h=Array(arguments.length-3);f<h.length;)h[f]=arguments[f+3],++f;f=new Jb(h,0,null)}return e.call(this,a,b,c,f)}function e(d,e,f,h){return oe(a,
+b,c,d,e,be([f,h]))}d.L=3;d.N=function(a){var b=y(a);a=z(a);var c=y(a);a=z(a);var d=y(a);a=vd(a);return e(b,c,d,a)};d.A=e;return d}();k=function(a,b,c,k){switch(arguments.length){case 0:return h.call(this);case 1:return f.call(this,a);case 2:return e.call(this,a,b);case 3:return d.call(this,a,b,c);default:var m=null;if(3<arguments.length){m=0;for(var p=Array(arguments.length-3);m<p.length;)p[m]=arguments[m+3],++m;m=new Jb(p,0,null)}return l.A(a,b,c,m)}throw Error("Invalid arity: "+(arguments.length-
+1));};k.L=3;k.N=l.N;k.B=h;k.h=f;k.c=e;k.l=d;k.A=l.A;return k}()};
+ag.M=function(a,b,c,d){return function(){function e(e,f,h){return a.Ca?a.Ca(b,c,d,e,f,h):a.call(null,b,c,d,e,f,h)}function f(e,f){return a.Z?a.Z(b,c,d,e,f):a.call(null,b,c,d,e,f)}function h(e){return a.M?a.M(b,c,d,e):a.call(null,b,c,d,e)}function k(){return a.l?a.l(b,c,d):a.call(null,b,c,d)}var l=null,p=function(){function e(a,b,c,d){var e=null;if(3<arguments.length){e=0;for(var h=Array(arguments.length-3);e<h.length;)h[e]=arguments[e+3],++e;e=new Jb(h,0,null)}return f.call(this,a,b,c,e)}function f(e,
+f,h,k){return oe(a,b,c,d,e,be([f,h,k]))}e.L=3;e.N=function(a){var b=y(a);a=z(a);var c=y(a);a=z(a);var d=y(a);a=vd(a);return f(b,c,d,a)};e.A=f;return e}();l=function(a,b,c,d){switch(arguments.length){case 0:return k.call(this);case 1:return h.call(this,a);case 2:return f.call(this,a,b);case 3:return e.call(this,a,b,c);default:var m=null;if(3<arguments.length){m=0;for(var l=Array(arguments.length-3);m<l.length;)l[m]=arguments[m+3],++m;m=new Jb(l,0,null)}return p.A(a,b,c,m)}throw Error("Invalid arity: "+
+(arguments.length-1));};l.L=3;l.N=p.N;l.B=k;l.h=h;l.c=f;l.l=e;l.A=p.A;return l}()};ag.A=function(a,b,c,d,e){return function(){function f(a){var b=null;if(0<arguments.length){b=0;for(var c=Array(arguments.length-0);b<c.length;)c[b]=arguments[b+0],++b;b=new Jb(c,0,null)}return h.call(this,b)}function h(f){return Af(a,b,c,d,O.c(e,f))}f.L=0;f.N=function(a){a=E(a);return h(a)};f.A=h;return f}()};ag.N=function(a){var b=y(a),c=z(a);a=y(c);var d=z(c);c=y(d);var e=z(d);d=y(e);e=z(e);return ag.A(b,a,c,d,e)};
+ag.L=4;function bg(a,b){return function f(b,e){return new kf(null,function(){var d=E(e);if(d){if(Ae(d)){for(var k=Wc(d),l=H(k),p=of(l),m=0;;)if(m<l)rf(p,function(){var d=b+m,e=A.c(k,m);return a.c?a.c(d,e):a.call(null,d,e)}()),m+=1;else break;return qf(p.Da(),f(b+l,Xc(d)))}return ae(function(){var e=y(d);return a.c?a.c(b,e):a.call(null,b,e)}(),f(b+1,vd(d)))}return null},null,null)}(0,b)}function cg(a,b,c,d){this.state=a;this.meta=b;this.df=c;this.gb=d;this.J=16386;this.m=6455296}g=cg.prototype;
+g.equiv=function(a){return this.K(null,a)};g.K=function(a,b){return this===b};g.pc=function(){return this.state};g.P=function(){return this.meta};g.Kd=function(a,b,c){a=E(this.gb);for(var d=null,e=0,f=0;;)if(f<e){var h=d.$(null,f),k=J(h,0,null);h=J(h,1,null);h.M?h.M(k,this,b,c):h.call(null,k,this,b,c);f+=1}else if(a=E(a))Ae(a)?(d=Wc(a),a=Xc(a),k=d,e=H(d),d=k):(d=y(a),k=J(d,0,null),h=J(d,1,null),h.M?h.M(k,this,b,c):h.call(null,k,this,b,c),a=z(a),d=null,e=0),f=0;else return null};
+g.Jd=function(a,b,c){this.gb=K.l(this.gb,b,c);return this};g.Ld=function(a,b){return this.gb=le.c(this.gb,b)};g.U=function(){return ja(this)};var dg=function dg(a){switch(arguments.length){case 1:return dg.h(arguments[0]);default:for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;return dg.A(arguments[0],new Jb(c.slice(1),0,null))}};dg.h=function(a){return new cg(a,null,null,null)};
+dg.A=function(a,b){var c=null!=b&&(b.m&64||q===b.G)?P(U,b):b,d=D.c(c,rb);c=D.c(c,eg);return new cg(a,d,c,null)};dg.N=function(a){var b=y(a);a=z(a);return dg.A(b,a)};dg.L=1;function fg(a,b){if(a instanceof cg){var c=a.df;if(null!=c&&!t(c.h?c.h(b):c.call(null,b)))throw Error("Validator rejected reference state");c=a.state;a.state=b;null!=a.gb&&Lc(a,c,b);return b}return $c(a,b)}
+var gg=function gg(a){switch(arguments.length){case 2:return gg.c(arguments[0],arguments[1]);case 3:return gg.l(arguments[0],arguments[1],arguments[2]);case 4:return gg.M(arguments[0],arguments[1],arguments[2],arguments[3]);default:for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;return gg.A(arguments[0],arguments[1],arguments[2],arguments[3],new Jb(c.slice(4),0,null))}};
+gg.c=function(a,b){if(a instanceof cg){var c=a.state;c=b.h?b.h(c):b.call(null,c);c=fg(a,c)}else c=ad.c(a,b);return c};gg.l=function(a,b,c){if(a instanceof cg){var d=a.state;b=b.c?b.c(d,c):b.call(null,d,c);a=fg(a,b)}else a=ad.l(a,b,c);return a};gg.M=function(a,b,c,d){if(a instanceof cg){var e=a.state;b=b.l?b.l(e,c,d):b.call(null,e,c,d);a=fg(a,b)}else a=ad.M(a,b,c,d);return a};gg.A=function(a,b,c,d,e){return a instanceof cg?fg(a,Af(b,a.state,c,d,e)):ad.Z(a,b,c,d,e)};
+gg.N=function(a){var b=y(a),c=z(a);a=y(c);var d=z(c);c=y(d);var e=z(d);d=y(e);e=z(e);return gg.A(b,a,c,d,e)};gg.L=4;function hg(a){this.state=a;this.m=32768;this.J=0}hg.prototype.Qe=function(a,b){return this.state=b};hg.prototype.pc=function(){return this.state};
+var ig=function ig(a){switch(arguments.length){case 1:return ig.h(arguments[0]);case 2:return ig.c(arguments[0],arguments[1]);case 3:return ig.l(arguments[0],arguments[1],arguments[2]);case 4:return ig.M(arguments[0],arguments[1],arguments[2],arguments[3]);default:for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;return ig.A(arguments[0],arguments[1],arguments[2],arguments[3],new Jb(c.slice(4),0,null))}};
+ig.h=function(a){return function(b){return function(){function c(c,d){var e=a.h?a.h(d):a.call(null,d);return b.c?b.c(c,e):b.call(null,c,e)}function d(a){return b.h?b.h(a):b.call(null,a)}function e(){return b.B?b.B():b.call(null)}var f=null,h=function(){function c(a,b,c){var e=null;if(2<arguments.length){e=0;for(var f=Array(arguments.length-2);e<f.length;)f[e]=arguments[e+2],++e;e=new Jb(f,0,null)}return d.call(this,a,b,e)}function d(c,d,e){d=Kb(a,d,e);return b.c?b.c(c,d):b.call(null,c,d)}c.L=2;c.N=
+function(a){var b=y(a);a=z(a);var c=y(a);a=vd(a);return d(b,c,a)};c.A=d;return c}();f=function(a,b,f){switch(arguments.length){case 0:return e.call(this);case 1:return d.call(this,a);case 2:return c.call(this,a,b);default:var k=null;if(2<arguments.length){k=0;for(var l=Array(arguments.length-2);k<l.length;)l[k]=arguments[k+2],++k;k=new Jb(l,0,null)}return h.A(a,b,k)}throw Error("Invalid arity: "+(arguments.length-1));};f.L=2;f.N=h.N;f.B=e;f.h=d;f.c=c;f.A=h.A;return f}()}};
+ig.c=function(a,b){return new kf(null,function(){var c=E(b);if(c){if(Ae(c)){for(var d=Wc(c),e=H(d),f=of(e),h=0;;)if(h<e)rf(f,function(){var b=A.c(d,h);return a.h?a.h(b):a.call(null,b)}()),h+=1;else break;return qf(f.Da(),ig.c(a,Xc(c)))}return ae(function(){var b=y(c);return a.h?a.h(b):a.call(null,b)}(),ig.c(a,vd(c)))}return null},null,null)};
+ig.l=function(a,b,c){return new kf(null,function(){var d=E(b),e=E(c);if(d&&e){var f=ae;var h=y(d);var k=y(e);h=a.c?a.c(h,k):a.call(null,h,k);d=f(h,ig.l(a,vd(d),vd(e)))}else d=null;return d},null,null)};ig.M=function(a,b,c,d){return new kf(null,function(){var e=E(b),f=E(c),h=E(d);if(e&&f&&h){var k=ae;var l=y(e);var p=y(f),m=y(h);l=a.l?a.l(l,p,m):a.call(null,l,p,m);e=k(l,ig.M(a,vd(e),vd(f),vd(h)))}else e=null;return e},null,null)};
+ig.A=function(a,b,c,d,e){var f=function l(a){return new kf(null,function(){var b=ig.c(E,a);return Vf(Ve,b)?ae(ig.c(y,b),l(ig.c(vd,b))):null},null,null)};return ig.c(function(){return function(b){return P(a,b)}}(f),f(ge.A(e,d,be([c,b]))))};ig.N=function(a){var b=y(a),c=z(a);a=y(c);var d=z(c);c=y(d);var e=z(d);d=y(e);e=z(e);return ig.A(b,a,c,d,e)};ig.L=4;function jg(a,b){return new kf(null,function(){if(0<a){var c=E(b);return c?ae(y(c),jg(a-1,vd(c))):null}return null},null,null)}
+function kg(a,b){return new kf(null,function(c){return function(){return c(a,b)}}(function(a,b){for(;;){var c=E(b);if(0<a&&c){var d=a-1;c=vd(c);a=d;b=c}else return c}}),null,null)}function lg(a){return ig.l(function(a){return a},a,kg(2,a))}
+function mg(a){return function(b){return function(c){return function(){function d(d,e){var f=B(c);if(t(t(f)?a.h?a.h(e):a.call(null,e):f))return d;bd(c,null);return b.c?b.c(d,e):b.call(null,d,e)}function e(a){return b.h?b.h(a):b.call(null,a)}function f(){return b.B?b.B():b.call(null)}var h=null;h=function(a,b){switch(arguments.length){case 0:return f.call(this);case 1:return e.call(this,a);case 2:return d.call(this,a,b)}throw Error("Invalid arity: "+(arguments.length-1));};h.B=f;h.h=e;h.c=d;return h}()}(new hg(!0))}}
+function ng(a,b){return new kf(null,function(c){return function(){return c(a,b)}}(function(a,b){for(;;){var c=E(b),d;if(d=c)d=y(c),d=a.h?a.h(d):a.call(null,d);if(t(d))d=a,c=vd(c),a=d,b=c;else return c}}),null,null)}var og=function og(a){return new kf(null,function(){var c=E(a);return c?O.c(c,og.h?og.h(c):og.call(null,c)):null},null,null)};function pg(a){return new kf(null,function(){return ae(a,pg(a))},null,null)}function qg(a,b){return jg(a,pg(b))}
+var rg=function rg(a,b){return ae(b,new kf(null,function(){var d=a.h?a.h(b):a.call(null,b);return rg.c?rg.c(a,d):rg.call(null,a,d)},null,null))};function sg(a,b){return P(O,Kb(ig,a,b))}
+function tg(a){return function(b){return function(){function c(c,d){return t(a.h?a.h(d):a.call(null,d))?b.c?b.c(c,d):b.call(null,c,d):c}function d(a){return b.h?b.h(a):b.call(null,a)}function e(){return b.B?b.B():b.call(null)}var f=null;f=function(a,b){switch(arguments.length){case 0:return e.call(this);case 1:return d.call(this,a);case 2:return c.call(this,a,b)}throw Error("Invalid arity: "+(arguments.length-1));};f.B=e;f.h=d;f.c=c;return f}()}}
+function ug(a,b){return new kf(null,function(){var c=E(b);if(c){if(Ae(c)){for(var d=Wc(c),e=H(d),f=of(e),h=0;;)if(h<e){var k=A.c(d,h);k=a.h?a.h(k):a.call(null,k);t(k)&&(k=A.c(d,h),f.add(k));h+=1}else break;return qf(f.Da(),ug(a,Xc(c)))}d=y(c);c=vd(c);return t(a.h?a.h(d):a.call(null,d))?ae(d,ug(a,c)):ug(a,c)}return null},null,null)}function vg(a,b){return ug(Yf(a),b)}
+var wg=function wg(a){switch(arguments.length){case 0:return wg.B();case 1:return wg.h(arguments[0]);case 2:return wg.c(arguments[0],arguments[1]);case 3:return wg.l(arguments[0],arguments[1],arguments[2]);default:throw Error(["Invalid arity: ",v.h(arguments.length)].join(""));}};wg.B=function(){return he};wg.h=function(a){return a};wg.c=function(a,b){return null!=a?null!=a&&(a.J&4||q===a.kf)?tc(Qc(Mb(Pc,Oc(a),b)),qe(a)):Mb(Tb,a,b):Mb(ge,wd,b)};
+wg.l=function(a,b,c){return null!=a&&(a.J&4||q===a.kf)?tc(Qc(We(b,uf,Oc(a),c)),qe(a)):We(b,ge,a,c)};wg.L=3;function xg(a,b){return Qc(Mb(function(b,d){return uf.c(b,a.h?a.h(d):a.call(null,d))},Oc(he),b))}function yg(a,b,c){return new kf(null,function(){var d=E(c);if(d){var e=jg(a,d);return a===H(e)?ae(e,yg(a,b,kg(b,d))):null}return null},null,null)}
+var zg=function zg(a,b,c){b=E(b);var e=y(b),f=z(b);return f?K.l(a,e,function(){var b=D.c(a,e);return zg.l?zg.l(b,f,c):zg.call(null,b,f,c)}()):K.l(a,e,c)},Ag=function Ag(a){switch(arguments.length){case 3:return Ag.l(arguments[0],arguments[1],arguments[2]);case 4:return Ag.M(arguments[0],arguments[1],arguments[2],arguments[3]);case 5:return Ag.Z(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4]);case 6:return Ag.Ca(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]);
+default:for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;return Ag.A(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],new Jb(c.slice(6),0,null))}};Ag.l=function(a,b,c){b=E(b);var d=y(b);return(b=z(b))?K.l(a,d,Ag.l(D.c(a,d),b,c)):K.l(a,d,function(){var b=D.c(a,d);return c.h?c.h(b):c.call(null,b)}())};
+Ag.M=function(a,b,c,d){b=E(b);var e=y(b);return(b=z(b))?K.l(a,e,Ag.M(D.c(a,e),b,c,d)):K.l(a,e,function(){var b=D.c(a,e);return c.c?c.c(b,d):c.call(null,b,d)}())};Ag.Z=function(a,b,c,d,e){b=E(b);var f=y(b);return(b=z(b))?K.l(a,f,Ag.Z(D.c(a,f),b,c,d,e)):K.l(a,f,function(){var b=D.c(a,f);return c.l?c.l(b,d,e):c.call(null,b,d,e)}())};
+Ag.Ca=function(a,b,c,d,e,f){b=E(b);var h=y(b);return(b=z(b))?K.l(a,h,Ag.Ca(D.c(a,h),b,c,d,e,f)):K.l(a,h,function(){var b=D.c(a,h);return c.M?c.M(b,d,e,f):c.call(null,b,d,e,f)}())};Ag.A=function(a,b,c,d,e,f,h){var k=E(b);b=y(k);return(k=z(k))?K.l(a,b,oe(Ag,D.c(a,b),k,c,d,be([e,f,h]))):K.l(a,b,oe(c,D.c(a,b),d,e,f,be([h])))};Ag.N=function(a){var b=y(a),c=z(a);a=y(c);var d=z(c);c=y(d);var e=z(d);d=y(e);var f=z(e);e=y(f);var h=z(f);f=y(h);h=z(h);return Ag.A(b,a,c,d,e,f,h)};Ag.L=6;
+function Bg(a,b,c){return K.l(a,b,function(){var d=D.c(a,b);return c.h?c.h(d):c.call(null,d)}())}function Cg(a,b,c,d){return K.l(a,b,function(){var e=D.c(a,b);return c.c?c.c(e,d):c.call(null,e,d)}())}function Dg(a,b,c){var d=V,e=Eg;return K.l(a,d,function(){var f=D.c(a,d);return e.l?e.l(f,b,c):e.call(null,f,b,c)}())}function Fg(a,b){this.la=a;this.o=b}
+function Gg(a){return new Fg(a,[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null])}function Hg(a){return new Fg(a.la,Gb(a.o))}function Ig(a){a=a.F;return 32>a?0:a-1>>>5<<5}function Jg(a,b,c){for(;;){if(0===b)return c;var d=Gg(a);d.o[0]=c;c=d;b-=5}}
+var Kg=function Kg(a,b,c,d){var f=Hg(c),h=a.F-1>>>b&31;5===b?f.o[h]=d:(c=c.o[h],null!=c?(b-=5,a=Kg.M?Kg.M(a,b,c,d):Kg.call(null,a,b,c,d)):a=Jg(null,b-5,d),f.o[h]=a);return f};function Lg(a,b){throw Error(["No item ",v.h(a)," in vector of length ",v.h(b)].join(""));}function Mg(a,b){if(b>=Ig(a))return a.fa;for(var c=a.root,d=a.shift;;)if(0<d){var e=d-5;c=c.o[b>>>d&31];d=e}else return c.o}
+var Ng=function Ng(a,b,c,d,e){var h=Hg(c);if(0===b)h.o[d&31]=e;else{var k=d>>>b&31;b-=5;c=c.o[k];a=Ng.Z?Ng.Z(a,b,c,d,e):Ng.call(null,a,b,c,d,e);h.o[k]=a}return h},Og=function Og(a,b,c){var e=a.F-2>>>b&31;if(5<b){b-=5;var f=c.o[e];a=Og.l?Og.l(a,b,f):Og.call(null,a,b,f);if(null==a&&0===e)return null;c=Hg(c);c.o[e]=a;return c}if(0===e)return null;c=Hg(c);c.o[e]=null;return c};function Pg(a,b,c,d,e,f){this.i=a;this.base=b;this.o=c;this.Ja=d;this.start=e;this.end=f}
+Pg.prototype.ja=function(){return this.i<this.end};Pg.prototype.next=function(){32===this.i-this.base&&(this.o=Mg(this.Ja,this.i),this.base+=32);var a=this.o[this.i&31];this.i+=1;return a};function Qg(a,b,c){return new Pg(b,b-b%32,b<H(a)?Mg(a,b):null,a,b,c)}function Rg(a,b,c,d){return c<d?Sg(a,b,Vd(a,c),c+1,d):b.B?b.B():b.call(null)}
+function Sg(a,b,c,d,e){var f=c;c=d;for(d=Mg(a,d);;)if(c<e){var h=c&31;d=0===h?Mg(a,c):d;h=d[h];f=b.c?b.c(f,h):b.call(null,f,h);if(Hd(f))return B(f);c+=1}else return f}function R(a,b,c,d,e,f){this.meta=a;this.F=b;this.shift=c;this.root=d;this.fa=e;this.w=f;this.m=167668511;this.J=139268}g=R.prototype;g.toString=function(){return fd(this)};g.equiv=function(a){return this.K(null,a)};
+g.indexOf=function(){var a=null;a=function(a,c){switch(arguments.length){case 1:return Ud(this,a,0);case 2:return Ud(this,a,c)}throw Error("Invalid arity: "+(arguments.length-1));};a.h=function(a){return Ud(this,a,0)};a.c=function(a,c){return Ud(this,a,c)};return a}();
+g.lastIndexOf=function(){function a(a){return Xd(this,a,H(this))}var b=null;b=function(b,d){switch(arguments.length){case 1:return a.call(this,b);case 2:return Xd(this,b,d)}throw Error("Invalid arity: "+(arguments.length-1));};b.h=a;b.c=function(a,b){return Xd(this,a,b)};return b}();g.V=function(a,b){return this.I(null,b,null)};g.I=function(a,b,c){return"number"===typeof b?this.ka(null,b,c):c};
+g.Qc=function(a,b,c){a=0;for(var d=c;;)if(a<this.F){var e=Mg(this,a);c=e.length;a:for(var f=0;;)if(f<c){var h=f+a,k=e[f];d=b.l?b.l(d,h,k):b.call(null,d,h,k);if(Hd(d)){e=d;break a}f+=1}else{e=d;break a}if(Hd(e))return B(e);a+=c;d=e}else return d};g.fe=q;g.$=function(a,b){return(0<=b&&b<this.F?Mg(this,b):Lg(b,this.F))[b&31]};g.ka=function(a,b,c){return 0<=b&&b<this.F?Mg(this,b)[b&31]:c};
+g.dc=function(a,b,c){if(0<=b&&b<this.F)return Ig(this)<=b?(a=Gb(this.fa),a[b&31]=c,new R(this.meta,this.F,this.shift,this.root,a,null)):new R(this.meta,this.F,this.shift,Ng(this,this.shift,this.root,b,c),this.fa,null);if(b===this.F)return this.X(null,c);throw Error(["Index ",v.h(b)," out of bounds [0,",v.h(this.F),"]"].join(""));};g.ba=function(){return Qg(this,0,this.F)};g.P=function(){return this.meta};g.W=function(){return this.F};g.fd=function(){return this.$(null,0)};
+g.gd=function(){return this.$(null,1)};g.Ac=function(){return 0<this.F?this.$(null,this.F-1):null};
+g.Bc=function(){if(0===this.F)throw Error("Can't pop empty vector");if(1===this.F)return tc(he,this.meta);if(1<this.F-Ig(this))return new R(this.meta,this.F-1,this.shift,this.root,this.fa.slice(0,-1),null);var a=Mg(this,this.F-2),b=Og(this,this.shift,this.root);b=null==b?T:b;var c=this.F-1;return 5<this.shift&&null==b.o[1]?new R(this.meta,c,this.shift-5,b.o[0],a,null):new R(this.meta,c,this.shift,b,a,null)};g.Rc=function(){return 0<this.F?new Zd(this,this.F-1,null):null};
+g.U=function(){var a=this.w;return null!=a?a:this.w=a=Ad(this)};g.K=function(a,b){if(b instanceof R)if(this.F===H(b))for(var c=this.ba(null),d=dd(b);;)if(c.ja()){var e=c.next(),f=d.next();if(!G.c(e,f))return!1}else return!0;else return!1;else return $d(this,b)};
+g.Pc=function(){var a=this.F,b=this.shift,c=new Fg({},Gb(this.root.o)),d=this.fa,e=[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null];Be(d,0,e,0,d.length);return new Tg(a,b,c,e)};g.oa=function(){return tc(he,this.meta)};g.Fa=function(a,b){return Rg(this,b,0,this.F)};
+g.Ga=function(a,b,c){a=0;for(var d=c;;)if(a<this.F){var e=Mg(this,a);c=e.length;a:for(var f=0;;)if(f<c){var h=e[f];d=b.c?b.c(d,h):b.call(null,d,h);if(Hd(d)){e=d;break a}f+=1}else{e=d;break a}if(Hd(e))return B(e);a+=c;d=e}else return d};g.O=function(a,b,c){if("number"===typeof b)return this.dc(null,b,c);throw Error("Vector's key for assoc must be a number.");};g.yc=function(a,b){return Ge(b)?0<=b&&b<this.F:!1};
+g.S=function(){if(0===this.F)var a=null;else if(32>=this.F)a=new Jb(this.fa,0,null);else{a:{a=this.root;for(var b=this.shift;;)if(0<b)b-=5,a=a.o[0];else{a=a.o;break a}}a=new Ug(this,a,0,0,null,null)}return a};g.T=function(a,b){return new R(b,this.F,this.shift,this.root,this.fa,this.w)};
+g.X=function(a,b){if(32>this.F-Ig(this)){for(var c=this.fa.length,d=Array(c+1),e=0;;)if(e<c)d[e]=this.fa[e],e+=1;else break;d[c]=b;return new R(this.meta,this.F+1,this.shift,this.root,d,null)}c=(d=this.F>>>5>1<<this.shift)?this.shift+5:this.shift;d?(d=Gg(null),d.o[0]=this.root,e=Jg(null,this.shift,new Fg(null,this.fa)),d.o[1]=e):d=Kg(this,this.shift,this.root,new Fg(null,this.fa));return new R(this.meta,this.F+1,c,d,[b],null)};
+g.call=function(){var a=null;a=function(a,c,d){switch(arguments.length){case 2:return this.$(null,c);case 3:return this.ka(null,c,d)}throw Error("Invalid arity: "+(arguments.length-1));};a.c=function(a,c){return this.$(null,c)};a.l=function(a,c,d){return this.ka(null,c,d)};return a}();g.apply=function(a,b){return this.call.apply(this,[this].concat(Gb(b)))};g.h=function(a){return this.$(null,a)};g.c=function(a,b){return this.ka(null,a,b)};
+var T=new Fg(null,[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null]),he=new R(null,0,5,T,[],Cd);function Vg(a){var b=a.length;if(32>b)return new R(null,b,5,T,a,null);for(var c=32,d=(new R(null,32,5,T,a.slice(0,32),null)).Pc(null);;)if(c<b){var e=c+1;d=uf.c(d,a[c]);c=e}else return Qc(d)}R.prototype[Fb]=function(){return yd(this)};function Wg(a){return vb(a)?Vg(a):Qc(Mb(Pc,Oc(he),a))}
+var Xg=function Xg(a){for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;return Xg.A(0<c.length?new Jb(c.slice(0),0,null):null)};Xg.A=function(a){return a instanceof Jb&&0===a.i?Vg(a.o):Wg(a)};Xg.L=0;Xg.N=function(a){return Xg.A(E(a))};function Ug(a,b,c,d,e,f){this.zb=a;this.node=b;this.i=c;this.ab=d;this.meta=e;this.w=f;this.m=32375020;this.J=1536}g=Ug.prototype;g.toString=function(){return fd(this)};g.equiv=function(a){return this.K(null,a)};
+g.indexOf=function(){var a=null;a=function(a,c){switch(arguments.length){case 1:return Ud(this,a,0);case 2:return Ud(this,a,c)}throw Error("Invalid arity: "+(arguments.length-1));};a.h=function(a){return Ud(this,a,0)};a.c=function(a,c){return Ud(this,a,c)};return a}();
+g.lastIndexOf=function(){function a(a){return Xd(this,a,H(this))}var b=null;b=function(b,d){switch(arguments.length){case 1:return a.call(this,b);case 2:return Xd(this,b,d)}throw Error("Invalid arity: "+(arguments.length-1));};b.h=a;b.c=function(a,b){return Xd(this,a,b)};return b}();g.P=function(){return this.meta};g.Ka=function(){if(this.ab+1<this.node.length){var a=new Ug(this.zb,this.node,this.i,this.ab+1,null,null);return null==a?null:a}return this.Me(null)};
+g.U=function(){var a=this.w;return null!=a?a:this.w=a=Ad(this)};g.K=function(a,b){return $d(this,b)};g.oa=function(){return tc(he,this.meta)};g.Fa=function(a,b){return Rg(this.zb,b,this.i+this.ab,H(this.zb))};g.Ga=function(a,b,c){return Sg(this.zb,b,c,this.i+this.ab,H(this.zb))};g.Ia=function(){return this.node[this.ab]};g.bb=function(){if(this.ab+1<this.node.length){var a=new Ug(this.zb,this.node,this.i,this.ab+1,null,null);return null==a?wd:a}return this.Hd(null)};g.S=function(){return this};
+g.ge=function(){var a=this.node;return new nf(a,this.ab,a.length)};g.Hd=function(){var a=this.i+this.node.length;return a<Qb(this.zb)?new Ug(this.zb,Mg(this.zb,a),a,0,null,null):wd};g.T=function(a,b){return new Ug(this.zb,this.node,this.i,this.ab,b,null)};g.X=function(a,b){return ae(b,this)};g.Me=function(){var a=this.i+this.node.length;return a<Qb(this.zb)?new Ug(this.zb,Mg(this.zb,a),a,0,null,null):null};Ug.prototype[Fb]=function(){return yd(this)};
+function Yg(a,b,c,d,e){this.meta=a;this.Ja=b;this.start=c;this.end=d;this.w=e;this.m=167666463;this.J=139264}g=Yg.prototype;g.toString=function(){return fd(this)};g.equiv=function(a){return this.K(null,a)};g.indexOf=function(){var a=null;a=function(a,c){switch(arguments.length){case 1:return Ud(this,a,0);case 2:return Ud(this,a,c)}throw Error("Invalid arity: "+(arguments.length-1));};a.h=function(a){return Ud(this,a,0)};a.c=function(a,c){return Ud(this,a,c)};return a}();
+g.lastIndexOf=function(){function a(a){return Xd(this,a,H(this))}var b=null;b=function(b,d){switch(arguments.length){case 1:return a.call(this,b);case 2:return Xd(this,b,d)}throw Error("Invalid arity: "+(arguments.length-1));};b.h=a;b.c=function(a,b){return Xd(this,a,b)};return b}();g.V=function(a,b){return this.I(null,b,null)};g.I=function(a,b,c){return"number"===typeof b?this.ka(null,b,c):c};
+g.Qc=function(a,b,c){a=this.start;for(var d=0;;)if(a<this.end){var e=d,f=A.c(this.Ja,a);c=b.l?b.l(c,e,f):b.call(null,c,e,f);if(Hd(c))return B(c);d+=1;a+=1}else return c};g.$=function(a,b){return 0>b||this.end<=this.start+b?Lg(b,this.end-this.start):A.c(this.Ja,this.start+b)};g.ka=function(a,b,c){return 0>b||this.end<=this.start+b?c:A.l(this.Ja,this.start+b,c)};
+g.dc=function(a,b,c){a=this.start+b;if(0>b||this.end+1<=a)throw Error(["Index ",v.h(b)," out of bounds [0,",v.h(this.W(null)),"]"].join(""));b=this.meta;c=K.l(this.Ja,a,c);var d=this.end;a+=1;return Zg(b,c,this.start,d>a?d:a,null)};g.ba=function(){return null!=this.Ja&&q===this.Ja.fe?Qg(this.Ja,this.start,this.end):new Jf(Hf,this)};g.P=function(){return this.meta};g.W=function(){return this.end-this.start};g.Ac=function(){return A.c(this.Ja,this.end-1)};
+g.Bc=function(){if(this.start===this.end)throw Error("Can't pop empty vector");return Zg(this.meta,this.Ja,this.start,this.end-1,null)};g.Rc=function(){return this.start!==this.end?new Zd(this,this.end-this.start-1,null):null};g.U=function(){var a=this.w;return null!=a?a:this.w=a=Ad(this)};g.K=function(a,b){return $d(this,b)};g.oa=function(){return tc(he,this.meta)};g.Fa=function(a,b){return null!=this.Ja&&q===this.Ja.fe?Rg(this.Ja,b,this.start,this.end):Kd(this,b)};
+g.Ga=function(a,b,c){return null!=this.Ja&&q===this.Ja.fe?Sg(this.Ja,b,c,this.start,this.end):Ld(this,b,c)};g.O=function(a,b,c){if("number"===typeof b)return this.dc(null,b,c);throw Error("Subvec's key for assoc must be a number.");};g.S=function(){var a=this;return function(b){return function e(d){return d===a.end?null:ae(A.c(a.Ja,d),new kf(null,function(){return function(){return e(d+1)}}(b),null,null))}}(this)(a.start)};g.T=function(a,b){return Zg(b,this.Ja,this.start,this.end,this.w)};
+g.X=function(a,b){return Zg(this.meta,qc(this.Ja,this.end,b),this.start,this.end+1,null)};g.call=function(){var a=null;a=function(a,c,d){switch(arguments.length){case 2:return this.$(null,c);case 3:return this.ka(null,c,d)}throw Error("Invalid arity: "+(arguments.length-1));};a.c=function(a,c){return this.$(null,c)};a.l=function(a,c,d){return this.ka(null,c,d)};return a}();g.apply=function(a,b){return this.call.apply(this,[this].concat(Gb(b)))};g.h=function(a){return this.$(null,a)};
+g.c=function(a,b){return this.ka(null,a,b)};Yg.prototype[Fb]=function(){return yd(this)};function Zg(a,b,c,d,e){for(;;)if(b instanceof Yg)c=b.start+c,d=b.start+d,b=b.Ja;else{if(!ze(b))throw Error("v must satisfy IVector");var f=H(b);if(0>c||0>d||c>f||d>f)throw Error("Index out of bounds");return new Yg(a,b,c,d,e)}}function $g(a,b){return a===b.la?b:new Fg(a,Gb(b.o))}
+var ah=function ah(a,b,c,d){c=$g(a.root.la,c);var f=a.F-1>>>b&31;if(5===b)a=d;else{var h=c.o[f];null!=h?(b-=5,a=ah.M?ah.M(a,b,h,d):ah.call(null,a,b,h,d)):a=Jg(a.root.la,b-5,d)}c.o[f]=a;return c};function Tg(a,b,c,d){this.F=a;this.shift=b;this.root=c;this.fa=d;this.J=88;this.m=275}g=Tg.prototype;
+g.Dc=function(a,b){if(this.root.la){if(32>this.F-Ig(this))this.fa[this.F&31]=b;else{var c=new Fg(this.root.la,this.fa),d=[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null];d[0]=b;this.fa=d;if(this.F>>>5>1<<this.shift){d=[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null];var e=this.shift+
+5;d[0]=this.root;d[1]=Jg(this.root.la,this.shift,c);this.root=new Fg(this.root.la,d);this.shift=e}else this.root=ah(this,this.shift,this.root,c)}this.F+=1;return this}throw Error("conj! after persistent!");};g.kd=function(){if(this.root.la){this.root.la=null;var a=this.F-Ig(this),b=Array(a);Be(this.fa,0,b,0,a);return new R(null,this.F,this.shift,this.root,b,null)}throw Error("persistent! called twice");};
+g.Cc=function(a,b,c){if("number"===typeof b)return bh(this,b,c);throw Error("TransientVector's key for assoc! must be a number.");};
+function bh(a,b,c){if(a.root.la){if(0<=b&&b<a.F){if(Ig(a)<=b)a.fa[b&31]=c;else{var d=function(){return function(){return function k(d,h){var f=$g(a.root.la,h);if(0===d)f.o[b&31]=c;else{var p=b>>>d&31,m=k(d-5,f.o[p]);f.o[p]=m}return f}}(a)(a.shift,a.root)}();a.root=d}return a}if(b===a.F)return a.Dc(null,c);throw Error(["Index ",v.h(b)," out of bounds for TransientVector of length",v.h(a.F)].join(""));}throw Error("assoc! after persistent!");}
+g.W=function(){if(this.root.la)return this.F;throw Error("count after persistent!");};g.$=function(a,b){if(this.root.la)return(0<=b&&b<this.F?Mg(this,b):Lg(b,this.F))[b&31];throw Error("nth after persistent!");};g.ka=function(a,b,c){return 0<=b&&b<this.F?this.$(null,b):c};g.V=function(a,b){return this.I(null,b,null)};g.I=function(a,b,c){return"number"===typeof b?this.ka(null,b,c):c};
+g.call=function(){var a=null;a=function(a,c,d){switch(arguments.length){case 2:return this.V(null,c);case 3:return this.I(null,c,d)}throw Error("Invalid arity: "+(arguments.length-1));};a.c=function(a,c){return this.V(null,c)};a.l=function(a,c,d){return this.I(null,c,d)};return a}();g.apply=function(a,b){return this.call.apply(this,[this].concat(Gb(b)))};g.h=function(a){return this.V(null,a)};g.c=function(a,b){return this.I(null,a,b)};function ch(){this.m=2097152;this.J=0}
+ch.prototype.equiv=function(a){return this.K(null,a)};ch.prototype.K=function(){return!1};var dh=new ch;function eh(a,b){return Ee(xe(b)&&!ye(b)?H(a)===H(b)?(null!=a?a.m&1048576||q===a.Uf||(a.m?0:Ab(wc,a)):Ab(wc,a))?Ue(function(a,d,e){return G.c(D.l(b,d,dh),e)?!0:new Gd(!1)},!0,a):Vf(function(a){return G.c(D.l(b,y(a),dh),ee(a))},a):null:null)}function fh(a,b,c,d,e){this.i=a;this.Mf=b;this.Ie=c;this.wf=d;this.Se=e}fh.prototype.ja=function(){var a=this.i<this.Ie;return a?a:this.Se.ja()};
+fh.prototype.next=function(){if(this.i<this.Ie){var a=Vd(this.wf,this.i);this.i+=1;return new R(null,2,5,T,[a,cc.c(this.Mf,a)],null)}return this.Se.next()};fh.prototype.remove=function(){return Error("Unsupported operation")};function gh(a){this.s=a}gh.prototype.next=function(){if(null!=this.s){var a=y(this.s),b=J(a,0,null);a=J(a,1,null);this.s=z(this.s);return{value:[b,a],done:!1}}return{value:null,done:!0}};function hh(a){this.s=a}
+hh.prototype.next=function(){if(null!=this.s){var a=y(this.s);this.s=z(this.s);return{value:[a,a],done:!1}}return{value:null,done:!0}};
+function ih(a,b){if(b instanceof L)a:{var c=a.length;for(var d=b.ea,e=0;;){if(c<=e){c=-1;break a}if(a[e]instanceof L&&d===a[e].ea){c=e;break a}e+=2}}else if(ca(b)||"number"===typeof b)a:for(c=a.length,d=0;;){if(c<=d){c=-1;break a}if(b===a[d]){c=d;break a}d+=2}else if(b instanceof rd)a:for(c=a.length,d=b.Zb,e=0;;){if(c<=e){c=-1;break a}if(a[e]instanceof rd&&d===a[e].Zb){c=e;break a}e+=2}else if(null==b)a:for(c=a.length,d=0;;){if(c<=d){c=-1;break a}if(null==a[d]){c=d;break a}d+=2}else a:for(c=a.length,
+d=0;;){if(c<=d){c=-1;break a}if(G.c(b,a[d])){c=d;break a}d+=2}return c}function jh(a,b,c){this.o=a;this.i=b;this.hb=c;this.m=32374990;this.J=0}g=jh.prototype;g.toString=function(){return fd(this)};g.equiv=function(a){return this.K(null,a)};g.indexOf=function(){var a=null;a=function(a,c){switch(arguments.length){case 1:return Ud(this,a,0);case 2:return Ud(this,a,c)}throw Error("Invalid arity: "+(arguments.length-1));};a.h=function(a){return Ud(this,a,0)};a.c=function(a,c){return Ud(this,a,c)};return a}();
+g.lastIndexOf=function(){function a(a){return Xd(this,a,H(this))}var b=null;b=function(b,d){switch(arguments.length){case 1:return a.call(this,b);case 2:return Xd(this,b,d)}throw Error("Invalid arity: "+(arguments.length-1));};b.h=a;b.c=function(a,b){return Xd(this,a,b)};return b}();g.P=function(){return this.hb};g.Ka=function(){return this.i<this.o.length-2?new jh(this.o,this.i+2,this.hb):null};g.W=function(){return(this.o.length-this.i)/2};g.U=function(){return Ad(this)};
+g.K=function(a,b){return $d(this,b)};g.oa=function(){return tc(wd,this.hb)};g.Fa=function(a,b){return ce(b,this)};g.Ga=function(a,b,c){return de(b,c,this)};g.Ia=function(){return new R(null,2,5,T,[this.o[this.i],this.o[this.i+1]],null)};g.bb=function(){return this.i<this.o.length-2?new jh(this.o,this.i+2,this.hb):wd};g.S=function(){return this};g.T=function(a,b){return new jh(this.o,this.i,b)};g.X=function(a,b){return ae(b,this)};jh.prototype[Fb]=function(){return yd(this)};
+function kh(a,b,c){this.o=a;this.i=b;this.F=c}kh.prototype.ja=function(){return this.i<this.F};kh.prototype.next=function(){var a=new R(null,2,5,T,[this.o[this.i],this.o[this.i+1]],null);this.i+=2;return a};function r(a,b,c,d){this.meta=a;this.F=b;this.o=c;this.w=d;this.m=16647951;this.J=139268}g=r.prototype;g.toString=function(){return fd(this)};g.equiv=function(a){return this.K(null,a)};g.keys=function(){return yd(lh(this))};g.entries=function(){return new gh(E(E(this)))};g.values=function(){return yd(mh(this))};
+g.has=function(a){return He(this,a)};g.get=function(a,b){return this.I(null,a,b)};g.forEach=function(a){for(var b=E(this),c=null,d=0,e=0;;)if(e<d){var f=c.$(null,e),h=J(f,0,null);f=J(f,1,null);a.c?a.c(f,h):a.call(null,f,h);e+=1}else if(b=E(b))Ae(b)?(c=Wc(b),b=Xc(b),h=c,d=H(c),c=h):(c=y(b),h=J(c,0,null),f=J(c,1,null),a.c?a.c(f,h):a.call(null,f,h),b=z(b),c=null,d=0),e=0;else return null};g.V=function(a,b){return this.I(null,b,null)};g.I=function(a,b,c){a=ih(this.o,b);return-1===a?c:this.o[a+1]};
+g.Qc=function(a,b,c){a=this.o.length;for(var d=0;;)if(d<a){var e=this.o[d],f=this.o[d+1];c=b.l?b.l(c,e,f):b.call(null,c,e,f);if(Hd(c))return B(c);d+=2}else return c};g.ba=function(){return new kh(this.o,0,2*this.F)};g.P=function(){return this.meta};g.W=function(){return this.F};g.U=function(){var a=this.w;return null!=a?a:this.w=a=Dd(this)};
+g.K=function(a,b){if(xe(b)&&!ye(b)){var c=this.o.length;if(this.F===b.W(null))for(var d=0;;)if(d<c){var e=b.I(null,this.o[d],Ce);if(e!==Ce)if(G.c(this.o[d+1],e))d+=2;else return!1;else return!1}else return!0;else return!1}else return!1};g.Pc=function(){return new nh({},this.o.length,Gb(this.o))};g.oa=function(){return tc(Ef,this.meta)};g.Fa=function(a,b){return Re(this,b)};g.Ga=function(a,b,c){return Se(this,b,c)};
+g.ga=function(a,b){if(0<=ih(this.o,b)){var c=this.o.length,d=c-2;if(0===d)return this.oa(null);d=Array(d);for(var e=0,f=0;;){if(e>=c)return new r(this.meta,this.F-1,d,null);G.c(b,this.o[e])||(d[f]=this.o[e],d[f+1]=this.o[e+1],f+=2);e+=2}}else return this};
+g.O=function(a,b,c){a=ih(this.o,b);if(-1===a){if(this.F<oh){a=this.o;for(var d=a.length,e=Array(d+2),f=0;;)if(f<d)e[f]=a[f],f+=1;else break;e[d]=b;e[d+1]=c;return new r(this.meta,this.F+1,e,null)}return tc(ec(wg.c(ph,this),b,c),this.meta)}if(c===this.o[a+1])return this;b=Gb(this.o);b[a+1]=c;return new r(this.meta,this.F,b,null)};g.yc=function(a,b){return-1!==ih(this.o,b)};g.S=function(){var a=this.o;return 0<=a.length-2?new jh(a,0,null):null};g.T=function(a,b){return new r(b,this.F,this.o,this.w)};
+g.X=function(a,b){if(ze(b))return this.O(null,A.c(b,0),A.c(b,1));for(var c=this,d=E(b);;){if(null==d)return c;var e=y(d);if(ze(e))c=c.O(null,A.c(e,0),A.c(e,1)),d=z(d);else throw Error("conj on a map takes map entries or seqables of map entries");}};
+g.call=function(){var a=null;a=function(a,c,d){switch(arguments.length){case 2:return this.V(null,c);case 3:return this.I(null,c,d)}throw Error("Invalid arity: "+(arguments.length-1));};a.c=function(a,c){return this.V(null,c)};a.l=function(a,c,d){return this.I(null,c,d)};return a}();g.apply=function(a,b){return this.call.apply(this,[this].concat(Gb(b)))};g.h=function(a){return this.V(null,a)};g.c=function(a,b){return this.I(null,a,b)};var Ef=new r(null,0,[],Ed),oh=8;
+function ke(a){for(var b=[],c=0;;)if(c<a.length){var d=a[c],e=a[c+1],f=ih(b,d);-1===f?(f=b,f.push(d),f.push(e)):b[f+1]=e;c+=2}else break;return new r(null,b.length/2,b,null)}r.prototype[Fb]=function(){return yd(this)};function nh(a,b,c){this.Uc=a;this.Zc=b;this.o=c;this.m=258;this.J=56}g=nh.prototype;g.W=function(){if(t(this.Uc))return Ze(this.Zc);throw Error("count after persistent!");};g.V=function(a,b){return this.I(null,b,null)};
+g.I=function(a,b,c){if(t(this.Uc))return a=ih(this.o,b),-1===a?c:this.o[a+1];throw Error("lookup after persistent!");};g.Dc=function(a,b){if(t(this.Uc)){if(null!=b?b.m&2048||q===b.sf||(b.m?0:Ab(hc,b)):Ab(hc,b))return this.Cc(null,jc(b),kc(b));for(var c=E(b),d=this;;){var e=y(c);if(t(e))c=z(c),d=d.Cc(null,jc(e),kc(e));else return d}}else throw Error("conj! after persistent!");};
+g.kd=function(){if(t(this.Uc))return this.Uc=!1,new r(null,Ze(this.Zc),this.o,null);throw Error("persistent! called twice");};g.Cc=function(a,b,c){if(t(this.Uc)){a=ih(this.o,b);if(-1===a){if(this.Zc+2<=2*oh)return this.Zc+=2,this.o.push(b),this.o.push(c),this;a:{a=this.Zc;var d=this.o;var e=Oc(ph);for(var f=0;;)if(f<a)e=Rc(e,d[f],d[f+1]),f+=2;else break a}return Rc(e,b,c)}c!==this.o[a+1]&&(this.o[a+1]=c);return this}throw Error("assoc! after persistent!");};function qh(){this.H=!1}
+function rh(a,b){return a===b?!0:N(a,b)?!0:G.c(a,b)}function sh(a,b,c){a=Gb(a);a[b]=c;return a}function th(a,b){var c=Array(a.length-2);Be(a,0,c,0,2*b);Be(a,2*(b+1),c,2*b,c.length-2*b);return c}function uh(a,b,c,d){a=a.Gc(b);a.o[c]=d;return a}function vh(a,b,c){for(var d=a.length,e=0,f=c;;)if(e<d){c=a[e];if(null!=c){var h=a[e+1];c=b.l?b.l(f,c,h):b.call(null,f,c,h)}else c=a[e+1],c=null!=c?c.Jc(b,f):f;if(Hd(c))return c;e+=2;f=c}else return f}
+function wh(a,b,c,d){this.o=a;this.i=b;this.sd=c;this.Lb=d}wh.prototype.advance=function(){for(var a=this.o.length;;)if(this.i<a){var b=this.o[this.i],c=this.o[this.i+1];null!=b?b=this.sd=new R(null,2,5,T,[b,c],null):null!=c?(b=dd(c),b=b.ja()?this.Lb=b:!1):b=!1;this.i+=2;if(b)return!0}else return!1};wh.prototype.ja=function(){var a=null!=this.sd;return a?a:(a=null!=this.Lb)?a:this.advance()};
+wh.prototype.next=function(){if(null!=this.sd){var a=this.sd;this.sd=null;return a}if(null!=this.Lb)return a=this.Lb.next(),this.Lb.ja()||(this.Lb=null),a;if(this.advance())return this.next();throw Error("No such element");};wh.prototype.remove=function(){return Error("Unsupported operation")};function xh(a,b,c){this.la=a;this.na=b;this.o=c;this.J=131072;this.m=0}g=xh.prototype;
+g.Gc=function(a){if(a===this.la)return this;var b=$e(this.na),c=Array(0>b?4:2*(b+1));Be(this.o,0,c,0,2*b);return new xh(a,this.na,c)};g.qd=function(){return yh(this.o,0,null)};g.Jc=function(a,b){return vh(this.o,a,b)};g.sc=function(a,b,c,d){var e=1<<(b>>>a&31);if(0===(this.na&e))return d;var f=$e(this.na&e-1);e=this.o[2*f];f=this.o[2*f+1];return null==e?f.sc(a+5,b,c,d):rh(c,e)?f:d};
+g.Kb=function(a,b,c,d,e,f){var h=1<<(c>>>b&31),k=$e(this.na&h-1);if(0===(this.na&h)){var l=$e(this.na);if(2*l<this.o.length){a=this.Gc(a);b=a.o;f.H=!0;a:for(c=2*(l-k),f=2*k+(c-1),l=2*(k+1)+(c-1);;){if(0===c)break a;b[l]=b[f];--l;--c;--f}b[2*k]=d;b[2*k+1]=e;a.na|=h;return a}if(16<=l){k=[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null];k[c>>>b&31]=zh.Kb(a,b+5,c,d,e,f);for(e=d=0;;)if(32>d)0!==
+(this.na>>>d&1)&&(k[d]=null!=this.o[e]?zh.Kb(a,b+5,od(this.o[e]),this.o[e],this.o[e+1],f):this.o[e+1],e+=2),d+=1;else break;return new Ah(a,l+1,k)}b=Array(2*(l+4));Be(this.o,0,b,0,2*k);b[2*k]=d;b[2*k+1]=e;Be(this.o,2*k,b,2*(k+1),2*(l-k));f.H=!0;a=this.Gc(a);a.o=b;a.na|=h;return a}l=this.o[2*k];h=this.o[2*k+1];if(null==l)return l=h.Kb(a,b+5,c,d,e,f),l===h?this:uh(this,a,2*k+1,l);if(rh(d,l))return e===h?this:uh(this,a,2*k+1,e);f.H=!0;f=b+5;b=od(l);if(b===c)e=new Bh(null,b,2,[l,h,d,e]);else{var p=new qh;
+e=zh.Kb(a,f,b,l,h,p).Kb(a,f,c,d,e,p)}d=2*k;k=2*k+1;a=this.Gc(a);a.o[d]=null;a.o[k]=e;return a};
+g.Jb=function(a,b,c,d,e){var f=1<<(b>>>a&31),h=$e(this.na&f-1);if(0===(this.na&f)){var k=$e(this.na);if(16<=k){h=[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null];h[b>>>a&31]=zh.Jb(a+5,b,c,d,e);for(d=c=0;;)if(32>c)0!==(this.na>>>c&1)&&(h[c]=null!=this.o[d]?zh.Jb(a+5,od(this.o[d]),this.o[d],this.o[d+1],e):this.o[d+1],d+=2),c+=1;else break;return new Ah(null,k+1,h)}a=Array(2*(k+1));Be(this.o,
+0,a,0,2*h);a[2*h]=c;a[2*h+1]=d;Be(this.o,2*h,a,2*(h+1),2*(k-h));e.H=!0;return new xh(null,this.na|f,a)}var l=this.o[2*h];f=this.o[2*h+1];if(null==l)return k=f.Jb(a+5,b,c,d,e),k===f?this:new xh(null,this.na,sh(this.o,2*h+1,k));if(rh(c,l))return d===f?this:new xh(null,this.na,sh(this.o,2*h+1,d));e.H=!0;e=this.na;k=this.o;a+=5;var p=od(l);if(p===b)c=new Bh(null,p,2,[l,f,c,d]);else{var m=new qh;c=zh.Jb(a,p,l,f,m).Jb(a,b,c,d,m)}a=2*h;h=2*h+1;d=Gb(k);d[a]=null;d[h]=c;return new xh(null,e,d)};
+g.rd=function(a,b,c){var d=1<<(b>>>a&31);if(0===(this.na&d))return this;var e=$e(this.na&d-1),f=this.o[2*e],h=this.o[2*e+1];return null==f?(a=h.rd(a+5,b,c),a===h?this:null!=a?new xh(null,this.na,sh(this.o,2*e+1,a)):this.na===d?null:new xh(null,this.na^d,th(this.o,e))):rh(c,f)?new xh(null,this.na^d,th(this.o,e)):this};g.ba=function(){return new wh(this.o,0,null,null)};var zh=new xh(null,0,[]);function Ch(a,b,c){this.o=a;this.i=b;this.Lb=c}
+Ch.prototype.ja=function(){for(var a=this.o.length;;){if(null!=this.Lb&&this.Lb.ja())return!0;if(this.i<a){var b=this.o[this.i];this.i+=1;null!=b&&(this.Lb=dd(b))}else return!1}};Ch.prototype.next=function(){if(this.ja())return this.Lb.next();throw Error("No such element");};Ch.prototype.remove=function(){return Error("Unsupported operation")};function Ah(a,b,c){this.la=a;this.F=b;this.o=c;this.J=131072;this.m=0}g=Ah.prototype;g.Gc=function(a){return a===this.la?this:new Ah(a,this.F,Gb(this.o))};
+g.qd=function(){return Dh(this.o,0,null)};g.Jc=function(a,b){for(var c=this.o.length,d=0,e=b;;)if(d<c){var f=this.o[d];if(null!=f&&(e=f.Jc(a,e),Hd(e)))return e;d+=1}else return e};g.sc=function(a,b,c,d){var e=this.o[b>>>a&31];return null!=e?e.sc(a+5,b,c,d):d};g.Kb=function(a,b,c,d,e,f){var h=c>>>b&31,k=this.o[h];if(null==k)return a=uh(this,a,h,zh.Kb(a,b+5,c,d,e,f)),a.F+=1,a;b=k.Kb(a,b+5,c,d,e,f);return b===k?this:uh(this,a,h,b)};
+g.Jb=function(a,b,c,d,e){var f=b>>>a&31,h=this.o[f];if(null==h)return new Ah(null,this.F+1,sh(this.o,f,zh.Jb(a+5,b,c,d,e)));a=h.Jb(a+5,b,c,d,e);return a===h?this:new Ah(null,this.F,sh(this.o,f,a))};
+g.rd=function(a,b,c){var d=b>>>a&31,e=this.o[d];if(null!=e){a=e.rd(a+5,b,c);if(a===e)d=this;else if(null==a)if(8>=this.F)a:{e=this.o;a=e.length;b=Array(2*(this.F-1));c=0;for(var f=1,h=0;;)if(c<a)c!==d&&null!=e[c]&&(b[f]=e[c],f+=2,h|=1<<c),c+=1;else{d=new xh(null,h,b);break a}}else d=new Ah(null,this.F-1,sh(this.o,d,a));else d=new Ah(null,this.F,sh(this.o,d,a));return d}return this};g.ba=function(){return new Ch(this.o,0,null)};
+function Eh(a,b,c){b*=2;for(var d=0;;)if(d<b){if(rh(c,a[d]))return d;d+=2}else return-1}function Bh(a,b,c,d){this.la=a;this.ec=b;this.F=c;this.o=d;this.J=131072;this.m=0}g=Bh.prototype;g.Gc=function(a){if(a===this.la)return this;var b=Array(2*(this.F+1));Be(this.o,0,b,0,2*this.F);return new Bh(a,this.ec,this.F,b)};g.qd=function(){return yh(this.o,0,null)};g.Jc=function(a,b){return vh(this.o,a,b)};g.sc=function(a,b,c,d){a=Eh(this.o,this.F,c);return 0>a?d:rh(c,this.o[a])?this.o[a+1]:d};
+g.Kb=function(a,b,c,d,e,f){if(c===this.ec){b=Eh(this.o,this.F,d);if(-1===b){if(this.o.length>2*this.F)return b=2*this.F,c=2*this.F+1,a=this.Gc(a),a.o[b]=d,a.o[c]=e,f.H=!0,a.F+=1,a;c=this.o.length;b=Array(c+2);Be(this.o,0,b,0,c);b[c]=d;b[c+1]=e;f.H=!0;d=this.F+1;a===this.la?(this.o=b,this.F=d,a=this):a=new Bh(this.la,this.ec,d,b);return a}return this.o[b+1]===e?this:uh(this,a,b+1,e)}return(new xh(a,1<<(this.ec>>>b&31),[null,this,null,null])).Kb(a,b,c,d,e,f)};
+g.Jb=function(a,b,c,d,e){return b===this.ec?(a=Eh(this.o,this.F,c),-1===a?(a=2*this.F,b=Array(a+2),Be(this.o,0,b,0,a),b[a]=c,b[a+1]=d,e.H=!0,new Bh(null,this.ec,this.F+1,b)):G.c(this.o[a+1],d)?this:new Bh(null,this.ec,this.F,sh(this.o,a+1,d))):(new xh(null,1<<(this.ec>>>a&31),[null,this])).Jb(a,b,c,d,e)};g.rd=function(a,b,c){a=Eh(this.o,this.F,c);return-1===a?this:1===this.F?null:new Bh(null,this.ec,this.F-1,th(this.o,Ze(a)))};g.ba=function(){return new wh(this.o,0,null,null)};
+function Fh(a,b,c,d,e){this.meta=a;this.Mb=b;this.i=c;this.s=d;this.w=e;this.m=32374988;this.J=0}g=Fh.prototype;g.toString=function(){return fd(this)};g.equiv=function(a){return this.K(null,a)};g.indexOf=function(){var a=null;a=function(a,c){switch(arguments.length){case 1:return Ud(this,a,0);case 2:return Ud(this,a,c)}throw Error("Invalid arity: "+(arguments.length-1));};a.h=function(a){return Ud(this,a,0)};a.c=function(a,c){return Ud(this,a,c)};return a}();
+g.lastIndexOf=function(){function a(a){return Xd(this,a,H(this))}var b=null;b=function(b,d){switch(arguments.length){case 1:return a.call(this,b);case 2:return Xd(this,b,d)}throw Error("Invalid arity: "+(arguments.length-1));};b.h=a;b.c=function(a,b){return Xd(this,a,b)};return b}();g.P=function(){return this.meta};g.Ka=function(){return null==this.s?yh(this.Mb,this.i+2,null):yh(this.Mb,this.i,z(this.s))};g.U=function(){var a=this.w;return null!=a?a:this.w=a=Ad(this)};
+g.K=function(a,b){return $d(this,b)};g.oa=function(){return tc(wd,this.meta)};g.Fa=function(a,b){return ce(b,this)};g.Ga=function(a,b,c){return de(b,c,this)};g.Ia=function(){return null==this.s?new R(null,2,5,T,[this.Mb[this.i],this.Mb[this.i+1]],null):y(this.s)};g.bb=function(){var a=null==this.s?yh(this.Mb,this.i+2,null):yh(this.Mb,this.i,z(this.s));return null!=a?a:wd};g.S=function(){return this};g.T=function(a,b){return new Fh(b,this.Mb,this.i,this.s,this.w)};g.X=function(a,b){return ae(b,this)};
+Fh.prototype[Fb]=function(){return yd(this)};function yh(a,b,c){if(null==c)for(c=a.length;;)if(b<c){if(null!=a[b])return new Fh(null,a,b,null,null);var d=a[b+1];if(t(d)&&(d=d.qd(),t(d)))return new Fh(null,a,b+2,d,null);b+=2}else return null;else return new Fh(null,a,b,c,null)}function Gh(a,b,c,d,e){this.meta=a;this.Mb=b;this.i=c;this.s=d;this.w=e;this.m=32374988;this.J=0}g=Gh.prototype;g.toString=function(){return fd(this)};g.equiv=function(a){return this.K(null,a)};
+g.indexOf=function(){var a=null;a=function(a,c){switch(arguments.length){case 1:return Ud(this,a,0);case 2:return Ud(this,a,c)}throw Error("Invalid arity: "+(arguments.length-1));};a.h=function(a){return Ud(this,a,0)};a.c=function(a,c){return Ud(this,a,c)};return a}();
+g.lastIndexOf=function(){function a(a){return Xd(this,a,H(this))}var b=null;b=function(b,d){switch(arguments.length){case 1:return a.call(this,b);case 2:return Xd(this,b,d)}throw Error("Invalid arity: "+(arguments.length-1));};b.h=a;b.c=function(a,b){return Xd(this,a,b)};return b}();g.P=function(){return this.meta};g.Ka=function(){return Dh(this.Mb,this.i,z(this.s))};g.U=function(){var a=this.w;return null!=a?a:this.w=a=Ad(this)};g.K=function(a,b){return $d(this,b)};g.oa=function(){return tc(wd,this.meta)};
+g.Fa=function(a,b){return ce(b,this)};g.Ga=function(a,b,c){return de(b,c,this)};g.Ia=function(){return y(this.s)};g.bb=function(){var a=Dh(this.Mb,this.i,z(this.s));return null!=a?a:wd};g.S=function(){return this};g.T=function(a,b){return new Gh(b,this.Mb,this.i,this.s,this.w)};g.X=function(a,b){return ae(b,this)};Gh.prototype[Fb]=function(){return yd(this)};
+function Dh(a,b,c){if(null==c)for(c=a.length;;)if(b<c){var d=a[b];if(t(d)&&(d=d.qd(),t(d)))return new Gh(null,a,b+1,d,null);b+=1}else return null;else return new Gh(null,a,b,c,null)}function Hh(a,b,c){this.eb=a;this.bf=b;this.xe=c}Hh.prototype.ja=function(){return!this.xe||this.bf.ja()};Hh.prototype.next=function(){if(this.xe)return this.bf.next();this.xe=!0;return new R(null,2,5,T,[null,this.eb],null)};Hh.prototype.remove=function(){return Error("Unsupported operation")};
+function Jh(a,b,c,d,e,f){this.meta=a;this.F=b;this.root=c;this.cb=d;this.eb=e;this.w=f;this.m=16123663;this.J=139268}g=Jh.prototype;g.toString=function(){return fd(this)};g.equiv=function(a){return this.K(null,a)};g.keys=function(){return yd(lh(this))};g.entries=function(){return new gh(E(E(this)))};g.values=function(){return yd(mh(this))};g.has=function(a){return He(this,a)};g.get=function(a,b){return this.I(null,a,b)};
+g.forEach=function(a){for(var b=E(this),c=null,d=0,e=0;;)if(e<d){var f=c.$(null,e),h=J(f,0,null);f=J(f,1,null);a.c?a.c(f,h):a.call(null,f,h);e+=1}else if(b=E(b))Ae(b)?(c=Wc(b),b=Xc(b),h=c,d=H(c),c=h):(c=y(b),h=J(c,0,null),f=J(c,1,null),a.c?a.c(f,h):a.call(null,f,h),b=z(b),c=null,d=0),e=0;else return null};g.V=function(a,b){return this.I(null,b,null)};g.I=function(a,b,c){return null==b?this.cb?this.eb:c:null==this.root?c:this.root.sc(0,od(b),b,c)};
+g.Qc=function(a,b,c){a=this.cb?b.l?b.l(c,null,this.eb):b.call(null,c,null,this.eb):c;return Hd(a)?B(a):null!=this.root?Jd(this.root.Jc(b,a)):a};g.ba=function(){var a=this.root?dd(this.root):Cf();return this.cb?new Hh(this.eb,a,!1):a};g.P=function(){return this.meta};g.W=function(){return this.F};g.U=function(){var a=this.w;return null!=a?a:this.w=a=Dd(this)};g.K=function(a,b){return eh(this,b)};g.Pc=function(){return new Kh({},this.root,this.F,this.cb,this.eb)};g.oa=function(){return tc(ph,this.meta)};
+g.ga=function(a,b){if(null==b)return this.cb?new Jh(this.meta,this.F-1,this.root,!1,null,null):this;if(null==this.root)return this;var c=this.root.rd(0,od(b),b);return c===this.root?this:new Jh(this.meta,this.F-1,c,this.cb,this.eb,null)};
+g.O=function(a,b,c){if(null==b)return this.cb&&c===this.eb?this:new Jh(this.meta,this.cb?this.F:this.F+1,this.root,!0,c,null);a=new qh;b=(null==this.root?zh:this.root).Jb(0,od(b),b,c,a);return b===this.root?this:new Jh(this.meta,a.H?this.F+1:this.F,b,this.cb,this.eb,null)};g.yc=function(a,b){return null==b?this.cb:null==this.root?!1:this.root.sc(0,od(b),b,Ce)!==Ce};g.S=function(){if(0<this.F){var a=null!=this.root?this.root.qd():null;return this.cb?ae(new R(null,2,5,T,[null,this.eb],null),a):a}return null};
+g.T=function(a,b){return new Jh(b,this.F,this.root,this.cb,this.eb,this.w)};g.X=function(a,b){if(ze(b))return this.O(null,A.c(b,0),A.c(b,1));for(var c=this,d=E(b);;){if(null==d)return c;var e=y(d);if(ze(e))c=c.O(null,A.c(e,0),A.c(e,1)),d=z(d);else throw Error("conj on a map takes map entries or seqables of map entries");}};
+g.call=function(){var a=null;a=function(a,c,d){switch(arguments.length){case 2:return this.V(null,c);case 3:return this.I(null,c,d)}throw Error("Invalid arity: "+(arguments.length-1));};a.c=function(a,c){return this.V(null,c)};a.l=function(a,c,d){return this.I(null,c,d)};return a}();g.apply=function(a,b){return this.call.apply(this,[this].concat(Gb(b)))};g.h=function(a){return this.V(null,a)};g.c=function(a,b){return this.I(null,a,b)};var ph=new Jh(null,0,null,!1,null,Ed);
+function Pe(a,b){for(var c=a.length,d=0,e=Oc(ph);;)if(d<c){var f=d+1;e=e.Cc(null,a[d],b[d]);d=f}else return Qc(e)}Jh.prototype[Fb]=function(){return yd(this)};function Kh(a,b,c,d,e){this.la=a;this.root=b;this.count=c;this.cb=d;this.eb=e;this.m=258;this.J=56}
+function Lh(a,b,c){if(a.la){if(null==b)a.eb!==c&&(a.eb=c),a.cb||(a.count+=1,a.cb=!0);else{var d=new qh;b=(null==a.root?zh:a.root).Kb(a.la,0,od(b),b,c,d);b!==a.root&&(a.root=b);d.H&&(a.count+=1)}return a}throw Error("assoc! after persistent!");}g=Kh.prototype;g.W=function(){if(this.la)return this.count;throw Error("count after persistent!");};g.V=function(a,b){return null==b?this.cb?this.eb:null:null==this.root?null:this.root.sc(0,od(b),b)};
+g.I=function(a,b,c){return null==b?this.cb?this.eb:c:null==this.root?c:this.root.sc(0,od(b),b,c)};g.Dc=function(a,b){a:if(this.la)if(null!=b?b.m&2048||q===b.sf||(b.m?0:Ab(hc,b)):Ab(hc,b))var c=Lh(this,jc(b),kc(b));else{c=E(b);for(var d=this;;){var e=y(c);if(t(e))c=z(c),d=Lh(d,jc(e),kc(e));else{c=d;break a}}}else throw Error("conj! after persistent");return c};
+g.kd=function(){if(this.la){this.la=null;var a=new Jh(null,this.count,this.root,this.cb,this.eb,null)}else throw Error("persistent! called twice");return a};g.Cc=function(a,b,c){return Lh(this,b,c)};function Mh(a,b,c){for(var d=b;;)if(null!=a)b=c?a.left:a.right,d=ge.c(d,a),a=b;else return d}function Nh(a,b,c,d,e){this.meta=a;this.stack=b;this.vc=c;this.F=d;this.w=e;this.m=32374990;this.J=0}g=Nh.prototype;g.toString=function(){return fd(this)};g.equiv=function(a){return this.K(null,a)};
+g.indexOf=function(){var a=null;a=function(a,c){switch(arguments.length){case 1:return Ud(this,a,0);case 2:return Ud(this,a,c)}throw Error("Invalid arity: "+(arguments.length-1));};a.h=function(a){return Ud(this,a,0)};a.c=function(a,c){return Ud(this,a,c)};return a}();
+g.lastIndexOf=function(){function a(a){return Xd(this,a,H(this))}var b=null;b=function(b,d){switch(arguments.length){case 1:return a.call(this,b);case 2:return Xd(this,b,d)}throw Error("Invalid arity: "+(arguments.length-1));};b.h=a;b.c=function(a,b){return Xd(this,a,b)};return b}();g.P=function(){return this.meta};g.Ka=function(){var a=y(this.stack);a=Mh(this.vc?a.right:a.left,z(this.stack),this.vc);return null==a?null:new Nh(null,a,this.vc,this.F-1,null)};
+g.W=function(){return 0>this.F?H(z(this))+1:this.F};g.U=function(){var a=this.w;return null!=a?a:this.w=a=Ad(this)};g.K=function(a,b){return $d(this,b)};g.oa=function(){return tc(wd,this.meta)};g.Fa=function(a,b){return ce(b,this)};g.Ga=function(a,b,c){return de(b,c,this)};g.Ia=function(){var a=this.stack;return null==a?null:nc(a)};g.bb=function(){var a=y(this.stack);a=Mh(this.vc?a.right:a.left,z(this.stack),this.vc);return null!=a?new Nh(null,a,this.vc,this.F-1,null):wd};g.S=function(){return this};
+g.T=function(a,b){return new Nh(b,this.stack,this.vc,this.F,this.w)};g.X=function(a,b){return ae(b,this)};Nh.prototype[Fb]=function(){return yd(this)};function Oh(a,b,c){return new Nh(null,Mh(a,null,b),b,c,null)}
+function Ph(a,b,c,d){return c instanceof Qh?c.left instanceof Qh?new Qh(c.key,c.H,c.left.bc(),new Rh(a,b,c.right,d,null),null):c.right instanceof Qh?new Qh(c.right.key,c.right.H,new Rh(c.key,c.H,c.left,c.right.left,null),new Rh(a,b,c.right.right,d,null),null):new Rh(a,b,c,d,null):new Rh(a,b,c,d,null)}
+function Sh(a,b,c,d){return d instanceof Qh?d.right instanceof Qh?new Qh(d.key,d.H,new Rh(a,b,c,d.left,null),d.right.bc(),null):d.left instanceof Qh?new Qh(d.left.key,d.left.H,new Rh(a,b,c,d.left.left,null),new Rh(d.key,d.H,d.left.right,d.right,null),null):new Rh(a,b,c,d,null):new Rh(a,b,c,d,null)}
+function Th(a,b,c,d){if(c instanceof Qh)return new Qh(a,b,c.bc(),d,null);if(d instanceof Rh)return Sh(a,b,c,d.ud());if(d instanceof Qh&&d.left instanceof Rh)return new Qh(d.left.key,d.left.H,new Rh(a,b,c,d.left.left,null),Sh(d.key,d.H,d.left.right,d.right.ud()),null);throw Error("red-black tree invariant violation");}
+function Uh(a,b,c,d){if(d instanceof Qh)return new Qh(a,b,c,d.bc(),null);if(c instanceof Rh)return Ph(a,b,c.ud(),d);if(c instanceof Qh&&c.right instanceof Rh)return new Qh(c.right.key,c.right.H,Ph(c.key,c.H,c.left.ud(),c.right.left),new Rh(a,b,c.right.right,d,null),null);throw Error("red-black tree invariant violation");}
+var Vh=function Vh(a,b,c){var e=null!=a.left?function(){var e=a.left;return Vh.l?Vh.l(e,b,c):Vh.call(null,e,b,c)}():c;if(Hd(e))return e;var f=function(){var c=a.key,f=a.H;return b.l?b.l(e,c,f):b.call(null,e,c,f)}();if(Hd(f))return f;if(null!=a.right){var h=a.right;return Vh.l?Vh.l(h,b,f):Vh.call(null,h,b,f)}return f};function Rh(a,b,c,d,e){this.key=a;this.H=b;this.left=c;this.right=d;this.w=e;this.m=32402207;this.J=0}g=Rh.prototype;
+g.lastIndexOf=function(){function a(a){return Xd(this,a,H(this))}var b=null;b=function(b,d){switch(arguments.length){case 1:return a.call(this,b);case 2:return Xd(this,b,d)}throw Error("Invalid arity: "+(arguments.length-1));};b.h=a;b.c=function(a,b){return Xd(this,a,b)};return b}();
+g.indexOf=function(){var a=null;a=function(a,c){switch(arguments.length){case 1:return Ud(this,a,0);case 2:return Ud(this,a,c)}throw Error("Invalid arity: "+(arguments.length-1));};a.h=function(a){return Ud(this,a,0)};a.c=function(a,c){return Ud(this,a,c)};return a}();g.Ee=function(a){return a.He(this)};g.ud=function(){return new Qh(this.key,this.H,this.left,this.right,null)};g.bc=function(){return this};g.De=function(a){return a.Ge(this)};g.replace=function(a,b,c,d){return new Rh(a,b,c,d,null)};
+g.Ge=function(a){return new Rh(a.key,a.H,this,a.right,null)};g.He=function(a){return new Rh(a.key,a.H,a.left,this,null)};g.Jc=function(a,b){return Vh(this,a,b)};g.V=function(a,b){return this.ka(null,b,null)};g.I=function(a,b,c){return this.ka(null,b,c)};g.$=function(a,b){if(0===b)return this.key;if(1===b)return this.H;throw Error("Index out of bounds");};g.ka=function(a,b,c){return 0===b?this.key:1===b?this.H:c};g.dc=function(a,b,c){return(new R(null,2,5,T,[this.key,this.H],null)).dc(null,b,c)};
+g.P=function(){return null};g.W=function(){return 2};g.fd=function(){return this.key};g.gd=function(){return this.H};g.Ac=function(){return this.H};g.Bc=function(){return new R(null,1,5,T,[this.key],null)};g.U=function(){var a=this.w;return null!=a?a:this.w=a=Ad(this)};g.K=function(a,b){return $d(this,b)};g.oa=function(){return he};g.Fa=function(a,b){return Kd(this,b)};g.Ga=function(a,b,c){return Ld(this,b,c)};g.O=function(a,b,c){return K.l(new R(null,2,5,T,[this.key,this.H],null),b,c)};
+g.yc=function(a,b){return 0===b||1===b};g.S=function(){var a=this.key;return Tb(Tb(wd,this.H),a)};g.T=function(a,b){return tc(new R(null,2,5,T,[this.key,this.H],null),b)};g.X=function(a,b){return new R(null,3,5,T,[this.key,this.H,b],null)};
+g.call=function(){var a=null;a=function(a,c,d){switch(arguments.length){case 2:return this.$(null,c);case 3:return this.ka(null,c,d)}throw Error("Invalid arity: "+(arguments.length-1));};a.c=function(a,c){return this.$(null,c)};a.l=function(a,c,d){return this.ka(null,c,d)};return a}();g.apply=function(a,b){return this.call.apply(this,[this].concat(Gb(b)))};g.h=function(a){return this.$(null,a)};g.c=function(a,b){return this.ka(null,a,b)};Rh.prototype[Fb]=function(){return yd(this)};
+function Qh(a,b,c,d,e){this.key=a;this.H=b;this.left=c;this.right=d;this.w=e;this.m=32402207;this.J=0}g=Qh.prototype;g.lastIndexOf=function(){function a(a){return Xd(this,a,H(this))}var b=null;b=function(b,d){switch(arguments.length){case 1:return a.call(this,b);case 2:return Xd(this,b,d)}throw Error("Invalid arity: "+(arguments.length-1));};b.h=a;b.c=function(a,b){return Xd(this,a,b)};return b}();
+g.indexOf=function(){var a=null;a=function(a,c){switch(arguments.length){case 1:return Ud(this,a,0);case 2:return Ud(this,a,c)}throw Error("Invalid arity: "+(arguments.length-1));};a.h=function(a){return Ud(this,a,0)};a.c=function(a,c){return Ud(this,a,c)};return a}();g.Ee=function(a){return new Qh(this.key,this.H,this.left,a,null)};g.ud=function(){throw Error("red-black tree invariant violation");};g.bc=function(){return new Rh(this.key,this.H,this.left,this.right,null)};
+g.De=function(a){return new Qh(this.key,this.H,a,this.right,null)};g.replace=function(a,b,c,d){return new Qh(a,b,c,d,null)};g.Ge=function(a){return this.left instanceof Qh?new Qh(this.key,this.H,this.left.bc(),new Rh(a.key,a.H,this.right,a.right,null),null):this.right instanceof Qh?new Qh(this.right.key,this.right.H,new Rh(this.key,this.H,this.left,this.right.left,null),new Rh(a.key,a.H,this.right.right,a.right,null),null):new Rh(a.key,a.H,this,a.right,null)};
+g.He=function(a){return this.right instanceof Qh?new Qh(this.key,this.H,new Rh(a.key,a.H,a.left,this.left,null),this.right.bc(),null):this.left instanceof Qh?new Qh(this.left.key,this.left.H,new Rh(a.key,a.H,a.left,this.left.left,null),new Rh(this.key,this.H,this.left.right,this.right,null),null):new Rh(a.key,a.H,a.left,this,null)};g.Jc=function(a,b){return Vh(this,a,b)};g.V=function(a,b){return this.ka(null,b,null)};g.I=function(a,b,c){return this.ka(null,b,c)};
+g.$=function(a,b){if(0===b)return this.key;if(1===b)return this.H;throw Error("Index out of bounds");};g.ka=function(a,b,c){return 0===b?this.key:1===b?this.H:c};g.dc=function(a,b,c){return(new R(null,2,5,T,[this.key,this.H],null)).dc(null,b,c)};g.P=function(){return null};g.W=function(){return 2};g.fd=function(){return this.key};g.gd=function(){return this.H};g.Ac=function(){return this.H};g.Bc=function(){return new R(null,1,5,T,[this.key],null)};
+g.U=function(){var a=this.w;return null!=a?a:this.w=a=Ad(this)};g.K=function(a,b){return $d(this,b)};g.oa=function(){return he};g.Fa=function(a,b){return Kd(this,b)};g.Ga=function(a,b,c){return Ld(this,b,c)};g.O=function(a,b,c){return K.l(new R(null,2,5,T,[this.key,this.H],null),b,c)};g.yc=function(a,b){return 0===b||1===b};g.S=function(){var a=this.key;return Tb(Tb(wd,this.H),a)};g.T=function(a,b){return tc(new R(null,2,5,T,[this.key,this.H],null),b)};
+g.X=function(a,b){return new R(null,3,5,T,[this.key,this.H,b],null)};g.call=function(){var a=null;a=function(a,c,d){switch(arguments.length){case 2:return this.$(null,c);case 3:return this.ka(null,c,d)}throw Error("Invalid arity: "+(arguments.length-1));};a.c=function(a,c){return this.$(null,c)};a.l=function(a,c,d){return this.ka(null,c,d)};return a}();g.apply=function(a,b){return this.call.apply(this,[this].concat(Gb(b)))};g.h=function(a){return this.$(null,a)};
+g.c=function(a,b){return this.ka(null,a,b)};Qh.prototype[Fb]=function(){return yd(this)};
+var Wh=function Wh(a,b,c,d,e){if(null==b)return new Qh(c,d,null,null,null);var h=function(){var d=b.key;return a.c?a.c(c,d):a.call(null,c,d)}();if(0===h)return e[0]=b,null;if(0>h)return h=function(){var h=b.left;return Wh.Z?Wh.Z(a,h,c,d,e):Wh.call(null,a,h,c,d,e)}(),null!=h?b.De(h):null;h=function(){var h=b.right;return Wh.Z?Wh.Z(a,h,c,d,e):Wh.call(null,a,h,c,d,e)}();return null!=h?b.Ee(h):null},Xh=function Xh(a,b){if(null==a)return b;if(null==b)return a;if(a instanceof Qh){if(b instanceof Qh){var d=
+function(){var d=a.right,f=b.left;return Xh.c?Xh.c(d,f):Xh.call(null,d,f)}();return d instanceof Qh?new Qh(d.key,d.H,new Qh(a.key,a.H,a.left,d.left,null),new Qh(b.key,b.H,d.right,b.right,null),null):new Qh(a.key,a.H,a.left,new Qh(b.key,b.H,d,b.right,null),null)}return new Qh(a.key,a.H,a.left,function(){var d=a.right;return Xh.c?Xh.c(d,b):Xh.call(null,d,b)}(),null)}if(b instanceof Qh)return new Qh(b.key,b.H,function(){var d=b.left;return Xh.c?Xh.c(a,d):Xh.call(null,a,d)}(),b.right,null);d=function(){var d=
+a.right,f=b.left;return Xh.c?Xh.c(d,f):Xh.call(null,d,f)}();return d instanceof Qh?new Qh(d.key,d.H,new Rh(a.key,a.H,a.left,d.left,null),new Rh(b.key,b.H,d.right,b.right,null),null):Th(a.key,a.H,a.left,new Rh(b.key,b.H,d,b.right,null))},Yh=function Yh(a,b,c,d){if(null!=b){var f=function(){var d=b.key;return a.c?a.c(c,d):a.call(null,c,d)}();if(0===f)return d[0]=b,Xh(b.left,b.right);if(0>f)return f=function(){var f=b.left;return Yh.M?Yh.M(a,f,c,d):Yh.call(null,a,f,c,d)}(),null!=f||null!=d[0]?b.left instanceof
+Rh?Th(b.key,b.H,f,b.right):new Qh(b.key,b.H,f,b.right,null):null;f=function(){var f=b.right;return Yh.M?Yh.M(a,f,c,d):Yh.call(null,a,f,c,d)}();return null!=f||null!=d[0]?b.right instanceof Rh?Uh(b.key,b.H,b.left,f):new Qh(b.key,b.H,b.left,f,null):null}return null},Zh=function Zh(a,b,c,d){var f=b.key,h=a.c?a.c(c,f):a.call(null,c,f);return 0===h?b.replace(f,d,b.left,b.right):0>h?b.replace(f,b.H,function(){var f=b.left;return Zh.M?Zh.M(a,f,c,d):Zh.call(null,a,f,c,d)}(),b.right):b.replace(f,b.H,b.left,
+function(){var f=b.right;return Zh.M?Zh.M(a,f,c,d):Zh.call(null,a,f,c,d)}())};function $h(a,b,c,d,e){this.Bb=a;this.mc=b;this.F=c;this.meta=d;this.w=e;this.m=418776847;this.J=8192}g=$h.prototype;g.forEach=function(a){for(var b=E(this),c=null,d=0,e=0;;)if(e<d){var f=c.$(null,e),h=J(f,0,null);f=J(f,1,null);a.c?a.c(f,h):a.call(null,f,h);e+=1}else if(b=E(b))Ae(b)?(c=Wc(b),b=Xc(b),h=c,d=H(c),c=h):(c=y(b),h=J(c,0,null),f=J(c,1,null),a.c?a.c(f,h):a.call(null,f,h),b=z(b),c=null,d=0),e=0;else return null};
+g.get=function(a,b){return this.I(null,a,b)};g.entries=function(){return new gh(E(E(this)))};g.toString=function(){return fd(this)};g.keys=function(){return yd(lh(this))};g.values=function(){return yd(mh(this))};g.equiv=function(a){return this.K(null,a)};function ai(a,b){for(var c=a.mc;;)if(null!=c){var d=c.key;d=a.Bb.c?a.Bb.c(b,d):a.Bb.call(null,b,d);if(0===d)return c;c=0>d?c.left:c.right}else return null}g.has=function(a){return He(this,a)};g.V=function(a,b){return this.I(null,b,null)};
+g.I=function(a,b,c){a=ai(this,b);return null!=a?a.H:c};g.Qc=function(a,b,c){return null!=this.mc?Jd(Vh(this.mc,b,c)):c};g.P=function(){return this.meta};g.W=function(){return this.F};g.Rc=function(){return 0<this.F?Oh(this.mc,!1,this.F):null};g.U=function(){var a=this.w;return null!=a?a:this.w=a=Dd(this)};g.K=function(a,b){return eh(this,b)};g.oa=function(){return new $h(this.Bb,null,0,this.meta,0)};
+g.ga=function(a,b){var c=[null],d=Yh(this.Bb,this.mc,b,c);return null==d?null==Vd(c,0)?this:new $h(this.Bb,null,0,this.meta,null):new $h(this.Bb,d.bc(),this.F-1,this.meta,null)};g.O=function(a,b,c){a=[null];var d=Wh(this.Bb,this.mc,b,c,a);return null==d?(a=Vd(a,0),G.c(c,a.H)?this:new $h(this.Bb,Zh(this.Bb,this.mc,b,c),this.F,this.meta,null)):new $h(this.Bb,d.bc(),this.F+1,this.meta,null)};g.yc=function(a,b){return null!=ai(this,b)};g.S=function(){return 0<this.F?Oh(this.mc,!0,this.F):null};
+g.T=function(a,b){return new $h(this.Bb,this.mc,this.F,b,this.w)};g.X=function(a,b){if(ze(b))return this.O(null,A.c(b,0),A.c(b,1));for(var c=this,d=E(b);;){if(null==d)return c;var e=y(d);if(ze(e))c=c.O(null,A.c(e,0),A.c(e,1)),d=z(d);else throw Error("conj on a map takes map entries or seqables of map entries");}};
+g.call=function(){var a=null;a=function(a,c,d){switch(arguments.length){case 2:return this.V(null,c);case 3:return this.I(null,c,d)}throw Error("Invalid arity: "+(arguments.length-1));};a.c=function(a,c){return this.V(null,c)};a.l=function(a,c,d){return this.I(null,c,d)};return a}();g.apply=function(a,b){return this.call.apply(this,[this].concat(Gb(b)))};g.h=function(a){return this.V(null,a)};g.c=function(a,b){return this.I(null,a,b)};var bi=new $h(Ke,null,0,null,Ed);$h.prototype[Fb]=function(){return yd(this)};
+var U=function U(a){for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;return U.A(0<c.length?new Jb(c.slice(0),0,null):null)};U.A=function(a){for(var b=E(a),c=Oc(ph);;)if(b){a=z(z(b));var d=y(b);b=ee(b);c=Rc(c,d,b);b=a}else return Qc(c)};U.L=0;U.N=function(a){return U.A(E(a))};var ci=function ci(a){for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;return ci.A(0<c.length?new Jb(c.slice(0),0,null):null)};
+ci.A=function(a){a=a instanceof Jb&&0===a.i?a.o:Lb(a);return ke(a)};ci.L=0;ci.N=function(a){return ci.A(E(a))};function di(a){for(var b=[],c=arguments.length,d=0;;)if(d<c)b.push(arguments[d]),d+=1;else break;a:for(b=E(0<b.length?new Jb(b.slice(0),0,null):null),d=bi;;)if(b)c=z(z(b)),d=K.l(d,y(b),ee(b)),b=c;else break a;return d}function ei(a,b){this.da=a;this.hb=b;this.m=32374988;this.J=0}g=ei.prototype;g.toString=function(){return fd(this)};g.equiv=function(a){return this.K(null,a)};
+g.indexOf=function(){var a=null;a=function(a,c){switch(arguments.length){case 1:return Ud(this,a,0);case 2:return Ud(this,a,c)}throw Error("Invalid arity: "+(arguments.length-1));};a.h=function(a){return Ud(this,a,0)};a.c=function(a,c){return Ud(this,a,c)};return a}();
+g.lastIndexOf=function(){function a(a){return Xd(this,a,H(this))}var b=null;b=function(b,d){switch(arguments.length){case 1:return a.call(this,b);case 2:return Xd(this,b,d)}throw Error("Invalid arity: "+(arguments.length-1));};b.h=a;b.c=function(a,b){return Xd(this,a,b)};return b}();g.P=function(){return this.hb};g.Ka=function(){var a=(null!=this.da?this.da.m&128||q===this.da.Id||(this.da.m?0:Ab(Zb,this.da)):Ab(Zb,this.da))?this.da.Ka(null):z(this.da);return null==a?null:new ei(a,this.hb)};g.U=function(){return Ad(this)};
+g.K=function(a,b){return $d(this,b)};g.oa=function(){return tc(wd,this.hb)};g.Fa=function(a,b){return ce(b,this)};g.Ga=function(a,b,c){return de(b,c,this)};g.Ia=function(){return this.da.Ia(null).fd(null)};g.bb=function(){var a=(null!=this.da?this.da.m&128||q===this.da.Id||(this.da.m?0:Ab(Zb,this.da)):Ab(Zb,this.da))?this.da.Ka(null):z(this.da);return null!=a?new ei(a,this.hb):wd};g.S=function(){return this};g.T=function(a,b){return new ei(this.da,b)};g.X=function(a,b){return ae(b,this)};
+ei.prototype[Fb]=function(){return yd(this)};function lh(a){return(a=E(a))?new ei(a,null):null}function fi(a){return jc(a)}function gi(a,b){this.da=a;this.hb=b;this.m=32374988;this.J=0}g=gi.prototype;g.toString=function(){return fd(this)};g.equiv=function(a){return this.K(null,a)};
+g.indexOf=function(){var a=null;a=function(a,c){switch(arguments.length){case 1:return Ud(this,a,0);case 2:return Ud(this,a,c)}throw Error("Invalid arity: "+(arguments.length-1));};a.h=function(a){return Ud(this,a,0)};a.c=function(a,c){return Ud(this,a,c)};return a}();
+g.lastIndexOf=function(){function a(a){return Xd(this,a,H(this))}var b=null;b=function(b,d){switch(arguments.length){case 1:return a.call(this,b);case 2:return Xd(this,b,d)}throw Error("Invalid arity: "+(arguments.length-1));};b.h=a;b.c=function(a,b){return Xd(this,a,b)};return b}();g.P=function(){return this.hb};g.Ka=function(){var a=(null!=this.da?this.da.m&128||q===this.da.Id||(this.da.m?0:Ab(Zb,this.da)):Ab(Zb,this.da))?this.da.Ka(null):z(this.da);return null==a?null:new gi(a,this.hb)};g.U=function(){return Ad(this)};
+g.K=function(a,b){return $d(this,b)};g.oa=function(){return tc(wd,this.hb)};g.Fa=function(a,b){return ce(b,this)};g.Ga=function(a,b,c){return de(b,c,this)};g.Ia=function(){return this.da.Ia(null).gd(null)};g.bb=function(){var a=(null!=this.da?this.da.m&128||q===this.da.Id||(this.da.m?0:Ab(Zb,this.da)):Ab(Zb,this.da))?this.da.Ka(null):z(this.da);return null!=a?new gi(a,this.hb):wd};g.S=function(){return this};g.T=function(a,b){return new gi(this.da,b)};g.X=function(a,b){return ae(b,this)};
+gi.prototype[Fb]=function(){return yd(this)};function mh(a){return(a=E(a))?new gi(a,null):null}var hi=function hi(a){for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;return hi.A(0<c.length?new Jb(c.slice(0),0,null):null)};hi.A=function(a){return t(Wf(Ve,a))?Te(function(a,c){return ge.c(t(a)?a:Ef,c)},a):null};hi.L=0;hi.N=function(a){return hi.A(E(a))};
+var ii=function ii(a){for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;return ii.A(arguments[0],1<c.length?new Jb(c.slice(1),0,null):null)};ii.A=function(a,b){return t(Wf(Ve,b))?Te(function(a){return function(b,c){return Mb(a,t(b)?b:Ef,E(c))}}(function(b,d){var c=y(d),f=ee(d);return He(b,c)?K.l(b,c,function(){var d=D.c(b,c);return a.c?a.c(d,f):a.call(null,d,f)}()):K.l(b,c,f)}),b):null};ii.L=1;ii.N=function(a){var b=y(a);a=z(a);return ii.A(b,a)};
+function ji(a){for(var b=Ef,c=E(new R(null,7,5,T,[ki,li,mi,ni,oi,pi,qi],null));;)if(c){var d=y(c),e=D.l(a,d,ri);b=G.c(e,ri)?b:K.l(b,d,e);c=z(c)}else return tc(b,qe(a))}function si(a){this.te=a}si.prototype.ja=function(){return this.te.ja()};si.prototype.next=function(){if(this.te.ja())return this.te.next().fa[0];throw Error("No such element");};si.prototype.remove=function(){return Error("Unsupported operation")};function ti(a,b,c){this.meta=a;this.gc=b;this.w=c;this.m=15077647;this.J=139268}g=ti.prototype;
+g.toString=function(){return fd(this)};g.equiv=function(a){return this.K(null,a)};g.keys=function(){return yd(E(this))};g.entries=function(){return new hh(E(E(this)))};g.values=function(){return yd(E(this))};g.has=function(a){return He(this,a)};
+g.forEach=function(a){for(var b=E(this),c=null,d=0,e=0;;)if(e<d){var f=c.$(null,e),h=J(f,0,null);f=J(f,1,null);a.c?a.c(f,h):a.call(null,f,h);e+=1}else if(b=E(b))Ae(b)?(c=Wc(b),b=Xc(b),h=c,d=H(c),c=h):(c=y(b),h=J(c,0,null),f=J(c,1,null),a.c?a.c(f,h):a.call(null,f,h),b=z(b),c=null,d=0),e=0;else return null};g.V=function(a,b){return this.I(null,b,null)};g.I=function(a,b,c){return dc(this.gc,b)?b:c};g.ba=function(){return new si(dd(this.gc))};g.P=function(){return this.meta};g.W=function(){return Qb(this.gc)};
+g.U=function(){var a=this.w;return null!=a?a:this.w=a=Dd(this)};g.K=function(a,b){return ve(b)&&H(this)===H(b)&&Ue(function(){return function(a,d){var c=He(b,d);return c?c:new Gd(!1)}}(this),!0,this.gc)};g.Pc=function(){return new ui(Oc(this.gc))};g.oa=function(){return tc(vi,this.meta)};g.ie=function(a,b){return new ti(this.meta,gc(this.gc,b),null)};g.S=function(){return lh(this.gc)};g.T=function(a,b){return new ti(b,this.gc,this.w)};
+g.X=function(a,b){return new ti(this.meta,K.l(this.gc,b,null),null)};g.call=function(){var a=null;a=function(a,c,d){switch(arguments.length){case 2:return this.V(null,c);case 3:return this.I(null,c,d)}throw Error("Invalid arity: "+(arguments.length-1));};a.c=function(a,c){return this.V(null,c)};a.l=function(a,c,d){return this.I(null,c,d)};return a}();g.apply=function(a,b){return this.call.apply(this,[this].concat(Gb(b)))};g.h=function(a){return this.V(null,a)};
+g.c=function(a,b){return this.I(null,a,b)};var vi=new ti(null,Ef,Ed);function Je(a){for(var b=a.length,c=Oc(vi),d=0;;)if(d<b)Pc(c,a[d]),d+=1;else break;return Qc(c)}ti.prototype[Fb]=function(){return yd(this)};function ui(a){this.lc=a;this.J=136;this.m=259}g=ui.prototype;g.Dc=function(a,b){this.lc=Rc(this.lc,b,null);return this};g.kd=function(){return new ti(null,Qc(this.lc),null)};g.W=function(){return H(this.lc)};g.V=function(a,b){return this.I(null,b,null)};
+g.I=function(a,b,c){return cc.l(this.lc,b,Ce)===Ce?c:b};g.call=function(){function a(a,b,c){return cc.l(this.lc,b,Ce)===Ce?c:b}function b(a,b){return cc.l(this.lc,b,Ce)===Ce?null:b}var c=null;c=function(c,e,f){switch(arguments.length){case 2:return b.call(this,0,e);case 3:return a.call(this,0,e,f)}throw Error("Invalid arity: "+(arguments.length-1));};c.c=b;c.l=a;return c}();g.apply=function(a,b){return this.call.apply(this,[this].concat(Gb(b)))};
+g.h=function(a){return cc.l(this.lc,a,Ce)===Ce?null:a};g.c=function(a,b){return cc.l(this.lc,a,Ce)===Ce?b:a};function wi(a,b,c){this.meta=a;this.$b=b;this.w=c;this.m=417730831;this.J=8192}g=wi.prototype;g.toString=function(){return fd(this)};g.equiv=function(a){return this.K(null,a)};g.keys=function(){return yd(E(this))};g.entries=function(){return new hh(E(E(this)))};g.values=function(){return yd(E(this))};g.has=function(a){return He(this,a)};
+g.forEach=function(a){for(var b=E(this),c=null,d=0,e=0;;)if(e<d){var f=c.$(null,e),h=J(f,0,null);f=J(f,1,null);a.c?a.c(f,h):a.call(null,f,h);e+=1}else if(b=E(b))Ae(b)?(c=Wc(b),b=Xc(b),h=c,d=H(c),c=h):(c=y(b),h=J(c,0,null),f=J(c,1,null),a.c?a.c(f,h):a.call(null,f,h),b=z(b),c=null,d=0),e=0;else return null};g.V=function(a,b){return this.I(null,b,null)};g.I=function(a,b,c){a=ai(this.$b,b);return null!=a?a.key:c};g.P=function(){return this.meta};g.W=function(){return H(this.$b)};
+g.Rc=function(){return 0<H(this.$b)?ig.c(fi,Ic(this.$b)):null};g.U=function(){var a=this.w;return null!=a?a:this.w=a=Dd(this)};g.K=function(a,b){return ve(b)&&H(this)===H(b)&&Ue(function(){return function(a,d){var c=He(b,d);return c?c:new Gd(!1)}}(this),!0,this.$b)};g.oa=function(){return new wi(this.meta,Rb(this.$b),0)};g.ie=function(a,b){return new wi(this.meta,le.c(this.$b,b),null)};g.S=function(){return lh(this.$b)};g.T=function(a,b){return new wi(b,this.$b,this.w)};
+g.X=function(a,b){return new wi(this.meta,K.l(this.$b,b,null),null)};g.call=function(){var a=null;a=function(a,c,d){switch(arguments.length){case 2:return this.V(null,c);case 3:return this.I(null,c,d)}throw Error("Invalid arity: "+(arguments.length-1));};a.c=function(a,c){return this.V(null,c)};a.l=function(a,c,d){return this.I(null,c,d)};return a}();g.apply=function(a,b){return this.call.apply(this,[this].concat(Gb(b)))};g.h=function(a){return this.V(null,a)};
+g.c=function(a,b){return this.I(null,a,b)};var xi=new wi(null,bi,Ed);wi.prototype[Fb]=function(){return yd(this)};function yi(a){a=E(a);if(null==a)return vi;if(a instanceof Jb&&0===a.i)return Je(a.o);for(var b=Oc(vi);;)if(null!=a){var c=z(a);b=b.Dc(null,a.Ia(null));a=c}else return Qc(b)}var zi=function zi(a){for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;return zi.A(0<c.length?new Jb(c.slice(0),0,null):null)};zi.A=function(a){return Mb(Tb,xi,a)};zi.L=0;zi.N=function(a){return zi.A(E(a))};
+function jf(a){if(null!=a&&(a.J&4096||q===a.Oe))return a.hd(null);if("string"===typeof a)return a;throw Error(["Doesn't support name: ",v.h(a)].join(""));}var Ai=function Ai(a){switch(arguments.length){case 2:return Ai.c(arguments[0],arguments[1]);case 3:return Ai.l(arguments[0],arguments[1],arguments[2]);default:for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;return Ai.A(arguments[0],arguments[1],arguments[2],new Jb(c.slice(3),0,null))}};Ai.c=function(a,b){return b};
+Ai.l=function(a,b,c){return(a.h?a.h(b):a.call(null,b))>(a.h?a.h(c):a.call(null,c))?b:c};Ai.A=function(a,b,c,d){return Mb(function(b,c){return Ai.l(a,b,c)},Ai.l(a,b,c),d)};Ai.N=function(a){var b=y(a),c=z(a);a=y(c);var d=z(c);c=y(d);d=z(d);return Ai.A(b,a,c,d)};Ai.L=3;function Bi(a,b){return new kf(null,function(){var c=E(b);if(c){var d=y(c);d=a.h?a.h(d):a.call(null,d);c=t(d)?ae(y(c),Bi(a,vd(c))):null}else c=null;return c},null,null)}function Di(a,b,c){this.i=a;this.end=b;this.step=c}
+Di.prototype.ja=function(){return 0<this.step?this.i<this.end:this.i>this.end};Di.prototype.next=function(){var a=this.i;this.i+=this.step;return a};function Ei(a,b,c,d,e){this.meta=a;this.start=b;this.end=c;this.step=d;this.w=e;this.m=32375006;this.J=139264}g=Ei.prototype;g.toString=function(){return fd(this)};g.equiv=function(a){return this.K(null,a)};
+g.indexOf=function(){var a=null;a=function(a,c){switch(arguments.length){case 1:return Ud(this,a,0);case 2:return Ud(this,a,c)}throw Error("Invalid arity: "+(arguments.length-1));};a.h=function(a){return Ud(this,a,0)};a.c=function(a,c){return Ud(this,a,c)};return a}();
+g.lastIndexOf=function(){function a(a){return Xd(this,a,H(this))}var b=null;b=function(b,d){switch(arguments.length){case 1:return a.call(this,b);case 2:return Xd(this,b,d)}throw Error("Invalid arity: "+(arguments.length-1));};b.h=a;b.c=function(a,b){return Xd(this,a,b)};return b}();g.$=function(a,b){if(0<=b&&b<this.W(null))return this.start+b*this.step;if(0<=b&&this.start>this.end&&0===this.step)return this.start;throw Error("Index out of bounds");};
+g.ka=function(a,b,c){return 0<=b&&b<this.W(null)?this.start+b*this.step:0<=b&&this.start>this.end&&0===this.step?this.start:c};g.ba=function(){return new Di(this.start,this.end,this.step)};g.P=function(){return this.meta};g.Ka=function(){return 0<this.step?this.start+this.step<this.end?new Ei(this.meta,this.start+this.step,this.end,this.step,null):null:this.start+this.step>this.end?new Ei(this.meta,this.start+this.step,this.end,this.step,null):null};
+g.W=function(){return wb(this.S(null))?0:Math.ceil((this.end-this.start)/this.step)};g.U=function(){var a=this.w;return null!=a?a:this.w=a=Ad(this)};g.K=function(a,b){return $d(this,b)};g.oa=function(){return tc(wd,this.meta)};g.Fa=function(a,b){return Kd(this,b)};g.Ga=function(a,b,c){for(a=this.start;;)if(0<this.step?a<this.end:a>this.end){c=b.c?b.c(c,a):b.call(null,c,a);if(Hd(c))return B(c);a+=this.step}else return c};g.Ia=function(){return null==this.S(null)?null:this.start};
+g.bb=function(){return null!=this.S(null)?new Ei(this.meta,this.start+this.step,this.end,this.step,null):wd};g.S=function(){return 0<this.step?this.start<this.end?this:null:0>this.step?this.start>this.end?this:null:this.start===this.end?null:this};g.T=function(a,b){return new Ei(b,this.start,this.end,this.step,this.w)};g.X=function(a,b){return ae(b,this)};Ei.prototype[Fb]=function(){return yd(this)};function Fi(a,b,c){return new Ei(null,a,b,c,null)}
+function Gi(a,b){return new R(null,2,5,T,[Bi(a,b),ng(a,b)],null)}
+function Hi(a){var b=y;return function(){function c(c,d,e){return new R(null,2,5,T,[b.l?b.l(c,d,e):b.call(null,c,d,e),a.l?a.l(c,d,e):a.call(null,c,d,e)],null)}function d(c,d){return new R(null,2,5,T,[b.c?b.c(c,d):b.call(null,c,d),a.c?a.c(c,d):a.call(null,c,d)],null)}function e(c){return new R(null,2,5,T,[b.h?b.h(c):b.call(null,c),a.h?a.h(c):a.call(null,c)],null)}function f(){return new R(null,2,5,T,[b.B?b.B():b.call(null),a.B?a.B():a.call(null)],null)}var h=null,k=function(){function c(a,b,c,e){var f=
+null;if(3<arguments.length){f=0;for(var h=Array(arguments.length-3);f<h.length;)h[f]=arguments[f+3],++f;f=new Jb(h,0,null)}return d.call(this,a,b,c,f)}function d(c,d,e,f){return new R(null,2,5,T,[Af(b,c,d,e,f),Af(a,c,d,e,f)],null)}c.L=3;c.N=function(a){var b=y(a);a=z(a);var c=y(a);a=z(a);var e=y(a);a=vd(a);return d(b,c,e,a)};c.A=d;return c}();h=function(a,b,h,u){switch(arguments.length){case 0:return f.call(this);case 1:return e.call(this,a);case 2:return d.call(this,a,b);case 3:return c.call(this,
+a,b,h);default:var m=null;if(3<arguments.length){m=0;for(var l=Array(arguments.length-3);m<l.length;)l[m]=arguments[m+3],++m;m=new Jb(l,0,null)}return k.A(a,b,h,m)}throw Error("Invalid arity: "+(arguments.length-1));};h.L=3;h.N=k.N;h.B=f;h.h=e;h.c=d;h.l=c;h.A=k.A;return h}()}function Ii(a){a:for(var b=a;;)if(E(b))b=z(b);else break a;return a}
+function Ji(a,b){if("string"===typeof b){var c=a.exec(b);return G.c(y(c),b)?1===H(c)?y(c):Wg(c):null}throw new TypeError("re-matches must match against a string.");}
+function Y(a,b,c,d,e,f,h){var k=lb;lb=null==lb?null:lb-1;try{if(null!=lb&&0>lb)return Jc(a,"#");Jc(a,c);if(0===tb.h(f))E(h)&&Jc(a,function(){var a=Ki.h(f);return t(a)?a:"..."}());else{if(E(h)){var l=y(h);b.l?b.l(l,a,f):b.call(null,l,a,f)}for(var p=z(h),m=tb.h(f)-1;;)if(!p||null!=m&&0===m){E(p)&&0===m&&(Jc(a,d),Jc(a,function(){var a=Ki.h(f);return t(a)?a:"..."}()));break}else{Jc(a,d);var u=y(p);c=a;h=f;b.l?b.l(u,c,h):b.call(null,u,c,h);var w=z(p);c=m-1;p=w;m=c}}return Jc(a,e)}finally{lb=k}}
+function Li(a,b){for(var c=E(b),d=null,e=0,f=0;;)if(f<e){var h=d.$(null,f);Jc(a,h);f+=1}else if(c=E(c))d=c,Ae(d)?(c=Wc(d),e=Xc(d),d=c,h=H(c),c=e,e=h):(h=y(d),Jc(a,h),c=z(d),d=null,e=0),f=0;else return null}var Mi={'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"};function Ni(a){return[v.h('"'),v.h(a.replace(RegExp('[\\\\"\b\f\n\r\t]',"g"),function(a){return Mi[a]})),v.h('"')].join("")}
+function Oi(a,b){var c=Ee(D.c(a,rb));return c?(c=null!=b?b.m&131072||q===b.tf?!0:!1:!1)?null!=qe(b):c:c}
+function Pi(a,b,c){if(null==a)return Jc(b,"nil");Oi(c,a)&&(Jc(b,"^"),Qi(qe(a),b,c),Jc(b," "));if(a.qc)return a.Ec(a,b,c);if(null!=a&&(a.m&2147483648||q===a.ma))return a.R(null,b,c);if(!0===a||!1===a)return Jc(b,""+v.h(a));if("number"===typeof a)return Jc(b,isNaN(a)?"##NaN":a===Number.POSITIVE_INFINITY?"##Inf":a===Number.NEGATIVE_INFINITY?"##-Inf":""+v.h(a));if(null!=a&&a.constructor===Object)return Jc(b,"#js "),Ri(ig.c(function(b){return new R(null,2,5,T,[null!=Ji(/[A-Za-z_\*\+\?!\-'][\w\*\+\?!\-']*/,
+b)?hf.h(b):b,a[b]],null)},Ea(a)),b,c);if(vb(a))return Y(b,Qi,"#js ["," ","]",c,a);if(ca(a))return t(qb.h(c))?Jc(b,Ni(a)):Jc(b,a);if(ha(a)){var d=a.name;c=t(function(){var a=null==d;return a?a:/^[\s\xa0]*$/.test(d)}())?"Function":d;return Li(b,be(["#object[",c,"","]"]))}if(a instanceof Date)return c=function(a,b){for(var c=""+v.h(a);;)if(H(c)<b)c=["0",v.h(c)].join("");else return c},Li(b,be(['#inst "',""+v.h(a.getUTCFullYear()),"-",c(a.getUTCMonth()+1,2),"-",c(a.getUTCDate(),2),"T",c(a.getUTCHours(),
+2),":",c(a.getUTCMinutes(),2),":",c(a.getUTCSeconds(),2),".",c(a.getUTCMilliseconds(),3),"-",'00:00"']));if(a instanceof RegExp)return Li(b,be(['#"',a.source,'"']));if(t(function(){var b=null==a?null:a.constructor;return null==b?null:b.Tb}()))return Li(b,be(["#object[",a.constructor.Tb.replace(RegExp("/","g"),"."),"]"]));d=function(){var b=null==a?null:a.constructor;return null==b?null:b.name}();c=t(function(){var a=null==d;return a?a:/^[\s\xa0]*$/.test(d)}())?"Object":d;return null==a.constructor?
+Li(b,be(["#object[",c,"]"])):Li(b,be(["#object[",c," ",""+v.h(a),"]"]))}function Qi(a,b,c){var d=Si.h(c);return t(d)?(c=K.l(c,Ti,Pi),d.l?d.l(a,b,c):d.call(null,a,b,c)):Pi(a,b,c)}function Ui(a,b){var c=new cb;a:{var d=new ed(c);Qi(y(a),d,b);for(var e=E(z(a)),f=null,h=0,k=0;;)if(k<h){var l=f.$(null,k);Jc(d," ");Qi(l,d,b);k+=1}else if(e=E(e))f=e,Ae(f)?(e=Wc(f),h=Xc(f),f=e,l=H(e),e=h,h=l):(l=y(f),Jc(d," "),Qi(l,d,b),e=z(f),f=null,h=0),k=0;else break a}return c}
+function Vi(a){var b=ob();return te(a)?"":""+v.h(Ui(a,b))}function Wi(a,b,c,d,e){return Y(d,function(a,b,d){var e=jc(a);c.l?c.l(e,b,d):c.call(null,e,b,d);Jc(b," ");a=kc(a);return c.l?c.l(a,b,d):c.call(null,a,b,d)},[v.h(a),"{"].join(""),", ","}",e,E(b))}function Ri(a,b,c){var d=Qi,e=(xe(a),null),f=J(e,0,null);e=J(e,1,null);return t(f)?Wi(["#:",v.h(f)].join(""),e,d,b,c):Wi(null,a,d,b,c)}hg.prototype.ma=q;
+hg.prototype.R=function(a,b,c){Jc(b,"#object [cljs.core.Volatile ");Qi(new r(null,1,[Xi,this.state],null),b,c);return Jc(b,"]")};Jb.prototype.ma=q;Jb.prototype.R=function(a,b,c){return Y(b,Qi,"("," ",")",c,this)};kf.prototype.ma=q;kf.prototype.R=function(a,b,c){return Y(b,Qi,"("," ",")",c,this)};Nh.prototype.ma=q;Nh.prototype.R=function(a,b,c){return Y(b,Qi,"("," ",")",c,this)};Fh.prototype.ma=q;Fh.prototype.R=function(a,b,c){return Y(b,Qi,"("," ",")",c,this)};Rh.prototype.ma=q;
+Rh.prototype.R=function(a,b,c){return Y(b,Qi,"["," ","]",c,this)};jh.prototype.ma=q;jh.prototype.R=function(a,b,c){return Y(b,Qi,"("," ",")",c,this)};wi.prototype.ma=q;wi.prototype.R=function(a,b,c){return Y(b,Qi,"#{"," ","}",c,this)};Ug.prototype.ma=q;Ug.prototype.R=function(a,b,c){return Y(b,Qi,"("," ",")",c,this)};ef.prototype.ma=q;ef.prototype.R=function(a,b,c){return Y(b,Qi,"("," ",")",c,this)};Zd.prototype.ma=q;Zd.prototype.R=function(a,b,c){return Y(b,Qi,"("," ",")",c,this)};
+Jh.prototype.ma=q;Jh.prototype.R=function(a,b,c){return Ri(this,b,c)};Gh.prototype.ma=q;Gh.prototype.R=function(a,b,c){return Y(b,Qi,"("," ",")",c,this)};Yg.prototype.ma=q;Yg.prototype.R=function(a,b,c){return Y(b,Qi,"["," ","]",c,this)};$h.prototype.ma=q;$h.prototype.R=function(a,b,c){return Ri(this,b,c)};ti.prototype.ma=q;ti.prototype.R=function(a,b,c){return Y(b,Qi,"#{"," ","}",c,this)};pf.prototype.ma=q;pf.prototype.R=function(a,b,c){return Y(b,Qi,"("," ",")",c,this)};cg.prototype.ma=q;
+cg.prototype.R=function(a,b,c){Jc(b,"#object [cljs.core.Atom ");Qi(new r(null,1,[Xi,this.state],null),b,c);return Jc(b,"]")};gi.prototype.ma=q;gi.prototype.R=function(a,b,c){return Y(b,Qi,"("," ",")",c,this)};Qh.prototype.ma=q;Qh.prototype.R=function(a,b,c){return Y(b,Qi,"["," ","]",c,this)};R.prototype.ma=q;R.prototype.R=function(a,b,c){return Y(b,Qi,"["," ","]",c,this)};bf.prototype.ma=q;bf.prototype.R=function(a,b){return Jc(b,"()")};r.prototype.ma=q;
+r.prototype.R=function(a,b,c){return Ri(this,b,c)};Ei.prototype.ma=q;Ei.prototype.R=function(a,b,c){return Y(b,Qi,"("," ",")",c,this)};Sf.prototype.ma=q;Sf.prototype.R=function(a,b,c){return Y(b,Qi,"("," ",")",c,this)};ei.prototype.ma=q;ei.prototype.R=function(a,b,c){return Y(b,Qi,"("," ",")",c,this)};af.prototype.ma=q;af.prototype.R=function(a,b,c){return Y(b,Qi,"("," ",")",c,this)};rd.prototype.zc=q;
+rd.prototype.cc=function(a,b){if(b instanceof rd)return sd(this,b);throw Error(["Cannot compare ",v.h(this)," to ",v.h(b)].join(""));};L.prototype.zc=q;L.prototype.cc=function(a,b){if(b instanceof L)return ff(this,b);throw Error(["Cannot compare ",v.h(this)," to ",v.h(b)].join(""));};Yg.prototype.zc=q;Yg.prototype.cc=function(a,b){if(ze(b))return Le(this,b);throw Error(["Cannot compare ",v.h(this)," to ",v.h(b)].join(""));};R.prototype.zc=q;
+R.prototype.cc=function(a,b){if(ze(b))return Le(this,b);throw Error(["Cannot compare ",v.h(this)," to ",v.h(b)].join(""));};Rh.prototype.zc=q;Rh.prototype.cc=function(a,b){if(ze(b))return Le(this,b);throw Error(["Cannot compare ",v.h(this)," to ",v.h(b)].join(""));};Qh.prototype.zc=q;Qh.prototype.cc=function(a,b){if(ze(b))return Le(this,b);throw Error(["Cannot compare ",v.h(this)," to ",v.h(b)].join(""));};var Yi=null;
+function Zi(){null==Yi&&(Yi=dg.h(0));return td.h([v.h("reagent"),v.h(gg.c(Yi,Fd))].join(""))}function $i(){}var aj=function aj(a){if(null!=a&&null!=a.pf)return a.pf(a);var c=aj[n(null==a?null:a)];if(null!=c)return c.h?c.h(a):c.call(null,a);c=aj._;if(null!=c)return c.h?c.h(a):c.call(null,a);throw Cb("IEncodeJS.-clj-\x3ejs",a);};function bj(a){return(null!=a?q===a.nf||(a.Tc?0:Ab($i,a)):Ab($i,a))?aj(a):"string"===typeof a||"number"===typeof a||a instanceof L||a instanceof rd?cj(a):Vi(be([a]))}
+var cj=function cj(a){if(null==a)return null;if(null!=a?q===a.nf||(a.Tc?0:Ab($i,a)):Ab($i,a))return aj(a);if(a instanceof L)return jf(a);if(a instanceof rd)return""+v.h(a);if(xe(a)){var c={};a=E(a);for(var d=null,e=0,f=0;;)if(f<e){var h=d.$(null,f),k=J(h,0,null),l=J(h,1,null);h=c;k=bj(k);l=cj.h?cj.h(l):cj.call(null,l);h[k]=l;f+=1}else if(a=E(a))Ae(a)?(e=Wc(a),a=Xc(a),d=e,e=H(e)):(d=y(a),e=J(d,0,null),f=J(d,1,null),d=c,e=bj(e),f=cj.h?cj.h(f):cj.call(null,f),d[e]=f,a=z(a),d=null,e=0),f=0;else break;
+return c}if(ue(a)){c=[];a=E(ig.c(cj,a));d=null;for(f=e=0;;)if(f<e)h=d.$(null,f),c.push(h),f+=1;else if(a=E(a))d=a,Ae(d)?(a=Wc(d),f=Xc(d),d=a,e=H(a),a=f):(a=y(d),c.push(a),a=z(d),d=null,e=0),f=0;else break;return c}return a};function dj(){}var ej=function ej(a,b){if(null!=a&&null!=a.mf)return a.mf(a,b);var d=ej[n(null==a?null:a)];if(null!=d)return d.c?d.c(a,b):d.call(null,a,b);d=ej._;if(null!=d)return d.c?d.c(a,b):d.call(null,a,b);throw Cb("IEncodeClojure.-js-\x3eclj",a);};
+function fj(a){var b=be([gj,!0]),c=null!=b&&(b.m&64||q===b.G)?P(U,b):b,d=D.c(c,gj);return function(a,c,d,k){return function m(e){return(null!=e?q===e.lf||(e.Tc?0:Ab(dj,e)):Ab(dj,e))?ej(e,P(ci,b)):De(e)?Ii(ig.c(m,e)):ue(e)?wg.c(ie(e),ig.c(m,e)):vb(e)?Wg(ig.c(m,e)):Bb(e)===Object?wg.c(Ef,function(){return function(a,b,c,d){return function M(f){return new kf(null,function(a,b,c,d){return function(){for(;;){var a=E(f);if(a){if(Ae(a)){var b=Wc(a),c=H(b),h=of(c);a:for(var k=0;;)if(k<c){var p=A.c(b,k);p=
+new R(null,2,5,T,[d.h?d.h(p):d.call(null,p),m(e[p])],null);h.add(p);k+=1}else{b=!0;break a}return b?qf(h.Da(),M(Xc(a))):qf(h.Da(),null)}h=y(a);return ae(new R(null,2,5,T,[d.h?d.h(h):d.call(null,h),m(e[h])],null),M(vd(a)))}return null}}}(a,b,c,d),null,null)}}(a,c,d,k)(Ea(e))}()):e}}(b,c,d,t(d)?hf:v)(a)}
+function hj(a){return function(b){return function(){function c(a){var b=null;if(0<arguments.length){b=0;for(var c=Array(arguments.length-0);b<c.length;)c[b]=arguments[b+0],++b;b=new Jb(c,0,null)}return d.call(this,b)}function d(c){var d=D.l(B(b),c,Ce);d===Ce&&(d=P(a,c),gg.M(b,K,c,d));return d}c.L=0;c.N=function(a){a=E(a);return d(a)};c.A=d;return c}()}(dg.h(Ef))}var ij=null;function jj(){null==ij&&(ij=dg.h(new r(null,3,[kj,Ef,lj,Ef,mj,Ef],null)));return ij}
+function nj(a,b,c){var d=G.c(b,c);if(d)return d;d=mj.h(a);d=d.h?d.h(b):d.call(null,b);if(!(d=He(d,c))&&(d=ze(c)))if(d=ze(b))if(d=H(c)===H(b)){d=!0;for(var e=0;;)if(d&&e!==H(c))d=nj(a,b.h?b.h(e):b.call(null,e),c.h?c.h(e):c.call(null,e)),e+=1;else return d}else return d;else return d;else return d}function oj(a){var b=B(jj());return Bf(D.c(kj.h(b),a))}function pj(a,b,c,d){gg.c(a,function(){return B(b)});gg.c(c,function(){return B(d)})}
+var qj=function qj(a,b,c){var e=function(){var b=B(c);return b.h?b.h(a):b.call(null,a)}();e=t(t(e)?e.h?e.h(b):e.call(null,b):e)?!0:null;if(t(e))return e;e=function(){for(var e=oj(b);;)if(0<H(e)){var h=y(e);qj.l?qj.l(a,h,c):qj.call(null,a,h,c);e=vd(e)}else return null}();if(t(e))return e;e=function(){for(var e=oj(a);;)if(0<H(e)){var h=y(e);qj.l?qj.l(h,b,c):qj.call(null,h,b,c);e=vd(e)}else return null}();return t(e)?e:!1};function rj(a,b,c,d){c=qj(a,b,c);return t(c)?c:nj(d,a,b)}
+var sj=function sj(a,b,c,d,e,f,h,k){var p=Mb(function(d,f){var h=J(f,0,null);J(f,1,null);if(nj(B(c),b,h)){var k=(k=null==d)?k:rj(h,y(d),e,B(c));k=t(k)?f:d;if(!t(rj(y(k),h,e,B(c))))throw Error(["Multiple methods in multimethod '",v.h(a),"' match dispatch value: ",v.h(b)," -\x3e ",v.h(h)," and ",v.h(y(k)),", and neither is preferred"].join(""));return k}return d},null,B(d)),m=function(){var a;if(a=null==p)a=B(d),a=a.h?a.h(k):a.call(null,k);return t(a)?new R(null,2,5,T,[k,a],null):p}();if(t(m)){if(G.c(B(h),
+B(c)))return gg.M(f,K,b,ee(m)),ee(m);pj(f,d,h,c);return sj.Ha?sj.Ha(a,b,c,d,e,f,h,k):sj.call(null,a,b,c,d,e,f,h,k)}return null};function tj(a,b){throw Error(["No method in multimethod '",v.h(a),"' for dispatch value: ",v.h(b)].join(""));}function uj(a,b,c,d,e,f,h,k){this.name=a;this.D=b;this.vf=c;this.Rd=d;this.Vd=e;this.Kf=f;this.Ud=h;this.Ed=k;this.m=4194305;this.J=4352}g=uj.prototype;
+g.call=function(){function a(a,b,c,d,e,f,h,k,m,l,p,u,w,x,F,C,I,M,S,X,Q,Ga){a=this;var W=oe(a.D,b,c,d,e,be([f,h,k,m,l,p,u,w,x,F,C,I,M,S,X,Q,Ga])),ka=vj(this,W);t(ka)||tj(a.name,W);return oe(ka,b,c,d,e,be([f,h,k,m,l,p,u,w,x,F,C,I,M,S,X,Q,Ga]))}function b(a,b,c,d,e,f,h,k,m,l,p,u,w,x,F,C,I,M,S,X,Q){a=this;var W=a.D.Xa?a.D.Xa(b,c,d,e,f,h,k,m,l,p,u,w,x,F,C,I,M,S,X,Q):a.D.call(null,b,c,d,e,f,h,k,m,l,p,u,w,x,F,C,I,M,S,X,Q),ka=vj(this,W);t(ka)||tj(a.name,W);return ka.Xa?ka.Xa(b,c,d,e,f,h,k,m,l,p,u,w,x,F,C,
+I,M,S,X,Q):ka.call(null,b,c,d,e,f,h,k,m,l,p,u,w,x,F,C,I,M,S,X,Q)}function c(a,b,c,d,e,f,h,k,m,l,p,u,w,x,F,C,I,M,S,X){a=this;var W=a.D.Wa?a.D.Wa(b,c,d,e,f,h,k,m,l,p,u,w,x,F,C,I,M,S,X):a.D.call(null,b,c,d,e,f,h,k,m,l,p,u,w,x,F,C,I,M,S,X),ka=vj(this,W);t(ka)||tj(a.name,W);return ka.Wa?ka.Wa(b,c,d,e,f,h,k,m,l,p,u,w,x,F,C,I,M,S,X):ka.call(null,b,c,d,e,f,h,k,m,l,p,u,w,x,F,C,I,M,S,X)}function d(a,b,c,d,e,f,h,k,m,l,p,u,w,x,F,C,I,M,S){a=this;var W=a.D.Va?a.D.Va(b,c,d,e,f,h,k,m,l,p,u,w,x,F,C,I,M,S):a.D.call(null,
+b,c,d,e,f,h,k,m,l,p,u,w,x,F,C,I,M,S),ka=vj(this,W);t(ka)||tj(a.name,W);return ka.Va?ka.Va(b,c,d,e,f,h,k,m,l,p,u,w,x,F,C,I,M,S):ka.call(null,b,c,d,e,f,h,k,m,l,p,u,w,x,F,C,I,M,S)}function e(a,b,c,d,e,f,h,k,m,l,p,u,w,x,F,C,I,M){a=this;var W=a.D.Ua?a.D.Ua(b,c,d,e,f,h,k,m,l,p,u,w,x,F,C,I,M):a.D.call(null,b,c,d,e,f,h,k,m,l,p,u,w,x,F,C,I,M),ka=vj(this,W);t(ka)||tj(a.name,W);return ka.Ua?ka.Ua(b,c,d,e,f,h,k,m,l,p,u,w,x,F,C,I,M):ka.call(null,b,c,d,e,f,h,k,m,l,p,u,w,x,F,C,I,M)}function f(a,b,c,d,e,f,h,k,m,
+l,p,u,w,x,F,C,I){a=this;var W=a.D.Ta?a.D.Ta(b,c,d,e,f,h,k,m,l,p,u,w,x,F,C,I):a.D.call(null,b,c,d,e,f,h,k,m,l,p,u,w,x,F,C,I),ka=vj(this,W);t(ka)||tj(a.name,W);return ka.Ta?ka.Ta(b,c,d,e,f,h,k,m,l,p,u,w,x,F,C,I):ka.call(null,b,c,d,e,f,h,k,m,l,p,u,w,x,F,C,I)}function h(a,b,c,d,e,f,h,k,m,l,p,u,w,x,F,C){a=this;var W=a.D.Sa?a.D.Sa(b,c,d,e,f,h,k,m,l,p,u,w,x,F,C):a.D.call(null,b,c,d,e,f,h,k,m,l,p,u,w,x,F,C),ka=vj(this,W);t(ka)||tj(a.name,W);return ka.Sa?ka.Sa(b,c,d,e,f,h,k,m,l,p,u,w,x,F,C):ka.call(null,b,
+c,d,e,f,h,k,m,l,p,u,w,x,F,C)}function k(a,b,c,d,e,f,h,k,m,l,p,u,w,x,F){a=this;var W=a.D.Ra?a.D.Ra(b,c,d,e,f,h,k,m,l,p,u,w,x,F):a.D.call(null,b,c,d,e,f,h,k,m,l,p,u,w,x,F),C=vj(this,W);t(C)||tj(a.name,W);return C.Ra?C.Ra(b,c,d,e,f,h,k,m,l,p,u,w,x,F):C.call(null,b,c,d,e,f,h,k,m,l,p,u,w,x,F)}function l(a,b,c,d,e,f,h,k,m,l,p,u,w,x){a=this;var W=a.D.Qa?a.D.Qa(b,c,d,e,f,h,k,m,l,p,u,w,x):a.D.call(null,b,c,d,e,f,h,k,m,l,p,u,w,x),F=vj(this,W);t(F)||tj(a.name,W);return F.Qa?F.Qa(b,c,d,e,f,h,k,m,l,p,u,w,x):F.call(null,
+b,c,d,e,f,h,k,m,l,p,u,w,x)}function p(a,b,c,d,e,f,h,k,m,l,p,u,w){a=this;var x=a.D.Pa?a.D.Pa(b,c,d,e,f,h,k,m,l,p,u,w):a.D.call(null,b,c,d,e,f,h,k,m,l,p,u,w),W=vj(this,x);t(W)||tj(a.name,x);return W.Pa?W.Pa(b,c,d,e,f,h,k,m,l,p,u,w):W.call(null,b,c,d,e,f,h,k,m,l,p,u,w)}function m(a,b,c,d,e,f,h,k,m,l,p,u){a=this;var w=a.D.Oa?a.D.Oa(b,c,d,e,f,h,k,m,l,p,u):a.D.call(null,b,c,d,e,f,h,k,m,l,p,u),x=vj(this,w);t(x)||tj(a.name,w);return x.Oa?x.Oa(b,c,d,e,f,h,k,m,l,p,u):x.call(null,b,c,d,e,f,h,k,m,l,p,u)}function u(a,
+b,c,d,e,f,h,k,m,l,p){a=this;var u=a.D.Na?a.D.Na(b,c,d,e,f,h,k,m,l,p):a.D.call(null,b,c,d,e,f,h,k,m,l,p),w=vj(this,u);t(w)||tj(a.name,u);return w.Na?w.Na(b,c,d,e,f,h,k,m,l,p):w.call(null,b,c,d,e,f,h,k,m,l,p)}function w(a,b,c,d,e,f,h,k,m,l){a=this;var p=a.D.Za?a.D.Za(b,c,d,e,f,h,k,m,l):a.D.call(null,b,c,d,e,f,h,k,m,l),u=vj(this,p);t(u)||tj(a.name,p);return u.Za?u.Za(b,c,d,e,f,h,k,m,l):u.call(null,b,c,d,e,f,h,k,m,l)}function x(a,b,c,d,e,f,h,k,m){a=this;var l=a.D.Ha?a.D.Ha(b,c,d,e,f,h,k,m):a.D.call(null,
+b,c,d,e,f,h,k,m),p=vj(this,l);t(p)||tj(a.name,l);return p.Ha?p.Ha(b,c,d,e,f,h,k,m):p.call(null,b,c,d,e,f,h,k,m)}function C(a,b,c,d,e,f,h,k){a=this;var m=a.D.Ya?a.D.Ya(b,c,d,e,f,h,k):a.D.call(null,b,c,d,e,f,h,k),l=vj(this,m);t(l)||tj(a.name,m);return l.Ya?l.Ya(b,c,d,e,f,h,k):l.call(null,b,c,d,e,f,h,k)}function F(a,b,c,d,e,f,h){a=this;var k=a.D.Ca?a.D.Ca(b,c,d,e,f,h):a.D.call(null,b,c,d,e,f,h),m=vj(this,k);t(m)||tj(a.name,k);return m.Ca?m.Ca(b,c,d,e,f,h):m.call(null,b,c,d,e,f,h)}function I(a,b,c,d,
+e,f){a=this;var h=a.D.Z?a.D.Z(b,c,d,e,f):a.D.call(null,b,c,d,e,f),k=vj(this,h);t(k)||tj(a.name,h);return k.Z?k.Z(b,c,d,e,f):k.call(null,b,c,d,e,f)}function M(a,b,c,d,e){a=this;var f=a.D.M?a.D.M(b,c,d,e):a.D.call(null,b,c,d,e),h=vj(this,f);t(h)||tj(a.name,f);return h.M?h.M(b,c,d,e):h.call(null,b,c,d,e)}function S(a,b,c,d){a=this;var e=a.D.l?a.D.l(b,c,d):a.D.call(null,b,c,d),f=vj(this,e);t(f)||tj(a.name,e);return f.l?f.l(b,c,d):f.call(null,b,c,d)}function X(a,b,c){a=this;var d=a.D.c?a.D.c(b,c):a.D.call(null,
+b,c),e=vj(this,d);t(e)||tj(a.name,d);return e.c?e.c(b,c):e.call(null,b,c)}function Ga(a,b){a=this;var c=a.D.h?a.D.h(b):a.D.call(null,b),d=vj(this,c);t(d)||tj(a.name,c);return d.h?d.h(b):d.call(null,b)}function db(a){a=this;var b=a.D.B?a.D.B():a.D.call(null),c=vj(this,b);t(c)||tj(a.name,b);return c.B?c.B():c.call(null)}var Q=null;Q=function(Q,Ha,Ja,Oa,Ba,W,$a,ka,jb,nb,zb,Ib,Wd,Xb,ic,xc,Sc,Bd,se,Lf,Ih,kl){switch(arguments.length){case 1:return db.call(this,Q);case 2:return Ga.call(this,Q,Ha);case 3:return X.call(this,
+Q,Ha,Ja);case 4:return S.call(this,Q,Ha,Ja,Oa);case 5:return M.call(this,Q,Ha,Ja,Oa,Ba);case 6:return I.call(this,Q,Ha,Ja,Oa,Ba,W);case 7:return F.call(this,Q,Ha,Ja,Oa,Ba,W,$a);case 8:return C.call(this,Q,Ha,Ja,Oa,Ba,W,$a,ka);case 9:return x.call(this,Q,Ha,Ja,Oa,Ba,W,$a,ka,jb);case 10:return w.call(this,Q,Ha,Ja,Oa,Ba,W,$a,ka,jb,nb);case 11:return u.call(this,Q,Ha,Ja,Oa,Ba,W,$a,ka,jb,nb,zb);case 12:return m.call(this,Q,Ha,Ja,Oa,Ba,W,$a,ka,jb,nb,zb,Ib);case 13:return p.call(this,Q,Ha,Ja,Oa,Ba,W,$a,
+ka,jb,nb,zb,Ib,Wd);case 14:return l.call(this,Q,Ha,Ja,Oa,Ba,W,$a,ka,jb,nb,zb,Ib,Wd,Xb);case 15:return k.call(this,Q,Ha,Ja,Oa,Ba,W,$a,ka,jb,nb,zb,Ib,Wd,Xb,ic);case 16:return h.call(this,Q,Ha,Ja,Oa,Ba,W,$a,ka,jb,nb,zb,Ib,Wd,Xb,ic,xc);case 17:return f.call(this,Q,Ha,Ja,Oa,Ba,W,$a,ka,jb,nb,zb,Ib,Wd,Xb,ic,xc,Sc);case 18:return e.call(this,Q,Ha,Ja,Oa,Ba,W,$a,ka,jb,nb,zb,Ib,Wd,Xb,ic,xc,Sc,Bd);case 19:return d.call(this,Q,Ha,Ja,Oa,Ba,W,$a,ka,jb,nb,zb,Ib,Wd,Xb,ic,xc,Sc,Bd,se);case 20:return c.call(this,Q,
+Ha,Ja,Oa,Ba,W,$a,ka,jb,nb,zb,Ib,Wd,Xb,ic,xc,Sc,Bd,se,Lf);case 21:return b.call(this,Q,Ha,Ja,Oa,Ba,W,$a,ka,jb,nb,zb,Ib,Wd,Xb,ic,xc,Sc,Bd,se,Lf,Ih);case 22:return a.call(this,Q,Ha,Ja,Oa,Ba,W,$a,ka,jb,nb,zb,Ib,Wd,Xb,ic,xc,Sc,Bd,se,Lf,Ih,kl)}throw Error("Invalid arity: "+(arguments.length-1));};Q.h=db;Q.c=Ga;Q.l=X;Q.M=S;Q.Z=M;Q.Ca=I;Q.Ya=F;Q.Ha=C;Q.Za=x;Q.Na=w;Q.Oa=u;Q.Pa=m;Q.Qa=p;Q.Ra=l;Q.Sa=k;Q.Ta=h;Q.Ua=f;Q.Va=e;Q.Wa=d;Q.Xa=c;Q.he=b;Q.qf=a;return Q}();
+g.apply=function(a,b){return this.call.apply(this,[this].concat(Gb(b)))};g.B=function(){var a=this.D.B?this.D.B():this.D.call(null),b=vj(this,a);t(b)||tj(this.name,a);return b.B?b.B():b.call(null)};g.h=function(a){var b=this.D.h?this.D.h(a):this.D.call(null,a),c=vj(this,b);t(c)||tj(this.name,b);return c.h?c.h(a):c.call(null,a)};g.c=function(a,b){var c=this.D.c?this.D.c(a,b):this.D.call(null,a,b),d=vj(this,c);t(d)||tj(this.name,c);return d.c?d.c(a,b):d.call(null,a,b)};
+g.l=function(a,b,c){var d=this.D.l?this.D.l(a,b,c):this.D.call(null,a,b,c),e=vj(this,d);t(e)||tj(this.name,d);return e.l?e.l(a,b,c):e.call(null,a,b,c)};g.M=function(a,b,c,d){var e=this.D.M?this.D.M(a,b,c,d):this.D.call(null,a,b,c,d),f=vj(this,e);t(f)||tj(this.name,e);return f.M?f.M(a,b,c,d):f.call(null,a,b,c,d)};g.Z=function(a,b,c,d,e){var f=this.D.Z?this.D.Z(a,b,c,d,e):this.D.call(null,a,b,c,d,e),h=vj(this,f);t(h)||tj(this.name,f);return h.Z?h.Z(a,b,c,d,e):h.call(null,a,b,c,d,e)};
+g.Ca=function(a,b,c,d,e,f){var h=this.D.Ca?this.D.Ca(a,b,c,d,e,f):this.D.call(null,a,b,c,d,e,f),k=vj(this,h);t(k)||tj(this.name,h);return k.Ca?k.Ca(a,b,c,d,e,f):k.call(null,a,b,c,d,e,f)};g.Ya=function(a,b,c,d,e,f,h){var k=this.D.Ya?this.D.Ya(a,b,c,d,e,f,h):this.D.call(null,a,b,c,d,e,f,h),l=vj(this,k);t(l)||tj(this.name,k);return l.Ya?l.Ya(a,b,c,d,e,f,h):l.call(null,a,b,c,d,e,f,h)};
+g.Ha=function(a,b,c,d,e,f,h,k){var l=this.D.Ha?this.D.Ha(a,b,c,d,e,f,h,k):this.D.call(null,a,b,c,d,e,f,h,k),p=vj(this,l);t(p)||tj(this.name,l);return p.Ha?p.Ha(a,b,c,d,e,f,h,k):p.call(null,a,b,c,d,e,f,h,k)};g.Za=function(a,b,c,d,e,f,h,k,l){var p=this.D.Za?this.D.Za(a,b,c,d,e,f,h,k,l):this.D.call(null,a,b,c,d,e,f,h,k,l),m=vj(this,p);t(m)||tj(this.name,p);return m.Za?m.Za(a,b,c,d,e,f,h,k,l):m.call(null,a,b,c,d,e,f,h,k,l)};
+g.Na=function(a,b,c,d,e,f,h,k,l,p){var m=this.D.Na?this.D.Na(a,b,c,d,e,f,h,k,l,p):this.D.call(null,a,b,c,d,e,f,h,k,l,p),u=vj(this,m);t(u)||tj(this.name,m);return u.Na?u.Na(a,b,c,d,e,f,h,k,l,p):u.call(null,a,b,c,d,e,f,h,k,l,p)};g.Oa=function(a,b,c,d,e,f,h,k,l,p,m){var u=this.D.Oa?this.D.Oa(a,b,c,d,e,f,h,k,l,p,m):this.D.call(null,a,b,c,d,e,f,h,k,l,p,m),w=vj(this,u);t(w)||tj(this.name,u);return w.Oa?w.Oa(a,b,c,d,e,f,h,k,l,p,m):w.call(null,a,b,c,d,e,f,h,k,l,p,m)};
+g.Pa=function(a,b,c,d,e,f,h,k,l,p,m,u){var w=this.D.Pa?this.D.Pa(a,b,c,d,e,f,h,k,l,p,m,u):this.D.call(null,a,b,c,d,e,f,h,k,l,p,m,u),x=vj(this,w);t(x)||tj(this.name,w);return x.Pa?x.Pa(a,b,c,d,e,f,h,k,l,p,m,u):x.call(null,a,b,c,d,e,f,h,k,l,p,m,u)};g.Qa=function(a,b,c,d,e,f,h,k,l,p,m,u,w){var x=this.D.Qa?this.D.Qa(a,b,c,d,e,f,h,k,l,p,m,u,w):this.D.call(null,a,b,c,d,e,f,h,k,l,p,m,u,w),C=vj(this,x);t(C)||tj(this.name,x);return C.Qa?C.Qa(a,b,c,d,e,f,h,k,l,p,m,u,w):C.call(null,a,b,c,d,e,f,h,k,l,p,m,u,w)};
+g.Ra=function(a,b,c,d,e,f,h,k,l,p,m,u,w,x){var C=this.D.Ra?this.D.Ra(a,b,c,d,e,f,h,k,l,p,m,u,w,x):this.D.call(null,a,b,c,d,e,f,h,k,l,p,m,u,w,x),F=vj(this,C);t(F)||tj(this.name,C);return F.Ra?F.Ra(a,b,c,d,e,f,h,k,l,p,m,u,w,x):F.call(null,a,b,c,d,e,f,h,k,l,p,m,u,w,x)};
+g.Sa=function(a,b,c,d,e,f,h,k,l,p,m,u,w,x,C){var F=this.D.Sa?this.D.Sa(a,b,c,d,e,f,h,k,l,p,m,u,w,x,C):this.D.call(null,a,b,c,d,e,f,h,k,l,p,m,u,w,x,C),I=vj(this,F);t(I)||tj(this.name,F);return I.Sa?I.Sa(a,b,c,d,e,f,h,k,l,p,m,u,w,x,C):I.call(null,a,b,c,d,e,f,h,k,l,p,m,u,w,x,C)};
+g.Ta=function(a,b,c,d,e,f,h,k,l,p,m,u,w,x,C,F){var I=this.D.Ta?this.D.Ta(a,b,c,d,e,f,h,k,l,p,m,u,w,x,C,F):this.D.call(null,a,b,c,d,e,f,h,k,l,p,m,u,w,x,C,F),M=vj(this,I);t(M)||tj(this.name,I);return M.Ta?M.Ta(a,b,c,d,e,f,h,k,l,p,m,u,w,x,C,F):M.call(null,a,b,c,d,e,f,h,k,l,p,m,u,w,x,C,F)};
+g.Ua=function(a,b,c,d,e,f,h,k,l,p,m,u,w,x,C,F,I){var M=this.D.Ua?this.D.Ua(a,b,c,d,e,f,h,k,l,p,m,u,w,x,C,F,I):this.D.call(null,a,b,c,d,e,f,h,k,l,p,m,u,w,x,C,F,I),S=vj(this,M);t(S)||tj(this.name,M);return S.Ua?S.Ua(a,b,c,d,e,f,h,k,l,p,m,u,w,x,C,F,I):S.call(null,a,b,c,d,e,f,h,k,l,p,m,u,w,x,C,F,I)};
+g.Va=function(a,b,c,d,e,f,h,k,l,p,m,u,w,x,C,F,I,M){var S=this.D.Va?this.D.Va(a,b,c,d,e,f,h,k,l,p,m,u,w,x,C,F,I,M):this.D.call(null,a,b,c,d,e,f,h,k,l,p,m,u,w,x,C,F,I,M),X=vj(this,S);t(X)||tj(this.name,S);return X.Va?X.Va(a,b,c,d,e,f,h,k,l,p,m,u,w,x,C,F,I,M):X.call(null,a,b,c,d,e,f,h,k,l,p,m,u,w,x,C,F,I,M)};
+g.Wa=function(a,b,c,d,e,f,h,k,l,p,m,u,w,x,C,F,I,M,S){var X=this.D.Wa?this.D.Wa(a,b,c,d,e,f,h,k,l,p,m,u,w,x,C,F,I,M,S):this.D.call(null,a,b,c,d,e,f,h,k,l,p,m,u,w,x,C,F,I,M,S),Ga=vj(this,X);t(Ga)||tj(this.name,X);return Ga.Wa?Ga.Wa(a,b,c,d,e,f,h,k,l,p,m,u,w,x,C,F,I,M,S):Ga.call(null,a,b,c,d,e,f,h,k,l,p,m,u,w,x,C,F,I,M,S)};
+g.Xa=function(a,b,c,d,e,f,h,k,l,p,m,u,w,x,C,F,I,M,S,X){var Ga=this.D.Xa?this.D.Xa(a,b,c,d,e,f,h,k,l,p,m,u,w,x,C,F,I,M,S,X):this.D.call(null,a,b,c,d,e,f,h,k,l,p,m,u,w,x,C,F,I,M,S,X),db=vj(this,Ga);t(db)||tj(this.name,Ga);return db.Xa?db.Xa(a,b,c,d,e,f,h,k,l,p,m,u,w,x,C,F,I,M,S,X):db.call(null,a,b,c,d,e,f,h,k,l,p,m,u,w,x,C,F,I,M,S,X)};
+g.he=function(a,b,c,d,e,f,h,k,l,p,m,u,w,x,C,F,I,M,S,X,Ga){var db=oe(this.D,a,b,c,d,be([e,f,h,k,l,p,m,u,w,x,C,F,I,M,S,X,Ga])),Q=vj(this,db);t(Q)||tj(this.name,db);return oe(Q,a,b,c,d,be([e,f,h,k,l,p,m,u,w,x,C,F,I,M,S,X,Ga]))};function wj(a,b){var c=xj;gg.M(c.Vd,K,a,b);pj(c.Ud,c.Vd,c.Ed,c.Rd)}function vj(a,b){G.c(B(a.Ed),B(a.Rd))||pj(a.Ud,a.Vd,a.Ed,a.Rd);var c=B(a.Ud);c=c.h?c.h(b):c.call(null,b);return t(c)?c:sj(a.name,b,a.Rd,a.Vd,a.Kf,a.Ud,a.Ed,a.vf)}g.hd=function(){return Yc(this.name)};g.jd=function(){return Zc(this.name)};
+g.U=function(){return ja(this)};function yj(a,b){this.Mc=a;this.w=b;this.m=2153775104;this.J=2048}g=yj.prototype;g.toString=function(){return this.Mc};g.equiv=function(a){return this.K(null,a)};g.K=function(a,b){return b instanceof yj&&this.Mc===b.Mc};g.R=function(a,b){return Jc(b,['#uuid "',v.h(this.Mc),'"'].join(""))};g.U=function(){null==this.w&&(this.w=od(this.Mc));return this.w};g.cc=function(a,b){return Aa(this.Mc,b.Mc)};var zj=new L(null,"hook","hook",750265408),Aj=new L(null,"y","y",-1757859776),Bj=new L(null,"setCurrentTime","setCurrentTime",-623552),Cj=new L(null,"span.gutter","span.gutter",-700214016),Dj=new rd(null,"\x26","\x26",-2144855648,null),Ej=new L(null,"dcs-param","dcs-param",-971011648),Fj=new L(null,"path","path",-188191168),Gj=new L(null,"escape","escape",-991601952),Df=new rd(null,"meta34617","meta34617",-1789836320,null),Hj=new L(null,"force-load-ch","force-load-ch",-1689229247),Ij=new rd("schema.core",
+"Any","schema.core/Any",-1891898271,null),Jj=new L(null,"tab-index","tab-index",895755393),Kj=new L(null,"bold","bold",-116809535),Lj=new L(null,"authorImgURL","authorImgURL",-1171541759),Mj=new L(null,"schema","schema",-1582001791),Nj=new rd(null,"optional-key","optional-key",988406145,null),Oj=new L(null,"char-attrs","char-attrs",-1444091455),Pj=new L(null,"esc-dispatch","esc-dispatch",17832481),Qj=new L(null,"idle_time_limit","idle_time_limit",-1837919647),Rj=new L(null,"auto-wrap-mode","auto-wrap-mode",
+-2049555583),Sj=new L(null,"preload?","preload?",445442977),Tj=new L(null,"on-set","on-set",-140953470),Uj=new L(null,"current-time","current-time",-1609407134),Vj=new L(null,"span.progressbar","span.progressbar",766750210),Wj=new L(null,"osc-end","osc-end",1762953954),Xj=new L("internal","rewind","internal/rewind",-31749342),Yj=new L(null,"bottom-margin","bottom-margin",-701300733),Zj=new L(null,"on-key-press","on-key-press",-399563677),ak=new L(null,"osc-put","osc-put",-1827844733),bk=new L(null,
+"cljsLegacyRender","cljsLegacyRender",-1527295613),ck=new L(null,"klass","klass",-1386752349),dk=new L(null,"blink","blink",-271985917),ek=new rd(null,"meta43127","meta43127",166183907,null),fk=new L(null,"primary","primary",817773892),gk=new rd(null,"meta43105","meta43105",-531987068,null),rb=new L(null,"meta","meta",1499536964),V=new L(null,"screen","screen",1990059748),hk=new rd(null,"Symbol","Symbol",716452869,null),ik=new L(null,"color","color",1011675173),jk=new rd(null,"blockable","blockable",
+-28395259,null),sb=new L(null,"dup","dup",556298533),kk=new L(null,"parser-params","parser-params",36457893),lk=new rd(null,"height","height",-1629257147,null),mk=new L(null,"key","key",-1516042587),nk=new rd(null,"CellLine","CellLine",-317574363,null),ok=new L(null,"asciicast","asciicast",509526949),pk=new rd(null,"conditional","conditional",-1212542970,null),qk=new L(null,"exit","exit",351849638),rk=new L(null,"parser-intermediates","parser-intermediates",-169100058),sk=new L(null,"else","else",
+-1508377146),tk=new L(null,"tabs","tabs",-779855354),uk=new L(null,"ground","ground",1193572934),vk=new L(null,"next-print-wraps","next-print-wraps",-1664999738),wk=new L(null,"font-size","font-size",-1847940346),xk=new rd(null,"Bool","Bool",195910502,null),yk=new L(null,"transition","transition",765692007),zk=new rd(null,"one","one",-1719427865,null),Ak=new L(null,"speed","speed",1257663751),Bk=new L(null,"displayName","displayName",-809144601),Ck=new L(null,"_","_",1453416199),eg=new L(null,"validator",
+"validator",-1966190681),Dk=new rd(null,"char-attrs","char-attrs",196440072,null),Ek=new L(null,"div.loading","div.loading",-155515768),Fk=new L(null,"dcs-passthrough","dcs-passthrough",-671044440),Gk=new L(null,"show-hud","show-hud",1983299752),Hk=new L(null,"start-at","start-at",-103334680),Ik=new L(null,"default","default",-1987822328),Jk=new L(null,"csi-param","csi-param",-1120111192),Kk=new L(null,"div.control-bar","div.control-bar",-1316808248),Lk=new L(null,"finally-block","finally-block",
+832982472),Mk=new rd(null,"cb","cb",-2064487928,null),Nk=new L(null,"inverse","inverse",-1623859672),Ok=new L(null,"fg","fg",-101797208),Pk=new L(null,"warn","warn",-436710552),Qk=new L(null,"dcs-intermediate","dcs-intermediate",480808872),Rk=new L(null,"osc-string","osc-string",-486531128),Sk=new L(null,"on-enter","on-enter",-928988216),Tk=new L(null,"name","name",1843675177),Uk=new L(null,"frames","frames",1765687497),Vk=new L(null,"extra-validator-fn","extra-validator-fn",1562905865),Wk=new L(null,
+"output-schema","output-schema",272504137),Xk=new L(null,"div.play-button","div.play-button",1020321513),Yk=new L(null,"span.time-elapsed","span.time-elapsed",-1782475638),Zk=new L(null,"time","time",1385887882),$k=new L(null,"component-did-mount","component-did-mount",-1126910518),al=new L(null,"background-color","background-color",570434026),bl=new L(null,"recording-ch-fn","recording-ch-fn",-902533462),cl=new L(null,"span.playback-button","span.playback-button",-1136389398),dl=new L(null,"span.title-bar",
+"span.title-bar",-1165872085),el=new L(null,"loaded","loaded",-1246482293),fl=new L(null,"width","width",-384071477),gl=new L(null,"start","start",-355208981),hl=new rd(null,"meta43130","meta43130",1056327947,null),il=new L(null,"lines","lines",-700165781),jl=new L(null,"input-schemas","input-schemas",-982154805),ll=new L(null,"sos-pm-apc-string","sos-pm-apc-string",398998091),ml=new L(null,"cursor-on","cursor-on",302555051),nl=new L(null,"component-did-update","component-did-update",-1468549173),
+ol=new L(null,"div.start-prompt","div.start-prompt",-41424788),Xi=new L(null,"val","val",128701612),pl=new L(null,"cursor","cursor",1011937484),ql=new L(null,"dcs-entry","dcs-entry",216833388),Z=new L(null,"recur","recur",-437573268),rl=new L(null,"type","type",1174270348),sl=new rd(null,"Num","Num",-2044934708,null),tl=new L(null,"alternate","alternate",-931038644),ul=new L(null,"catch-block","catch-block",1175212748),vl=new L(null,"onPlay","onPlay",150417132),wl=new L(null,"duration","duration",
+1444101068),xl=new L(null,"execute","execute",-129499188),yl=new rd(null,"pred","pred",-727012372,null),zl=new L(null,"src","src",-1651076051),Al=new rd(null,"Any","Any",1277492269,null),Bl=new L(null,"span.bar","span.bar",-1986926323),Cl=new rd(null,"Regex","Regex",205914413,null),Dl=new L(null,"msg-ch","msg-ch",-1840176755),El=new L(null,"on-exit","on-exit",1821961613),Ti=new L(null,"fallback-impl","fallback-impl",-1501286995),Fl=new L(null,"view-box","view-box",-1792199155),Gl=new L(null,"source",
+"source",-433931539),Hl=new L(null,"csi-entry","csi-entry",-1787942099),pb=new L(null,"flush-on-newline","flush-on-newline",-151457939),Il=new L(null,"preds-and-schemas","preds-and-schemas",-1306766355),Jl=new L(null,"command-ch","command-ch",508874766),Kl=new L(null,"componentWillUnmount","componentWillUnmount",1573788814),Ll=new rd(null,"Inst","Inst",292408622,null),Ml=new L(null,"span.timer","span.timer",2111534382),Nl=new L(null,"toggle","toggle",1291842030),Ol=new L(null,"cursor-blink-ch","cursor-blink-ch",
+1063651214),Pl=new L(null,"print","print",1299562414),Ql=new L(null,"on-mouse-down","on-mouse-down",1147755470),Rl=new L(null,"csi-dispatch","csi-dispatch",-126857169),Sl=new L(null,"on-click","on-click",1632826543),Tl=new L(null,"parser-state","parser-state",594493647),Ul=new L(null,"ignore","ignore",-1631542033),lj=new L(null,"descendants","descendants",1824886031),Vl=new L(null,"underline","underline",2018066703),Wl=new rd(null,"Str","Str",907970895,null),Xl=new L(null,"param","param",2013631823),
+Yl=new L(null,"k","k",-2146297393),ki=new L(null,"title","title",636505583),Zl=new L(null,"stop-ch","stop-ch",-219113969),$l=new L(null,"insert-mode","insert-mode",894811791),am=new rd(null,"maybe","maybe",1326133967,null),bm=new L(null,"toggle-fullscreen","toggle-fullscreen",-1647254833),cm=new L(null,"loop","loop",-395552849),ni=new L(null,"author-img-url","author-img-url",2016975920),dm=new L(null,"shouldComponentUpdate","shouldComponentUpdate",1795750960),mj=new L(null,"ancestors","ancestors",
+-776045424),em=new rd(null,"flag","flag",-1565787888,null),fm=new L(null,"style","style",-496642736),gm=new L(null,"theme","theme",-1247880880),hm=new L(null,"stream","stream",1534941648),im=new L(null,"charset-fn","charset-fn",1374523920),li=new L(null,"author","author",2111686192),jm=new L(null,"escape-intermediate","escape-intermediate",1036490448),km=new L(null,"div","div",1057191632),qb=new L(null,"readably","readably",1129599760),lm=new L(null,"change-speed","change-speed",2125740976),Ki=new L(null,
+"more-marker","more-marker",-14717935),mm=new L(null,"new-line-mode","new-line-mode",1467504785),nm=new L(null,"optional?","optional?",1184638129),om=new L(null,"csi-intermediate","csi-intermediate",-410048175),pm=new L(null,"reagentRender","reagentRender",-358306383),qm=new L(null,"idle-time-limit","idle-time-limit",-928369231),rm=new L(null,"started?","started?",-1301062863),sm=new L(null,"other-buffer-saved","other-buffer-saved",-2048065486),tm=new L(null,"snapshot","snapshot",-1274785710),um=
+new L(null,"osc-start","osc-start",-1717437326),vm=new L(null,"preload","preload",1646824722),wm=new L(null,"stop","stop",-2140911342),xm=new L(null,"no-cache","no-cache",1588056370),ym=new rd(null,"Uuid","Uuid",-1866694318,null),zm=new L(null,"render","render",-1408033454),Am=new rd(null,"width","width",1256460050,null),Bm=new L(null,"poster","poster",-1616913550),Cm=new L(null,"csi-ignore","csi-ignore",-764437550),Dm=new L(null,"reagent-render","reagent-render",-985383853),Em=new L(null,"auto-play",
+"auto-play",-645319501),Fm=new L(null,"collect","collect",-284321549),Gm=new L(null,"pre.asciinema-terminal","pre.asciinema-terminal",832737619),Hm=new L(null,"loading","loading",-737050189),Im=new L(null,"priority","priority",1431093715),Jm=new L(null,"auto-play?","auto-play?",385278451),Km=new rd(null,"val","val",1769233139,null),Lm=new L(null,"span.line","span.line",-1541583788),tb=new L(null,"print-length","print-length",1931866356),Mm=new L(null,"poster-time","poster-time",1478579796),Nm=new L(null,
+"saved","saved",288760660),Om=new L(null,"error-symbol","error-symbol",-823480428),oi=new L(null,"on-can-play","on-can-play",1481578549),Pm=new L(null,"catch-exception","catch-exception",-1997306795),Qm=new L(null,"constructor","constructor",-1953928811),Rm=new L(null,"auto-run","auto-run",1958400437),Sm=new L(null,"div.asciinema-player","div.asciinema-player",-1293079051),kj=new L(null,"parents","parents",-2027538891),mi=new L(null,"author-url","author-url",1091920533),Tm=new L(null,"pred-name",
+"pred-name",-3677451),Um=new rd(null,"meta42957","meta42957",-1080714315,null),Vm=new L(null,"on-mouse-move","on-mouse-move",-1386320874),Wm=new L(null,"component-will-unmount","component-will-unmount",-2058314698),Xm=new L(null,"prev","prev",-1597069226),Ym=new L(null,"svg","svg",856789142),Zm=new L(null,"getDuration","getDuration",-995932010),$m=new L(null,"url","url",276297046),an=new L(null,"authorURL","authorURL",549221782),bn=new rd(null,"meta38850","meta38850",1963771318,null),cn=new L(null,
+"continue-block","continue-block",-1852047850),dn=new L(null,"loop?","loop?",457687798),en=new rd(null,"ch","ch",1085813622,null),fn=new rd(null,"CodePoint","CodePoint",-132710345,null),gn=new L(null,"autoPlay","autoPlay",-561263241),hn=new rd(null,"\x3d\x3e","\x3d\x3e",-813269641,null),jn=new L(null,"playing","playing",70013335),kn=new rd(null,"Keyword","Keyword",-850065993,null),ln=new L(null,"display-name","display-name",694513143),mn=new L(null,"random","random",-557811113),nn=new L(null,"position",
+"position",-2011731912),on=new L(null,"on-dispose","on-dispose",2105306360),pn=new L(null,"d","d",1972142424),qn=new L(null,"action","action",-811238024),rn=new L(null,"stdout-ch","stdout-ch",825692568),sn=new L(null,"pause","pause",-2095325672),tn=new L(null,"error","error",-978969032),un=new L(null,"span.fullscreen-button","span.fullscreen-button",-1476136392),vn=new L(null,"class-name","class-name",945142584),wn=new L(null,"componentFunction","componentFunction",825866104),xn=new L(null,"div.loader",
+"div.loader",-1644603528),yn=new L(null,"origin-mode","origin-mode",-1430095912),zn=new L(null,"x","x",2099068185),An=new L(null,"__html","__html",674048345),Bn=new L(null,"fontSize","fontSize",919623033),Cn=new L(null,"div.asciinema-player-wrapper","div.asciinema-player-wrapper",2009764409),Dn=new L(null,"startAt","startAt",849336089),En=new L(null,"getCurrentTime","getCurrentTime",697283642),Fn=new L(null,"put","put",1299772570),Gn=new rd(null,"CharAttrs","CharAttrs",1533586778,null),Hn=new L(null,
+"top-margin","top-margin",655579514),In=new L(null,"unhook","unhook",1440586234),Jn=new L(null,"play","play",-580418022),Kn=new L(null,"seek","seek",758996602),Ln=new rd(null,"chars","chars",545901210,null),Mn=new L(null,"version","version",425292698),Nn=new rd(null,"line","line",1852876762,null),qi=new L(null,"on-pause","on-pause",1839279163),On=new L(null,"visible","visible",-1024216805),Pn=new L(null,"autobind","autobind",-570650245),Qn=new L(null,"hierarchy","hierarchy",-1053470341),Rn=new L(null,
+"on-key-down","on-key-down",-1374733765),pi=new L(null,"on-play","on-play",-188934501),Sn=new rd(null,"\x3d\x3e*","\x3d\x3e*",1909690043,null),Si=new L(null,"alt-impl","alt-impl",670969595),Tn=new L(null,"bg","bg",-206688421),Un=new L(null,"p?","p?",-1172161701),Vn=new L(null,"onCanPlay","onCanPlay",197552027),Wn=new L(null,"other-buffer-lines","other-buffer-lines",-1562366021),Xn=new rd(null,"record","record",861424668,null),Yn=new L(null,"italic","italic",32599196),Zn=new rd(null,"required-key",
+"required-key",1624616412,null),$n=new L(null,"dcs-ignore","dcs-ignore",198619612),ao=new rd(null,"optional","optional",-600484260,null),gj=new L(null,"keywordize-keys","keywordize-keys",1310784252),bo=new rd(null,"Int","Int",-2116888740,null),co=new L(null,"span.time-remaining","span.time-remaining",706865437),eo=new L(null,"componentWillMount","componentWillMount",-285327619),fo=new L(null,"idleTimeLimit","idleTimeLimit",-867712227),go=new L("internal","seek","internal/seek",-1958914115),ho=new L(null,
+"href","href",-793805698),io=new L(null,"buffer","buffer",617295198),jo=new L(null,"img","img",1442687358),ko=new L(null,"stdout","stdout",-531490018),lo=new L(null,"a","a",-2123407586),mo=new L(null,"dangerouslySetInnerHTML","dangerouslySetInnerHTML",-554971138),no=new L(null,"height","height",1025178622),oo=new rd("s","Num","s/Num",-2044935073,null),po=new L(null,"clear","clear",1877104959),ri=new L("cljs.core","not-found","cljs.core/not-found",-1572889185),qo=new rd(null,"meta36583","meta36583",
+-346463841,null),ro=new L(null,"span","span",1394872991),so=new L(null,"show","show",-576705889),to=new rd(null,"f","f",43394975,null),uo=new L(null,"onPause","onPause",-470027297);function vo(a,b){var c=Kb(Ai,a,b);return ae(c,vg(function(a){return function(b){return a===b}}(c),b))}var wo=function wo(a){switch(arguments.length){case 0:return wo.B();case 1:return wo.h(arguments[0]);case 2:return wo.c(arguments[0],arguments[1]);default:for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;return wo.A(arguments[0],arguments[1],new Jb(c.slice(2),0,null))}};wo.B=function(){return vi};wo.h=function(a){return a};
+wo.c=function(a,b){return H(a)<H(b)?Mb(ge,b,a):Mb(ge,a,b)};wo.A=function(a,b,c){a=vo(H,ge.A(c,b,be([a])));return Mb(wg,y(a),vd(a))};wo.N=function(a){var b=y(a),c=z(a);a=y(c);c=z(c);return wo.A(b,a,c)};wo.L=2;var xo=function xo(a){switch(arguments.length){case 1:return xo.h(arguments[0]);case 2:return xo.c(arguments[0],arguments[1]);default:for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;return xo.A(arguments[0],arguments[1],new Jb(c.slice(2),0,null))}};xo.h=function(a){return a};
+xo.c=function(a,b){return H(a)<H(b)?Mb(function(a,d){return He(b,d)?re.c(a,d):a},a,a):Mb(re,a,b)};xo.A=function(a,b,c){return Mb(xo,a,ge.c(c,b))};xo.N=function(a){var b=y(a),c=z(a);a=y(c);c=z(c);return xo.A(b,a,c)};xo.L=2;function yo(a){var b=Pe([Lj,vl,tm,an,gn,Bn,Dn,Vn,fo,uo],[ni,pi,Bm,mi,Em,wk,Hk,oi,qm,qi]);return Mb(function(b,d){var c=J(d,0,null),f=J(d,1,null);return He(a,c)?K.l(b,f,D.c(a,c)):b},Kb(le,a,lh(b)),b)};if("undefined"===typeof zo)var zo=dg.h(null);
+if("undefined"===typeof Ao)var Ao=function(){var a={};a.warn=function(){return function(){function a(a){var b=null;if(0<arguments.length){b=0;for(var d=Array(arguments.length-0);b<d.length;)d[b]=arguments[b+0],++b;b=new Jb(d,0,null)}return c.call(this,b)}function c(a){return gg.A(zo,Ag,new R(null,1,5,T,[Pk],null),ge,be([P(v,a)]))}a.L=0;a.N=function(a){a=E(a);return c(a)};a.A=c;return a}()}(a);a.error=function(){return function(){function a(a){var b=null;if(0<arguments.length){b=0;for(var d=Array(arguments.length-
+0);b<d.length;)d[b]=arguments[b+0],++b;b=new Jb(d,0,null)}return c.call(this,b)}function c(a){return gg.A(zo,Ag,new R(null,1,5,T,[tn],null),ge,be([P(v,a)]))}a.L=0;a.N=function(a){a=E(a);return c(a)};a.A=c;return a}()}(a);return a}();function Bo(a,b,c){var d=RegExp,e=b.source,f=t(b.ignoreCase)?[v.h("g"),"i"].join(""):"g";f=t(b.multiline)?[v.h(f),"m"].join(""):f;b=t(b.cg)?[v.h(f),"u"].join(""):f;d=new d(e,b);return a.replace(d,c)}
+function Co(a){return function(){function b(a){var b=null;if(0<arguments.length){b=0;for(var d=Array(arguments.length-0);b<d.length;)d[b]=arguments[b+0],++b;b=new Jb(d,0,null)}return c.call(this,b)}function c(b){b=lg(b);if(G.c(H(b),1))return b=y(b),a.h?a.h(b):a.call(null,b);b=Wg(b);return a.h?a.h(b):a.call(null,b)}b.L=0;b.N=function(a){a=E(a);return c(a)};b.A=c;return b}()}
+function Do(a,b,c){if("string"===typeof b)return a.replace(new RegExp(String(b).replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08"),"g"),c);if(b instanceof RegExp)return"string"===typeof c?Bo(a,b,c):Bo(a,b,Co(c));throw["Invalid match arg: ",v.h(b)].join("");}function Eo(a){var b=new cb;for(a=E(a);;)if(null!=a)b=b.append(""+v.h(y(a))),a=z(a);else return b.toString()}
+function Fo(a,b){var c="/(?:)/"===""+v.h(b)?ge.c(Wg(ae("",ig.c(v,E(a)))),""):Wg((""+v.h(a)).split(b));if(1<H(c))a:for(;;)if(""===(null==c?null:nc(c)))c=null==c?null:oc(c);else break a;return c};if("undefined"===typeof Go){var Ho;if("undefined"!==typeof React)Ho=React;else{var Io;if("undefined"!==typeof require){var Jo=require("react");if(t(Jo))Io=Jo;else throw Error("require('react') failed");}else throw Error("js/React is missing");Ho=Io}var Go=Ho}
+if("undefined"===typeof Ko){var Lo;if("undefined"!==typeof createReactClass)Lo=createReactClass;else{var Mo;if("undefined"!==typeof require){var No=require("create-react-class");if(t(No))Mo=No;else throw Error("require('create-react-class') failed");}else throw Error("js/createReactClass is missing");Lo=Mo}var Ko=Lo}var Oo=new ti(null,new r(null,2,["aria",null,"data",null],null),null);function Po(a){return 2>H(a)?a.toUpperCase():[v.h(a.substring(0,1).toUpperCase()),v.h(a.substring(1))].join("")}
+function Qo(a){if("string"===typeof a)return a;a=jf(a);var b=Fo(a,/-/),c=E(b);b=y(c);c=z(c);return t(Oo.h?Oo.h(b):Oo.call(null,b))?a:Kb(v,b,ig.c(Po,c))}function Ro(a){var b=function(){var b=function(){var b=me(a);return b?(b=a.displayName,t(b)?b:a.name):b}();if(t(b))return b;b=function(){var b=null!=a?a.J&4096||q===a.Oe?!0:!1:!1;return b?jf(a):b}();if(t(b))return b;b=qe(a);return xe(b)?Tk.h(b):null}();return Do(""+v.h(b),"$",".")}var So=!1;if("undefined"===typeof To)var To=0;function Uo(a){return setTimeout(a,16)}var Vo="undefined"===typeof window||null==window.document?Uo:function(){var a=window,b=a.requestAnimationFrame;if(t(b))return b;b=a.webkitRequestAnimationFrame;if(t(b))return b;b=a.mozRequestAnimationFrame;if(t(b))return b;a=a.msRequestAnimationFrame;return t(a)?a:Uo}();function Wo(a,b){return a.cljsMountOrder-b.cljsMountOrder}if("undefined"===typeof Xo)var Xo=function(){return null};function Yo(a){this.Yd=a}
+function Zo(a,b){var c=a[b];if(null==c)return null;a[b]=null;for(var d=c.length,e=0;;)if(e<d){var f=c[e];f.B?f.B():f.call(null);e+=1}else return null}function $o(a){if(a.Yd)return null;a.Yd=!0;a=function(a){return function(){a.Yd=!1;return ap(a)}}(a);return Vo.h?Vo.h(a):Vo.call(null,a)}
+function ap(a){Zo(a,"beforeFlush");Xo();var b=a.componentQueue;if(null!=b)a:{a.componentQueue=null,b.sort(Wo);for(var c=b.length,d=0;;)if(d<c){var e=b[d];!0===e.cljsIsDirty&&e.forceUpdate();d+=1}else break a}return Zo(a,"afterRender")}Yo.prototype.enqueue=function(a,b){null==this[a]&&(this[a]=[]);this[a].push(b);return $o(this)};if("undefined"===typeof bp)var bp=new Yo(!1);function cp(a){if(t(a.cljsIsDirty))return null;a.cljsIsDirty=!0;return bp.enqueue("componentQueue",a)};var dp;if("undefined"===typeof ep)var ep=!1;if("undefined"===typeof fp)var fp=0;if("undefined"===typeof gp)var gp=dg.h(0);
+function hp(a,b){b.captured=null;a:{var c=dp;dp=b;try{var d=a.B?a.B():a.call(null);break a}finally{dp=c}d=void 0}var e=b.captured;b.rc=!1;a:{c=b.Nc;var f=null==e?0:e.length,h=f===(null==c?0:c.length);if(h)for(h=0;;){var k=h===f;if(k){c=k;break a}if(e[h]===c[h])h+=1;else{c=!1;break a}}else c=h}if(!c)a:{c=yi(e);f=yi(b.Nc);b.Nc=e;e=E(xo.c(c,f));h=null;for(var l=k=0;;)if(l<k){var p=h.$(null,l);Mc(p,b,ip);l+=1}else if(e=E(e))h=e,Ae(h)?(e=Wc(h),l=Xc(h),h=e,k=H(e),e=l):(e=y(h),Mc(e,b,ip),e=z(h),h=null,k=
+0),l=0;else break;c=E(xo.c(f,c));f=null;for(k=h=0;;)if(k<h)e=f.$(null,k),Nc(e,b),k+=1;else if(c=E(c))f=c,Ae(f)?(c=Wc(f),h=Xc(f),f=c,e=H(c),c=h,h=e):(e=y(f),Nc(e,b),c=z(f),f=null,h=0),k=0;else break a}return d}function jp(a){var b=dp;if(null!=b){var c=b.captured;null==c?b.captured=[a]:c.push(a)}}function kp(a,b){ep&&gg.l(gp,Xe,H(b)-H(a));return b}function lp(a,b,c){var d=a.gb;a.gb=kp(d,K.l(d,b,c));return a.Ce=null}function mp(a,b){var c=a.gb;a.gb=kp(c,le.c(c,b));return a.Ce=null}
+function np(a,b,c){var d=a.Ce;d=null==d?a.Ce=Ue(function(){return function(a,b,c){a.push(b);a.push(c);return a}}(d),[],a.gb):d;for(var e=d.length,f=0;;)if(f<e){var h=d[f],k=d[f+1];k.M?k.M(h,a,b,c):k.call(null,h,a,b,c);f=2+f}else return null}function op(a,b,c,d){Jc(b,["#\x3c",v.h(d)," "].join(""));a:{d=dp;dp=null;try{var e=B(a);break a}finally{dp=d}e=void 0}Qi(e,b,c);return Jc(b,"\x3e")}if("undefined"===typeof pp)var pp=null;
+function qp(){for(;;){var a=pp;if(null==a)return null;pp=null;for(var b=a.length,c=0;;)if(c<b){var d=a[c];d.rc&&null!=d.Nc&&rp(d,!0);c+=1}else break}}Xo=qp;function sp(a,b,c,d){this.state=a;this.meta=b;this.df=c;this.gb=d;this.m=2153938944;this.J=114690}g=sp.prototype;g.R=function(a,b,c){return op(this,b,c,"Atom:")};g.P=function(){return this.meta};g.U=function(){return ja(this)};g.K=function(a,b){return this===b};g.Gb=function(a,b){var c=this.state;this.state=b;null!=this.gb&&np(this,c,b);return b};
+g.je=function(a,b){return this.Gb(null,b.h?b.h(this.state):b.call(null,this.state))};g.ke=function(a,b,c){return this.Gb(null,b.c?b.c(this.state,c):b.call(null,this.state,c))};g.le=function(a,b,c,d){return this.Gb(null,b.l?b.l(this.state,c,d):b.call(null,this.state,c,d))};g.me=function(a,b,c,d,e){return this.Gb(null,Af(b,this.state,c,d,e))};g.Kd=function(a,b,c){return np(this,b,c)};g.Jd=function(a,b,c){return lp(this,b,c)};g.Ld=function(a,b){return mp(this,b)};g.pc=function(){jp(this);return this.state};
+var tp=function tp(a){switch(arguments.length){case 1:return tp.h(arguments[0]);default:for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;return tp.A(arguments[0],new Jb(c.slice(1),0,null))}};tp.h=function(a){return new sp(a,null,null,null)};tp.A=function(a,b){var c=null!=b&&(b.m&64||q===b.G)?P(U,b):b,d=D.c(c,rb);c=D.c(c,eg);return new sp(a,d,c,null)};tp.N=function(a){var b=y(a);a=z(a);return tp.A(b,a)};tp.L=1;
+var up=function up(a){if(null!=a&&null!=a.we)return a.we();var c=up[n(null==a?null:a)];if(null!=c)return c.h?c.h(a):c.call(null,a);c=up._;if(null!=c)return c.h?c.h(a):c.call(null,a);throw Cb("IDisposable.dispose!",a);};function ip(a,b,c,d){c===d||a.rc?a=null:null==a.Sb?(a.rc=!0,null==pp&&(pp=[],!1===bp.Yd&&$o(bp)),a=pp.push(a)):a=!0===a.Sb?rp(a,!1):a.Sb.h?a.Sb.h(a):a.Sb.call(null,a);return a}
+function vp(a,b,c,d,e,f,h,k){this.Cb=a;this.state=b;this.rc=c;this.We=d;this.Nc=e;this.gb=f;this.Sb=h;this.ee=k;this.m=2153807872;this.J=114690}function wp(a){var b=dp;dp=null;try{return a.pc(null)}finally{dp=b}}function rp(a,b){var c=a.state;if(t(b)){var d=a.Cb;try{a.ee=null;var e=hp(d,a)}catch(f){e=f,a.state=e,a.ee=e,e=a.rc=!1}}else e=hp(a.Cb,a);a.We||(a.state=e,null==a.gb||G.c(c,e)||np(a,c,e));return e}
+function xp(a,b){var c=null!=b&&(b.m&64||q===b.G)?P(U,b):b,d=D.c(c,Rm),e=D.c(c,Tj),f=D.c(c,on);c=D.c(c,xm);null!=d&&(a.Sb=d);null!=e&&(a.Jf=e);null!=f&&(a.Ze=f);null!=c&&(a.We=c)}g=vp.prototype;g.R=function(a,b,c){return op(this,b,c,["Reaction ",v.h(od(this)),":"].join(""))};g.U=function(){return ja(this)};g.K=function(a,b){return this===b};
+g.we=function(){var a=this.state,b=this.Nc;this.Sb=this.state=this.Nc=null;this.rc=!0;b=E(yi(b));for(var c=null,d=0,e=0;;)if(e<d){var f=c.$(null,e);Nc(f,this);e+=1}else if(b=E(b))c=b,Ae(c)?(b=Wc(c),e=Xc(c),c=b,d=H(b),b=e):(b=y(c),Nc(b,this),b=z(c),c=null,d=0),e=0;else break;null!=this.Ze&&this.Ze(a);a=this.bg;if(null==a)return null;b=a.length;for(c=0;;)if(c<b)d=a[c],d.h?d.h(this):d.call(null,this),c+=1;else return null};g.Gb=function(a,b){var c=this.state;this.state=b;this.Jf(c,b);np(this,c,b);return b};
+g.je=function(a,b){var c=this;return c.Gb(null,function(){var a=wp(c);return b.h?b.h(a):b.call(null,a)}())};g.ke=function(a,b,c){var d=this;return d.Gb(null,function(){var a=wp(d);return b.c?b.c(a,c):b.call(null,a,c)}())};g.le=function(a,b,c,d){var e=this;return e.Gb(null,function(){var a=wp(e);return b.l?b.l(a,c,d):b.call(null,a,c,d)}())};g.me=function(a,b,c,d,e){return this.Gb(null,Af(b,wp(this),c,d,e))};g.Kd=function(a,b,c){return np(this,b,c)};g.Jd=function(a,b,c){return lp(this,b,c)};
+g.Ld=function(a,b){var c=te(this.gb);mp(this,b);return!c&&te(this.gb)&&null==this.Sb?this.we():null};g.pc=function(){var a=this.ee;if(null!=a)throw a;(a=null==dp)&&qp();a&&null==this.Sb?this.rc&&(a=this.state,this.state=this.Cb.B?this.Cb.B():this.Cb.call(null),null==this.gb||G.c(a,this.state)||np(this,a,this.state)):(jp(this),this.rc&&rp(this,!1));return this.state};
+function yp(a){for(var b=[],c=arguments.length,d=0;;)if(d<c)b.push(arguments[d]),d+=1;else break;c=arguments[0];b=1<b.length?new Jb(b.slice(1),0,null):null;var e=null!=b&&(b.m&64||q===b.G)?P(U,b):b;b=D.c(e,Rm);d=D.c(e,Tj);e=D.c(e,on);c=new vp(c,null,!0,!1,null,null,null,null);xp(c,new r(null,3,[Rm,b,Tj,d,on,e],null));return c}var zp=yp(null);
+function Ap(a,b){var c=Bp,d=zp,e=hp(a,d);null!=d.Nc&&(zp=yp(null),xp(d,c),d.Cb=a,d.Sb=function(){return function(){return cp.h?cp.h(b):cp.call(null,b)}}(d,e),b.cljsRatom=d);return e};var Cp;function Dp(a,b){var c=b.argv;if(null==c){c=T;var d=a.constructor;a:for(var e=Ea(b),f=e.length,h=Ef,k=0;;)if(k<f){var l=e[k];h=K.l(h,hf.h(l),b[l]);k+=1}else break a;c=new R(null,2,5,c,[d,h],null)}return c}function Ep(a){var b;if(b=me(a))a=null==a?null:a.prototype,b=null!=(null==a?null:a.reagentRender);return b}if("undefined"===typeof Fp)var Fp=null;
+function Gp(a){for(;;){var b=a.reagentRender,c=!0===a.cljsLegacyRender?b.call(a,a):function(){var c=Dp(a,a.props);switch(H(c)){case 1:return b.call(a);case 2:return b.call(a,Vd(c,1));case 3:return b.call(a,Vd(c,1),Vd(c,2));case 4:return b.call(a,Vd(c,1),Vd(c,2),Vd(c,3));case 5:return b.call(a,Vd(c,1),Vd(c,2),Vd(c,3),Vd(c,4));default:return b.apply(a,Lb(c).slice(1))}}();if(ze(c))return Fp.h?Fp.h(c):Fp.call(null,c);if(Fe(c))c=Ep(c)?function(a,b,c,h){return function(){function a(a){var c=null;if(0<arguments.length){c=
+0;for(var d=Array(arguments.length-0);c<d.length;)d[c]=arguments[c+0],++c;c=new Jb(d,0,null)}return b.call(this,c)}function b(a){a=Kb(Xg,h,a);return Fp.h?Fp.h(a):Fp.call(null,a)}a.L=0;a.N=function(a){a=E(a);return b(a)};a.A=b;return a}()}(a,b,null,c):c,a.reagentRender=c;else return c}}
+var Bp=new r(null,1,[xm,!0],null),Hp=new r(null,1,[zm,function(){var a=this.cljsRatom;this.cljsIsDirty=!1;return null==a?Ap(function(a,c){return function(){a:{var a=Cp;Cp=c;try{var b=Gp(c);break a}finally{Cp=a}b=void 0}return b}}(a,this),this):rp(a,!1)}],null);
+function Ip(a,b){var c=a instanceof L?a.ea:null;switch(c){case "getDefaultProps":throw Error("getDefaultProps not supported");case "getInitialState":return function(){return function(){var a=this.cljsState;a=null!=a?a:this.cljsState=tp.h(null);return fg(a,b.call(this,this))}}(a,c);case "componentWillReceiveProps":return function(){return function(a){return b.call(this,this,Dp(this,a))}}(a,c);case "shouldComponentUpdate":return function(){return function(a){var c=So;if(c)return c;c=this.props.argv;
+var d=a.argv,h=null==c||null==d;return null==b?h||!G.c(c,d):h?b.call(this,this,Dp(this,this.props),Dp(this,a)):b.call(this,this,c,d)}}(a,c);case "componentWillUpdate":return function(){return function(a){return b.call(this,this,Dp(this,a))}}(a,c);case "componentDidUpdate":return function(){return function(a){return b.call(this,this,Dp(this,a))}}(a,c);case "componentWillMount":return function(){return function(){this.cljsMountOrder=To+=1;return null==b?null:b.call(this,this)}}(a,c);case "componentDidMount":return function(){return function(){return b.call(this,
+this)}}(a,c);case "componentWillUnmount":return function(){return function(){var a=this.cljsRatom;null!=a&&up(a);this.cljsIsDirty=!1;return null==b?null:b.call(this,this)}}(a,c);default:return null}}function Jp(a,b){var c=Ip(a,b);return t(c)?c:b}var Kp=new r(null,3,[dm,null,eo,null,Kl,null],null),Lp=function(a){return function(b){return function(c){var d=D.c(B(b),c);if(null!=d)return d;d=a.h?a.h(c):a.call(null,c);gg.M(b,K,c,d);return d}}(dg.h(Ef))}(Qo);
+function Mp(a){return Ue(function(a,c,d){return K.l(a,hf.h(Lp.h?Lp.h(c):Lp.call(null,c)),d)},Ef,a)}function Np(a){var b=function(){var b=pm.h(a);return t(b)?b:wn.h(a)}(),c=null==b,d=t(b)?b:zm.h(a),e=""+v.h(function(){var b=Bk.h(a);return t(b)?b:Ro(d)}());a:switch(e){case "":var f=""+v.h(Zi());break a;default:f=e}b=Ue(function(){return function(a,b,c){return K.l(a,b,Jp(b,c))}}(b,c,d,e,f),Ef,a);return K.A(b,Bk,f,be([Pn,!1,bk,c,pm,d,zm,zm.h(Hp)]))}
+function Op(a){return Ue(function(a,c,d){a[jf(c)]=d;return a},{},a)}function Pp(a){a=Op(Np(hi.A(be([Kp,Mp(a)]))));return Ko.h?Ko.h(a):Ko.call(null,a)};var Qp=/([^\s\.#]+)(?:#([^\s\.#]+))?(?:\.([^\s#]+))?/;function Rp(a){return a instanceof L||a instanceof rd}var Sp={"class":"className","for":"htmlFor",charset:"charSet"};function Tp(a,b,c){if(Rp(b)){var d=jf(b);d=Sp.hasOwnProperty(d)?Sp[d]:null;b=null==d?Sp[jf(b)]=Qo(b):d}a[b]=Up.h?Up.h(c):Up.call(null,c);return a}
+function Up(a){return"object"!==n(a)?a:Rp(a)?jf(a):xe(a)?Ue(Tp,{},a):ue(a)?cj(a):Fe(a)?function(){function b(a){var b=null;if(0<arguments.length){b=0;for(var d=Array(arguments.length-0);b<d.length;)d[b]=arguments[b+0],++b;b=new Jb(d,0,null)}return c.call(this,b)}function c(b){return P(a,b)}b.L=0;b.N=function(a){a=E(a);return c(a)};b.A=c;return b}():cj(a)}function Vp(a,b,c){a=null==a?{}:a;a[b]=c;return a}if("undefined"===typeof Wp)var Wp=null;
+var Xp=new ti(null,new r(null,6,["url",null,"tel",null,"text",null,"textarea",null,"password",null,"search",null],null),null),Yp=function Yp(a){if(t(a.cljsInputLive)){a.cljsInputDirty=!1;var c=a.cljsRenderedValue,d=a.cljsDOMValue,e=Wp.h?Wp.h(a):Wp.call(null,a);if(!G.c(c,d)){if(e===document.activeElement&&He(Xp,e.type)&&"string"===typeof c&&"string"===typeof d){var f=e.value;if(!G.c(f,d))return bp.enqueue("afterRender",function(){return function(){return Yp.h?Yp.h(a):Yp.call(null,a)}}(f,c,d,e));d=
+H(f)-e.selectionStart;d=H(c)-d;a.cljsDOMValue=c;e.value=c;e.selectionStart=d;return e.selectionEnd=d}a.cljsDOMValue=c;return e.value=c}}return null};function Zp(a,b,c){a.cljsDOMValue=c.target.value;t(a.cljsInputDirty)||(a.cljsInputDirty=!0,bp.enqueue("afterRender",function(){return Yp(a)}));return b.h?b.h(c):b.call(null,c)}
+function $p(a){var b=Cp;if(t(function(){var b=null!=a;return b?(b=a.hasOwnProperty("onChange"),t(b)?a.hasOwnProperty("value"):b):b}())){var c=a.value,d=null==c?"":c,e=a.onChange;t(b.cljsInputLive)||(b.cljsInputLive=!0,b.cljsDOMValue=d);b.cljsRenderedValue=d;delete a.value;a.defaultValue=d;a.onChange=function(a,c,d,e){return function(a){return Zp(b,e,a)}}(a,c,d,e)}}
+var aq=null,cq=new r(null,4,[ln,"ReagentInput",nl,Yp,Wm,function(a){return a.cljsInputLive=null},Dm,function(a,b,c,d){$p(c);return bq.M?bq.M(a,b,c,d):bq.call(null,a,b,c,d)}],null);function dq(a){if(xe(a))try{var b=D.c(a,mk)}catch(c){b=null}else b=null;return b}var eq={};
+function fq(a,b,c){var d=a.name,e=J(b,c,null),f=null==e||xe(e);e=Up(f?e:null);var h=a.id;e=null!=h&&null==(null==e?null:e.id)?Vp(e,"id",h):e;a=a.className;null==a?a=e:(h=null==e?null:e.className,a=Vp(e,"className",null==h?a:[v.h(a)," ",v.h(h)].join("")));c+=f?1:0;a:switch(d){case "input":case "textarea":f=!0;break a;default:f=!1}if(f)return f=T,null==aq&&(aq=Pp(cq)),b=pe(new R(null,5,5,f,[aq,b,d,a,c],null),qe(b)),gq.h?gq.h(b):gq.call(null,b);f=dq(qe(b));f=null==f?a:Vp(a,"key",f);return bq.M?bq.M(b,
+d,f,c):bq.call(null,b,d,f,c)}
+function hq(a){for(;;){var b=J(a,0,null);if(Rp(b)||"string"===typeof b){b=jf(b);var c=b.indexOf("\x3e");switch(c){case -1:c=b;b=eq;var d=c;b=b.hasOwnProperty(d)?b[d]:null;if(null==b){b=c;var e=z(Ji(Qp,jf(c)));c=J(e,0,null);d=J(e,1,null);e=J(e,2,null);e=null==e?null:Do(e,/\./," ");b=eq[b]={name:c,id:d,className:e}}return fq(b,a,1);case 0:return b=J(a,1,null),fq({name:b},a,2);default:a=new R(null,2,5,T,[b.substring(0,c),K.l(a,0,b.substring(c+1))],null)}}else return c=b.cljsReactClass,null==c?Ep(b)?
+b=b.cljsReactClass=b:(c=qe(b),c=K.l(c,Dm,b),c=Pp(c),b=b.cljsReactClass=c):b=c,c={argv:a},d=dq(qe(a)),a=null==d?dq(J(a,1,null)):d,null!=a&&(c.key=a),Go.createElement(b,c)}}function gq(a){return"object"!==n(a)?a:ze(a)?hq(a):De(a)?iq.h?iq.h(a):iq.call(null,a):Rp(a)?jf(a):(null!=a?a.m&2147483648||q===a.ma||(a.m?0:Ab(Kc,a)):Ab(Kc,a))?Vi(be([a])):a}Fp=gq;function iq(a){a=Lb(a);for(var b=a.length,c=0;;)if(c<b)a[c]=gq(a[c]),c+=1;else break;return a}
+function bq(a,b,c,d){var e=H(a)-d;switch(e){case 0:return Go.createElement(b,c);case 1:return Go.createElement(b,c,gq(J(a,d,null)));default:return Go.createElement.apply(null,Ue(function(){return function(a,b,c){b>=d&&a.push(gq(c));return a}}(e),[b,c],a))}};if("undefined"===typeof jq)var jq=null;function kq(){if(null!=jq)return jq;if("undefined"!==typeof ReactDOM)return jq=ReactDOM;if("undefined"!==typeof require){var a=jq=require("react-dom");if(t(a))return a;throw Error("require('react-dom') failed");}throw Error("js/ReactDOM is missing");}if("undefined"===typeof lq)var lq=dg.h(Ef);
+function mq(a,b,c){var d=So;So=!0;try{return kq().render(a.B?a.B():a.call(null),b,function(){return function(){var d=So;So=!1;try{return gg.M(lq,K,b,new R(null,2,5,T,[a,b],null)),Zo(bp,"afterRender"),null!=c?c.B?c.B():c.call(null):null}finally{So=d}}}(d))}finally{So=d}}function nq(a,b){return mq(a,b,null)}function oq(a,b,c){qp();return mq(function(){return gq(me(a)?a.B?a.B():a.call(null):a)},b,c)}Wp=function(a){return kq().findDOMNode(a)};function pq(a){switch(arguments.length){case 2:return oq(arguments[0],arguments[1],null);case 3:return oq(arguments[0],arguments[1],arguments[2]);default:throw Error(["Invalid arity: ",v.h(arguments.length)].join(""));}}function qq(a,b){return oq(a,b,null)}
+da("reagent.core.force_update_all",function(){qp();qp();for(var a=E(mh(B(lq))),b=null,c=0,d=0;;)if(d<c){var e=b.$(null,d);P(nq,e);d+=1}else if(a=E(a))b=a,Ae(b)?(a=Wc(b),d=Xc(b),b=a,c=H(a),a=d):(a=y(b),P(nq,a),a=z(b),b=null,c=0),d=0;else break;return Zo(bp,"afterRender")});var rq=yi(df(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,25,28,29,30,31)),sq=ke([yi(df(24,26,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,145,146,147,148,149,150,151,153,154)),new r(null,2,[qn,xl,yk,uk],null),yi(df(156)),new r(null,1,[yk,uk],null),yi(df(27)),new r(null,1,[yk,Gj],null),yi(df(152,158,159)),new r(null,1,[yk,ll],null),yi(df(144)),new r(null,1,[yk,ql],null),yi(df(157)),new r(null,1,[yk,Rk],null),yi(df(155)),new r(null,1,[yk,Hl],null)]),tq=Pe([Ej,Gj,
+uk,Fk,Jk,Qk,Rk,ll,ql,Hl,jm,om,Cm,$n],[ke([rq,new r(null,1,[qn,Ul],null),yi(df(32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47)),new r(null,2,[qn,Fm,yk,Qk],null),yi(df(48,49,50,51,52,53,54,55,56,57,59)),new r(null,1,[qn,Xl],null),yi(df(58,60,61,62,63)),new r(null,1,[yk,$n],null),yi(df(64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126)),
+new r(null,1,[yk,Fk],null),yi(df(127)),new r(null,1,[qn,Ul],null)]),Pe([Sk,yi(df(88,94,95)),rq,yi(df(91)),yi(df(80)),yi(df(32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47)),yi(df(127)),yi(df(48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,81,82,83,84,85,86,87,89,90,92,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126)),yi(df(93))],[po,new r(null,1,[yk,ll],null),new r(null,1,[qn,xl],
+null),new r(null,1,[yk,Hl],null),new r(null,1,[yk,ql],null),new r(null,2,[qn,Fm,yk,jm],null),new r(null,1,[qn,Ul],null),new r(null,2,[qn,Pj,yk,uk],null),new r(null,1,[yk,Rk],null)]),ke([rq,new r(null,1,[qn,xl],null),yi(df(32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,
+119,120,121,122,123,124,125,126,127,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255)),new r(null,1,[qn,Pl],null)]),ke([Sk,zj,rq,new r(null,1,[qn,Fn],null),yi(df(32,33,
+34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126)),new r(null,1,[qn,Fn],null),yi(df(127)),new r(null,1,[qn,Ul],null),El,In]),ke([rq,new r(null,1,[qn,xl],null),yi(df(48,49,50,51,52,53,54,55,56,57,59)),new r(null,1,[qn,Xl],null),yi(df(58,60,61,62,
+63)),new r(null,1,[yk,Cm],null),yi(df(32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47)),new r(null,2,[qn,Fm,yk,om],null),yi(df(64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126)),new r(null,2,[qn,Rl,yk,uk],null),yi(df(127)),new r(null,1,[qn,Ul],null)]),ke([rq,new r(null,1,[qn,Ul],null),yi(df(32,33,34,35,36,37,38,39,40,41,42,43,44,45,
+46,47)),new r(null,1,[qn,Fm],null),yi(df(48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63)),new r(null,1,[yk,$n],null),yi(df(64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126)),new r(null,1,[yk,Fk],null),yi(df(127)),new r(null,1,[qn,Ul],null)]),ke([Sk,um,re.c(rq,7),new r(null,1,[qn,Ul],null),yi(df(32,33,34,35,36,37,38,39,40,41,42,43,44,
+45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127)),new r(null,1,[qn,ak],null),yi(df(7)),new r(null,1,[yk,uk],null),El,Wj]),ke([rq,new r(null,1,[qn,Ul],null),yi(df(32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,
+69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127)),new r(null,1,[qn,Ul],null)]),ke([Sk,po,rq,new r(null,1,[qn,Ul],null),yi(df(32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47)),new r(null,2,[qn,Fm,yk,Qk],null),yi(df(58)),new r(null,1,[yk,$n],null),yi(df(48,49,50,51,52,53,54,55,56,57,59)),new r(null,2,[qn,Xl,yk,Ej],null),yi(df(60,61,62,63)),new r(null,
+2,[qn,Fm,yk,Ej],null),yi(df(64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126)),new r(null,1,[yk,Fk],null),yi(df(127)),new r(null,1,[qn,Ul],null)]),ke([Sk,po,rq,new r(null,1,[qn,xl],null),yi(df(64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,
+109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126)),new r(null,2,[qn,Rl,yk,uk],null),yi(df(48,49,50,51,52,53,54,55,56,57,59)),new r(null,2,[qn,Xl,yk,Jk],null),yi(df(60,61,62,63)),new r(null,2,[qn,Fm,yk,Jk],null),yi(df(58)),new r(null,1,[yk,Cm],null),yi(df(32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47)),new r(null,2,[qn,Fm,yk,om],null),yi(df(127)),new r(null,1,[qn,Ul],null)]),ke([rq,new r(null,1,[qn,xl],null),yi(df(32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47)),new r(null,
+1,[qn,Fm],null),yi(df(48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126)),new r(null,2,[qn,Pj,yk,uk],null),yi(df(127)),new r(null,1,[qn,Ul],null)]),ke([rq,new r(null,1,[qn,xl],null),yi(df(32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47)),new r(null,1,[qn,Fm],null),yi(df(64,65,66,67,68,69,
+70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126)),new r(null,2,[qn,Rl,yk,uk],null),yi(df(48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63)),new r(null,1,[yk,Cm],null),yi(df(127)),new r(null,1,[qn,Ul],null)]),ke([rq,new r(null,1,[qn,xl],null),yi(df(32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63)),new r(null,
+1,[qn,Ul],null),yi(df(64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126)),new r(null,1,[yk,uk],null),yi(df(127)),new r(null,1,[qn,Ul],null)]),ke([rq,new r(null,1,[qn,Ul],null),yi(df(32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,
+83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127)),new r(null,1,[qn,Ul],null)])]);function uq(a,b){return Wf(function(a){var c=J(a,0,null);a=J(a,1,null);return t(c.h?c.h(b):c.call(null,b))?a:null},a)}
+function vq(a,b){var c=D.c(tq,a),d=uq(sq,b);var e=t(d)?d:uq(c,160<=b?65:b);d=qn.h(e);e=yk.h(e);if(t(e)){var f=D.c(tq,e);c=El.h(c);f=Sk.h(f);d=Wg(vg(ub,new R(null,3,5,T,[c,d,f],null)));return new R(null,2,5,T,[e,d],null)}return new R(null,2,5,T,[a,t(d)?new R(null,1,5,T,[d],null):he],null)}
+var xq=P(hi,function wq(a){return new kf(null,function(){for(;;){var c=E(a);if(c){if(Ae(c)){var d=Wc(c),e=H(d),f=of(e);a:for(var h=0;;)if(h<e){var k=A.c(d,h);k=ke([k,xg(ag.c(vq,k),Fi(0,160,1))]);f.add(k);h+=1}else{d=!0;break a}return d?qf(f.Da(),wq(Xc(c))):qf(f.Da(),null)}f=y(c);return ae(ke([f,xg(ag.c(vq,f),Fi(0,160,1))]),wq(vd(c)))}return null}},null,null)}(lh(tq)));function yq(a,b){var c=Array.prototype.slice.call(arguments),d=c.shift();if("undefined"==typeof d)throw Error("[goog.string.format] Template required");return d.replace(/%([0\-\ \+]*)(\d+)?(\.(\d+))?([%sfdiu])/g,function(a,b,d,k,l,p,m,u){if("%"==p)return"%";var e=c.shift();if("undefined"==typeof e)throw Error("[goog.string.format] Not enough arguments");arguments[0]=e;return yq.fc[p].apply(null,arguments)})}yq.fc={};
+yq.fc.s=function(a,b,c){return isNaN(c)||""==c||a.length>=Number(c)?a:a=-1<b.indexOf("-",0)?a+sa(" ",Number(c)-a.length):sa(" ",Number(c)-a.length)+a};
+yq.fc.f=function(a,b,c,d,e){d=a.toString();isNaN(e)||""==e||(d=parseFloat(a).toFixed(e));var f=0>Number(a)?"-":0<=b.indexOf("+")?"+":0<=b.indexOf(" ")?" ":"";0<=Number(a)&&(d=f+d);if(isNaN(c)||d.length>=Number(c))return d;d=isNaN(e)?Math.abs(Number(a)).toString():Math.abs(Number(a)).toFixed(e);a=Number(c)-d.length-f.length;0<=b.indexOf("-",0)?d=f+d+sa(" ",a):(b=0<=b.indexOf("0",0)?"0":" ",d=f+sa(b,a)+d);return d};yq.fc.d=function(a,b,c,d,e,f,h,k){return yq.fc.f(parseInt(a,10),b,c,d,0,f,h,k)};
+yq.fc.i=yq.fc.d;yq.fc.u=yq.fc.d;function zq(a){var b=be([Vk,null]);return wg.c(t(a)?a:Ef,function(){return function e(a){return new kf(null,function(){for(var b=a;;)if(b=E(b)){if(Ae(b)){var d=Wc(b),k=H(d),l=of(k);a:for(var p=0;;)if(p<k){var m=A.c(d,p),u=J(m,0,null);m=J(m,1,null);t(m)&&l.add(new R(null,2,5,T,[u,m],null));p+=1}else{d=!0;break a}return d?qf(l.Da(),e(Xc(b))):qf(l.Da(),null)}d=y(b);l=J(d,0,null);d=J(d,1,null);if(t(d))return ae(new R(null,2,5,T,[l,d],null),e(vd(b)));b=vd(b)}else return null},null,null)}(yg(2,2,b))}())}
+function Aq(a){for(var b=[],c=arguments.length,d=0;;)if(d<c)b.push(arguments[d]),d+=1;else break;return Bq(arguments[0],1<b.length?new Jb(b.slice(1),0,null):null)}function Bq(a,b){return Kb(yq,a,b)}dg.h(19);function Cq(a){return Mb(function(a,c){var b=J(c,0,null),e=J(c,1,null);return Do(a,e,""+v.h(b))},a,Oe(function(a){return-H(ee(a))}))}
+function Dq(a){a=""+v.h(a);var b=/function ([^\(]*)\(/;if("string"===typeof a)a=b.exec(a),a=null==a?null:1===H(a)?y(a):Wg(a);else throw new TypeError("re-find must match against a string.");a=Bf(ee(a));return Cq(t(a)?a:"function")}function Eq(a,b){a.schema$utils$schema=b}dg.h(!1);var Fq,Gq=function Gq(a){if(null!=a&&null!=a.xb)return a.xb(a);var c=Gq[n(null==a?null:a)];if(null!=c)return c.h?c.h(a):c.call(null,a);c=Gq._;if(null!=c)return c.h?c.h(a):c.call(null,a);throw Cb("Schema.explain",a);};
+Gq["function"]=function(a){var b=a.schema$utils$schema;return t(b)?Gq(b):t(G.c?G.c(null,a):G.call(null,null,a))?Wl:t(G.c?G.c(Boolean,a):G.call(null,Boolean,a))?xk:t(G.c?G.c(Number,a):G.call(null,Number,a))?sl:t(G.c?G.c(null,a):G.call(null,null,a))?Cl:t(G.c?G.c(Date,a):G.call(null,Date,a))?Ll:t(G.c?G.c(yj,a):G.call(null,yj,a))?ym:a};function Hq(a,b,c,d){this.nc=a;this.v=b;this.j=c;this.w=d;this.m=2229667594;this.J=139264}g=Hq.prototype;g.V=function(a,b){return this.I(null,b,null)};
+g.I=function(a,b,c){switch(b instanceof L?b.ea:null){case "_":return this.nc;default:return D.l(this.j,b,c)}};g.R=function(a,b,c){return Y(b,function(){return function(a){return Y(b,Qi,""," ","",c,a)}}(this),"#schema.core.AnythingSchema{",", ","}",c,O.c(new R(null,1,5,T,[new R(null,2,5,T,[Ck,this.nc],null)],null),this.j))};g.ba=function(){return new fh(0,this,1,new R(null,1,5,T,[Ck],null),t(this.j)?dd(this.j):Cf())};g.P=function(){return this.v};g.W=function(){return 1+H(this.j)};
+g.U=function(){var a=this,b=this.w;if(null!=b)return b;var c=function(){return function(){return function(a){return-1432036169^Dd(a)}}(b,a)(a)}();return this.w=c};g.K=function(a,b){return null!=b&&this.constructor===b.constructor&&G.c(this.nc,b.nc)&&G.c(this.j,b.j)};g.ga=function(a,b){return He(new ti(null,new r(null,1,[Ck,null],null),null),b)?le.c(tc(wg.c(Ef,this),this.v),b):new Hq(this.nc,this.v,Bf(le.c(this.j,b)),null)};
+g.O=function(a,b,c){return t(N.c?N.c(Ck,b):N.call(null,Ck,b))?new Hq(c,this.v,this.j,null):new Hq(this.nc,this.v,K.l(this.j,b,c),null)};g.S=function(){return E(O.c(new R(null,1,5,T,[new R(null,2,5,T,[Ck,this.nc],null)],null),this.j))};g.T=function(a,b){return new Hq(this.nc,b,this.j,this.w)};g.X=function(a,b){return ze(b)?this.O(null,A.c(b,0),A.c(b,1)):Mb(Tb,this,b)};g.xb=function(){return Al};var Iq=new Hq(null,null,null,null);
+function Jq(a,b,c,d,e){this.wb=a;this.Xb=b;this.v=c;this.j=d;this.w=e;this.m=2229667594;this.J=139264}g=Jq.prototype;g.V=function(a,b){return this.I(null,b,null)};g.I=function(a,b,c){switch(b instanceof L?b.ea:null){case "p?":return this.wb;case "pred-name":return this.Xb;default:return D.l(this.j,b,c)}};
+g.R=function(a,b,c){return Y(b,function(){return function(a){return Y(b,Qi,""," ","",c,a)}}(this),"#schema.core.Predicate{",", ","}",c,O.c(new R(null,2,5,T,[new R(null,2,5,T,[Un,this.wb],null),new R(null,2,5,T,[Tm,this.Xb],null)],null),this.j))};g.ba=function(){return new fh(0,this,2,new R(null,2,5,T,[Un,Tm],null),t(this.j)?dd(this.j):Cf())};g.P=function(){return this.v};g.W=function(){return 2+H(this.j)};
+g.U=function(){var a=this,b=this.w;if(null!=b)return b;var c=function(){return function(){return function(a){return 2041221968^Dd(a)}}(b,a)(a)}();return this.w=c};g.K=function(a,b){return null!=b&&this.constructor===b.constructor&&G.c(this.wb,b.wb)&&G.c(this.Xb,b.Xb)&&G.c(this.j,b.j)};g.ga=function(a,b){return He(new ti(null,new r(null,2,[Tm,null,Un,null],null),null),b)?le.c(tc(wg.c(Ef,this),this.v),b):new Jq(this.wb,this.Xb,this.v,Bf(le.c(this.j,b)),null)};
+g.O=function(a,b,c){return t(N.c?N.c(Un,b):N.call(null,Un,b))?new Jq(c,this.Xb,this.v,this.j,null):t(N.c?N.c(Tm,b):N.call(null,Tm,b))?new Jq(this.wb,c,this.v,this.j,null):new Jq(this.wb,this.Xb,this.v,K.l(this.j,b,c),null)};g.S=function(){return E(O.c(new R(null,2,5,T,[new R(null,2,5,T,[Un,this.wb],null),new R(null,2,5,T,[Tm,this.Xb],null)],null),this.j))};g.T=function(a,b){return new Jq(this.wb,this.Xb,b,this.j,this.w)};g.X=function(a,b){return ze(b)?this.O(null,A.c(b,0),A.c(b,1)):Mb(Tb,this,b)};
+g.xb=function(){return G.c(this.wb,Ge)?bo:G.c(this.wb,gf)?kn:G.c(this.wb,qd)?hk:G.c(this.wb,yb)?Wl:Tb(Tb(wd,this.Xb),yl)};function Kq(a){var b=td.h(Dq(a));if(!Fe(a))throw Error(Bq("Not a function: %s",be([a])));return new Jq(a,b,null,null,null)}RegExp.prototype.xb=function(){return td.h(['#"',v.h((""+v.h(this)).slice(1,-1)),'"'].join(""))};var Lq=Kq(yb),Mq=Boolean,Nq=Number,Oq=Kq(Ge),Pq=Kq(gf);Kq(qd);
+"undefined"===typeof Fq&&(Fq=function(a){this.Bf=a;this.m=393216;this.J=0},Fq.prototype.T=function(a,b){return new Fq(b)},Fq.prototype.P=function(){return this.Bf},Fq.prototype.xb=function(){return Cl},Fq.Wc=function(){return new R(null,1,5,T,[bn],null)},Fq.qc=!0,Fq.Tb="schema.core/t_schema$core38849",Fq.Ec=function(a,b){return Jc(b,"schema.core/t_schema$core38849")});function Qq(a,b,c,d){this.ia=a;this.v=b;this.j=c;this.w=d;this.m=2229667594;this.J=139264}g=Qq.prototype;
+g.V=function(a,b){return this.I(null,b,null)};g.I=function(a,b,c){switch(b instanceof L?b.ea:null){case "schema":return this.ia;default:return D.l(this.j,b,c)}};g.R=function(a,b,c){return Y(b,function(){return function(a){return Y(b,Qi,""," ","",c,a)}}(this),"#schema.core.Maybe{",", ","}",c,O.c(new R(null,1,5,T,[new R(null,2,5,T,[Mj,this.ia],null)],null),this.j))};g.ba=function(){return new fh(0,this,1,new R(null,1,5,T,[Mj],null),t(this.j)?dd(this.j):Cf())};g.P=function(){return this.v};
+g.W=function(){return 1+H(this.j)};g.U=function(){var a=this,b=this.w;if(null!=b)return b;var c=function(){return function(){return function(a){return-805411239^Dd(a)}}(b,a)(a)}();return this.w=c};g.K=function(a,b){return null!=b&&this.constructor===b.constructor&&G.c(this.ia,b.ia)&&G.c(this.j,b.j)};g.ga=function(a,b){return He(new ti(null,new r(null,1,[Mj,null],null),null),b)?le.c(tc(wg.c(Ef,this),this.v),b):new Qq(this.ia,this.v,Bf(le.c(this.j,b)),null)};
+g.O=function(a,b,c){return t(N.c?N.c(Mj,b):N.call(null,Mj,b))?new Qq(c,this.v,this.j,null):new Qq(this.ia,this.v,K.l(this.j,b,c),null)};g.S=function(){return E(O.c(new R(null,1,5,T,[new R(null,2,5,T,[Mj,this.ia],null)],null),this.j))};g.T=function(a,b){return new Qq(this.ia,b,this.j,this.w)};g.X=function(a,b){return ze(b)?this.O(null,A.c(b,0),A.c(b,1)):Mb(Tb,this,b)};g.xb=function(){var a=Gq(this.ia);a=Tb(wd,a);return Tb(a,am)};
+function Rq(a,b,c,d,e){this.Yb=a;this.Hb=b;this.v=c;this.j=d;this.w=e;this.m=2229667594;this.J=139264}g=Rq.prototype;g.V=function(a,b){return this.I(null,b,null)};g.I=function(a,b,c){switch(b instanceof L?b.ea:null){case "preds-and-schemas":return this.Yb;case "error-symbol":return this.Hb;default:return D.l(this.j,b,c)}};
+g.R=function(a,b,c){return Y(b,function(){return function(a){return Y(b,Qi,""," ","",c,a)}}(this),"#schema.core.ConditionalSchema{",", ","}",c,O.c(new R(null,2,5,T,[new R(null,2,5,T,[Il,this.Yb],null),new R(null,2,5,T,[Om,this.Hb],null)],null),this.j))};g.ba=function(){return new fh(0,this,2,new R(null,2,5,T,[Il,Om],null),t(this.j)?dd(this.j):Cf())};g.P=function(){return this.v};g.W=function(){return 2+H(this.j)};
+g.U=function(){var a=this,b=this.w;if(null!=b)return b;var c=function(){return function(){return function(a){return 1418435858^Dd(a)}}(b,a)(a)}();return this.w=c};g.K=function(a,b){return null!=b&&this.constructor===b.constructor&&G.c(this.Yb,b.Yb)&&G.c(this.Hb,b.Hb)&&G.c(this.j,b.j)};g.ga=function(a,b){return He(new ti(null,new r(null,2,[Il,null,Om,null],null),null),b)?le.c(tc(wg.c(Ef,this),this.v),b):new Rq(this.Yb,this.Hb,this.v,Bf(le.c(this.j,b)),null)};
+g.O=function(a,b,c){return t(N.c?N.c(Il,b):N.call(null,Il,b))?new Rq(c,this.Hb,this.v,this.j,null):t(N.c?N.c(Om,b):N.call(null,Om,b))?new Rq(this.Yb,c,this.v,this.j,null):new Rq(this.Yb,this.Hb,this.v,K.l(this.j,b,c),null)};g.S=function(){return E(O.c(new R(null,2,5,T,[new R(null,2,5,T,[Il,this.Yb],null),new R(null,2,5,T,[Om,this.Hb],null)],null),this.j))};g.T=function(a,b){return new Rq(this.Yb,this.Hb,b,this.j,this.w)};g.X=function(a,b){return ze(b)?this.O(null,A.c(b,0),A.c(b,1)):Mb(Tb,this,b)};
+g.xb=function(){return ae(pk,O.c(sg(function(){return function(a){var b=J(a,0,null);a=J(a,1,null);return new R(null,2,5,T,[td.h(Dq(b)),Gq(a)],null)}}(this),be([this.Yb])),t(this.Hb)?new R(null,1,5,T,[this.Hb],null):null))};function Sq(a){return a instanceof L||!1}function Tq(a,b,c,d){this.k=a;this.v=b;this.j=c;this.w=d;this.m=2229667594;this.J=139264}g=Tq.prototype;g.V=function(a,b){return this.I(null,b,null)};
+g.I=function(a,b,c){switch(b instanceof L?b.ea:null){case "k":return this.k;default:return D.l(this.j,b,c)}};g.R=function(a,b,c){return Y(b,function(){return function(a){return Y(b,Qi,""," ","",c,a)}}(this),"#schema.core.OptionalKey{",", ","}",c,O.c(new R(null,1,5,T,[new R(null,2,5,T,[Yl,this.k],null)],null),this.j))};g.ba=function(){return new fh(0,this,1,new R(null,1,5,T,[Yl],null),t(this.j)?dd(this.j):Cf())};g.P=function(){return this.v};g.W=function(){return 1+H(this.j)};
+g.U=function(){var a=this,b=this.w;if(null!=b)return b;var c=function(){return function(){return function(a){return-1508333161^Dd(a)}}(b,a)(a)}();return this.w=c};g.K=function(a,b){return null!=b&&this.constructor===b.constructor&&G.c(this.k,b.k)&&G.c(this.j,b.j)};g.ga=function(a,b){return He(new ti(null,new r(null,1,[Yl,null],null),null),b)?le.c(tc(wg.c(Ef,this),this.v),b):new Tq(this.k,this.v,Bf(le.c(this.j,b)),null)};
+g.O=function(a,b,c){return t(N.c?N.c(Yl,b):N.call(null,Yl,b))?new Tq(c,this.v,this.j,null):new Tq(this.k,this.v,K.l(this.j,b,c),null)};g.S=function(){return E(O.c(new R(null,1,5,T,[new R(null,2,5,T,[Yl,this.k],null)],null),this.j))};g.T=function(a,b){return new Tq(this.k,b,this.j,this.w)};g.X=function(a,b){return ze(b)?this.O(null,A.c(b,0),A.c(b,1)):Mb(Tb,this,b)};function Uq(a){return new Tq(a,null,null,null)}
+function Vq(a){var b=Sq(a);if(t(t(b)?b:a instanceof Tq)){if(a instanceof L)return a;b=t(Sq(a))?Zn:t(a instanceof Tq)?Nj:null;if(!(a instanceof L))if(t(a instanceof Tq))a=a.k;else throw Error(Bq("Bad explicit key: %s",be([a])));a=Tb(wd,a);return Tb(a,b)}return Gq(a)}
+function Wq(a){return wg.c(Ef,function(){return function d(a){return new kf(null,function(){for(;;){var c=E(a);if(c){if(Ae(c)){var f=Wc(c),h=H(f),k=of(h);a:for(var l=0;;)if(l<h){var p=A.c(f,l),m=J(p,0,null);p=J(p,1,null);m=new R(null,2,5,T,[Vq(m),Gq(p)],null);k.add(m);l+=1}else{f=!0;break a}return f?qf(k.Da(),d(Xc(c))):qf(k.Da(),null)}f=y(c);k=J(f,0,null);f=J(f,1,null);return ae(new R(null,2,5,T,[Vq(k),Gq(f)],null),d(vd(c)))}return null}},null,null)}(a)}())}r.prototype.xb=function(){return Wq(this)};
+Jh.prototype.xb=function(){return Wq(this)};ti.prototype.xb=function(){return yi(new R(null,1,5,T,[Gq(y(this))],null))};function Xq(a,b,c,d,e,f){this.ia=a;this.Fb=b;this.name=c;this.v=d;this.j=e;this.w=f;this.m=2229667594;this.J=139264}g=Xq.prototype;g.V=function(a,b){return this.I(null,b,null)};g.I=function(a,b,c){switch(b instanceof L?b.ea:null){case "schema":return this.ia;case "optional?":return this.Fb;case "name":return this.name;default:return D.l(this.j,b,c)}};
+g.R=function(a,b,c){return Y(b,function(){return function(a){return Y(b,Qi,""," ","",c,a)}}(this),"#schema.core.One{",", ","}",c,O.c(new R(null,3,5,T,[new R(null,2,5,T,[Mj,this.ia],null),new R(null,2,5,T,[nm,this.Fb],null),new R(null,2,5,T,[Tk,this.name],null)],null),this.j))};g.ba=function(){return new fh(0,this,3,new R(null,3,5,T,[Mj,nm,Tk],null),t(this.j)?dd(this.j):Cf())};g.P=function(){return this.v};g.W=function(){return 3+H(this.j)};
+g.U=function(){var a=this,b=this.w;if(null!=b)return b;var c=function(){return function(){return function(a){return-197981045^Dd(a)}}(b,a)(a)}();return this.w=c};g.K=function(a,b){return null!=b&&this.constructor===b.constructor&&G.c(this.ia,b.ia)&&G.c(this.Fb,b.Fb)&&G.c(this.name,b.name)&&G.c(this.j,b.j)};g.ga=function(a,b){return He(new ti(null,new r(null,3,[Mj,null,Tk,null,nm,null],null),null),b)?le.c(tc(wg.c(Ef,this),this.v),b):new Xq(this.ia,this.Fb,this.name,this.v,Bf(le.c(this.j,b)),null)};
+g.O=function(a,b,c){return t(N.c?N.c(Mj,b):N.call(null,Mj,b))?new Xq(c,this.Fb,this.name,this.v,this.j,null):t(N.c?N.c(nm,b):N.call(null,nm,b))?new Xq(this.ia,c,this.name,this.v,this.j,null):t(N.c?N.c(Tk,b):N.call(null,Tk,b))?new Xq(this.ia,this.Fb,c,this.v,this.j,null):new Xq(this.ia,this.Fb,this.name,this.v,K.l(this.j,b,c),null)};g.S=function(){return E(O.c(new R(null,3,5,T,[new R(null,2,5,T,[Mj,this.ia],null),new R(null,2,5,T,[nm,this.Fb],null),new R(null,2,5,T,[Tk,this.name],null)],null),this.j))};
+g.T=function(a,b){return new Xq(this.ia,this.Fb,this.name,b,this.j,this.w)};g.X=function(a,b){return ze(b)?this.O(null,A.c(b,0),A.c(b,1)):Mb(Tb,this,b)};function Yq(a,b){return new Xq(a,!1,b,null,null,null)}
+function Zq(a){var b=Gi(function(a){return a instanceof Xq&&wb(nm.h(a))},a),c=J(b,0,null),d=J(b,1,null),e=Gi(function(){return function(a){var b=a instanceof Xq;return b?nm.h(a):b}}(b,c,d),d),f=J(e,0,null),h=J(e,1,null);if(!(1>=H(h)&&Vf(function(){return function(a){return!(a instanceof Xq)}}(b,c,d,e,f,h),h)))throw Error(Bq("%s is not a valid sequence schema; %s%s%s",be([a,"a valid sequence schema consists of zero or more `one` elements, ","followed by zero or more `optional` elements, followed by an optional ",
+"schema that will match the remaining elements."])));return new R(null,2,5,T,[O.c(c,f),y(h)],null)}
+R.prototype.xb=function(){var a=this,b=Zq(a),c=J(b,0,null),d=J(b,1,null);return Wg(O.c(function(){return function(a,b,c,d){return function m(e){return new kf(null,function(){return function(){for(;;){var a=E(e);if(a){if(Ae(a)){var b=Wc(a),c=H(b),d=of(c);return function(){for(var a=0;;)if(a<c){var e=A.c(b,a),f=d;var h=t(e.Fb)?ao:zk;var k=Gq(Mj.h(e));e=Tk.h(e);e=Tb(wd,e);k=Tb(e,k);h=Tb(k,h);f.add(h);a+=1}else return!0}()?qf(d.Da(),m(Xc(a))):qf(d.Da(),null)}var f=y(a);return ae(function(){var a=t(f.Fb)?
+ao:zk;var b=Gq(Mj.h(f));var c=Tk.h(f);c=Tb(wd,c);b=Tb(c,b);return Tb(b,a)}(),m(vd(a)))}return null}}}(a,b,c,d),null,null)}}(b,c,d,a)(c)}(),t(d)?new R(null,1,5,T,[Gq(d)],null):null))};function $q(a,b,c,d,e){this.Vb=a;this.ia=b;this.v=c;this.j=d;this.w=e;this.m=2229667594;this.J=139264}g=$q.prototype;g.V=function(a,b){return this.I(null,b,null)};g.I=function(a,b,c){switch(b instanceof L?b.ea:null){case "klass":return this.Vb;case "schema":return this.ia;default:return D.l(this.j,b,c)}};
+g.R=function(a,b,c){return Y(b,function(){return function(a){return Y(b,Qi,""," ","",c,a)}}(this),"#schema.core.Record{",", ","}",c,O.c(new R(null,2,5,T,[new R(null,2,5,T,[ck,this.Vb],null),new R(null,2,5,T,[Mj,this.ia],null)],null),this.j))};g.ba=function(){return new fh(0,this,2,new R(null,2,5,T,[ck,Mj],null),t(this.j)?dd(this.j):Cf())};g.P=function(){return this.v};g.W=function(){return 2+H(this.j)};
+g.U=function(){var a=this,b=this.w;if(null!=b)return b;var c=function(){return function(){return function(a){return-1486476872^Dd(a)}}(b,a)(a)}();return this.w=c};g.K=function(a,b){return null!=b&&this.constructor===b.constructor&&G.c(this.Vb,b.Vb)&&G.c(this.ia,b.ia)&&G.c(this.j,b.j)};g.ga=function(a,b){return He(new ti(null,new r(null,2,[Mj,null,ck,null],null),null),b)?le.c(tc(wg.c(Ef,this),this.v),b):new $q(this.Vb,this.ia,this.v,Bf(le.c(this.j,b)),null)};
+g.O=function(a,b,c){return t(N.c?N.c(ck,b):N.call(null,ck,b))?new $q(c,this.ia,this.v,this.j,null):t(N.c?N.c(Mj,b):N.call(null,Mj,b))?new $q(this.Vb,c,this.v,this.j,null):new $q(this.Vb,this.ia,this.v,K.l(this.j,b,c),null)};g.S=function(){return E(O.c(new R(null,2,5,T,[new R(null,2,5,T,[ck,this.Vb],null),new R(null,2,5,T,[Mj,this.ia],null)],null),this.j))};g.T=function(a,b){return new $q(this.Vb,this.ia,b,this.j,this.w)};g.X=function(a,b){return ze(b)?this.O(null,A.c(b,0),A.c(b,1)):Mb(Tb,this,b)};
+g.xb=function(){var a=td.h(Vi(be([this.Vb])));var b=Gq(this.ia);b=Tb(wd,b);a=Tb(b,a);return Tb(a,Xn)};function ar(a,b,c){if(!xe(b))throw Error(Bq("Expected map, got %s",be([typeof b])));return pe(new $q(a,b,null,null,null),new r(null,1,[Qm,c],null))}function br(a){a=Gi(function(a){return a instanceof Xq},a);var b=J(a,0,null),c=J(a,1,null);return O.c(ig.c(function(){return function(a){return Gq(a.ia)}}(a,b,c),b),E(c)?new R(null,2,5,T,[Dj,xg(Gq,c)],null):null)}
+function cr(a,b,c,d,e){this.Nb=a;this.Db=b;this.v=c;this.j=d;this.w=e;this.m=2229667594;this.J=139264}g=cr.prototype;g.V=function(a,b){return this.I(null,b,null)};g.I=function(a,b,c){switch(b instanceof L?b.ea:null){case "output-schema":return this.Nb;case "input-schemas":return this.Db;default:return D.l(this.j,b,c)}};
+g.R=function(a,b,c){return Y(b,function(){return function(a){return Y(b,Qi,""," ","",c,a)}}(this),"#schema.core.FnSchema{",", ","}",c,O.c(new R(null,2,5,T,[new R(null,2,5,T,[Wk,this.Nb],null),new R(null,2,5,T,[jl,this.Db],null)],null),this.j))};g.ba=function(){return new fh(0,this,2,new R(null,2,5,T,[Wk,jl],null),t(this.j)?dd(this.j):Cf())};g.P=function(){return this.v};g.W=function(){return 2+H(this.j)};
+g.U=function(){var a=this,b=this.w;if(null!=b)return b;var c=function(){return function(){return function(a){return-2054647546^Dd(a)}}(b,a)(a)}();return this.w=c};g.K=function(a,b){return null!=b&&this.constructor===b.constructor&&G.c(this.Nb,b.Nb)&&G.c(this.Db,b.Db)&&G.c(this.j,b.j)};g.ga=function(a,b){return He(new ti(null,new r(null,2,[Wk,null,jl,null],null),null),b)?le.c(tc(wg.c(Ef,this),this.v),b):new cr(this.Nb,this.Db,this.v,Bf(le.c(this.j,b)),null)};
+g.O=function(a,b,c){return t(N.c?N.c(Wk,b):N.call(null,Wk,b))?new cr(c,this.Db,this.v,this.j,null):t(N.c?N.c(jl,b):N.call(null,jl,b))?new cr(this.Nb,c,this.v,this.j,null):new cr(this.Nb,this.Db,this.v,K.l(this.j,b,c),null)};g.S=function(){return E(O.c(new R(null,2,5,T,[new R(null,2,5,T,[Wk,this.Nb],null),new R(null,2,5,T,[jl,this.Db],null)],null),this.j))};g.T=function(a,b){return new cr(this.Nb,this.Db,b,this.j,this.w)};g.X=function(a,b){return ze(b)?this.O(null,A.c(b,0),A.c(b,1)):Mb(Tb,this,b)};
+g.xb=function(){if(1<H(this.Db)){var a=Gq(this.Nb);var b=ig.c(br,this.Db);a=ae(Sn,ae(a,b))}else a=Gq(this.Nb),b=br(y(this.Db)),a=ae(hn,ae(a,b));return a};function dr(a,b){return new cr(a,b,null,null,null)}function er(a){return E(a)?fe(a)instanceof Xq?H(a):Number.MAX_VALUE:0}
+function fr(a,b){if(!E(b))throw Error(Aq("Function must have at least one input schema"));if(!Vf(ze,b))throw Error(Aq("Each arity must be a vector."));if(!t(P(Ie,ig.c(er,b))))throw Error(Aq("Arities must be distinct"));return new cr(a,Qe(er,b),null,null,null)};var gr,hr,ir=Kq(Fe),jr=new r(null,3,[zn,Nq,Aj,Nq,On,Mq],null),kr;
+kr=function(a){if(!E(a)||!(Xf(H(a))||fe(a)instanceof rd))throw Error(Bq("Expected even, nonzero number of args (with optional trailing symbol); got %s",be([H(a)])));return new Rq(Wg(function(){return function d(a){return new kf(null,function(){for(;;){var c=E(a);if(c){if(Ae(c)){var f=Wc(c),h=H(f),k=of(h);a:for(var l=0;;)if(l<h){var p=A.c(f,l),m=J(p,0,null),u=J(p,1,null);p=k;if(!Fe(m))throw Error(Aq(["Conditional predicate ",v.h(m)," must be a function"].join("")));m=new R(null,2,5,T,[G.c(m,sk)?Zf(!0):
+m,u],null);p.add(m);l+=1}else{f=!0;break a}return f?qf(k.Da(),d(Xc(c))):qf(k.Da(),null)}f=y(c);k=J(f,0,null);h=J(f,1,null);f=ae;if(!Fe(k))throw Error(Aq(["Conditional predicate ",v.h(k)," must be a function"].join("")));k=new R(null,2,5,T,[G.c(k,sk)?Zf(!0):k,h],null);return f(k,d(vd(c)))}return null}},null,null)}(yg(2,2,a))}()),Xf(H(a))?null:fe(a),null,null,null)}(be([ze,new R(null,3,5,T,[Yq(Nq,"r"),Yq(Nq,"g"),Yq(Nq,"b")],null),Zf(!0),Nq]));
+var lr=ke([Uq(Ok),kr,Uq(Tn),kr,Uq(Kj),Mq,Uq(Yn),Mq,Uq(Vl),Mq,Uq(dk),Mq,Uq(Nk),Mq]),mr=new r(null,4,[pl,new r(null,2,[zn,Nq,Aj,Nq],null),Oj,lr,yn,Mq,Rj,Mq],null),nr=new R(null,2,5,T,[Yq(Nq,"unicode codepoint"),Yq(lr,"text attributes")],null),or=new R(null,1,5,T,[nr],null),pr=E(ug(function(a){return Sq(a)},lh(null)));if(!wb(pr))throw Error(Bq("extra-key-schema? can not contain required keys: %s",be([Wg(pr)])));
+function qr(a,b,c,d,e,f,h,k,l,p,m,u,w,x,C,F,I,M,S,X,Ga){this.width=a;this.height=b;this.Ba=c;this.qa=d;this.Aa=e;this.cursor=f;this.ra=h;this.sa=k;this.ta=l;this.pa=p;this.ua=m;this.va=u;this.wa=w;this.buffer=x;this.lines=C;this.za=F;this.xa=I;this.ya=M;this.v=S;this.j=X;this.w=Ga;this.m=2229667594;this.J=139264}g=qr.prototype;g.V=function(a,b){return this.I(null,b,null)};
+g.I=function(a,b,c){switch(b instanceof L?b.ea:null){case "width":return this.width;case "height":return this.height;case "top-margin":return this.Ba;case "bottom-margin":return this.qa;case "tabs":return this.Aa;case "cursor":return this.cursor;case "char-attrs":return this.ra;case "charset-fn":return this.sa;case "insert-mode":return this.ta;case "auto-wrap-mode":return this.pa;case "new-line-mode":return this.ua;case "next-print-wraps":return this.va;case "origin-mode":return this.wa;case "buffer":return this.buffer;
+case "lines":return this.lines;case "saved":return this.za;case "other-buffer-lines":return this.xa;case "other-buffer-saved":return this.ya;default:return D.l(this.j,b,c)}};
+g.R=function(a,b,c){return Y(b,function(){return function(a){return Y(b,Qi,""," ","",c,a)}}(this),"#asciinema.vt.screen.Screen{",", ","}",c,O.c(new R(null,18,5,T,[new R(null,2,5,T,[fl,this.width],null),new R(null,2,5,T,[no,this.height],null),new R(null,2,5,T,[Hn,this.Ba],null),new R(null,2,5,T,[Yj,this.qa],null),new R(null,2,5,T,[tk,this.Aa],null),new R(null,2,5,T,[pl,this.cursor],null),new R(null,2,5,T,[Oj,this.ra],null),new R(null,2,5,T,[im,this.sa],null),new R(null,2,5,T,[$l,this.ta],null),new R(null,
+2,5,T,[Rj,this.pa],null),new R(null,2,5,T,[mm,this.ua],null),new R(null,2,5,T,[vk,this.va],null),new R(null,2,5,T,[yn,this.wa],null),new R(null,2,5,T,[io,this.buffer],null),new R(null,2,5,T,[il,this.lines],null),new R(null,2,5,T,[Nm,this.za],null),new R(null,2,5,T,[Wn,this.xa],null),new R(null,2,5,T,[sm,this.ya],null)],null),this.j))};g.ba=function(){return new fh(0,this,18,new R(null,18,5,T,[fl,no,Hn,Yj,tk,pl,Oj,im,$l,Rj,mm,vk,yn,io,il,Nm,Wn,sm],null),t(this.j)?dd(this.j):Cf())};g.P=function(){return this.v};
+g.W=function(){return 18+H(this.j)};g.U=function(){var a=this,b=this.w;if(null!=b)return b;var c=function(){return function(){return function(a){return-1452363486^Dd(a)}}(b,a)(a)}();return this.w=c};
+g.K=function(a,b){return null!=b&&this.constructor===b.constructor&&G.c(this.width,b.width)&&G.c(this.height,b.height)&&G.c(this.Ba,b.Ba)&&G.c(this.qa,b.qa)&&G.c(this.Aa,b.Aa)&&G.c(this.cursor,b.cursor)&&G.c(this.ra,b.ra)&&G.c(this.sa,b.sa)&&G.c(this.ta,b.ta)&&G.c(this.pa,b.pa)&&G.c(this.ua,b.ua)&&G.c(this.va,b.va)&&G.c(this.wa,b.wa)&&G.c(this.buffer,b.buffer)&&G.c(this.lines,b.lines)&&G.c(this.za,b.za)&&G.c(this.xa,b.xa)&&G.c(this.ya,b.ya)&&G.c(this.j,b.j)};
+g.ga=function(a,b){return He(new ti(null,new r(null,18,[Oj,null,Rj,null,Yj,null,tk,null,vk,null,fl,null,il,null,pl,null,$l,null,im,null,mm,null,sm,null,Nm,null,yn,null,Hn,null,Wn,null,io,null,no,null],null),null),b)?le.c(tc(wg.c(Ef,this),this.v),b):new qr(this.width,this.height,this.Ba,this.qa,this.Aa,this.cursor,this.ra,this.sa,this.ta,this.pa,this.ua,this.va,this.wa,this.buffer,this.lines,this.za,this.xa,this.ya,this.v,Bf(le.c(this.j,b)),null)};
+g.O=function(a,b,c){return t(N.c?N.c(fl,b):N.call(null,fl,b))?new qr(c,this.height,this.Ba,this.qa,this.Aa,this.cursor,this.ra,this.sa,this.ta,this.pa,this.ua,this.va,this.wa,this.buffer,this.lines,this.za,this.xa,this.ya,this.v,this.j,null):t(N.c?N.c(no,b):N.call(null,no,b))?new qr(this.width,c,this.Ba,this.qa,this.Aa,this.cursor,this.ra,this.sa,this.ta,this.pa,this.ua,this.va,this.wa,this.buffer,this.lines,this.za,this.xa,this.ya,this.v,this.j,null):t(N.c?N.c(Hn,b):N.call(null,Hn,b))?new qr(this.width,
+this.height,c,this.qa,this.Aa,this.cursor,this.ra,this.sa,this.ta,this.pa,this.ua,this.va,this.wa,this.buffer,this.lines,this.za,this.xa,this.ya,this.v,this.j,null):t(N.c?N.c(Yj,b):N.call(null,Yj,b))?new qr(this.width,this.height,this.Ba,c,this.Aa,this.cursor,this.ra,this.sa,this.ta,this.pa,this.ua,this.va,this.wa,this.buffer,this.lines,this.za,this.xa,this.ya,this.v,this.j,null):t(N.c?N.c(tk,b):N.call(null,tk,b))?new qr(this.width,this.height,this.Ba,this.qa,c,this.cursor,this.ra,this.sa,this.ta,
+this.pa,this.ua,this.va,this.wa,this.buffer,this.lines,this.za,this.xa,this.ya,this.v,this.j,null):t(N.c?N.c(pl,b):N.call(null,pl,b))?new qr(this.width,this.height,this.Ba,this.qa,this.Aa,c,this.ra,this.sa,this.ta,this.pa,this.ua,this.va,this.wa,this.buffer,this.lines,this.za,this.xa,this.ya,this.v,this.j,null):t(N.c?N.c(Oj,b):N.call(null,Oj,b))?new qr(this.width,this.height,this.Ba,this.qa,this.Aa,this.cursor,c,this.sa,this.ta,this.pa,this.ua,this.va,this.wa,this.buffer,this.lines,this.za,this.xa,
+this.ya,this.v,this.j,null):t(N.c?N.c(im,b):N.call(null,im,b))?new qr(this.width,this.height,this.Ba,this.qa,this.Aa,this.cursor,this.ra,c,this.ta,this.pa,this.ua,this.va,this.wa,this.buffer,this.lines,this.za,this.xa,this.ya,this.v,this.j,null):t(N.c?N.c($l,b):N.call(null,$l,b))?new qr(this.width,this.height,this.Ba,this.qa,this.Aa,this.cursor,this.ra,this.sa,c,this.pa,this.ua,this.va,this.wa,this.buffer,this.lines,this.za,this.xa,this.ya,this.v,this.j,null):t(N.c?N.c(Rj,b):N.call(null,Rj,b))?new qr(this.width,
+this.height,this.Ba,this.qa,this.Aa,this.cursor,this.ra,this.sa,this.ta,c,this.ua,this.va,this.wa,this.buffer,this.lines,this.za,this.xa,this.ya,this.v,this.j,null):t(N.c?N.c(mm,b):N.call(null,mm,b))?new qr(this.width,this.height,this.Ba,this.qa,this.Aa,this.cursor,this.ra,this.sa,this.ta,this.pa,c,this.va,this.wa,this.buffer,this.lines,this.za,this.xa,this.ya,this.v,this.j,null):t(N.c?N.c(vk,b):N.call(null,vk,b))?new qr(this.width,this.height,this.Ba,this.qa,this.Aa,this.cursor,this.ra,this.sa,this.ta,
+this.pa,this.ua,c,this.wa,this.buffer,this.lines,this.za,this.xa,this.ya,this.v,this.j,null):t(N.c?N.c(yn,b):N.call(null,yn,b))?new qr(this.width,this.height,this.Ba,this.qa,this.Aa,this.cursor,this.ra,this.sa,this.ta,this.pa,this.ua,this.va,c,this.buffer,this.lines,this.za,this.xa,this.ya,this.v,this.j,null):t(N.c?N.c(io,b):N.call(null,io,b))?new qr(this.width,this.height,this.Ba,this.qa,this.Aa,this.cursor,this.ra,this.sa,this.ta,this.pa,this.ua,this.va,this.wa,c,this.lines,this.za,this.xa,this.ya,
+this.v,this.j,null):t(N.c?N.c(il,b):N.call(null,il,b))?new qr(this.width,this.height,this.Ba,this.qa,this.Aa,this.cursor,this.ra,this.sa,this.ta,this.pa,this.ua,this.va,this.wa,this.buffer,c,this.za,this.xa,this.ya,this.v,this.j,null):t(N.c?N.c(Nm,b):N.call(null,Nm,b))?new qr(this.width,this.height,this.Ba,this.qa,this.Aa,this.cursor,this.ra,this.sa,this.ta,this.pa,this.ua,this.va,this.wa,this.buffer,this.lines,c,this.xa,this.ya,this.v,this.j,null):t(N.c?N.c(Wn,b):N.call(null,Wn,b))?new qr(this.width,
+this.height,this.Ba,this.qa,this.Aa,this.cursor,this.ra,this.sa,this.ta,this.pa,this.ua,this.va,this.wa,this.buffer,this.lines,this.za,c,this.ya,this.v,this.j,null):t(N.c?N.c(sm,b):N.call(null,sm,b))?new qr(this.width,this.height,this.Ba,this.qa,this.Aa,this.cursor,this.ra,this.sa,this.ta,this.pa,this.ua,this.va,this.wa,this.buffer,this.lines,this.za,this.xa,c,this.v,this.j,null):new qr(this.width,this.height,this.Ba,this.qa,this.Aa,this.cursor,this.ra,this.sa,this.ta,this.pa,this.ua,this.va,this.wa,
+this.buffer,this.lines,this.za,this.xa,this.ya,this.v,K.l(this.j,b,c),null)};
+g.S=function(){return E(O.c(new R(null,18,5,T,[new R(null,2,5,T,[fl,this.width],null),new R(null,2,5,T,[no,this.height],null),new R(null,2,5,T,[Hn,this.Ba],null),new R(null,2,5,T,[Yj,this.qa],null),new R(null,2,5,T,[tk,this.Aa],null),new R(null,2,5,T,[pl,this.cursor],null),new R(null,2,5,T,[Oj,this.ra],null),new R(null,2,5,T,[im,this.sa],null),new R(null,2,5,T,[$l,this.ta],null),new R(null,2,5,T,[Rj,this.pa],null),new R(null,2,5,T,[mm,this.ua],null),new R(null,2,5,T,[vk,this.va],null),new R(null,
+2,5,T,[yn,this.wa],null),new R(null,2,5,T,[io,this.buffer],null),new R(null,2,5,T,[il,this.lines],null),new R(null,2,5,T,[Nm,this.za],null),new R(null,2,5,T,[Wn,this.xa],null),new R(null,2,5,T,[sm,this.ya],null)],null),this.j))};g.T=function(a,b){return new qr(this.width,this.height,this.Ba,this.qa,this.Aa,this.cursor,this.ra,this.sa,this.ta,this.pa,this.ua,this.va,this.wa,this.buffer,this.lines,this.za,this.xa,this.ya,b,this.j,this.w)};
+g.X=function(a,b){return ze(b)?this.O(null,A.c(b,0),A.c(b,1)):Mb(Tb,this,b)};function rr(a){return new qr(fl.h(a),no.h(a),Hn.h(a),Yj.h(a),tk.h(a),pl.h(a),Oj.h(a),im.h(a),$l.h(a),Rj.h(a),mm.h(a),vk.h(a),yn.h(a),io.h(a),il.h(a),Nm.h(a),Wn.h(a),sm.h(a),null,Bf(le.A(a,fl,be([no,Hn,Yj,tk,pl,Oj,im,$l,Rj,mm,vk,yn,io,il,Nm,Wn,sm]))),null)}
+Eq(qr,zq(ar(qr,hi.A(be([Pe([Oj,Rj,Yj,tk,vk,fl,il,pl,$l,im,mm,sm,Nm,yn,Hn,Wn,io,no],[lr,Mq,Nq,wi,Mq,Nq,new R(null,1,5,T,[or],null),jr,Mq,ir,Mq,mr,mr,Mq,Nq,new Qq(new R(null,1,5,T,[or],null),null,null,null),Pq,Nq]),null])),function(a){return rr(wg.c(Ef,a))})));var sr=new R(null,2,5,T,[Yq(Nq,pe(en,new r(null,1,[Mj,fn],null))),Yq(lr,pe(Dk,new r(null,1,[Mj,Gn],null)))],null),tr;tr=function(a,b){return new R(null,2,5,T,[a,b],null)};Eq(tr,dr(nr,new R(null,1,5,T,[sr],null)));
+var ur=new R(null,1,5,T,[Yq(Iq,pe(Dk,new r(null,1,[Mj,Ij],null)))],null),vr;vr=function(a){return tr(32,a)};Eq(vr,dr(nr,new R(null,1,5,T,[ur],null)));var wr=new R(null,1,5,T,[Yq(Iq,pe(Am,new r(null,1,[Mj,Ij],null)))],null),xr=new R(null,2,5,T,[Yq(Iq,pe(Am,new r(null,1,[Mj,Ij],null))),Yq(Iq,pe(Dk,new r(null,1,[Mj,Ij],null)))],null);
+gr=function yr(a){switch(arguments.length){case 1:return yr.h(arguments[0]);case 2:return yr.c(arguments[0],arguments[1]);default:throw Error(["Invalid arity: ",v.h(arguments.length)].join(""));}};gr.h=function(a){return gr.c(a,Ef)};gr.c=function(a,b){return Wg(qg(a,vr(b)))};gr.L=2;Eq(gr,fr(or,new R(null,2,5,T,[wr,xr],null)));
+var zr=new R(null,1,5,T,[or],null),Ar=new R(null,2,5,T,[Yq(Iq,pe(Am,new r(null,1,[Mj,Ij],null))),Yq(Iq,pe(lk,new r(null,1,[Mj,Ij],null)))],null),Br=new R(null,3,5,T,[Yq(Iq,pe(Am,new r(null,1,[Mj,Ij],null))),Yq(Iq,pe(lk,new r(null,1,[Mj,Ij],null))),Yq(Iq,pe(Dk,new r(null,1,[Mj,Ij],null)))],null);
+hr=function Cr(a){switch(arguments.length){case 2:return Cr.c(arguments[0],arguments[1]);case 3:return Cr.l(arguments[0],arguments[1],arguments[2]);default:throw Error(["Invalid arity: ",v.h(arguments.length)].join(""));}};hr.c=function(a,b){return hr.l(a,b,Ef)};hr.l=function(a,b,c){a=gr.c(a,c);return Wg(qg(b,a))};hr.L=3;Eq(hr,fr(zr,new R(null,2,5,T,[Ar,Br],null)));var Dr=new R(null,1,5,T,[Yq(Iq,pe(Am,new r(null,1,[Mj,Ij],null)))],null),Er;Er=function(a){return P(zi,Fi(8,a,8))};
+Eq(Er,dr(wi,new R(null,1,5,T,[Dr],null)));
+var Fr=new r(null,3,[zn,0,Aj,0,On,!0],null),Gr=new r(null,4,[pl,new r(null,2,[zn,0,Aj,0],null),Oj,Ef,yn,!1,Rj,!0],null),Hr=Pe([121,110,101,102,106,119,104,116,99,113,117,108,109,118,100,122,111,103,125,107,97,115,112,123,120,126,98,124,96,105,114],[8804,9532,9226,176,9496,9516,9252,9500,9228,9472,9508,9484,9492,9524,9229,8805,9146,177,163,9488,9618,9149,9147,960,9474,8901,9225,8800,9830,9227,9148]),Ir=new R(null,2,5,T,[Yq(Nq,pe(Am,new r(null,1,[Mj,oo],null))),Yq(Nq,pe(lk,new r(null,1,[Mj,oo],null)))],
+null),Jr;Jr=function(a,b){return rr(Pe([Oj,Rj,Yj,tk,vk,fl,il,pl,$l,im,mm,sm,Nm,yn,Hn,Wn,io,no],[Ef,!0,b-1,Er(a),!1,a,hr.c(a,b),Fr,!1,Ve,!1,Gr,Gr,!1,0,null,fk,b]))};Eq(Jr,dr(qr,new R(null,1,5,T,[Ir],null)));function Kr(a){return K.l(a,$l,!0)}function Lr(a){return K.l(a,$l,!1)}function Mr(a){return K.l(a,mm,!0)}function Nr(a){return K.l(a,mm,!1)}function Or(a){return K.l(a,Rj,!0)}function Pr(a){return K.l(a,Rj,!1)}function Qr(a,b,c){return zg(a,new R(null,2,5,T,[Oj,b],null),c)}
+function Rr(a,b){return Cg(a,Oj,le,b)}function Sr(a,b,c){var d=H(a);b=b<d?b:d;return O.c(kg(b,a),qg(b,c))}var Tr=function Tr(a){switch(arguments.length){case 1:return Tr.h(arguments[0]);case 2:return Tr.c(arguments[0],arguments[1]);default:throw Error(["Invalid arity: ",v.h(arguments.length)].join(""));}};Tr.h=function(a){return Tr.c(a,1)};
+Tr.c=function(a,b){var c=null!=a&&(a.m&64||q===a.G)?P(U,a):a,d=D.c(c,fl),e=D.c(c,Hn),f=D.c(c,Yj),h=D.c(c,Oj),k=gr.c(d,h);return Bg(c,il,function(a,c,d,e,f,h,k){return function(c){return Wg(O.A(jg(h,c),Sr(Zg(null,c,h,k+1,null),b,a),be([kg(k+1,c)])))}}(k,a,c,c,d,e,f,h))};Tr.L=2;function Ur(a,b,c){var d=H(a);b=b<d?b:d;return O.c(qg(b,c),jg(d-b,a))}
+var Vr=function Vr(a){switch(arguments.length){case 1:return Vr.h(arguments[0]);case 2:return Vr.c(arguments[0],arguments[1]);default:throw Error(["Invalid arity: ",v.h(arguments.length)].join(""));}};Vr.h=function(a){return Vr.c(a,1)};
+Vr.c=function(a,b){var c=null!=a&&(a.m&64||q===a.G)?P(U,a):a,d=D.c(c,fl),e=D.c(c,Hn),f=D.c(c,Yj),h=D.c(c,Oj),k=gr.c(d,h);return Bg(c,il,function(a,c,d,e,f,h,k){return function(c){return Wg(O.A(jg(h,c),Ur(Zg(null,c,h,k+1,null),b,a),be([kg(k+1,c)])))}}(k,a,c,c,d,e,f,h))};Vr.L=2;function Wr(a){return zg(a,new R(null,2,5,T,[pl,On],null),!0)}function Xr(a){return zg(a,new R(null,2,5,T,[pl,On],null),!1)}function Yr(a,b){return K.l(zg(a,new R(null,2,5,T,[pl,zn],null),b),vk,!1)}
+function Zr(a,b){var c=null!=a&&(a.m&64||q===a.G)?P(U,a):a,d=D.c(c,fl),e=0<b?b:0;--d;return Yr(c,e<d?e:d)}function $r(a,b){var c=null!=a&&(a.m&64||q===a.G)?P(U,a):a,d=D.c(c,pl);d=null!=d&&(d.m&64||q===d.G)?P(U,d):d;d=D.c(d,zn);var e=D.c(c,fl)-1;return K.l(zg(zg(c,new R(null,2,5,T,[pl,zn],null),d<e?d:e),new R(null,2,5,T,[pl,Aj],null),b),vk,!1)}function as(a){var b=null!=a&&(a.m&64||q===a.G)?P(U,a):a;a=D.c(b,yn);b=D.c(b,Hn);return t(a)?b:0}
+function bs(a,b){var c=as(a),d=null!=a&&(a.m&64||q===a.G)?P(U,a):a;var e=D.c(d,yn);var f=D.c(d,Yj);d=D.c(d,no);e=t(e)?f:d-1;f=c+b;c=f>c?f:c;return $r(a,e<c?e:c)}function cs(a){return $r(Yr(a,0),as(a))}function Eg(a,b,c){return bs(Zr(a,b),c)}function ds(a){a=null!=a&&(a.m&64||q===a.G)?P(U,a):a;var b=D.c(a,pl);b=null!=b&&(b.m&64||q===b.G)?P(U,b):b;b=D.c(b,Aj);var c=D.c(a,Yj),d=D.c(a,no)-1;return G.c(b,c)?Tr.h(a):b<d?$r(a,b+1):a}
+function es(a){a=null!=a&&(a.m&64||q===a.G)?P(U,a):a;var b=D.c(a,pl);b=null!=b&&(b.m&64||q===b.G)?P(U,b):b;b=D.c(b,zn);return Zr(a,b-1)}function fs(a,b){var c=null!=a&&(a.m&64||q===a.G)?P(U,a):a,d=D.c(c,pl);d=null!=d&&(d.m&64||q===d.G)?P(U,d):d;var e=D.c(d,Aj),f=D.c(c,Hn);return $r(c,e<f?function(){var a=e-b;return 0>a?0:a}():function(){var a=e-b;return f>a?f:a}())}
+function gs(a,b){var c=null!=a&&(a.m&64||q===a.G)?P(U,a):a,d=D.c(c,pl);d=null!=d&&(d.m&64||q===d.G)?P(U,d):d;var e=D.c(d,Aj),f=D.c(c,Yj),h=D.c(c,no);return $r(c,e>f?function(){var a=h-1,c=e+b;return a<c?a:c}():function(){var a=e+b;return f<a?f:a}())}function hs(a,b){var c=null!=a&&(a.m&64||q===a.G)?P(U,a):a,d=D.c(c,pl);d=null!=d&&(d.m&64||q===d.G)?P(U,d):d;d=D.c(d,zn);return Zr(c,d+b)}
+function is(a,b){var c=null!=a&&(a.m&64||q===a.G)?P(U,a):a,d=D.c(c,pl);d=null!=d&&(d.m&64||q===d.G)?P(U,d):d;d=D.c(d,zn);return Zr(c,d-b)}function js(a){var b=null!=a&&(a.m&64||q===a.G)?P(U,a):a;a=D.c(b,mm);b=ds(b);return t(a)?Yr(b,0):b}function ks(a){return Yr(ds(a),0)}function ls(a){a=null!=a&&(a.m&64||q===a.G)?P(U,a):a;var b=D.c(a,pl);b=null!=b&&(b.m&64||q===b.G)?P(U,b):b;b=D.c(b,Aj);var c=D.c(a,Hn);return G.c(b,c)?Vr.h(a):0<b?$r(a,b-1):a}
+function ms(a){a=null!=a&&(a.m&64||q===a.G)?P(U,a):a;var b=D.c(a,pl),c=null!=b&&(b.m&64||q===b.G)?P(U,b):b;b=D.c(c,zn);c=D.c(c,Aj);var d=D.c(a,Oj),e=D.c(a,yn),f=D.c(a,Rj);return K.l(a,Nm,new r(null,4,[pl,new r(null,2,[zn,b,Aj,c],null),Oj,d,yn,e,Rj,f],null))}function ns(a){a=null!=a&&(a.m&64||q===a.G)?P(U,a):a;var b=D.c(a,Nm),c=null!=b&&(b.m&64||q===b.G)?P(U,b):b;b=D.c(c,pl);var d=D.c(c,Oj),e=D.c(c,yn);c=D.c(c,Rj);return Cg(K.A(a,Oj,d,be([vk,!1,yn,e,Rj,c])),pl,hi,b)}
+function os(a){a=null!=a&&(a.m&64||q===a.G)?P(U,a):a;var b=D.c(a,io),c=D.c(a,fl),d=D.c(a,no),e=D.c(a,Oj);return G.c(b,fk)?K.A(a,io,tl,be([Wn,il.h(a),sm,Nm.h(a),il,hr.l(c,d,e),Nm,sm.h(a)])):a}function dt(a){a=null!=a&&(a.m&64||q===a.G)?P(U,a):a;var b=D.c(a,io);return G.c(b,tl)?K.A(a,io,fk,be([Wn,null,sm,Nm.h(a),il,Wn.h(a),Nm,sm.h(a)])):a}
+function et(a){a=null!=a&&(a.m&64||q===a.G)?P(U,a):a;var b=D.c(a,pl);b=null!=b&&(b.m&64||q===b.G)?P(U,b):b;b=D.c(b,zn);var c=D.c(a,fl);return 0<b&&b<c?Cg(a,tk,ge,b):a}function ft(a){a=null!=a&&(a.m&64||q===a.G)?P(U,a):a;var b=D.c(a,pl);b=null!=b&&(b.m&64||q===b.G)?P(U,b):b;b=D.c(b,zn);return Cg(a,tk,re,b)}function gt(a){return Bg(a,tk,ie)}
+function ht(a,b){var c=null!=a&&(a.m&64||q===a.G)?P(U,a):a,d=D.c(c,pl),e=null!=d&&(d.m&64||q===d.G)?P(U,d):d,f=D.c(e,zn),h=D.c(c,tk),k=D.c(c,fl),l=b-1,p=k-1;d=J(ng(function(a,b,c,d,e,f,h,k){return function(a){return k>=a}}(l,p,a,c,c,d,e,f,h,k),h),l,p);return Zr(c,d)}
+function it(a,b){var c=null!=a&&(a.m&64||q===a.G)?P(U,a):a,d=D.c(c,pl),e=null!=d&&(d.m&64||q===d.G)?P(U,d):d,f=D.c(e,zn),h=D.c(c,tk),k=D.c(c,fl),l=b-1;d=J(cf(Bi(function(a,b,c,d,e,f,h){return function(a){return h>a}}(l,a,c,c,d,e,f,h,k),h)),l,0);return Zr(c,d)}function jt(a){return K.l(a,im,Ve)}function kt(a){return K.l(a,im,Hr)}function lt(a,b,c){return K.l(a,b,c)}function mt(a,b,c){return Wg(O.A(jg(b,a),new R(null,1,5,T,[c],null),be([jg(H(a)-b-1,kg(b,a))])))}
+function nt(a,b){var c=null!=a&&(a.m&64||q===a.G)?P(U,a):a,d=D.c(c,pl),e=null!=d&&(d.m&64||q===d.G)?P(U,d):d;d=D.c(e,zn);e=D.c(e,Aj);var f=D.c(c,fl);D.c(c,no);var h=D.c(c,Oj),k=D.c(c,Rj),l=D.c(c,$l),p=D.c(c,im);p=95<b&&127>b?p.h?p.h(b):p.call(null,b):b;h=tr(p,h);return G.c(f,d+1)?t(k)?K.l(Yr(zg(c,new R(null,3,5,T,[il,e,d],null),h),d+1),vk,!0):zg(c,new R(null,3,5,T,[il,e,d],null),h):Yr(Ag.Z(c,new R(null,2,5,T,[il,e],null),t(l)?mt:lt,d,h),d+1)}
+function ot(a,b){var c=null!=a&&(a.m&64||q===a.G)?P(U,a):a,d=D.c(c,Rj),e=D.c(c,vk);t(t(d)?e:d)&&(c=null!=c&&(c.m&64||q===c.G)?P(U,c):c,d=D.c(c,pl),d=null!=d&&(d.m&64||q===d.G)?P(U,d):d,d=D.c(d,Aj),e=D.c(c,no),c=Yr(c,0),c=G.c(e,d+1)?Tr.h(c):$r(c,d+1));return c=nt(c,b)}function pt(a){a=null!=a&&(a.m&64||q===a.G)?P(U,a):a;var b=D.c(a,fl),c=D.c(a,no);return K.l(a,il,Wg(qg(c,Wg(qg(b,new R(null,2,5,T,[69,Ef],null))))))}
+function qt(a){a=null!=a&&(a.m&64||q===a.G)?P(U,a):a;var b=D.c(a,pl);b=null!=b&&(b.m&64||q===b.G)?P(U,b):b;b=D.c(b,Aj);var c=D.c(a,fl),d=D.c(a,Oj);return zg(a,new R(null,2,5,T,[il,b],null),gr.c(c,d))}function rt(a,b,c){return Wg(O.c(jg(b,a),qg(H(a)-b,vr(c))))}function st(a,b,c){return Wg(O.c(qg(b+1,vr(c)),kg(b+1,a)))}
+function tt(a){a=null!=a&&(a.m&64||q===a.G)?P(U,a):a;var b=D.c(a,pl),c=null!=b&&(b.m&64||q===b.G)?P(U,b):b;b=D.c(c,zn);c=D.c(c,Aj);var d=D.c(a,fl),e=D.c(a,Oj);--d;return Ag.Z(a,new R(null,2,5,T,[il,c],null),rt,b<d?b:d,e)}function ut(a){a=null!=a&&(a.m&64||q===a.G)?P(U,a):a;var b=D.c(a,pl),c=null!=b&&(b.m&64||q===b.G)?P(U,b):b;b=D.c(c,zn);c=D.c(c,Aj);var d=D.c(a,fl),e=D.c(a,Oj);--d;return Ag.Z(a,new R(null,2,5,T,[il,c],null),st,b<d?b:d,e)}
+function vt(a){a=null!=a&&(a.m&64||q===a.G)?P(U,a):a;var b=D.c(a,fl),c=D.c(a,no),d=D.c(a,Oj);return K.l(a,il,hr.l(b,c,d))}function wt(a){var b=null!=a&&(a.m&64||q===a.G)?P(U,a):a,c=D.c(b,pl),d=null!=c&&(c.m&64||q===c.G)?P(U,c):c,e=D.c(d,zn),f=D.c(d,Aj),h=D.c(b,fl),k=D.c(b,no),l=D.c(b,Oj);return Bg(b,il,function(a,b,c,d,e,f,h,k,l,S){return function(a){var b=jg(h,a);a=rt(Vd(a,h),f,S);var c=qg(l-h-1,gr.c(k,S));return Wg(O.A(b,new R(null,1,5,T,[a],null),be([c])))}}(a,b,b,c,d,e,f,h,k,l))}
+function xt(a){var b=null!=a&&(a.m&64||q===a.G)?P(U,a):a,c=D.c(b,pl),d=null!=c&&(c.m&64||q===c.G)?P(U,c):c,e=D.c(d,zn),f=D.c(d,Aj),h=D.c(b,fl),k=D.c(b,no),l=D.c(b,Oj);return Bg(b,il,function(a,b,c,d,e,f,h,k,l,S,X){return function(b){var c=qg(k,gr.c(l,X)),d=st(Vd(b,k),a,X);return Wg(O.A(c,new R(null,1,5,T,[d],null),be([kg(k+1,b)])))}}(function(){var a=h-1;return e<a?e:a}(),a,b,b,c,d,e,f,h,k,l))}
+function yt(a,b){var c=null!=a&&(a.m&64||q===a.G)?P(U,a):a,d=D.c(c,pl),e=null!=d&&(d.m&64||q===d.G)?P(U,d):d,f=D.c(e,zn),h=D.c(e,Aj),k=D.c(c,fl),l=D.c(c,Oj);return Ag.l(c,new R(null,2,5,T,[il,h],null),function(a,b,c,d,e,f,h,k,l,S){return function(b){return Wg(O.A(jg(h,b),qg(a,vr(S)),be([kg(h+a,b)])))}}(function(){var a=k-f;return b<a?b:a}(),a,c,c,d,e,f,h,k,l))}
+function zt(a,b){var c=null!=a&&(a.m&64||q===a.G)?P(U,a):a,d=D.c(c,pl),e=null!=d&&(d.m&64||q===d.G)?P(U,d):d,f=D.c(e,zn),h=D.c(e,Aj),k=D.c(c,fl),l=D.c(c,Oj);return Ag.l(c,new R(null,2,5,T,[il,h],null),function(a,c,d,e,f,h,k,l,M){return function(a){return Wg(jg(l,O.A(jg(h,a),qg(b,new R(null,2,5,T,[32,M],null)),be([kg(h,a)]))))}}(a,c,c,d,e,f,h,k,l))}
+function At(a,b){var c=null!=a&&(a.m&64||q===a.G)?P(U,a):a,d=D.c(c,pl),e=null!=d&&(d.m&64||q===d.G)?P(U,d):d,f=D.c(e,Aj),h=D.c(c,Yj),k=D.c(c,fl),l=D.c(c,no),p=D.c(c,Oj),m=gr.c(k,p);return Bg(c,il,function(a,c,d,e,f,h,k,m){return function(c){return Wg(k<=m?O.A(jg(k,c),Ur(Zg(null,c,k,m+1,null),b,a),be([kg(m+1,c)])):O.c(jg(k,c),Ur(kg(k,c),b,a)))}}(m,a,c,c,d,e,f,h,k,l,p))}
+function Bt(a,b){var c=null!=a&&(a.m&64||q===a.G)?P(U,a):a,d=D.c(c,pl),e=null!=d&&(d.m&64||q===d.G)?P(U,d):d,f=D.c(e,Aj),h=D.c(c,Yj),k=D.c(c,fl),l=D.c(c,no),p=D.c(c,Oj),m=gr.c(k,p);return Bg(c,il,function(a,c,d,e,f,h,k,m){return function(c){return Wg(k<=m?O.A(jg(k,c),Sr(Zg(null,c,k,m+1,null),b,a),be([kg(m+1,c)])):O.c(jg(k,c),Sr(kg(k,c),b,a)))}}(m,a,c,c,d,e,f,h,k,l,p))}
+function Ct(a,b){var c=null!=a&&(a.m&64||q===a.G)?P(U,a):a,d=D.c(c,pl),e=null!=d&&(d.m&64||q===d.G)?P(U,d):d,f=D.c(e,zn),h=D.c(e,Aj),k=D.c(c,fl),l=D.c(c,Oj),p=f>=k?Zr(c,k-1):c,m=Mb(D,p,new R(null,2,5,T,[pl,zn],null));return Ag.l(p,new R(null,2,5,T,[il,h],null),function(a,b,c,d,e,f,h,k,m,l,p,Q){return function(a){return Wg(O.A(jg(b,a),kg(b+c,a),be([qg(c,vr(Q))])))}}(p,m,function(){var a=k-m;return b<a?b:a}(),a,c,c,d,e,f,h,k,l))}
+var Dt=new R(null,1,5,T,[Yq(new R(null,1,5,T,[Nq],null),pe(Ln,new r(null,1,[Mj,new R(null,1,5,T,[fn],null)],null)))],null),Et;Et=function(a){return P(String.fromCodePoint,a)};Eq(Et,dr(Lq,new R(null,1,5,T,[Dt],null)));var Ft=new R(null,1,5,T,[new R(null,2,5,T,[Yq(Lq,"text"),Yq(lr,"text attributes")],null)],null),Gt=new R(null,1,5,T,[Yq(or,pe(Nn,new r(null,1,[Mj,nk],null)))],null),Ht;
+Ht=function(a){a=E(a);var b=y(a),c=z(a);a=he;var d=new R(null,1,5,T,[y(b)],null),e=fe(b);for(b=c;;)if(c=y(b),t(c)){var f=c;c=J(f,0,null);f=J(f,1,null);G.c(f,e)?d=ge.c(d,c):(a=ge.c(a,new R(null,2,5,T,[Et(d),e],null)),d=new R(null,1,5,T,[c],null),e=f);b=vd(b)}else return ge.c(a,new R(null,2,5,T,[Et(d),e],null))};Eq(Ht,dr(Ft,new R(null,1,5,T,[Gt],null)));
+function It(a){a=Wr(a);a=null!=a&&(a.m&64||q===a.G)?P(U,a):a;var b=D.c(a,no);a=K.A(a,Hn,0,be([Yj,b-1]));return K.l(K.l(K.l(Lr(a),yn,!1),Oj,Ef),Nm,Gr)};var Jt=Error();var Kt=E(ug(function(a){return Sq(a)},lh(null)));if(!wb(Kt))throw Error(Bq("extra-key-schema? can not contain required keys: %s",be([Wg(Kt)])));function Lt(a,b,c,d,e,f,h){this.Qb=a;this.Pb=b;this.Ob=c;this.screen=d;this.v=e;this.j=f;this.w=h;this.m=2229667594;this.J=139264}g=Lt.prototype;g.V=function(a,b){return this.I(null,b,null)};
+g.I=function(a,b,c){switch(b instanceof L?b.ea:null){case "parser-state":return this.Qb;case "parser-params":return this.Pb;case "parser-intermediates":return this.Ob;case "screen":return this.screen;default:return D.l(this.j,b,c)}};
+g.R=function(a,b,c){return Y(b,function(){return function(a){return Y(b,Qi,""," ","",c,a)}}(this),"#asciinema.vt.VT{",", ","}",c,O.c(new R(null,4,5,T,[new R(null,2,5,T,[Tl,this.Qb],null),new R(null,2,5,T,[kk,this.Pb],null),new R(null,2,5,T,[rk,this.Ob],null),new R(null,2,5,T,[V,this.screen],null)],null),this.j))};g.ba=function(){return new fh(0,this,4,new R(null,4,5,T,[Tl,kk,rk,V],null),t(this.j)?dd(this.j):Cf())};g.P=function(){return this.v};g.W=function(){return 4+H(this.j)};
+g.U=function(){var a=this,b=this.w;if(null!=b)return b;var c=function(){return function(){return function(a){return-156373259^Dd(a)}}(b,a)(a)}();return this.w=c};g.K=function(a,b){return null!=b&&this.constructor===b.constructor&&G.c(this.Qb,b.Qb)&&G.c(this.Pb,b.Pb)&&G.c(this.Ob,b.Ob)&&G.c(this.screen,b.screen)&&G.c(this.j,b.j)};
+g.ga=function(a,b){return He(new ti(null,new r(null,4,[V,null,kk,null,rk,null,Tl,null],null),null),b)?le.c(tc(wg.c(Ef,this),this.v),b):new Lt(this.Qb,this.Pb,this.Ob,this.screen,this.v,Bf(le.c(this.j,b)),null)};
+g.O=function(a,b,c){return t(N.c?N.c(Tl,b):N.call(null,Tl,b))?new Lt(c,this.Pb,this.Ob,this.screen,this.v,this.j,null):t(N.c?N.c(kk,b):N.call(null,kk,b))?new Lt(this.Qb,c,this.Ob,this.screen,this.v,this.j,null):t(N.c?N.c(rk,b):N.call(null,rk,b))?new Lt(this.Qb,this.Pb,c,this.screen,this.v,this.j,null):t(N.c?N.c(V,b):N.call(null,V,b))?new Lt(this.Qb,this.Pb,this.Ob,c,this.v,this.j,null):new Lt(this.Qb,this.Pb,this.Ob,this.screen,this.v,K.l(this.j,b,c),null)};
+g.S=function(){return E(O.c(new R(null,4,5,T,[new R(null,2,5,T,[Tl,this.Qb],null),new R(null,2,5,T,[kk,this.Pb],null),new R(null,2,5,T,[rk,this.Ob],null),new R(null,2,5,T,[V,this.screen],null)],null),this.j))};g.T=function(a,b){return new Lt(this.Qb,this.Pb,this.Ob,this.screen,b,this.j,this.w)};g.X=function(a,b){return ze(b)?this.O(null,A.c(b,0),A.c(b,1)):Mb(Tb,this,b)};function Mt(a){return new Lt(Tl.h(a),kk.h(a),rk.h(a),V.h(a),null,Bf(le.A(a,Tl,be([kk,rk,V]))),null)}
+Eq(Lt,zq(ar(Lt,hi.A(be([new r(null,4,[Tl,Pq,kk,new R(null,1,5,T,[Oq],null),rk,new R(null,1,5,T,[Oq],null),V,qr],null),null])),function(a){return Mt(wg.c(Ef,a))})));var Nt=new R(null,2,5,T,[Yq(Nq,pe(Am,new r(null,1,[Mj,oo],null))),Yq(Nq,pe(lk,new r(null,1,[Mj,oo],null)))],null),Ot;Ot=function(a,b){return Mt(new r(null,4,[Tl,uk,kk,he,rk,he,V,Jr(a,b)],null))};Eq(Ot,dr(Lt,new R(null,1,5,T,[Nt],null)));
+function Pt(a,b,c){try{if(null===b)try{if(4===c)return Bg(a,V,Kr);throw Jt;}catch(p){if(p instanceof Error){var d=p;if(d===Jt)try{if(20===c)return Bg(a,V,Mr);throw Jt;}catch(m){if(m instanceof Error){var e=m;if(e===Jt)throw Jt;throw e;}throw m;}else throw d;}else throw p;}else throw Jt;}catch(p){if(p instanceof Error)if(d=p,d===Jt)try{if(63===b)try{if(6===c)return Bg(a,V,function(){return function(a){return cs(K.l(a,yn,!0))}}(d));throw Jt;}catch(m){if(m instanceof Error)if(e=m,e===Jt)try{if(7===c)return Bg(a,
+V,Or);throw Jt;}catch(u){if(u instanceof Error)if(b=u,b===Jt)try{if(25===c)return Bg(a,V,Wr);throw Jt;}catch(w){if(w instanceof Error){var f=w;if(f===Jt)try{if(47===c)return Bg(a,V,os);throw Jt;}catch(x){if(x instanceof Error){var h=x;if(h===Jt)try{if(1047===c)return Bg(a,V,os);throw Jt;}catch(C){if(C instanceof Error){var k=C;if(k===Jt)try{if(1048===c)return Bg(a,V,ms);throw Jt;}catch(F){if(F instanceof Error){var l=F;if(l===Jt)try{if(1049===c)return Bg(a,V,function(){return function(a){return os(ms(a))}}(l,
+k,h,f,b,e,d));throw Jt;}catch(I){if(I instanceof Error){c=I;if(c===Jt)throw Jt;throw c;}throw I;}else throw l;}else throw F;}else throw k;}else throw C;}else throw h;}else throw x;}else throw f;}else throw w;}else throw b;else throw u;}else throw e;else throw m;}else throw Jt;}catch(m){if(m instanceof Error){e=m;if(e===Jt)return a;throw e;}throw m;}else throw d;else throw p;}}
+function Qt(a,b,c){try{if(null===b)try{if(4===c)return Bg(a,V,Lr);throw Jt;}catch(p){if(p instanceof Error){var d=p;if(d===Jt)try{if(20===c)return Bg(a,V,Nr);throw Jt;}catch(m){if(m instanceof Error){var e=m;if(e===Jt)throw Jt;throw e;}throw m;}else throw d;}else throw p;}else throw Jt;}catch(p){if(p instanceof Error)if(d=p,d===Jt)try{if(63===b)try{if(6===c)return Bg(a,V,function(){return function(a){return cs(K.l(a,yn,!1))}}(d));throw Jt;}catch(m){if(m instanceof Error)if(e=m,e===Jt)try{if(7===c)return Bg(a,
+V,Pr);throw Jt;}catch(u){if(u instanceof Error)if(b=u,b===Jt)try{if(25===c)return Bg(a,V,Xr);throw Jt;}catch(w){if(w instanceof Error){var f=w;if(f===Jt)try{if(47===c)return Bg(a,V,dt);throw Jt;}catch(x){if(x instanceof Error){var h=x;if(h===Jt)try{if(1047===c)return Bg(a,V,dt);throw Jt;}catch(C){if(C instanceof Error){var k=C;if(k===Jt)try{if(1048===c)return Bg(a,V,ns);throw Jt;}catch(F){if(F instanceof Error){var l=F;if(l===Jt)try{if(1049===c)return Bg(a,V,function(){return function(a){return ns(dt(a))}}(l,
+k,h,f,b,e,d));throw Jt;}catch(I){if(I instanceof Error){c=I;if(c===Jt)throw Jt;throw c;}throw I;}else throw l;}else throw F;}else throw k;}else throw C;}else throw h;}else throw x;}else throw f;}else throw w;}else throw b;else throw u;}else throw e;else throw m;}else throw Jt;}catch(m){if(m instanceof Error){e=m;if(e===Jt)return a;throw e;}throw m;}else throw d;else throw p;}}
+function Rt(a){a=ig.c(function(a){return a-48},a);a=ig.l(Ye,cf(a),rg(function(){return function(a){return 10*a}}(a),1));return Mb(Xe,0,a)}var St=hj(function(a){a:for(var b=he,c=he;;){var d=y(a);if(t(d))G.c(d,59)?(a=vd(a),b=ge.c(b,c),c=he):(a=vd(a),c=ge.c(c,d));else{a=E(c)?ge.c(b,c):b;break a}}return ig.c(Rt,a)});function Tt(a){a=kk.h(a);return St.h?St.h(a):St.call(null,a)}function Ut(a,b,c){a=J(Tt(a),b,0);return 0===a?c:a}function Vt(a){return Bg(a,V,es)}function Wt(a){return Cg(a,V,ht,1)}
+function Xt(a){return Cg(a,V,Yr,0)}function Yt(a){return Bg(a,V,js)}function Zt(a){return Bg(a,V,kt)}function $t(a){return Bg(a,V,jt)}function au(a){return Bg(a,V,ks)}function bu(a){return Bg(a,V,et)}function cu(a){return Bg(a,V,ls)}function du(a){return Ot(fl.h(V.h(a)),no.h(V.h(a)))}function eu(a){var b=Ut(a,0,1);return Cg(a,V,zt,b)}function fu(a){var b=Ut(a,0,1);return Cg(a,V,fs,b)}function gu(a){var b=Ut(a,0,1);return Cg(a,V,gs,b)}function hu(a){var b=Ut(a,0,1);return Cg(a,V,hs,b)}
+function iu(a){var b=Ut(a,0,1);return Cg(a,V,is,b)}function ju(a){var b=Ut(a,0,1);return Bg(a,V,function(a){return function(b){return Yr(gs(b,a),0)}}(b))}function ku(a){var b=Ut(a,0,1);return Bg(a,V,function(a){return function(b){return Yr(fs(b,a),0)}}(b))}function lu(a){var b=Ut(a,0,1)-1;return Cg(a,V,Zr,b)}function mu(a){var b=Ut(a,0,1)-1,c=Ut(a,1,1)-1;return Dg(a,c,b)}function nu(a){var b=Ut(a,0,1);return Cg(a,V,ht,b)}
+function ou(a){var b=Ut(a,0,0);return Bg(a,V,function(){switch(b){case 0:return wt;case 1:return xt;case 2:return vt;default:return Ve}}())}function pu(a){var b=Ut(a,0,0);return Bg(a,V,function(){switch(b){case 0:return tt;case 1:return ut;case 2:return qt;default:return Ve}}())}function qu(a){var b=Ut(a,0,1);return Cg(a,V,Tr,b)}function ru(a){var b=Ut(a,0,1);return Cg(a,V,Vr,b)}function su(a){var b=Ut(a,0,1);return Cg(a,V,At,b)}function tu(a){var b=Ut(a,0,1);return Cg(a,V,Bt,b)}
+function uu(a){var b=Ut(a,0,1);return Cg(a,V,Ct,b)}function vu(a){switch(Ut(a,0,0)){case 0:return Bg(a,V,et);case 2:return Bg(a,V,ft);case 5:return Bg(a,V,gt);default:return a}}function wu(a){var b=Ut(a,0,1);return Cg(a,V,yt,b)}function xu(a){var b=Ut(a,0,1);return Cg(a,V,it,b)}function yu(a){switch(Ut(a,0,0)){case 0:return Bg(a,V,ft);case 3:return Bg(a,V,gt);default:return a}}function zu(a){var b=D.c(rk.h(a),0);return Mb(function(a){return function(b,c){return Pt(b,a,c)}}(b),a,Tt(a))}
+function Au(a){var b=D.c(rk.h(a),0);return Mb(function(a){return function(b,c){return Qt(b,a,c)}}(b),a,Tt(a))}
+function Bu(a,b){for(var c=a,d=b;;)if(E(d)){var e=y(d);switch(e){case 0:c=K.l(c,Oj,Ef);d=vd(d);continue;case 1:c=Qr(c,Kj,!0);d=vd(d);continue;case 3:c=Qr(c,Yn,!0);d=vd(d);continue;case 4:c=Qr(c,Vl,!0);d=vd(d);continue;case 5:c=Qr(c,dk,!0);d=vd(d);continue;case 7:c=Qr(c,Nk,!0);d=vd(d);continue;case 21:c=Rr(c,Kj);d=vd(d);continue;case 22:c=Rr(c,Kj);d=vd(d);continue;case 23:c=Rr(c,Yn);d=vd(d);continue;case 24:c=Rr(c,Vl);d=vd(d);continue;case 25:c=Rr(c,dk);d=vd(d);continue;case 27:c=Rr(c,Nk);d=vd(d);
+continue;case 30:case 31:case 32:case 33:case 34:case 35:case 36:case 37:c=Qr(c,Ok,e-30);d=vd(d);continue;case 38:switch(ee(d)){case 2:var f=jg(3,kg(2,d));e=J(f,0,null);var h=J(f,1,null);f=J(f,2,null);t(f)?(c=Qr(c,Ok,new R(null,3,5,T,[e,h,f],null)),d=kg(5,d)):d=kg(2,d);continue;case 5:e=y(kg(2,d));t(e)?(c=Qr(c,Ok,e),d=kg(3,d)):d=kg(2,d);continue;default:d=vd(d);continue}case 39:c=Rr(c,Ok);d=vd(d);continue;case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:c=Qr(c,Tn,e-40);d=vd(d);continue;
+case 48:switch(ee(d)){case 2:f=jg(3,kg(2,d));e=J(f,0,null);h=J(f,1,null);f=J(f,2,null);t(f)?(c=Qr(c,Tn,new R(null,3,5,T,[e,h,f],null)),d=kg(5,d)):d=kg(2,d);continue;case 5:e=y(kg(2,d));t(e)?(c=Qr(c,Tn,e),d=kg(3,d)):d=kg(2,d);continue;default:d=vd(d);continue}case 49:c=Rr(c,Tn);d=vd(d);continue;case 90:case 91:case 92:case 93:case 94:case 95:case 96:case 97:c=Qr(c,Ok,e-82);d=vd(d);continue;case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:c=Qr(c,Tn,e-92);d=vd(d);continue;default:d=
+vd(d)}}else return c}function Cu(a){var b=E(Tt(a));return Cg(a,V,Bu,b?b:new R(null,1,5,T,[0],null))}function Du(a){var b=Ut(a,0,1)-1;return Cg(a,V,bs,b)}function Eu(a){return G.c(D.c(rk.h(a),0),33)?Bg(a,V,It):a}function Fu(a){var b=Ut(a,0,1)-1,c=function(){var b=null==a?null:Ut(a,1,null);return null==b?null:b-1}();return Bg(a,V,function(a,b){return function(c){c=null!=c&&(c.m&64||q===c.G)?P(U,c):c;var d=D.c(c,no),e=t(b)?b:d-1;c=-1<a&&a<e&&e<d?K.A(c,Hn,a,be([Yj,e])):c;return cs(c)}}(b,c))}
+function Gu(a,b){var c=function(){switch(b){case 8:return Vt;case 9:return Wt;case 10:return Yt;case 11:return Yt;case 12:return Yt;case 13:return Xt;case 14:return Zt;case 15:return $t;case 132:return Yt;case 133:return au;case 136:return bu;case 141:return cu;default:return null}}();return t(c)?c.h?c.h(a):c.call(null,a):a}
+var Hu=Pe([zj,Pj,Wj,ak,xl,Pl,Rl,Ul,Xl,um,Fm,Fn,In,po],[function(a){return a},function(a,b){var c=D.c(rk.h(a),0);try{if(null===c)try{if(t(function(){return function(){return function(a){return 64<=a&&95>=a}}(c,b)(b)}()))return Gu(a,b+64);throw Jt;}catch(h){if(h instanceof Error){var d=h;if(d===Jt)try{if(55===b)return Bg(a,V,ms);throw Jt;}catch(k){if(k instanceof Error){var e=k;if(e===Jt)try{if(56===b)return Bg(a,V,ns);throw Jt;}catch(l){if(l instanceof Error){var f=l;if(f===Jt)try{if(99===b)return du(a);
+throw Jt;}catch(p){if(p instanceof Error){d=p;if(d===Jt)throw Jt;throw d;}throw p;}else throw f;}else throw l;}else throw e;}else throw k;}else throw d;}else throw h;}else throw Jt;}catch(h){if(h instanceof Error)if(d=h,d===Jt)try{if(35===c)try{if(56===b)return Bg(a,V,pt);throw Jt;}catch(k){if(k instanceof Error){e=k;if(e===Jt)throw Jt;throw e;}throw k;}else throw Jt;}catch(k){if(k instanceof Error)if(e=k,e===Jt)try{if(40===c)try{if(48===b)return Zt(a);throw Jt;}catch(l){if(l instanceof Error){f=
+l;if(f===Jt)return $t(a);throw f;}throw l;}else throw Jt;}catch(l){if(l instanceof Error){f=l;if(f===Jt)return a;throw f;}throw l;}else throw e;else throw k;}else throw d;else throw h;}},function(a){return a},function(a){return a},Gu,function(a,b){return Cg(a,V,ot,b)},function(a,b){var c=function(){switch(b){case 64:return eu;case 65:return fu;case 66:return gu;case 67:return hu;case 68:return iu;case 69:return ju;case 70:return ku;case 71:return lu;case 72:return mu;case 73:return nu;case 74:return ou;
+case 75:return pu;case 76:return su;case 77:return tu;case 80:return uu;case 83:return qu;case 84:return ru;case 87:return vu;case 88:return wu;case 90:return xu;case 96:return lu;case 97:return hu;case 100:return Du;case 101:return fu;case 102:return mu;case 103:return yu;case 104:return zu;case 108:return Au;case 109:return Cu;case 112:return Eu;case 114:return Fu;default:return null}}();return t(c)?c.h?c.h(a):c.call(null,a):a},function(a){return a},function(a,b){return K.l(a,kk,ge.c(kk.h(a),b))},
+function(a){return a},function(a,b){return K.l(a,rk,ge.c(rk.h(a),b))},function(a){return a},function(a){return a},function(a){return K.A(a,rk,he,be([kk,he]))}]);function Iu(a,b){for(var c=a,d=Tl.h(c),e=b;;){var f=y(e);if(t(f)){var h=160<=f?65:f;h=D.c(d.h?d.h(xq):d.call(null,xq),h);d=J(h,0,null);h=J(h,1,null);a:for(;;)if(E(h)){var k=y(h);k=Hu.h?Hu.h(k):Hu.call(null,k);c=k.c?k.c(c,f):k.call(null,c,f);h=z(h)}else break a;e=vd(e)}else return K.l(c,Tl,d)}}
+function Ju(a,b){var c=xg(function(a){return a.codePointAt(0)},b);return Iu(a,c)}
+function Ku(a,b){try{if(ze(b)&&3===H(b)){var c=Vd(b,0),d=Vd(b,1),e=Vd(b,2);return[v.h(a+8),";2;",v.h(c),";",v.h(d),";",v.h(e)].join("")}throw Jt;}catch(k){if(k instanceof Error){var f=k;if(f===Jt)try{if(t(function(){return function(){return function(a){return 8>a}}(f)(b)}()))return""+v.h(a+b);throw Jt;}catch(l){if(l instanceof Error){var h=l;if(h===Jt)try{if(t(function(){return function(){return function(a){return 16>a}}(h,f)(b)}()))return""+v.h(a+52+b);throw Jt;}catch(p){if(p instanceof Error){c=
+p;if(c===Jt)return[v.h(a+8),";5;",v.h(b)].join("");throw c;}throw p;}else throw h;}else throw l;}else throw f;}else throw k;}}ag.c(Ku,30);ag.c(Ku,40);var Lu=function Lu(a){if(null!=a&&null!=a.yd)return a.yd(a);var c=Lu[n(null==a?null:a)];if(null!=c)return c.h?c.h(a):c.call(null,a);c=Lu._;if(null!=c)return c.h?c.h(a):c.call(null,a);throw Cb("Screen.lines",a);},Mu=function Mu(a){if(null!=a&&null!=a.xd)return a.xd(a);var c=Mu[n(null==a?null:a)];if(null!=c)return c.h?c.h(a):c.call(null,a);c=Mu._;if(null!=c)return c.h?c.h(a):c.call(null,a);throw Cb("Screen.cursor",a);};function Nu(a,b){var c=0<a?a:0;return b<c?b:c}function Ou(a){return function(b){return function(){return((new Date).getTime()-b.getTime())/1E3*a}}(new Date)}function Pu(a){return document[a]}
+function Qu(a){return function(b){var c=new hg(null);bd(c,c);return function(c){return function(){function d(d,e){if(B(c)===c){var f=bd(c,e);return b.c?b.c(d,f):b.call(null,d,f)}var h=bd(c,function(){var b=B(c);return a.c?a.c(b,e):a.call(null,b,e)}());return Hd(h)?Id(function(){var a=B(h);return b.c?b.c(d,a):b.call(null,d,a)}()):b.c?b.c(d,h):b.call(null,d,h)}function f(a){return B(c)===c?a:b.h?b.h(a):b.call(null,a)}function h(){return b.B?b.B():b.call(null)}var k=null;k=function(a,b){switch(arguments.length){case 0:return h.call(this);
+case 1:return f.call(this,a);case 2:return d.call(this,a,b)}throw Error("Invalid arity: "+(arguments.length-1));};k.B=h;k.h=f;k.c=d;return k}()}(c)}}
+function Ru(a,b){return function(c){var d=new hg(null);bd(d,d);return function(d){return function(){function e(e,f){for(;;)if(B(d)===d){var h=function(){var a=e,f=bd(d,b);return c.c?c.c(a,f):c.call(null,a,f)}();if(Hd(h))return h;var k=f;e=h;f=k}else{var m=bd(d,function(){var b=B(d),c=f;return a.c?a.c(b,c):a.call(null,b,c)}());return Hd(m)?Id(function(){var a=e,b=B(m);return c.c?c.c(a,b):c.call(null,a,b)}()):c.c?c.c(e,m):c.call(null,e,m)}}function h(a){B(d)===d&&(a=Jd(c.c?c.c(a,b):c.call(null,a,b)));
+return c.h?c.h(a):c.call(null,a)}function k(){return c.B?c.B():c.call(null)}var l=null;l=function(a,b){switch(arguments.length){case 0:return k.call(this);case 1:return h.call(this,a);case 2:return e.call(this,a,b)}throw Error("Invalid arity: "+(arguments.length-1));};l.B=k;l.h=h;l.c=e;return l}()}(d)}};function Su(a,b){return ig.c(function(b){var c=J(b,0,null);b=J(b,1,null);return new R(null,2,5,T,[c,a.h?a.h(b):a.call(null,b)],null)},b)}var Tu=function Tu(a,b){return new kf(null,function(){if(E(a)){if(E(b)){var d=y(a),e=J(d,0,null);J(d,1,null);var f=y(b),h=J(f,0,null);J(f,1,null);return e<h?ae(d,function(){var d=vd(a);return Tu.c?Tu.c(d,b):Tu.call(null,d,b)}()):ae(f,function(){var d=vd(b);return Tu.c?Tu.c(a,d):Tu.call(null,a,d)}())}return a}return null},null,null)};
+function Uu(a,b){var c=J(b,0,null),d=J(b,1,null);return new R(null,2,5,T,[c+a,d],null)}function Vu(a,b){var c=J(b,0,null),d=J(b,1,null);return new R(null,2,5,T,[c/a,d],null)}function Wu(a){return ig.h(function(b){var c=J(b,0,null),d=J(b,1,null);return t(a)?new R(null,2,5,T,[c<a?c:a,d],null):b})}function Xu(a,b){return y(b)<a}function Yu(a,b,c){return Uf($f.l(mg(ag.c(Xu,a)),ig.h(ag.c(Uu,-a)),ig.h(ag.c(Vu,b))),c)}function Zu(a,b){return y(b)<=a}function $u(a,b){return fe(Bi(ag.c(Zu,a),b))}
+function av(a,b){return Ru(function(b,d){J(b,0,null);var c=J(b,1,null),f=J(d,0,null),h=J(d,1,null);return new R(null,2,5,T,[f,a.c?a.c(c,h):a.call(null,c,h)],null)},new R(null,2,5,T,[0,b],null))}function bv(){return Qu(function(a,b){var c=J(a,0,null);J(a,1,null);var d=J(b,0,null),e=J(b,1,null);return new R(null,2,5,T,[c+d,e],null)})}
+function cv(){return function(a){return function(b){return function(){function c(c,d){var e=J(d,0,null),f=J(d,1,null),h=e-B(b);bd(b,e);e=new R(null,2,5,T,[h,f],null);return a.c?a.c(c,e):a.call(null,c,e)}function d(b){return a.h?a.h(b):a.call(null,b)}function e(){return a.B?a.B():a.call(null)}var f=null;f=function(a,b){switch(arguments.length){case 0:return e.call(this);case 1:return d.call(this,a);case 2:return c.call(this,a,b)}throw Error("Invalid arity: "+(arguments.length-1));};f.B=e;f.h=d;f.c=
+c;return f}()}(new hg(0))}};function dv(a,b,c,d){return Uf($f.A(tg(function(a){return G.c(ee(a),"o")}),ig.h(Hi(function(a){return Vd(a,2)})),cv(),be([Wu(d),bv(),av(Ju,Ot(b,c))])),a)};function ev(a){var b=be([gj,!0]);if(null!=a?q===a.lf||(a.Tc?0:Ab(dj,a)):Ab(dj,a))return ej(a,P(ci,b));if(E(b)){var c=null!=b&&(b.m&64||q===b.G)?P(U,b):b,d=D.c(c,gj);return function(a,b,c,d){return function m(e){return De(e)?Ii(ig.c(m,e)):ue(e)?wg.l(ie(e),ig.h(m),e):vb(e)?Qc(Mb(function(){return function(a,b){return uf.c(a,m(b))}}(a,b,c,d),Oc(he),e)):Bb(e)===Object?Qc(Mb(function(a,b,c,d){return function(a,b){var c=d.h?d.h(b):d.call(null,b),f=m(e[b]);return Rc(a,c,f)}}(a,b,c,d),Oc(Ef),Ea(e))):e}}(b,
+c,d,t(d)?hf:v)(a)}return null};function fv(a,b,c,d,e){this.cursor=a;this.lines=b;this.v=c;this.j=d;this.w=e;this.m=2229667594;this.J=139264}g=fv.prototype;g.V=function(a,b){return this.I(null,b,null)};g.I=function(a,b,c){switch(b instanceof L?b.ea:null){case "cursor":return this.cursor;case "lines":return this.lines;default:return D.l(this.j,b,c)}};
+g.R=function(a,b,c){return Y(b,function(){return function(a){return Y(b,Qi,""," ","",c,a)}}(this),"#asciinema.player.asciicast.v0.LegacyScreen{",", ","}",c,O.c(new R(null,2,5,T,[new R(null,2,5,T,[pl,this.cursor],null),new R(null,2,5,T,[il,this.lines],null)],null),this.j))};g.ba=function(){return new fh(0,this,2,new R(null,2,5,T,[pl,il],null),t(this.j)?dd(this.j):Cf())};g.P=function(){return this.v};g.W=function(){return 2+H(this.j)};
+g.U=function(){var a=this,b=this.w;if(null!=b)return b;var c=function(){return function(){return function(a){return 1528554851^Dd(a)}}(b,a)(a)}();return this.w=c};g.K=function(a,b){return null!=b&&this.constructor===b.constructor&&G.c(this.cursor,b.cursor)&&G.c(this.lines,b.lines)&&G.c(this.j,b.j)};g.ga=function(a,b){return He(new ti(null,new r(null,2,[il,null,pl,null],null),null),b)?le.c(tc(wg.c(Ef,this),this.v),b):new fv(this.cursor,this.lines,this.v,Bf(le.c(this.j,b)),null)};
+g.O=function(a,b,c){return t(N.c?N.c(pl,b):N.call(null,pl,b))?new fv(c,this.lines,this.v,this.j,null):t(N.c?N.c(il,b):N.call(null,il,b))?new fv(this.cursor,c,this.v,this.j,null):new fv(this.cursor,this.lines,this.v,K.l(this.j,b,c),null)};g.S=function(){return E(O.c(new R(null,2,5,T,[new R(null,2,5,T,[pl,this.cursor],null),new R(null,2,5,T,[il,this.lines],null)],null),this.j))};g.T=function(a,b){return new fv(this.cursor,this.lines,b,this.j,this.w)};
+g.X=function(a,b){return ze(b)?this.O(null,A.c(b,0),A.c(b,1)):Mb(Tb,this,b)};function gv(a,b){return y(fe(Uf($f.c(Wu(b),bv()),a)))}function hv(a){return wg.c(Ef,ig.c(function(a){var b=J(a,0,null);a=J(a,1,null);var d=T;b=jf(b);return new R(null,2,5,d,[parseInt(b,10),a],null)},a))}function iv(a,b){var c=Bg(b,il,hv);return ii.A(hi,be([a,c]))}
+function jv(a,b){var c=new r(null,2,[il,di(),pl,new r(null,3,[zn,0,Aj,0,On,!0],null)],null);c=new fv(pl.h(c),il.h(c),null,Bf(le.A(c,pl,be([il]))),null);return Uf($f.l(Wu(b),bv(),av(iv,c)),a)}function kv(a,b){var c=il.h(fe(y(a))),d=Te(Xe,ig.c(function(){return function(a){return H(y(a))}}(c),y(mh(c))));c=H(c);return new r(null,5,[Mn,0,fl,d,no,c,wl,gv(a,b),Uk,jv(a,b)],null)}g.yd=function(){return Wg(mh(il.h(this)))};g.xd=function(){return pl.h(this)};function lv(a){return ev(JSON.parse(a))}function mv(a,b,c,d){if(G.c(Mn.h(a),1)){b=t(b)?b:fl.h(a);c=t(c)?c:no.h(a);var e=ko.h(a);a=y(fe(Uf($f.c(Wu(d),bv()),e)));d=Uf($f.l(Wu(d),bv(),av(Ju,Ot(b,c))),e);d=new r(null,5,[Mn,1,fl,b,no,c,wl,a,Uk,d],null)}else d=null;return d}
+function nv(a,b,c,d){var e=y(a);G.c(Mn.h(e),2)?(e=y(a),a=vd(a),b=t(b)?b:fl.h(e),c=t(c)?c:no.h(e),d=t(d)?d:Qj.h(e),e=y(fe(Uf($f.l(cv(),Wu(d),bv()),a))),d=new r(null,5,[Mn,2,fl,b,no,c,wl,e,Uk,dv(a,b,c,d)],null)):d=t(il.h(ee(e)))?kv(a,d):null;return d}function ov(a,b,c,d){try{var e=lv(a);return we(e)?nv(e,b,c,d):xe(e)?mv(e,b,c,d):null}catch(k){try{var f=Fo(ra(a),"\n");var h=ig.c(lv,f);return nv(h,b,c,d)}catch(l){return null}}}
+function pv(a,b,c,d){var e="string"===typeof a?ov:we(a)?nv:xe(a)?mv:null;a=t(e)?e.M?e.M(a,b,c,d):e.call(null,a,b,c,d):null;if(t(a))return a;throw"only asciicast v1 and v2 formats can be opened";}Lt.prototype.yd=function(){return xg(Ht,il.h(V.h(this)))};Lt.prototype.xd=function(){return pl.h(V.h(this))};var qv;a:{var rv=ba.navigator;if(rv){var sv=rv.userAgent;if(sv){qv=sv;break a}}qv=""}function tv(a){return-1!=qv.indexOf(a)};var uv;
+function vv(){var a=ba.MessageChannel;"undefined"===typeof a&&"undefined"!==typeof window&&window.postMessage&&window.addEventListener&&!tv("Presto")&&(a=function(){var a=document.createElement("IFRAME");a.style.display="none";a.src="";document.documentElement.appendChild(a);var b=a.contentWindow;a=b.document;a.open();a.write("");a.close();var c="callImmediate"+Math.random(),d="file:"==b.location.protocol?"*":b.location.protocol+"//"+b.location.host;a=pa(function(a){if(("*"==d||a.origin==d)&&a.data==
+c)this.port1.onmessage()},this);b.addEventListener("message",a,!1);this.port1={};this.port2={postMessage:function(){b.postMessage(c,d)}}});if("undefined"!==typeof a&&!tv("Trident")&&!tv("MSIE")){var b=new a,c={},d=c;b.port1.onmessage=function(){if(void 0!==c.next){c=c.next;var a=c.ed;c.ed=null;a()}};return function(a){d.next={ed:a};d=d.next;b.port2.postMessage(0)}}return"undefined"!==typeof document&&"onreadystatechange"in document.createElement("SCRIPT")?function(a){var b=document.createElement("SCRIPT");
+b.onreadystatechange=function(){b.onreadystatechange=null;b.parentNode.removeChild(b);b=null;a();a=null};document.documentElement.appendChild(b)}:function(a){ba.setTimeout(a,0)}};function wv(){0!=xv&&(yv[ja(this)]=this);this.od=this.od;this.Wd=this.Wd}var xv=0,yv={};wv.prototype.od=!1;wv.prototype.nd=function(){if(this.Wd)for(;this.Wd.length;)this.Wd.shift()()};function zv(){return tv("iPhone")&&!tv("iPod")&&!tv("iPad")};var Av=tv("Opera"),Bv=tv("Trident")||tv("MSIE"),Cv=tv("Edge"),Dv=tv("Gecko")&&!(-1!=qv.toLowerCase().indexOf("webkit")&&!tv("Edge"))&&!(tv("Trident")||tv("MSIE"))&&!tv("Edge"),Ev=-1!=qv.toLowerCase().indexOf("webkit")&&!tv("Edge");Ev&&tv("Mobile");tv("Macintosh");tv("Windows");tv("Linux")||tv("CrOS");var Fv=ba.navigator||null;Fv&&(Fv.appVersion||"").indexOf("X11");tv("Android");zv();tv("iPad");tv("iPod");zv()||tv("iPad")||tv("iPod");function Gv(){var a=ba.document;return a?a.documentMode:void 0}var Hv;
+a:{var Iv="",Jv=function(){var a=qv;if(Dv)return/rv\:([^\);]+)(\)|;)/.exec(a);if(Cv)return/Edge\/([\d\.]+)/.exec(a);if(Bv)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(Ev)return/WebKit\/(\S+)/.exec(a);if(Av)return/(?:Version)[ \/]?(\S+)/.exec(a)}();Jv&&(Iv=Jv?Jv[1]:"");if(Bv){var Kv=Gv();if(null!=Kv&&Kv>parseFloat(Iv)){Hv=String(Kv);break a}}Hv=Iv}var gb={};
+function Lv(a){return fb(a,function(){for(var b=0,c=ra(String(Hv)).split("."),d=ra(String(a)).split("."),e=Math.max(c.length,d.length),f=0;0==b&&f<e;f++){var h=c[f]||"",k=d[f]||"";do{h=/(\d*)(\D*)(.*)/.exec(h)||["","","",""];k=/(\d*)(\D*)(.*)/.exec(k)||["","","",""];if(0==h[0].length&&0==k[0].length)break;b=ta(0==h[1].length?0:parseInt(h[1],10),0==k[1].length?0:parseInt(k[1],10))||ta(0==h[2].length,0==k[2].length)||ta(h[2],k[2]);h=h[3];k=k[3]}while(0==b)}return 0<=b})}var Mv;var Nv=ba.document;
+Mv=Nv&&Bv?Gv()||("CSS1Compat"==Nv.compatMode?parseInt(Hv,10):5):void 0;var Ov;(Ov=!Bv)||(Ov=9<=Number(Mv));var Pv=Ov,Qv=Bv&&!Lv("9");!Ev||Lv("528");Dv&&Lv("1.9b")||Bv&&Lv("8")||Av&&Lv("9.5")||Ev&&Lv("528");Dv&&!Lv("8")||Bv&&Lv("9");var Rv=function(){if(!ba.addEventListener||!Object.defineProperty)return!1;var a=!1,b=Object.defineProperty({},"passive",{get:function(){a=!0}});ba.addEventListener("test",ea,b);ba.removeEventListener("test",ea,b);return a}();function Sv(a,b){this.type=a;this.currentTarget=this.target=b;this.defaultPrevented=this.Kc=!1;this.af=!0}Sv.prototype.stopPropagation=function(){this.Kc=!0};Sv.prototype.preventDefault=function(){this.defaultPrevented=!0;this.af=!1};function Tv(a,b){Sv.call(this,a?a.type:"");this.relatedTarget=this.currentTarget=this.target=null;this.button=this.screenY=this.screenX=this.clientY=this.clientX=this.offsetY=this.offsetX=0;this.key="";this.charCode=this.keyCode=0;this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1;this.pd=this.state=null;if(a){var c=this.type=a.type,d=a.changedTouches?a.changedTouches[0]:null;this.target=a.target||a.srcElement;this.currentTarget=b;var e=a.relatedTarget;if(e){if(Dv){a:{try{eb(e.nodeName);var f=
+!0;break a}catch(h){}f=!1}f||(e=null)}}else"mouseover"==c?e=a.fromElement:"mouseout"==c&&(e=a.toElement);this.relatedTarget=e;null===d?(this.offsetX=Ev||void 0!==a.offsetX?a.offsetX:a.layerX,this.offsetY=Ev||void 0!==a.offsetY?a.offsetY:a.layerY,this.clientX=void 0!==a.clientX?a.clientX:a.pageX,this.clientY=void 0!==a.clientY?a.clientY:a.pageY,this.screenX=a.screenX||0,this.screenY=a.screenY||0):(this.clientX=void 0!==d.clientX?d.clientX:d.pageX,this.clientY=void 0!==d.clientY?d.clientY:d.pageY,this.screenX=
+d.screenX||0,this.screenY=d.screenY||0);this.button=a.button;this.keyCode=a.keyCode||0;this.key=a.key||"";this.charCode=a.charCode||("keypress"==c?a.keyCode:0);this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=a.shiftKey;this.metaKey=a.metaKey;this.state=a.state;this.pd=a;a.defaultPrevented&&this.preventDefault()}}qa(Tv,Sv);Tv.prototype.stopPropagation=function(){Tv.Zd.stopPropagation.call(this);this.pd.stopPropagation?this.pd.stopPropagation():this.pd.cancelBubble=!0};
+Tv.prototype.preventDefault=function(){Tv.Zd.preventDefault.call(this);var a=this.pd;if(a.preventDefault)a.preventDefault();else if(a.returnValue=!1,Qv)try{if(a.ctrlKey||112<=a.keyCode&&123>=a.keyCode)a.keyCode=-1}catch(b){}};var Uv="closure_listenable_"+(1E6*Math.random()|0),Vv=0;function Wv(a,b,c,d,e){this.listener=a;this.Xd=null;this.src=b;this.type=c;this.capture=!!d;this.Ub=e;this.key=++Vv;this.$c=this.Fd=!1}function Xv(a){a.$c=!0;a.listener=null;a.Xd=null;a.src=null;a.Ub=null};function Yv(a){this.src=a;this.rb={};this.wd=0}Yv.prototype.add=function(a,b,c,d,e){var f=a.toString();a=this.rb[f];a||(a=this.rb[f]=[],this.wd++);var h=Zv(a,b,d,e);-1<h?(b=a[h],c||(b.Fd=!1)):(b=new Wv(b,this.src,f,!!d,e),b.Fd=c,a.push(b));return b};Yv.prototype.remove=function(a,b,c,d){a=a.toString();if(!(a in this.rb))return!1;var e=this.rb[a];b=Zv(e,b,c,d);return-1<b?(Xv(e[b]),Array.prototype.splice.call(e,b,1),0==e.length&&(delete this.rb[a],this.wd--),!0):!1};
+function $v(a,b){var c=b.type;c in a.rb&&ya(a.rb[c],b)&&(Xv(b),0==a.rb[c].length&&(delete a.rb[c],a.wd--))}Yv.prototype.re=function(a,b,c,d){a=this.rb[a.toString()];var e=-1;a&&(e=Zv(a,b,c,d));return-1<e?a[e]:null};function Zv(a,b,c,d){for(var e=0;e<a.length;++e){var f=a[e];if(!f.$c&&f.listener==b&&f.capture==!!c&&f.Ub==d)return e}return-1};var aw="closure_lm_"+(1E6*Math.random()|0),bw={},cw=0;function dw(a,b,c,d,e){if(d&&d.once)ew(a,b,c,d,e);else if("array"==n(b))for(var f=0;f<b.length;f++)dw(a,b[f],c,d,e);else c=fw(c),a&&a[Uv]?a.Ib.add(String(b),c,!1,ia(d)?!!d.capture:!!d,e):gw(a,b,c,!1,d,e)}
+function gw(a,b,c,d,e,f){if(!b)throw Error("Invalid event type");var h=ia(e)?!!e.capture:!!e,k=hw(a);k||(a[aw]=k=new Yv(a));c=k.add(b,c,d,h,f);if(!c.Xd){d=iw();c.Xd=d;d.src=a;d.listener=c;if(a.addEventListener)Rv||(e=h),void 0===e&&(e=!1),a.addEventListener(b.toString(),d,e);else if(a.attachEvent)a.attachEvent(jw(b.toString()),d);else throw Error("addEventListener and attachEvent are unavailable.");cw++}}
+function iw(){var a=kw,b=Pv?function(c){return a.call(b.src,b.listener,c)}:function(c){c=a.call(b.src,b.listener,c);if(!c)return c};return b}function ew(a,b,c,d,e){if("array"==n(b))for(var f=0;f<b.length;f++)ew(a,b[f],c,d,e);else c=fw(c),a&&a[Uv]?a.Ib.add(String(b),c,!0,ia(d)?!!d.capture:!!d,e):gw(a,b,c,!0,d,e)}
+function lw(a,b,c,d,e){if("array"==n(b))for(var f=0;f<b.length;f++)lw(a,b[f],c,d,e);else d=ia(d)?!!d.capture:!!d,c=fw(c),a&&a[Uv]?a.Ib.remove(String(b),c,d,e):a&&(a=hw(a))&&(b=a.re(b,c,d,e))&&mw(b)}function mw(a){if("number"!=typeof a&&a&&!a.$c){var b=a.src;if(b&&b[Uv])$v(b.Ib,a);else{var c=a.type,d=a.Xd;b.removeEventListener?b.removeEventListener(c,d,a.capture):b.detachEvent&&b.detachEvent(jw(c),d);cw--;(c=hw(b))?($v(c,a),0==c.wd&&(c.src=null,b[aw]=null)):Xv(a)}}}
+function jw(a){return a in bw?bw[a]:bw[a]="on"+a}function nw(a,b,c,d){var e=!0;if(a=hw(a))if(b=a.rb[b.toString()])for(b=b.concat(),a=0;a<b.length;a++){var f=b[a];f&&f.capture==c&&!f.$c&&(f=ow(f,d),e=e&&!1!==f)}return e}function ow(a,b){var c=a.listener,d=a.Ub||a.src;a.Fd&&mw(a);return c.call(d,b)}
+function kw(a,b){if(a.$c)return!0;if(!Pv){var c;if(!(c=b))a:{c=["window","event"];for(var d=ba,e;e=c.shift();)if(null!=d[e])d=d[e];else{c=null;break a}c=d}e=c;c=new Tv(e,this);d=!0;if(!(0>e.keyCode||void 0!=e.returnValue)){a:{var f=!1;if(0==e.keyCode)try{e.keyCode=-1;break a}catch(l){f=!0}if(f||void 0==e.returnValue)e.returnValue=!0}e=[];for(f=c.currentTarget;f;f=f.parentNode)e.push(f);f=a.type;for(var h=e.length-1;!c.Kc&&0<=h;h--){c.currentTarget=e[h];var k=nw(e[h],f,!0,c);d=d&&k}for(h=0;!c.Kc&&
+h<e.length;h++)c.currentTarget=e[h],k=nw(e[h],f,!1,c),d=d&&k}return d}return ow(a,new Tv(b,this))}function hw(a){a=a[aw];return a instanceof Yv?a:null}var pw="__closure_events_fn_"+(1E9*Math.random()>>>0);function fw(a){if(ha(a))return a;a[pw]||(a[pw]=function(b){return a.handleEvent(b)});return a[pw]};function qw(){wv.call(this);this.Ib=new Yv(this);this.ff=this;this.ve=null}qa(qw,wv);qw.prototype[Uv]=!0;g=qw.prototype;g.addEventListener=function(a,b,c,d){dw(this,a,b,c,d)};g.removeEventListener=function(a,b,c,d){lw(this,a,b,c,d)};
+g.dispatchEvent=function(a){var b,c=this.ve;if(c)for(b=[];c;c=c.ve)b.push(c);c=this.ff;var d=a.type||a;if(ca(a))a=new Sv(a,c);else if(a instanceof Sv)a.target=a.target||c;else{var e=a;a=new Sv(d,c);Ia(a,e)}e=!0;if(b)for(var f=b.length-1;!a.Kc&&0<=f;f--){var h=a.currentTarget=b[f];e=rw(h,d,!0,a)&&e}a.Kc||(h=a.currentTarget=c,e=rw(h,d,!0,a)&&e,a.Kc||(e=rw(h,d,!1,a)&&e));if(b)for(f=0;!a.Kc&&f<b.length;f++)h=a.currentTarget=b[f],e=rw(h,d,!1,a)&&e;return e};
+g.nd=function(){qw.Zd.nd.call(this);if(this.Ib){var a=this.Ib,b=0,c;for(c in a.rb){for(var d=a.rb[c],e=0;e<d.length;e++)++b,Xv(d[e]);delete a.rb[c];a.wd--}}this.ve=null};function rw(a,b,c,d){b=a.Ib.rb[String(b)];if(!b)return!0;b=b.concat();for(var e=!0,f=0;f<b.length;++f){var h=b[f];if(h&&!h.$c&&h.capture==c){var k=h.listener,l=h.Ub||h.src;h.Fd&&$v(a.Ib,h);e=!1!==k.call(l,d)&&e}}return e&&0!=d.af}g.re=function(a,b,c,d){return this.Ib.re(String(a),b,c,d)};function sw(a,b,c){if(ha(a))c&&(a=pa(a,c));else if(a&&"function"==typeof a.handleEvent)a=pa(a.handleEvent,a);else throw Error("Invalid listener argument");return 2147483647<Number(b)?-1:ba.setTimeout(a,b||0)};function tw(){}tw.prototype.Ke=null;function uw(a){var b;(b=a.Ke)||(b={},vw(a)&&(b[0]=!0,b[1]=!0),b=a.Ke=b);return b};var ww;function xw(){}qa(xw,tw);function yw(a){return(a=vw(a))?new ActiveXObject(a):new XMLHttpRequest}function vw(a){if(!a.Te&&"undefined"==typeof XMLHttpRequest&&"undefined"!=typeof ActiveXObject){for(var b=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],c=0;c<b.length;c++){var d=b[c];try{return new ActiveXObject(d),a.Te=d}catch(e){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed");}return a.Te}ww=new xw;function zw(a){qw.call(this);this.headers=new Ma;this.ce=a||null;this.oc=!1;this.be=this.ca=null;this.ue="";this.Ic=this.se=this.Sd=this.qe=!1;this.Ae=0;this.$d=null;this.$e=Aw;this.Be=this.Lf=this.ef=!1}qa(zw,qw);var Aw="",Bw=/^https?$/i,Cw=["POST","PUT"],Dw=[];function Ew(a,b){var c=new zw;Dw.push(c);b&&c.Ib.add("complete",b,!1,void 0,void 0);c.Ib.add("ready",c.gf,!0,void 0,void 0);c.send(a,void 0,void 0,void 0);return c}g=zw.prototype;
+g.gf=function(){if(!this.od&&(this.od=!0,this.nd(),0!=xv)){var a=ja(this);delete yv[a]}ya(Dw,this)};
+g.send=function(a,b,c,d){if(this.ca)throw Error("[goog.net.XhrIo] Object is active with another request\x3d"+this.ue+"; newUri\x3d"+a);b=b?b.toUpperCase():"GET";this.ue=a;this.qe=!1;this.oc=!0;this.ca=this.ce?yw(this.ce):yw(ww);this.be=this.ce?uw(this.ce):uw(ww);this.ca.onreadystatechange=pa(this.Ye,this);this.Lf&&"onprogress"in this.ca&&(this.ca.onprogress=pa(function(a){this.Xe(a,!0)},this),this.ca.upload&&(this.ca.upload.onprogress=pa(this.Xe,this)));try{this.se=!0,this.ca.open(b,String(a),!0),
+this.se=!1}catch(f){Fw(this);return}a=c||"";var e=this.headers.clone();d&&La(d,function(a,b){e.set(b,a)});d=wa(e.Xc());c=ba.FormData&&a instanceof ba.FormData;!(0<=ua(Cw,b))||d||c||e.set("Content-Type","application/x-www-form-urlencoded;charset\x3dutf-8");e.forEach(function(a,b){this.ca.setRequestHeader(b,a)},this);this.$e&&(this.ca.responseType=this.$e);"withCredentials"in this.ca&&this.ca.withCredentials!==this.ef&&(this.ca.withCredentials=this.ef);try{Gw(this),0<this.Ae&&((this.Be=Hw(this.ca))?
+(this.ca.timeout=this.Ae,this.ca.ontimeout=pa(this.cf,this)):this.$d=sw(this.cf,this.Ae,this)),this.Sd=!0,this.ca.send(a),this.Sd=!1}catch(f){Fw(this)}};function Hw(a){return Bv&&Lv(9)&&"number"==typeof a.timeout&&void 0!==a.ontimeout}function xa(a){return"content-type"==a.toLowerCase()}g.cf=function(){"undefined"!=typeof aa&&this.ca&&(this.dispatchEvent("timeout"),this.abort(8))};function Fw(a){a.oc=!1;a.ca&&(a.Ic=!0,a.ca.abort(),a.Ic=!1);Iw(a);Jw(a)}
+function Iw(a){a.qe||(a.qe=!0,a.dispatchEvent("complete"),a.dispatchEvent("error"))}g.abort=function(){this.ca&&this.oc&&(this.oc=!1,this.Ic=!0,this.ca.abort(),this.Ic=!1,this.dispatchEvent("complete"),this.dispatchEvent("abort"),Jw(this))};g.nd=function(){this.ca&&(this.oc&&(this.oc=!1,this.Ic=!0,this.ca.abort(),this.Ic=!1),Jw(this,!0));zw.Zd.nd.call(this)};g.Ye=function(){this.od||(this.se||this.Sd||this.Ic?Kw(this):this.If())};g.If=function(){Kw(this)};
+function Kw(a){if(a.oc&&"undefined"!=typeof aa&&(!a.be[1]||4!=Lw(a)||2!=Mw(a)))if(a.Sd&&4==Lw(a))sw(a.Ye,0,a);else if(a.dispatchEvent("readystatechange"),4==Lw(a)){a.oc=!1;try{var b=Mw(a);a:switch(b){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var c=!0;break a;default:c=!1}var d;if(!(d=c)){var e;if(e=0===b){var f=String(a.ue).match(Pa)[1]||null;if(!f&&ba.self&&ba.self.location){var h=ba.self.location.protocol;f=h.substr(0,h.length-1)}e=!Bw.test(f?f.toLowerCase():"")}d=e}d?(a.dispatchEvent("complete"),
+a.dispatchEvent("success")):Iw(a)}finally{Jw(a)}}}g.Xe=function(a,b){this.dispatchEvent(Nw(a,"progress"));this.dispatchEvent(Nw(a,b?"downloadprogress":"uploadprogress"))};function Nw(a,b){return{type:b,lengthComputable:a.lengthComputable,loaded:a.loaded,total:a.total}}function Jw(a,b){if(a.ca){Gw(a);var c=a.ca,d=a.be[0]?ea:null;a.ca=null;a.be=null;b||a.dispatchEvent("ready");try{c.onreadystatechange=d}catch(e){}}}
+function Gw(a){a.ca&&a.Be&&(a.ca.ontimeout=null);"number"==typeof a.$d&&(ba.clearTimeout(a.$d),a.$d=null)}function Lw(a){return a.ca?a.ca.readyState:0}function Mw(a){try{return 2<Lw(a)?a.ca.status:-1}catch(b){return-1}}g.getResponseHeader=function(a){if(this.ca&&4==Lw(this))return a=this.ca.getResponseHeader(a),null===a?void 0:a};g.getAllResponseHeaders=function(){return this.ca&&4==Lw(this)?this.ca.getAllResponseHeaders():""};var Ow,Pw,Qw,Rw=function Rw(a,b){if(null!=a&&null!=a.oe)return a.oe(0,b);var d=Rw[n(null==a?null:a)];if(null!=d)return d.c?d.c(a,b):d.call(null,a,b);d=Rw._;if(null!=d)return d.c?d.c(a,b):d.call(null,a,b);throw Cb("ReadPort.take!",a);},Sw=function Sw(a,b,c){if(null!=a&&null!=a.Od)return a.Od(0,b,c);var e=Sw[n(null==a?null:a)];if(null!=e)return e.l?e.l(a,b,c):e.call(null,a,b,c);e=Sw._;if(null!=e)return e.l?e.l(a,b,c):e.call(null,a,b,c);throw Cb("WritePort.put!",a);},Tw=function Tw(a){if(null!=a&&null!=
+a.ld)return a.ld();var c=Tw[n(null==a?null:a)];if(null!=c)return c.h?c.h(a):c.call(null,a);c=Tw._;if(null!=c)return c.h?c.h(a):c.call(null,a);throw Cb("Channel.close!",a);},Uw=function Uw(a){if(null!=a&&null!=a.vb)return a.vb(a);var c=Uw[n(null==a?null:a)];if(null!=c)return c.h?c.h(a):c.call(null,a);c=Uw._;if(null!=c)return c.h?c.h(a):c.call(null,a);throw Cb("Handler.active?",a);},Vw=function Vw(a){if(null!=a&&null!=a.tb)return a.tb(a);var c=Vw[n(null==a?null:a)];if(null!=c)return c.h?c.h(a):c.call(null,
+a);c=Vw._;if(null!=c)return c.h?c.h(a):c.call(null,a);throw Cb("Handler.commit",a);},Ww=function Ww(a,b){if(null!=a&&null!=a.Md)return a.Md(a,b);var d=Ww[n(null==a?null:a)];if(null!=d)return d.c?d.c(a,b):d.call(null,a,b);d=Ww._;if(null!=d)return d.c?d.c(a,b):d.call(null,a,b);throw Cb("Buffer.add!*",a);},Xw=function Xw(a){switch(arguments.length){case 1:return Xw.h(arguments[0]);case 2:return Xw.c(arguments[0],arguments[1]);default:throw Error(["Invalid arity: ",v.h(arguments.length)].join(""));}};
+Xw.h=function(a){return a};Xw.c=function(a,b){return Ww(a,b)};Xw.L=2;function Yw(a,b,c,d,e){for(var f=0;;)if(f<e)c[d+f]=a[b+f],f+=1;else break}function Zw(a,b,c,d){this.head=a;this.fa=b;this.length=c;this.o=d}Zw.prototype.pop=function(){if(0===this.length)return null;var a=this.o[this.fa];this.o[this.fa]=null;this.fa=(this.fa+1)%this.o.length;--this.length;return a};Zw.prototype.unshift=function(a){this.o[this.head]=a;this.head=(this.head+1)%this.o.length;this.length+=1;return null};function $w(a,b){a.length+1===a.o.length&&a.resize();a.unshift(b)}
+Zw.prototype.resize=function(){var a=Array(2*this.o.length);return this.fa<this.head?(Yw(this.o,this.fa,a,0,this.length),this.fa=0,this.head=this.length,this.o=a):this.fa>this.head?(Yw(this.o,this.fa,a,0,this.o.length-this.fa),Yw(this.o,0,a,this.o.length-this.fa,this.head),this.fa=0,this.head=this.length,this.o=a):this.fa===this.head?(this.head=this.fa=0,this.o=a):null};function ax(a,b){for(var c=a.length,d=0;;)if(d<c){var e=a.pop();(b.h?b.h(e):b.call(null,e))&&a.unshift(e);d+=1}else break}
+function bx(a){return new Zw(0,0,0,Array(a))}function cx(a,b){this.aa=a;this.n=b;this.m=2;this.J=0}g=cx.prototype;g.Nd=function(){return this.aa.length===this.n};g.Sc=function(){return this.aa.pop()};g.Md=function(a,b){$w(this.aa,b);return this};g.ne=function(){return null};g.W=function(){return this.aa.length};function dx(a,b){this.aa=a;this.n=b;this.m=2;this.J=0}g=dx.prototype;g.Nd=function(){return!1};g.Sc=function(){return this.aa.pop()};
+g.Md=function(a,b){this.aa.length!==this.n&&this.aa.unshift(b);return this};g.ne=function(){return null};g.W=function(){return this.aa.length};if("undefined"===typeof ex)var ex={};function fx(a){this.H=a;this.m=2;this.J=0}g=fx.prototype;g.Nd=function(){return!1};g.Sc=function(){return this.H};g.Md=function(a,b){t(ex===this.H)&&(this.H=b);return this};g.ne=function(){return t(ex===this.H)?this.H=null:null};g.W=function(){return t(ex===this.H)?0:1};var gx=bx(32),hx=!1,ix=!1;function jx(){hx=!0;ix=!1;for(var a=0;;){var b=gx.pop();if(null!=b&&(b.B?b.B():b.call(null),1024>a)){a+=1;continue}break}hx=!1;return 0<gx.length?kx.B?kx.B():kx.call(null):null}function kx(){if(ix&&hx)return null;ix=!0;!ha(ba.setImmediate)||ba.Window&&ba.Window.prototype&&!tv("Edge")&&ba.Window.prototype.setImmediate==ba.setImmediate?(uv||(uv=vv()),uv(jx)):ba.setImmediate(jx)}function lx(a){$w(gx,a);kx()}function mx(a,b){setTimeout(a,b)};var nx;
+function ox(a){"undefined"===typeof nx&&(nx=function(a,c){this.H=a;this.Af=c;this.m=425984;this.J=0},nx.prototype.T=function(a,c){return new nx(this.H,c)},nx.prototype.P=function(){return this.Af},nx.prototype.pc=function(){return this.H},nx.Wc=function(){return new R(null,2,5,T,[Km,qo],null)},nx.qc=!0,nx.Tb="cljs.core.async.impl.channels/t_cljs$core$async$impl$channels36582",nx.Ec=function(a,c){return Jc(c,"cljs.core.async.impl.channels/t_cljs$core$async$impl$channels36582")});return new nx(a,Ef)}
+function px(a,b){this.Ub=a;this.H=b}function qx(a){return Uw(a.Ub)}function rx(a,b,c,d,e,f,h){this.bd=a;this.Qd=b;this.jc=c;this.Pd=d;this.aa=e;this.closed=f;this.Ab=h}function sx(a){for(;;){var b=a.jc.pop();if(null!=b){var c=b.Ub,d=b.H;if(c.vb(null)){var e=c.tb(null);lx(function(a){return function(){return a.h?a.h(!0):a.call(null,!0)}}(e,c,d,b,a))}else continue}break}ax(a.jc,Zf(!1));a.ld()}
+rx.prototype.Od=function(a,b,c){var d=this,e=this,f=d.closed;if(f||!c.vb(null))return ox(!f);if(t(function(){var a=d.aa;return t(a)?wb(d.aa.Nd(null)):a}())){c.tb(null);var h=Hd(d.Ab.c?d.Ab.c(d.aa,b):d.Ab.call(null,d.aa,b));c=function(){for(var a=he;;)if(0<d.bd.length&&0<H(d.aa)){var b=d.bd.pop();if(b.vb(null)){var c=b.tb(null),k=d.aa.Sc(null);a=ge.c(a,function(a,b,c){return function(){return b.h?b.h(c):b.call(null,c)}}(a,c,k,b,h,f,e))}}else return a}();h&&sx(e);if(E(c)){c=E(c);a=null;for(var k=0,
+l=0;;)if(l<k){var p=a.$(null,l);lx(p);l+=1}else if(c=E(c))a=c,Ae(a)?(c=Wc(a),l=Xc(a),a=c,k=H(c),c=l):(c=y(a),lx(c),c=z(a),a=null,k=0),l=0;else break}return ox(!0)}a=function(){for(;;){var a=d.bd.pop();if(t(a)){if(t(a.vb(null)))return a}else return null}}();if(t(a))return k=Vw(a),c.tb(null),lx(function(a){return function(){return a.h?a.h(b):a.call(null,b)}}(k,a,f,e)),ox(!0);64<d.Pd?(d.Pd=0,ax(d.jc,qx)):d.Pd+=1;t(c.md(null))&&$w(d.jc,new px(c,b));return null};
+rx.prototype.oe=function(a,b){var c=this;if(b.vb(null)){if(null!=c.aa&&0<H(c.aa)){var d=b.tb(null);if(t(d)){var e=c.aa.Sc(null),f=0<c.jc.length?function(){for(var a=he;;){var b=c.jc.pop(),d=b.Ub;b=b.H;var e=d.vb(null);d=e?d.tb(null):e;a=t(d)?ge.c(a,d):a;b=t(d)?Hd(c.Ab.c?c.Ab.c(c.aa,b):c.Ab.call(null,c.aa,b)):null;if(!(wb(b)&&wb(c.aa.Nd(null))&&0<c.jc.length))return new R(null,2,5,T,[b,a],null)}}():null,h=J(f,0,null),k=J(f,1,null);t(h)&&sx(this);for(var l=E(k),p=null,m=0,u=0;;)if(u<m){var w=p.$(null,
+u);lx(function(a,b,c,d,e){return function(){return e.h?e.h(!0):e.call(null,!0)}}(l,p,m,u,w,e,f,h,k,d,d,this));u+=1}else{var x=E(l);if(x){w=x;if(Ae(w))l=Wc(w),u=Xc(w),p=l,m=H(l),l=u;else{var C=y(w);lx(function(a,b,c,d,e){return function(){return e.h?e.h(!0):e.call(null,!0)}}(l,p,m,u,C,w,x,e,f,h,k,d,d,this));l=z(w);p=null;m=0}u=0}else break}return ox(e)}return null}d=function(){for(;;){var a=c.jc.pop();if(t(a)){if(Uw(a.Ub))return a}else return null}}();if(t(d))return e=Vw(d.Ub),b.tb(null),lx(function(a){return function(){return a.h?
+a.h(!0):a.call(null,!0)}}(e,d,this)),ox(d.H);if(t(c.closed))return t(c.aa)&&(c.Ab.h?c.Ab.h(c.aa):c.Ab.call(null,c.aa)),t(function(){var a=b.vb(null);return t(a)?b.tb(null):a}())?(d=function(){var a=c.aa;return t(a)?0<H(c.aa):a}(),e=t(d)?c.aa.Sc(null):null,ox(e)):null;64<c.Qd?(c.Qd=0,ax(c.bd,Uw)):c.Qd+=1;t(b.md(null))&&$w(c.bd,b)}return null};
+rx.prototype.ld=function(){var a=this;if(!a.closed){a.closed=!0;for(t(function(){var b=a.aa;return t(b)?0===a.jc.length:b}())&&(a.Ab.h?a.Ab.h(a.aa):a.Ab.call(null,a.aa));;){var b=a.bd.pop();if(null!=b){if(b.vb(null)){var c=b.tb(null),d=t(function(){var b=a.aa;return t(b)?0<H(a.aa):b}())?a.aa.Sc(null):null;lx(function(a,b){return function(){return a.h?a.h(b):a.call(null,b)}}(c,d,b,this))}}else break}t(a.aa)&&a.aa.ne(null)}return null};function tx(a){console.log(a);return null}
+function ux(a,b){var c=t(null)?null:tx;c=c.h?c.h(b):c.call(null,b);return null==c?a:Xw.c(a,c)}
+function vx(a,b){return new rx(bx(32),0,bx(32),0,a,!1,function(){return function(a){return function(){function b(b,c){try{return a.c?a.c(b,c):a.call(null,b,c)}catch(l){return ux(b,l)}}function c(b){try{return a.h?a.h(b):a.call(null,b)}catch(k){return ux(b,k)}}var f=null;f=function(a,d){switch(arguments.length){case 1:return c.call(this,a);case 2:return b.call(this,a,d)}throw Error("Invalid arity: "+(arguments.length-1));};f.h=c;f.c=b;return f}()}(t(b)?b.h?b.h(Xw):b.call(null,Xw):Xw)}())};var wx;
+function xx(a){"undefined"===typeof wx&&(wx=function(a,c){this.Cb=a;this.Cf=c;this.m=393216;this.J=0},wx.prototype.T=function(a,c){return new wx(this.Cb,c)},wx.prototype.P=function(){return this.Cf},wx.prototype.vb=function(){return!0},wx.prototype.md=function(){return!0},wx.prototype.tb=function(){return this.Cb},wx.Wc=function(){return new R(null,2,5,T,[to,Um],null)},wx.qc=!0,wx.Tb="cljs.core.async.impl.ioc-helpers/t_cljs$core$async$impl$ioc_helpers42956",wx.Ec=function(a,c){return Jc(c,"cljs.core.async.impl.ioc-helpers/t_cljs$core$async$impl$ioc_helpers42956")});
+return new wx(a,Ef)}function yx(a){try{var b=a[0];return b.h?b.h(a):b.call(null,a)}catch(c){if(c instanceof Object)throw b=c,a[6].ld(),b;throw c;}}function zx(a,b,c){c=c.oe(0,xx(function(c){a[2]=c;a[1]=b;return yx(a)}));return t(c)?(a[2]=B(c),a[1]=b,Z):null}function Ax(a,b,c,d){c=c.Od(0,d,xx(function(c){a[2]=c;a[1]=b;return yx(a)}));return t(c)?(a[2]=B(c),a[1]=b,Z):null}function Bx(a,b){var c=a[6];null!=b&&c.Od(0,b,xx(function(){return function(){return null}}(c)));c.ld();return c}
+function Cx(a){for(;;){var b=a[4],c=ul.h(b),d=Pm.h(b),e=a[5];if(t(function(){var a=e;return t(a)?wb(b):a}()))throw e;if(t(function(){var a=e;return t(a)?(a=c,t(a)?G.c(Ik,d)||e instanceof d:a):a}())){a[1]=c;a[2]=e;a[5]=null;a[4]=K.A(b,ul,null,be([Pm,null]));break}if(t(function(){var a=e;return t(a)?wb(c)&&wb(Lk.h(b)):a}()))a[4]=Xm.h(b);else{if(t(function(){var a=e;return t(a)?(a=wb(c))?Lk.h(b):a:a}())){a[1]=Lk.h(b);a[4]=K.l(b,Lk,null);break}if(t(function(){var a=wb(e);return a?Lk.h(b):a}())){a[1]=
+Lk.h(b);a[4]=K.l(b,Lk,null);break}if(wb(e)&&wb(Lk.h(b))){a[1]=cn.h(b);a[4]=Xm.h(b);break}throw Error("No matching clause");}}};function Dx(a,b,c){this.key=a;this.H=b;this.forward=c;this.m=2155872256;this.J=0}Dx.prototype.S=function(){var a=this.key;return Tb(Tb(wd,this.H),a)};Dx.prototype.R=function(a,b,c){return Y(b,Qi,"["," ","]",c,this)};function Ex(a,b,c){c=Array(c+1);for(var d=0;;)if(d<c.length)c[d]=null,d+=1;else break;return new Dx(a,b,c)}function Fx(a,b,c,d){for(;;){if(0>c)return a;a:for(;;){var e=c<a.forward.length?a.forward[c]:null;if(t(e))if(e.key<b)a=e;else break a;else break a}null!=d&&(d[c]=a);--c}}
+function Gx(a,b){this.header=a;this.level=b;this.m=2155872256;this.J=0}Gx.prototype.put=function(a,b){var c=Array(15),d=Fx(this.header,a,this.level,c).forward[0];if(null!=d&&d.key===a)return d.H=b;a:for(d=0;;)if(.5>Math.random()&&15>d)d+=1;else break a;if(d>this.level){for(var e=this.level+1;;)if(e<=d+1)c[e]=this.header,e+=1;else break;this.level=d}for(d=Ex(a,b,Array(d));;)return 0<=this.level?(c=c[0].forward,d.forward[0]=c[0],c[0]=d):null};
+Gx.prototype.remove=function(a){var b=Array(15),c=Fx(this.header,a,this.level,b);c=0===c.forward.length?null:c.forward[0];if(null!=c&&c.key===a){for(a=0;;)if(a<=this.level){var d=b[a].forward;c===(a<d.length?d[a]:null)&&(d[a]=c.forward[a]);a+=1}else break;for(;;)if(0<this.level&&this.level<this.header.forward.length&&null==this.header.forward[this.level])--this.level;else return null}else return null};
+function Hx(a){for(var b=Ix,c=b.header,d=b.level;;){if(0>d)return c===b.header?null:c;var e;a:for(e=c;;){e=d<e.forward.length?e.forward[d]:null;if(null==e){e=null;break a}if(e.key>=a)break a}null!=e?(--d,c=e):--d}}Gx.prototype.S=function(){return function(a){return function d(c){return new kf(null,function(){return function(){return null==c?null:ae(new R(null,2,5,T,[c.key,c.H],null),d(c.forward[0]))}}(a),null,null)}}(this)(this.header.forward[0])};
+Gx.prototype.R=function(a,b,c){return Y(b,function(){return function(a){return Y(b,Qi,""," ","",c,a)}}(this),"{",", ","}",c,this)};var Ix=new Gx(Ex(null,null,0),0);function Jx(a){var b=(new Date).valueOf()+a,c=Hx(b),d=t(t(c)?c.key<b+10:c)?c.H:null;if(t(d))return d;var e=vx(null,null);Ix.put(b,e);mx(function(a,b,c){return function(){Ix.remove(c);return Tw(a)}}(e,d,b,c),a);return e};function Kx(a){return Lx(a,null)}function Mx(a,b){return Lx(a,b)}function Lx(a,b){var c=G.c(a,0)?null:a;return vx("number"===typeof c?new cx(bx(c),c):c,b)}
+var Nx=function(a){"undefined"===typeof Ow&&(Ow=function(a,c,d){this.Cb=a;this.Je=c;this.Df=d;this.m=393216;this.J=0},Ow.prototype.T=function(a,c){return new Ow(this.Cb,this.Je,c)},Ow.prototype.P=function(){return this.Df},Ow.prototype.vb=function(){return!0},Ow.prototype.md=function(){return this.Je},Ow.prototype.tb=function(){return this.Cb},Ow.Wc=function(){return new R(null,3,5,T,[to,jk,gk],null)},Ow.qc=!0,Ow.Tb="cljs.core.async/t_cljs$core$async43104",Ow.Ec=function(a,c){return Jc(c,"cljs.core.async/t_cljs$core$async43104")});
+return new Ow(a,!0,Ef)}(function(){return null});function Ox(a,b){var c=Sw(a,b,Nx);return t(c)?B(c):!0}function Px(a){for(var b=Array(a),c=0;;)if(c<a)b[c]=0,c+=1;else break;for(c=1;;){if(G.c(c,a))return b;var d=Math.floor(Math.random()*c);b[c]=b[d];b[d]=c;c+=1}}
+function Qx(){var a=dg.h(!0);"undefined"===typeof Pw&&(Pw=function(a,c){this.Hc=a;this.Ef=c;this.m=393216;this.J=0},Pw.prototype.T=function(){return function(a,c){return new Pw(this.Hc,c)}}(a),Pw.prototype.P=function(){return function(){return this.Ef}}(a),Pw.prototype.vb=function(){return function(){return B(this.Hc)}}(a),Pw.prototype.md=function(){return function(){return!0}}(a),Pw.prototype.tb=function(){return function(){fg(this.Hc,null);return!0}}(a),Pw.Wc=function(){return function(){return new R(null,
+2,5,T,[em,ek],null)}}(a),Pw.qc=!0,Pw.Tb="cljs.core.async/t_cljs$core$async43126",Pw.Ec=function(){return function(a,c){return Jc(c,"cljs.core.async/t_cljs$core$async43126")}}(a));return new Pw(a,Ef)}
+function Rx(a,b){"undefined"===typeof Qw&&(Qw=function(a,b,e){this.Hc=a;this.ed=b;this.Ff=e;this.m=393216;this.J=0},Qw.prototype.T=function(a,b){return new Qw(this.Hc,this.ed,b)},Qw.prototype.P=function(){return this.Ff},Qw.prototype.vb=function(){return Uw(this.Hc)},Qw.prototype.md=function(){return!0},Qw.prototype.tb=function(){Vw(this.Hc);return this.ed},Qw.Wc=function(){return new R(null,3,5,T,[em,Mk,hl],null)},Qw.qc=!0,Qw.Tb="cljs.core.async/t_cljs$core$async43129",Qw.Ec=function(a,b){return Jc(b,
+"cljs.core.async/t_cljs$core$async43129")});return new Qw(a,b,Ef)}
+function Sx(a,b,c){var d=Qx(),e=H(b),f=Px(e),h=Im.h(c),k=function(){for(var c=0;;)if(c<e){var k=t(h)?c:f[c],m=Vd(b,k),u=ze(m)?m.h?m.h(0):m.call(null,0):null,w=t(u)?function(){var b=m.h?m.h(1):m.call(null,1);return Sw(u,b,Rx(d,function(b,c,d,e,f){return function(b){b=new R(null,2,5,T,[b,f],null);return a.h?a.h(b):a.call(null,b)}}(c,b,k,m,u,d,e,f,h)))}():Rw(m,Rx(d,function(b,c,d){return function(b){b=new R(null,2,5,T,[b,d],null);return a.h?a.h(b):a.call(null,b)}}(c,k,m,u,d,e,f,h)));if(t(w))return ox(new R(null,
+2,5,T,[B(w),function(){var a=u;return t(a)?a:m}()],null));c+=1}else return null}();return t(k)?k:He(c,Ik)&&(k=function(){var a=Uw(d);return t(a)?Vw(d):a}(),t(k))?ox(new R(null,2,5,T,[Ik.h(c),Ik],null)):null}
+function Tx(a,b){var c=Kx(1);lx(function(c){return function(){var d=function(){return function(a){return function(){function b(b){for(;;){a:try{for(;;){var c=a(b);if(!N(c,Z)){var d=c;break a}}}catch(x){if(x instanceof Object)b[5]=x,Cx(b),d=Z;else throw x;}if(!N(d,Z))return d}}function c(){var a=[null,null,null,null,null,null,null,null];a[0]=d;a[1]=1;return a}var d=null;d=function(a){switch(arguments.length){case 0:return c.call(this);case 1:return b.call(this,a)}throw Error("Invalid arity: "+(arguments.length-
+1));};d.B=c;d.h=b;return d}()}(function(){return function(c){var d=c[1];return 7===d?(c[2]=c[2],c[1]=3,Z):1===d?(c[2]=null,c[1]=2,Z):4===d?(d=c[2],c[7]=d,c[1]=t(null==d)?5:6,Z):13===d?(c[2]=null,c[1]=14,Z):6===d?(d=c[7],Ax(c,11,b,d)):3===d?Bx(c,c[2]):12===d?(c[2]=null,c[1]=2,Z):2===d?zx(c,4,a):11===d?(c[1]=t(c[2])?12:13,Z):9===d?(c[2]=null,c[1]=10,Z):5===d?(c[1]=t(!0)?8:9,Z):14===d||10===d?(c[2]=c[2],c[1]=7,Z):8===d?(d=Tw(b),c[2]=d,c[1]=10,Z):null}}(c),c)}(),f=function(){var a=d.B?d.B():d.call(null);
+a[6]=c;return a}();return yx(f)}}(c))}function Ux(a){for(var b=[],c=arguments.length,d=0;;)if(d<c)b.push(arguments[d]),d+=1;else break;return Vx(arguments[0],arguments[1],arguments[2],3<b.length?new Jb(b.slice(3),0,null):null)}function Vx(a,b,c,d){var e=null!=d&&(d.m&64||q===d.G)?P(U,d):d;a[1]=b;b=Sx(function(){return function(b){a[2]=b;return yx(a)}}(d,e,e),c,e);return t(b)?(a[2]=B(b),Z):null};function Wx(){}var Xx=function Xx(a,b){if(null!=a&&null!=a.qb)return a.qb(a,b);var d=Xx[n(null==a?null:a)];if(null!=d)return d.c?d.c(a,b):d.call(null,a,b);d=Xx._;if(null!=d)return d.c?d.c(a,b):d.call(null,a,b);throw Cb("Update.update-player",a);};function Yx(){}var Zx=function Zx(a,b){if(null!=a&&null!=a.de)return a.de(a,b);var d=Zx[n(null==a?null:a)];if(null!=d)return d.c?d.c(a,b):d.call(null,a,b);d=Zx._;if(null!=d)return d.c?d.c(a,b):d.call(null,a,b);throw Cb("ChannelSource.get-channels",a);};
+function $x(a,b,c){this.v=a;this.j=b;this.w=c;this.m=2229667594;this.J=139264}g=$x.prototype;g.V=function(a,b){return this.I(null,b,null)};g.I=function(a,b,c){return D.l(this.j,b,c)};g.R=function(a,b,c){return Y(b,function(){return function(a){return Y(b,Qi,""," ","",c,a)}}(this),"#asciinema.player.messages.FastForward{",", ","}",c,O.c(he,this.j))};g.ba=function(){return new fh(0,this,0,he,t(this.j)?dd(this.j):Cf())};g.P=function(){return this.v};g.W=function(){return 0+H(this.j)};
+g.U=function(){var a=this,b=this.w;if(null!=b)return b;var c=function(){return function(){return function(a){return 1082393681^Dd(a)}}(b,a)(a)}();return this.w=c};g.K=function(a,b){return null!=b&&this.constructor===b.constructor&&G.c(this.j,b.j)};g.ga=function(a,b){return He(vi,b)?le.c(tc(wg.c(Ef,this),this.v),b):new $x(this.v,Bf(le.c(this.j,b)),null)};g.O=function(a,b,c){return new $x(this.v,K.l(this.j,b,c),null)};g.S=function(){return E(O.c(he,this.j))};
+g.T=function(a,b){return new $x(b,this.j,this.w)};g.X=function(a,b){return ze(b)?this.O(null,A.c(b,0),A.c(b,1)):Mb(Tb,this,b)};function ay(a,b,c){this.v=a;this.j=b;this.w=c;this.m=2229667594;this.J=139264}g=ay.prototype;g.V=function(a,b){return this.I(null,b,null)};g.I=function(a,b,c){return D.l(this.j,b,c)};g.R=function(a,b,c){return Y(b,function(){return function(a){return Y(b,Qi,""," ","",c,a)}}(this),"#asciinema.player.messages.Rewind{",", ","}",c,O.c(he,this.j))};
+g.ba=function(){return new fh(0,this,0,he,t(this.j)?dd(this.j):Cf())};g.P=function(){return this.v};g.W=function(){return 0+H(this.j)};g.U=function(){var a=this,b=this.w;if(null!=b)return b;var c=function(){return function(){return function(a){return-1020675721^Dd(a)}}(b,a)(a)}();return this.w=c};g.K=function(a,b){return null!=b&&this.constructor===b.constructor&&G.c(this.j,b.j)};g.ga=function(a,b){return He(vi,b)?le.c(tc(wg.c(Ef,this),this.v),b):new ay(this.v,Bf(le.c(this.j,b)),null)};
+g.O=function(a,b,c){return new ay(this.v,K.l(this.j,b,c),null)};g.S=function(){return E(O.c(he,this.j))};g.T=function(a,b){return new ay(b,this.j,this.w)};g.X=function(a,b){return ze(b)?this.O(null,A.c(b,0),A.c(b,1)):Mb(Tb,this,b)};function by(a,b,c,d){this.position=a;this.v=b;this.j=c;this.w=d;this.m=2229667594;this.J=139264}g=by.prototype;g.V=function(a,b){return this.I(null,b,null)};
+g.I=function(a,b,c){switch(b instanceof L?b.ea:null){case "position":return this.position;default:return D.l(this.j,b,c)}};g.R=function(a,b,c){return Y(b,function(){return function(a){return Y(b,Qi,""," ","",c,a)}}(this),"#asciinema.player.messages.Seek{",", ","}",c,O.c(new R(null,1,5,T,[new R(null,2,5,T,[nn,this.position],null)],null),this.j))};g.ba=function(){return new fh(0,this,1,new R(null,1,5,T,[nn],null),t(this.j)?dd(this.j):Cf())};g.P=function(){return this.v};g.W=function(){return 1+H(this.j)};
+g.U=function(){var a=this,b=this.w;if(null!=b)return b;var c=function(){return function(){return function(a){return-2136325183^Dd(a)}}(b,a)(a)}();return this.w=c};g.K=function(a,b){return null!=b&&this.constructor===b.constructor&&G.c(this.position,b.position)&&G.c(this.j,b.j)};g.ga=function(a,b){return He(new ti(null,new r(null,1,[nn,null],null),null),b)?le.c(tc(wg.c(Ef,this),this.v),b):new by(this.position,this.v,Bf(le.c(this.j,b)),null)};
+g.O=function(a,b,c){return t(N.c?N.c(nn,b):N.call(null,nn,b))?new by(c,this.v,this.j,null):new by(this.position,this.v,K.l(this.j,b,c),null)};g.S=function(){return E(O.c(new R(null,1,5,T,[new R(null,2,5,T,[nn,this.position],null)],null),this.j))};g.T=function(a,b){return new by(this.position,b,this.j,this.w)};g.X=function(a,b){return ze(b)?this.O(null,A.c(b,0),A.c(b,1)):Mb(Tb,this,b)};function cy(a){return new by(a,null,null,null)}
+function dy(a,b,c){this.v=a;this.j=b;this.w=c;this.m=2229667594;this.J=139264}g=dy.prototype;g.V=function(a,b){return this.I(null,b,null)};g.I=function(a,b,c){return D.l(this.j,b,c)};g.R=function(a,b,c){return Y(b,function(){return function(a){return Y(b,Qi,""," ","",c,a)}}(this),"#asciinema.player.messages.SpeedDown{",", ","}",c,O.c(he,this.j))};g.ba=function(){return new fh(0,this,0,he,t(this.j)?dd(this.j):Cf())};g.P=function(){return this.v};g.W=function(){return 0+H(this.j)};
+g.U=function(){var a=this,b=this.w;if(null!=b)return b;var c=function(){return function(){return function(a){return 1945704126^Dd(a)}}(b,a)(a)}();return this.w=c};g.K=function(a,b){return null!=b&&this.constructor===b.constructor&&G.c(this.j,b.j)};g.ga=function(a,b){return He(vi,b)?le.c(tc(wg.c(Ef,this),this.v),b):new dy(this.v,Bf(le.c(this.j,b)),null)};g.O=function(a,b,c){return new dy(this.v,K.l(this.j,b,c),null)};g.S=function(){return E(O.c(he,this.j))};
+g.T=function(a,b){return new dy(b,this.j,this.w)};g.X=function(a,b){return ze(b)?this.O(null,A.c(b,0),A.c(b,1)):Mb(Tb,this,b)};function ey(a,b,c){this.v=a;this.j=b;this.w=c;this.m=2229667594;this.J=139264}g=ey.prototype;g.V=function(a,b){return this.I(null,b,null)};g.I=function(a,b,c){return D.l(this.j,b,c)};g.R=function(a,b,c){return Y(b,function(){return function(a){return Y(b,Qi,""," ","",c,a)}}(this),"#asciinema.player.messages.SpeedUp{",", ","}",c,O.c(he,this.j))};
+g.ba=function(){return new fh(0,this,0,he,t(this.j)?dd(this.j):Cf())};g.P=function(){return this.v};g.W=function(){return 0+H(this.j)};g.U=function(){var a=this,b=this.w;if(null!=b)return b;var c=function(){return function(){return function(a){return 2001377313^Dd(a)}}(b,a)(a)}();return this.w=c};g.K=function(a,b){return null!=b&&this.constructor===b.constructor&&G.c(this.j,b.j)};g.ga=function(a,b){return He(vi,b)?le.c(tc(wg.c(Ef,this),this.v),b):new ey(this.v,Bf(le.c(this.j,b)),null)};
+g.O=function(a,b,c){return new ey(this.v,K.l(this.j,b,c),null)};g.S=function(){return E(O.c(he,this.j))};g.T=function(a,b){return new ey(b,this.j,this.w)};g.X=function(a,b){return ze(b)?this.O(null,A.c(b,0),A.c(b,1)):Mb(Tb,this,b)};function fy(a,b,c){this.v=a;this.j=b;this.w=c;this.m=2229667594;this.J=139264}g=fy.prototype;g.V=function(a,b){return this.I(null,b,null)};g.I=function(a,b,c){return D.l(this.j,b,c)};
+g.R=function(a,b,c){return Y(b,function(){return function(a){return Y(b,Qi,""," ","",c,a)}}(this),"#asciinema.player.messages.TogglePlay{",", ","}",c,O.c(he,this.j))};g.ba=function(){return new fh(0,this,0,he,t(this.j)?dd(this.j):Cf())};g.P=function(){return this.v};g.W=function(){return 0+H(this.j)};g.U=function(){var a=this,b=this.w;if(null!=b)return b;var c=function(){return function(){return function(a){return 1662385780^Dd(a)}}(b,a)(a)}();return this.w=c};
+g.K=function(a,b){return null!=b&&this.constructor===b.constructor&&G.c(this.j,b.j)};g.ga=function(a,b){return He(vi,b)?le.c(tc(wg.c(Ef,this),this.v),b):new fy(this.v,Bf(le.c(this.j,b)),null)};g.O=function(a,b,c){return new fy(this.v,K.l(this.j,b,c),null)};g.S=function(){return E(O.c(he,this.j))};g.T=function(a,b){return new fy(b,this.j,this.w)};g.X=function(a,b){return ze(b)?this.O(null,A.c(b,0),A.c(b,1)):Mb(Tb,this,b)};
+function gy(a,b,c,d){this.show=a;this.v=b;this.j=c;this.w=d;this.m=2229667594;this.J=139264}g=gy.prototype;g.V=function(a,b){return this.I(null,b,null)};g.I=function(a,b,c){switch(b instanceof L?b.ea:null){case "show":return this.show;default:return D.l(this.j,b,c)}};g.R=function(a,b,c){return Y(b,function(){return function(a){return Y(b,Qi,""," ","",c,a)}}(this),"#asciinema.player.messages.ShowCursor{",", ","}",c,O.c(new R(null,1,5,T,[new R(null,2,5,T,[so,this.show],null)],null),this.j))};
+g.ba=function(){return new fh(0,this,1,new R(null,1,5,T,[so],null),t(this.j)?dd(this.j):Cf())};g.P=function(){return this.v};g.W=function(){return 1+H(this.j)};g.U=function(){var a=this,b=this.w;if(null!=b)return b;var c=function(){return function(){return function(a){return 1380979759^Dd(a)}}(b,a)(a)}();return this.w=c};g.K=function(a,b){return null!=b&&this.constructor===b.constructor&&G.c(this.show,b.show)&&G.c(this.j,b.j)};
+g.ga=function(a,b){return He(new ti(null,new r(null,1,[so,null],null),null),b)?le.c(tc(wg.c(Ef,this),this.v),b):new gy(this.show,this.v,Bf(le.c(this.j,b)),null)};g.O=function(a,b,c){return t(N.c?N.c(so,b):N.call(null,so,b))?new gy(c,this.v,this.j,null):new gy(this.show,this.v,K.l(this.j,b,c),null)};g.S=function(){return E(O.c(new R(null,1,5,T,[new R(null,2,5,T,[so,this.show],null)],null),this.j))};g.T=function(a,b){return new gy(this.show,b,this.j,this.w)};
+g.X=function(a,b){return ze(b)?this.O(null,A.c(b,0),A.c(b,1)):Mb(Tb,this,b)};function hy(a,b,c,d){this.show=a;this.v=b;this.j=c;this.w=d;this.m=2229667594;this.J=139264}g=hy.prototype;g.V=function(a,b){return this.I(null,b,null)};g.I=function(a,b,c){switch(b instanceof L?b.ea:null){case "show":return this.show;default:return D.l(this.j,b,c)}};
+g.R=function(a,b,c){return Y(b,function(){return function(a){return Y(b,Qi,""," ","",c,a)}}(this),"#asciinema.player.messages.ShowHud{",", ","}",c,O.c(new R(null,1,5,T,[new R(null,2,5,T,[so,this.show],null)],null),this.j))};g.ba=function(){return new fh(0,this,1,new R(null,1,5,T,[so],null),t(this.j)?dd(this.j):Cf())};g.P=function(){return this.v};g.W=function(){return 1+H(this.j)};
+g.U=function(){var a=this,b=this.w;if(null!=b)return b;var c=function(){return function(){return function(a){return-1875838466^Dd(a)}}(b,a)(a)}();return this.w=c};g.K=function(a,b){return null!=b&&this.constructor===b.constructor&&G.c(this.show,b.show)&&G.c(this.j,b.j)};g.ga=function(a,b){return He(new ti(null,new r(null,1,[so,null],null),null),b)?le.c(tc(wg.c(Ef,this),this.v),b):new hy(this.show,this.v,Bf(le.c(this.j,b)),null)};
+g.O=function(a,b,c){return t(N.c?N.c(so,b):N.call(null,so,b))?new hy(c,this.v,this.j,null):new hy(this.show,this.v,K.l(this.j,b,c),null)};g.S=function(){return E(O.c(new R(null,1,5,T,[new R(null,2,5,T,[so,this.show],null)],null),this.j))};g.T=function(a,b){return new hy(this.show,b,this.j,this.w)};g.X=function(a,b){return ze(b)?this.O(null,A.c(b,0),A.c(b,1)):Mb(Tb,this,b)};function iy(a){return new hy(a,null,null,null)}
+function jy(a,b,c,d,e,f){this.width=a;this.height=b;this.duration=c;this.v=d;this.j=e;this.w=f;this.m=2229667594;this.J=139264}g=jy.prototype;g.V=function(a,b){return this.I(null,b,null)};g.I=function(a,b,c){switch(b instanceof L?b.ea:null){case "width":return this.width;case "height":return this.height;case "duration":return this.duration;default:return D.l(this.j,b,c)}};
+g.R=function(a,b,c){return Y(b,function(){return function(a){return Y(b,Qi,""," ","",c,a)}}(this),"#asciinema.player.messages.SetMetadata{",", ","}",c,O.c(new R(null,3,5,T,[new R(null,2,5,T,[fl,this.width],null),new R(null,2,5,T,[no,this.height],null),new R(null,2,5,T,[wl,this.duration],null)],null),this.j))};g.ba=function(){return new fh(0,this,3,new R(null,3,5,T,[fl,no,wl],null),t(this.j)?dd(this.j):Cf())};g.P=function(){return this.v};g.W=function(){return 3+H(this.j)};
+g.U=function(){var a=this,b=this.w;if(null!=b)return b;var c=function(){return function(){return function(a){return 2110730596^Dd(a)}}(b,a)(a)}();return this.w=c};g.K=function(a,b){return null!=b&&this.constructor===b.constructor&&G.c(this.width,b.width)&&G.c(this.height,b.height)&&G.c(this.duration,b.duration)&&G.c(this.j,b.j)};
+g.ga=function(a,b){return He(new ti(null,new r(null,3,[fl,null,wl,null,no,null],null),null),b)?le.c(tc(wg.c(Ef,this),this.v),b):new jy(this.width,this.height,this.duration,this.v,Bf(le.c(this.j,b)),null)};
+g.O=function(a,b,c){return t(N.c?N.c(fl,b):N.call(null,fl,b))?new jy(c,this.height,this.duration,this.v,this.j,null):t(N.c?N.c(no,b):N.call(null,no,b))?new jy(this.width,c,this.duration,this.v,this.j,null):t(N.c?N.c(wl,b):N.call(null,wl,b))?new jy(this.width,this.height,c,this.v,this.j,null):new jy(this.width,this.height,this.duration,this.v,K.l(this.j,b,c),null)};
+g.S=function(){return E(O.c(new R(null,3,5,T,[new R(null,2,5,T,[fl,this.width],null),new R(null,2,5,T,[no,this.height],null),new R(null,2,5,T,[wl,this.duration],null)],null),this.j))};g.T=function(a,b){return new jy(this.width,this.height,this.duration,b,this.j,this.w)};g.X=function(a,b){return ze(b)?this.O(null,A.c(b,0),A.c(b,1)):Mb(Tb,this,b)};function ky(a,b,c,d){this.tc=a;this.v=b;this.j=c;this.w=d;this.m=2229667594;this.J=139264}g=ky.prototype;g.V=function(a,b){return this.I(null,b,null)};
+g.I=function(a,b,c){switch(b instanceof L?b.ea:null){case "loading":return this.tc;default:return D.l(this.j,b,c)}};g.R=function(a,b,c){return Y(b,function(){return function(a){return Y(b,Qi,""," ","",c,a)}}(this),"#asciinema.player.messages.SetLoading{",", ","}",c,O.c(new R(null,1,5,T,[new R(null,2,5,T,[Hm,this.tc],null)],null),this.j))};g.ba=function(){return new fh(0,this,1,new R(null,1,5,T,[Hm],null),t(this.j)?dd(this.j):Cf())};g.P=function(){return this.v};g.W=function(){return 1+H(this.j)};
+g.U=function(){var a=this,b=this.w;if(null!=b)return b;var c=function(){return function(){return function(a){return 1609009220^Dd(a)}}(b,a)(a)}();return this.w=c};g.K=function(a,b){return null!=b&&this.constructor===b.constructor&&G.c(this.tc,b.tc)&&G.c(this.j,b.j)};g.ga=function(a,b){return He(new ti(null,new r(null,1,[Hm,null],null),null),b)?le.c(tc(wg.c(Ef,this),this.v),b):new ky(this.tc,this.v,Bf(le.c(this.j,b)),null)};
+g.O=function(a,b,c){return t(N.c?N.c(Hm,b):N.call(null,Hm,b))?new ky(c,this.v,this.j,null):new ky(this.tc,this.v,K.l(this.j,b,c),null)};g.S=function(){return E(O.c(new R(null,1,5,T,[new R(null,2,5,T,[Hm,this.tc],null)],null),this.j))};g.T=function(a,b){return new ky(this.tc,b,this.j,this.w)};g.X=function(a,b){return ze(b)?this.O(null,A.c(b,0),A.c(b,1)):Mb(Tb,this,b)};function ly(a){return new ky(a,null,null,null)}
+function my(a,b,c,d){this.uc=a;this.v=b;this.j=c;this.w=d;this.m=2229667594;this.J=139264}g=my.prototype;g.V=function(a,b){return this.I(null,b,null)};g.I=function(a,b,c){switch(b instanceof L?b.ea:null){case "playing":return this.uc;default:return D.l(this.j,b,c)}};g.R=function(a,b,c){return Y(b,function(){return function(a){return Y(b,Qi,""," ","",c,a)}}(this),"#asciinema.player.messages.SetPlaying{",", ","}",c,O.c(new R(null,1,5,T,[new R(null,2,5,T,[jn,this.uc],null)],null),this.j))};
+g.ba=function(){return new fh(0,this,1,new R(null,1,5,T,[jn],null),t(this.j)?dd(this.j):Cf())};g.P=function(){return this.v};g.W=function(){return 1+H(this.j)};g.U=function(){var a=this,b=this.w;if(null!=b)return b;var c=function(){return function(){return function(a){return-2119286176^Dd(a)}}(b,a)(a)}();return this.w=c};g.K=function(a,b){return null!=b&&this.constructor===b.constructor&&G.c(this.uc,b.uc)&&G.c(this.j,b.j)};
+g.ga=function(a,b){return He(new ti(null,new r(null,1,[jn,null],null),null),b)?le.c(tc(wg.c(Ef,this),this.v),b):new my(this.uc,this.v,Bf(le.c(this.j,b)),null)};g.O=function(a,b,c){return t(N.c?N.c(jn,b):N.call(null,jn,b))?new my(c,this.v,this.j,null):new my(this.uc,this.v,K.l(this.j,b,c),null)};g.S=function(){return E(O.c(new R(null,1,5,T,[new R(null,2,5,T,[jn,this.uc],null)],null),this.j))};g.T=function(a,b){return new my(this.uc,b,this.j,this.w)};
+g.X=function(a,b){return ze(b)?this.O(null,A.c(b,0),A.c(b,1)):Mb(Tb,this,b)};function ny(a){return new my(a,null,null,null)}function oy(a,b,c){this.v=a;this.j=b;this.w=c;this.m=2229667594;this.J=139264}g=oy.prototype;g.V=function(a,b){return this.I(null,b,null)};g.I=function(a,b,c){return D.l(this.j,b,c)};g.R=function(a,b,c){return Y(b,function(){return function(a){return Y(b,Qi,""," ","",c,a)}}(this),"#asciinema.player.messages.TriggerCanPlay{",", ","}",c,O.c(he,this.j))};
+g.ba=function(){return new fh(0,this,0,he,t(this.j)?dd(this.j):Cf())};g.P=function(){return this.v};g.W=function(){return 0+H(this.j)};g.U=function(){var a=this,b=this.w;if(null!=b)return b;var c=function(){return function(){return function(a){return-1080034109^Dd(a)}}(b,a)(a)}();return this.w=c};g.K=function(a,b){return null!=b&&this.constructor===b.constructor&&G.c(this.j,b.j)};g.ga=function(a,b){return He(vi,b)?le.c(tc(wg.c(Ef,this),this.v),b):new oy(this.v,Bf(le.c(this.j,b)),null)};
+g.O=function(a,b,c){return new oy(this.v,K.l(this.j,b,c),null)};g.S=function(){return E(O.c(he,this.j))};g.T=function(a,b){return new oy(b,this.j,this.w)};g.X=function(a,b){return ze(b)?this.O(null,A.c(b,0),A.c(b,1)):Mb(Tb,this,b)};function py(a,b,c,d){this.screen=a;this.v=b;this.j=c;this.w=d;this.m=2229667594;this.J=139264}g=py.prototype;g.V=function(a,b){return this.I(null,b,null)};
+g.I=function(a,b,c){switch(b instanceof L?b.ea:null){case "screen":return this.screen;default:return D.l(this.j,b,c)}};g.R=function(a,b,c){return Y(b,function(){return function(a){return Y(b,Qi,""," ","",c,a)}}(this),"#asciinema.player.messages.UpdateScreen{",", ","}",c,O.c(new R(null,1,5,T,[new R(null,2,5,T,[V,this.screen],null)],null),this.j))};g.ba=function(){return new fh(0,this,1,new R(null,1,5,T,[V],null),t(this.j)?dd(this.j):Cf())};g.P=function(){return this.v};g.W=function(){return 1+H(this.j)};
+g.U=function(){var a=this,b=this.w;if(null!=b)return b;var c=function(){return function(){return function(a){return-1861248332^Dd(a)}}(b,a)(a)}();return this.w=c};g.K=function(a,b){return null!=b&&this.constructor===b.constructor&&G.c(this.screen,b.screen)&&G.c(this.j,b.j)};g.ga=function(a,b){return He(new ti(null,new r(null,1,[V,null],null),null),b)?le.c(tc(wg.c(Ef,this),this.v),b):new py(this.screen,this.v,Bf(le.c(this.j,b)),null)};
+g.O=function(a,b,c){return t(N.c?N.c(V,b):N.call(null,V,b))?new py(c,this.v,this.j,null):new py(this.screen,this.v,K.l(this.j,b,c),null)};g.S=function(){return E(O.c(new R(null,1,5,T,[new R(null,2,5,T,[V,this.screen],null)],null),this.j))};g.T=function(a,b){return new py(this.screen,b,this.j,this.w)};g.X=function(a,b){return ze(b)?this.O(null,A.c(b,0),A.c(b,1)):Mb(Tb,this,b)};function qy(a){return new py(a,null,null,null)}
+function ry(a,b,c,d){this.time=a;this.v=b;this.j=c;this.w=d;this.m=2229667594;this.J=139264}g=ry.prototype;g.V=function(a,b){return this.I(null,b,null)};g.I=function(a,b,c){switch(b instanceof L?b.ea:null){case "time":return this.time;default:return D.l(this.j,b,c)}};g.R=function(a,b,c){return Y(b,function(){return function(a){return Y(b,Qi,""," ","",c,a)}}(this),"#asciinema.player.messages.UpdateTime{",", ","}",c,O.c(new R(null,1,5,T,[new R(null,2,5,T,[Zk,this.time],null)],null),this.j))};
+g.ba=function(){return new fh(0,this,1,new R(null,1,5,T,[Zk],null),t(this.j)?dd(this.j):Cf())};g.P=function(){return this.v};g.W=function(){return 1+H(this.j)};g.U=function(){var a=this,b=this.w;if(null!=b)return b;var c=function(){return function(){return function(a){return 463038319^Dd(a)}}(b,a)(a)}();return this.w=c};g.K=function(a,b){return null!=b&&this.constructor===b.constructor&&G.c(this.time,b.time)&&G.c(this.j,b.j)};
+g.ga=function(a,b){return He(new ti(null,new r(null,1,[Zk,null],null),null),b)?le.c(tc(wg.c(Ef,this),this.v),b):new ry(this.time,this.v,Bf(le.c(this.j,b)),null)};g.O=function(a,b,c){return t(N.c?N.c(Zk,b):N.call(null,Zk,b))?new ry(c,this.v,this.j,null):new ry(this.time,this.v,K.l(this.j,b,c),null)};g.S=function(){return E(O.c(new R(null,1,5,T,[new R(null,2,5,T,[Zk,this.time],null)],null),this.j))};g.T=function(a,b){return new ry(this.time,b,this.j,this.w)};
+g.X=function(a,b){return ze(b)?this.O(null,A.c(b,0),A.c(b,1)):Mb(Tb,this,b)};function sy(a){return new ry(a,null,null,null)};var ty=function ty(a){if(null!=a&&null!=a.Bd)return a.Bd(a);var c=ty[n(null==a?null:a)];if(null!=c)return c.h?c.h(a):c.call(null,a);c=ty._;if(null!=c)return c.h?c.h(a):c.call(null,a);throw Cb("Source.init",a);},uy=function uy(a){if(null!=a&&null!=a.Ad)return a.Ad(a);var c=uy[n(null==a?null:a)];if(null!=c)return c.h?c.h(a):c.call(null,a);c=uy._;if(null!=c)return c.h?c.h(a):c.call(null,a);throw Cb("Source.close",a);},vy=function vy(a){if(null!=a&&null!=a.ac)return a.ac(a);var c=vy[n(null==a?null:a)];
+if(null!=c)return c.h?c.h(a):c.call(null,a);c=vy._;if(null!=c)return c.h?c.h(a):c.call(null,a);throw Cb("Source.start",a);},wy=function wy(a){if(null!=a&&null!=a.wc)return a.wc(a);var c=wy[n(null==a?null:a)];if(null!=c)return c.h?c.h(a):c.call(null,a);c=wy._;if(null!=c)return c.h?c.h(a):c.call(null,a);throw Cb("Source.stop",a);},xy=function xy(a){if(null!=a&&null!=a.Dd)return a.Dd(a);var c=xy[n(null==a?null:a)];if(null!=c)return c.h?c.h(a):c.call(null,a);c=xy._;if(null!=c)return c.h?c.h(a):c.call(null,
+a);throw Cb("Source.toggle",a);},yy=function yy(a,b){if(null!=a&&null!=a.Cd)return a.Cd(a,b);var d=yy[n(null==a?null:a)];if(null!=d)return d.c?d.c(a,b):d.call(null,a,b);d=yy._;if(null!=d)return d.c?d.c(a,b):d.call(null,a,b);throw Cb("Source.seek",a);},zy=function zy(a,b){if(null!=a&&null!=a.zd)return a.zd(a,b);var d=zy[n(null==a?null:a)];if(null!=d)return d.c?d.c(a,b):d.call(null,a,b);d=zy._;if(null!=d)return d.c?d.c(a,b):d.call(null,a,b);throw Cb("Source.change-speed",a);};
+if("undefined"===typeof xj)var xj=function(){var a=dg.h(Ef),b=dg.h(Ef),c=dg.h(Ef),d=dg.h(Ef),e=D.l(Ef,Qn,jj());return new uj(td.c("asciinema.player.source","make-source"),function(){return function(a,b){var c=null!=b&&(b.m&64||q===b.G)?P(U,b):b;c=D.c(c,rl);return t(c)?c:ok}}(a,b,c,d,e),Ik,e,a,b,c,d)}();function Ay(){return ig.c(function(a){return function(b){b*=a;return new R(null,2,5,T,[b,b],null)}}(1/3),Fi(0,Number.MAX_VALUE,1))}
+function By(a){var b=Kx(null),c=Lx(new fx(ex),null),d=Kx(1);lx(function(b,c,d){return function(){var e=function(){return function(a){return function(){function b(b){for(;;){a:try{for(;;){var c=a(b);if(!N(c,Z)){var d=c;break a}}}catch(I){if(I instanceof Object)b[5]=I,Cx(b),d=Z;else throw I;}if(!N(d,Z))return d}}function c(){var a=[null,null,null,null,null,null,null,null];a[0]=d;a[1]=1;return a}var d=null;d=function(a){switch(arguments.length){case 0:return c.call(this);case 1:return b.call(this,a)}throw Error("Invalid arity: "+
+(arguments.length-1));};d.B=c;d.h=b;return d}()}(function(b,c,d){return function(e){var f=e[1];if(1===f)return zx(e,2,c);if(2===f){var h=e[2],k=function(){return function(a,b,c,d,e){return function(a){return Ox(e,a)}}(h,f,b,c,d)}();k=a.h?a.h(k):a.call(null,k);e[7]=h;return Bx(e,k)}return null}}(b,c,d),b,c,d)}(),f=function(){var a=e.B?e.B():e.call(null);a[6]=b;return a}();return yx(f)}}(d,b,c));return function(a,b){return function(c){t(c)&&Tw(a);return b}}(b,c)}
+function Cy(a,b,c,d){return By(function(e){if("string"===typeof a)return Ew(a,function(){return function(a){a=a.target;try{var f=a.ca?a.ca.responseText:""}catch(l){f=""}f=pv(f,b,c,d);return e.h?e.h(f):e.call(null,f)}}(a));var f=pv(a,b,c,d);return e.h?e.h(f):e.call(null,f)})}
+function Dy(a){var b=Kx(null),c=Kx(1);lx(function(b,c){return function(){var d=function(){return function(a){return function(){function b(b){for(;;){a:try{for(;;){var c=a(b);if(!N(c,Z)){var d=c;break a}}}catch(C){if(C instanceof Object)b[5]=C,Cx(b),d=Z;else throw C;}if(!N(d,Z))return d}}function c(){var a=[null,null,null,null,null,null,null,null,null,null,null,null,null,null];a[0]=d;a[1]=1;return a}var d=null;d=function(a){switch(arguments.length){case 0:return c.call(this);case 1:return b.call(this,
+a)}throw Error("Invalid arity: "+(arguments.length-1));};d.B=c;d.h=b;return d}()}(function(b,c){return function(b){var d=b[1];if(7===d)return d=Jx(1E3*b[7]),zx(b,10,d);if(1===d){d=Ou(1);var e=d.B?d.B():d.call(null),f=a;b[8]=d;b[9]=e;b[10]=f;b[2]=null;b[1]=2;return Z}return 4===d?(e=b[11],d=b[9],f=J(e,0,null),e=J(e,1,null),d=f-d,b[12]=e,b[7]=d,b[1]=t(0<d)?7:8,Z):15===d?(b[1]=t(b[2])?16:17,Z):13===d?(b[2]=null,b[1]=14,Z):6===d?(b[2]=b[2],b[1]=3,Z):17===d?(b[2]=null,b[1]=18,Z):3===d?Bx(b,b[2]):12===
+d?(d=b[8],f=b[10],f=vd(f),d=d.B?d.B():d.call(null),b[9]=d,b[10]=f,b[2]=null,b[1]=2,Z):2===d?(f=b[10],d=y(f),b[11]=d,b[1]=t(d)?4:5,Z):11===d?(b[1]=t(b[2])?12:13,Z):9===d?(b[2]=b[2],b[1]=6,Z):5===d?(d=Tw(c),b[2]=d,b[1]=6,Z):14===d?(b[2]=b[2],b[1]=9,Z):16===d?(d=b[9],f=b[10],f=vd(f),b[9]=d,b[10]=f,b[2]=null,b[1]=2,Z):10===d?(e=b[12],b[13]=b[2],Ax(b,11,c,e)):18===d?(b[2]=b[2],b[1]=9,Z):8===d?(e=b[12],Ax(b,15,c,e)):null}}(b,c),b,c)}(),e=function(){var a=d.B?d.B():d.call(null);a[6]=b;return a}();return yx(e)}}(c,
+b));return b}
+function Ey(a,b,c,d,e,f){var h=Kx(1);lx(function(h){return function(){var k=function(){return function(a){return function(){function b(b){for(;;){a:try{for(;;){var c=a(b);if(!N(c,Z)){var d=c;break a}}}catch(M){if(M instanceof Object)b[5]=M,Cx(b),d=Z;else throw M;}if(!N(d,Z))return d}}function c(){var a=[null,null,null,null,null,null,null,null,null,null,null,null,null,null];a[0]=d;a[1]=1;return a}var d=null;d=function(a){switch(arguments.length){case 0:return c.call(this);case 1:return b.call(this,a)}throw Error("Invalid arity: "+
+(arguments.length-1));};d.B=c;d.h=b;return d}()}(function(){return function(h){var k=h[1];if(7===k)return h[2]=h[2],h[1]=3,Z;if(1===k){k=Yu(c,d,b);var l=Dy(k);k=c;var m=Ou(d);h[7]=l;h[8]=m;h[9]=k;h[2]=null;h[1]=2;return Z}if(4===k)return l=h[7],m=h[2],k=J(m,0,null),m=J(m,1,null),l=G.c(l,m),h[11]=k,h[10]=m,h[1]=l?5:6,Z;if(15===k)return l=h[7],m=h[8],k=h[9],l=Tw(l),m=m.B?m.B():m.call(null),h[12]=l,h[2]=k+m,h[1]=17,Z;if(13===k)return h[2]=null,h[1]=14,Z;if(6===k)return k=h[10],k=G.c(f,k),h[1]=k?15:16,
+Z;if(17===k)return h[2]=h[2],h[1]=7,Z;if(3===k)return Bx(h,h[2]);if(12===k)return k=Yu(0,d,b),k=Dy(k),l=Ou(d),h[7]=k,h[8]=l,h[9]=0,h[2]=null,h[1]=2,Z;if(2===k)return l=h[7],Ux(h,4,new R(null,2,5,T,[l,f],null));if(11===k)return l=h[7],m=h[8],k=h[9],h[13]=h[2],h[7]=l,h[8]=m,h[9]=k,h[2]=null,h[1]=2,Z;if(9===k)return h[1]=t(e)?12:13,Z;if(5===k)return k=h[11],h[1]=t(k)?8:9,Z;if(14===k)return h[2]=h[2],h[1]=10,Z;if(16===k)throw k=h[10],h=["No matching clause: ",v.h(k)].join(""),Error(h);return 10===k?(h[2]=
+h[2],h[1]=7,Z):8===k?(k=h[11],Ax(h,11,a,k)):null}}(h),h)}(),p=function(){var a=k.B?k.B():k.call(null);a[6]=h;return a}();return yx(p)}}(h));return h}
+function Fy(a,b,c,d,e,f,h){var k=Kx(1);lx(function(k){return function(){var l=function(){return function(a){return function(){function b(b){for(;;){a:try{for(;;){var c=a(b);if(!N(c,Z)){var d=c;break a}}}catch(S){if(S instanceof Object)b[5]=S,Cx(b),d=Z;else throw S;}if(!N(d,Z))return d}}function c(){var a=[null,null,null,null,null,null,null,null,null,null,null,null,null];a[0]=d;a[1]=1;return a}var d=null;d=function(a){switch(arguments.length){case 0:return c.call(this);case 1:return b.call(this,a)}throw Error("Invalid arity: "+
+(arguments.length-1));};d.B=c;d.h=b;return d}()}(function(){return function(k){var l=k[1];if(7===l)return l=k[7],k[2]=l,k[1]=9,Z;if(1===l)return Ax(k,2,a,ny(!0));if(4===l){l=k[2];var m=Su(qy,b),p=Ay();p=Su(sy,p);m=Ey(a,Tu(m,p),d,e,f,h);k[8]=l;return zx(k,5,m)}return 6===l?(l=ny(!1),k[9]=k[2],Ax(k,10,a,l)):3===l?(l=k[2],m=fe($u(d,b)),m=qy(m),k[10]=l,Ax(k,4,a,m)):2===l?(l=sy(d),k[11]=k[2],Ax(k,3,a,l)):9===l?Ax(k,6,a,sy(k[2])):5===l?(l=k[2],k[7]=l,k[1]=t(l)?7:8,Z):10===l?(l=k[7],k[12]=k[2],Bx(k,l)):
+8===l?(k[2]=c,k[1]=9,Z):null}}(k),k)}(),m=function(){var a=l.B?l.B():l.call(null);a[6]=k;return a}();return yx(m)}}(k));return k}
+function Gy(a,b,c){var d=null!=a&&(a.m&64||q===a.G)?P(U,a):a,e=D.c(d,Hk),f=D.c(d,Ak),h=D.c(d,dn),k=D.c(d,Jl),l=Kx(10),p=Kx(1);lx(function(a,d,e,f,h,k,l,p){return function(){var m=function(){return function(a){return function(){function b(b){for(;;){a:try{for(;;){var c=a(b);if(!N(c,Z)){var d=c;break a}}}catch(Ba){if(Ba instanceof Object)b[5]=Ba,Cx(b),d=Z;else throw Ba;}if(!N(d,Z))return d}}function c(){var a=[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,
+null,null,null,null,null,null,null];a[0]=d;a[1]=1;return a}var d=null;d=function(a){switch(arguments.length){case 0:return c.call(this);case 1:return b.call(this,a)}throw Error("Invalid arity: "+(arguments.length-1));};d.B=c;d.h=b;return d}()}(function(a,d,e,f,h,k,l,m){return function(a){var e=a[1];if(65===e){var f=a,p=f;p[2]=a[2];p[1]=62;return Z}if(70===e){var u=f=a;u[2]=!1;u[1]=71;return Z}if(62===e){var w=a[2],x=f=a;x[2]=w;x[1]=59;return Z}if(74===e){var C=a[7],F=a[8],I=a[2],M=D.c(I,Uk),S=D.c(I,
+wl),Q=Nu(F,S),X=sy(Q);a[7]=Q;a[9]=M;f=a;return Ax(f,75,b,X)}if(7===e){var W=a[10],Ha=a[2],Ba=J(Ha,0,null);F=J(Ha,1,null);var Ga=G.c(gl,Ba);a[8]=F;a[10]=Ba;f=a;f[1]=Ga?8:9;return Z}if(59===e){var Oa=a[2],Ja=f=a;Ja[2]=Oa;Ja[1]=51;return Z}if(20===e){var db=P(U,c),xb=f=a;xb[2]=db;xb[1]=22;return Z}if(72===e){var az=P(U,c),ps=f=a;ps[2]=az;ps[1]=74;return Z}if(58===e){W=a[10];var bz=G.c(Xj,W);f=a;f[1]=bz?60:61;return Z}if(60===e){var ac=a[11],bc=0,Dc=ac,Eb=null,bb=null;a[11]=Dc;a[12]=bb;a[13]=bc;a[14]=
+Eb;var qs=f=a;qs[2]=null;qs[1]=2;return Z}if(27===e){ac=a[11];bb=a[12];bc=a[13];Eb=a[14];var cz=bb,dz=Eb,Rd=bc;Dc=ac;var Sd=dz,Td=cz;a[11]=Dc;a[12]=Td;a[13]=Rd;a[14]=Sd;var rs=f=a;rs[2]=null;rs[1]=2;return Z}if(1===e){bc=h;ac=k;bb=Eb=null;a[11]=ac;a[12]=bb;a[13]=bc;a[14]=Eb;var ss=f=a;ss[2]=null;ss[1]=2;return Z}if(69===e){var ts=f=a;ts[2]=!0;ts[1]=71;return Z}if(24===e){W=a[10];var ez=G.c(Nl,W);f=a;f[1]=ez?30:31;return Z}if(55===e){var fz=new R(null,1,5,T,[gl],null);a[15]=a[2];f=a;return Ax(f,56,
+d,fz)}if(39===e){var gz=a[2],us=f=a;us[2]=gz;us[1]=32;return Z}if(46===e){var vs=f=a;vs[2]=null;vs[1]=47;return Z}if(4===e){Eb=a[14];var ws=a[2],Ci=J(ws,0,null),hz=J(ws,1,null),iz=G.c(hz,Eb);a[16]=Ci;f=a;f[1]=iz?5:6;return Z}if(54===e){F=a[8];bb=a[12];bc=a[13];Eb=a[14];var jz=a[2],kz=bb,lz=Eb;Rd=bc;ac=F;Sd=lz;Td=kz;a[11]=ac;a[17]=jz;a[12]=Td;a[13]=Rd;a[14]=Sd;var xs=f=a;xs[2]=null;xs[1]=2;return Z}if(15===e){var ys=f=a;ys[2]=!1;ys[1]=16;return Z}if(48===e){var mz=a[2],zs=f=a;zs[2]=mz;zs[1]=47;return Z}if(50===
+e){W=a[10];var nz=G.c(qk,W);f=a;f[1]=nz?57:58;return Z}if(75===e){C=a[7];M=a[9];var oz=a[2],pz=fe($u(C,M)),qz=qy(pz);a[18]=oz;f=a;return Ax(f,76,b,qz)}if(21===e){var As=f=a;As[2]=c;As[1]=22;return Z}if(31===e){W=a[10];var rz=G.c(Kn,W);f=a;f[1]=rz?37:38;return Z}if(32===e){var sz=a[2],Bs=f=a;Bs[2]=sz;Bs[1]=25;return Z}if(40===e){var tz=new R(null,1,5,T,[wm],null);f=a;return Ax(f,43,d,tz)}if(56===e){var uz=a[2],Cs=f=a;Cs[2]=uz;Cs[1]=54;return Z}if(33===e){var Ds=f=a;Ds[2]=wm;Ds[1]=35;return Z}if(13===
+e){var vz=a[2],Es=f=a;Es[2]=vz;Es[1]=10;return Z}if(22===e){ac=a[11];bc=a[13];var Fs=a[2],wz=D.c(Fs,Uk),xz=D.c(Fs,wl),Gs=Kx(null),yz=Fy(b,wz,xz,bc,ac,l,Gs),zz=ac;Rd=null;Dc=zz;Eb=yz;bb=Gs;a[11]=Dc;a[12]=bb;a[13]=Rd;a[14]=Eb;var Hs=f=a;Hs[2]=null;Hs[1]=2;return Z}if(36===e){ac=a[11];bb=a[12];bc=a[13];Eb=a[14];var Az=a[2],Bz=ac,Cz=bb,Dz=Eb;Rd=bc;Dc=Bz;Sd=Dz;Td=Cz;a[11]=Dc;a[19]=Az;a[12]=Td;a[13]=Rd;a[14]=Sd;var Is=f=a;Is[2]=null;Is[1]=2;return Z}if(41===e){var Js=f=a;Js[2]=null;Js[1]=42;return Z}if(43===
+e){var Ez=a[2],Ks=f=a;Ks[2]=Ez;Ks[1]=42;return Z}if(61===e){W=a[10];var Fz=G.c(go,W);f=a;f[1]=Fz?63:64;return Z}if(29===e){var Gz=ac=a[11];bc=a[2];Dc=Gz;bb=Eb=null;a[11]=Dc;a[12]=bb;a[13]=bc;a[14]=Eb;var Ls=f=a;Ls[2]=null;Ls[1]=2;return Z}if(44===e)return bb=a[12],a[20]=a[2],f=a,f[1]=t(bb)?45:46,Z;if(6===e){Ci=a[16];var Ms=f=a;Ms[2]=Ci;Ms[1]=7;return Z}if(28===e){var Hz=a[2],Ns=f=a;Ns[2]=Hz;Ns[1]=25;return Z}if(64===e){W=a[10];var Iz=["No matching clause: ",v.h(W)].join("");throw Error(Iz);}if(51===
+e){var Jz=a[2],Os=f=a;Os[2]=Jz;Os[1]=39;return Z}if(25===e){var Kz=a[2],Ps=f=a;Ps[2]=Kz;Ps[1]=10;return Z}if(34===e){var Qs=f=a;Qs[2]=gl;Qs[1]=35;return Z}if(17===e){var Rs=f=a;Rs[2]=!0;Rs[1]=19;return Z}if(3===e){var Lz=a[2];f=a;return Bx(f,Lz)}if(12===e){var Mz=wb(null==c);f=a;f[1]=Mz?14:15;return Z}if(2===e){Eb=a[14];var Nz=vg(ub,new R(null,3,5,T,[d,m,Eb],null));f=a;return Vx(f,4,Nz,be([Im,!0]))}if(66===e){var Oz=q===c.G,Pz=c.m&64||Oz;f=a;f[1]=t(Pz)?69:70;return Z}if(23===e)return bb=a[12],f=a,
+f[1]=t(bb)?26:27,Z;if(47===e){ac=a[11];bb=a[12];bc=a[13];Eb=a[14];var Qz=a[2],Rz=ac,Sz=bb,Tz=Eb;Rd=bc;Dc=Rz;Sd=Tz;Td=Sz;a[11]=Dc;a[21]=Qz;a[12]=Td;a[13]=Rd;a[14]=Sd;var Ss=f=a;Ss[2]=null;Ss[1]=2;return Z}if(35===e){var Uz=new R(null,1,5,T,[a[2]],null);f=a;return Ax(f,36,d,Uz)}if(76===e){ac=a[11];C=a[7];bb=a[12];Eb=a[14];var Vz=a[2],Wz=ac,Xz=bb,Yz=Eb;bc=C;Dc=Wz;Sd=Yz;Td=Xz;a[11]=Dc;a[22]=Vz;a[12]=Td;a[13]=bc;a[14]=Sd;var Ts=f=a;Ts[2]=null;Ts[1]=2;return Z}if(19===e){var Zz=a[2],Us=f=a;Us[2]=Zz;Us[1]=
+16;return Z}if(57===e){var Vs=f=a;Vs[2]=null;Vs[1]=59;return Z}if(68===e){var $z=a[2];f=a;f[1]=t($z)?72:73;return Z}if(11===e){ac=a[11];bb=a[12];bc=a[13];Eb=a[14];var aA=ac,bA=bb,cA=Eb;Rd=bc;Dc=aA;Sd=cA;Td=bA;a[11]=Dc;a[12]=Td;a[13]=Rd;a[14]=Sd;var Ws=f=a;Ws[2]=null;Ws[1]=2;return Z}if(9===e){W=a[10];var dA=G.c(wm,W);f=a;f[1]=dA?23:24;return Z}if(5===e){Ci=a[16];var eA=new R(null,2,5,T,[Xj,Ci],null),Xs=f=a;Xs[2]=eA;Xs[1]=7;return Z}if(14===e){var fA=q===c.G,gA=c.m&64||fA;f=a;f[1]=t(gA)?17:18;return Z}if(45===
+e){var hA=new R(null,1,5,T,[gl],null);f=a;return Ax(f,48,d,hA)}if(53===e){var Ys=f=a;Ys[2]=null;Ys[1]=54;return Z}if(26===e){bb=a[12];Eb=a[14];var iA=Tw(bb);a[23]=iA;f=a;return zx(f,29,Eb)}if(16===e){var jA=a[2];f=a;f[1]=t(jA)?20:21;return Z}if(38===e){W=a[10];var kA=G.c(lm,W);f=a;f[1]=kA?49:50;return Z}if(30===e)return bb=a[12],f=a,f[1]=t(bb)?33:34,Z;if(73===e){var Zs=f=a;Zs[2]=c;Zs[1]=74;return Z}if(10===e){var lA=a[2],$s=f=a;$s[2]=lA;$s[1]=3;return Z}if(18===e){var at=f=a;at[2]=!1;at[1]=19;return Z}if(52===
+e){var mA=new R(null,1,5,T,[wm],null);f=a;return Ax(f,55,d,mA)}if(67===e){var bt=f=a;bt[2]=!1;bt[1]=68;return Z}if(71===e){var nA=a[2],ct=f=a;ct[2]=nA;ct[1]=68;return Z}if(42===e){F=a[8];var oA=new R(null,2,5,T,[go,F],null);a[24]=a[2];f=a;return Ax(f,44,d,oA)}if(37===e)return bb=a[12],f=a,f[1]=t(bb)?40:41,Z;if(63===e){var pA=wb(null==c);f=a;f[1]=pA?66:67;return Z}return 8===e?(bb=a[12],f=a,f[1]=t(bb)?11:12,Z):49===e?(bb=a[12],f=a,f[1]=t(bb)?52:53,Z):null}}(a,d,e,f,h,k,l,p),a,d,e,f,h,k,l,p)}(),u=function(){var b=
+m.B?m.B():m.call(null);b[6]=a;return b}();return yx(u)}}(p,l,a,d,e,f,h,k));return p}function Hy(a){var b=window.requestIdleCallback;return t(b)?(a=function(a,b){return function h(c){return function(a){return function(){if(E(c)){var b=h(vd(c));return a.h?a.h(b):a.call(null,b)}return null}}(a,b)}}(b,b)(a),b.h?b.h(a):b.call(null,a)):null}
+function Iy(a,b){var c=null!=a&&(a.m&64||q===a.G)?P(U,a):a,d=D.c(c,bl),e=D.c(c,Jl),f=D.c(c,Hj),h=D.c(c,Sj),k=D.c(c,Mm),l=Kx(1);lx(function(a,c,d,e,f,h,k,l,M){return function(){var m=function(){return function(a){return function(){function b(b){for(;;){a:try{for(;;){var c=a(b);if(!N(c,Z)){var d=c;break a}}}catch(Ba){if(Ba instanceof Object)b[5]=Ba,Cx(b),d=Z;else throw Ba;}if(!N(d,Z))return d}}function c(){var a=[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null];
+a[0]=d;a[1]=1;return a}var d=null;d=function(a){switch(arguments.length){case 0:return c.call(this);case 1:return b.call(this,a)}throw Error("Invalid arity: "+(arguments.length-1));};d.B=c;d.h=b;return d}()}(function(a,c,d,e,f,h,k,l,m){return function(a){var c=a[1];if(7===c)return c=a[7],c=G.c(k,c),a[1]=c?9:10,Z;if(1===c)return a[1]=t(l)?2:3,Z;if(4===c){c=a[2];c=f.h?f.h(c):f.call(null,c);var d=new R(null,2,5,T,[c,k],null);a[8]=c;return Ux(a,5,d)}if(15===c)return c=d=a[9],c=null!=c&&(c.m&64||q===c.G)?
+P(U,c):c,c=D.c(c,Uk),c=Ox(b,qy(fe($u(m,c)))),a[2]=c,a[1]=17,Z;if(13===c)return c=a[2],d=ly(!1),a[10]=c,Ax(a,14,b,d);if(6===c)return c=a[11],a[2]=c,a[1]=8,Z;if(17===c){d=a[9];c=a[2];var h=d;var p=null!=h&&(h.m&64||q===h.G)?P(U,h):h;h=D.c(p,fl);var u=D.c(p,no);p=D.c(p,wl);Ox(b,new jy(h,u,p,null,null,null));h=Ox(b,new oy(null,null,null));u=Gy(e,b,d);d=Uk.h(d);d=Hy(d);a[12]=c;a[13]=u;a[14]=h;return Bx(a,d)}if(3===c)return a[2]=m,a[1]=4,Z;if(12===c)return c=a[2],d=f.h?f.h(!0):f.call(null,!0),a[15]=c,zx(a,
+13,d);if(2===c)return a[2]=l,a[1]=4,Z;if(11===c)return a[2]=a[2],a[1]=8,Z;if(9===c)return Ax(a,12,b,ly(!0));if(5===c)return d=a[8],h=a[2],c=J(h,0,null),h=J(h,1,null),d=G.c(d,h),a[7]=h,a[11]=c,a[1]=d?6:7,Z;if(14===c)return c=a[10],a[16]=a[2],a[2]=c,a[1]=11,Z;if(16===c)return a[2]=null,a[1]=17,Z;if(10===c)throw c=a[7],a=["No matching clause: ",v.h(c)].join(""),Error(a);return 8===c?(d=a[2],a[9]=d,a[1]=t(m)?15:16,Z):null}}(a,c,d,e,f,h,k,l,M),a,c,d,e,f,h,k,l,M)}(),p=function(){var b=m.B?m.B():m.call(null);
+b[6]=a;return b}();return yx(p)}}(l,a,c,c,d,e,f,h,k))}function Jy(a,b,c,d,e,f,h,k,l,p,m,u){this.nb=a;this.Ea=b;this.$a=c;this.ob=d;this.speed=e;this.Y=f;this.jb=h;this.mb=k;this.lb=l;this.v=p;this.j=m;this.w=u;this.m=2229667594;this.J=139264}g=Jy.prototype;g.Bd=function(){var a=Kx(null);Iy(this,a);t(this.Y)&&this.ac(null);return a};g.Ad=function(){Ox(this.Ea,new R(null,1,5,T,[wm],null));return Ox(this.Ea,new R(null,1,5,T,[qk],null))};
+g.ac=function(){Tw(this.$a);return Ox(this.Ea,new R(null,1,5,T,[gl],null))};g.wc=function(){return Ox(this.Ea,new R(null,1,5,T,[wm],null))};g.Dd=function(){Tw(this.$a);return Ox(this.Ea,new R(null,1,5,T,[Nl],null))};g.Cd=function(a,b){Tw(this.$a);return Ox(this.Ea,new R(null,2,5,T,[Kn,b],null))};g.zd=function(a,b){return Ox(this.Ea,new R(null,2,5,T,[lm,b],null))};g.V=function(a,b){return this.I(null,b,null)};
+g.I=function(a,b,c){switch(b instanceof L?b.ea:null){case "recording-ch-fn":return this.nb;case "command-ch":return this.Ea;case "force-load-ch":return this.$a;case "start-at":return this.ob;case "speed":return this.speed;case "auto-play?":return this.Y;case "loop?":return this.jb;case "preload?":return this.mb;case "poster-time":return this.lb;default:return D.l(this.j,b,c)}};
+g.R=function(a,b,c){return Y(b,function(){return function(a){return Y(b,Qi,""," ","",c,a)}}(this),"#asciinema.player.source.Recording{",", ","}",c,O.c(new R(null,9,5,T,[new R(null,2,5,T,[bl,this.nb],null),new R(null,2,5,T,[Jl,this.Ea],null),new R(null,2,5,T,[Hj,this.$a],null),new R(null,2,5,T,[Hk,this.ob],null),new R(null,2,5,T,[Ak,this.speed],null),new R(null,2,5,T,[Jm,this.Y],null),new R(null,2,5,T,[dn,this.jb],null),new R(null,2,5,T,[Sj,this.mb],null),new R(null,2,5,T,[Mm,this.lb],null)],null),
+this.j))};g.ba=function(){return new fh(0,this,9,new R(null,9,5,T,[bl,Jl,Hj,Hk,Ak,Jm,dn,Sj,Mm],null),t(this.j)?dd(this.j):Cf())};g.P=function(){return this.v};g.W=function(){return 9+H(this.j)};g.U=function(){var a=this,b=this.w;if(null!=b)return b;var c=function(){return function(){return function(a){return 1201370539^Dd(a)}}(b,a)(a)}();return this.w=c};
+g.K=function(a,b){return null!=b&&this.constructor===b.constructor&&G.c(this.nb,b.nb)&&G.c(this.Ea,b.Ea)&&G.c(this.$a,b.$a)&&G.c(this.ob,b.ob)&&G.c(this.speed,b.speed)&&G.c(this.Y,b.Y)&&G.c(this.jb,b.jb)&&G.c(this.mb,b.mb)&&G.c(this.lb,b.lb)&&G.c(this.j,b.j)};
+g.ga=function(a,b){return He(new ti(null,new r(null,9,[Hj,null,Sj,null,Ak,null,Hk,null,bl,null,Jl,null,Jm,null,Mm,null,dn,null],null),null),b)?le.c(tc(wg.c(Ef,this),this.v),b):new Jy(this.nb,this.Ea,this.$a,this.ob,this.speed,this.Y,this.jb,this.mb,this.lb,this.v,Bf(le.c(this.j,b)),null)};
+g.O=function(a,b,c){return t(N.c?N.c(bl,b):N.call(null,bl,b))?new Jy(c,this.Ea,this.$a,this.ob,this.speed,this.Y,this.jb,this.mb,this.lb,this.v,this.j,null):t(N.c?N.c(Jl,b):N.call(null,Jl,b))?new Jy(this.nb,c,this.$a,this.ob,this.speed,this.Y,this.jb,this.mb,this.lb,this.v,this.j,null):t(N.c?N.c(Hj,b):N.call(null,Hj,b))?new Jy(this.nb,this.Ea,c,this.ob,this.speed,this.Y,this.jb,this.mb,this.lb,this.v,this.j,null):t(N.c?N.c(Hk,b):N.call(null,Hk,b))?new Jy(this.nb,this.Ea,this.$a,c,this.speed,this.Y,
+this.jb,this.mb,this.lb,this.v,this.j,null):t(N.c?N.c(Ak,b):N.call(null,Ak,b))?new Jy(this.nb,this.Ea,this.$a,this.ob,c,this.Y,this.jb,this.mb,this.lb,this.v,this.j,null):t(N.c?N.c(Jm,b):N.call(null,Jm,b))?new Jy(this.nb,this.Ea,this.$a,this.ob,this.speed,c,this.jb,this.mb,this.lb,this.v,this.j,null):t(N.c?N.c(dn,b):N.call(null,dn,b))?new Jy(this.nb,this.Ea,this.$a,this.ob,this.speed,this.Y,c,this.mb,this.lb,this.v,this.j,null):t(N.c?N.c(Sj,b):N.call(null,Sj,b))?new Jy(this.nb,this.Ea,this.$a,this.ob,
+this.speed,this.Y,this.jb,c,this.lb,this.v,this.j,null):t(N.c?N.c(Mm,b):N.call(null,Mm,b))?new Jy(this.nb,this.Ea,this.$a,this.ob,this.speed,this.Y,this.jb,this.mb,c,this.v,this.j,null):new Jy(this.nb,this.Ea,this.$a,this.ob,this.speed,this.Y,this.jb,this.mb,this.lb,this.v,K.l(this.j,b,c),null)};
+g.S=function(){return E(O.c(new R(null,9,5,T,[new R(null,2,5,T,[bl,this.nb],null),new R(null,2,5,T,[Jl,this.Ea],null),new R(null,2,5,T,[Hj,this.$a],null),new R(null,2,5,T,[Hk,this.ob],null),new R(null,2,5,T,[Ak,this.speed],null),new R(null,2,5,T,[Jm,this.Y],null),new R(null,2,5,T,[dn,this.jb],null),new R(null,2,5,T,[Sj,this.mb],null),new R(null,2,5,T,[Mm,this.lb],null)],null),this.j))};
+g.T=function(a,b){return new Jy(this.nb,this.Ea,this.$a,this.ob,this.speed,this.Y,this.jb,this.mb,this.lb,b,this.j,this.w)};g.X=function(a,b){return ze(b)?this.O(null,A.c(b,0),A.c(b,1)):Mb(Tb,this,b)};wj(ok,function(a,b){var c=null!=b&&(b.m&64||q===b.G)?P(U,b):b,d=D.c(c,fl),e=D.c(c,no),f=D.c(c,Hk),h=D.c(c,Ak),k=D.c(c,qm),l=D.c(c,Em),p=D.c(c,cm),m=D.c(c,vm);c=D.c(c,Mm);d=Cy(a,d,e,k);e=Kx(10);k=Kx(null);return new Jy(d,e,k,f,h,l,p,m,c,null,null,null)});
+function Ky(a,b,c){var d=Kx(null),e=Kx(1);lx(function(d,e){return function(){var f=function(){return function(a){return function(){function b(b){for(;;){a:try{for(;;){var c=a(b);if(!N(c,Z)){var d=c;break a}}}catch(I){if(I instanceof Object)b[5]=I,Cx(b),d=Z;else throw I;}if(!N(d,Z))return d}}function c(){var a=[null,null,null,null,null,null,null,null,null,null,null];a[0]=d;a[1]=1;return a}var d=null;d=function(a){switch(arguments.length){case 0:return c.call(this);case 1:return b.call(this,a)}throw Error("Invalid arity: "+
+(arguments.length-1));};d.B=c;d.h=b;return d}()}(function(d,e){return function(d){var f=d[1];if(1===f)return f=Ot(a,b),d[7]=f,d[2]=null,d[1]=2,Z;if(2===f)return zx(d,4,e);if(3===f)return Bx(d,d[2]);if(4===f)return f=d[2],d[8]=f,d[1]=t(f)?5:6,Z;if(5===f){var h=d[8];f=d[7];f=Ju(f,h);h=qy(f);d[9]=f;return Ax(d,8,c,h)}return 6===f?(d[2]=null,d[1]=7,Z):7===f?(d[2]=d[2],d[1]=3,Z):8===f?(f=d[9],h=d[2],d[10]=h,d[7]=f,d[2]=null,d[1]=2,Z):null}}(d,e),d,e)}(),h=function(){var a=f.B?f.B():f.call(null);a[6]=d;
+return a}();return yx(h)}}(e,d));return d}
+function Ly(a,b,c,d){var e=Kx(1);lx(function(e){return function(){var f=function(){return function(a){return function(){function b(b){for(;;){a:try{for(;;){var c=a(b);if(!N(c,Z)){var d=c;break a}}}catch(F){if(F instanceof Object)b[5]=F,Cx(b),d=Z;else throw F;}if(!N(d,Z))return d}}function c(){var a=[null,null,null,null,null,null,null,null,null,null,null];a[0]=d;a[1]=1;return a}var d=null;d=function(a){switch(arguments.length){case 0:return c.call(this);case 1:return b.call(this,a)}throw Error("Invalid arity: "+
+(arguments.length-1));};d.B=c;d.h=b;return d}()}(function(){return function(e){var f=e[1];if(7===f)return Ax(e,9,b,String.fromCharCode(Math.floor(160*Math.random())));if(1===f)return Ax(e,2,a,ny(!0));if(4===f)return f=ny(!1),e[7]=e[2],Ax(e,10,a,f);if(6===f)return e[2]=null,e[1]=8,Z;if(3===f)return f=Jx(100*Math.random()/c),Ux(e,5,new R(null,2,5,T,[d,f],null));if(2===f)return e[8]=e[2],e[2]=null,e[1]=3,Z;if(9===f)return e[9]=e[2],e[2]=null,e[1]=3,Z;if(5===f){var h=e[2];f=J(h,0,null);h=J(h,1,null);
+h=G.c(h,d);e[10]=f;e[1]=h?6:7;return Z}return 10===f?Bx(e,e[2]):8===f?(e[2]=e[2],e[1]=4,Z):null}}(e),e)}(),k=function(){var a=f.B?f.B():f.call(null);a[6]=e;return a}();return yx(k)}}(e));return e}function My(a,b,c,d,e,f,h,k,l,p){this.speed=a;this.Y=b;this.width=c;this.height=d;this.ha=e;this.pb=f;this.La=h;this.v=k;this.j=l;this.w=p;this.m=2229667594;this.J=139264}g=My.prototype;g.Bd=function(){fg(this.ha,Kx(null));fg(this.pb,Ky(this.width,this.height,B(this.ha)));t(this.Y)&&this.ac(null);return B(this.ha)};
+g.Ad=function(){return this.wc(null)};g.ac=function(){if(t(B(this.La)))return null;var a=Kx(null);fg(this.La,a);return Ly(B(this.ha),B(this.pb),this.speed,a)};g.wc=function(){return t(B(this.La))?(Tw(B(this.La)),fg(this.La,null)):null};g.Dd=function(){return t(B(this.La))?this.wc(null):this.ac(null)};g.Cd=function(){return null};g.zd=function(){return null};g.V=function(a,b){return this.I(null,b,null)};
+g.I=function(a,b,c){switch(b instanceof L?b.ea:null){case "speed":return this.speed;case "auto-play?":return this.Y;case "width":return this.width;case "height":return this.height;case "msg-ch":return this.ha;case "stdout-ch":return this.pb;case "stop-ch":return this.La;default:return D.l(this.j,b,c)}};
+g.R=function(a,b,c){return Y(b,function(){return function(a){return Y(b,Qi,""," ","",c,a)}}(this),"#asciinema.player.source.JunkPrinter{",", ","}",c,O.c(new R(null,7,5,T,[new R(null,2,5,T,[Ak,this.speed],null),new R(null,2,5,T,[Jm,this.Y],null),new R(null,2,5,T,[fl,this.width],null),new R(null,2,5,T,[no,this.height],null),new R(null,2,5,T,[Dl,this.ha],null),new R(null,2,5,T,[rn,this.pb],null),new R(null,2,5,T,[Zl,this.La],null)],null),this.j))};
+g.ba=function(){return new fh(0,this,7,new R(null,7,5,T,[Ak,Jm,fl,no,Dl,rn,Zl],null),t(this.j)?dd(this.j):Cf())};g.P=function(){return this.v};g.W=function(){return 7+H(this.j)};g.U=function(){var a=this,b=this.w;if(null!=b)return b;var c=function(){return function(){return function(a){return 1937333797^Dd(a)}}(b,a)(a)}();return this.w=c};
+g.K=function(a,b){return null!=b&&this.constructor===b.constructor&&G.c(this.speed,b.speed)&&G.c(this.Y,b.Y)&&G.c(this.width,b.width)&&G.c(this.height,b.height)&&G.c(this.ha,b.ha)&&G.c(this.pb,b.pb)&&G.c(this.La,b.La)&&G.c(this.j,b.j)};g.ga=function(a,b){return He(new ti(null,new r(null,7,[Ak,null,fl,null,Dl,null,Zl,null,Jm,null,rn,null,no,null],null),null),b)?le.c(tc(wg.c(Ef,this),this.v),b):new My(this.speed,this.Y,this.width,this.height,this.ha,this.pb,this.La,this.v,Bf(le.c(this.j,b)),null)};
+g.O=function(a,b,c){return t(N.c?N.c(Ak,b):N.call(null,Ak,b))?new My(c,this.Y,this.width,this.height,this.ha,this.pb,this.La,this.v,this.j,null):t(N.c?N.c(Jm,b):N.call(null,Jm,b))?new My(this.speed,c,this.width,this.height,this.ha,this.pb,this.La,this.v,this.j,null):t(N.c?N.c(fl,b):N.call(null,fl,b))?new My(this.speed,this.Y,c,this.height,this.ha,this.pb,this.La,this.v,this.j,null):t(N.c?N.c(no,b):N.call(null,no,b))?new My(this.speed,this.Y,this.width,c,this.ha,this.pb,this.La,this.v,this.j,null):
+t(N.c?N.c(Dl,b):N.call(null,Dl,b))?new My(this.speed,this.Y,this.width,this.height,c,this.pb,this.La,this.v,this.j,null):t(N.c?N.c(rn,b):N.call(null,rn,b))?new My(this.speed,this.Y,this.width,this.height,this.ha,c,this.La,this.v,this.j,null):t(N.c?N.c(Zl,b):N.call(null,Zl,b))?new My(this.speed,this.Y,this.width,this.height,this.ha,this.pb,c,this.v,this.j,null):new My(this.speed,this.Y,this.width,this.height,this.ha,this.pb,this.La,this.v,K.l(this.j,b,c),null)};
+g.S=function(){return E(O.c(new R(null,7,5,T,[new R(null,2,5,T,[Ak,this.speed],null),new R(null,2,5,T,[Jm,this.Y],null),new R(null,2,5,T,[fl,this.width],null),new R(null,2,5,T,[no,this.height],null),new R(null,2,5,T,[Dl,this.ha],null),new R(null,2,5,T,[rn,this.pb],null),new R(null,2,5,T,[Zl,this.La],null)],null),this.j))};g.T=function(a,b){return new My(this.speed,this.Y,this.width,this.height,this.ha,this.pb,this.La,b,this.j,this.w)};
+g.X=function(a,b){return ze(b)?this.O(null,A.c(b,0),A.c(b,1)):Mb(Tb,this,b)};wj(mn,function(a,b){var c=null!=b&&(b.m&64||q===b.G)?P(U,b):b;D.c(c,$m);var d=D.c(c,fl),e=D.c(c,no),f=D.c(c,Ak);c=D.c(c,Em);var h=dg.h(null),k=dg.h(null),l=dg.h(null);return new My(f,c,d,e,h,k,l,null,null,null)});function Ny(a){return ev(JSON.parse(a))}
+function Oy(a,b){var c=Kx(1);lx(function(c){return function(){var d=function(){return function(a){return function(){function b(b){for(;;){a:try{for(;;){var c=a(b);if(!N(c,Z)){var d=c;break a}}}catch(x){if(x instanceof Object)b[5]=x,Cx(b),d=Z;else throw x;}if(!N(d,Z))return d}}function c(){var a=[null,null,null,null,null,null,null,null,null,null,null,null,null];a[0]=d;a[1]=1;return a}var d=null;d=function(a){switch(arguments.length){case 0:return c.call(this);case 1:return b.call(this,a)}throw Error("Invalid arity: "+
+(arguments.length-1));};d.B=c;d.h=b;return d}()}(function(){return function(c){var d=c[1];if(7===d)return c[2]=!1,c[1]=8,Z;if(20===d)return c[2]=!1,c[1]=21,Z;if(27===d){d=c[7];var e=D.c(c[2],ko);return Ax(c,28,d,e)}if(1===d)return zx(c,2,a);if(24===d)return c[2]=c[2],c[1]=21,Z;if(4===d)return c[2]=!1,c[1]=5,Z;if(15===d)return d=c[2],c[8]=d,c[1]=t(d)?16:17,Z;if(21===d)return c[1]=t(c[2])?25:26,Z;if(13===d)return zx(c,15,a);if(22===d)return c[2]=!0,c[1]=24,Z;if(6===d)return c[2]=!0,c[1]=8,Z;if(28===
+d)return c[9]=c[2],c[2]=null,c[1]=13,Z;if(25===d)return d=c[8],d=P(U,d),c[2]=d,c[1]=27,Z;if(17===d)return c[2]=null,c[1]=18,Z;if(3===d)return d=c[10],e=q===d.G,c[1]=t(d.m&64||e)?6:7,Z;if(12===d)return c[11]=c[2],c[2]=null,c[1]=13,Z;if(2===d)return d=c[2],e=wb(null==d),c[10]=d,c[1]=e?3:4,Z;if(23===d)return c[2]=!1,c[1]=24,Z;if(19===d)return d=c[8],e=q===d.G,c[1]=t(d.m&64||e)?22:23,Z;if(11===d){var f=c[2];d=D.c(f,Zk);e=D.c(f,fl);var h=D.c(f,no);f=D.c(f,ko);e=Ky(e,h,b);c[7]=e;c[12]=d;return Ax(c,12,
+e,f)}return 9===d?(d=c[10],d=P(U,d),c[2]=d,c[1]=11,Z):5===d?(c[1]=t(c[2])?9:10,Z):14===d?Bx(c,c[2]):26===d?(d=c[8],c[2]=d,c[1]=27,Z):16===d?(d=c[8],c[1]=wb(null==d)?19:20,Z):10===d?(d=c[10],c[2]=d,c[1]=11,Z):18===d?(c[2]=c[2],c[1]=14,Z):8===d?(c[2]=c[2],c[1]=5,Z):null}}(c),c)}(),f=function(){var a=d.B?d.B():d.call(null);a[6]=c;return a}();return yx(f)}}(c))}
+function Py(a,b){var c=new EventSource(a),d=dg.h(null);Ox(b,ly(!0));c.onopen=function(a,c){return function(){var a=Mx(1E4,ig.h(Ny));fg(c,a);Oy(a,b);Ox(b,ny(!0));return Ox(b,ly(!1))}}(c,d);c.onerror=function(a,c){return function(){Tw(B(c));fg(c,null);return Ox(b,ly(!0))}}(c,d);return c.onmessage=function(a,b){return function(a){var c=B(b);return t(c)?Ox(c,a.data):null}}(c,d)}
+function Qy(a,b,c,d,e,f,h){this.ha=a;this.url=b;this.Y=c;this.yb=d;this.v=e;this.j=f;this.w=h;this.m=2229667594;this.J=139264}g=Qy.prototype;g.Bd=function(){fg(this.ha,Kx(null));return t(this.Y)?this.ac(null):null};g.Ad=function(){return this.wc(null)};g.ac=function(){if(t(B(this.yb)))return null;fg(this.yb,!0);return Py(this.url,B(this.ha))};g.wc=function(){return null};g.Dd=function(){return this.ac(null)};g.Cd=function(){return null};g.zd=function(){return null};
+g.V=function(a,b){return this.I(null,b,null)};g.I=function(a,b,c){switch(b instanceof L?b.ea:null){case "msg-ch":return this.ha;case "url":return this.url;case "auto-play?":return this.Y;case "started?":return this.yb;default:return D.l(this.j,b,c)}};
+g.R=function(a,b,c){return Y(b,function(){return function(a){return Y(b,Qi,""," ","",c,a)}}(this),"#asciinema.player.source.Stream{",", ","}",c,O.c(new R(null,4,5,T,[new R(null,2,5,T,[Dl,this.ha],null),new R(null,2,5,T,[$m,this.url],null),new R(null,2,5,T,[Jm,this.Y],null),new R(null,2,5,T,[rm,this.yb],null)],null),this.j))};g.ba=function(){return new fh(0,this,4,new R(null,4,5,T,[Dl,$m,Jm,rm],null),t(this.j)?dd(this.j):Cf())};g.P=function(){return this.v};g.W=function(){return 4+H(this.j)};
+g.U=function(){var a=this,b=this.w;if(null!=b)return b;var c=function(){return function(){return function(a){return 187678783^Dd(a)}}(b,a)(a)}();return this.w=c};g.K=function(a,b){return null!=b&&this.constructor===b.constructor&&G.c(this.ha,b.ha)&&G.c(this.url,b.url)&&G.c(this.Y,b.Y)&&G.c(this.yb,b.yb)&&G.c(this.j,b.j)};
+g.ga=function(a,b){return He(new ti(null,new r(null,4,[Dl,null,rm,null,Jm,null,$m,null],null),null),b)?le.c(tc(wg.c(Ef,this),this.v),b):new Qy(this.ha,this.url,this.Y,this.yb,this.v,Bf(le.c(this.j,b)),null)};
+g.O=function(a,b,c){return t(N.c?N.c(Dl,b):N.call(null,Dl,b))?new Qy(c,this.url,this.Y,this.yb,this.v,this.j,null):t(N.c?N.c($m,b):N.call(null,$m,b))?new Qy(this.ha,c,this.Y,this.yb,this.v,this.j,null):t(N.c?N.c(Jm,b):N.call(null,Jm,b))?new Qy(this.ha,this.url,c,this.yb,this.v,this.j,null):t(N.c?N.c(rm,b):N.call(null,rm,b))?new Qy(this.ha,this.url,this.Y,c,this.v,this.j,null):new Qy(this.ha,this.url,this.Y,this.yb,this.v,K.l(this.j,b,c),null)};
+g.S=function(){return E(O.c(new R(null,4,5,T,[new R(null,2,5,T,[Dl,this.ha],null),new R(null,2,5,T,[$m,this.url],null),new R(null,2,5,T,[Jm,this.Y],null),new R(null,2,5,T,[rm,this.yb],null)],null),this.j))};g.T=function(a,b){return new Qy(this.ha,this.url,this.Y,this.yb,b,this.j,this.w)};g.X=function(a,b){return ze(b)?this.O(null,A.c(b,0),A.c(b,1)):Mb(Tb,this,b)};wj(hm,function(a,b){var c=null!=b&&(b.m&64||q===b.G)?P(U,b):b;c=D.c(c,Em);var d=dg.h(null),e=dg.h(!1);return new Qy(d,a,c,e,null,null,null)});function Ry(a){var b=new R(null,5,5,T,["fullscreenElement","mozFullScreenElement","webkitFullscreenElement","webkitCurrentFullScreenElement","msFullscreenElement"],null);b=Wf($f.c(Ee,Pu),b);t(b)?(a=Wf(Pu,new R(null,5,5,T,["exitFullscreen","webkitExitFullscreen","webkitCancelFullScreen","mozCancelFullScreen","msExitFullscreen"],null)),a=t(a)?a.call(document):null):(b=new R(null,5,5,T,["requestFullscreen","webkitRequestFullscreen","webkitRequestFullScreen","mozRequestFullScreen","msRequestFullscreen"],
+null),b=Wf(ag.c(Hb,a),b),a=t(b)?b.call(a):null);return a};r.prototype.yd=function(){return il.h(this)};r.prototype.xd=function(){return pl.h(this)};function Sy(a,b){return function(c){var d=b.h?b.h(c):b.call(null,c);return t(d)?(Ox(a,d),c.stopPropagation()):null}}function Ty(a,b){return Sy(a,function(){return b})}function Uy(a,b,c){var d="number"===typeof a||G.c(a,"fg")||G.c(a,"bg");return t(d)?(a=t(t(b)?8>a:b)?a+8:a,[v.h(c),v.h(a)].join("")):null}
+function Vy(a){var b=J(a,0,null),c=J(a,1,null);a=J(a,2,null);return["rgb(",v.h(b),",",v.h(c),",",v.h(a),")"].join("")}
+var Wy=hj(function(a){a=null!=a&&(a.m&64||q===a.G)?P(U,a):a;var b=D.c(a,Nk),c=D.c(a,pl);a=K.l(a,Nk,t(c)?wb(b):b);var d=null!=a&&(a.m&64||q===a.G)?P(U,a):a,e=D.c(d,Ok),f=D.c(d,Tn);b=D.c(d,Kj);var h=D.c(d,dk);c=D.c(d,Vl);var k=D.c(d,Nk),l=D.c(d,Yn);d=D.c(d,pl);var p=t(k)?t(e)?e:"fg":f;e=Uy(t(k)?t(f)?f:"bg":e,b,"fg-");h=Uy(p,h,"bg-");c=vg(ub,new R(null,6,5,T,[e,h,t(b)?"bright":null,t(l)?"italic":null,t(c)?"underline":null,t(d)?"cursor":null],null));if(E(c))a:for(b=new cb,c=E(c);;)if(null!=c)b.append(""+
+v.h(y(c))),c=z(c),null!=c&&b.append(" ");else{b=b.toString();break a}else b=null;l=null!=a&&(a.m&64||q===a.G)?P(U,a):a;a=D.c(l,Ok);c=D.c(l,Tn);h=D.c(l,Nk);l=t(h)?c:a;a=t(h)?a:c;a=hi.A(be([t(ze.h?ze.h(l):ze.call(null,l))?new r(null,1,[ik,Vy(l)],null):null,t(ze.h?ze.h(a):ze.call(null,a))?new r(null,1,[al,Vy(a)],null):null]));return hi.A(be([t(b)?new r(null,1,[vn,b],null):null,t(a)?new r(null,1,[fm,a],null):null]))});
+function Xy(a,b){var c=J(a,0,null),d=J(a,1,null);d=Bg(d,pl,function(){return function(a){return t(a)?B(b):a}}(a,c,d));return new R(null,3,5,T,[ro,Wy.h?Wy.h(d):Wy.call(null,d),c],null)}function Yy(a,b){var c=J(a,0,null),d=J(a,1,null),e=jg(b,c);e=E(e)?new R(null,2,5,T,[Eo(e),d],null):null;var f=K.l(d,pl,!0);f=new R(null,2,5,T,[Vd(c,b),f],null);c=kg(b+1,c);d=E(c)?new R(null,2,5,T,[Eo(c),d],null):null;return vg(ub,new R(null,3,5,T,[e,f,d],null))}
+function Zy(a,b){for(var c=he,d=a,e=b;;)if(E(d)){var f=y(d),h=J(f,0,null);J(f,1,null);h=H(h);if(h<=e)c=ge.c(c,f),d=vd(d),e-=h;else return O.A(c,Yy(f,e),be([vd(d)]))}else return c}function $y(a,b,c){a=t(B(b))?Zy(B(a),B(b)):B(a);return new R(null,2,5,T,[Lm,Ii(bg(function(){return function(a,b){return pe(new R(null,3,5,T,[Xy,b,c],null),new r(null,1,[mk,a],null))}}(a),a))],null)}var qA=new ti(null,new r(null,3,["small",null,"medium",null,"big",null],null),null);
+function rA(a,b,c,d,e){var f=yp(function(){var a=B(c);return t(qA.h?qA.h(a):qA.call(null,a))?["font-",v.h(a)].join(""):null}),h=yp(function(){return function(){var d=B(a),e=B(b),f=B(c);f=t(qA.h?qA.h(f):qA.call(null,f))?null:new r(null,1,[wk,f],null);return hi.A(be([new r(null,2,[fl,[v.h(d),"ch"].join(""),no,[v.h(1.3333333333*e),"em"].join("")],null),f]))}}(f)),k=yp(function(){return function(){return Lu(B(d))}}(f,h)),l=yp(function(a,c,d){return function(){return xg(function(a,b,c){return function(d){return yp(function(a,
+b,c){return function(){return D.c(B(c),d)}}(a,b,c))}}(a,c,d),Fi(0,B(b),1))}}(f,h,k)),p=yp(function(){return function(){return Mu(B(d))}}(f,h,k,l)),m=yp(function(a,b,c,d,e){return function(){return zn.h(B(e))}}(f,h,k,l,p)),u=yp(function(a,b,c,d,e){return function(){return Aj.h(B(e))}}(f,h,k,l,p,m)),w=yp(function(a,b,c,d,e){return function(){return On.h(B(e))}}(f,h,k,l,p,m,u));return function(a,b,c,d,f,h,k,l){return function(){return new R(null,3,5,T,[Gm,new r(null,2,[vn,B(a),fm,B(b)],null),bg(function(a,
+b,c,d,f,h,k,l){return function(m,p){var u=yp(function(a,b,c,d,e,f,h,k){return function(){var a=B(k);return t(a)?(a=G.c(m,B(h)))?B(f):a:a}}(a,b,c,d,f,h,k,l));return pe(new R(null,4,5,T,[$y,p,u,e],null),new r(null,1,[mk,m],null))}}(a,b,c,d,f,h,k,l),B(d))],null)}}(f,h,k,l,p,m,u,w)}
+function sA(){return new R(null,2,5,T,[Ym,new r(null,4,[Mn,"1.1",Fl,"0 0 866.0254037844387 866.0254037844387",vn,"icon",mo,new r(null,1,[An,'\x3cdefs\x3e \x3cmask id\x3d"small-triangle-mask"\x3e \x3crect width\x3d"100%" height\x3d"100%" fill\x3d"white"/\x3e \x3cpolygon points\x3d"508.01270189221935 433.01270189221935, 208.0127018922194 259.8076211353316, 208.01270189221927 606.217782649107" fill\x3d"black"\x3e\x3c/polygon\x3e \x3c/mask\x3e \x3c/defs\x3e \x3cpolygon points\x3d"808.0127018922194 433.01270189221935, 58.01270189221947 -1.1368683772161603e-13, 58.01270189221913 866.0254037844386" mask\x3d"url(#small-triangle-mask)" fill\x3d"white"\x3e\x3c/polygon\x3e \x3cpolyline points\x3d"481.2177826491071 333.0127018922194, 134.80762113533166 533.0127018922194" stroke\x3d"white" stroke-width\x3d"90"\x3e\x3c/polyline\x3e'],null)],
+null)],null)}function tA(){return new R(null,3,5,T,[Ym,new r(null,3,[Mn,"1.1",Fl,"0 0 12 12",vn,"icon"],null),new R(null,2,5,T,[Fj,new r(null,1,[pn,"M1,0 L11,6 L1,12 Z"],null)],null)],null)}function uA(){return new R(null,4,5,T,[Ym,new r(null,3,[Mn,"1.1",Fl,"0 0 12 12",vn,"icon"],null),new R(null,2,5,T,[Fj,new r(null,1,[pn,"M1,0 L4,0 L4,12 L1,12 Z"],null)],null),new R(null,2,5,T,[Fj,new r(null,1,[pn,"M8,0 L11,0 L11,12 L8,12 Z"],null)],null)],null)}
+function vA(){return new R(null,4,5,T,[Ym,new r(null,3,[Mn,"1.1",Fl,"0 0 12 12",vn,"icon"],null),new R(null,2,5,T,[Fj,new r(null,1,[pn,"M12,0 L7,0 L9,2 L7,4 L8,5 L10,3 L12,5 Z"],null)],null),new R(null,2,5,T,[Fj,new r(null,1,[pn,"M0,12 L0,7 L2,9 L4,7 L5,8 L3,10 L5,12 Z"],null)],null)],null)}
+function wA(){return new R(null,4,5,T,[Ym,new r(null,3,[Mn,"1.1",Fl,"0 0 12 12",vn,"icon"],null),new R(null,2,5,T,[Fj,new r(null,1,[pn,"M7,5 L7,0 L9,2 L11,0 L12,1 L10,3 L12,5 Z"],null)],null),new R(null,2,5,T,[Fj,new r(null,1,[pn,"M5,7 L0,7 L2,9 L0,11 L1,12 L3,10 L5,12 Z"],null)],null)],null)}function xA(a,b){return function(b){return function(){return new R(null,3,5,T,[cl,new r(null,1,[Sl,b],null),new R(null,1,5,T,[t(B(a))?uA:tA],null)],null)}}(Ty(b,new fy(null,null,null)))}
+function yA(a){return 10>a?["0",v.h(a)].join(""):a}function zA(a){var b=Math.floor((a%60+60)%60);return[v.h(yA(Math.floor(a/60))),":",v.h(yA(b))].join("")}function AA(a,b){var c=T,d=new R(null,2,5,T,[Yk,zA(B(a))],null),e=T;var f=B(a);var h=B(b);f=["-",v.h(zA(h-f))].join("");return new R(null,3,5,c,[Ml,d,new R(null,2,5,e,[co,f],null)],null)}
+function BA(){function a(a){a.preventDefault();return Ry(a.currentTarget.parentNode.parentNode.parentNode)}return function(){return new R(null,4,5,T,[un,new r(null,1,[Sl,a],null),new R(null,1,5,T,[vA],null),new R(null,1,5,T,[wA],null)],null)}}
+function CA(a,b){var c=Sy(b,function(a){var b=a.currentTarget.offsetWidth,c=a.currentTarget.getBoundingClientRect();return cy(Nu(a.clientX-c.left,b)/b)}),d=yp(function(){return function(){return[v.h(100*B(a)),"%"].join("")}}(c));return function(a,b){return function(){return new R(null,2,5,T,[Vj,new R(null,3,5,T,[Bl,new r(null,1,[Ql,a],null),new R(null,2,5,T,[Cj,new R(null,2,5,T,[ro,new r(null,1,[fm,new r(null,1,[fl,B(b)],null)],null)],null)],null)],null)],null)}}(c,d)}
+function DA(a,b,c,d){return function(e){return function(){return new R(null,5,5,T,[Kk,new R(null,3,5,T,[xA,a,d],null),new R(null,3,5,T,[AA,b,c],null),new R(null,1,5,T,[BA],null),new R(null,3,5,T,[CA,e,d],null)],null)}}(yp(function(){return B(b)/B(c)}))}
+function EA(a){return function(a){return function(){return new R(null,3,5,T,[ol,new r(null,1,[Sl,a],null),new R(null,2,5,T,[Xk,new R(null,2,5,T,[km,new R(null,2,5,T,[ro,new R(null,1,5,T,[sA],null)],null)],null)],null)],null)}}(Ty(a,new fy(null,null,null)))}function FA(){return new R(null,2,5,T,[Ek,new R(null,1,5,T,[xn],null)],null)}function GA(a){return Wf(function(b){return a[b]},new R(null,4,5,T,["altKey","shiftKey","metaKey","ctrlKey"],null))}
+function HA(a){var b=t(GA(a))?null:function(){switch(a.key){case " ":return new fy(null,null,null);case "f":return bm;case "0":return cy(0);case "1":return cy(.1);case "2":return cy(.2);case "3":return cy(.3);case "4":return cy(.4);case "5":return cy(.5);case "6":return cy(.6);case "7":return cy(.7);case "8":return cy(.8);case "9":return cy(.9);default:return null}}();if(t(b))return b;switch(a.key){case "\x3e":return new ey(null,null,null);case "\x3c":return new dy(null,null,null);default:return null}}
+function IA(a){if(t(GA(a)))return null;switch(a.which){case 37:return new ay(null,null,null);case 39:return new $x(null,null,null);default:return null}}function JA(a){var b=HA(a);return t(b)?(a.preventDefault(),G.c(b,bm)?(Ry(a.currentTarget),null):b):null}function KA(a){var b=IA(a);return t(b)?(a.preventDefault(),b):null}
+function LA(a,b,c,d){a=t(a)?['"',v.h(a),'"'].join(""):"untitled";return new R(null,4,5,T,[dl,t(d)?new R(null,2,5,T,[jo,new r(null,1,[zl,d],null)],null):null,a,t(b)?new R(null,3,5,T,[ro," by ",t(c)?new R(null,3,5,T,[lo,new r(null,1,[ho,c],null),b],null):b],null):null],null)}
+function MA(a){var b=Mx(1,ig.h(iy)),c=Kx(1);lx(function(c){return function(){var d=function(){return function(a){return function(){function b(b){for(;;){a:try{for(;;){var c=a(b);if(!N(c,Z)){var d=c;break a}}}catch(x){if(x instanceof Object)b[5]=x,Cx(b),d=Z;else throw x;}if(!N(d,Z))return d}}function c(){var a=[null,null,null,null,null,null,null,null,null,null,null,null];a[0]=d;a[1]=1;return a}var d=null;d=function(a){switch(arguments.length){case 0:return c.call(this);case 1:return b.call(this,a)}throw Error("Invalid arity: "+
+(arguments.length-1));};d.B=c;d.h=b;return d}()}(function(){return function(c){var d=c[1];if(7===d)return c[7]=c[2],Ax(c,12,b,!1);if(1===d)return c[2]=null,c[1]=2,Z;if(4===d)return c[8]=c[2],Ax(c,5,b,!0);if(6===d)return d=Jx(3E3),Ux(c,8,new R(null,2,5,T,[a,d],null));if(3===d)return Bx(c,c[2]);if(12===d)return c[9]=c[2],c[2]=null,c[1]=2,Z;if(2===d)return zx(c,4,a);if(11===d)return c[2]=c[2],c[1]=7,Z;if(9===d)return c[2]=null,c[1]=6,Z;if(5===d)return c[10]=c[2],c[2]=null,c[1]=6,Z;if(10===d)return c[2]=
+null,c[1]=11,Z;if(8===d){var e=c[2];d=J(e,0,null);e=J(e,1,null);e=G.c(e,a);c[11]=d;c[1]=e?9:10;return Z}return null}}(c),c)}(),f=function(){var a=d.B?d.B():d.call(null);a[6]=c;return a}();return yx(f)}}(c));return b}
+function NA(a,b){var c=dg.h(b),d=Kx(1);lx(function(b,c){return function(){var d=function(){return function(a){return function(){function b(b){for(;;){a:try{for(;;){var c=a(b);if(!N(c,Z)){var d=c;break a}}}catch(F){if(F instanceof Object)b[5]=F,Cx(b),d=Z;else throw F;}if(!N(d,Z))return d}}function c(){var a=[null,null,null,null,null,null,null,null,null,null,null,null,null];a[0]=d;a[1]=1;return a}var d=null;d=function(a){switch(arguments.length){case 0:return c.call(this);case 1:return b.call(this,
+a)}throw Error("Invalid arity: "+(arguments.length-1));};d.B=c;d.h=b;return d}()}(function(b,c){return function(d){var e=d[1];if(7===e){var f=d[7],h=wb(null==f);d[8]=d[2];d[1]=h?8:9;return Z}if(20===e)return f=d[7],d[1]=t(q===f.Fe)?23:24,Z;if(27===e)return d[2]=!1,d[1]=28,Z;if(1===e)return d[2]=null,d[1]=2,Z;if(24===e)return f=d[7],d[1]=t(!f.Tc)?26:27,Z;if(4===e){f=d[7];var k=d[9];h=d[2];var l=J(h,0,null),m=J(h,1,null);d[10]=m;d[7]=l;d[9]=h;d[1]=t(null==l)?5:6;return Z}return 15===e?(d[2]=!1,d[1]=
+16,Z):21===e?(f=d[7],h=Ab(Yx,f),d[2]=h,d[1]=22,Z):31===e?(d[11]=d[2],d[2]=null,d[1]=2,Z):13===e?(d[2]=d[2],d[1]=10,Z):22===e?(d[1]=t(d[2])?29:30,Z):29===e?(f=d[7],h=B(a),h=Zx(f,h),h=gg.l(c,wo,h),d[2]=h,d[1]=31,Z):6===e?(d[2]=null,d[1]=7,Z):28===e?(d[2]=d[2],d[1]=25,Z):25===e?(d[2]=d[2],d[1]=22,Z):17===e?(m=d[10],f=d[7],k=d[9],h=gg.c(a,function(){return function(a,b){return function(a){return Xx(b,a)}}(k,f,m,m,f,k,e,b,c)}()),d[2]=h,d[1]=19,Z):3===e?Bx(d,d[2]):12===e?(f=d[7],d[1]=t(!f.Tc)?14:15,Z):
+2===e?(h=B(c),h=E(h),Ux(d,4,h)):23===e?(d[2]=!0,d[1]=25,Z):19===e?(f=d[7],h=wb(null==f),d[12]=d[2],d[1]=h?20:21,Z):11===e?(d[2]=!0,d[1]=13,Z):9===e?(f=d[7],h=Ab(Wx,f),d[2]=h,d[1]=10,Z):5===e?(m=d[10],h=gg.l(c,re,m),d[2]=h,d[1]=7,Z):14===e?(f=d[7],h=Ab(Wx,f),d[2]=h,d[1]=16,Z):26===e?(f=d[7],h=Ab(Yx,f),d[2]=h,d[1]=28,Z):16===e?(d[2]=d[2],d[1]=13,Z):30===e?(d[2]=null,d[1]=31,Z):10===e?(d[1]=t(d[2])?17:18,Z):18===e?(d[2]=null,d[1]=19,Z):8===e?(f=d[7],d[1]=t(q===f.sb)?11:12,Z):null}}(b,c),b,c)}(),e=function(){var a=
+d.B?d.B():d.call(null);a[6]=b;return a}();return yx(e)}}(d,c));return d}
+function OA(a,b,c){c=Ty(c,!0);var d=Sy(b,JA),e=Sy(b,KA),f=yp(function(){return function(){return Hm.h(B(a))}}(c,d,e)),h=yp(function(){return function(){return el.h(B(a))}}(c,d,e,f)),k=yp(function(a,b,c,d,e){return function(){var a=B(d);return t(a)?a:B(e)}}(c,d,e,f,h)),l=yp(function(b,c,d,e,f,h){return function(){var b=Gk.h(B(a));b=t(b)?b:wb(B(h));return t(b)?"hud":null}}(c,d,e,f,h,k)),p=yp(function(){return function(){return["asciinema-theme-",v.h(gm.h(B(a)))].join("")}}(c,d,e,f,h,k,l)),m=yp(function(){return function(){var b=
+fl.h(B(a));return t(b)?b:80}}(c,d,e,f,h,k,l,p)),u=yp(function(){return function(){var b=no.h(B(a));return t(b)?b:24}}(c,d,e,f,h,k,l,p,m)),w=yp(function(){return function(){return wk.h(B(a))}}(c,d,e,f,h,k,l,p,m,u)),x=yp(function(){return function(){return V.h(B(a))}}(c,d,e,f,h,k,l,p,m,u,w)),C=yp(function(){return function(){return ml.h(B(a))}}(c,d,e,f,h,k,l,p,m,u,w,x)),F=yp(function(){return function(){return jn.h(B(a))}}(c,d,e,f,h,k,l,p,m,u,w,x,C)),I=yp(function(){return function(){return Uj.h(B(a))}}(c,
+d,e,f,h,k,l,p,m,u,w,x,C,F)),M=yp(function(){return function(){return wl.h(B(a))}}(c,d,e,f,h,k,l,p,m,u,w,x,C,F,I)),S=B(a),X=null!=S&&(S.m&64||q===S.G)?P(U,S):S,Ga=D.c(X,ki),db=D.c(X,li),Q=D.c(X,mi),xb=D.c(X,ni);return function(a,c,d,e,f,h,k,l,m,p,u,w,x,C,F,I,M,S,Q,X,Ga,db){return function(){return new R(null,3,5,T,[Cn,new r(null,5,[Jj,-1,Zj,c,Rn,d,Vm,a,vn,B(k)],null),new R(null,7,5,T,[Sm,new r(null,1,[vn,B(l)],null),new R(null,6,5,T,[rA,m,p,u,w,x],null),new R(null,5,5,T,[DA,C,F,I,b],null),t(t(Q)?Q:
+X)?new R(null,5,5,T,[LA,Q,X,Ga,db],null):null,t(B(h))?null:new R(null,2,5,T,[EA,b],null),t(B(e))?new R(null,1,5,T,[FA],null):null],null)],null)}}(c,d,e,f,h,k,l,p,m,u,w,x,C,F,I,M,S,X,Ga,db,Q,xb)}
+function PA(a){var b=Kx(null),c=Kx(new dx(bx(1),1));return function(b,c){return function(){return Pp(new r(null,4,[ln,"asciinema-player",Dm,function(b,c){return function(){return OA(a,b,c)}}(b,c),$k,function(b,c){return function(){var d=ty(Gl.h(B(a))),e=MA(c);Tx(e,b);return NA(a,Je([b,d]))}}(b,c),Wm,function(){return function(){return uy(Gl.h(B(a)))}}(b,c)],null))}}(b,c)};function QA(a,b){var c=null!=b&&(b.m&64||q===b.G)?P(U,b):b,d=D.c(c,Ak),e=D.c(c,Gl);d=a.h?a.h(d):a.call(null,d);zy(e,d);return K.l(c,Ak,d)}$x.prototype.sb=q;$x.prototype.qb=function(a,b){var c=null!=b&&(b.m&64||q===b.G)?P(U,b):b,d=D.c(c,Uj),e=D.c(c,wl),f=D.c(c,Gl);t(e)&&yy(f,Nu(d+5,e));return c};ay.prototype.sb=q;ay.prototype.qb=function(a,b){var c=null!=b&&(b.m&64||q===b.G)?P(U,b):b,d=D.c(c,Uj),e=D.c(c,wl),f=D.c(c,Gl);t(e)&&yy(f,Nu(d+-5,e));return c};by.prototype.sb=q;
+by.prototype.qb=function(a,b){var c=null!=b&&(b.m&64||q===b.G)?P(U,b):b,d=D.c(c,wl),e=D.c(c,Gl);t(d)&&(d*=nn.h(this),yy(e,d));return c};dy.prototype.sb=q;dy.prototype.qb=function(a,b){return QA(function(){return function(a){return a/2}}(this),b)};ey.prototype.sb=q;ey.prototype.qb=function(a,b){return QA(function(){return function(a){return 2*a}}(this),b)};fy.prototype.sb=q;fy.prototype.qb=function(a,b){xy(Gl.h(b));return b};gy.prototype.sb=q;gy.prototype.qb=function(a,b){return K.l(b,ml,so.h(this))};
+hy.prototype.sb=q;hy.prototype.qb=function(a,b){return K.l(b,Gk,so.h(this))};jy.prototype.sb=q;jy.prototype.qb=function(a,b){var c=null!=a&&(a.m&64||q===a.G)?P(U,a):a;D.c(c,fl);D.c(c,no);D.c(c,wl);c=null!=b&&(b.m&64||q===b.G)?P(U,b):b;var d=D.c(c,fl),e=D.c(c,no),f=null!=this&&(this.m&64||q===this.G)?P(U,this):this,h=D.c(f,fl),k=D.c(f,no);f=D.c(f,wl);return K.A(c,fl,t(d)?d:h,be([no,t(e)?e:k,wl,f]))};ky.prototype.sb=q;ky.prototype.qb=function(a,b){return K.l(b,Hm,Hm.h(this))};oy.prototype.sb=q;
+oy.prototype.qb=function(a,b){var c=null!=b&&(b.m&64||q===b.G)?P(U,b):b,d=D.c(c,oi);t(d)&&(ap(bp),d.B?d.B():d.call(null));return c};ry.prototype.sb=q;ry.prototype.qb=function(a,b){return K.l(b,Uj,Zk.h(this))};function RA(){return ig.l(function(a,b){return new R(null,2,5,T,[a,new gy(b,null,null,null)],null)},rg(function(a){return a+.5},.5),og(new R(null,2,5,T,[!1,!0],null)))}function SA(a){var b=Dy(RA());return K.l(K.l(a,ml,!0),Ol,b)}
+function TA(a){a=null!=a&&(a.m&64||q===a.G)?P(U,a):a;var b=D.c(a,Ol);Tw(b);return K.l(K.l(a,ml,!0),Ol,null)}function UA(a){a=null!=a&&(a.m&64||q===a.G)?P(U,a):a;a=D.c(a,Ol);return t(a)?Je([a]):vi}my.prototype.sb=q;
+my.prototype.qb=function(a,b){var c=null!=a&&(a.m&64||q===a.G)?P(U,a):a;D.c(c,jn);var d=null!=b&&(b.m&64||q===b.G)?P(U,b):b,e=D.c(d,jn);c=D.c(d,pi);var f=D.c(d,qi),h=null!=this&&(this.m&64||q===this.G)?P(U,this):this;h=D.c(h,jn);if(G.c(e,h))return d;d=K.A(d,jn,h,be([el,!0]));if(t(h))return t(c)&&(c.B?c.B():c.call(null)),SA(d);t(f)&&(f.B?f.B():f.call(null));return TA(d)};my.prototype.Fe=q;my.prototype.de=function(a,b){return UA(b)};py.prototype.sb=q;
+py.prototype.qb=function(a,b){var c=K.l(b,V,V.h(this));c=null!=c&&(c.m&64||q===c.G)?P(U,c):c;var d=D.c(c,Ol);return t(d)?SA(TA(c)):c};py.prototype.Fe=q;py.prototype.de=function(a,b){return UA(b)};function VA(a){return t(a)?(a=ig.c(parseFloat,Fo(""+v.h(a),/:/)),a=ig.l(Ye,cf(a),rg(function(){return function(a){return 60*a}}(a),1)),P(Xe,a)):null}
+function WA(a,b,c){t(a)?"string"===typeof a?t(0===a.indexOf("data:application/json;base64,"))?(b=a.substring(29).replace(RegExp("\\s","g"),""),b=JSON.parse(atob(b)),b=fj(b),b=new r(null,1,[V,new r(null,1,[il,b],null)],null)):t(0===a.indexOf("data:text/plain,"))?(a=a.substring(16),b=Ju(Ot(t(b)?b:80,t(c)?c:24),a),b=new r(null,1,[V,b],null)):b=t(0===a.indexOf("npt:"))?new r(null,1,[Zk,VA(a.substring(4))],null):null:b=new r(null,1,[V,new r(null,1,[il,a],null)],null):b=null;return b}
+var XA=new r(null,2,[pl,new r(null,1,[On,!1],null),il,he],null);
+function YA(a,b){var c=null!=b&&(b.m&64||q===b.G)?P(U,b):b,d=D.c(c,no),e=D.l(c,wk,"small"),f=D.l(c,Ak,1),h=D.c(c,Hk),k=D.c(c,fl),l=D.c(c,rl),p=D.l(c,cm,!1),m=D.l(c,gm,"asciinema"),u=D.c(c,qm),w=D.c(c,Bm),x=D.l(c,vm,!1),C=D.l(c,Em,!1),F=function(){var a=VA(h);return t(a)?a:0}();w=WA(w,k,d);var I=null!=w&&(w.m&64||q===w.G)?P(U,w):w;w=D.c(I,V);I=D.c(I,Zk);var M=t(I)?I:wb(w)&&0<F?F:null;I=function(){var b=Pe([Ak,Hk,fl,rl,cm,qm,vm,Em,Mm,no],[f,F,k,l,p,u,x,C,M,d]);return xj.c?xj.c(a,b):xj.call(null,a,b)}();
+return hi.A(be([Pe([Uj,V,wk,Ak,Gk,el,fl,wl,Gl,Ol,gm,Hm,jn,no],[F,t(w)?w:XA,e,f,!1,!1,k,null,I,null,m,!1,!1,d]),ji(c)]))}function ZA(a,b,c){a="string"===typeof a?document.getElementById(a):a;b=tp.h(P(YA,be([b,c])));c=new R(null,2,5,T,[PA,b],null);qq?oq(c,a,null):pq.call(null,c,a);return b}
+ib=function(){function a(a){var c=null;if(0<arguments.length){c=0;for(var e=Array(arguments.length-0);c<e.length;)e[c]=arguments[c+0],++c;c=new Jb(e,0,null)}return b.call(this,c)}function b(a){return console.log.apply(console,Lb(a))}a.L=0;a.N=function(a){a=E(a);return b(a)};a.A=b;return a}();
+kb=function(){function a(a){var c=null;if(0<arguments.length){c=0;for(var e=Array(arguments.length-0);c<e.length;)e[c]=arguments[c+0],++c;c=new Jb(e,0,null)}return b.call(this,c)}function b(a){return console.error.apply(console,Lb(a))}a.L=0;a.N=function(a){a=E(a);return b(a)};a.A=b;return a}();var $A=function $A(a){switch(arguments.length){case 2:return $A.c(arguments[0],arguments[1]);case 3:return $A.l(arguments[0],arguments[1],arguments[2]);default:throw Error(["Invalid arity: ",v.h(arguments.length)].join(""));}};da("asciinema.player.js.CreatePlayer",$A);$A.c=function(a,b){return $A.l(a,b,Ef)};
+$A.l=function(a,b,c){b=fj(b);c=yo(fj(c));a=ZA(a,b,c);return cj(new r(null,5,[En,function(a,b,c){return function(){return Uj.h(B(c))}}(b,c,a),Bj,function(a,b,c){return function(a){var b=B(c);b=null!=b&&(b.m&64||q===b.G)?P(U,b):b;D.c(b,wl);b=D.c(b,Gl);return yy(b,a)}}(b,c,a),Zm,function(a,b,c){return function(){return wl.h(B(c))}}(b,c,a),Jn,function(a,b,c){return function(){var a=B(c);a=null!=a&&(a.m&64||q===a.G)?P(U,a):a;a=D.c(a,Gl);return vy(a)}}(b,c,a),sn,function(a,b,c){return function(){var a=
+B(c);a=null!=a&&(a.m&64||q===a.G)?P(U,a):a;a=D.c(a,Gl);return wy(a)}}(b,c,a)],null))};$A.L=3;da("asciinema.player.js.UnmountPlayer",function(a){a="string"===typeof a?document.getElementById(a):a;gg.l(lq,le,a);return kq().unmountComponentAtNode(a)});registerAsciinemaPlayerElement();
+})();
+
+//# sourceMappingURL=asciinema-player.js.map
+
diff --git a/public_html/data/js/vendor/bootstrap.js b/public_html/data/js/vendor/bootstrap.js
new file mode 100644
index 000000000..34636e37e
--- /dev/null
+++ b/public_html/data/js/vendor/bootstrap.js
@@ -0,0 +1,2366 @@
+/*!
+ * Bootstrap v3.3.5 (http://getbootstrap.com)
+ * Copyright 2011-2016 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ */
+
+/*!
+ * Generated using the Bootstrap Customizer (http://getbootstrap.com/customize/?id=e51bc4b79b5712077b546b4ea577f138)
+ * Config saved to config.json and https://gist.github.com/e51bc4b79b5712077b546b4ea577f138
+ */
+if (typeof jQuery === 'undefined') {
+ throw new Error('Bootstrap\'s JavaScript requires jQuery')
+}
++function ($) {
+ 'use strict';
+ var version = $.fn.jquery.split(' ')[0].split('.')
+ if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] > 2)) {
+ throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3')
+ }
+}(jQuery);
+
+/* ========================================================================
+ * Bootstrap: alert.js v3.3.6
+ * http://getbootstrap.com/javascript/#alerts
+ * ========================================================================
+ * Copyright 2011-2015 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ * ======================================================================== */
+
+
++function ($) {
+ 'use strict';
+
+ // ALERT CLASS DEFINITION
+ // ======================
+
+ var dismiss = '[data-dismiss="alert"]'
+ var Alert = function (el) {
+ $(el).on('click', dismiss, this.close)
+ }
+
+ Alert.VERSION = '3.3.6'
+
+ Alert.TRANSITION_DURATION = 150
+
+ Alert.prototype.close = function (e) {
+ var $this = $(this)
+ var selector = $this.attr('data-target')
+
+ if (!selector) {
+ selector = $this.attr('href')
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
+ }
+
+ var $parent = $(selector)
+
+ if (e) e.preventDefault()
+
+ if (!$parent.length) {
+ $parent = $this.closest('.alert')
+ }
+
+ $parent.trigger(e = $.Event('close.bs.alert'))
+
+ if (e.isDefaultPrevented()) return
+
+ $parent.removeClass('in')
+
+ function removeElement() {
+ // detach from parent, fire event then clean up data
+ $parent.detach().trigger('closed.bs.alert').remove()
+ }
+
+ $.support.transition && $parent.hasClass('fade') ?
+ $parent
+ .one('bsTransitionEnd', removeElement)
+ .emulateTransitionEnd(Alert.TRANSITION_DURATION) :
+ removeElement()
+ }
+
+
+ // ALERT PLUGIN DEFINITION
+ // =======================
+
+ function Plugin(option) {
+ return this.each(function () {
+ var $this = $(this)
+ var data = $this.data('bs.alert')
+
+ if (!data) $this.data('bs.alert', (data = new Alert(this)))
+ if (typeof option == 'string') data[option].call($this)
+ })
+ }
+
+ var old = $.fn.alert
+
+ $.fn.alert = Plugin
+ $.fn.alert.Constructor = Alert
+
+
+ // ALERT NO CONFLICT
+ // =================
+
+ $.fn.alert.noConflict = function () {
+ $.fn.alert = old
+ return this
+ }
+
+
+ // ALERT DATA-API
+ // ==============
+
+ $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
+
+}(jQuery);
+
+/* ========================================================================
+ * Bootstrap: button.js v3.3.6
+ * http://getbootstrap.com/javascript/#buttons
+ * ========================================================================
+ * Copyright 2011-2015 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ * ======================================================================== */
+
+
++function ($) {
+ 'use strict';
+
+ // BUTTON PUBLIC CLASS DEFINITION
+ // ==============================
+
+ var Button = function (element, options) {
+ this.$element = $(element)
+ this.options = $.extend({}, Button.DEFAULTS, options)
+ this.isLoading = false
+ }
+
+ Button.VERSION = '3.3.6'
+
+ Button.DEFAULTS = {
+ loadingText: 'loading...'
+ }
+
+ Button.prototype.setState = function (state) {
+ var d = 'disabled'
+ var $el = this.$element
+ var val = $el.is('input') ? 'val' : 'html'
+ var data = $el.data()
+
+ state += 'Text'
+
+ if (data.resetText == null) $el.data('resetText', $el[val]())
+
+ // push to event loop to allow forms to submit
+ setTimeout($.proxy(function () {
+ $el[val](data[state] == null ? this.options[state] : data[state])
+
+ if (state == 'loadingText') {
+ this.isLoading = true
+ $el.addClass(d).attr(d, d)
+ } else if (this.isLoading) {
+ this.isLoading = false
+ $el.removeClass(d).removeAttr(d)
+ }
+ }, this), 0)
+ }
+
+ Button.prototype.toggle = function () {
+ var changed = true
+ var $parent = this.$element.closest('[data-toggle="buttons"]')
+
+ if ($parent.length) {
+ var $input = this.$element.find('input')
+ if ($input.prop('type') == 'radio') {
+ if ($input.prop('checked')) changed = false
+ $parent.find('.active').removeClass('active')
+ this.$element.addClass('active')
+ } else if ($input.prop('type') == 'checkbox') {
+ if (($input.prop('checked')) !== this.$element.hasClass('active')) changed = false
+ this.$element.toggleClass('active')
+ }
+ $input.prop('checked', this.$element.hasClass('active'))
+ if (changed) $input.trigger('change')
+ } else {
+ this.$element.attr('aria-pressed', !this.$element.hasClass('active'))
+ this.$element.toggleClass('active')
+ }
+ }
+
+
+ // BUTTON PLUGIN DEFINITION
+ // ========================
+
+ function Plugin(option) {
+ return this.each(function () {
+ var $this = $(this)
+ var data = $this.data('bs.button')
+ var options = typeof option == 'object' && option
+
+ if (!data) $this.data('bs.button', (data = new Button(this, options)))
+
+ if (option == 'toggle') data.toggle()
+ else if (option) data.setState(option)
+ })
+ }
+
+ var old = $.fn.button
+
+ $.fn.button = Plugin
+ $.fn.button.Constructor = Button
+
+
+ // BUTTON NO CONFLICT
+ // ==================
+
+ $.fn.button.noConflict = function () {
+ $.fn.button = old
+ return this
+ }
+
+
+ // BUTTON DATA-API
+ // ===============
+
+ $(document)
+ .on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) {
+ var $btn = $(e.target)
+ if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
+ Plugin.call($btn, 'toggle')
+ if (!($(e.target).is('input[type="radio"]') || $(e.target).is('input[type="checkbox"]'))) e.preventDefault()
+ })
+ .on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) {
+ $(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type))
+ })
+
+}(jQuery);
+
+/* ========================================================================
+ * Bootstrap: carousel.js v3.3.6
+ * http://getbootstrap.com/javascript/#carousel
+ * ========================================================================
+ * Copyright 2011-2015 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ * ======================================================================== */
+
+
++function ($) {
+ 'use strict';
+
+ // CAROUSEL CLASS DEFINITION
+ // =========================
+
+ var Carousel = function (element, options) {
+ this.$element = $(element)
+ this.$indicators = this.$element.find('.carousel-indicators')
+ this.options = options
+ this.paused = null
+ this.sliding = null
+ this.interval = null
+ this.$active = null
+ this.$items = null
+
+ this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this))
+
+ this.options.pause == 'hover' && !('ontouchstart' in document.documentElement) && this.$element
+ .on('mouseenter.bs.carousel', $.proxy(this.pause, this))
+ .on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
+ }
+
+ Carousel.VERSION = '3.3.6'
+
+ Carousel.TRANSITION_DURATION = 600
+
+ Carousel.DEFAULTS = {
+ interval: 5000,
+ pause: 'hover',
+ wrap: true,
+ keyboard: true
+ }
+
+ Carousel.prototype.keydown = function (e) {
+ if (/input|textarea/i.test(e.target.tagName)) return
+ switch (e.which) {
+ case 37: this.prev(); break
+ case 39: this.next(); break
+ default: return
+ }
+
+ e.preventDefault()
+ }
+
+ Carousel.prototype.cycle = function (e) {
+ e || (this.paused = false)
+
+ this.interval && clearInterval(this.interval)
+
+ this.options.interval
+ && !this.paused
+ && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
+
+ return this
+ }
+
+ Carousel.prototype.getItemIndex = function (item) {
+ this.$items = item.parent().children('.item')
+ return this.$items.index(item || this.$active)
+ }
+
+ Carousel.prototype.getItemForDirection = function (direction, active) {
+ var activeIndex = this.getItemIndex(active)
+ var willWrap = (direction == 'prev' && activeIndex === 0)
+ || (direction == 'next' && activeIndex == (this.$items.length - 1))
+ if (willWrap && !this.options.wrap) return active
+ var delta = direction == 'prev' ? -1 : 1
+ var itemIndex = (activeIndex + delta) % this.$items.length
+ return this.$items.eq(itemIndex)
+ }
+
+ Carousel.prototype.to = function (pos) {
+ var that = this
+ var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active'))
+
+ if (pos > (this.$items.length - 1) || pos < 0) return
+
+ if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid"
+ if (activeIndex == pos) return this.pause().cycle()
+
+ return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos))
+ }
+
+ Carousel.prototype.pause = function (e) {
+ e || (this.paused = true)
+
+ if (this.$element.find('.next, .prev').length && $.support.transition) {
+ this.$element.trigger($.support.transition.end)
+ this.cycle(true)
+ }
+
+ this.interval = clearInterval(this.interval)
+
+ return this
+ }
+
+ Carousel.prototype.next = function () {
+ if (this.sliding) return
+ return this.slide('next')
+ }
+
+ Carousel.prototype.prev = function () {
+ if (this.sliding) return
+ return this.slide('prev')
+ }
+
+ Carousel.prototype.slide = function (type, next) {
+ var $active = this.$element.find('.item.active')
+ var $next = next || this.getItemForDirection(type, $active)
+ var isCycling = this.interval
+ var direction = type == 'next' ? 'left' : 'right'
+ var that = this
+
+ if ($next.hasClass('active')) return (this.sliding = false)
+
+ var relatedTarget = $next[0]
+ var slideEvent = $.Event('slide.bs.carousel', {
+ relatedTarget: relatedTarget,
+ direction: direction
+ })
+ this.$element.trigger(slideEvent)
+ if (slideEvent.isDefaultPrevented()) return
+
+ this.sliding = true
+
+ isCycling && this.pause()
+
+ if (this.$indicators.length) {
+ this.$indicators.find('.active').removeClass('active')
+ var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)])
+ $nextIndicator && $nextIndicator.addClass('active')
+ }
+
+ var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid"
+ if ($.support.transition && this.$element.hasClass('slide')) {
+ $next.addClass(type)
+ $next[0].offsetWidth // force reflow
+ $active.addClass(direction)
+ $next.addClass(direction)
+ $active
+ .one('bsTransitionEnd', function () {
+ $next.removeClass([type, direction].join(' ')).addClass('active')
+ $active.removeClass(['active', direction].join(' '))
+ that.sliding = false
+ setTimeout(function () {
+ that.$element.trigger(slidEvent)
+ }, 0)
+ })
+ .emulateTransitionEnd(Carousel.TRANSITION_DURATION)
+ } else {
+ $active.removeClass('active')
+ $next.addClass('active')
+ this.sliding = false
+ this.$element.trigger(slidEvent)
+ }
+
+ isCycling && this.cycle()
+
+ return this
+ }
+
+
+ // CAROUSEL PLUGIN DEFINITION
+ // ==========================
+
+ function Plugin(option) {
+ return this.each(function () {
+ var $this = $(this)
+ var data = $this.data('bs.carousel')
+ var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option)
+ var action = typeof option == 'string' ? option : options.slide
+
+ if (!data) $this.data('bs.carousel', (data = new Carousel(this, options)))
+ if (typeof option == 'number') data.to(option)
+ else if (action) data[action]()
+ else if (options.interval) data.pause().cycle()
+ })
+ }
+
+ var old = $.fn.carousel
+
+ $.fn.carousel = Plugin
+ $.fn.carousel.Constructor = Carousel
+
+
+ // CAROUSEL NO CONFLICT
+ // ====================
+
+ $.fn.carousel.noConflict = function () {
+ $.fn.carousel = old
+ return this
+ }
+
+
+ // CAROUSEL DATA-API
+ // =================
+
+ var clickHandler = function (e) {
+ var href
+ var $this = $(this)
+ var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
+ if (!$target.hasClass('carousel')) return
+ var options = $.extend({}, $target.data(), $this.data())
+ var slideIndex = $this.attr('data-slide-to')
+ if (slideIndex) options.interval = false
+
+ Plugin.call($target, options)
+
+ if (slideIndex) {
+ $target.data('bs.carousel').to(slideIndex)
+ }
+
+ e.preventDefault()
+ }
+
+ $(document)
+ .on('click.bs.carousel.data-api', '[data-slide]', clickHandler)
+ .on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler)
+
+ $(window).on('load', function () {
+ $('[data-ride="carousel"]').each(function () {
+ var $carousel = $(this)
+ Plugin.call($carousel, $carousel.data())
+ })
+ })
+
+}(jQuery);
+
+/* ========================================================================
+ * Bootstrap: dropdown.js v3.3.6
+ * http://getbootstrap.com/javascript/#dropdowns
+ * ========================================================================
+ * Copyright 2011-2015 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ * ======================================================================== */
+
+
++function ($) {
+ 'use strict';
+
+ // DROPDOWN CLASS DEFINITION
+ // =========================
+
+ var backdrop = '.dropdown-backdrop'
+ var toggle = '[data-toggle="dropdown"]'
+ var Dropdown = function (element) {
+ $(element).on('click.bs.dropdown', this.toggle)
+ }
+
+ Dropdown.VERSION = '3.3.6'
+
+ function getParent($this) {
+ var selector = $this.attr('data-target')
+
+ if (!selector) {
+ selector = $this.attr('href')
+ selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
+ }
+
+ var $parent = selector && $(selector)
+
+ return $parent && $parent.length ? $parent : $this.parent()
+ }
+
+ function clearMenus(e) {
+ if (e && e.which === 3) return
+ $(backdrop).remove()
+ $(toggle).each(function () {
+ var $this = $(this)
+ var $parent = getParent($this)
+ var relatedTarget = { relatedTarget: this }
+
+ if (!$parent.hasClass('open')) return
+
+ if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return
+
+ $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
+
+ if (e.isDefaultPrevented()) return
+
+ $this.attr('aria-expanded', 'false')
+ $parent.removeClass('open').trigger($.Event('hidden.bs.dropdown', relatedTarget))
+ })
+ }
+
+ Dropdown.prototype.toggle = function (e) {
+ var $this = $(this)
+
+ if ($this.is('.disabled, :disabled')) return
+
+ var $parent = getParent($this)
+ var isActive = $parent.hasClass('open')
+
+ clearMenus()
+
+ if (!isActive) {
+ if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
+ // if mobile we use a backdrop because click events don't delegate
+ $(document.createElement('div'))
+ .addClass('dropdown-backdrop')
+ .insertAfter($(this))
+ .on('click', clearMenus)
+ }
+
+ var relatedTarget = { relatedTarget: this }
+ $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
+
+ if (e.isDefaultPrevented()) return
+
+ $this
+ .trigger('focus')
+ .attr('aria-expanded', 'true')
+
+ $parent
+ .toggleClass('open')
+ .trigger($.Event('shown.bs.dropdown', relatedTarget))
+ }
+
+ return false
+ }
+
+ Dropdown.prototype.keydown = function (e) {
+ if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return
+
+ var $this = $(this)
+
+ e.preventDefault()
+ e.stopPropagation()
+
+ if ($this.is('.disabled, :disabled')) return
+
+ var $parent = getParent($this)
+ var isActive = $parent.hasClass('open')
+
+ if (!isActive && e.which != 27 || isActive && e.which == 27) {
+ if (e.which == 27) $parent.find(toggle).trigger('focus')
+ return $this.trigger('click')
+ }
+
+ var desc = ' li:not(.disabled):visible a'
+ var $items = $parent.find('.dropdown-menu' + desc)
+
+ if (!$items.length) return
+
+ var index = $items.index(e.target)
+
+ if (e.which == 38 && index > 0) index-- // up
+ if (e.which == 40 && index < $items.length - 1) index++ // down
+ if (!~index) index = 0
+
+ $items.eq(index).trigger('focus')
+ }
+
+
+ // DROPDOWN PLUGIN DEFINITION
+ // ==========================
+
+ function Plugin(option) {
+ return this.each(function () {
+ var $this = $(this)
+ var data = $this.data('bs.dropdown')
+
+ if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
+ if (typeof option == 'string') data[option].call($this)
+ })
+ }
+
+ var old = $.fn.dropdown
+
+ $.fn.dropdown = Plugin
+ $.fn.dropdown.Constructor = Dropdown
+
+
+ // DROPDOWN NO CONFLICT
+ // ====================
+
+ $.fn.dropdown.noConflict = function () {
+ $.fn.dropdown = old
+ return this
+ }
+
+
+ // APPLY TO STANDARD DROPDOWN ELEMENTS
+ // ===================================
+
+ $(document)
+ .on('click.bs.dropdown.data-api', clearMenus)
+ .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
+ .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
+ .on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown)
+ .on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown)
+
+}(jQuery);
+
+/* ========================================================================
+ * Bootstrap: modal.js v3.3.6
+ * http://getbootstrap.com/javascript/#modals
+ * ========================================================================
+ * Copyright 2011-2015 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ * ======================================================================== */
+
+
++function ($) {
+ 'use strict';
+
+ // MODAL CLASS DEFINITION
+ // ======================
+
+ var Modal = function (element, options) {
+ this.options = options
+ this.$body = $(document.body)
+ this.$element = $(element)
+ this.$dialog = this.$element.find('.modal-dialog')
+ this.$backdrop = null
+ this.isShown = null
+ this.originalBodyPad = null
+ this.scrollbarWidth = 0
+ this.ignoreBackdropClick = false
+
+ if (this.options.remote) {
+ this.$element
+ .find('.modal-content')
+ .load(this.options.remote, $.proxy(function () {
+ this.$element.trigger('loaded.bs.modal')
+ }, this))
+ }
+ }
+
+ Modal.VERSION = '3.3.6'
+
+ Modal.TRANSITION_DURATION = 300
+ Modal.BACKDROP_TRANSITION_DURATION = 150
+
+ Modal.DEFAULTS = {
+ backdrop: true,
+ keyboard: true,
+ show: true
+ }
+
+ Modal.prototype.toggle = function (_relatedTarget) {
+ return this.isShown ? this.hide() : this.show(_relatedTarget)
+ }
+
+ Modal.prototype.show = function (_relatedTarget) {
+ var that = this
+ var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
+
+ this.$element.trigger(e)
+
+ if (this.isShown || e.isDefaultPrevented()) return
+
+ this.isShown = true
+
+ this.checkScrollbar()
+ this.setScrollbar()
+ this.$body.addClass('modal-open')
+
+ this.escape()
+ this.resize()
+
+ this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
+
+ this.$dialog.on('mousedown.dismiss.bs.modal', function () {
+ that.$element.one('mouseup.dismiss.bs.modal', function (e) {
+ if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true
+ })
+ })
+
+ this.backdrop(function () {
+ var transition = $.support.transition && that.$element.hasClass('fade')
+
+ if (!that.$element.parent().length) {
+ that.$element.appendTo(that.$body) // don't move modals dom position
+ }
+
+ that.$element
+ .show()
+ .scrollTop(0)
+
+ that.adjustDialog()
+
+ if (transition) {
+ that.$element[0].offsetWidth // force reflow
+ }
+
+ that.$element.addClass('in')
+
+ that.enforceFocus()
+
+ var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
+
+ transition ?
+ that.$dialog // wait for modal to slide in
+ .one('bsTransitionEnd', function () {
+ that.$element.trigger('focus').trigger(e)
+ })
+ .emulateTransitionEnd(Modal.TRANSITION_DURATION) :
+ that.$element.trigger('focus').trigger(e)
+ })
+ }
+
+ Modal.prototype.hide = function (e) {
+ if (e) e.preventDefault()
+
+ e = $.Event('hide.bs.modal')
+
+ this.$element.trigger(e)
+
+ if (!this.isShown || e.isDefaultPrevented()) return
+
+ this.isShown = false
+
+ this.escape()
+ this.resize()
+
+ $(document).off('focusin.bs.modal')
+
+ this.$element
+ .removeClass('in')
+ .off('click.dismiss.bs.modal')
+ .off('mouseup.dismiss.bs.modal')
+
+ this.$dialog.off('mousedown.dismiss.bs.modal')
+
+ $.support.transition && this.$element.hasClass('fade') ?
+ this.$element
+ .one('bsTransitionEnd', $.proxy(this.hideModal, this))
+ .emulateTransitionEnd(Modal.TRANSITION_DURATION) :
+ this.hideModal()
+ }
+
+ Modal.prototype.enforceFocus = function () {
+ $(document)
+ .off('focusin.bs.modal') // guard against infinite focus loop
+ .on('focusin.bs.modal', $.proxy(function (e) {
+ if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
+ this.$element.trigger('focus')
+ }
+ }, this))
+ }
+
+ Modal.prototype.escape = function () {
+ if (this.isShown && this.options.keyboard) {
+ this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) {
+ e.which == 27 && this.hide()
+ }, this))
+ } else if (!this.isShown) {
+ this.$element.off('keydown.dismiss.bs.modal')
+ }
+ }
+
+ Modal.prototype.resize = function () {
+ if (this.isShown) {
+ $(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this))
+ } else {
+ $(window).off('resize.bs.modal')
+ }
+ }
+
+ Modal.prototype.hideModal = function () {
+ var that = this
+ this.$element.hide()
+ this.backdrop(function () {
+ that.$body.removeClass('modal-open')
+ that.resetAdjustments()
+ that.resetScrollbar()
+ that.$element.trigger('hidden.bs.modal')
+ })
+ }
+
+ Modal.prototype.removeBackdrop = function () {
+ this.$backdrop && this.$backdrop.remove()
+ this.$backdrop = null
+ }
+
+ Modal.prototype.backdrop = function (callback) {
+ var that = this
+ var animate = this.$element.hasClass('fade') ? 'fade' : ''
+
+ if (this.isShown && this.options.backdrop) {
+ var doAnimate = $.support.transition && animate
+
+ this.$backdrop = $(document.createElement('div'))
+ .addClass('modal-backdrop ' + animate)
+ .appendTo(this.$body)
+
+ this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
+ if (this.ignoreBackdropClick) {
+ this.ignoreBackdropClick = false
+ return
+ }
+ if (e.target !== e.currentTarget) return
+ this.options.backdrop == 'static'
+ ? this.$element[0].focus()
+ : this.hide()
+ }, this))
+
+ if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
+
+ this.$backdrop.addClass('in')
+
+ if (!callback) return
+
+ doAnimate ?
+ this.$backdrop
+ .one('bsTransitionEnd', callback)
+ .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
+ callback()
+
+ } else if (!this.isShown && this.$backdrop) {
+ this.$backdrop.removeClass('in')
+
+ var callbackRemove = function () {
+ that.removeBackdrop()
+ callback && callback()
+ }
+ $.support.transition && this.$element.hasClass('fade') ?
+ this.$backdrop
+ .one('bsTransitionEnd', callbackRemove)
+ .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
+ callbackRemove()
+
+ } else if (callback) {
+ callback()
+ }
+ }
+
+ // these following methods are used to handle overflowing modals
+
+ Modal.prototype.handleUpdate = function () {
+ this.adjustDialog()
+ }
+
+ Modal.prototype.adjustDialog = function () {
+ var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight
+
+ this.$element.css({
+ paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '',
+ paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : ''
+ })
+ }
+
+ Modal.prototype.resetAdjustments = function () {
+ this.$element.css({
+ paddingLeft: '',
+ paddingRight: ''
+ })
+ }
+
+ Modal.prototype.checkScrollbar = function () {
+ var fullWindowWidth = window.innerWidth
+ if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8
+ var documentElementRect = document.documentElement.getBoundingClientRect()
+ fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left)
+ }
+ this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth
+ this.scrollbarWidth = this.measureScrollbar()
+ }
+
+ Modal.prototype.setScrollbar = function () {
+ var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
+ this.originalBodyPad = document.body.style.paddingRight || ''
+ if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
+ }
+
+ Modal.prototype.resetScrollbar = function () {
+ this.$body.css('padding-right', this.originalBodyPad)
+ }
+
+ Modal.prototype.measureScrollbar = function () { // thx walsh
+ var scrollDiv = document.createElement('div')
+ scrollDiv.className = 'modal-scrollbar-measure'
+ this.$body.append(scrollDiv)
+ var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth
+ this.$body[0].removeChild(scrollDiv)
+ return scrollbarWidth
+ }
+
+
+ // MODAL PLUGIN DEFINITION
+ // =======================
+
+ function Plugin(option, _relatedTarget) {
+ return this.each(function () {
+ var $this = $(this)
+ var data = $this.data('bs.modal')
+ var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
+
+ if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
+ if (typeof option == 'string') data[option](_relatedTarget)
+ else if (options.show) data.show(_relatedTarget)
+ })
+ }
+
+ var old = $.fn.modal
+
+ $.fn.modal = Plugin
+ $.fn.modal.Constructor = Modal
+
+
+ // MODAL NO CONFLICT
+ // =================
+
+ $.fn.modal.noConflict = function () {
+ $.fn.modal = old
+ return this
+ }
+
+
+ // MODAL DATA-API
+ // ==============
+
+ $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
+ var $this = $(this)
+ var href = $this.attr('href')
+ var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) // strip for ie7
+ var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
+
+ if ($this.is('a')) e.preventDefault()
+
+ $target.one('show.bs.modal', function (showEvent) {
+ if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown
+ $target.one('hidden.bs.modal', function () {
+ $this.is(':visible') && $this.trigger('focus')
+ })
+ })
+ Plugin.call($target, option, this)
+ })
+
+}(jQuery);
+
+/* ========================================================================
+ * Bootstrap: tooltip.js v3.3.6
+ * http://getbootstrap.com/javascript/#tooltip
+ * Inspired by the original jQuery.tipsy by Jason Frame
+ * ========================================================================
+ * Copyright 2011-2015 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ * ======================================================================== */
+
+
++function ($) {
+ 'use strict';
+
+ // TOOLTIP PUBLIC CLASS DEFINITION
+ // ===============================
+
+ var Tooltip = function (element, options) {
+ this.type = null
+ this.options = null
+ this.enabled = null
+ this.timeout = null
+ this.hoverState = null
+ this.$element = null
+ this.inState = null
+
+ this.init('tooltip', element, options)
+ }
+
+ Tooltip.VERSION = '3.3.6'
+
+ Tooltip.TRANSITION_DURATION = 150
+
+ Tooltip.DEFAULTS = {
+ animation: true,
+ placement: 'top',
+ selector: false,
+ template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
+ trigger: 'hover focus',
+ title: '',
+ delay: 0,
+ html: false,
+ container: false,
+ viewport: {
+ selector: 'body',
+ padding: 0
+ }
+ }
+
+ Tooltip.prototype.init = function (type, element, options) {
+ this.enabled = true
+ this.type = type
+ this.$element = $(element)
+ this.options = this.getOptions(options)
+ this.$viewport = this.options.viewport && $($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : (this.options.viewport.selector || this.options.viewport))
+ this.inState = { click: false, hover: false, focus: false }
+
+ if (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!')
+ }
+
+ var triggers = this.options.trigger.split(' ')
+
+ for (var i = triggers.length; i--;) {
+ var trigger = triggers[i]
+
+ if (trigger == 'click') {
+ this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
+ } else if (trigger != 'manual') {
+ var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin'
+ var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'
+
+ this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
+ this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
+ }
+ }
+
+ this.options.selector ?
+ (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
+ this.fixTitle()
+ }
+
+ Tooltip.prototype.getDefaults = function () {
+ return Tooltip.DEFAULTS
+ }
+
+ Tooltip.prototype.getOptions = function (options) {
+ options = $.extend({}, this.getDefaults(), this.$element.data(), options)
+
+ if (options.delay && typeof options.delay == 'number') {
+ options.delay = {
+ show: options.delay,
+ hide: options.delay
+ }
+ }
+
+ return options
+ }
+
+ Tooltip.prototype.getDelegateOptions = function () {
+ var options = {}
+ var defaults = this.getDefaults()
+
+ this._options && $.each(this._options, function (key, value) {
+ if (defaults[key] != value) options[key] = value
+ })
+
+ return options
+ }
+
+ Tooltip.prototype.enter = function (obj) {
+ var self = obj instanceof this.constructor ?
+ obj : $(obj.currentTarget).data('bs.' + this.type)
+
+ if (!self) {
+ self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
+ $(obj.currentTarget).data('bs.' + this.type, self)
+ }
+
+ if (obj instanceof $.Event) {
+ self.inState[obj.type == 'focusin' ? 'focus' : 'hover'] = true
+ }
+
+ if (self.tip().hasClass('in') || self.hoverState == 'in') {
+ self.hoverState = 'in'
+ return
+ }
+
+ clearTimeout(self.timeout)
+
+ self.hoverState = 'in'
+
+ if (!self.options.delay || !self.options.delay.show) return self.show()
+
+ self.timeout = setTimeout(function () {
+ if (self.hoverState == 'in') self.show()
+ }, self.options.delay.show)
+ }
+
+ Tooltip.prototype.isInStateTrue = function () {
+ for (var key in this.inState) {
+ if (this.inState[key]) return true
+ }
+
+ return false
+ }
+
+ Tooltip.prototype.leave = function (obj) {
+ var self = obj instanceof this.constructor ?
+ obj : $(obj.currentTarget).data('bs.' + this.type)
+
+ if (!self) {
+ self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
+ $(obj.currentTarget).data('bs.' + this.type, self)
+ }
+
+ if (obj instanceof $.Event) {
+ self.inState[obj.type == 'focusout' ? 'focus' : 'hover'] = false
+ }
+
+ if (self.isInStateTrue()) return
+
+ clearTimeout(self.timeout)
+
+ self.hoverState = 'out'
+
+ if (!self.options.delay || !self.options.delay.hide) return self.hide()
+
+ self.timeout = setTimeout(function () {
+ if (self.hoverState == 'out') self.hide()
+ }, self.options.delay.hide)
+ }
+
+ Tooltip.prototype.show = function () {
+ var e = $.Event('show.bs.' + this.type)
+
+ if (this.hasContent() && this.enabled) {
+ this.$element.trigger(e)
+
+ var inDom = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0])
+ if (e.isDefaultPrevented() || !inDom) return
+ var that = this
+
+ var $tip = this.tip()
+
+ var tipId = this.getUID(this.type)
+
+ this.setContent()
+ $tip.attr('id', tipId)
+ this.$element.attr('aria-describedby', tipId)
+
+ if (this.options.animation) $tip.addClass('fade')
+
+ var placement = typeof this.options.placement == 'function' ?
+ this.options.placement.call(this, $tip[0], this.$element[0]) :
+ this.options.placement
+
+ var autoToken = /\s?auto?\s?/i
+ var autoPlace = autoToken.test(placement)
+ if (autoPlace) placement = placement.replace(autoToken, '') || 'top'
+
+ $tip
+ .detach()
+ .css({ top: 0, left: 0, display: 'block' })
+ .addClass(placement)
+ .data('bs.' + this.type, this)
+
+ this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
+ this.$element.trigger('inserted.bs.' + this.type)
+
+ var pos = this.getPosition()
+ var actualWidth = $tip[0].offsetWidth
+ var actualHeight = $tip[0].offsetHeight
+
+ if (autoPlace) {
+ var orgPlacement = placement
+ var viewportDim = this.getPosition(this.$viewport)
+
+ placement = placement == 'bottom' && pos.bottom + actualHeight > viewportDim.bottom ? 'top' :
+ placement == 'top' && pos.top - actualHeight < viewportDim.top ? 'bottom' :
+ placement == 'right' && pos.right + actualWidth > viewportDim.width ? 'left' :
+ placement == 'left' && pos.left - actualWidth < viewportDim.left ? 'right' :
+ placement
+
+ $tip
+ .removeClass(orgPlacement)
+ .addClass(placement)
+ }
+
+ var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
+
+ this.applyPlacement(calculatedOffset, placement)
+
+ var complete = function () {
+ var prevHoverState = that.hoverState
+ that.$element.trigger('shown.bs.' + that.type)
+ that.hoverState = null
+
+ if (prevHoverState == 'out') that.leave(that)
+ }
+
+ $.support.transition && this.$tip.hasClass('fade') ?
+ $tip
+ .one('bsTransitionEnd', complete)
+ .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
+ complete()
+ }
+ }
+
+ Tooltip.prototype.applyPlacement = function (offset, placement) {
+ var $tip = this.tip()
+ var width = $tip[0].offsetWidth
+ var height = $tip[0].offsetHeight
+
+ // manually read margins because getBoundingClientRect includes difference
+ var marginTop = parseInt($tip.css('margin-top'), 10)
+ var marginLeft = parseInt($tip.css('margin-left'), 10)
+
+ // we must check for NaN for ie 8/9
+ if (isNaN(marginTop)) marginTop = 0
+ if (isNaN(marginLeft)) marginLeft = 0
+
+ offset.top += marginTop
+ offset.left += marginLeft
+
+ // $.fn.offset doesn't round pixel values
+ // so we use setOffset directly with our own function B-0
+ $.offset.setOffset($tip[0], $.extend({
+ using: function (props) {
+ $tip.css({
+ top: Math.round(props.top),
+ left: Math.round(props.left)
+ })
+ }
+ }, offset), 0)
+
+ $tip.addClass('in')
+
+ // check to see if placing tip in new offset caused the tip to resize itself
+ var actualWidth = $tip[0].offsetWidth
+ var actualHeight = $tip[0].offsetHeight
+
+ if (placement == 'top' && actualHeight != height) {
+ offset.top = offset.top + height - actualHeight
+ }
+
+ var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight)
+
+ if (delta.left) offset.left += delta.left
+ else offset.top += delta.top
+
+ var isVertical = /top|bottom/.test(placement)
+ var arrowDelta = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight
+ var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight'
+
+ $tip.offset(offset)
+ this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical)
+ }
+
+ Tooltip.prototype.replaceArrow = function (delta, dimension, isVertical) {
+ this.arrow()
+ .css(isVertical ? 'left' : 'top', 50 * (1 - delta / dimension) + '%')
+ .css(isVertical ? 'top' : 'left', '')
+ }
+
+ Tooltip.prototype.setContent = function () {
+ var $tip = this.tip()
+ var title = this.getTitle()
+
+ $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
+ $tip.removeClass('fade in top bottom left right')
+ }
+
+ Tooltip.prototype.hide = function (callback) {
+ var that = this
+ var $tip = $(this.$tip)
+ var e = $.Event('hide.bs.' + this.type)
+
+ function complete() {
+ if (that.hoverState != 'in') $tip.detach()
+ that.$element
+ .removeAttr('aria-describedby')
+ .trigger('hidden.bs.' + that.type)
+ callback && callback()
+ }
+
+ this.$element.trigger(e)
+
+ if (e.isDefaultPrevented()) return
+
+ $tip.removeClass('in')
+
+ $.support.transition && $tip.hasClass('fade') ?
+ $tip
+ .one('bsTransitionEnd', complete)
+ .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
+ complete()
+
+ this.hoverState = null
+
+ return this
+ }
+
+ Tooltip.prototype.fixTitle = function () {
+ var $e = this.$element
+ if ($e.attr('title') || typeof $e.attr('data-original-title') != 'string') {
+ $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
+ }
+ }
+
+ Tooltip.prototype.hasContent = function () {
+ return this.getTitle()
+ }
+
+ Tooltip.prototype.getPosition = function ($element) {
+ $element = $element || this.$element
+
+ var el = $element[0]
+ var isBody = el.tagName == 'BODY'
+
+ var elRect = el.getBoundingClientRect()
+ if (elRect.width == null) {
+ // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093
+ elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top })
+ }
+ var elOffset = isBody ? { top: 0, left: 0 } : $element.offset()
+ var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() }
+ var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null
+
+ return $.extend({}, elRect, scroll, outerDims, elOffset)
+ }
+
+ Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
+ return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } :
+ placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
+ placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
+ /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
+
+ }
+
+ Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) {
+ var delta = { top: 0, left: 0 }
+ if (!this.$viewport) return delta
+
+ var viewportPadding = this.options.viewport && this.options.viewport.padding || 0
+ var viewportDimensions = this.getPosition(this.$viewport)
+
+ if (/right|left/.test(placement)) {
+ var topEdgeOffset = pos.top - viewportPadding - viewportDimensions.scroll
+ var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight
+ if (topEdgeOffset < viewportDimensions.top) { // top overflow
+ delta.top = viewportDimensions.top - topEdgeOffset
+ } else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { // bottom overflow
+ delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset
+ }
+ } else {
+ var leftEdgeOffset = pos.left - viewportPadding
+ var rightEdgeOffset = pos.left + viewportPadding + actualWidth
+ if (leftEdgeOffset < viewportDimensions.left) { // left overflow
+ delta.left = viewportDimensions.left - leftEdgeOffset
+ } else if (rightEdgeOffset > viewportDimensions.right) { // right overflow
+ delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset
+ }
+ }
+
+ return delta
+ }
+
+ Tooltip.prototype.getTitle = function () {
+ var title
+ var $e = this.$element
+ var o = this.options
+
+ title = $e.attr('data-original-title')
+ || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
+
+ return title
+ }
+
+ Tooltip.prototype.getUID = function (prefix) {
+ do prefix += ~~(Math.random() * 1000000)
+ while (document.getElementById(prefix))
+ return prefix
+ }
+
+ Tooltip.prototype.tip = function () {
+ if (!this.$tip) {
+ this.$tip = $(this.options.template)
+ if (this.$tip.length != 1) {
+ throw new Error(this.type + ' `template` option must consist of exactly 1 top-level element!')
+ }
+ }
+ return this.$tip
+ }
+
+ Tooltip.prototype.arrow = function () {
+ return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'))
+ }
+
+ Tooltip.prototype.enable = function () {
+ this.enabled = true
+ }
+
+ Tooltip.prototype.disable = function () {
+ this.enabled = false
+ }
+
+ Tooltip.prototype.toggleEnabled = function () {
+ this.enabled = !this.enabled
+ }
+
+ Tooltip.prototype.toggle = function (e) {
+ var self = this
+ if (e) {
+ self = $(e.currentTarget).data('bs.' + this.type)
+ if (!self) {
+ self = new this.constructor(e.currentTarget, this.getDelegateOptions())
+ $(e.currentTarget).data('bs.' + this.type, self)
+ }
+ }
+
+ if (e) {
+ self.inState.click = !self.inState.click
+ if (self.isInStateTrue()) self.enter(self)
+ else self.leave(self)
+ } else {
+ self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
+ }
+ }
+
+ Tooltip.prototype.destroy = function () {
+ var that = this
+ clearTimeout(this.timeout)
+ this.hide(function () {
+ that.$element.off('.' + that.type).removeData('bs.' + that.type)
+ if (that.$tip) {
+ that.$tip.detach()
+ }
+ that.$tip = null
+ that.$arrow = null
+ that.$viewport = null
+ })
+ }
+
+
+ // TOOLTIP PLUGIN DEFINITION
+ // =========================
+
+ function Plugin(option) {
+ return this.each(function () {
+ var $this = $(this)
+ var data = $this.data('bs.tooltip')
+ var options = typeof option == 'object' && option
+
+ if (!data && /destroy|hide/.test(option)) return
+ if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
+ if (typeof option == 'string') data[option]()
+ })
+ }
+
+ var old = $.fn.tooltip
+
+ $.fn.tooltip = Plugin
+ $.fn.tooltip.Constructor = Tooltip
+
+
+ // TOOLTIP NO CONFLICT
+ // ===================
+
+ $.fn.tooltip.noConflict = function () {
+ $.fn.tooltip = old
+ return this
+ }
+
+}(jQuery);
+
+/* ========================================================================
+ * Bootstrap: popover.js v3.3.6
+ * http://getbootstrap.com/javascript/#popovers
+ * ========================================================================
+ * Copyright 2011-2015 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ * ======================================================================== */
+
+
++function ($) {
+ 'use strict';
+
+ // POPOVER PUBLIC CLASS DEFINITION
+ // ===============================
+
+ var Popover = function (element, options) {
+ this.init('popover', element, options)
+ }
+
+ if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
+
+ Popover.VERSION = '3.3.6'
+
+ Popover.DEFAULTS = $.extend({}, $.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>'
+ })
+
+
+ // NOTE: POPOVER EXTENDS tooltip.js
+ // ================================
+
+ Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)
+
+ Popover.prototype.constructor = Popover
+
+ Popover.prototype.getDefaults = function () {
+ return Popover.DEFAULTS
+ }
+
+ Popover.prototype.setContent = function () {
+ var $tip = this.tip()
+ var title = this.getTitle()
+ var content = this.getContent()
+
+ $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
+ $tip.find('.popover-content').children().detach().end()[ // we use append for html objects to maintain js events
+ this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text'
+ ](content)
+
+ $tip.removeClass('fade top bottom left right in')
+
+ // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
+ // this manually by checking the contents.
+ if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
+ }
+
+ Popover.prototype.hasContent = function () {
+ return this.getTitle() || this.getContent()
+ }
+
+ Popover.prototype.getContent = function () {
+ var $e = this.$element
+ var o = this.options
+
+ return $e.attr('data-content')
+ || (typeof o.content == 'function' ?
+ o.content.call($e[0]) :
+ o.content)
+ }
+
+ Popover.prototype.arrow = function () {
+ return (this.$arrow = this.$arrow || this.tip().find('.arrow'))
+ }
+
+
+ // POPOVER PLUGIN DEFINITION
+ // =========================
+
+ function Plugin(option) {
+ return this.each(function () {
+ var $this = $(this)
+ var data = $this.data('bs.popover')
+ var options = typeof option == 'object' && option
+
+ if (!data && /destroy|hide/.test(option)) return
+ if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
+ if (typeof option == 'string') data[option]()
+ })
+ }
+
+ var old = $.fn.popover
+
+ $.fn.popover = Plugin
+ $.fn.popover.Constructor = Popover
+
+
+ // POPOVER NO CONFLICT
+ // ===================
+
+ $.fn.popover.noConflict = function () {
+ $.fn.popover = old
+ return this
+ }
+
+}(jQuery);
+
+/* ========================================================================
+ * Bootstrap: tab.js v3.3.6
+ * http://getbootstrap.com/javascript/#tabs
+ * ========================================================================
+ * Copyright 2011-2015 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ * ======================================================================== */
+
+
++function ($) {
+ 'use strict';
+
+ // TAB CLASS DEFINITION
+ // ====================
+
+ var Tab = function (element) {
+ // jscs:disable requireDollarBeforejQueryAssignment
+ this.element = $(element)
+ // jscs:enable requireDollarBeforejQueryAssignment
+ }
+
+ Tab.VERSION = '3.3.6'
+
+ Tab.TRANSITION_DURATION = 150
+
+ Tab.prototype.show = function () {
+ var $this = this.element
+ var $ul = $this.closest('ul:not(.dropdown-menu)')
+ var selector = $this.data('target')
+
+ if (!selector) {
+ selector = $this.attr('href')
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
+ }
+
+ if ($this.parent('li').hasClass('active')) return
+
+ var $previous = $ul.find('.active:last a')
+ var hideEvent = $.Event('hide.bs.tab', {
+ relatedTarget: $this[0]
+ })
+ var showEvent = $.Event('show.bs.tab', {
+ relatedTarget: $previous[0]
+ })
+
+ $previous.trigger(hideEvent)
+ $this.trigger(showEvent)
+
+ if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return
+
+ var $target = $(selector)
+
+ this.activate($this.closest('li'), $ul)
+ this.activate($target, $target.parent(), function () {
+ $previous.trigger({
+ type: 'hidden.bs.tab',
+ relatedTarget: $this[0]
+ })
+ $this.trigger({
+ type: 'shown.bs.tab',
+ relatedTarget: $previous[0]
+ })
+ })
+ }
+
+ Tab.prototype.activate = function (element, container, callback) {
+ var $active = container.find('> .active')
+ var transition = callback
+ && $.support.transition
+ && ($active.length && $active.hasClass('fade') || !!container.find('> .fade').length)
+
+ function next() {
+ $active
+ .removeClass('active')
+ .find('> .dropdown-menu > .active')
+ .removeClass('active')
+ .end()
+ .find('[data-toggle="tab"]')
+ .attr('aria-expanded', false)
+
+ element
+ .addClass('active')
+ .find('[data-toggle="tab"]')
+ .attr('aria-expanded', true)
+
+ if (transition) {
+ element[0].offsetWidth // reflow for transition
+ element.addClass('in')
+ } else {
+ element.removeClass('fade')
+ }
+
+ if (element.parent('.dropdown-menu').length) {
+ element
+ .closest('li.dropdown')
+ .addClass('active')
+ .end()
+ .find('[data-toggle="tab"]')
+ .attr('aria-expanded', true)
+ }
+
+ callback && callback()
+ }
+
+ $active.length && transition ?
+ $active
+ .one('bsTransitionEnd', next)
+ .emulateTransitionEnd(Tab.TRANSITION_DURATION) :
+ next()
+
+ $active.removeClass('in')
+ }
+
+
+ // TAB PLUGIN DEFINITION
+ // =====================
+
+ function Plugin(option) {
+ return this.each(function () {
+ var $this = $(this)
+ var data = $this.data('bs.tab')
+
+ if (!data) $this.data('bs.tab', (data = new Tab(this)))
+ if (typeof option == 'string') data[option]()
+ })
+ }
+
+ var old = $.fn.tab
+
+ $.fn.tab = Plugin
+ $.fn.tab.Constructor = Tab
+
+
+ // TAB NO CONFLICT
+ // ===============
+
+ $.fn.tab.noConflict = function () {
+ $.fn.tab = old
+ return this
+ }
+
+
+ // TAB DATA-API
+ // ============
+
+ var clickHandler = function (e) {
+ e.preventDefault()
+ Plugin.call($(this), 'show')
+ }
+
+ $(document)
+ .on('click.bs.tab.data-api', '[data-toggle="tab"]', clickHandler)
+ .on('click.bs.tab.data-api', '[data-toggle="pill"]', clickHandler)
+
+}(jQuery);
+
+/* ========================================================================
+ * Bootstrap: affix.js v3.3.6
+ * http://getbootstrap.com/javascript/#affix
+ * ========================================================================
+ * Copyright 2011-2015 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ * ======================================================================== */
+
+
++function ($) {
+ 'use strict';
+
+ // AFFIX CLASS DEFINITION
+ // ======================
+
+ var Affix = function (element, options) {
+ this.options = $.extend({}, Affix.DEFAULTS, options)
+
+ this.$target = $(this.options.target)
+ .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
+ .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
+
+ this.$element = $(element)
+ this.affixed = null
+ this.unpin = null
+ this.pinnedOffset = null
+
+ this.checkPosition()
+ }
+
+ Affix.VERSION = '3.3.6'
+
+ Affix.RESET = 'affix affix-top affix-bottom'
+
+ Affix.DEFAULTS = {
+ offset: 0,
+ target: window
+ }
+
+ Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) {
+ var scrollTop = this.$target.scrollTop()
+ var position = this.$element.offset()
+ var targetHeight = this.$target.height()
+
+ if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false
+
+ if (this.affixed == 'bottom') {
+ if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom'
+ return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom'
+ }
+
+ var initializing = this.affixed == null
+ var colliderTop = initializing ? scrollTop : position.top
+ var colliderHeight = initializing ? targetHeight : height
+
+ if (offsetTop != null && scrollTop <= offsetTop) return 'top'
+ if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'
+
+ return false
+ }
+
+ Affix.prototype.getPinnedOffset = function () {
+ if (this.pinnedOffset) return this.pinnedOffset
+ this.$element.removeClass(Affix.RESET).addClass('affix')
+ var scrollTop = this.$target.scrollTop()
+ var position = this.$element.offset()
+ return (this.pinnedOffset = position.top - scrollTop)
+ }
+
+ Affix.prototype.checkPositionWithEventLoop = function () {
+ setTimeout($.proxy(this.checkPosition, this), 1)
+ }
+
+ Affix.prototype.checkPosition = function () {
+ if (!this.$element.is(':visible')) return
+
+ var height = this.$element.height()
+ var offset = this.options.offset
+ var offsetTop = offset.top
+ var offsetBottom = offset.bottom
+ var scrollHeight = Math.max($(document).height(), $(document.body).height())
+
+ if (typeof offset != 'object') offsetBottom = offsetTop = offset
+ if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
+ if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
+
+ var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom)
+
+ if (this.affixed != affix) {
+ if (this.unpin != null) this.$element.css('top', '')
+
+ var affixType = 'affix' + (affix ? '-' + affix : '')
+ var e = $.Event(affixType + '.bs.affix')
+
+ this.$element.trigger(e)
+
+ if (e.isDefaultPrevented()) return
+
+ this.affixed = affix
+ this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
+
+ this.$element
+ .removeClass(Affix.RESET)
+ .addClass(affixType)
+ .trigger(affixType.replace('affix', 'affixed') + '.bs.affix')
+ }
+
+ if (affix == 'bottom') {
+ this.$element.offset({
+ top: scrollHeight - height - offsetBottom
+ })
+ }
+ }
+
+
+ // AFFIX PLUGIN DEFINITION
+ // =======================
+
+ function Plugin(option) {
+ return this.each(function () {
+ var $this = $(this)
+ var data = $this.data('bs.affix')
+ var options = typeof option == 'object' && option
+
+ if (!data) $this.data('bs.affix', (data = new Affix(this, options)))
+ if (typeof option == 'string') data[option]()
+ })
+ }
+
+ var old = $.fn.affix
+
+ $.fn.affix = Plugin
+ $.fn.affix.Constructor = Affix
+
+
+ // AFFIX NO CONFLICT
+ // =================
+
+ $.fn.affix.noConflict = function () {
+ $.fn.affix = old
+ return this
+ }
+
+
+ // AFFIX DATA-API
+ // ==============
+
+ $(window).on('load', function () {
+ $('[data-spy="affix"]').each(function () {
+ var $spy = $(this)
+ var data = $spy.data()
+
+ data.offset = data.offset || {}
+
+ if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom
+ if (data.offsetTop != null) data.offset.top = data.offsetTop
+
+ Plugin.call($spy, data)
+ })
+ })
+
+}(jQuery);
+
+/* ========================================================================
+ * Bootstrap: collapse.js v3.3.6
+ * http://getbootstrap.com/javascript/#collapse
+ * ========================================================================
+ * Copyright 2011-2015 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ * ======================================================================== */
+
+
++function ($) {
+ 'use strict';
+
+ // COLLAPSE PUBLIC CLASS DEFINITION
+ // ================================
+
+ var Collapse = function (element, options) {
+ this.$element = $(element)
+ this.options = $.extend({}, Collapse.DEFAULTS, options)
+ this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' +
+ '[data-toggle="collapse"][data-target="#' + element.id + '"]')
+ this.transitioning = null
+
+ if (this.options.parent) {
+ this.$parent = this.getParent()
+ } else {
+ this.addAriaAndCollapsedClass(this.$element, this.$trigger)
+ }
+
+ if (this.options.toggle) this.toggle()
+ }
+
+ Collapse.VERSION = '3.3.6'
+
+ Collapse.TRANSITION_DURATION = 350
+
+ Collapse.DEFAULTS = {
+ toggle: true
+ }
+
+ Collapse.prototype.dimension = function () {
+ var hasWidth = this.$element.hasClass('width')
+ return hasWidth ? 'width' : 'height'
+ }
+
+ Collapse.prototype.show = function () {
+ if (this.transitioning || this.$element.hasClass('in')) return
+
+ var activesData
+ var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing')
+
+ if (actives && actives.length) {
+ activesData = actives.data('bs.collapse')
+ if (activesData && activesData.transitioning) return
+ }
+
+ var startEvent = $.Event('show.bs.collapse')
+ this.$element.trigger(startEvent)
+ if (startEvent.isDefaultPrevented()) return
+
+ if (actives && actives.length) {
+ Plugin.call(actives, 'hide')
+ activesData || actives.data('bs.collapse', null)
+ }
+
+ var dimension = this.dimension()
+
+ this.$element
+ .removeClass('collapse')
+ .addClass('collapsing')[dimension](0)
+ .attr('aria-expanded', true)
+
+ this.$trigger
+ .removeClass('collapsed')
+ .attr('aria-expanded', true)
+
+ this.transitioning = 1
+
+ var complete = function () {
+ this.$element
+ .removeClass('collapsing')
+ .addClass('collapse in')[dimension]('')
+ this.transitioning = 0
+ this.$element
+ .trigger('shown.bs.collapse')
+ }
+
+ if (!$.support.transition) return complete.call(this)
+
+ var scrollSize = $.camelCase(['scroll', dimension].join('-'))
+
+ this.$element
+ .one('bsTransitionEnd', $.proxy(complete, this))
+ .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize])
+ }
+
+ Collapse.prototype.hide = function () {
+ if (this.transitioning || !this.$element.hasClass('in')) return
+
+ var startEvent = $.Event('hide.bs.collapse')
+ this.$element.trigger(startEvent)
+ if (startEvent.isDefaultPrevented()) return
+
+ var dimension = this.dimension()
+
+ this.$element[dimension](this.$element[dimension]())[0].offsetHeight
+
+ this.$element
+ .addClass('collapsing')
+ .removeClass('collapse in')
+ .attr('aria-expanded', false)
+
+ this.$trigger
+ .addClass('collapsed')
+ .attr('aria-expanded', false)
+
+ this.transitioning = 1
+
+ var complete = function () {
+ this.transitioning = 0
+ this.$element
+ .removeClass('collapsing')
+ .addClass('collapse')
+ .trigger('hidden.bs.collapse')
+ }
+
+ if (!$.support.transition) return complete.call(this)
+
+ this.$element
+ [dimension](0)
+ .one('bsTransitionEnd', $.proxy(complete, this))
+ .emulateTransitionEnd(Collapse.TRANSITION_DURATION)
+ }
+
+ Collapse.prototype.toggle = function () {
+ this[this.$element.hasClass('in') ? 'hide' : 'show']()
+ }
+
+ Collapse.prototype.getParent = function () {
+ return $(this.options.parent)
+ .find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]')
+ .each($.proxy(function (i, element) {
+ var $element = $(element)
+ this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element)
+ }, this))
+ .end()
+ }
+
+ Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) {
+ var isOpen = $element.hasClass('in')
+
+ $element.attr('aria-expanded', isOpen)
+ $trigger
+ .toggleClass('collapsed', !isOpen)
+ .attr('aria-expanded', isOpen)
+ }
+
+ function getTargetFromTrigger($trigger) {
+ var href
+ var target = $trigger.attr('data-target')
+ || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
+
+ return $(target)
+ }
+
+
+ // COLLAPSE PLUGIN DEFINITION
+ // ==========================
+
+ function Plugin(option) {
+ return this.each(function () {
+ var $this = $(this)
+ var data = $this.data('bs.collapse')
+ var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
+
+ if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false
+ if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
+ if (typeof option == 'string') data[option]()
+ })
+ }
+
+ var old = $.fn.collapse
+
+ $.fn.collapse = Plugin
+ $.fn.collapse.Constructor = Collapse
+
+
+ // COLLAPSE NO CONFLICT
+ // ====================
+
+ $.fn.collapse.noConflict = function () {
+ $.fn.collapse = old
+ return this
+ }
+
+
+ // COLLAPSE DATA-API
+ // =================
+
+ $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) {
+ var $this = $(this)
+
+ if (!$this.attr('data-target')) e.preventDefault()
+
+ var $target = getTargetFromTrigger($this)
+ var data = $target.data('bs.collapse')
+ var option = data ? 'toggle' : $this.data()
+
+ Plugin.call($target, option)
+ })
+
+}(jQuery);
+
+/* ========================================================================
+ * Bootstrap: scrollspy.js v3.3.6
+ * http://getbootstrap.com/javascript/#scrollspy
+ * ========================================================================
+ * Copyright 2011-2015 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ * ======================================================================== */
+
+
++function ($) {
+ 'use strict';
+
+ // SCROLLSPY CLASS DEFINITION
+ // ==========================
+
+ function ScrollSpy(element, options) {
+ this.$body = $(document.body)
+ this.$scrollElement = $(element).is(document.body) ? $(window) : $(element)
+ this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
+ this.selector = (this.options.target || '') + ' .nav li > a'
+ this.offsets = []
+ this.targets = []
+ this.activeTarget = null
+ this.scrollHeight = 0
+
+ this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this))
+ this.refresh()
+ this.process()
+ }
+
+ ScrollSpy.VERSION = '3.3.6'
+
+ ScrollSpy.DEFAULTS = {
+ offset: 10
+ }
+
+ ScrollSpy.prototype.getScrollHeight = function () {
+ return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
+ }
+
+ ScrollSpy.prototype.refresh = function () {
+ var that = this
+ var offsetMethod = 'offset'
+ var offsetBase = 0
+
+ this.offsets = []
+ this.targets = []
+ this.scrollHeight = this.getScrollHeight()
+
+ if (!$.isWindow(this.$scrollElement[0])) {
+ offsetMethod = 'position'
+ offsetBase = this.$scrollElement.scrollTop()
+ }
+
+ this.$body
+ .find(this.selector)
+ .map(function () {
+ var $el = $(this)
+ var href = $el.data('target') || $el.attr('href')
+ var $href = /^#./.test(href) && $(href)
+
+ return ($href
+ && $href.length
+ && $href.is(':visible')
+ && [[$href[offsetMethod]().top + offsetBase, href]]) || null
+ })
+ .sort(function (a, b) { return a[0] - b[0] })
+ .each(function () {
+ that.offsets.push(this[0])
+ that.targets.push(this[1])
+ })
+ }
+
+ ScrollSpy.prototype.process = function () {
+ var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
+ var scrollHeight = this.getScrollHeight()
+ var maxScroll = this.options.offset + scrollHeight - this.$scrollElement.height()
+ var offsets = this.offsets
+ var targets = this.targets
+ var activeTarget = this.activeTarget
+ var i
+
+ if (this.scrollHeight != scrollHeight) {
+ this.refresh()
+ }
+
+ if (scrollTop >= maxScroll) {
+ return activeTarget != (i = targets[targets.length - 1]) && this.activate(i)
+ }
+
+ if (activeTarget && scrollTop < offsets[0]) {
+ this.activeTarget = null
+ return this.clear()
+ }
+
+ for (i = offsets.length; i--;) {
+ activeTarget != targets[i]
+ && scrollTop >= offsets[i]
+ && (offsets[i + 1] === undefined || scrollTop < offsets[i + 1])
+ && this.activate(targets[i])
+ }
+ }
+
+ ScrollSpy.prototype.activate = function (target) {
+ this.activeTarget = target
+
+ this.clear()
+
+ var selector = this.selector +
+ '[data-target="' + target + '"],' +
+ this.selector + '[href="' + target + '"]'
+
+ var active = $(selector)
+ .parents('li')
+ .addClass('active')
+
+ if (active.parent('.dropdown-menu').length) {
+ active = active
+ .closest('li.dropdown')
+ .addClass('active')
+ }
+
+ active.trigger('activate.bs.scrollspy')
+ }
+
+ ScrollSpy.prototype.clear = function () {
+ $(this.selector)
+ .parentsUntil(this.options.target, '.active')
+ .removeClass('active')
+ }
+
+
+ // SCROLLSPY PLUGIN DEFINITION
+ // ===========================
+
+ function Plugin(option) {
+ return this.each(function () {
+ var $this = $(this)
+ var data = $this.data('bs.scrollspy')
+ var options = typeof option == 'object' && option
+
+ if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options)))
+ if (typeof option == 'string') data[option]()
+ })
+ }
+
+ var old = $.fn.scrollspy
+
+ $.fn.scrollspy = Plugin
+ $.fn.scrollspy.Constructor = ScrollSpy
+
+
+ // SCROLLSPY NO CONFLICT
+ // =====================
+
+ $.fn.scrollspy.noConflict = function () {
+ $.fn.scrollspy = old
+ return this
+ }
+
+
+ // SCROLLSPY DATA-API
+ // ==================
+
+ $(window).on('load.bs.scrollspy.data-api', function () {
+ $('[data-spy="scroll"]').each(function () {
+ var $spy = $(this)
+ Plugin.call($spy, $spy.data())
+ })
+ })
+
+}(jQuery);
+
+/* ========================================================================
+ * Bootstrap: transition.js v3.3.6
+ * http://getbootstrap.com/javascript/#transitions
+ * ========================================================================
+ * Copyright 2011-2015 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ * ======================================================================== */
+
+
++function ($) {
+ 'use strict';
+
+ // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
+ // ============================================================
+
+ function transitionEnd() {
+ var el = document.createElement('bootstrap')
+
+ var transEndEventNames = {
+ WebkitTransition : 'webkitTransitionEnd',
+ MozTransition : 'transitionend',
+ OTransition : 'oTransitionEnd otransitionend',
+ transition : 'transitionend'
+ }
+
+ for (var name in transEndEventNames) {
+ if (el.style[name] !== undefined) {
+ return { end: transEndEventNames[name] }
+ }
+ }
+
+ return false // explicit for ie8 ( ._.)
+ }
+
+ // http://blog.alexmaccaw.com/css-transitions
+ $.fn.emulateTransitionEnd = function (duration) {
+ var called = false
+ var $el = this
+ $(this).one('bsTransitionEnd', function () { called = true })
+ var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
+ setTimeout(callback, duration)
+ return this
+ }
+
+ $(function () {
+ $.support.transition = transitionEnd()
+
+ if (!$.support.transition) return
+
+ $.event.special.bsTransitionEnd = {
+ bindType: $.support.transition.end,
+ delegateType: $.support.transition.end,
+ handle: function (e) {
+ if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments)
+ }
+ }
+ })
+
+}(jQuery);
diff --git a/public_html/data/js/vendor/bootstrap.min.js b/public_html/data/js/vendor/bootstrap.min.js
new file mode 100644
index 000000000..dde71d2be
--- /dev/null
+++ b/public_html/data/js/vendor/bootstrap.min.js
@@ -0,0 +1,12 @@
+/*!
+ * Bootstrap v3.3.5 (http://getbootstrap.com)
+ * Copyright 2011-2016 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ */
+
+/*!
+ * Generated using the Bootstrap Customizer (http://getbootstrap.com/customize/?id=e51bc4b79b5712077b546b4ea577f138)
+ * Config saved to config.json and https://gist.github.com/e51bc4b79b5712077b546b4ea577f138
+ */
+if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(t){"use strict";var e=t.fn.jquery.split(" ")[0].split(".");if(e[0]<2&&e[1]<9||1==e[0]&&9==e[1]&&e[2]<1||e[0]>2)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3")}(jQuery),+function(t){"use strict";function e(e){return this.each(function(){var i=t(this),n=i.data("bs.alert");n||i.data("bs.alert",n=new o(this)),"string"==typeof e&&n[e].call(i)})}var i='[data-dismiss="alert"]',o=function(e){t(e).on("click",i,this.close)};o.VERSION="3.3.6",o.TRANSITION_DURATION=150,o.prototype.close=function(e){function i(){a.detach().trigger("closed.bs.alert").remove()}var n=t(this),s=n.attr("data-target");s||(s=n.attr("href"),s=s&&s.replace(/.*(?=#[^\s]*$)/,""));var a=t(s);e&&e.preventDefault(),a.length||(a=n.closest(".alert")),a.trigger(e=t.Event("close.bs.alert")),e.isDefaultPrevented()||(a.removeClass("in"),t.support.transition&&a.hasClass("fade")?a.one("bsTransitionEnd",i).emulateTransitionEnd(o.TRANSITION_DURATION):i())};var n=t.fn.alert;t.fn.alert=e,t.fn.alert.Constructor=o,t.fn.alert.noConflict=function(){return t.fn.alert=n,this},t(document).on("click.bs.alert.data-api",i,o.prototype.close)}(jQuery),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.button"),s="object"==typeof e&&e;n||o.data("bs.button",n=new i(this,s)),"toggle"==e?n.toggle():e&&n.setState(e)})}var i=function(e,o){this.$element=t(e),this.options=t.extend({},i.DEFAULTS,o),this.isLoading=!1};i.VERSION="3.3.6",i.DEFAULTS={loadingText:"loading..."},i.prototype.setState=function(e){var i="disabled",o=this.$element,n=o.is("input")?"val":"html",s=o.data();e+="Text",null==s.resetText&&o.data("resetText",o[n]()),setTimeout(t.proxy(function(){o[n](null==s[e]?this.options[e]:s[e]),"loadingText"==e?(this.isLoading=!0,o.addClass(i).attr(i,i)):this.isLoading&&(this.isLoading=!1,o.removeClass(i).removeAttr(i))},this),0)},i.prototype.toggle=function(){var t=!0,e=this.$element.closest('[data-toggle="buttons"]');if(e.length){var i=this.$element.find("input");"radio"==i.prop("type")?(i.prop("checked")&&(t=!1),e.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==i.prop("type")&&(i.prop("checked")!==this.$element.hasClass("active")&&(t=!1),this.$element.toggleClass("active")),i.prop("checked",this.$element.hasClass("active")),t&&i.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var o=t.fn.button;t.fn.button=e,t.fn.button.Constructor=i,t.fn.button.noConflict=function(){return t.fn.button=o,this},t(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(i){var o=t(i.target);o.hasClass("btn")||(o=o.closest(".btn")),e.call(o,"toggle"),t(i.target).is('input[type="radio"]')||t(i.target).is('input[type="checkbox"]')||i.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(e){t(e.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(e.type))})}(jQuery),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.carousel"),s=t.extend({},i.DEFAULTS,o.data(),"object"==typeof e&&e),a="string"==typeof e?e:s.slide;n||o.data("bs.carousel",n=new i(this,s)),"number"==typeof e?n.to(e):a?n[a]():s.interval&&n.pause().cycle()})}var i=function(e,i){this.$element=t(e),this.$indicators=this.$element.find(".carousel-indicators"),this.options=i,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",t.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",t.proxy(this.pause,this)).on("mouseleave.bs.carousel",t.proxy(this.cycle,this))};i.VERSION="3.3.6",i.TRANSITION_DURATION=600,i.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},i.prototype.keydown=function(t){if(!/input|textarea/i.test(t.target.tagName)){switch(t.which){case 37:this.prev();break;case 39:this.next();break;default:return}t.preventDefault()}},i.prototype.cycle=function(e){return e||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(t.proxy(this.next,this),this.options.interval)),this},i.prototype.getItemIndex=function(t){return this.$items=t.parent().children(".item"),this.$items.index(t||this.$active)},i.prototype.getItemForDirection=function(t,e){var i=this.getItemIndex(e),o="prev"==t&&0===i||"next"==t&&i==this.$items.length-1;if(o&&!this.options.wrap)return e;var n="prev"==t?-1:1,s=(i+n)%this.$items.length;return this.$items.eq(s)},i.prototype.to=function(t){var e=this,i=this.getItemIndex(this.$active=this.$element.find(".item.active"));return t>this.$items.length-1||0>t?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){e.to(t)}):i==t?this.pause().cycle():this.slide(t>i?"next":"prev",this.$items.eq(t))},i.prototype.pause=function(e){return e||(this.paused=!0),this.$element.find(".next, .prev").length&&t.support.transition&&(this.$element.trigger(t.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},i.prototype.next=function(){return this.sliding?void 0:this.slide("next")},i.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},i.prototype.slide=function(e,o){var n=this.$element.find(".item.active"),s=o||this.getItemForDirection(e,n),a=this.interval,r="next"==e?"left":"right",l=this;if(s.hasClass("active"))return this.sliding=!1;var h=s[0],d=t.Event("slide.bs.carousel",{relatedTarget:h,direction:r});if(this.$element.trigger(d),!d.isDefaultPrevented()){if(this.sliding=!0,a&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var p=t(this.$indicators.children()[this.getItemIndex(s)]);p&&p.addClass("active")}var c=t.Event("slid.bs.carousel",{relatedTarget:h,direction:r});return t.support.transition&&this.$element.hasClass("slide")?(s.addClass(e),s[0].offsetWidth,n.addClass(r),s.addClass(r),n.one("bsTransitionEnd",function(){s.removeClass([e,r].join(" ")).addClass("active"),n.removeClass(["active",r].join(" ")),l.sliding=!1,setTimeout(function(){l.$element.trigger(c)},0)}).emulateTransitionEnd(i.TRANSITION_DURATION)):(n.removeClass("active"),s.addClass("active"),this.sliding=!1,this.$element.trigger(c)),a&&this.cycle(),this}};var o=t.fn.carousel;t.fn.carousel=e,t.fn.carousel.Constructor=i,t.fn.carousel.noConflict=function(){return t.fn.carousel=o,this};var n=function(i){var o,n=t(this),s=t(n.attr("data-target")||(o=n.attr("href"))&&o.replace(/.*(?=#[^\s]+$)/,""));if(s.hasClass("carousel")){var a=t.extend({},s.data(),n.data()),r=n.attr("data-slide-to");r&&(a.interval=!1),e.call(s,a),r&&s.data("bs.carousel").to(r),i.preventDefault()}};t(document).on("click.bs.carousel.data-api","[data-slide]",n).on("click.bs.carousel.data-api","[data-slide-to]",n),t(window).on("load",function(){t('[data-ride="carousel"]').each(function(){var i=t(this);e.call(i,i.data())})})}(jQuery),+function(t){"use strict";function e(e){var i=e.attr("data-target");i||(i=e.attr("href"),i=i&&/#[A-Za-z]/.test(i)&&i.replace(/.*(?=#[^\s]*$)/,""));var o=i&&t(i);return o&&o.length?o:e.parent()}function i(i){i&&3===i.which||(t(n).remove(),t(s).each(function(){var o=t(this),n=e(o),s={relatedTarget:this};n.hasClass("open")&&(i&&"click"==i.type&&/input|textarea/i.test(i.target.tagName)&&t.contains(n[0],i.target)||(n.trigger(i=t.Event("hide.bs.dropdown",s)),i.isDefaultPrevented()||(o.attr("aria-expanded","false"),n.removeClass("open").trigger(t.Event("hidden.bs.dropdown",s)))))}))}function o(e){return this.each(function(){var i=t(this),o=i.data("bs.dropdown");o||i.data("bs.dropdown",o=new a(this)),"string"==typeof e&&o[e].call(i)})}var n=".dropdown-backdrop",s='[data-toggle="dropdown"]',a=function(e){t(e).on("click.bs.dropdown",this.toggle)};a.VERSION="3.3.6",a.prototype.toggle=function(o){var n=t(this);if(!n.is(".disabled, :disabled")){var s=e(n),a=s.hasClass("open");if(i(),!a){"ontouchstart"in document.documentElement&&!s.closest(".navbar-nav").length&&t(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(t(this)).on("click",i);var r={relatedTarget:this};if(s.trigger(o=t.Event("show.bs.dropdown",r)),o.isDefaultPrevented())return;n.trigger("focus").attr("aria-expanded","true"),s.toggleClass("open").trigger(t.Event("shown.bs.dropdown",r))}return!1}},a.prototype.keydown=function(i){if(/(38|40|27|32)/.test(i.which)&&!/input|textarea/i.test(i.target.tagName)){var o=t(this);if(i.preventDefault(),i.stopPropagation(),!o.is(".disabled, :disabled")){var n=e(o),a=n.hasClass("open");if(!a&&27!=i.which||a&&27==i.which)return 27==i.which&&n.find(s).trigger("focus"),o.trigger("click");var r=" li:not(.disabled):visible a",l=n.find(".dropdown-menu"+r);if(l.length){var h=l.index(i.target);38==i.which&&h>0&&h--,40==i.which&&h<l.length-1&&h++,~h||(h=0),l.eq(h).trigger("focus")}}}};var r=t.fn.dropdown;t.fn.dropdown=o,t.fn.dropdown.Constructor=a,t.fn.dropdown.noConflict=function(){return t.fn.dropdown=r,this},t(document).on("click.bs.dropdown.data-api",i).on("click.bs.dropdown.data-api",".dropdown form",function(t){t.stopPropagation()}).on("click.bs.dropdown.data-api",s,a.prototype.toggle).on("keydown.bs.dropdown.data-api",s,a.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",a.prototype.keydown)}(jQuery),+function(t){"use strict";function e(e,o){return this.each(function(){var n=t(this),s=n.data("bs.modal"),a=t.extend({},i.DEFAULTS,n.data(),"object"==typeof e&&e);s||n.data("bs.modal",s=new i(this,a)),"string"==typeof e?s[e](o):a.show&&s.show(o)})}var i=function(e,i){this.options=i,this.$body=t(document.body),this.$element=t(e),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,t.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};i.VERSION="3.3.6",i.TRANSITION_DURATION=300,i.BACKDROP_TRANSITION_DURATION=150,i.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},i.prototype.toggle=function(t){return this.isShown?this.hide():this.show(t)},i.prototype.show=function(e){var o=this,n=t.Event("show.bs.modal",{relatedTarget:e});this.$element.trigger(n),this.isShown||n.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"]',t.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){o.$element.one("mouseup.dismiss.bs.modal",function(e){t(e.target).is(o.$element)&&(o.ignoreBackdropClick=!0)})}),this.backdrop(function(){var n=t.support.transition&&o.$element.hasClass("fade");o.$element.parent().length||o.$element.appendTo(o.$body),o.$element.show().scrollTop(0),o.adjustDialog(),n&&o.$element[0].offsetWidth,o.$element.addClass("in"),o.enforceFocus();var s=t.Event("shown.bs.modal",{relatedTarget:e});n?o.$dialog.one("bsTransitionEnd",function(){o.$element.trigger("focus").trigger(s)}).emulateTransitionEnd(i.TRANSITION_DURATION):o.$element.trigger("focus").trigger(s)}))},i.prototype.hide=function(e){e&&e.preventDefault(),e=t.Event("hide.bs.modal"),this.$element.trigger(e),this.isShown&&!e.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),t(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),t.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",t.proxy(this.hideModal,this)).emulateTransitionEnd(i.TRANSITION_DURATION):this.hideModal())},i.prototype.enforceFocus=function(){t(document).off("focusin.bs.modal").on("focusin.bs.modal",t.proxy(function(t){this.$element[0]===t.target||this.$element.has(t.target).length||this.$element.trigger("focus")},this))},i.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",t.proxy(function(t){27==t.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},i.prototype.resize=function(){this.isShown?t(window).on("resize.bs.modal",t.proxy(this.handleUpdate,this)):t(window).off("resize.bs.modal")},i.prototype.hideModal=function(){var t=this;this.$element.hide(),this.backdrop(function(){t.$body.removeClass("modal-open"),t.resetAdjustments(),t.resetScrollbar(),t.$element.trigger("hidden.bs.modal")})},i.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},i.prototype.backdrop=function(e){var o=this,n=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var s=t.support.transition&&n;if(this.$backdrop=t(document.createElement("div")).addClass("modal-backdrop "+n).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",t.proxy(function(t){return this.ignoreBackdropClick?void(this.ignoreBackdropClick=!1):void(t.target===t.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide()))},this)),s&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!e)return;s?this.$backdrop.one("bsTransitionEnd",e).emulateTransitionEnd(i.BACKDROP_TRANSITION_DURATION):e()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var a=function(){o.removeBackdrop(),e&&e()};t.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",a).emulateTransitionEnd(i.BACKDROP_TRANSITION_DURATION):a()}else e&&e()},i.prototype.handleUpdate=function(){this.adjustDialog()},i.prototype.adjustDialog=function(){var t=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&t?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!t?this.scrollbarWidth:""})},i.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},i.prototype.checkScrollbar=function(){var t=window.innerWidth;if(!t){var e=document.documentElement.getBoundingClientRect();t=e.right-Math.abs(e.left)}this.bodyIsOverflowing=document.body.clientWidth<t,this.scrollbarWidth=this.measureScrollbar()},i.prototype.setScrollbar=function(){var t=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"",this.bodyIsOverflowing&&this.$body.css("padding-right",t+this.scrollbarWidth)},i.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)},i.prototype.measureScrollbar=function(){var t=document.createElement("div");t.className="modal-scrollbar-measure",this.$body.append(t);var e=t.offsetWidth-t.clientWidth;return this.$body[0].removeChild(t),e};var o=t.fn.modal;t.fn.modal=e,t.fn.modal.Constructor=i,t.fn.modal.noConflict=function(){return t.fn.modal=o,this},t(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(i){var o=t(this),n=o.attr("href"),s=t(o.attr("data-target")||n&&n.replace(/.*(?=#[^\s]+$)/,"")),a=s.data("bs.modal")?"toggle":t.extend({remote:!/#/.test(n)&&n},s.data(),o.data());o.is("a")&&i.preventDefault(),s.one("show.bs.modal",function(t){t.isDefaultPrevented()||s.one("hidden.bs.modal",function(){o.is(":visible")&&o.trigger("focus")})}),e.call(s,a,this)})}(jQuery),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.tooltip"),s="object"==typeof e&&e;(n||!/destroy|hide/.test(e))&&(n||o.data("bs.tooltip",n=new i(this,s)),"string"==typeof e&&n[e]())})}var i=function(t,e){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",t,e)};i.VERSION="3.3.6",i.TRANSITION_DURATION=150,i.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}},i.prototype.init=function(e,i,o){if(this.enabled=!0,this.type=e,this.$element=t(i),this.options=this.getOptions(o),this.$viewport=this.options.viewport&&t(t.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},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 n=this.options.trigger.split(" "),s=n.length;s--;){var a=n[s];if("click"==a)this.$element.on("click."+this.type,this.options.selector,t.proxy(this.toggle,this));else if("manual"!=a){var r="hover"==a?"mouseenter":"focusin",l="hover"==a?"mouseleave":"focusout";this.$element.on(r+"."+this.type,this.options.selector,t.proxy(this.enter,this)),this.$element.on(l+"."+this.type,this.options.selector,t.proxy(this.leave,this))}}this.options.selector?this._options=t.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},i.prototype.getDefaults=function(){return i.DEFAULTS},i.prototype.getOptions=function(e){return e=t.extend({},this.getDefaults(),this.$element.data(),e),e.delay&&"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),e},i.prototype.getDelegateOptions=function(){var e={},i=this.getDefaults();return this._options&&t.each(this._options,function(t,o){i[t]!=o&&(e[t]=o)}),e},i.prototype.enter=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);return i||(i=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,i)),e instanceof t.Event&&(i.inState["focusin"==e.type?"focus":"hover"]=!0),i.tip().hasClass("in")||"in"==i.hoverState?void(i.hoverState="in"):(clearTimeout(i.timeout),i.hoverState="in",i.options.delay&&i.options.delay.show?void(i.timeout=setTimeout(function(){"in"==i.hoverState&&i.show()},i.options.delay.show)):i.show())},i.prototype.isInStateTrue=function(){for(var t in this.inState)if(this.inState[t])return!0;return!1},i.prototype.leave=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);return i||(i=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,i)),e instanceof t.Event&&(i.inState["focusout"==e.type?"focus":"hover"]=!1),i.isInStateTrue()?void 0:(clearTimeout(i.timeout),i.hoverState="out",i.options.delay&&i.options.delay.hide?void(i.timeout=setTimeout(function(){"out"==i.hoverState&&i.hide()},i.options.delay.hide)):i.hide())},i.prototype.show=function(){var e=t.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(e);var o=t.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(e.isDefaultPrevented()||!o)return;var n=this,s=this.tip(),a=this.getUID(this.type);this.setContent(),s.attr("id",a),this.$element.attr("aria-describedby",a),this.options.animation&&s.addClass("fade");var r="function"==typeof this.options.placement?this.options.placement.call(this,s[0],this.$element[0]):this.options.placement,l=/\s?auto?\s?/i,h=l.test(r);h&&(r=r.replace(l,"")||"top"),s.detach().css({top:0,left:0,display:"block"}).addClass(r).data("bs."+this.type,this),this.options.container?s.appendTo(this.options.container):s.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var d=this.getPosition(),p=s[0].offsetWidth,c=s[0].offsetHeight;if(h){var f=r,u=this.getPosition(this.$viewport);r="bottom"==r&&d.bottom+c>u.bottom?"top":"top"==r&&d.top-c<u.top?"bottom":"right"==r&&d.right+p>u.width?"left":"left"==r&&d.left-p<u.left?"right":r,s.removeClass(f).addClass(r)}var g=this.getCalculatedOffset(r,d,p,c);this.applyPlacement(g,r);var v=function(){var t=n.hoverState;n.$element.trigger("shown.bs."+n.type),n.hoverState=null,"out"==t&&n.leave(n)};t.support.transition&&this.$tip.hasClass("fade")?s.one("bsTransitionEnd",v).emulateTransitionEnd(i.TRANSITION_DURATION):v()}},i.prototype.applyPlacement=function(e,i){var o=this.tip(),n=o[0].offsetWidth,s=o[0].offsetHeight,a=parseInt(o.css("margin-top"),10),r=parseInt(o.css("margin-left"),10);isNaN(a)&&(a=0),isNaN(r)&&(r=0),e.top+=a,e.left+=r,t.offset.setOffset(o[0],t.extend({using:function(t){o.css({top:Math.round(t.top),left:Math.round(t.left)})}},e),0),o.addClass("in");var l=o[0].offsetWidth,h=o[0].offsetHeight;"top"==i&&h!=s&&(e.top=e.top+s-h);var d=this.getViewportAdjustedDelta(i,e,l,h);d.left?e.left+=d.left:e.top+=d.top;var p=/top|bottom/.test(i),c=p?2*d.left-n+l:2*d.top-s+h,f=p?"offsetWidth":"offsetHeight";o.offset(e),this.replaceArrow(c,o[0][f],p)},i.prototype.replaceArrow=function(t,e,i){this.arrow().css(i?"left":"top",50*(1-t/e)+"%").css(i?"top":"left","")},i.prototype.setContent=function(){var t=this.tip(),e=this.getTitle();t.find(".tooltip-inner")[this.options.html?"html":"text"](e),t.removeClass("fade in top bottom left right")},i.prototype.hide=function(e){function o(){"in"!=n.hoverState&&s.detach(),n.$element.removeAttr("aria-describedby").trigger("hidden.bs."+n.type),e&&e()}var n=this,s=t(this.$tip),a=t.Event("hide.bs."+this.type);return this.$element.trigger(a),a.isDefaultPrevented()?void 0:(s.removeClass("in"),t.support.transition&&s.hasClass("fade")?s.one("bsTransitionEnd",o).emulateTransitionEnd(i.TRANSITION_DURATION):o(),this.hoverState=null,this)},i.prototype.fixTitle=function(){var t=this.$element;(t.attr("title")||"string"!=typeof t.attr("data-original-title"))&&t.attr("data-original-title",t.attr("title")||"").attr("title","")},i.prototype.hasContent=function(){return this.getTitle()},i.prototype.getPosition=function(e){e=e||this.$element;var i=e[0],o="BODY"==i.tagName,n=i.getBoundingClientRect();null==n.width&&(n=t.extend({},n,{width:n.right-n.left,height:n.bottom-n.top}));var s=o?{top:0,left:0}:e.offset(),a={scroll:o?document.documentElement.scrollTop||document.body.scrollTop:e.scrollTop()},r=o?{width:t(window).width(),height:t(window).height()}:null;return t.extend({},n,a,r,s)},i.prototype.getCalculatedOffset=function(t,e,i,o){return"bottom"==t?{top:e.top+e.height,left:e.left+e.width/2-i/2}:"top"==t?{top:e.top-o,left:e.left+e.width/2-i/2}:"left"==t?{top:e.top+e.height/2-o/2,left:e.left-i}:{top:e.top+e.height/2-o/2,left:e.left+e.width}},i.prototype.getViewportAdjustedDelta=function(t,e,i,o){var n={top:0,left:0};if(!this.$viewport)return n;var s=this.options.viewport&&this.options.viewport.padding||0,a=this.getPosition(this.$viewport);if(/right|left/.test(t)){var r=e.top-s-a.scroll,l=e.top+s-a.scroll+o;r<a.top?n.top=a.top-r:l>a.top+a.height&&(n.top=a.top+a.height-l)}else{var h=e.left-s,d=e.left+s+i;h<a.left?n.left=a.left-h:d>a.right&&(n.left=a.left+a.width-d)}return n},i.prototype.getTitle=function(){var t,e=this.$element,i=this.options;return t=e.attr("data-original-title")||("function"==typeof i.title?i.title.call(e[0]):i.title)},i.prototype.getUID=function(t){do t+=~~(1e6*Math.random());while(document.getElementById(t));return t},i.prototype.tip=function(){if(!this.$tip&&(this.$tip=t(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},i.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},i.prototype.enable=function(){this.enabled=!0},i.prototype.disable=function(){this.enabled=!1},i.prototype.toggleEnabled=function(){this.enabled=!this.enabled},i.prototype.toggle=function(e){var i=this;e&&(i=t(e.currentTarget).data("bs."+this.type),i||(i=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,i))),e?(i.inState.click=!i.inState.click,i.isInStateTrue()?i.enter(i):i.leave(i)):i.tip().hasClass("in")?i.leave(i):i.enter(i)},i.prototype.destroy=function(){var t=this;clearTimeout(this.timeout),this.hide(function(){t.$element.off("."+t.type).removeData("bs."+t.type),t.$tip&&t.$tip.detach(),t.$tip=null,t.$arrow=null,t.$viewport=null})};var o=t.fn.tooltip;t.fn.tooltip=e,t.fn.tooltip.Constructor=i,t.fn.tooltip.noConflict=function(){return t.fn.tooltip=o,this}}(jQuery),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.popover"),s="object"==typeof e&&e;(n||!/destroy|hide/.test(e))&&(n||o.data("bs.popover",n=new i(this,s)),"string"==typeof e&&n[e]())})}var i=function(t,e){this.init("popover",t,e)};if(!t.fn.tooltip)throw new Error("Popover requires tooltip.js");i.VERSION="3.3.6",i.DEFAULTS=t.extend({},t.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>'}),i.prototype=t.extend({},t.fn.tooltip.Constructor.prototype),i.prototype.constructor=i,i.prototype.getDefaults=function(){return i.DEFAULTS},i.prototype.setContent=function(){var t=this.tip(),e=this.getTitle(),i=this.getContent();t.find(".popover-title")[this.options.html?"html":"text"](e),t.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof i?"html":"append":"text"](i),t.removeClass("fade top bottom left right in"),t.find(".popover-title").html()||t.find(".popover-title").hide()},i.prototype.hasContent=function(){return this.getTitle()||this.getContent()},i.prototype.getContent=function(){var t=this.$element,e=this.options;return t.attr("data-content")||("function"==typeof e.content?e.content.call(t[0]):e.content)},i.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var o=t.fn.popover;t.fn.popover=e,t.fn.popover.Constructor=i,t.fn.popover.noConflict=function(){return t.fn.popover=o,this}}(jQuery),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.tab");n||o.data("bs.tab",n=new i(this)),"string"==typeof e&&n[e]()})}var i=function(e){this.element=t(e)};i.VERSION="3.3.6",i.TRANSITION_DURATION=150,i.prototype.show=function(){var e=this.element,i=e.closest("ul:not(.dropdown-menu)"),o=e.data("target");if(o||(o=e.attr("href"),o=o&&o.replace(/.*(?=#[^\s]*$)/,"")),!e.parent("li").hasClass("active")){var n=i.find(".active:last a"),s=t.Event("hide.bs.tab",{relatedTarget:e[0]}),a=t.Event("show.bs.tab",{relatedTarget:n[0]});if(n.trigger(s),e.trigger(a),!a.isDefaultPrevented()&&!s.isDefaultPrevented()){var r=t(o);this.activate(e.closest("li"),i),this.activate(r,r.parent(),function(){n.trigger({type:"hidden.bs.tab",relatedTarget:e[0]}),e.trigger({type:"shown.bs.tab",relatedTarget:n[0]})})}}},i.prototype.activate=function(e,o,n){function s(){a.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),e.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),r?(e[0].offsetWidth,e.addClass("in")):e.removeClass("fade"),e.parent(".dropdown-menu").length&&e.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),n&&n()}var a=o.find("> .active"),r=n&&t.support.transition&&(a.length&&a.hasClass("fade")||!!o.find("> .fade").length);a.length&&r?a.one("bsTransitionEnd",s).emulateTransitionEnd(i.TRANSITION_DURATION):s(),a.removeClass("in")};var o=t.fn.tab;t.fn.tab=e,t.fn.tab.Constructor=i,t.fn.tab.noConflict=function(){return t.fn.tab=o,this};var n=function(i){i.preventDefault(),e.call(t(this),"show")};t(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',n).on("click.bs.tab.data-api",'[data-toggle="pill"]',n)}(jQuery),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.affix"),s="object"==typeof e&&e;n||o.data("bs.affix",n=new i(this,s)),"string"==typeof e&&n[e]()})}var i=function(e,o){this.options=t.extend({},i.DEFAULTS,o),this.$target=t(this.options.target).on("scroll.bs.affix.data-api",t.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",t.proxy(this.checkPositionWithEventLoop,this)),this.$element=t(e),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};i.VERSION="3.3.6",i.RESET="affix affix-top affix-bottom",i.DEFAULTS={offset:0,target:window},i.prototype.getState=function(t,e,i,o){var n=this.$target.scrollTop(),s=this.$element.offset(),a=this.$target.height();if(null!=i&&"top"==this.affixed)return i>n?"top":!1;if("bottom"==this.affixed)return null!=i?n+this.unpin<=s.top?!1:"bottom":t-o>=n+a?!1:"bottom";var r=null==this.affixed,l=r?n:s.top,h=r?a:e;return null!=i&&i>=n?"top":null!=o&&l+h>=t-o?"bottom":!1},i.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(i.RESET).addClass("affix");var t=this.$target.scrollTop(),e=this.$element.offset();return this.pinnedOffset=e.top-t},i.prototype.checkPositionWithEventLoop=function(){setTimeout(t.proxy(this.checkPosition,this),1)},i.prototype.checkPosition=function(){if(this.$element.is(":visible")){var e=this.$element.height(),o=this.options.offset,n=o.top,s=o.bottom,a=Math.max(t(document).height(),t(document.body).height());"object"!=typeof o&&(s=n=o),"function"==typeof n&&(n=o.top(this.$element)),"function"==typeof s&&(s=o.bottom(this.$element));var r=this.getState(a,e,n,s);if(this.affixed!=r){null!=this.unpin&&this.$element.css("top","");var l="affix"+(r?"-"+r:""),h=t.Event(l+".bs.affix");if(this.$element.trigger(h),h.isDefaultPrevented())return;this.affixed=r,this.unpin="bottom"==r?this.getPinnedOffset():null,this.$element.removeClass(i.RESET).addClass(l).trigger(l.replace("affix","affixed")+".bs.affix")}"bottom"==r&&this.$element.offset({top:a-e-s})}};var o=t.fn.affix;t.fn.affix=e,t.fn.affix.Constructor=i,t.fn.affix.noConflict=function(){return t.fn.affix=o,this},t(window).on("load",function(){t('[data-spy="affix"]').each(function(){var i=t(this),o=i.data();o.offset=o.offset||{},null!=o.offsetBottom&&(o.offset.bottom=o.offsetBottom),null!=o.offsetTop&&(o.offset.top=o.offsetTop),e.call(i,o)})})}(jQuery),+function(t){"use strict";function e(e){var i,o=e.attr("data-target")||(i=e.attr("href"))&&i.replace(/.*(?=#[^\s]+$)/,"");return t(o)}function i(e){return this.each(function(){var i=t(this),n=i.data("bs.collapse"),s=t.extend({},o.DEFAULTS,i.data(),"object"==typeof e&&e);!n&&s.toggle&&/show|hide/.test(e)&&(s.toggle=!1),n||i.data("bs.collapse",n=new o(this,s)),"string"==typeof e&&n[e]()})}var o=function(e,i){this.$element=t(e),this.options=t.extend({},o.DEFAULTS,i),this.$trigger=t('[data-toggle="collapse"][href="#'+e.id+'"],[data-toggle="collapse"][data-target="#'+e.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};o.VERSION="3.3.6",o.TRANSITION_DURATION=350,o.DEFAULTS={toggle:!0},o.prototype.dimension=function(){var t=this.$element.hasClass("width");return t?"width":"height"},o.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var e,n=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(n&&n.length&&(e=n.data("bs.collapse"),e&&e.transitioning))){var s=t.Event("show.bs.collapse");if(this.$element.trigger(s),!s.isDefaultPrevented()){n&&n.length&&(i.call(n,"hide"),e||n.data("bs.collapse",null));var a=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[a](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var r=function(){this.$element.removeClass("collapsing").addClass("collapse in")[a](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!t.support.transition)return r.call(this);var l=t.camelCase(["scroll",a].join("-"));this.$element.one("bsTransitionEnd",t.proxy(r,this)).emulateTransitionEnd(o.TRANSITION_DURATION)[a](this.$element[0][l]);
+}}}},o.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var e=t.Event("hide.bs.collapse");if(this.$element.trigger(e),!e.isDefaultPrevented()){var i=this.dimension();this.$element[i](this.$element[i]())[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 n=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return t.support.transition?void this.$element[i](0).one("bsTransitionEnd",t.proxy(n,this)).emulateTransitionEnd(o.TRANSITION_DURATION):n.call(this)}}},o.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},o.prototype.getParent=function(){return t(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(t.proxy(function(i,o){var n=t(o);this.addAriaAndCollapsedClass(e(n),n)},this)).end()},o.prototype.addAriaAndCollapsedClass=function(t,e){var i=t.hasClass("in");t.attr("aria-expanded",i),e.toggleClass("collapsed",!i).attr("aria-expanded",i)};var n=t.fn.collapse;t.fn.collapse=i,t.fn.collapse.Constructor=o,t.fn.collapse.noConflict=function(){return t.fn.collapse=n,this},t(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(o){var n=t(this);n.attr("data-target")||o.preventDefault();var s=e(n),a=s.data("bs.collapse"),r=a?"toggle":n.data();i.call(s,r)})}(jQuery),+function(t){"use strict";function e(i,o){this.$body=t(document.body),this.$scrollElement=t(t(i).is(document.body)?window:i),this.options=t.extend({},e.DEFAULTS,o),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",t.proxy(this.process,this)),this.refresh(),this.process()}function i(i){return this.each(function(){var o=t(this),n=o.data("bs.scrollspy"),s="object"==typeof i&&i;n||o.data("bs.scrollspy",n=new e(this,s)),"string"==typeof i&&n[i]()})}e.VERSION="3.3.6",e.DEFAULTS={offset:10},e.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},e.prototype.refresh=function(){var e=this,i="offset",o=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),t.isWindow(this.$scrollElement[0])||(i="position",o=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var e=t(this),n=e.data("target")||e.attr("href"),s=/^#./.test(n)&&t(n);return s&&s.length&&s.is(":visible")&&[[s[i]().top+o,n]]||null}).sort(function(t,e){return t[0]-e[0]}).each(function(){e.offsets.push(this[0]),e.targets.push(this[1])})},e.prototype.process=function(){var t,e=this.$scrollElement.scrollTop()+this.options.offset,i=this.getScrollHeight(),o=this.options.offset+i-this.$scrollElement.height(),n=this.offsets,s=this.targets,a=this.activeTarget;if(this.scrollHeight!=i&&this.refresh(),e>=o)return a!=(t=s[s.length-1])&&this.activate(t);if(a&&e<n[0])return this.activeTarget=null,this.clear();for(t=n.length;t--;)a!=s[t]&&e>=n[t]&&(void 0===n[t+1]||e<n[t+1])&&this.activate(s[t])},e.prototype.activate=function(e){this.activeTarget=e,this.clear();var i=this.selector+'[data-target="'+e+'"],'+this.selector+'[href="'+e+'"]',o=t(i).parents("li").addClass("active");o.parent(".dropdown-menu").length&&(o=o.closest("li.dropdown").addClass("active")),o.trigger("activate.bs.scrollspy")},e.prototype.clear=function(){t(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var o=t.fn.scrollspy;t.fn.scrollspy=i,t.fn.scrollspy.Constructor=e,t.fn.scrollspy.noConflict=function(){return t.fn.scrollspy=o,this},t(window).on("load.bs.scrollspy.data-api",function(){t('[data-spy="scroll"]').each(function(){var e=t(this);i.call(e,e.data())})})}(jQuery),+function(t){"use strict";function e(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in e)if(void 0!==t.style[i])return{end:e[i]};return!1}t.fn.emulateTransitionEnd=function(e){var i=!1,o=this;t(this).one("bsTransitionEnd",function(){i=!0});var n=function(){i||t(o).trigger(t.support.transition.end)};return setTimeout(n,e),this},t(function(){t.support.transition=e(),t.support.transition&&(t.event.special.bsTransitionEnd={bindType:t.support.transition.end,delegateType:t.support.transition.end,handle:function(e){return t(e.target).is(this)?e.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery); \ No newline at end of file
diff --git a/public_html/data/js/vendor/jquery-2.0.3.js b/public_html/data/js/vendor/jquery-2.0.3.js
new file mode 100644
index 000000000..ebc6c187d
--- /dev/null
+++ b/public_html/data/js/vendor/jquery-2.0.3.js
@@ -0,0 +1,8829 @@
+/*!
+ * jQuery JavaScript Library v2.0.3
+ * http://jquery.com/
+ *
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ *
+ * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors
+ * Released under the MIT license
+ * http://jquery.org/license
+ *
+ * Date: 2013-07-03T13:30Z
+ */
+(function( window, undefined ) {
+
+// Can't do this because several apps including ASP.NET trace
+// the stack via arguments.caller.callee and Firefox dies if
+// you try to trace through "use strict" call chains. (#13335)
+// Support: Firefox 18+
+//"use strict";
+var
+ // A central reference to the root jQuery(document)
+ rootjQuery,
+
+ // The deferred used on DOM ready
+ readyList,
+
+ // Support: IE9
+ // For `typeof xmlNode.method` instead of `xmlNode.method !== undefined`
+ core_strundefined = typeof undefined,
+
+ // Use the correct document accordingly with window argument (sandbox)
+ location = window.location,
+ document = window.document,
+ docElem = document.documentElement,
+
+ // Map over jQuery in case of overwrite
+ _jQuery = window.jQuery,
+
+ // Map over the $ in case of overwrite
+ _$ = window.$,
+
+ // [[Class]] -> type pairs
+ class2type = {},
+
+ // List of deleted data cache ids, so we can reuse them
+ core_deletedIds = [],
+
+ core_version = "2.0.3",
+
+ // Save a reference to some core methods
+ core_concat = core_deletedIds.concat,
+ core_push = core_deletedIds.push,
+ core_slice = core_deletedIds.slice,
+ core_indexOf = core_deletedIds.indexOf,
+ core_toString = class2type.toString,
+ core_hasOwn = class2type.hasOwnProperty,
+ core_trim = core_version.trim,
+
+ // Define a local copy of jQuery
+ jQuery = function( selector, context ) {
+ // The jQuery object is actually just the init constructor 'enhanced'
+ return new jQuery.fn.init( selector, context, rootjQuery );
+ },
+
+ // Used for matching numbers
+ core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,
+
+ // Used for splitting on whitespace
+ core_rnotwhite = /\S+/g,
+
+ // A simple way to check for HTML strings
+ // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
+ // Strict HTML recognition (#11290: must start with <)
+ rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
+
+ // Match a standalone tag
+ rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
+
+ // Matches dashed string for camelizing
+ rmsPrefix = /^-ms-/,
+ rdashAlpha = /-([\da-z])/gi,
+
+ // Used by jQuery.camelCase as callback to replace()
+ fcamelCase = function( all, letter ) {
+ return letter.toUpperCase();
+ },
+
+ // The ready event handler and self cleanup method
+ completed = function() {
+ document.removeEventListener( "DOMContentLoaded", completed, false );
+ window.removeEventListener( "load", completed, false );
+ jQuery.ready();
+ };
+
+jQuery.fn = jQuery.prototype = {
+ // The current version of jQuery being used
+ jquery: core_version,
+
+ constructor: jQuery,
+ init: function( selector, context, rootjQuery ) {
+ var match, elem;
+
+ // HANDLE: $(""), $(null), $(undefined), $(false)
+ if ( !selector ) {
+ return this;
+ }
+
+ // Handle HTML strings
+ if ( typeof selector === "string" ) {
+ if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
+ // Assume that strings that start and end with <> are HTML and skip the regex check
+ match = [ null, selector, null ];
+
+ } else {
+ match = rquickExpr.exec( selector );
+ }
+
+ // Match html or make sure no context is specified for #id
+ if ( match && (match[1] || !context) ) {
+
+ // HANDLE: $(html) -> $(array)
+ if ( match[1] ) {
+ context = context instanceof jQuery ? context[0] : context;
+
+ // scripts is true for back-compat
+ jQuery.merge( this, jQuery.parseHTML(
+ match[1],
+ context && context.nodeType ? context.ownerDocument || context : document,
+ true
+ ) );
+
+ // HANDLE: $(html, props)
+ if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
+ for ( match in context ) {
+ // Properties of context are called as methods if possible
+ if ( jQuery.isFunction( this[ match ] ) ) {
+ this[ match ]( context[ match ] );
+
+ // ...and otherwise set as attributes
+ } else {
+ this.attr( match, context[ match ] );
+ }
+ }
+ }
+
+ return this;
+
+ // HANDLE: $(#id)
+ } else {
+ elem = document.getElementById( match[2] );
+
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ if ( elem && elem.parentNode ) {
+ // Inject the element directly into the jQuery object
+ this.length = 1;
+ this[0] = elem;
+ }
+
+ this.context = document;
+ this.selector = selector;
+ return this;
+ }
+
+ // HANDLE: $(expr, $(...))
+ } else if ( !context || context.jquery ) {
+ return ( context || rootjQuery ).find( selector );
+
+ // HANDLE: $(expr, context)
+ // (which is just equivalent to: $(context).find(expr)
+ } else {
+ return this.constructor( context ).find( selector );
+ }
+
+ // HANDLE: $(DOMElement)
+ } else if ( selector.nodeType ) {
+ this.context = this[0] = selector;
+ this.length = 1;
+ return this;
+
+ // HANDLE: $(function)
+ // Shortcut for document ready
+ } else if ( jQuery.isFunction( selector ) ) {
+ return rootjQuery.ready( selector );
+ }
+
+ if ( selector.selector !== undefined ) {
+ this.selector = selector.selector;
+ this.context = selector.context;
+ }
+
+ return jQuery.makeArray( selector, this );
+ },
+
+ // Start with an empty selector
+ selector: "",
+
+ // The default length of a jQuery object is 0
+ length: 0,
+
+ toArray: function() {
+ return core_slice.call( this );
+ },
+
+ // Get the Nth element in the matched element set OR
+ // Get the whole matched element set as a clean array
+ get: function( num ) {
+ return num == null ?
+
+ // Return a 'clean' array
+ this.toArray() :
+
+ // Return just the object
+ ( num < 0 ? this[ this.length + num ] : this[ num ] );
+ },
+
+ // Take an array of elements and push it onto the stack
+ // (returning the new matched element set)
+ pushStack: function( elems ) {
+
+ // Build a new jQuery matched element set
+ var ret = jQuery.merge( this.constructor(), elems );
+
+ // Add the old object onto the stack (as a reference)
+ ret.prevObject = this;
+ ret.context = this.context;
+
+ // Return the newly-formed element set
+ return ret;
+ },
+
+ // Execute a callback for every element in the matched set.
+ // (You can seed the arguments with an array of args, but this is
+ // only used internally.)
+ each: function( callback, args ) {
+ return jQuery.each( this, callback, args );
+ },
+
+ ready: function( fn ) {
+ // Add the callback
+ jQuery.ready.promise().done( fn );
+
+ return this;
+ },
+
+ slice: function() {
+ return this.pushStack( core_slice.apply( this, arguments ) );
+ },
+
+ first: function() {
+ return this.eq( 0 );
+ },
+
+ last: function() {
+ return this.eq( -1 );
+ },
+
+ eq: function( i ) {
+ var len = this.length,
+ j = +i + ( i < 0 ? len : 0 );
+ return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
+ },
+
+ map: function( callback ) {
+ return this.pushStack( jQuery.map(this, function( elem, i ) {
+ return callback.call( elem, i, elem );
+ }));
+ },
+
+ end: function() {
+ return this.prevObject || this.constructor(null);
+ },
+
+ // For internal use only.
+ // Behaves like an Array's method, not like a jQuery method.
+ push: core_push,
+ sort: [].sort,
+ splice: [].splice
+};
+
+// Give the init function the jQuery prototype for later instantiation
+jQuery.fn.init.prototype = jQuery.fn;
+
+jQuery.extend = jQuery.fn.extend = function() {
+ var options, name, src, copy, copyIsArray, clone,
+ target = arguments[0] || {},
+ i = 1,
+ length = arguments.length,
+ deep = false;
+
+ // Handle a deep copy situation
+ if ( typeof target === "boolean" ) {
+ deep = target;
+ target = arguments[1] || {};
+ // skip the boolean and the target
+ i = 2;
+ }
+
+ // Handle case when target is a string or something (possible in deep copy)
+ if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
+ target = {};
+ }
+
+ // extend jQuery itself if only one argument is passed
+ if ( length === i ) {
+ target = this;
+ --i;
+ }
+
+ for ( ; i < length; i++ ) {
+ // Only deal with non-null/undefined values
+ if ( (options = arguments[ i ]) != null ) {
+ // Extend the base object
+ for ( name in options ) {
+ src = target[ name ];
+ copy = options[ name ];
+
+ // Prevent never-ending loop
+ if ( target === copy ) {
+ continue;
+ }
+
+ // Recurse if we're merging plain objects or arrays
+ if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
+ if ( copyIsArray ) {
+ copyIsArray = false;
+ clone = src && jQuery.isArray(src) ? src : [];
+
+ } else {
+ clone = src && jQuery.isPlainObject(src) ? src : {};
+ }
+
+ // Never move original objects, clone them
+ target[ name ] = jQuery.extend( deep, clone, copy );
+
+ // Don't bring in undefined values
+ } else if ( copy !== undefined ) {
+ target[ name ] = copy;
+ }
+ }
+ }
+ }
+
+ // Return the modified object
+ return target;
+};
+
+jQuery.extend({
+ // Unique for each copy of jQuery on the page
+ expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ),
+
+ noConflict: function( deep ) {
+ if ( window.$ === jQuery ) {
+ window.$ = _$;
+ }
+
+ if ( deep && window.jQuery === jQuery ) {
+ window.jQuery = _jQuery;
+ }
+
+ return jQuery;
+ },
+
+ // Is the DOM ready to be used? Set to true once it occurs.
+ isReady: false,
+
+ // A counter to track how many items to wait for before
+ // the ready event fires. See #6781
+ readyWait: 1,
+
+ // Hold (or release) the ready event
+ holdReady: function( hold ) {
+ if ( hold ) {
+ jQuery.readyWait++;
+ } else {
+ jQuery.ready( true );
+ }
+ },
+
+ // Handle when the DOM is ready
+ ready: function( wait ) {
+
+ // Abort if there are pending holds or we're already ready
+ if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
+ return;
+ }
+
+ // Remember that the DOM is ready
+ jQuery.isReady = true;
+
+ // If a normal DOM Ready event fired, decrement, and wait if need be
+ if ( wait !== true && --jQuery.readyWait > 0 ) {
+ return;
+ }
+
+ // If there are functions bound, to execute
+ readyList.resolveWith( document, [ jQuery ] );
+
+ // Trigger any bound ready events
+ if ( jQuery.fn.trigger ) {
+ jQuery( document ).trigger("ready").off("ready");
+ }
+ },
+
+ // See test/unit/core.js for details concerning isFunction.
+ // Since version 1.3, DOM methods and functions like alert
+ // aren't supported. They return false on IE (#2968).
+ isFunction: function( obj ) {
+ return jQuery.type(obj) === "function";
+ },
+
+ isArray: Array.isArray,
+
+ isWindow: function( obj ) {
+ return obj != null && obj === obj.window;
+ },
+
+ isNumeric: function( obj ) {
+ return !isNaN( parseFloat(obj) ) && isFinite( obj );
+ },
+
+ type: function( obj ) {
+ if ( obj == null ) {
+ return String( obj );
+ }
+ // Support: Safari <= 5.1 (functionish RegExp)
+ return typeof obj === "object" || typeof obj === "function" ?
+ class2type[ core_toString.call(obj) ] || "object" :
+ typeof obj;
+ },
+
+ isPlainObject: function( obj ) {
+ // Not plain objects:
+ // - Any object or value whose internal [[Class]] property is not "[object Object]"
+ // - DOM nodes
+ // - window
+ if ( jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
+ return false;
+ }
+
+ // Support: Firefox <20
+ // The try/catch suppresses exceptions thrown when attempting to access
+ // the "constructor" property of certain host objects, ie. |window.location|
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=814622
+ try {
+ if ( obj.constructor &&
+ !core_hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) {
+ return false;
+ }
+ } catch ( e ) {
+ return false;
+ }
+
+ // If the function hasn't returned already, we're confident that
+ // |obj| is a plain object, created by {} or constructed with new Object
+ return true;
+ },
+
+ isEmptyObject: function( obj ) {
+ var name;
+ for ( name in obj ) {
+ return false;
+ }
+ return true;
+ },
+
+ error: function( msg ) {
+ throw new Error( msg );
+ },
+
+ // data: string of html
+ // context (optional): If specified, the fragment will be created in this context, defaults to document
+ // keepScripts (optional): If true, will include scripts passed in the html string
+ parseHTML: function( data, context, keepScripts ) {
+ if ( !data || typeof data !== "string" ) {
+ return null;
+ }
+ if ( typeof context === "boolean" ) {
+ keepScripts = context;
+ context = false;
+ }
+ context = context || document;
+
+ var parsed = rsingleTag.exec( data ),
+ scripts = !keepScripts && [];
+
+ // Single tag
+ if ( parsed ) {
+ return [ context.createElement( parsed[1] ) ];
+ }
+
+ parsed = jQuery.buildFragment( [ data ], context, scripts );
+
+ if ( scripts ) {
+ jQuery( scripts ).remove();
+ }
+
+ return jQuery.merge( [], parsed.childNodes );
+ },
+
+ parseJSON: JSON.parse,
+
+ // Cross-browser xml parsing
+ parseXML: function( data ) {
+ var xml, tmp;
+ if ( !data || typeof data !== "string" ) {
+ return null;
+ }
+
+ // Support: IE9
+ try {
+ tmp = new DOMParser();
+ xml = tmp.parseFromString( data , "text/xml" );
+ } catch ( e ) {
+ xml = undefined;
+ }
+
+ if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
+ jQuery.error( "Invalid XML: " + data );
+ }
+ return xml;
+ },
+
+ noop: function() {},
+
+ // Evaluates a script in a global context
+ globalEval: function( code ) {
+ var script,
+ indirect = eval;
+
+ code = jQuery.trim( code );
+
+ if ( code ) {
+ // If the code includes a valid, prologue position
+ // strict mode pragma, execute code by injecting a
+ // script tag into the document.
+ if ( code.indexOf("use strict") === 1 ) {
+ script = document.createElement("script");
+ script.text = code;
+ document.head.appendChild( script ).parentNode.removeChild( script );
+ } else {
+ // Otherwise, avoid the DOM node creation, insertion
+ // and removal by using an indirect global eval
+ indirect( code );
+ }
+ }
+ },
+
+ // Convert dashed to camelCase; used by the css and data modules
+ // Microsoft forgot to hump their vendor prefix (#9572)
+ camelCase: function( string ) {
+ return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
+ },
+
+ nodeName: function( elem, name ) {
+ return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
+ },
+
+ // args is for internal usage only
+ each: function( obj, callback, args ) {
+ var value,
+ i = 0,
+ length = obj.length,
+ isArray = isArraylike( obj );
+
+ if ( args ) {
+ if ( isArray ) {
+ for ( ; i < length; i++ ) {
+ value = callback.apply( obj[ i ], args );
+
+ if ( value === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( i in obj ) {
+ value = callback.apply( obj[ i ], args );
+
+ if ( value === false ) {
+ break;
+ }
+ }
+ }
+
+ // A special, fast, case for the most common use of each
+ } else {
+ if ( isArray ) {
+ for ( ; i < length; i++ ) {
+ value = callback.call( obj[ i ], i, obj[ i ] );
+
+ if ( value === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( i in obj ) {
+ value = callback.call( obj[ i ], i, obj[ i ] );
+
+ if ( value === false ) {
+ break;
+ }
+ }
+ }
+ }
+
+ return obj;
+ },
+
+ trim: function( text ) {
+ return text == null ? "" : core_trim.call( text );
+ },
+
+ // results is for internal usage only
+ makeArray: function( arr, results ) {
+ var ret = results || [];
+
+ if ( arr != null ) {
+ if ( isArraylike( Object(arr) ) ) {
+ jQuery.merge( ret,
+ typeof arr === "string" ?
+ [ arr ] : arr
+ );
+ } else {
+ core_push.call( ret, arr );
+ }
+ }
+
+ return ret;
+ },
+
+ inArray: function( elem, arr, i ) {
+ return arr == null ? -1 : core_indexOf.call( arr, elem, i );
+ },
+
+ merge: function( first, second ) {
+ var l = second.length,
+ i = first.length,
+ j = 0;
+
+ if ( typeof l === "number" ) {
+ for ( ; j < l; j++ ) {
+ first[ i++ ] = second[ j ];
+ }
+ } else {
+ while ( second[j] !== undefined ) {
+ first[ i++ ] = second[ j++ ];
+ }
+ }
+
+ first.length = i;
+
+ return first;
+ },
+
+ grep: function( elems, callback, inv ) {
+ var retVal,
+ ret = [],
+ i = 0,
+ length = elems.length;
+ inv = !!inv;
+
+ // Go through the array, only saving the items
+ // that pass the validator function
+ for ( ; i < length; i++ ) {
+ retVal = !!callback( elems[ i ], i );
+ if ( inv !== retVal ) {
+ ret.push( elems[ i ] );
+ }
+ }
+
+ return ret;
+ },
+
+ // arg is for internal usage only
+ map: function( elems, callback, arg ) {
+ var value,
+ i = 0,
+ length = elems.length,
+ isArray = isArraylike( elems ),
+ ret = [];
+
+ // Go through the array, translating each of the items to their
+ if ( isArray ) {
+ for ( ; i < length; i++ ) {
+ value = callback( elems[ i ], i, arg );
+
+ if ( value != null ) {
+ ret[ ret.length ] = value;
+ }
+ }
+
+ // Go through every key on the object,
+ } else {
+ for ( i in elems ) {
+ value = callback( elems[ i ], i, arg );
+
+ if ( value != null ) {
+ ret[ ret.length ] = value;
+ }
+ }
+ }
+
+ // Flatten any nested arrays
+ return core_concat.apply( [], ret );
+ },
+
+ // A global GUID counter for objects
+ guid: 1,
+
+ // Bind a function to a context, optionally partially applying any
+ // arguments.
+ proxy: function( fn, context ) {
+ var tmp, args, proxy;
+
+ if ( typeof context === "string" ) {
+ tmp = fn[ context ];
+ context = fn;
+ fn = tmp;
+ }
+
+ // Quick check to determine if target is callable, in the spec
+ // this throws a TypeError, but we will just return undefined.
+ if ( !jQuery.isFunction( fn ) ) {
+ return undefined;
+ }
+
+ // Simulated bind
+ args = core_slice.call( arguments, 2 );
+ proxy = function() {
+ return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) );
+ };
+
+ // Set the guid of unique handler to the same of original handler, so it can be removed
+ proxy.guid = fn.guid = fn.guid || jQuery.guid++;
+
+ return proxy;
+ },
+
+ // Multifunctional method to get and set values of a collection
+ // The value/s can optionally be executed if it's a function
+ access: function( elems, fn, key, value, chainable, emptyGet, raw ) {
+ var i = 0,
+ length = elems.length,
+ bulk = key == null;
+
+ // Sets many values
+ if ( jQuery.type( key ) === "object" ) {
+ chainable = true;
+ for ( i in key ) {
+ jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
+ }
+
+ // Sets one value
+ } else if ( value !== undefined ) {
+ chainable = true;
+
+ if ( !jQuery.isFunction( value ) ) {
+ raw = true;
+ }
+
+ if ( bulk ) {
+ // Bulk operations run against the entire set
+ if ( raw ) {
+ fn.call( elems, value );
+ fn = null;
+
+ // ...except when executing function values
+ } else {
+ bulk = fn;
+ fn = function( elem, key, value ) {
+ return bulk.call( jQuery( elem ), value );
+ };
+ }
+ }
+
+ if ( fn ) {
+ for ( ; i < length; i++ ) {
+ fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
+ }
+ }
+ }
+
+ return chainable ?
+ elems :
+
+ // Gets
+ bulk ?
+ fn.call( elems ) :
+ length ? fn( elems[0], key ) : emptyGet;
+ },
+
+ now: Date.now,
+
+ // A method for quickly swapping in/out CSS properties to get correct calculations.
+ // Note: this method belongs to the css module but it's needed here for the support module.
+ // If support gets modularized, this method should be moved back to the css module.
+ swap: function( elem, options, callback, args ) {
+ var ret, name,
+ old = {};
+
+ // Remember the old values, and insert the new ones
+ for ( name in options ) {
+ old[ name ] = elem.style[ name ];
+ elem.style[ name ] = options[ name ];
+ }
+
+ ret = callback.apply( elem, args || [] );
+
+ // Revert the old values
+ for ( name in options ) {
+ elem.style[ name ] = old[ name ];
+ }
+
+ return ret;
+ }
+});
+
+jQuery.ready.promise = function( obj ) {
+ if ( !readyList ) {
+
+ readyList = jQuery.Deferred();
+
+ // Catch cases where $(document).ready() is called after the browser event has already occurred.
+ // we once tried to use readyState "interactive" here, but it caused issues like the one
+ // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
+ if ( document.readyState === "complete" ) {
+ // Handle it asynchronously to allow scripts the opportunity to delay ready
+ setTimeout( jQuery.ready );
+
+ } else {
+
+ // Use the handy event callback
+ document.addEventListener( "DOMContentLoaded", completed, false );
+
+ // A fallback to window.onload, that will always work
+ window.addEventListener( "load", completed, false );
+ }
+ }
+ return readyList.promise( obj );
+};
+
+// Populate the class2type map
+jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
+ class2type[ "[object " + name + "]" ] = name.toLowerCase();
+});
+
+function isArraylike( obj ) {
+ var length = obj.length,
+ type = jQuery.type( obj );
+
+ if ( jQuery.isWindow( obj ) ) {
+ return false;
+ }
+
+ if ( obj.nodeType === 1 && length ) {
+ return true;
+ }
+
+ return type === "array" || type !== "function" &&
+ ( length === 0 ||
+ typeof length === "number" && length > 0 && ( length - 1 ) in obj );
+}
+
+// All jQuery objects should point back to these
+rootjQuery = jQuery(document);
+/*!
+ * Sizzle CSS Selector Engine v1.9.4-pre
+ * http://sizzlejs.com/
+ *
+ * Copyright 2013 jQuery Foundation, Inc. and other contributors
+ * Released under the MIT license
+ * http://jquery.org/license
+ *
+ * Date: 2013-06-03
+ */
+(function( window, undefined ) {
+
+var i,
+ support,
+ cachedruns,
+ Expr,
+ getText,
+ isXML,
+ compile,
+ outermostContext,
+ sortInput,
+
+ // Local document vars
+ setDocument,
+ document,
+ docElem,
+ documentIsHTML,
+ rbuggyQSA,
+ rbuggyMatches,
+ matches,
+ contains,
+
+ // Instance-specific data
+ expando = "sizzle" + -(new Date()),
+ preferredDoc = window.document,
+ dirruns = 0,
+ done = 0,
+ classCache = createCache(),
+ tokenCache = createCache(),
+ compilerCache = createCache(),
+ hasDuplicate = false,
+ sortOrder = function( a, b ) {
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+ }
+ return 0;
+ },
+
+ // General-purpose constants
+ strundefined = typeof undefined,
+ MAX_NEGATIVE = 1 << 31,
+
+ // Instance methods
+ hasOwn = ({}).hasOwnProperty,
+ arr = [],
+ pop = arr.pop,
+ push_native = arr.push,
+ push = arr.push,
+ slice = arr.slice,
+ // Use a stripped-down indexOf if we can't use a native one
+ indexOf = arr.indexOf || function( elem ) {
+ var i = 0,
+ len = this.length;
+ for ( ; i < len; i++ ) {
+ if ( this[i] === elem ) {
+ return i;
+ }
+ }
+ return -1;
+ },
+
+ booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
+
+ // Regular expressions
+
+ // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
+ whitespace = "[\\x20\\t\\r\\n\\f]",
+ // http://www.w3.org/TR/css3-syntax/#characters
+ characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
+
+ // Loosely modeled on CSS identifier characters
+ // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
+ // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
+ identifier = characterEncoding.replace( "w", "w#" ),
+
+ // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors
+ attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace +
+ "*(?:([*^$|!~]?=)" + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",
+
+ // Prefer arguments quoted,
+ // then not containing pseudos/brackets,
+ // then attribute selectors/non-parenthetical expressions,
+ // then anything else
+ // These preferences are here to reduce the number of selectors
+ // needing tokenize in the PSEUDO preFilter
+ pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)",
+
+ // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
+ rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
+
+ rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
+ rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
+
+ rsibling = new RegExp( whitespace + "*[+~]" ),
+ rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*)" + whitespace + "*\\]", "g" ),
+
+ rpseudo = new RegExp( pseudos ),
+ ridentifier = new RegExp( "^" + identifier + "$" ),
+
+ matchExpr = {
+ "ID": new RegExp( "^#(" + characterEncoding + ")" ),
+ "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
+ "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
+ "ATTR": new RegExp( "^" + attributes ),
+ "PSEUDO": new RegExp( "^" + pseudos ),
+ "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
+ "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
+ "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
+ "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
+ // For use in libraries implementing .is()
+ // We use this for POS matching in `select`
+ "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
+ whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
+ },
+
+ rnative = /^[^{]+\{\s*\[native \w/,
+
+ // Easily-parseable/retrievable ID or TAG or CLASS selectors
+ rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
+
+ rinputs = /^(?:input|select|textarea|button)$/i,
+ rheader = /^h\d$/i,
+
+ rescape = /'|\\/g,
+
+ // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
+ runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
+ funescape = function( _, escaped, escapedWhitespace ) {
+ var high = "0x" + escaped - 0x10000;
+ // NaN means non-codepoint
+ // Support: Firefox
+ // Workaround erroneous numeric interpretation of +"0x"
+ return high !== high || escapedWhitespace ?
+ escaped :
+ // BMP codepoint
+ high < 0 ?
+ String.fromCharCode( high + 0x10000 ) :
+ // Supplemental Plane codepoint (surrogate pair)
+ String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
+ };
+
+// Optimize for push.apply( _, NodeList )
+try {
+ push.apply(
+ (arr = slice.call( preferredDoc.childNodes )),
+ preferredDoc.childNodes
+ );
+ // Support: Android<4.0
+ // Detect silently failing push.apply
+ arr[ preferredDoc.childNodes.length ].nodeType;
+} catch ( e ) {
+ push = { apply: arr.length ?
+
+ // Leverage slice if possible
+ function( target, els ) {
+ push_native.apply( target, slice.call(els) );
+ } :
+
+ // Support: IE<9
+ // Otherwise append directly
+ function( target, els ) {
+ var j = target.length,
+ i = 0;
+ // Can't trust NodeList.length
+ while ( (target[j++] = els[i++]) ) {}
+ target.length = j - 1;
+ }
+ };
+}
+
+function Sizzle( selector, context, results, seed ) {
+ var match, elem, m, nodeType,
+ // QSA vars
+ i, groups, old, nid, newContext, newSelector;
+
+ if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
+ setDocument( context );
+ }
+
+ context = context || document;
+ results = results || [];
+
+ if ( !selector || typeof selector !== "string" ) {
+ return results;
+ }
+
+ if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {
+ return [];
+ }
+
+ if ( documentIsHTML && !seed ) {
+
+ // Shortcuts
+ if ( (match = rquickExpr.exec( selector )) ) {
+ // Speed-up: Sizzle("#ID")
+ if ( (m = match[1]) ) {
+ if ( nodeType === 9 ) {
+ elem = context.getElementById( m );
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ if ( elem && elem.parentNode ) {
+ // Handle the case where IE, Opera, and Webkit return items
+ // by name instead of ID
+ if ( elem.id === m ) {
+ results.push( elem );
+ return results;
+ }
+ } else {
+ return results;
+ }
+ } else {
+ // Context is not a document
+ if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
+ contains( context, elem ) && elem.id === m ) {
+ results.push( elem );
+ return results;
+ }
+ }
+
+ // Speed-up: Sizzle("TAG")
+ } else if ( match[2] ) {
+ push.apply( results, context.getElementsByTagName( selector ) );
+ return results;
+
+ // Speed-up: Sizzle(".CLASS")
+ } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) {
+ push.apply( results, context.getElementsByClassName( m ) );
+ return results;
+ }
+ }
+
+ // QSA path
+ if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
+ nid = old = expando;
+ newContext = context;
+ newSelector = nodeType === 9 && selector;
+
+ // qSA works strangely on Element-rooted queries
+ // We can work around this by specifying an extra ID on the root
+ // and working up from there (Thanks to Andrew Dupont for the technique)
+ // IE 8 doesn't work on object elements
+ if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
+ groups = tokenize( selector );
+
+ if ( (old = context.getAttribute("id")) ) {
+ nid = old.replace( rescape, "\\$&" );
+ } else {
+ context.setAttribute( "id", nid );
+ }
+ nid = "[id='" + nid + "'] ";
+
+ i = groups.length;
+ while ( i-- ) {
+ groups[i] = nid + toSelector( groups[i] );
+ }
+ newContext = rsibling.test( selector ) && context.parentNode || context;
+ newSelector = groups.join(",");
+ }
+
+ if ( newSelector ) {
+ try {
+ push.apply( results,
+ newContext.querySelectorAll( newSelector )
+ );
+ return results;
+ } catch(qsaError) {
+ } finally {
+ if ( !old ) {
+ context.removeAttribute("id");
+ }
+ }
+ }
+ }
+ }
+
+ // All others
+ return select( selector.replace( rtrim, "$1" ), context, results, seed );
+}
+
+/**
+ * Create key-value caches of limited size
+ * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
+ * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
+ * deleting the oldest entry
+ */
+function createCache() {
+ var keys = [];
+
+ function cache( key, value ) {
+ // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
+ if ( keys.push( key += " " ) > Expr.cacheLength ) {
+ // Only keep the most recent entries
+ delete cache[ keys.shift() ];
+ }
+ return (cache[ key ] = value);
+ }
+ return cache;
+}
+
+/**
+ * Mark a function for special use by Sizzle
+ * @param {Function} fn The function to mark
+ */
+function markFunction( fn ) {
+ fn[ expando ] = true;
+ return fn;
+}
+
+/**
+ * Support testing using an element
+ * @param {Function} fn Passed the created div and expects a boolean result
+ */
+function assert( fn ) {
+ var div = document.createElement("div");
+
+ try {
+ return !!fn( div );
+ } catch (e) {
+ return false;
+ } finally {
+ // Remove from its parent by default
+ if ( div.parentNode ) {
+ div.parentNode.removeChild( div );
+ }
+ // release memory in IE
+ div = null;
+ }
+}
+
+/**
+ * Adds the same handler for all of the specified attrs
+ * @param {String} attrs Pipe-separated list of attributes
+ * @param {Function} handler The method that will be applied
+ */
+function addHandle( attrs, handler ) {
+ var arr = attrs.split("|"),
+ i = attrs.length;
+
+ while ( i-- ) {
+ Expr.attrHandle[ arr[i] ] = handler;
+ }
+}
+
+/**
+ * Checks document order of two siblings
+ * @param {Element} a
+ * @param {Element} b
+ * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
+ */
+function siblingCheck( a, b ) {
+ var cur = b && a,
+ diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
+ ( ~b.sourceIndex || MAX_NEGATIVE ) -
+ ( ~a.sourceIndex || MAX_NEGATIVE );
+
+ // Use IE sourceIndex if available on both nodes
+ if ( diff ) {
+ return diff;
+ }
+
+ // Check if b follows a
+ if ( cur ) {
+ while ( (cur = cur.nextSibling) ) {
+ if ( cur === b ) {
+ return -1;
+ }
+ }
+ }
+
+ return a ? 1 : -1;
+}
+
+/**
+ * Returns a function to use in pseudos for input types
+ * @param {String} type
+ */
+function createInputPseudo( type ) {
+ return function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return name === "input" && elem.type === type;
+ };
+}
+
+/**
+ * Returns a function to use in pseudos for buttons
+ * @param {String} type
+ */
+function createButtonPseudo( type ) {
+ return function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return (name === "input" || name === "button") && elem.type === type;
+ };
+}
+
+/**
+ * Returns a function to use in pseudos for positionals
+ * @param {Function} fn
+ */
+function createPositionalPseudo( fn ) {
+ return markFunction(function( argument ) {
+ argument = +argument;
+ return markFunction(function( seed, matches ) {
+ var j,
+ matchIndexes = fn( [], seed.length, argument ),
+ i = matchIndexes.length;
+
+ // Match elements found at the specified indexes
+ while ( i-- ) {
+ if ( seed[ (j = matchIndexes[i]) ] ) {
+ seed[j] = !(matches[j] = seed[j]);
+ }
+ }
+ });
+ });
+}
+
+/**
+ * Detect xml
+ * @param {Element|Object} elem An element or a document
+ */
+isXML = Sizzle.isXML = function( elem ) {
+ // documentElement is verified for cases where it doesn't yet exist
+ // (such as loading iframes in IE - #4833)
+ var documentElement = elem && (elem.ownerDocument || elem).documentElement;
+ return documentElement ? documentElement.nodeName !== "HTML" : false;
+};
+
+// Expose support vars for convenience
+support = Sizzle.support = {};
+
+/**
+ * Sets document-related variables once based on the current document
+ * @param {Element|Object} [doc] An element or document object to use to set the document
+ * @returns {Object} Returns the current document
+ */
+setDocument = Sizzle.setDocument = function( node ) {
+ var doc = node ? node.ownerDocument || node : preferredDoc,
+ parent = doc.defaultView;
+
+ // If no document and documentElement is available, return
+ if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
+ return document;
+ }
+
+ // Set our document
+ document = doc;
+ docElem = doc.documentElement;
+
+ // Support tests
+ documentIsHTML = !isXML( doc );
+
+ // Support: IE>8
+ // If iframe document is assigned to "document" variable and if iframe has been reloaded,
+ // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936
+ // IE6-8 do not support the defaultView property so parent will be undefined
+ if ( parent && parent.attachEvent && parent !== parent.top ) {
+ parent.attachEvent( "onbeforeunload", function() {
+ setDocument();
+ });
+ }
+
+ /* Attributes
+ ---------------------------------------------------------------------- */
+
+ // Support: IE<8
+ // Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans)
+ support.attributes = assert(function( div ) {
+ div.className = "i";
+ return !div.getAttribute("className");
+ });
+
+ /* getElement(s)By*
+ ---------------------------------------------------------------------- */
+
+ // Check if getElementsByTagName("*") returns only elements
+ support.getElementsByTagName = assert(function( div ) {
+ div.appendChild( doc.createComment("") );
+ return !div.getElementsByTagName("*").length;
+ });
+
+ // Check if getElementsByClassName can be trusted
+ support.getElementsByClassName = assert(function( div ) {
+ div.innerHTML = "<div class='a'></div><div class='a i'></div>";
+
+ // Support: Safari<4
+ // Catch class over-caching
+ div.firstChild.className = "i";
+ // Support: Opera<10
+ // Catch gEBCN failure to find non-leading classes
+ return div.getElementsByClassName("i").length === 2;
+ });
+
+ // Support: IE<10
+ // Check if getElementById returns elements by name
+ // The broken getElementById methods don't pick up programatically-set names,
+ // so use a roundabout getElementsByName test
+ support.getById = assert(function( div ) {
+ docElem.appendChild( div ).id = expando;
+ return !doc.getElementsByName || !doc.getElementsByName( expando ).length;
+ });
+
+ // ID find and filter
+ if ( support.getById ) {
+ Expr.find["ID"] = function( id, context ) {
+ if ( typeof context.getElementById !== strundefined && documentIsHTML ) {
+ var m = context.getElementById( id );
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ return m && m.parentNode ? [m] : [];
+ }
+ };
+ Expr.filter["ID"] = function( id ) {
+ var attrId = id.replace( runescape, funescape );
+ return function( elem ) {
+ return elem.getAttribute("id") === attrId;
+ };
+ };
+ } else {
+ // Support: IE6/7
+ // getElementById is not reliable as a find shortcut
+ delete Expr.find["ID"];
+
+ Expr.filter["ID"] = function( id ) {
+ var attrId = id.replace( runescape, funescape );
+ return function( elem ) {
+ var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
+ return node && node.value === attrId;
+ };
+ };
+ }
+
+ // Tag
+ Expr.find["TAG"] = support.getElementsByTagName ?
+ function( tag, context ) {
+ if ( typeof context.getElementsByTagName !== strundefined ) {
+ return context.getElementsByTagName( tag );
+ }
+ } :
+ function( tag, context ) {
+ var elem,
+ tmp = [],
+ i = 0,
+ results = context.getElementsByTagName( tag );
+
+ // Filter out possible comments
+ if ( tag === "*" ) {
+ while ( (elem = results[i++]) ) {
+ if ( elem.nodeType === 1 ) {
+ tmp.push( elem );
+ }
+ }
+
+ return tmp;
+ }
+ return results;
+ };
+
+ // Class
+ Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
+ if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) {
+ return context.getElementsByClassName( className );
+ }
+ };
+
+ /* QSA/matchesSelector
+ ---------------------------------------------------------------------- */
+
+ // QSA and matchesSelector support
+
+ // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
+ rbuggyMatches = [];
+
+ // qSa(:focus) reports false when true (Chrome 21)
+ // We allow this because of a bug in IE8/9 that throws an error
+ // whenever `document.activeElement` is accessed on an iframe
+ // So, we allow :focus to pass through QSA all the time to avoid the IE error
+ // See http://bugs.jquery.com/ticket/13378
+ rbuggyQSA = [];
+
+ if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) {
+ // Build QSA regex
+ // Regex strategy adopted from Diego Perini
+ assert(function( div ) {
+ // Select is set to empty string on purpose
+ // This is to test IE's treatment of not explicitly
+ // setting a boolean content attribute,
+ // since its presence should be enough
+ // http://bugs.jquery.com/ticket/12359
+ div.innerHTML = "<select><option selected=''></option></select>";
+
+ // Support: IE8
+ // Boolean attributes and "value" are not treated correctly
+ if ( !div.querySelectorAll("[selected]").length ) {
+ rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
+ }
+
+ // Webkit/Opera - :checked should return selected option elements
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
+ // IE8 throws error here and will not see later tests
+ if ( !div.querySelectorAll(":checked").length ) {
+ rbuggyQSA.push(":checked");
+ }
+ });
+
+ assert(function( div ) {
+
+ // Support: Opera 10-12/IE8
+ // ^= $= *= and empty values
+ // Should not select anything
+ // Support: Windows 8 Native Apps
+ // The type attribute is restricted during .innerHTML assignment
+ var input = doc.createElement("input");
+ input.setAttribute( "type", "hidden" );
+ div.appendChild( input ).setAttribute( "t", "" );
+
+ if ( div.querySelectorAll("[t^='']").length ) {
+ rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
+ }
+
+ // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
+ // IE8 throws error here and will not see later tests
+ if ( !div.querySelectorAll(":enabled").length ) {
+ rbuggyQSA.push( ":enabled", ":disabled" );
+ }
+
+ // Opera 10-11 does not throw on post-comma invalid pseudos
+ div.querySelectorAll("*,:x");
+ rbuggyQSA.push(",.*:");
+ });
+ }
+
+ if ( (support.matchesSelector = rnative.test( (matches = docElem.webkitMatchesSelector ||
+ docElem.mozMatchesSelector ||
+ docElem.oMatchesSelector ||
+ docElem.msMatchesSelector) )) ) {
+
+ assert(function( div ) {
+ // Check to see if it's possible to do matchesSelector
+ // on a disconnected node (IE 9)
+ support.disconnectedMatch = matches.call( div, "div" );
+
+ // This should fail with an exception
+ // Gecko does not error, returns false instead
+ matches.call( div, "[s!='']:x" );
+ rbuggyMatches.push( "!=", pseudos );
+ });
+ }
+
+ rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
+ rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
+
+ /* Contains
+ ---------------------------------------------------------------------- */
+
+ // Element contains another
+ // Purposefully does not implement inclusive descendent
+ // As in, an element does not contain itself
+ contains = rnative.test( docElem.contains ) || docElem.compareDocumentPosition ?
+ function( a, b ) {
+ var adown = a.nodeType === 9 ? a.documentElement : a,
+ bup = b && b.parentNode;
+ return a === bup || !!( bup && bup.nodeType === 1 && (
+ adown.contains ?
+ adown.contains( bup ) :
+ a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
+ ));
+ } :
+ function( a, b ) {
+ if ( b ) {
+ while ( (b = b.parentNode) ) {
+ if ( b === a ) {
+ return true;
+ }
+ }
+ }
+ return false;
+ };
+
+ /* Sorting
+ ---------------------------------------------------------------------- */
+
+ // Document order sorting
+ sortOrder = docElem.compareDocumentPosition ?
+ function( a, b ) {
+
+ // Flag for duplicate removal
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+ }
+
+ var compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b );
+
+ if ( compare ) {
+ // Disconnected nodes
+ if ( compare & 1 ||
+ (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
+
+ // Choose the first element that is related to our preferred document
+ if ( a === doc || contains(preferredDoc, a) ) {
+ return -1;
+ }
+ if ( b === doc || contains(preferredDoc, b) ) {
+ return 1;
+ }
+
+ // Maintain original order
+ return sortInput ?
+ ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
+ 0;
+ }
+
+ return compare & 4 ? -1 : 1;
+ }
+
+ // Not directly comparable, sort on existence of method
+ return a.compareDocumentPosition ? -1 : 1;
+ } :
+ function( a, b ) {
+ var cur,
+ i = 0,
+ aup = a.parentNode,
+ bup = b.parentNode,
+ ap = [ a ],
+ bp = [ b ];
+
+ // Exit early if the nodes are identical
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+
+ // Parentless nodes are either documents or disconnected
+ } else if ( !aup || !bup ) {
+ return a === doc ? -1 :
+ b === doc ? 1 :
+ aup ? -1 :
+ bup ? 1 :
+ sortInput ?
+ ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
+ 0;
+
+ // If the nodes are siblings, we can do a quick check
+ } else if ( aup === bup ) {
+ return siblingCheck( a, b );
+ }
+
+ // Otherwise we need full lists of their ancestors for comparison
+ cur = a;
+ while ( (cur = cur.parentNode) ) {
+ ap.unshift( cur );
+ }
+ cur = b;
+ while ( (cur = cur.parentNode) ) {
+ bp.unshift( cur );
+ }
+
+ // Walk down the tree looking for a discrepancy
+ while ( ap[i] === bp[i] ) {
+ i++;
+ }
+
+ return i ?
+ // Do a sibling check if the nodes have a common ancestor
+ siblingCheck( ap[i], bp[i] ) :
+
+ // Otherwise nodes in our document sort first
+ ap[i] === preferredDoc ? -1 :
+ bp[i] === preferredDoc ? 1 :
+ 0;
+ };
+
+ return doc;
+};
+
+Sizzle.matches = function( expr, elements ) {
+ return Sizzle( expr, null, null, elements );
+};
+
+Sizzle.matchesSelector = function( elem, expr ) {
+ // Set document vars if needed
+ if ( ( elem.ownerDocument || elem ) !== document ) {
+ setDocument( elem );
+ }
+
+ // Make sure that attribute selectors are quoted
+ expr = expr.replace( rattributeQuotes, "='$1']" );
+
+ if ( support.matchesSelector && documentIsHTML &&
+ ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
+ ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
+
+ try {
+ var ret = matches.call( elem, expr );
+
+ // IE 9's matchesSelector returns false on disconnected nodes
+ if ( ret || support.disconnectedMatch ||
+ // As well, disconnected nodes are said to be in a document
+ // fragment in IE 9
+ elem.document && elem.document.nodeType !== 11 ) {
+ return ret;
+ }
+ } catch(e) {}
+ }
+
+ return Sizzle( expr, document, null, [elem] ).length > 0;
+};
+
+Sizzle.contains = function( context, elem ) {
+ // Set document vars if needed
+ if ( ( context.ownerDocument || context ) !== document ) {
+ setDocument( context );
+ }
+ return contains( context, elem );
+};
+
+Sizzle.attr = function( elem, name ) {
+ // Set document vars if needed
+ if ( ( elem.ownerDocument || elem ) !== document ) {
+ setDocument( elem );
+ }
+
+ var fn = Expr.attrHandle[ name.toLowerCase() ],
+ // Don't get fooled by Object.prototype properties (jQuery #13807)
+ val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
+ fn( elem, name, !documentIsHTML ) :
+ undefined;
+
+ return val === undefined ?
+ support.attributes || !documentIsHTML ?
+ elem.getAttribute( name ) :
+ (val = elem.getAttributeNode(name)) && val.specified ?
+ val.value :
+ null :
+ val;
+};
+
+Sizzle.error = function( msg ) {
+ throw new Error( "Syntax error, unrecognized expression: " + msg );
+};
+
+/**
+ * Document sorting and removing duplicates
+ * @param {ArrayLike} results
+ */
+Sizzle.uniqueSort = function( results ) {
+ var elem,
+ duplicates = [],
+ j = 0,
+ i = 0;
+
+ // Unless we *know* we can detect duplicates, assume their presence
+ hasDuplicate = !support.detectDuplicates;
+ sortInput = !support.sortStable && results.slice( 0 );
+ results.sort( sortOrder );
+
+ if ( hasDuplicate ) {
+ while ( (elem = results[i++]) ) {
+ if ( elem === results[ i ] ) {
+ j = duplicates.push( i );
+ }
+ }
+ while ( j-- ) {
+ results.splice( duplicates[ j ], 1 );
+ }
+ }
+
+ return results;
+};
+
+/**
+ * Utility function for retrieving the text value of an array of DOM nodes
+ * @param {Array|Element} elem
+ */
+getText = Sizzle.getText = function( elem ) {
+ var node,
+ ret = "",
+ i = 0,
+ nodeType = elem.nodeType;
+
+ if ( !nodeType ) {
+ // If no nodeType, this is expected to be an array
+ for ( ; (node = elem[i]); i++ ) {
+ // Do not traverse comment nodes
+ ret += getText( node );
+ }
+ } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
+ // Use textContent for elements
+ // innerText usage removed for consistency of new lines (see #11153)
+ if ( typeof elem.textContent === "string" ) {
+ return elem.textContent;
+ } else {
+ // Traverse its children
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
+ ret += getText( elem );
+ }
+ }
+ } else if ( nodeType === 3 || nodeType === 4 ) {
+ return elem.nodeValue;
+ }
+ // Do not include comment or processing instruction nodes
+
+ return ret;
+};
+
+Expr = Sizzle.selectors = {
+
+ // Can be adjusted by the user
+ cacheLength: 50,
+
+ createPseudo: markFunction,
+
+ match: matchExpr,
+
+ attrHandle: {},
+
+ find: {},
+
+ relative: {
+ ">": { dir: "parentNode", first: true },
+ " ": { dir: "parentNode" },
+ "+": { dir: "previousSibling", first: true },
+ "~": { dir: "previousSibling" }
+ },
+
+ preFilter: {
+ "ATTR": function( match ) {
+ match[1] = match[1].replace( runescape, funescape );
+
+ // Move the given value to match[3] whether quoted or unquoted
+ match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape );
+
+ if ( match[2] === "~=" ) {
+ match[3] = " " + match[3] + " ";
+ }
+
+ return match.slice( 0, 4 );
+ },
+
+ "CHILD": function( match ) {
+ /* matches from matchExpr["CHILD"]
+ 1 type (only|nth|...)
+ 2 what (child|of-type)
+ 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
+ 4 xn-component of xn+y argument ([+-]?\d*n|)
+ 5 sign of xn-component
+ 6 x of xn-component
+ 7 sign of y-component
+ 8 y of y-component
+ */
+ match[1] = match[1].toLowerCase();
+
+ if ( match[1].slice( 0, 3 ) === "nth" ) {
+ // nth-* requires argument
+ if ( !match[3] ) {
+ Sizzle.error( match[0] );
+ }
+
+ // numeric x and y parameters for Expr.filter.CHILD
+ // remember that false/true cast respectively to 0/1
+ match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
+ match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
+
+ // other types prohibit arguments
+ } else if ( match[3] ) {
+ Sizzle.error( match[0] );
+ }
+
+ return match;
+ },
+
+ "PSEUDO": function( match ) {
+ var excess,
+ unquoted = !match[5] && match[2];
+
+ if ( matchExpr["CHILD"].test( match[0] ) ) {
+ return null;
+ }
+
+ // Accept quoted arguments as-is
+ if ( match[3] && match[4] !== undefined ) {
+ match[2] = match[4];
+
+ // Strip excess characters from unquoted arguments
+ } else if ( unquoted && rpseudo.test( unquoted ) &&
+ // Get excess from tokenize (recursively)
+ (excess = tokenize( unquoted, true )) &&
+ // advance to the next closing parenthesis
+ (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
+
+ // excess is a negative index
+ match[0] = match[0].slice( 0, excess );
+ match[2] = unquoted.slice( 0, excess );
+ }
+
+ // Return only captures needed by the pseudo filter method (type and argument)
+ return match.slice( 0, 3 );
+ }
+ },
+
+ filter: {
+
+ "TAG": function( nodeNameSelector ) {
+ var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
+ return nodeNameSelector === "*" ?
+ function() { return true; } :
+ function( elem ) {
+ return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
+ };
+ },
+
+ "CLASS": function( className ) {
+ var pattern = classCache[ className + " " ];
+
+ return pattern ||
+ (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
+ classCache( className, function( elem ) {
+ return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" );
+ });
+ },
+
+ "ATTR": function( name, operator, check ) {
+ return function( elem ) {
+ var result = Sizzle.attr( elem, name );
+
+ if ( result == null ) {
+ return operator === "!=";
+ }
+ if ( !operator ) {
+ return true;
+ }
+
+ result += "";
+
+ return operator === "=" ? result === check :
+ operator === "!=" ? result !== check :
+ operator === "^=" ? check && result.indexOf( check ) === 0 :
+ operator === "*=" ? check && result.indexOf( check ) > -1 :
+ operator === "$=" ? check && result.slice( -check.length ) === check :
+ operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
+ operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
+ false;
+ };
+ },
+
+ "CHILD": function( type, what, argument, first, last ) {
+ var simple = type.slice( 0, 3 ) !== "nth",
+ forward = type.slice( -4 ) !== "last",
+ ofType = what === "of-type";
+
+ return first === 1 && last === 0 ?
+
+ // Shortcut for :nth-*(n)
+ function( elem ) {
+ return !!elem.parentNode;
+ } :
+
+ function( elem, context, xml ) {
+ var cache, outerCache, node, diff, nodeIndex, start,
+ dir = simple !== forward ? "nextSibling" : "previousSibling",
+ parent = elem.parentNode,
+ name = ofType && elem.nodeName.toLowerCase(),
+ useCache = !xml && !ofType;
+
+ if ( parent ) {
+
+ // :(first|last|only)-(child|of-type)
+ if ( simple ) {
+ while ( dir ) {
+ node = elem;
+ while ( (node = node[ dir ]) ) {
+ if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
+ return false;
+ }
+ }
+ // Reverse direction for :only-* (if we haven't yet done so)
+ start = dir = type === "only" && !start && "nextSibling";
+ }
+ return true;
+ }
+
+ start = [ forward ? parent.firstChild : parent.lastChild ];
+
+ // non-xml :nth-child(...) stores cache data on `parent`
+ if ( forward && useCache ) {
+ // Seek `elem` from a previously-cached index
+ outerCache = parent[ expando ] || (parent[ expando ] = {});
+ cache = outerCache[ type ] || [];
+ nodeIndex = cache[0] === dirruns && cache[1];
+ diff = cache[0] === dirruns && cache[2];
+ node = nodeIndex && parent.childNodes[ nodeIndex ];
+
+ while ( (node = ++nodeIndex && node && node[ dir ] ||
+
+ // Fallback to seeking `elem` from the start
+ (diff = nodeIndex = 0) || start.pop()) ) {
+
+ // When found, cache indexes on `parent` and break
+ if ( node.nodeType === 1 && ++diff && node === elem ) {
+ outerCache[ type ] = [ dirruns, nodeIndex, diff ];
+ break;
+ }
+ }
+
+ // Use previously-cached element index if available
+ } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
+ diff = cache[1];
+
+ // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
+ } else {
+ // Use the same loop as above to seek `elem` from the start
+ while ( (node = ++nodeIndex && node && node[ dir ] ||
+ (diff = nodeIndex = 0) || start.pop()) ) {
+
+ if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
+ // Cache the index of each encountered element
+ if ( useCache ) {
+ (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
+ }
+
+ if ( node === elem ) {
+ break;
+ }
+ }
+ }
+ }
+
+ // Incorporate the offset, then check against cycle size
+ diff -= last;
+ return diff === first || ( diff % first === 0 && diff / first >= 0 );
+ }
+ };
+ },
+
+ "PSEUDO": function( pseudo, argument ) {
+ // pseudo-class names are case-insensitive
+ // http://www.w3.org/TR/selectors/#pseudo-classes
+ // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
+ // Remember that setFilters inherits from pseudos
+ var args,
+ fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
+ Sizzle.error( "unsupported pseudo: " + pseudo );
+
+ // The user may use createPseudo to indicate that
+ // arguments are needed to create the filter function
+ // just as Sizzle does
+ if ( fn[ expando ] ) {
+ return fn( argument );
+ }
+
+ // But maintain support for old signatures
+ if ( fn.length > 1 ) {
+ args = [ pseudo, pseudo, "", argument ];
+ return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
+ markFunction(function( seed, matches ) {
+ var idx,
+ matched = fn( seed, argument ),
+ i = matched.length;
+ while ( i-- ) {
+ idx = indexOf.call( seed, matched[i] );
+ seed[ idx ] = !( matches[ idx ] = matched[i] );
+ }
+ }) :
+ function( elem ) {
+ return fn( elem, 0, args );
+ };
+ }
+
+ return fn;
+ }
+ },
+
+ pseudos: {
+ // Potentially complex pseudos
+ "not": markFunction(function( selector ) {
+ // Trim the selector passed to compile
+ // to avoid treating leading and trailing
+ // spaces as combinators
+ var input = [],
+ results = [],
+ matcher = compile( selector.replace( rtrim, "$1" ) );
+
+ return matcher[ expando ] ?
+ markFunction(function( seed, matches, context, xml ) {
+ var elem,
+ unmatched = matcher( seed, null, xml, [] ),
+ i = seed.length;
+
+ // Match elements unmatched by `matcher`
+ while ( i-- ) {
+ if ( (elem = unmatched[i]) ) {
+ seed[i] = !(matches[i] = elem);
+ }
+ }
+ }) :
+ function( elem, context, xml ) {
+ input[0] = elem;
+ matcher( input, null, xml, results );
+ return !results.pop();
+ };
+ }),
+
+ "has": markFunction(function( selector ) {
+ return function( elem ) {
+ return Sizzle( selector, elem ).length > 0;
+ };
+ }),
+
+ "contains": markFunction(function( text ) {
+ return function( elem ) {
+ return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
+ };
+ }),
+
+ // "Whether an element is represented by a :lang() selector
+ // is based solely on the element's language value
+ // being equal to the identifier C,
+ // or beginning with the identifier C immediately followed by "-".
+ // The matching of C against the element's language value is performed case-insensitively.
+ // The identifier C does not have to be a valid language name."
+ // http://www.w3.org/TR/selectors/#lang-pseudo
+ "lang": markFunction( function( lang ) {
+ // lang value must be a valid identifier
+ if ( !ridentifier.test(lang || "") ) {
+ Sizzle.error( "unsupported lang: " + lang );
+ }
+ lang = lang.replace( runescape, funescape ).toLowerCase();
+ return function( elem ) {
+ var elemLang;
+ do {
+ if ( (elemLang = documentIsHTML ?
+ elem.lang :
+ elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
+
+ elemLang = elemLang.toLowerCase();
+ return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
+ }
+ } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
+ return false;
+ };
+ }),
+
+ // Miscellaneous
+ "target": function( elem ) {
+ var hash = window.location && window.location.hash;
+ return hash && hash.slice( 1 ) === elem.id;
+ },
+
+ "root": function( elem ) {
+ return elem === docElem;
+ },
+
+ "focus": function( elem ) {
+ return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
+ },
+
+ // Boolean properties
+ "enabled": function( elem ) {
+ return elem.disabled === false;
+ },
+
+ "disabled": function( elem ) {
+ return elem.disabled === true;
+ },
+
+ "checked": function( elem ) {
+ // In CSS3, :checked should return both checked and selected elements
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
+ var nodeName = elem.nodeName.toLowerCase();
+ return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
+ },
+
+ "selected": function( elem ) {
+ // Accessing this property makes selected-by-default
+ // options in Safari work properly
+ if ( elem.parentNode ) {
+ elem.parentNode.selectedIndex;
+ }
+
+ return elem.selected === true;
+ },
+
+ // Contents
+ "empty": function( elem ) {
+ // http://www.w3.org/TR/selectors/#empty-pseudo
+ // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)),
+ // not comment, processing instructions, or others
+ // Thanks to Diego Perini for the nodeName shortcut
+ // Greater than "@" means alpha characters (specifically not starting with "#" or "?")
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
+ if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) {
+ return false;
+ }
+ }
+ return true;
+ },
+
+ "parent": function( elem ) {
+ return !Expr.pseudos["empty"]( elem );
+ },
+
+ // Element/input types
+ "header": function( elem ) {
+ return rheader.test( elem.nodeName );
+ },
+
+ "input": function( elem ) {
+ return rinputs.test( elem.nodeName );
+ },
+
+ "button": function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return name === "input" && elem.type === "button" || name === "button";
+ },
+
+ "text": function( elem ) {
+ var attr;
+ // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
+ // use getAttribute instead to test this case
+ return elem.nodeName.toLowerCase() === "input" &&
+ elem.type === "text" &&
+ ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type );
+ },
+
+ // Position-in-collection
+ "first": createPositionalPseudo(function() {
+ return [ 0 ];
+ }),
+
+ "last": createPositionalPseudo(function( matchIndexes, length ) {
+ return [ length - 1 ];
+ }),
+
+ "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ return [ argument < 0 ? argument + length : argument ];
+ }),
+
+ "even": createPositionalPseudo(function( matchIndexes, length ) {
+ var i = 0;
+ for ( ; i < length; i += 2 ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
+
+ "odd": createPositionalPseudo(function( matchIndexes, length ) {
+ var i = 1;
+ for ( ; i < length; i += 2 ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
+
+ "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ var i = argument < 0 ? argument + length : argument;
+ for ( ; --i >= 0; ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
+
+ "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ var i = argument < 0 ? argument + length : argument;
+ for ( ; ++i < length; ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ })
+ }
+};
+
+Expr.pseudos["nth"] = Expr.pseudos["eq"];
+
+// Add button/input type pseudos
+for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
+ Expr.pseudos[ i ] = createInputPseudo( i );
+}
+for ( i in { submit: true, reset: true } ) {
+ Expr.pseudos[ i ] = createButtonPseudo( i );
+}
+
+// Easy API for creating new setFilters
+function setFilters() {}
+setFilters.prototype = Expr.filters = Expr.pseudos;
+Expr.setFilters = new setFilters();
+
+function tokenize( selector, parseOnly ) {
+ var matched, match, tokens, type,
+ soFar, groups, preFilters,
+ cached = tokenCache[ selector + " " ];
+
+ if ( cached ) {
+ return parseOnly ? 0 : cached.slice( 0 );
+ }
+
+ soFar = selector;
+ groups = [];
+ preFilters = Expr.preFilter;
+
+ while ( soFar ) {
+
+ // Comma and first run
+ if ( !matched || (match = rcomma.exec( soFar )) ) {
+ if ( match ) {
+ // Don't consume trailing commas as valid
+ soFar = soFar.slice( match[0].length ) || soFar;
+ }
+ groups.push( tokens = [] );
+ }
+
+ matched = false;
+
+ // Combinators
+ if ( (match = rcombinators.exec( soFar )) ) {
+ matched = match.shift();
+ tokens.push({
+ value: matched,
+ // Cast descendant combinators to space
+ type: match[0].replace( rtrim, " " )
+ });
+ soFar = soFar.slice( matched.length );
+ }
+
+ // Filters
+ for ( type in Expr.filter ) {
+ if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
+ (match = preFilters[ type ]( match ))) ) {
+ matched = match.shift();
+ tokens.push({
+ value: matched,
+ type: type,
+ matches: match
+ });
+ soFar = soFar.slice( matched.length );
+ }
+ }
+
+ if ( !matched ) {
+ break;
+ }
+ }
+
+ // Return the length of the invalid excess
+ // if we're just parsing
+ // Otherwise, throw an error or return tokens
+ return parseOnly ?
+ soFar.length :
+ soFar ?
+ Sizzle.error( selector ) :
+ // Cache the tokens
+ tokenCache( selector, groups ).slice( 0 );
+}
+
+function toSelector( tokens ) {
+ var i = 0,
+ len = tokens.length,
+ selector = "";
+ for ( ; i < len; i++ ) {
+ selector += tokens[i].value;
+ }
+ return selector;
+}
+
+function addCombinator( matcher, combinator, base ) {
+ var dir = combinator.dir,
+ checkNonElements = base && dir === "parentNode",
+ doneName = done++;
+
+ return combinator.first ?
+ // Check against closest ancestor/preceding element
+ function( elem, context, xml ) {
+ while ( (elem = elem[ dir ]) ) {
+ if ( elem.nodeType === 1 || checkNonElements ) {
+ return matcher( elem, context, xml );
+ }
+ }
+ } :
+
+ // Check against all ancestor/preceding elements
+ function( elem, context, xml ) {
+ var data, cache, outerCache,
+ dirkey = dirruns + " " + doneName;
+
+ // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
+ if ( xml ) {
+ while ( (elem = elem[ dir ]) ) {
+ if ( elem.nodeType === 1 || checkNonElements ) {
+ if ( matcher( elem, context, xml ) ) {
+ return true;
+ }
+ }
+ }
+ } else {
+ while ( (elem = elem[ dir ]) ) {
+ if ( elem.nodeType === 1 || checkNonElements ) {
+ outerCache = elem[ expando ] || (elem[ expando ] = {});
+ if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) {
+ if ( (data = cache[1]) === true || data === cachedruns ) {
+ return data === true;
+ }
+ } else {
+ cache = outerCache[ dir ] = [ dirkey ];
+ cache[1] = matcher( elem, context, xml ) || cachedruns;
+ if ( cache[1] === true ) {
+ return true;
+ }
+ }
+ }
+ }
+ }
+ };
+}
+
+function elementMatcher( matchers ) {
+ return matchers.length > 1 ?
+ function( elem, context, xml ) {
+ var i = matchers.length;
+ while ( i-- ) {
+ if ( !matchers[i]( elem, context, xml ) ) {
+ return false;
+ }
+ }
+ return true;
+ } :
+ matchers[0];
+}
+
+function condense( unmatched, map, filter, context, xml ) {
+ var elem,
+ newUnmatched = [],
+ i = 0,
+ len = unmatched.length,
+ mapped = map != null;
+
+ for ( ; i < len; i++ ) {
+ if ( (elem = unmatched[i]) ) {
+ if ( !filter || filter( elem, context, xml ) ) {
+ newUnmatched.push( elem );
+ if ( mapped ) {
+ map.push( i );
+ }
+ }
+ }
+ }
+
+ return newUnmatched;
+}
+
+function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
+ if ( postFilter && !postFilter[ expando ] ) {
+ postFilter = setMatcher( postFilter );
+ }
+ if ( postFinder && !postFinder[ expando ] ) {
+ postFinder = setMatcher( postFinder, postSelector );
+ }
+ return markFunction(function( seed, results, context, xml ) {
+ var temp, i, elem,
+ preMap = [],
+ postMap = [],
+ preexisting = results.length,
+
+ // Get initial elements from seed or context
+ elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
+
+ // Prefilter to get matcher input, preserving a map for seed-results synchronization
+ matcherIn = preFilter && ( seed || !selector ) ?
+ condense( elems, preMap, preFilter, context, xml ) :
+ elems,
+
+ matcherOut = matcher ?
+ // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
+ postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
+
+ // ...intermediate processing is necessary
+ [] :
+
+ // ...otherwise use results directly
+ results :
+ matcherIn;
+
+ // Find primary matches
+ if ( matcher ) {
+ matcher( matcherIn, matcherOut, context, xml );
+ }
+
+ // Apply postFilter
+ if ( postFilter ) {
+ temp = condense( matcherOut, postMap );
+ postFilter( temp, [], context, xml );
+
+ // Un-match failing elements by moving them back to matcherIn
+ i = temp.length;
+ while ( i-- ) {
+ if ( (elem = temp[i]) ) {
+ matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
+ }
+ }
+ }
+
+ if ( seed ) {
+ if ( postFinder || preFilter ) {
+ if ( postFinder ) {
+ // Get the final matcherOut by condensing this intermediate into postFinder contexts
+ temp = [];
+ i = matcherOut.length;
+ while ( i-- ) {
+ if ( (elem = matcherOut[i]) ) {
+ // Restore matcherIn since elem is not yet a final match
+ temp.push( (matcherIn[i] = elem) );
+ }
+ }
+ postFinder( null, (matcherOut = []), temp, xml );
+ }
+
+ // Move matched elements from seed to results to keep them synchronized
+ i = matcherOut.length;
+ while ( i-- ) {
+ if ( (elem = matcherOut[i]) &&
+ (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) {
+
+ seed[temp] = !(results[temp] = elem);
+ }
+ }
+ }
+
+ // Add elements to results, through postFinder if defined
+ } else {
+ matcherOut = condense(
+ matcherOut === results ?
+ matcherOut.splice( preexisting, matcherOut.length ) :
+ matcherOut
+ );
+ if ( postFinder ) {
+ postFinder( null, results, matcherOut, xml );
+ } else {
+ push.apply( results, matcherOut );
+ }
+ }
+ });
+}
+
+function matcherFromTokens( tokens ) {
+ var checkContext, matcher, j,
+ len = tokens.length,
+ leadingRelative = Expr.relative[ tokens[0].type ],
+ implicitRelative = leadingRelative || Expr.relative[" "],
+ i = leadingRelative ? 1 : 0,
+
+ // The foundational matcher ensures that elements are reachable from top-level context(s)
+ matchContext = addCombinator( function( elem ) {
+ return elem === checkContext;
+ }, implicitRelative, true ),
+ matchAnyContext = addCombinator( function( elem ) {
+ return indexOf.call( checkContext, elem ) > -1;
+ }, implicitRelative, true ),
+ matchers = [ function( elem, context, xml ) {
+ return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
+ (checkContext = context).nodeType ?
+ matchContext( elem, context, xml ) :
+ matchAnyContext( elem, context, xml ) );
+ } ];
+
+ for ( ; i < len; i++ ) {
+ if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
+ matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
+ } else {
+ matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
+
+ // Return special upon seeing a positional matcher
+ if ( matcher[ expando ] ) {
+ // Find the next relative operator (if any) for proper handling
+ j = ++i;
+ for ( ; j < len; j++ ) {
+ if ( Expr.relative[ tokens[j].type ] ) {
+ break;
+ }
+ }
+ return setMatcher(
+ i > 1 && elementMatcher( matchers ),
+ i > 1 && toSelector(
+ // If the preceding token was a descendant combinator, insert an implicit any-element `*`
+ tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
+ ).replace( rtrim, "$1" ),
+ matcher,
+ i < j && matcherFromTokens( tokens.slice( i, j ) ),
+ j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
+ j < len && toSelector( tokens )
+ );
+ }
+ matchers.push( matcher );
+ }
+ }
+
+ return elementMatcher( matchers );
+}
+
+function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
+ // A counter to specify which element is currently being matched
+ var matcherCachedRuns = 0,
+ bySet = setMatchers.length > 0,
+ byElement = elementMatchers.length > 0,
+ superMatcher = function( seed, context, xml, results, expandContext ) {
+ var elem, j, matcher,
+ setMatched = [],
+ matchedCount = 0,
+ i = "0",
+ unmatched = seed && [],
+ outermost = expandContext != null,
+ contextBackup = outermostContext,
+ // We must always have either seed elements or context
+ elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ),
+ // Use integer dirruns iff this is the outermost matcher
+ dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1);
+
+ if ( outermost ) {
+ outermostContext = context !== document && context;
+ cachedruns = matcherCachedRuns;
+ }
+
+ // Add elements passing elementMatchers directly to results
+ // Keep `i` a string if there are no elements so `matchedCount` will be "00" below
+ for ( ; (elem = elems[i]) != null; i++ ) {
+ if ( byElement && elem ) {
+ j = 0;
+ while ( (matcher = elementMatchers[j++]) ) {
+ if ( matcher( elem, context, xml ) ) {
+ results.push( elem );
+ break;
+ }
+ }
+ if ( outermost ) {
+ dirruns = dirrunsUnique;
+ cachedruns = ++matcherCachedRuns;
+ }
+ }
+
+ // Track unmatched elements for set filters
+ if ( bySet ) {
+ // They will have gone through all possible matchers
+ if ( (elem = !matcher && elem) ) {
+ matchedCount--;
+ }
+
+ // Lengthen the array for every element, matched or not
+ if ( seed ) {
+ unmatched.push( elem );
+ }
+ }
+ }
+
+ // Apply set filters to unmatched elements
+ matchedCount += i;
+ if ( bySet && i !== matchedCount ) {
+ j = 0;
+ while ( (matcher = setMatchers[j++]) ) {
+ matcher( unmatched, setMatched, context, xml );
+ }
+
+ if ( seed ) {
+ // Reintegrate element matches to eliminate the need for sorting
+ if ( matchedCount > 0 ) {
+ while ( i-- ) {
+ if ( !(unmatched[i] || setMatched[i]) ) {
+ setMatched[i] = pop.call( results );
+ }
+ }
+ }
+
+ // Discard index placeholder values to get only actual matches
+ setMatched = condense( setMatched );
+ }
+
+ // Add matches to results
+ push.apply( results, setMatched );
+
+ // Seedless set matches succeeding multiple successful matchers stipulate sorting
+ if ( outermost && !seed && setMatched.length > 0 &&
+ ( matchedCount + setMatchers.length ) > 1 ) {
+
+ Sizzle.uniqueSort( results );
+ }
+ }
+
+ // Override manipulation of globals by nested matchers
+ if ( outermost ) {
+ dirruns = dirrunsUnique;
+ outermostContext = contextBackup;
+ }
+
+ return unmatched;
+ };
+
+ return bySet ?
+ markFunction( superMatcher ) :
+ superMatcher;
+}
+
+compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {
+ var i,
+ setMatchers = [],
+ elementMatchers = [],
+ cached = compilerCache[ selector + " " ];
+
+ if ( !cached ) {
+ // Generate a function of recursive functions that can be used to check each element
+ if ( !group ) {
+ group = tokenize( selector );
+ }
+ i = group.length;
+ while ( i-- ) {
+ cached = matcherFromTokens( group[i] );
+ if ( cached[ expando ] ) {
+ setMatchers.push( cached );
+ } else {
+ elementMatchers.push( cached );
+ }
+ }
+
+ // Cache the compiled function
+ cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
+ }
+ return cached;
+};
+
+function multipleContexts( selector, contexts, results ) {
+ var i = 0,
+ len = contexts.length;
+ for ( ; i < len; i++ ) {
+ Sizzle( selector, contexts[i], results );
+ }
+ return results;
+}
+
+function select( selector, context, results, seed ) {
+ var i, tokens, token, type, find,
+ match = tokenize( selector );
+
+ if ( !seed ) {
+ // Try to minimize operations if there is only one group
+ if ( match.length === 1 ) {
+
+ // Take a shortcut and set the context if the root selector is an ID
+ tokens = match[0] = match[0].slice( 0 );
+ if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
+ support.getById && context.nodeType === 9 && documentIsHTML &&
+ Expr.relative[ tokens[1].type ] ) {
+
+ context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
+ if ( !context ) {
+ return results;
+ }
+ selector = selector.slice( tokens.shift().value.length );
+ }
+
+ // Fetch a seed set for right-to-left matching
+ i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
+ while ( i-- ) {
+ token = tokens[i];
+
+ // Abort if we hit a combinator
+ if ( Expr.relative[ (type = token.type) ] ) {
+ break;
+ }
+ if ( (find = Expr.find[ type ]) ) {
+ // Search, expanding context for leading sibling combinators
+ if ( (seed = find(
+ token.matches[0].replace( runescape, funescape ),
+ rsibling.test( tokens[0].type ) && context.parentNode || context
+ )) ) {
+
+ // If seed is empty or no tokens remain, we can return early
+ tokens.splice( i, 1 );
+ selector = seed.length && toSelector( tokens );
+ if ( !selector ) {
+ push.apply( results, seed );
+ return results;
+ }
+
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ // Compile and execute a filtering function
+ // Provide `match` to avoid retokenization if we modified the selector above
+ compile( selector, match )(
+ seed,
+ context,
+ !documentIsHTML,
+ results,
+ rsibling.test( selector )
+ );
+ return results;
+}
+
+// One-time assignments
+
+// Sort stability
+support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
+
+// Support: Chrome<14
+// Always assume duplicates if they aren't passed to the comparison function
+support.detectDuplicates = hasDuplicate;
+
+// Initialize against the default document
+setDocument();
+
+// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
+// Detached nodes confoundingly follow *each other*
+support.sortDetached = assert(function( div1 ) {
+ // Should return 1, but returns 4 (following)
+ return div1.compareDocumentPosition( document.createElement("div") ) & 1;
+});
+
+// Support: IE<8
+// Prevent attribute/property "interpolation"
+// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
+if ( !assert(function( div ) {
+ div.innerHTML = "<a href='#'></a>";
+ return div.firstChild.getAttribute("href") === "#" ;
+}) ) {
+ addHandle( "type|href|height|width", function( elem, name, isXML ) {
+ if ( !isXML ) {
+ return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
+ }
+ });
+}
+
+// Support: IE<9
+// Use defaultValue in place of getAttribute("value")
+if ( !support.attributes || !assert(function( div ) {
+ div.innerHTML = "<input/>";
+ div.firstChild.setAttribute( "value", "" );
+ return div.firstChild.getAttribute( "value" ) === "";
+}) ) {
+ addHandle( "value", function( elem, name, isXML ) {
+ if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
+ return elem.defaultValue;
+ }
+ });
+}
+
+// Support: IE<9
+// Use getAttributeNode to fetch booleans when getAttribute lies
+if ( !assert(function( div ) {
+ return div.getAttribute("disabled") == null;
+}) ) {
+ addHandle( booleans, function( elem, name, isXML ) {
+ var val;
+ if ( !isXML ) {
+ return (val = elem.getAttributeNode( name )) && val.specified ?
+ val.value :
+ elem[ name ] === true ? name.toLowerCase() : null;
+ }
+ });
+}
+
+jQuery.find = Sizzle;
+jQuery.expr = Sizzle.selectors;
+jQuery.expr[":"] = jQuery.expr.pseudos;
+jQuery.unique = Sizzle.uniqueSort;
+jQuery.text = Sizzle.getText;
+jQuery.isXMLDoc = Sizzle.isXML;
+jQuery.contains = Sizzle.contains;
+
+
+})( window );
+// String to Object options format cache
+var optionsCache = {};
+
+// Convert String-formatted options into Object-formatted ones and store in cache
+function createOptions( options ) {
+ var object = optionsCache[ options ] = {};
+ jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {
+ object[ flag ] = true;
+ });
+ return object;
+}
+
+/*
+ * Create a callback list using the following parameters:
+ *
+ * options: an optional list of space-separated options that will change how
+ * the callback list behaves or a more traditional option object
+ *
+ * By default a callback list will act like an event callback list and can be
+ * "fired" multiple times.
+ *
+ * Possible options:
+ *
+ * once: will ensure the callback list can only be fired once (like a Deferred)
+ *
+ * memory: will keep track of previous values and will call any callback added
+ * after the list has been fired right away with the latest "memorized"
+ * values (like a Deferred)
+ *
+ * unique: will ensure a callback can only be added once (no duplicate in the list)
+ *
+ * stopOnFalse: interrupt callings when a callback returns false
+ *
+ */
+jQuery.Callbacks = function( options ) {
+
+ // Convert options from String-formatted to Object-formatted if needed
+ // (we check in cache first)
+ options = typeof options === "string" ?
+ ( optionsCache[ options ] || createOptions( options ) ) :
+ jQuery.extend( {}, options );
+
+ var // Last fire value (for non-forgettable lists)
+ memory,
+ // Flag to know if list was already fired
+ fired,
+ // Flag to know if list is currently firing
+ firing,
+ // First callback to fire (used internally by add and fireWith)
+ firingStart,
+ // End of the loop when firing
+ firingLength,
+ // Index of currently firing callback (modified by remove if needed)
+ firingIndex,
+ // Actual callback list
+ list = [],
+ // Stack of fire calls for repeatable lists
+ stack = !options.once && [],
+ // Fire callbacks
+ fire = function( data ) {
+ memory = options.memory && data;
+ fired = true;
+ firingIndex = firingStart || 0;
+ firingStart = 0;
+ firingLength = list.length;
+ firing = true;
+ for ( ; list && firingIndex < firingLength; firingIndex++ ) {
+ if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
+ memory = false; // To prevent further calls using add
+ break;
+ }
+ }
+ firing = false;
+ if ( list ) {
+ if ( stack ) {
+ if ( stack.length ) {
+ fire( stack.shift() );
+ }
+ } else if ( memory ) {
+ list = [];
+ } else {
+ self.disable();
+ }
+ }
+ },
+ // Actual Callbacks object
+ self = {
+ // Add a callback or a collection of callbacks to the list
+ add: function() {
+ if ( list ) {
+ // First, we save the current length
+ var start = list.length;
+ (function add( args ) {
+ jQuery.each( args, function( _, arg ) {
+ var type = jQuery.type( arg );
+ if ( type === "function" ) {
+ if ( !options.unique || !self.has( arg ) ) {
+ list.push( arg );
+ }
+ } else if ( arg && arg.length && type !== "string" ) {
+ // Inspect recursively
+ add( arg );
+ }
+ });
+ })( arguments );
+ // Do we need to add the callbacks to the
+ // current firing batch?
+ if ( firing ) {
+ firingLength = list.length;
+ // With memory, if we're not firing then
+ // we should call right away
+ } else if ( memory ) {
+ firingStart = start;
+ fire( memory );
+ }
+ }
+ return this;
+ },
+ // Remove a callback from the list
+ remove: function() {
+ if ( list ) {
+ jQuery.each( arguments, function( _, arg ) {
+ var index;
+ while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
+ list.splice( index, 1 );
+ // Handle firing indexes
+ if ( firing ) {
+ if ( index <= firingLength ) {
+ firingLength--;
+ }
+ if ( index <= firingIndex ) {
+ firingIndex--;
+ }
+ }
+ }
+ });
+ }
+ return this;
+ },
+ // Check if a given callback is in the list.
+ // If no argument is given, return whether or not list has callbacks attached.
+ has: function( fn ) {
+ return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
+ },
+ // Remove all callbacks from the list
+ empty: function() {
+ list = [];
+ firingLength = 0;
+ return this;
+ },
+ // Have the list do nothing anymore
+ disable: function() {
+ list = stack = memory = undefined;
+ return this;
+ },
+ // Is it disabled?
+ disabled: function() {
+ return !list;
+ },
+ // Lock the list in its current state
+ lock: function() {
+ stack = undefined;
+ if ( !memory ) {
+ self.disable();
+ }
+ return this;
+ },
+ // Is it locked?
+ locked: function() {
+ return !stack;
+ },
+ // Call all callbacks with the given context and arguments
+ fireWith: function( context, args ) {
+ if ( list && ( !fired || stack ) ) {
+ args = args || [];
+ args = [ context, args.slice ? args.slice() : args ];
+ if ( firing ) {
+ stack.push( args );
+ } else {
+ fire( args );
+ }
+ }
+ return this;
+ },
+ // Call all the callbacks with the given arguments
+ fire: function() {
+ self.fireWith( this, arguments );
+ return this;
+ },
+ // To know if the callbacks have already been called at least once
+ fired: function() {
+ return !!fired;
+ }
+ };
+
+ return self;
+};
+jQuery.extend({
+
+ Deferred: function( func ) {
+ var tuples = [
+ // action, add listener, listener list, final state
+ [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
+ [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
+ [ "notify", "progress", jQuery.Callbacks("memory") ]
+ ],
+ state = "pending",
+ promise = {
+ state: function() {
+ return state;
+ },
+ always: function() {
+ deferred.done( arguments ).fail( arguments );
+ return this;
+ },
+ then: function( /* fnDone, fnFail, fnProgress */ ) {
+ var fns = arguments;
+ return jQuery.Deferred(function( newDefer ) {
+ jQuery.each( tuples, function( i, tuple ) {
+ var action = tuple[ 0 ],
+ fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
+ // deferred[ done | fail | progress ] for forwarding actions to newDefer
+ deferred[ tuple[1] ](function() {
+ var returned = fn && fn.apply( this, arguments );
+ if ( returned && jQuery.isFunction( returned.promise ) ) {
+ returned.promise()
+ .done( newDefer.resolve )
+ .fail( newDefer.reject )
+ .progress( newDefer.notify );
+ } else {
+ newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
+ }
+ });
+ });
+ fns = null;
+ }).promise();
+ },
+ // Get a promise for this deferred
+ // If obj is provided, the promise aspect is added to the object
+ promise: function( obj ) {
+ return obj != null ? jQuery.extend( obj, promise ) : promise;
+ }
+ },
+ deferred = {};
+
+ // Keep pipe for back-compat
+ promise.pipe = promise.then;
+
+ // Add list-specific methods
+ jQuery.each( tuples, function( i, tuple ) {
+ var list = tuple[ 2 ],
+ stateString = tuple[ 3 ];
+
+ // promise[ done | fail | progress ] = list.add
+ promise[ tuple[1] ] = list.add;
+
+ // Handle state
+ if ( stateString ) {
+ list.add(function() {
+ // state = [ resolved | rejected ]
+ state = stateString;
+
+ // [ reject_list | resolve_list ].disable; progress_list.lock
+ }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
+ }
+
+ // deferred[ resolve | reject | notify ]
+ deferred[ tuple[0] ] = function() {
+ deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
+ return this;
+ };
+ deferred[ tuple[0] + "With" ] = list.fireWith;
+ });
+
+ // Make the deferred a promise
+ promise.promise( deferred );
+
+ // Call given func if any
+ if ( func ) {
+ func.call( deferred, deferred );
+ }
+
+ // All done!
+ return deferred;
+ },
+
+ // Deferred helper
+ when: function( subordinate /* , ..., subordinateN */ ) {
+ var i = 0,
+ resolveValues = core_slice.call( arguments ),
+ length = resolveValues.length,
+
+ // the count of uncompleted subordinates
+ remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
+
+ // the master Deferred. If resolveValues consist of only a single Deferred, just use that.
+ deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
+
+ // Update function for both resolve and progress values
+ updateFunc = function( i, contexts, values ) {
+ return function( value ) {
+ contexts[ i ] = this;
+ values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;
+ if( values === progressValues ) {
+ deferred.notifyWith( contexts, values );
+ } else if ( !( --remaining ) ) {
+ deferred.resolveWith( contexts, values );
+ }
+ };
+ },
+
+ progressValues, progressContexts, resolveContexts;
+
+ // add listeners to Deferred subordinates; treat others as resolved
+ if ( length > 1 ) {
+ progressValues = new Array( length );
+ progressContexts = new Array( length );
+ resolveContexts = new Array( length );
+ for ( ; i < length; i++ ) {
+ if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
+ resolveValues[ i ].promise()
+ .done( updateFunc( i, resolveContexts, resolveValues ) )
+ .fail( deferred.reject )
+ .progress( updateFunc( i, progressContexts, progressValues ) );
+ } else {
+ --remaining;
+ }
+ }
+ }
+
+ // if we're not waiting on anything, resolve the master
+ if ( !remaining ) {
+ deferred.resolveWith( resolveContexts, resolveValues );
+ }
+
+ return deferred.promise();
+ }
+});
+jQuery.support = (function( support ) {
+ var input = document.createElement("input"),
+ fragment = document.createDocumentFragment(),
+ div = document.createElement("div"),
+ select = document.createElement("select"),
+ opt = select.appendChild( document.createElement("option") );
+
+ // Finish early in limited environments
+ if ( !input.type ) {
+ return support;
+ }
+
+ input.type = "checkbox";
+
+ // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3
+ // Check the default checkbox/radio value ("" on old WebKit; "on" elsewhere)
+ support.checkOn = input.value !== "";
+
+ // Must access the parent to make an option select properly
+ // Support: IE9, IE10
+ support.optSelected = opt.selected;
+
+ // Will be defined later
+ support.reliableMarginRight = true;
+ support.boxSizingReliable = true;
+ support.pixelPosition = false;
+
+ // Make sure checked status is properly cloned
+ // Support: IE9, IE10
+ input.checked = true;
+ support.noCloneChecked = input.cloneNode( true ).checked;
+
+ // Make sure that the options inside disabled selects aren't marked as disabled
+ // (WebKit marks them as disabled)
+ select.disabled = true;
+ support.optDisabled = !opt.disabled;
+
+ // Check if an input maintains its value after becoming a radio
+ // Support: IE9, IE10
+ input = document.createElement("input");
+ input.value = "t";
+ input.type = "radio";
+ support.radioValue = input.value === "t";
+
+ // #11217 - WebKit loses check when the name is after the checked attribute
+ input.setAttribute( "checked", "t" );
+ input.setAttribute( "name", "t" );
+
+ fragment.appendChild( input );
+
+ // Support: Safari 5.1, Android 4.x, Android 2.3
+ // old WebKit doesn't clone checked state correctly in fragments
+ support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
+
+ // Support: Firefox, Chrome, Safari
+ // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP)
+ support.focusinBubbles = "onfocusin" in window;
+
+ div.style.backgroundClip = "content-box";
+ div.cloneNode( true ).style.backgroundClip = "";
+ support.clearCloneStyle = div.style.backgroundClip === "content-box";
+
+ // Run tests that need a body at doc ready
+ jQuery(function() {
+ var container, marginDiv,
+ // Support: Firefox, Android 2.3 (Prefixed box-sizing versions).
+ divReset = "padding:0;margin:0;border:0;display:block;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box",
+ body = document.getElementsByTagName("body")[ 0 ];
+
+ if ( !body ) {
+ // Return for frameset docs that don't have a body
+ return;
+ }
+
+ container = document.createElement("div");
+ container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px";
+
+ // Check box-sizing and margin behavior.
+ body.appendChild( container ).appendChild( div );
+ div.innerHTML = "";
+ // Support: Firefox, Android 2.3 (Prefixed box-sizing versions).
+ div.style.cssText = "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%";
+
+ // Workaround failing boxSizing test due to offsetWidth returning wrong value
+ // with some non-1 values of body zoom, ticket #13543
+ jQuery.swap( body, body.style.zoom != null ? { zoom: 1 } : {}, function() {
+ support.boxSizing = div.offsetWidth === 4;
+ });
+
+ // Use window.getComputedStyle because jsdom on node.js will break without it.
+ if ( window.getComputedStyle ) {
+ support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
+ support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
+
+ // Support: Android 2.3
+ // Check if div with explicit width and no margin-right incorrectly
+ // gets computed margin-right based on width of container. (#3333)
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
+ marginDiv = div.appendChild( document.createElement("div") );
+ marginDiv.style.cssText = div.style.cssText = divReset;
+ marginDiv.style.marginRight = marginDiv.style.width = "0";
+ div.style.width = "1px";
+
+ support.reliableMarginRight =
+ !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );
+ }
+
+ body.removeChild( container );
+ });
+
+ return support;
+})( {} );
+
+/*
+ Implementation Summary
+
+ 1. Enforce API surface and semantic compatibility with 1.9.x branch
+ 2. Improve the module's maintainability by reducing the storage
+ paths to a single mechanism.
+ 3. Use the same single mechanism to support "private" and "user" data.
+ 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
+ 5. Avoid exposing implementation details on user objects (eg. expando properties)
+ 6. Provide a clear path for implementation upgrade to WeakMap in 2014
+*/
+var data_user, data_priv,
+ rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
+ rmultiDash = /([A-Z])/g;
+
+function Data() {
+ // Support: Android < 4,
+ // Old WebKit does not have Object.preventExtensions/freeze method,
+ // return new empty object instead with no [[set]] accessor
+ Object.defineProperty( this.cache = {}, 0, {
+ get: function() {
+ return {};
+ }
+ });
+
+ this.expando = jQuery.expando + Math.random();
+}
+
+Data.uid = 1;
+
+Data.accepts = function( owner ) {
+ // Accepts only:
+ // - Node
+ // - Node.ELEMENT_NODE
+ // - Node.DOCUMENT_NODE
+ // - Object
+ // - Any
+ return owner.nodeType ?
+ owner.nodeType === 1 || owner.nodeType === 9 : true;
+};
+
+Data.prototype = {
+ key: function( owner ) {
+ // We can accept data for non-element nodes in modern browsers,
+ // but we should not, see #8335.
+ // Always return the key for a frozen object.
+ if ( !Data.accepts( owner ) ) {
+ return 0;
+ }
+
+ var descriptor = {},
+ // Check if the owner object already has a cache key
+ unlock = owner[ this.expando ];
+
+ // If not, create one
+ if ( !unlock ) {
+ unlock = Data.uid++;
+
+ // Secure it in a non-enumerable, non-writable property
+ try {
+ descriptor[ this.expando ] = { value: unlock };
+ Object.defineProperties( owner, descriptor );
+
+ // Support: Android < 4
+ // Fallback to a less secure definition
+ } catch ( e ) {
+ descriptor[ this.expando ] = unlock;
+ jQuery.extend( owner, descriptor );
+ }
+ }
+
+ // Ensure the cache object
+ if ( !this.cache[ unlock ] ) {
+ this.cache[ unlock ] = {};
+ }
+
+ return unlock;
+ },
+ set: function( owner, data, value ) {
+ var prop,
+ // There may be an unlock assigned to this node,
+ // if there is no entry for this "owner", create one inline
+ // and set the unlock as though an owner entry had always existed
+ unlock = this.key( owner ),
+ cache = this.cache[ unlock ];
+
+ // Handle: [ owner, key, value ] args
+ if ( typeof data === "string" ) {
+ cache[ data ] = value;
+
+ // Handle: [ owner, { properties } ] args
+ } else {
+ // Fresh assignments by object are shallow copied
+ if ( jQuery.isEmptyObject( cache ) ) {
+ jQuery.extend( this.cache[ unlock ], data );
+ // Otherwise, copy the properties one-by-one to the cache object
+ } else {
+ for ( prop in data ) {
+ cache[ prop ] = data[ prop ];
+ }
+ }
+ }
+ return cache;
+ },
+ get: function( owner, key ) {
+ // Either a valid cache is found, or will be created.
+ // New caches will be created and the unlock returned,
+ // allowing direct access to the newly created
+ // empty data object. A valid owner object must be provided.
+ var cache = this.cache[ this.key( owner ) ];
+
+ return key === undefined ?
+ cache : cache[ key ];
+ },
+ access: function( owner, key, value ) {
+ var stored;
+ // In cases where either:
+ //
+ // 1. No key was specified
+ // 2. A string key was specified, but no value provided
+ //
+ // Take the "read" path and allow the get method to determine
+ // which value to return, respectively either:
+ //
+ // 1. The entire cache object
+ // 2. The data stored at the key
+ //
+ if ( key === undefined ||
+ ((key && typeof key === "string") && value === undefined) ) {
+
+ stored = this.get( owner, key );
+
+ return stored !== undefined ?
+ stored : this.get( owner, jQuery.camelCase(key) );
+ }
+
+ // [*]When the key is not a string, or both a key and value
+ // are specified, set or extend (existing objects) with either:
+ //
+ // 1. An object of properties
+ // 2. A key and value
+ //
+ this.set( owner, key, value );
+
+ // Since the "set" path can have two possible entry points
+ // return the expected data based on which path was taken[*]
+ return value !== undefined ? value : key;
+ },
+ remove: function( owner, key ) {
+ var i, name, camel,
+ unlock = this.key( owner ),
+ cache = this.cache[ unlock ];
+
+ if ( key === undefined ) {
+ this.cache[ unlock ] = {};
+
+ } else {
+ // Support array or space separated string of keys
+ if ( jQuery.isArray( key ) ) {
+ // If "name" is an array of keys...
+ // When data is initially created, via ("key", "val") signature,
+ // keys will be converted to camelCase.
+ // Since there is no way to tell _how_ a key was added, remove
+ // both plain key and camelCase key. #12786
+ // This will only penalize the array argument path.
+ name = key.concat( key.map( jQuery.camelCase ) );
+ } else {
+ camel = jQuery.camelCase( key );
+ // Try the string as a key before any manipulation
+ if ( key in cache ) {
+ name = [ key, camel ];
+ } else {
+ // If a key with the spaces exists, use it.
+ // Otherwise, create an array by matching non-whitespace
+ name = camel;
+ name = name in cache ?
+ [ name ] : ( name.match( core_rnotwhite ) || [] );
+ }
+ }
+
+ i = name.length;
+ while ( i-- ) {
+ delete cache[ name[ i ] ];
+ }
+ }
+ },
+ hasData: function( owner ) {
+ return !jQuery.isEmptyObject(
+ this.cache[ owner[ this.expando ] ] || {}
+ );
+ },
+ discard: function( owner ) {
+ if ( owner[ this.expando ] ) {
+ delete this.cache[ owner[ this.expando ] ];
+ }
+ }
+};
+
+// These may be used throughout the jQuery core codebase
+data_user = new Data();
+data_priv = new Data();
+
+
+jQuery.extend({
+ acceptData: Data.accepts,
+
+ hasData: function( elem ) {
+ return data_user.hasData( elem ) || data_priv.hasData( elem );
+ },
+
+ data: function( elem, name, data ) {
+ return data_user.access( elem, name, data );
+ },
+
+ removeData: function( elem, name ) {
+ data_user.remove( elem, name );
+ },
+
+ // TODO: Now that all calls to _data and _removeData have been replaced
+ // with direct calls to data_priv methods, these can be deprecated.
+ _data: function( elem, name, data ) {
+ return data_priv.access( elem, name, data );
+ },
+
+ _removeData: function( elem, name ) {
+ data_priv.remove( elem, name );
+ }
+});
+
+jQuery.fn.extend({
+ data: function( key, value ) {
+ var attrs, name,
+ elem = this[ 0 ],
+ i = 0,
+ data = null;
+
+ // Gets all values
+ if ( key === undefined ) {
+ if ( this.length ) {
+ data = data_user.get( elem );
+
+ if ( elem.nodeType === 1 && !data_priv.get( elem, "hasDataAttrs" ) ) {
+ attrs = elem.attributes;
+ for ( ; i < attrs.length; i++ ) {
+ name = attrs[ i ].name;
+
+ if ( name.indexOf( "data-" ) === 0 ) {
+ name = jQuery.camelCase( name.slice(5) );
+ dataAttr( elem, name, data[ name ] );
+ }
+ }
+ data_priv.set( elem, "hasDataAttrs", true );
+ }
+ }
+
+ return data;
+ }
+
+ // Sets multiple values
+ if ( typeof key === "object" ) {
+ return this.each(function() {
+ data_user.set( this, key );
+ });
+ }
+
+ return jQuery.access( this, function( value ) {
+ var data,
+ camelKey = jQuery.camelCase( key );
+
+ // The calling jQuery object (element matches) is not empty
+ // (and therefore has an element appears at this[ 0 ]) and the
+ // `value` parameter was not undefined. An empty jQuery object
+ // will result in `undefined` for elem = this[ 0 ] which will
+ // throw an exception if an attempt to read a data cache is made.
+ if ( elem && value === undefined ) {
+ // Attempt to get data from the cache
+ // with the key as-is
+ data = data_user.get( elem, key );
+ if ( data !== undefined ) {
+ return data;
+ }
+
+ // Attempt to get data from the cache
+ // with the key camelized
+ data = data_user.get( elem, camelKey );
+ if ( data !== undefined ) {
+ return data;
+ }
+
+ // Attempt to "discover" the data in
+ // HTML5 custom data-* attrs
+ data = dataAttr( elem, camelKey, undefined );
+ if ( data !== undefined ) {
+ return data;
+ }
+
+ // We tried really hard, but the data doesn't exist.
+ return;
+ }
+
+ // Set the data...
+ this.each(function() {
+ // First, attempt to store a copy or reference of any
+ // data that might've been store with a camelCased key.
+ var data = data_user.get( this, camelKey );
+
+ // For HTML5 data-* attribute interop, we have to
+ // store property names with dashes in a camelCase form.
+ // This might not apply to all properties...*
+ data_user.set( this, camelKey, value );
+
+ // *... In the case of properties that might _actually_
+ // have dashes, we need to also store a copy of that
+ // unchanged property.
+ if ( key.indexOf("-") !== -1 && data !== undefined ) {
+ data_user.set( this, key, value );
+ }
+ });
+ }, null, value, arguments.length > 1, null, true );
+ },
+
+ removeData: function( key ) {
+ return this.each(function() {
+ data_user.remove( this, key );
+ });
+ }
+});
+
+function dataAttr( elem, key, data ) {
+ var name;
+
+ // If nothing was found internally, try to fetch any
+ // data from the HTML5 data-* attribute
+ if ( data === undefined && elem.nodeType === 1 ) {
+ name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
+ data = elem.getAttribute( name );
+
+ if ( typeof data === "string" ) {
+ try {
+ data = data === "true" ? true :
+ data === "false" ? false :
+ data === "null" ? null :
+ // Only convert to a number if it doesn't change the string
+ +data + "" === data ? +data :
+ rbrace.test( data ) ? JSON.parse( data ) :
+ data;
+ } catch( e ) {}
+
+ // Make sure we set the data so it isn't changed later
+ data_user.set( elem, key, data );
+ } else {
+ data = undefined;
+ }
+ }
+ return data;
+}
+jQuery.extend({
+ queue: function( elem, type, data ) {
+ var queue;
+
+ if ( elem ) {
+ type = ( type || "fx" ) + "queue";
+ queue = data_priv.get( elem, type );
+
+ // Speed up dequeue by getting out quickly if this is just a lookup
+ if ( data ) {
+ if ( !queue || jQuery.isArray( data ) ) {
+ queue = data_priv.access( elem, type, jQuery.makeArray(data) );
+ } else {
+ queue.push( data );
+ }
+ }
+ return queue || [];
+ }
+ },
+
+ dequeue: function( elem, type ) {
+ type = type || "fx";
+
+ var queue = jQuery.queue( elem, type ),
+ startLength = queue.length,
+ fn = queue.shift(),
+ hooks = jQuery._queueHooks( elem, type ),
+ next = function() {
+ jQuery.dequeue( elem, type );
+ };
+
+ // If the fx queue is dequeued, always remove the progress sentinel
+ if ( fn === "inprogress" ) {
+ fn = queue.shift();
+ startLength--;
+ }
+
+ if ( fn ) {
+
+ // Add a progress sentinel to prevent the fx queue from being
+ // automatically dequeued
+ if ( type === "fx" ) {
+ queue.unshift( "inprogress" );
+ }
+
+ // clear up the last queue stop function
+ delete hooks.stop;
+ fn.call( elem, next, hooks );
+ }
+
+ if ( !startLength && hooks ) {
+ hooks.empty.fire();
+ }
+ },
+
+ // not intended for public consumption - generates a queueHooks object, or returns the current one
+ _queueHooks: function( elem, type ) {
+ var key = type + "queueHooks";
+ return data_priv.get( elem, key ) || data_priv.access( elem, key, {
+ empty: jQuery.Callbacks("once memory").add(function() {
+ data_priv.remove( elem, [ type + "queue", key ] );
+ })
+ });
+ }
+});
+
+jQuery.fn.extend({
+ queue: function( type, data ) {
+ var setter = 2;
+
+ if ( typeof type !== "string" ) {
+ data = type;
+ type = "fx";
+ setter--;
+ }
+
+ if ( arguments.length < setter ) {
+ return jQuery.queue( this[0], type );
+ }
+
+ return data === undefined ?
+ this :
+ this.each(function() {
+ var queue = jQuery.queue( this, type, data );
+
+ // ensure a hooks for this queue
+ jQuery._queueHooks( this, type );
+
+ if ( type === "fx" && queue[0] !== "inprogress" ) {
+ jQuery.dequeue( this, type );
+ }
+ });
+ },
+ dequeue: function( type ) {
+ return this.each(function() {
+ jQuery.dequeue( this, type );
+ });
+ },
+ // Based off of the plugin by Clint Helfers, with permission.
+ // http://blindsignals.com/index.php/2009/07/jquery-delay/
+ delay: function( time, type ) {
+ time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
+ type = type || "fx";
+
+ return this.queue( type, function( next, hooks ) {
+ var timeout = setTimeout( next, time );
+ hooks.stop = function() {
+ clearTimeout( timeout );
+ };
+ });
+ },
+ clearQueue: function( type ) {
+ return this.queue( type || "fx", [] );
+ },
+ // Get a promise resolved when queues of a certain type
+ // are emptied (fx is the type by default)
+ promise: function( type, obj ) {
+ var tmp,
+ count = 1,
+ defer = jQuery.Deferred(),
+ elements = this,
+ i = this.length,
+ resolve = function() {
+ if ( !( --count ) ) {
+ defer.resolveWith( elements, [ elements ] );
+ }
+ };
+
+ if ( typeof type !== "string" ) {
+ obj = type;
+ type = undefined;
+ }
+ type = type || "fx";
+
+ while( i-- ) {
+ tmp = data_priv.get( elements[ i ], type + "queueHooks" );
+ if ( tmp && tmp.empty ) {
+ count++;
+ tmp.empty.add( resolve );
+ }
+ }
+ resolve();
+ return defer.promise( obj );
+ }
+});
+var nodeHook, boolHook,
+ rclass = /[\t\r\n\f]/g,
+ rreturn = /\r/g,
+ rfocusable = /^(?:input|select|textarea|button)$/i;
+
+jQuery.fn.extend({
+ attr: function( name, value ) {
+ return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
+ },
+
+ removeAttr: function( name ) {
+ return this.each(function() {
+ jQuery.removeAttr( this, name );
+ });
+ },
+
+ prop: function( name, value ) {
+ return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );
+ },
+
+ removeProp: function( name ) {
+ return this.each(function() {
+ delete this[ jQuery.propFix[ name ] || name ];
+ });
+ },
+
+ addClass: function( value ) {
+ var classes, elem, cur, clazz, j,
+ i = 0,
+ len = this.length,
+ proceed = typeof value === "string" && value;
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function( j ) {
+ jQuery( this ).addClass( value.call( this, j, this.className ) );
+ });
+ }
+
+ if ( proceed ) {
+ // The disjunction here is for better compressibility (see removeClass)
+ classes = ( value || "" ).match( core_rnotwhite ) || [];
+
+ for ( ; i < len; i++ ) {
+ elem = this[ i ];
+ cur = elem.nodeType === 1 && ( elem.className ?
+ ( " " + elem.className + " " ).replace( rclass, " " ) :
+ " "
+ );
+
+ if ( cur ) {
+ j = 0;
+ while ( (clazz = classes[j++]) ) {
+ if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
+ cur += clazz + " ";
+ }
+ }
+ elem.className = jQuery.trim( cur );
+
+ }
+ }
+ }
+
+ return this;
+ },
+
+ removeClass: function( value ) {
+ var classes, elem, cur, clazz, j,
+ i = 0,
+ len = this.length,
+ proceed = arguments.length === 0 || typeof value === "string" && value;
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function( j ) {
+ jQuery( this ).removeClass( value.call( this, j, this.className ) );
+ });
+ }
+ if ( proceed ) {
+ classes = ( value || "" ).match( core_rnotwhite ) || [];
+
+ for ( ; i < len; i++ ) {
+ elem = this[ i ];
+ // This expression is here for better compressibility (see addClass)
+ cur = elem.nodeType === 1 && ( elem.className ?
+ ( " " + elem.className + " " ).replace( rclass, " " ) :
+ ""
+ );
+
+ if ( cur ) {
+ j = 0;
+ while ( (clazz = classes[j++]) ) {
+ // Remove *all* instances
+ while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
+ cur = cur.replace( " " + clazz + " ", " " );
+ }
+ }
+ elem.className = value ? jQuery.trim( cur ) : "";
+ }
+ }
+ }
+
+ return this;
+ },
+
+ toggleClass: function( value, stateVal ) {
+ var type = typeof value;
+
+ if ( typeof stateVal === "boolean" && type === "string" ) {
+ return stateVal ? this.addClass( value ) : this.removeClass( value );
+ }
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function( i ) {
+ jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
+ });
+ }
+
+ return this.each(function() {
+ if ( type === "string" ) {
+ // toggle individual class names
+ var className,
+ i = 0,
+ self = jQuery( this ),
+ classNames = value.match( core_rnotwhite ) || [];
+
+ while ( (className = classNames[ i++ ]) ) {
+ // check each className given, space separated list
+ if ( self.hasClass( className ) ) {
+ self.removeClass( className );
+ } else {
+ self.addClass( className );
+ }
+ }
+
+ // Toggle whole class name
+ } else if ( type === core_strundefined || type === "boolean" ) {
+ if ( this.className ) {
+ // store className if set
+ data_priv.set( this, "__className__", this.className );
+ }
+
+ // If the element has a class name or if we're passed "false",
+ // then remove the whole classname (if there was one, the above saved it).
+ // Otherwise bring back whatever was previously saved (if anything),
+ // falling back to the empty string if nothing was stored.
+ this.className = this.className || value === false ? "" : data_priv.get( this, "__className__" ) || "";
+ }
+ });
+ },
+
+ hasClass: function( selector ) {
+ var className = " " + selector + " ",
+ i = 0,
+ l = this.length;
+ for ( ; i < l; i++ ) {
+ if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
+ return true;
+ }
+ }
+
+ return false;
+ },
+
+ val: function( value ) {
+ var hooks, ret, isFunction,
+ elem = this[0];
+
+ if ( !arguments.length ) {
+ if ( elem ) {
+ hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
+
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
+ return ret;
+ }
+
+ ret = elem.value;
+
+ return typeof ret === "string" ?
+ // handle most common string cases
+ ret.replace(rreturn, "") :
+ // handle cases where value is null/undef or number
+ ret == null ? "" : ret;
+ }
+
+ return;
+ }
+
+ isFunction = jQuery.isFunction( value );
+
+ return this.each(function( i ) {
+ var val;
+
+ if ( this.nodeType !== 1 ) {
+ return;
+ }
+
+ if ( isFunction ) {
+ val = value.call( this, i, jQuery( this ).val() );
+ } else {
+ val = value;
+ }
+
+ // Treat null/undefined as ""; convert numbers to string
+ if ( val == null ) {
+ val = "";
+ } else if ( typeof val === "number" ) {
+ val += "";
+ } else if ( jQuery.isArray( val ) ) {
+ val = jQuery.map(val, function ( value ) {
+ return value == null ? "" : value + "";
+ });
+ }
+
+ hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
+
+ // If set returns undefined, fall back to normal setting
+ if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
+ this.value = val;
+ }
+ });
+ }
+});
+
+jQuery.extend({
+ valHooks: {
+ option: {
+ get: function( elem ) {
+ // attributes.value is undefined in Blackberry 4.7 but
+ // uses .value. See #6932
+ var val = elem.attributes.value;
+ return !val || val.specified ? elem.value : elem.text;
+ }
+ },
+ select: {
+ get: function( elem ) {
+ var value, option,
+ options = elem.options,
+ index = elem.selectedIndex,
+ one = elem.type === "select-one" || index < 0,
+ values = one ? null : [],
+ max = one ? index + 1 : options.length,
+ i = index < 0 ?
+ max :
+ one ? index : 0;
+
+ // Loop through all the selected options
+ for ( ; i < max; i++ ) {
+ option = options[ i ];
+
+ // IE6-9 doesn't update selected after form reset (#2551)
+ if ( ( option.selected || i === index ) &&
+ // Don't return options that are disabled or in a disabled optgroup
+ ( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) &&
+ ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
+
+ // Get the specific value for the option
+ value = jQuery( option ).val();
+
+ // We don't need an array for one selects
+ if ( one ) {
+ return value;
+ }
+
+ // Multi-Selects return an array
+ values.push( value );
+ }
+ }
+
+ return values;
+ },
+
+ set: function( elem, value ) {
+ var optionSet, option,
+ options = elem.options,
+ values = jQuery.makeArray( value ),
+ i = options.length;
+
+ while ( i-- ) {
+ option = options[ i ];
+ if ( (option.selected = jQuery.inArray( jQuery(option).val(), values ) >= 0) ) {
+ optionSet = true;
+ }
+ }
+
+ // force browsers to behave consistently when non-matching value is set
+ if ( !optionSet ) {
+ elem.selectedIndex = -1;
+ }
+ return values;
+ }
+ }
+ },
+
+ attr: function( elem, name, value ) {
+ var hooks, ret,
+ nType = elem.nodeType;
+
+ // don't get/set attributes on text, comment and attribute nodes
+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
+ return;
+ }
+
+ // Fallback to prop when attributes are not supported
+ if ( typeof elem.getAttribute === core_strundefined ) {
+ return jQuery.prop( elem, name, value );
+ }
+
+ // All attributes are lowercase
+ // Grab necessary hook if one is defined
+ if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
+ name = name.toLowerCase();
+ hooks = jQuery.attrHooks[ name ] ||
+ ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );
+ }
+
+ if ( value !== undefined ) {
+
+ if ( value === null ) {
+ jQuery.removeAttr( elem, name );
+
+ } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
+ return ret;
+
+ } else {
+ elem.setAttribute( name, value + "" );
+ return value;
+ }
+
+ } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
+ return ret;
+
+ } else {
+ ret = jQuery.find.attr( elem, name );
+
+ // Non-existent attributes return null, we normalize to undefined
+ return ret == null ?
+ undefined :
+ ret;
+ }
+ },
+
+ removeAttr: function( elem, value ) {
+ var name, propName,
+ i = 0,
+ attrNames = value && value.match( core_rnotwhite );
+
+ if ( attrNames && elem.nodeType === 1 ) {
+ while ( (name = attrNames[i++]) ) {
+ propName = jQuery.propFix[ name ] || name;
+
+ // Boolean attributes get special treatment (#10870)
+ if ( jQuery.expr.match.bool.test( name ) ) {
+ // Set corresponding property to false
+ elem[ propName ] = false;
+ }
+
+ elem.removeAttribute( name );
+ }
+ }
+ },
+
+ attrHooks: {
+ type: {
+ set: function( elem, value ) {
+ if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
+ // Setting the type on a radio button after the value resets the value in IE6-9
+ // Reset value to default in case type is set after value during creation
+ var val = elem.value;
+ elem.setAttribute( "type", value );
+ if ( val ) {
+ elem.value = val;
+ }
+ return value;
+ }
+ }
+ }
+ },
+
+ propFix: {
+ "for": "htmlFor",
+ "class": "className"
+ },
+
+ prop: function( elem, name, value ) {
+ var ret, hooks, notxml,
+ nType = elem.nodeType;
+
+ // don't get/set properties on text, comment and attribute nodes
+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
+ return;
+ }
+
+ notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
+
+ if ( notxml ) {
+ // Fix name and attach hooks
+ name = jQuery.propFix[ name ] || name;
+ hooks = jQuery.propHooks[ name ];
+ }
+
+ if ( value !== undefined ) {
+ return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ?
+ ret :
+ ( elem[ name ] = value );
+
+ } else {
+ return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ?
+ ret :
+ elem[ name ];
+ }
+ },
+
+ propHooks: {
+ tabIndex: {
+ get: function( elem ) {
+ return elem.hasAttribute( "tabindex" ) || rfocusable.test( elem.nodeName ) || elem.href ?
+ elem.tabIndex :
+ -1;
+ }
+ }
+ }
+});
+
+// Hooks for boolean attributes
+boolHook = {
+ set: function( elem, value, name ) {
+ if ( value === false ) {
+ // Remove boolean attributes when set to false
+ jQuery.removeAttr( elem, name );
+ } else {
+ elem.setAttribute( name, name );
+ }
+ return name;
+ }
+};
+jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
+ var getter = jQuery.expr.attrHandle[ name ] || jQuery.find.attr;
+
+ jQuery.expr.attrHandle[ name ] = function( elem, name, isXML ) {
+ var fn = jQuery.expr.attrHandle[ name ],
+ ret = isXML ?
+ undefined :
+ /* jshint eqeqeq: false */
+ // Temporarily disable this handler to check existence
+ (jQuery.expr.attrHandle[ name ] = undefined) !=
+ getter( elem, name, isXML ) ?
+
+ name.toLowerCase() :
+ null;
+
+ // Restore handler
+ jQuery.expr.attrHandle[ name ] = fn;
+
+ return ret;
+ };
+});
+
+// Support: IE9+
+// Selectedness for an option in an optgroup can be inaccurate
+if ( !jQuery.support.optSelected ) {
+ jQuery.propHooks.selected = {
+ get: function( elem ) {
+ var parent = elem.parentNode;
+ if ( parent && parent.parentNode ) {
+ parent.parentNode.selectedIndex;
+ }
+ return null;
+ }
+ };
+}
+
+jQuery.each([
+ "tabIndex",
+ "readOnly",
+ "maxLength",
+ "cellSpacing",
+ "cellPadding",
+ "rowSpan",
+ "colSpan",
+ "useMap",
+ "frameBorder",
+ "contentEditable"
+], function() {
+ jQuery.propFix[ this.toLowerCase() ] = this;
+});
+
+// Radios and checkboxes getter/setter
+jQuery.each([ "radio", "checkbox" ], function() {
+ jQuery.valHooks[ this ] = {
+ set: function( elem, value ) {
+ if ( jQuery.isArray( value ) ) {
+ return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
+ }
+ }
+ };
+ if ( !jQuery.support.checkOn ) {
+ jQuery.valHooks[ this ].get = function( elem ) {
+ // Support: Webkit
+ // "" is returned instead of "on" if a value isn't specified
+ return elem.getAttribute("value") === null ? "on" : elem.value;
+ };
+ }
+});
+var rkeyEvent = /^key/,
+ rmouseEvent = /^(?:mouse|contextmenu)|click/,
+ rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
+ rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
+
+function returnTrue() {
+ return true;
+}
+
+function returnFalse() {
+ return false;
+}
+
+function safeActiveElement() {
+ try {
+ return document.activeElement;
+ } catch ( err ) { }
+}
+
+/*
+ * Helper functions for managing events -- not part of the public interface.
+ * Props to Dean Edwards' addEvent library for many of the ideas.
+ */
+jQuery.event = {
+
+ global: {},
+
+ add: function( elem, types, handler, data, selector ) {
+
+ var handleObjIn, eventHandle, tmp,
+ events, t, handleObj,
+ special, handlers, type, namespaces, origType,
+ elemData = data_priv.get( elem );
+
+ // Don't attach events to noData or text/comment nodes (but allow plain objects)
+ if ( !elemData ) {
+ return;
+ }
+
+ // Caller can pass in an object of custom data in lieu of the handler
+ if ( handler.handler ) {
+ handleObjIn = handler;
+ handler = handleObjIn.handler;
+ selector = handleObjIn.selector;
+ }
+
+ // Make sure that the handler has a unique ID, used to find/remove it later
+ if ( !handler.guid ) {
+ handler.guid = jQuery.guid++;
+ }
+
+ // Init the element's event structure and main handler, if this is the first
+ if ( !(events = elemData.events) ) {
+ events = elemData.events = {};
+ }
+ if ( !(eventHandle = elemData.handle) ) {
+ eventHandle = elemData.handle = function( e ) {
+ // Discard the second event of a jQuery.event.trigger() and
+ // when an event is called after a page has unloaded
+ return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ?
+ jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
+ undefined;
+ };
+ // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
+ eventHandle.elem = elem;
+ }
+
+ // Handle multiple events separated by a space
+ types = ( types || "" ).match( core_rnotwhite ) || [""];
+ t = types.length;
+ while ( t-- ) {
+ tmp = rtypenamespace.exec( types[t] ) || [];
+ type = origType = tmp[1];
+ namespaces = ( tmp[2] || "" ).split( "." ).sort();
+
+ // There *must* be a type, no attaching namespace-only handlers
+ if ( !type ) {
+ continue;
+ }
+
+ // If event changes its type, use the special event handlers for the changed type
+ special = jQuery.event.special[ type ] || {};
+
+ // If selector defined, determine special event api type, otherwise given type
+ type = ( selector ? special.delegateType : special.bindType ) || type;
+
+ // Update special based on newly reset type
+ special = jQuery.event.special[ type ] || {};
+
+ // handleObj is passed to all event handlers
+ handleObj = jQuery.extend({
+ type: type,
+ origType: origType,
+ data: data,
+ handler: handler,
+ guid: handler.guid,
+ selector: selector,
+ needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
+ namespace: namespaces.join(".")
+ }, handleObjIn );
+
+ // Init the event handler queue if we're the first
+ if ( !(handlers = events[ type ]) ) {
+ handlers = events[ type ] = [];
+ handlers.delegateCount = 0;
+
+ // Only use addEventListener if the special events handler returns false
+ if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
+ if ( elem.addEventListener ) {
+ elem.addEventListener( type, eventHandle, false );
+ }
+ }
+ }
+
+ if ( special.add ) {
+ special.add.call( elem, handleObj );
+
+ if ( !handleObj.handler.guid ) {
+ handleObj.handler.guid = handler.guid;
+ }
+ }
+
+ // Add to the element's handler list, delegates in front
+ if ( selector ) {
+ handlers.splice( handlers.delegateCount++, 0, handleObj );
+ } else {
+ handlers.push( handleObj );
+ }
+
+ // Keep track of which events have ever been used, for event optimization
+ jQuery.event.global[ type ] = true;
+ }
+
+ // Nullify elem to prevent memory leaks in IE
+ elem = null;
+ },
+
+ // Detach an event or set of events from an element
+ remove: function( elem, types, handler, selector, mappedTypes ) {
+
+ var j, origCount, tmp,
+ events, t, handleObj,
+ special, handlers, type, namespaces, origType,
+ elemData = data_priv.hasData( elem ) && data_priv.get( elem );
+
+ if ( !elemData || !(events = elemData.events) ) {
+ return;
+ }
+
+ // Once for each type.namespace in types; type may be omitted
+ types = ( types || "" ).match( core_rnotwhite ) || [""];
+ t = types.length;
+ while ( t-- ) {
+ tmp = rtypenamespace.exec( types[t] ) || [];
+ type = origType = tmp[1];
+ namespaces = ( tmp[2] || "" ).split( "." ).sort();
+
+ // Unbind all events (on this namespace, if provided) for the element
+ if ( !type ) {
+ for ( type in events ) {
+ jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
+ }
+ continue;
+ }
+
+ special = jQuery.event.special[ type ] || {};
+ type = ( selector ? special.delegateType : special.bindType ) || type;
+ handlers = events[ type ] || [];
+ tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );
+
+ // Remove matching events
+ origCount = j = handlers.length;
+ while ( j-- ) {
+ handleObj = handlers[ j ];
+
+ if ( ( mappedTypes || origType === handleObj.origType ) &&
+ ( !handler || handler.guid === handleObj.guid ) &&
+ ( !tmp || tmp.test( handleObj.namespace ) ) &&
+ ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
+ handlers.splice( j, 1 );
+
+ if ( handleObj.selector ) {
+ handlers.delegateCount--;
+ }
+ if ( special.remove ) {
+ special.remove.call( elem, handleObj );
+ }
+ }
+ }
+
+ // Remove generic event handler if we removed something and no more handlers exist
+ // (avoids potential for endless recursion during removal of special event handlers)
+ if ( origCount && !handlers.length ) {
+ if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
+ jQuery.removeEvent( elem, type, elemData.handle );
+ }
+
+ delete events[ type ];
+ }
+ }
+
+ // Remove the expando if it's no longer used
+ if ( jQuery.isEmptyObject( events ) ) {
+ delete elemData.handle;
+ data_priv.remove( elem, "events" );
+ }
+ },
+
+ trigger: function( event, data, elem, onlyHandlers ) {
+
+ var i, cur, tmp, bubbleType, ontype, handle, special,
+ eventPath = [ elem || document ],
+ type = core_hasOwn.call( event, "type" ) ? event.type : event,
+ namespaces = core_hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];
+
+ cur = tmp = elem = elem || document;
+
+ // Don't do events on text and comment nodes
+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return;
+ }
+
+ // focus/blur morphs to focusin/out; ensure we're not firing them right now
+ if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
+ return;
+ }
+
+ if ( type.indexOf(".") >= 0 ) {
+ // Namespaced trigger; create a regexp to match event type in handle()
+ namespaces = type.split(".");
+ type = namespaces.shift();
+ namespaces.sort();
+ }
+ ontype = type.indexOf(":") < 0 && "on" + type;
+
+ // Caller can pass in a jQuery.Event object, Object, or just an event type string
+ event = event[ jQuery.expando ] ?
+ event :
+ new jQuery.Event( type, typeof event === "object" && event );
+
+ // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
+ event.isTrigger = onlyHandlers ? 2 : 3;
+ event.namespace = namespaces.join(".");
+ event.namespace_re = event.namespace ?
+ new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
+ null;
+
+ // Clean up the event in case it is being reused
+ event.result = undefined;
+ if ( !event.target ) {
+ event.target = elem;
+ }
+
+ // Clone any incoming data and prepend the event, creating the handler arg list
+ data = data == null ?
+ [ event ] :
+ jQuery.makeArray( data, [ event ] );
+
+ // Allow special events to draw outside the lines
+ special = jQuery.event.special[ type ] || {};
+ if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
+ return;
+ }
+
+ // Determine event propagation path in advance, per W3C events spec (#9951)
+ // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
+ if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
+
+ bubbleType = special.delegateType || type;
+ if ( !rfocusMorph.test( bubbleType + type ) ) {
+ cur = cur.parentNode;
+ }
+ for ( ; cur; cur = cur.parentNode ) {
+ eventPath.push( cur );
+ tmp = cur;
+ }
+
+ // Only add window if we got to document (e.g., not plain obj or detached DOM)
+ if ( tmp === (elem.ownerDocument || document) ) {
+ eventPath.push( tmp.defaultView || tmp.parentWindow || window );
+ }
+ }
+
+ // Fire handlers on the event path
+ i = 0;
+ while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
+
+ event.type = i > 1 ?
+ bubbleType :
+ special.bindType || type;
+
+ // jQuery handler
+ handle = ( data_priv.get( cur, "events" ) || {} )[ event.type ] && data_priv.get( cur, "handle" );
+ if ( handle ) {
+ handle.apply( cur, data );
+ }
+
+ // Native handler
+ handle = ontype && cur[ ontype ];
+ if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) {
+ event.preventDefault();
+ }
+ }
+ event.type = type;
+
+ // If nobody prevented the default action, do it now
+ if ( !onlyHandlers && !event.isDefaultPrevented() ) {
+
+ if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) &&
+ jQuery.acceptData( elem ) ) {
+
+ // Call a native DOM method on the target with the same name name as the event.
+ // Don't do default actions on window, that's where global variables be (#6170)
+ if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) {
+
+ // Don't re-trigger an onFOO event when we call its FOO() method
+ tmp = elem[ ontype ];
+
+ if ( tmp ) {
+ elem[ ontype ] = null;
+ }
+
+ // Prevent re-triggering of the same event, since we already bubbled it above
+ jQuery.event.triggered = type;
+ elem[ type ]();
+ jQuery.event.triggered = undefined;
+
+ if ( tmp ) {
+ elem[ ontype ] = tmp;
+ }
+ }
+ }
+ }
+
+ return event.result;
+ },
+
+ dispatch: function( event ) {
+
+ // Make a writable jQuery.Event from the native event object
+ event = jQuery.event.fix( event );
+
+ var i, j, ret, matched, handleObj,
+ handlerQueue = [],
+ args = core_slice.call( arguments ),
+ handlers = ( data_priv.get( this, "events" ) || {} )[ event.type ] || [],
+ special = jQuery.event.special[ event.type ] || {};
+
+ // Use the fix-ed jQuery.Event rather than the (read-only) native event
+ args[0] = event;
+ event.delegateTarget = this;
+
+ // Call the preDispatch hook for the mapped type, and let it bail if desired
+ if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
+ return;
+ }
+
+ // Determine handlers
+ handlerQueue = jQuery.event.handlers.call( this, event, handlers );
+
+ // Run delegates first; they may want to stop propagation beneath us
+ i = 0;
+ while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
+ event.currentTarget = matched.elem;
+
+ j = 0;
+ while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {
+
+ // Triggered event must either 1) have no namespace, or
+ // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
+ if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {
+
+ event.handleObj = handleObj;
+ event.data = handleObj.data;
+
+ ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
+ .apply( matched.elem, args );
+
+ if ( ret !== undefined ) {
+ if ( (event.result = ret) === false ) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ }
+ }
+ }
+ }
+
+ // Call the postDispatch hook for the mapped type
+ if ( special.postDispatch ) {
+ special.postDispatch.call( this, event );
+ }
+
+ return event.result;
+ },
+
+ handlers: function( event, handlers ) {
+ var i, matches, sel, handleObj,
+ handlerQueue = [],
+ delegateCount = handlers.delegateCount,
+ cur = event.target;
+
+ // Find delegate handlers
+ // Black-hole SVG <use> instance trees (#13180)
+ // Avoid non-left-click bubbling in Firefox (#3861)
+ if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {
+
+ for ( ; cur !== this; cur = cur.parentNode || this ) {
+
+ // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
+ if ( cur.disabled !== true || event.type !== "click" ) {
+ matches = [];
+ for ( i = 0; i < delegateCount; i++ ) {
+ handleObj = handlers[ i ];
+
+ // Don't conflict with Object.prototype properties (#13203)
+ sel = handleObj.selector + " ";
+
+ if ( matches[ sel ] === undefined ) {
+ matches[ sel ] = handleObj.needsContext ?
+ jQuery( sel, this ).index( cur ) >= 0 :
+ jQuery.find( sel, this, null, [ cur ] ).length;
+ }
+ if ( matches[ sel ] ) {
+ matches.push( handleObj );
+ }
+ }
+ if ( matches.length ) {
+ handlerQueue.push({ elem: cur, handlers: matches });
+ }
+ }
+ }
+ }
+
+ // Add the remaining (directly-bound) handlers
+ if ( delegateCount < handlers.length ) {
+ handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });
+ }
+
+ return handlerQueue;
+ },
+
+ // Includes some event props shared by KeyEvent and MouseEvent
+ props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
+
+ fixHooks: {},
+
+ keyHooks: {
+ props: "char charCode key keyCode".split(" "),
+ filter: function( event, original ) {
+
+ // Add which for key events
+ if ( event.which == null ) {
+ event.which = original.charCode != null ? original.charCode : original.keyCode;
+ }
+
+ return event;
+ }
+ },
+
+ mouseHooks: {
+ props: "button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
+ filter: function( event, original ) {
+ var eventDoc, doc, body,
+ button = original.button;
+
+ // Calculate pageX/Y if missing and clientX/Y available
+ if ( event.pageX == null && original.clientX != null ) {
+ eventDoc = event.target.ownerDocument || document;
+ doc = eventDoc.documentElement;
+ body = eventDoc.body;
+
+ event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
+ event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
+ }
+
+ // Add which for click: 1 === left; 2 === middle; 3 === right
+ // Note: button is not normalized, so don't use it
+ if ( !event.which && button !== undefined ) {
+ event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
+ }
+
+ return event;
+ }
+ },
+
+ fix: function( event ) {
+ if ( event[ jQuery.expando ] ) {
+ return event;
+ }
+
+ // Create a writable copy of the event object and normalize some properties
+ var i, prop, copy,
+ type = event.type,
+ originalEvent = event,
+ fixHook = this.fixHooks[ type ];
+
+ if ( !fixHook ) {
+ this.fixHooks[ type ] = fixHook =
+ rmouseEvent.test( type ) ? this.mouseHooks :
+ rkeyEvent.test( type ) ? this.keyHooks :
+ {};
+ }
+ copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
+
+ event = new jQuery.Event( originalEvent );
+
+ i = copy.length;
+ while ( i-- ) {
+ prop = copy[ i ];
+ event[ prop ] = originalEvent[ prop ];
+ }
+
+ // Support: Cordova 2.5 (WebKit) (#13255)
+ // All events should have a target; Cordova deviceready doesn't
+ if ( !event.target ) {
+ event.target = document;
+ }
+
+ // Support: Safari 6.0+, Chrome < 28
+ // Target should not be a text node (#504, #13143)
+ if ( event.target.nodeType === 3 ) {
+ event.target = event.target.parentNode;
+ }
+
+ return fixHook.filter? fixHook.filter( event, originalEvent ) : event;
+ },
+
+ special: {
+ load: {
+ // Prevent triggered image.load events from bubbling to window.load
+ noBubble: true
+ },
+ focus: {
+ // Fire native event if possible so blur/focus sequence is correct
+ trigger: function() {
+ if ( this !== safeActiveElement() && this.focus ) {
+ this.focus();
+ return false;
+ }
+ },
+ delegateType: "focusin"
+ },
+ blur: {
+ trigger: function() {
+ if ( this === safeActiveElement() && this.blur ) {
+ this.blur();
+ return false;
+ }
+ },
+ delegateType: "focusout"
+ },
+ click: {
+ // For checkbox, fire native event so checked state will be right
+ trigger: function() {
+ if ( this.type === "checkbox" && this.click && jQuery.nodeName( this, "input" ) ) {
+ this.click();
+ return false;
+ }
+ },
+
+ // For cross-browser consistency, don't fire native .click() on links
+ _default: function( event ) {
+ return jQuery.nodeName( event.target, "a" );
+ }
+ },
+
+ beforeunload: {
+ postDispatch: function( event ) {
+
+ // Support: Firefox 20+
+ // Firefox doesn't alert if the returnValue field is not set.
+ if ( event.result !== undefined ) {
+ event.originalEvent.returnValue = event.result;
+ }
+ }
+ }
+ },
+
+ simulate: function( type, elem, event, bubble ) {
+ // Piggyback on a donor event to simulate a different one.
+ // Fake originalEvent to avoid donor's stopPropagation, but if the
+ // simulated event prevents default then we do the same on the donor.
+ var e = jQuery.extend(
+ new jQuery.Event(),
+ event,
+ {
+ type: type,
+ isSimulated: true,
+ originalEvent: {}
+ }
+ );
+ if ( bubble ) {
+ jQuery.event.trigger( e, null, elem );
+ } else {
+ jQuery.event.dispatch.call( elem, e );
+ }
+ if ( e.isDefaultPrevented() ) {
+ event.preventDefault();
+ }
+ }
+};
+
+jQuery.removeEvent = function( elem, type, handle ) {
+ if ( elem.removeEventListener ) {
+ elem.removeEventListener( type, handle, false );
+ }
+};
+
+jQuery.Event = function( src, props ) {
+ // Allow instantiation without the 'new' keyword
+ if ( !(this instanceof jQuery.Event) ) {
+ return new jQuery.Event( src, props );
+ }
+
+ // Event object
+ if ( src && src.type ) {
+ this.originalEvent = src;
+ this.type = src.type;
+
+ // Events bubbling up the document may have been marked as prevented
+ // by a handler lower down the tree; reflect the correct value.
+ this.isDefaultPrevented = ( src.defaultPrevented ||
+ src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;
+
+ // Event type
+ } else {
+ this.type = src;
+ }
+
+ // Put explicitly provided properties onto the event object
+ if ( props ) {
+ jQuery.extend( this, props );
+ }
+
+ // Create a timestamp if incoming event doesn't have one
+ this.timeStamp = src && src.timeStamp || jQuery.now();
+
+ // Mark it as fixed
+ this[ jQuery.expando ] = true;
+};
+
+// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
+// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
+jQuery.Event.prototype = {
+ isDefaultPrevented: returnFalse,
+ isPropagationStopped: returnFalse,
+ isImmediatePropagationStopped: returnFalse,
+
+ preventDefault: function() {
+ var e = this.originalEvent;
+
+ this.isDefaultPrevented = returnTrue;
+
+ if ( e && e.preventDefault ) {
+ e.preventDefault();
+ }
+ },
+ stopPropagation: function() {
+ var e = this.originalEvent;
+
+ this.isPropagationStopped = returnTrue;
+
+ if ( e && e.stopPropagation ) {
+ e.stopPropagation();
+ }
+ },
+ stopImmediatePropagation: function() {
+ this.isImmediatePropagationStopped = returnTrue;
+ this.stopPropagation();
+ }
+};
+
+// Create mouseenter/leave events using mouseover/out and event-time checks
+// Support: Chrome 15+
+jQuery.each({
+ mouseenter: "mouseover",
+ mouseleave: "mouseout"
+}, function( orig, fix ) {
+ jQuery.event.special[ orig ] = {
+ delegateType: fix,
+ bindType: fix,
+
+ handle: function( event ) {
+ var ret,
+ target = this,
+ related = event.relatedTarget,
+ handleObj = event.handleObj;
+
+ // For mousenter/leave call the handler if related is outside the target.
+ // NB: No relatedTarget if the mouse left/entered the browser window
+ if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
+ event.type = handleObj.origType;
+ ret = handleObj.handler.apply( this, arguments );
+ event.type = fix;
+ }
+ return ret;
+ }
+ };
+});
+
+// Create "bubbling" focus and blur events
+// Support: Firefox, Chrome, Safari
+if ( !jQuery.support.focusinBubbles ) {
+ jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
+
+ // Attach a single capturing handler while someone wants focusin/focusout
+ var attaches = 0,
+ handler = function( event ) {
+ jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
+ };
+
+ jQuery.event.special[ fix ] = {
+ setup: function() {
+ if ( attaches++ === 0 ) {
+ document.addEventListener( orig, handler, true );
+ }
+ },
+ teardown: function() {
+ if ( --attaches === 0 ) {
+ document.removeEventListener( orig, handler, true );
+ }
+ }
+ };
+ });
+}
+
+jQuery.fn.extend({
+
+ on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
+ var origFn, type;
+
+ // Types can be a map of types/handlers
+ if ( typeof types === "object" ) {
+ // ( types-Object, selector, data )
+ if ( typeof selector !== "string" ) {
+ // ( types-Object, data )
+ data = data || selector;
+ selector = undefined;
+ }
+ for ( type in types ) {
+ this.on( type, selector, data, types[ type ], one );
+ }
+ return this;
+ }
+
+ if ( data == null && fn == null ) {
+ // ( types, fn )
+ fn = selector;
+ data = selector = undefined;
+ } else if ( fn == null ) {
+ if ( typeof selector === "string" ) {
+ // ( types, selector, fn )
+ fn = data;
+ data = undefined;
+ } else {
+ // ( types, data, fn )
+ fn = data;
+ data = selector;
+ selector = undefined;
+ }
+ }
+ if ( fn === false ) {
+ fn = returnFalse;
+ } else if ( !fn ) {
+ return this;
+ }
+
+ if ( one === 1 ) {
+ origFn = fn;
+ fn = function( event ) {
+ // Can use an empty set, since event contains the info
+ jQuery().off( event );
+ return origFn.apply( this, arguments );
+ };
+ // Use same guid so caller can remove using origFn
+ fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
+ }
+ return this.each( function() {
+ jQuery.event.add( this, types, fn, data, selector );
+ });
+ },
+ one: function( types, selector, data, fn ) {
+ return this.on( types, selector, data, fn, 1 );
+ },
+ off: function( types, selector, fn ) {
+ var handleObj, type;
+ if ( types && types.preventDefault && types.handleObj ) {
+ // ( event ) dispatched jQuery.Event
+ handleObj = types.handleObj;
+ jQuery( types.delegateTarget ).off(
+ handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
+ handleObj.selector,
+ handleObj.handler
+ );
+ return this;
+ }
+ if ( typeof types === "object" ) {
+ // ( types-object [, selector] )
+ for ( type in types ) {
+ this.off( type, selector, types[ type ] );
+ }
+ return this;
+ }
+ if ( selector === false || typeof selector === "function" ) {
+ // ( types [, fn] )
+ fn = selector;
+ selector = undefined;
+ }
+ if ( fn === false ) {
+ fn = returnFalse;
+ }
+ return this.each(function() {
+ jQuery.event.remove( this, types, fn, selector );
+ });
+ },
+
+ trigger: function( type, data ) {
+ return this.each(function() {
+ jQuery.event.trigger( type, data, this );
+ });
+ },
+ triggerHandler: function( type, data ) {
+ var elem = this[0];
+ if ( elem ) {
+ return jQuery.event.trigger( type, data, elem, true );
+ }
+ }
+});
+var isSimple = /^.[^:#\[\.,]*$/,
+ rparentsprev = /^(?:parents|prev(?:Until|All))/,
+ rneedsContext = jQuery.expr.match.needsContext,
+ // methods guaranteed to produce a unique set when starting from a unique set
+ guaranteedUnique = {
+ children: true,
+ contents: true,
+ next: true,
+ prev: true
+ };
+
+jQuery.fn.extend({
+ find: function( selector ) {
+ var i,
+ ret = [],
+ self = this,
+ len = self.length;
+
+ if ( typeof selector !== "string" ) {
+ return this.pushStack( jQuery( selector ).filter(function() {
+ for ( i = 0; i < len; i++ ) {
+ if ( jQuery.contains( self[ i ], this ) ) {
+ return true;
+ }
+ }
+ }) );
+ }
+
+ for ( i = 0; i < len; i++ ) {
+ jQuery.find( selector, self[ i ], ret );
+ }
+
+ // Needed because $( selector, context ) becomes $( context ).find( selector )
+ ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
+ ret.selector = this.selector ? this.selector + " " + selector : selector;
+ return ret;
+ },
+
+ has: function( target ) {
+ var targets = jQuery( target, this ),
+ l = targets.length;
+
+ return this.filter(function() {
+ var i = 0;
+ for ( ; i < l; i++ ) {
+ if ( jQuery.contains( this, targets[i] ) ) {
+ return true;
+ }
+ }
+ });
+ },
+
+ not: function( selector ) {
+ return this.pushStack( winnow(this, selector || [], true) );
+ },
+
+ filter: function( selector ) {
+ return this.pushStack( winnow(this, selector || [], false) );
+ },
+
+ is: function( selector ) {
+ return !!winnow(
+ this,
+
+ // If this is a positional/relative selector, check membership in the returned set
+ // so $("p:first").is("p:last") won't return true for a doc with two "p".
+ typeof selector === "string" && rneedsContext.test( selector ) ?
+ jQuery( selector ) :
+ selector || [],
+ false
+ ).length;
+ },
+
+ closest: function( selectors, context ) {
+ var cur,
+ i = 0,
+ l = this.length,
+ matched = [],
+ pos = ( rneedsContext.test( selectors ) || typeof selectors !== "string" ) ?
+ jQuery( selectors, context || this.context ) :
+ 0;
+
+ for ( ; i < l; i++ ) {
+ for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) {
+ // Always skip document fragments
+ if ( cur.nodeType < 11 && (pos ?
+ pos.index(cur) > -1 :
+
+ // Don't pass non-elements to Sizzle
+ cur.nodeType === 1 &&
+ jQuery.find.matchesSelector(cur, selectors)) ) {
+
+ cur = matched.push( cur );
+ break;
+ }
+ }
+ }
+
+ return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched );
+ },
+
+ // Determine the position of an element within
+ // the matched set of elements
+ index: function( elem ) {
+
+ // No argument, return index in parent
+ if ( !elem ) {
+ return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
+ }
+
+ // index in selector
+ if ( typeof elem === "string" ) {
+ return core_indexOf.call( jQuery( elem ), this[ 0 ] );
+ }
+
+ // Locate the position of the desired element
+ return core_indexOf.call( this,
+
+ // If it receives a jQuery object, the first element is used
+ elem.jquery ? elem[ 0 ] : elem
+ );
+ },
+
+ add: function( selector, context ) {
+ var set = typeof selector === "string" ?
+ jQuery( selector, context ) :
+ jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
+ all = jQuery.merge( this.get(), set );
+
+ return this.pushStack( jQuery.unique(all) );
+ },
+
+ addBack: function( selector ) {
+ return this.add( selector == null ?
+ this.prevObject : this.prevObject.filter(selector)
+ );
+ }
+});
+
+function sibling( cur, dir ) {
+ while ( (cur = cur[dir]) && cur.nodeType !== 1 ) {}
+
+ return cur;
+}
+
+jQuery.each({
+ parent: function( elem ) {
+ var parent = elem.parentNode;
+ return parent && parent.nodeType !== 11 ? parent : null;
+ },
+ parents: function( elem ) {
+ return jQuery.dir( elem, "parentNode" );
+ },
+ parentsUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "parentNode", until );
+ },
+ next: function( elem ) {
+ return sibling( elem, "nextSibling" );
+ },
+ prev: function( elem ) {
+ return sibling( elem, "previousSibling" );
+ },
+ nextAll: function( elem ) {
+ return jQuery.dir( elem, "nextSibling" );
+ },
+ prevAll: function( elem ) {
+ return jQuery.dir( elem, "previousSibling" );
+ },
+ nextUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "nextSibling", until );
+ },
+ prevUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "previousSibling", until );
+ },
+ siblings: function( elem ) {
+ return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
+ },
+ children: function( elem ) {
+ return jQuery.sibling( elem.firstChild );
+ },
+ contents: function( elem ) {
+ return elem.contentDocument || jQuery.merge( [], elem.childNodes );
+ }
+}, function( name, fn ) {
+ jQuery.fn[ name ] = function( until, selector ) {
+ var matched = jQuery.map( this, fn, until );
+
+ if ( name.slice( -5 ) !== "Until" ) {
+ selector = until;
+ }
+
+ if ( selector && typeof selector === "string" ) {
+ matched = jQuery.filter( selector, matched );
+ }
+
+ if ( this.length > 1 ) {
+ // Remove duplicates
+ if ( !guaranteedUnique[ name ] ) {
+ jQuery.unique( matched );
+ }
+
+ // Reverse order for parents* and prev-derivatives
+ if ( rparentsprev.test( name ) ) {
+ matched.reverse();
+ }
+ }
+
+ return this.pushStack( matched );
+ };
+});
+
+jQuery.extend({
+ filter: function( expr, elems, not ) {
+ var elem = elems[ 0 ];
+
+ if ( not ) {
+ expr = ":not(" + expr + ")";
+ }
+
+ return elems.length === 1 && elem.nodeType === 1 ?
+ jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
+ jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
+ return elem.nodeType === 1;
+ }));
+ },
+
+ dir: function( elem, dir, until ) {
+ var matched = [],
+ truncate = until !== undefined;
+
+ while ( (elem = elem[ dir ]) && elem.nodeType !== 9 ) {
+ if ( elem.nodeType === 1 ) {
+ if ( truncate && jQuery( elem ).is( until ) ) {
+ break;
+ }
+ matched.push( elem );
+ }
+ }
+ return matched;
+ },
+
+ sibling: function( n, elem ) {
+ var matched = [];
+
+ for ( ; n; n = n.nextSibling ) {
+ if ( n.nodeType === 1 && n !== elem ) {
+ matched.push( n );
+ }
+ }
+
+ return matched;
+ }
+});
+
+// Implement the identical functionality for filter and not
+function winnow( elements, qualifier, not ) {
+ if ( jQuery.isFunction( qualifier ) ) {
+ return jQuery.grep( elements, function( elem, i ) {
+ /* jshint -W018 */
+ return !!qualifier.call( elem, i, elem ) !== not;
+ });
+
+ }
+
+ if ( qualifier.nodeType ) {
+ return jQuery.grep( elements, function( elem ) {
+ return ( elem === qualifier ) !== not;
+ });
+
+ }
+
+ if ( typeof qualifier === "string" ) {
+ if ( isSimple.test( qualifier ) ) {
+ return jQuery.filter( qualifier, elements, not );
+ }
+
+ qualifier = jQuery.filter( qualifier, elements );
+ }
+
+ return jQuery.grep( elements, function( elem ) {
+ return ( core_indexOf.call( qualifier, elem ) >= 0 ) !== not;
+ });
+}
+var rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
+ rtagName = /<([\w:]+)/,
+ rhtml = /<|&#?\w+;/,
+ rnoInnerhtml = /<(?:script|style|link)/i,
+ manipulation_rcheckableType = /^(?:checkbox|radio)$/i,
+ // checked="checked" or checked
+ rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
+ rscriptType = /^$|\/(?:java|ecma)script/i,
+ rscriptTypeMasked = /^true\/(.*)/,
+ rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
+
+ // We have to close these tags to support XHTML (#13200)
+ wrapMap = {
+
+ // Support: IE 9
+ 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, "", "" ]
+ };
+
+// Support: IE 9
+wrapMap.optgroup = wrapMap.option;
+
+wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
+wrapMap.th = wrapMap.td;
+
+jQuery.fn.extend({
+ text: function( value ) {
+ return jQuery.access( this, function( value ) {
+ return value === undefined ?
+ jQuery.text( this ) :
+ this.empty().append( ( this[ 0 ] && this[ 0 ].ownerDocument || document ).createTextNode( value ) );
+ }, null, value, arguments.length );
+ },
+
+ append: function() {
+ return this.domManip( arguments, function( elem ) {
+ if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
+ var target = manipulationTarget( this, elem );
+ target.appendChild( elem );
+ }
+ });
+ },
+
+ prepend: function() {
+ return this.domManip( arguments, function( elem ) {
+ if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
+ var target = manipulationTarget( this, elem );
+ target.insertBefore( elem, target.firstChild );
+ }
+ });
+ },
+
+ before: function() {
+ return this.domManip( arguments, function( elem ) {
+ if ( this.parentNode ) {
+ this.parentNode.insertBefore( elem, this );
+ }
+ });
+ },
+
+ after: function() {
+ return this.domManip( arguments, function( elem ) {
+ if ( this.parentNode ) {
+ this.parentNode.insertBefore( elem, this.nextSibling );
+ }
+ });
+ },
+
+ // keepData is for internal use only--do not document
+ remove: function( selector, keepData ) {
+ var elem,
+ elems = selector ? jQuery.filter( selector, this ) : this,
+ i = 0;
+
+ for ( ; (elem = elems[i]) != null; i++ ) {
+ if ( !keepData && elem.nodeType === 1 ) {
+ jQuery.cleanData( getAll( elem ) );
+ }
+
+ if ( elem.parentNode ) {
+ if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {
+ setGlobalEval( getAll( elem, "script" ) );
+ }
+ elem.parentNode.removeChild( elem );
+ }
+ }
+
+ return this;
+ },
+
+ empty: function() {
+ var elem,
+ i = 0;
+
+ for ( ; (elem = this[i]) != null; i++ ) {
+ if ( elem.nodeType === 1 ) {
+
+ // Prevent memory leaks
+ jQuery.cleanData( getAll( elem, false ) );
+
+ // Remove any remaining nodes
+ elem.textContent = "";
+ }
+ }
+
+ return this;
+ },
+
+ clone: function( dataAndEvents, deepDataAndEvents ) {
+ dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
+ deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
+
+ return this.map( function () {
+ return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
+ });
+ },
+
+ html: function( value ) {
+ return jQuery.access( this, function( value ) {
+ var elem = this[ 0 ] || {},
+ i = 0,
+ l = this.length;
+
+ if ( value === undefined && elem.nodeType === 1 ) {
+ return elem.innerHTML;
+ }
+
+ // See if we can take a shortcut and just use innerHTML
+ if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
+ !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
+
+ value = value.replace( rxhtmlTag, "<$1></$2>" );
+
+ try {
+ for ( ; i < l; i++ ) {
+ elem = this[ i ] || {};
+
+ // Remove element nodes and prevent memory leaks
+ if ( elem.nodeType === 1 ) {
+ jQuery.cleanData( getAll( elem, false ) );
+ elem.innerHTML = value;
+ }
+ }
+
+ elem = 0;
+
+ // If using innerHTML throws an exception, use the fallback method
+ } catch( e ) {}
+ }
+
+ if ( elem ) {
+ this.empty().append( value );
+ }
+ }, null, value, arguments.length );
+ },
+
+ replaceWith: function() {
+ var
+ // Snapshot the DOM in case .domManip sweeps something relevant into its fragment
+ args = jQuery.map( this, function( elem ) {
+ return [ elem.nextSibling, elem.parentNode ];
+ }),
+ i = 0;
+
+ // Make the changes, replacing each context element with the new content
+ this.domManip( arguments, function( elem ) {
+ var next = args[ i++ ],
+ parent = args[ i++ ];
+
+ if ( parent ) {
+ // Don't use the snapshot next if it has moved (#13810)
+ if ( next && next.parentNode !== parent ) {
+ next = this.nextSibling;
+ }
+ jQuery( this ).remove();
+ parent.insertBefore( elem, next );
+ }
+ // Allow new content to include elements from the context set
+ }, true );
+
+ // Force removal if there was no new content (e.g., from empty arguments)
+ return i ? this : this.remove();
+ },
+
+ detach: function( selector ) {
+ return this.remove( selector, true );
+ },
+
+ domManip: function( args, callback, allowIntersection ) {
+
+ // Flatten any nested arrays
+ args = core_concat.apply( [], args );
+
+ var fragment, first, scripts, hasScripts, node, doc,
+ i = 0,
+ l = this.length,
+ set = this,
+ iNoClone = l - 1,
+ value = args[ 0 ],
+ isFunction = jQuery.isFunction( value );
+
+ // We can't cloneNode fragments that contain checked, in WebKit
+ if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) {
+ return this.each(function( index ) {
+ var self = set.eq( index );
+ if ( isFunction ) {
+ args[ 0 ] = value.call( this, index, self.html() );
+ }
+ self.domManip( args, callback, allowIntersection );
+ });
+ }
+
+ if ( l ) {
+ fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, !allowIntersection && this );
+ first = fragment.firstChild;
+
+ if ( fragment.childNodes.length === 1 ) {
+ fragment = first;
+ }
+
+ if ( first ) {
+ scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
+ hasScripts = scripts.length;
+
+ // Use the original fragment for the last item instead of the first because it can end up
+ // being emptied incorrectly in certain situations (#8070).
+ for ( ; i < l; i++ ) {
+ node = fragment;
+
+ if ( i !== iNoClone ) {
+ node = jQuery.clone( node, true, true );
+
+ // Keep references to cloned scripts for later restoration
+ if ( hasScripts ) {
+ // Support: QtWebKit
+ // jQuery.merge because core_push.apply(_, arraylike) throws
+ jQuery.merge( scripts, getAll( node, "script" ) );
+ }
+ }
+
+ callback.call( this[ i ], node, i );
+ }
+
+ if ( hasScripts ) {
+ doc = scripts[ scripts.length - 1 ].ownerDocument;
+
+ // Reenable scripts
+ jQuery.map( scripts, restoreScript );
+
+ // Evaluate executable scripts on first document insertion
+ for ( i = 0; i < hasScripts; i++ ) {
+ node = scripts[ i ];
+ if ( rscriptType.test( node.type || "" ) &&
+ !data_priv.access( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
+
+ if ( node.src ) {
+ // Hope ajax is available...
+ jQuery._evalUrl( node.src );
+ } else {
+ jQuery.globalEval( node.textContent.replace( rcleanScript, "" ) );
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return this;
+ }
+});
+
+jQuery.each({
+ appendTo: "append",
+ prependTo: "prepend",
+ insertBefore: "before",
+ insertAfter: "after",
+ replaceAll: "replaceWith"
+}, function( name, original ) {
+ jQuery.fn[ name ] = function( selector ) {
+ var elems,
+ ret = [],
+ insert = jQuery( selector ),
+ last = insert.length - 1,
+ i = 0;
+
+ for ( ; i <= last; i++ ) {
+ elems = i === last ? this : this.clone( true );
+ jQuery( insert[ i ] )[ original ]( elems );
+
+ // Support: QtWebKit
+ // .get() because core_push.apply(_, arraylike) throws
+ core_push.apply( ret, elems.get() );
+ }
+
+ return this.pushStack( ret );
+ };
+});
+
+jQuery.extend({
+ clone: function( elem, dataAndEvents, deepDataAndEvents ) {
+ var i, l, srcElements, destElements,
+ clone = elem.cloneNode( true ),
+ inPage = jQuery.contains( elem.ownerDocument, elem );
+
+ // Support: IE >= 9
+ // Fix Cloning issues
+ if ( !jQuery.support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && !jQuery.isXMLDoc( elem ) ) {
+
+ // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
+ destElements = getAll( clone );
+ srcElements = getAll( elem );
+
+ for ( i = 0, l = srcElements.length; i < l; i++ ) {
+ fixInput( srcElements[ i ], destElements[ i ] );
+ }
+ }
+
+ // Copy the events from the original to the clone
+ if ( dataAndEvents ) {
+ if ( deepDataAndEvents ) {
+ srcElements = srcElements || getAll( elem );
+ destElements = destElements || getAll( clone );
+
+ for ( i = 0, l = srcElements.length; i < l; i++ ) {
+ cloneCopyEvent( srcElements[ i ], destElements[ i ] );
+ }
+ } else {
+ cloneCopyEvent( elem, clone );
+ }
+ }
+
+ // Preserve script evaluation history
+ destElements = getAll( clone, "script" );
+ if ( destElements.length > 0 ) {
+ setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
+ }
+
+ // Return the cloned set
+ return clone;
+ },
+
+ buildFragment: function( elems, context, scripts, selection ) {
+ var elem, tmp, tag, wrap, contains, j,
+ i = 0,
+ l = elems.length,
+ fragment = context.createDocumentFragment(),
+ nodes = [];
+
+ for ( ; i < l; i++ ) {
+ elem = elems[ i ];
+
+ if ( elem || elem === 0 ) {
+
+ // Add nodes directly
+ if ( jQuery.type( elem ) === "object" ) {
+ // Support: QtWebKit
+ // jQuery.merge because core_push.apply(_, arraylike) throws
+ jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
+
+ // Convert non-html into a text node
+ } else if ( !rhtml.test( elem ) ) {
+ nodes.push( context.createTextNode( elem ) );
+
+ // Convert html into DOM nodes
+ } else {
+ tmp = tmp || fragment.appendChild( context.createElement("div") );
+
+ // Deserialize a standard representation
+ tag = ( rtagName.exec( elem ) || ["", ""] )[ 1 ].toLowerCase();
+ wrap = wrapMap[ tag ] || wrapMap._default;
+ tmp.innerHTML = wrap[ 1 ] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[ 2 ];
+
+ // Descend through wrappers to the right content
+ j = wrap[ 0 ];
+ while ( j-- ) {
+ tmp = tmp.lastChild;
+ }
+
+ // Support: QtWebKit
+ // jQuery.merge because core_push.apply(_, arraylike) throws
+ jQuery.merge( nodes, tmp.childNodes );
+
+ // Remember the top-level container
+ tmp = fragment.firstChild;
+
+ // Fixes #12346
+ // Support: Webkit, IE
+ tmp.textContent = "";
+ }
+ }
+ }
+
+ // Remove wrapper from fragment
+ fragment.textContent = "";
+
+ i = 0;
+ while ( (elem = nodes[ i++ ]) ) {
+
+ // #4087 - If origin and destination elements are the same, and this is
+ // that element, do not do anything
+ if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {
+ continue;
+ }
+
+ contains = jQuery.contains( elem.ownerDocument, elem );
+
+ // Append to fragment
+ tmp = getAll( fragment.appendChild( elem ), "script" );
+
+ // Preserve script evaluation history
+ if ( contains ) {
+ setGlobalEval( tmp );
+ }
+
+ // Capture executables
+ if ( scripts ) {
+ j = 0;
+ while ( (elem = tmp[ j++ ]) ) {
+ if ( rscriptType.test( elem.type || "" ) ) {
+ scripts.push( elem );
+ }
+ }
+ }
+ }
+
+ return fragment;
+ },
+
+ cleanData: function( elems ) {
+ var data, elem, events, type, key, j,
+ special = jQuery.event.special,
+ i = 0;
+
+ for ( ; (elem = elems[ i ]) !== undefined; i++ ) {
+ if ( Data.accepts( elem ) ) {
+ key = elem[ data_priv.expando ];
+
+ if ( key && (data = data_priv.cache[ key ]) ) {
+ events = Object.keys( data.events || {} );
+ if ( events.length ) {
+ for ( j = 0; (type = events[j]) !== undefined; j++ ) {
+ if ( special[ type ] ) {
+ jQuery.event.remove( elem, type );
+
+ // This is a shortcut to avoid jQuery.event.remove's overhead
+ } else {
+ jQuery.removeEvent( elem, type, data.handle );
+ }
+ }
+ }
+ if ( data_priv.cache[ key ] ) {
+ // Discard any remaining `private` data
+ delete data_priv.cache[ key ];
+ }
+ }
+ }
+ // Discard any remaining `user` data
+ delete data_user.cache[ elem[ data_user.expando ] ];
+ }
+ },
+
+ _evalUrl: function( url ) {
+ return jQuery.ajax({
+ url: url,
+ type: "GET",
+ dataType: "script",
+ async: false,
+ global: false,
+ "throws": true
+ });
+ }
+});
+
+// Support: 1.x compatibility
+// Manipulating tables requires a tbody
+function manipulationTarget( elem, content ) {
+ return jQuery.nodeName( elem, "table" ) &&
+ jQuery.nodeName( content.nodeType === 1 ? content : content.firstChild, "tr" ) ?
+
+ elem.getElementsByTagName("tbody")[0] ||
+ elem.appendChild( elem.ownerDocument.createElement("tbody") ) :
+ elem;
+}
+
+// Replace/restore the type attribute of script elements for safe DOM manipulation
+function disableScript( elem ) {
+ elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type;
+ return elem;
+}
+function restoreScript( elem ) {
+ var match = rscriptTypeMasked.exec( elem.type );
+
+ if ( match ) {
+ elem.type = match[ 1 ];
+ } else {
+ elem.removeAttribute("type");
+ }
+
+ return elem;
+}
+
+// Mark scripts as having already been evaluated
+function setGlobalEval( elems, refElements ) {
+ var l = elems.length,
+ i = 0;
+
+ for ( ; i < l; i++ ) {
+ data_priv.set(
+ elems[ i ], "globalEval", !refElements || data_priv.get( refElements[ i ], "globalEval" )
+ );
+ }
+}
+
+function cloneCopyEvent( src, dest ) {
+ var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;
+
+ if ( dest.nodeType !== 1 ) {
+ return;
+ }
+
+ // 1. Copy private data: events, handlers, etc.
+ if ( data_priv.hasData( src ) ) {
+ pdataOld = data_priv.access( src );
+ pdataCur = data_priv.set( dest, pdataOld );
+ events = pdataOld.events;
+
+ if ( events ) {
+ delete pdataCur.handle;
+ pdataCur.events = {};
+
+ for ( type in events ) {
+ for ( i = 0, l = events[ type ].length; i < l; i++ ) {
+ jQuery.event.add( dest, type, events[ type ][ i ] );
+ }
+ }
+ }
+ }
+
+ // 2. Copy user data
+ if ( data_user.hasData( src ) ) {
+ udataOld = data_user.access( src );
+ udataCur = jQuery.extend( {}, udataOld );
+
+ data_user.set( dest, udataCur );
+ }
+}
+
+
+function getAll( context, tag ) {
+ var ret = context.getElementsByTagName ? context.getElementsByTagName( tag || "*" ) :
+ context.querySelectorAll ? context.querySelectorAll( tag || "*" ) :
+ [];
+
+ return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
+ jQuery.merge( [ context ], ret ) :
+ ret;
+}
+
+// Support: IE >= 9
+function fixInput( src, dest ) {
+ var nodeName = dest.nodeName.toLowerCase();
+
+ // Fails to persist the checked state of a cloned checkbox or radio button.
+ if ( nodeName === "input" && manipulation_rcheckableType.test( src.type ) ) {
+ dest.checked = src.checked;
+
+ // Fails to return the selected option to the default selected state when cloning options
+ } else if ( nodeName === "input" || nodeName === "textarea" ) {
+ dest.defaultValue = src.defaultValue;
+ }
+}
+jQuery.fn.extend({
+ wrapAll: function( html ) {
+ var wrap;
+
+ if ( jQuery.isFunction( html ) ) {
+ return this.each(function( i ) {
+ jQuery( this ).wrapAll( html.call(this, i) );
+ });
+ }
+
+ if ( this[ 0 ] ) {
+
+ // The elements to wrap the target around
+ wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
+
+ if ( this[ 0 ].parentNode ) {
+ wrap.insertBefore( this[ 0 ] );
+ }
+
+ wrap.map(function() {
+ var elem = this;
+
+ while ( elem.firstElementChild ) {
+ elem = elem.firstElementChild;
+ }
+
+ return elem;
+ }).append( this );
+ }
+
+ return this;
+ },
+
+ wrapInner: function( html ) {
+ if ( jQuery.isFunction( html ) ) {
+ return this.each(function( i ) {
+ jQuery( this ).wrapInner( html.call(this, i) );
+ });
+ }
+
+ return this.each(function() {
+ var self = jQuery( this ),
+ contents = self.contents();
+
+ if ( contents.length ) {
+ contents.wrapAll( html );
+
+ } else {
+ self.append( html );
+ }
+ });
+ },
+
+ wrap: function( html ) {
+ var isFunction = jQuery.isFunction( html );
+
+ return this.each(function( i ) {
+ jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
+ });
+ },
+
+ unwrap: function() {
+ return this.parent().each(function() {
+ if ( !jQuery.nodeName( this, "body" ) ) {
+ jQuery( this ).replaceWith( this.childNodes );
+ }
+ }).end();
+ }
+});
+var curCSS, iframe,
+ // swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
+ // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
+ rdisplayswap = /^(none|table(?!-c[ea]).+)/,
+ rmargin = /^margin/,
+ rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ),
+ rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ),
+ rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ),
+ elemdisplay = { BODY: "block" },
+
+ cssShow = { position: "absolute", visibility: "hidden", display: "block" },
+ cssNormalTransform = {
+ letterSpacing: 0,
+ fontWeight: 400
+ },
+
+ cssExpand = [ "Top", "Right", "Bottom", "Left" ],
+ cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];
+
+// return a css property mapped to a potentially vendor prefixed property
+function vendorPropName( style, name ) {
+
+ // shortcut for names that are not vendor prefixed
+ if ( name in style ) {
+ return name;
+ }
+
+ // check for vendor prefixed names
+ var capName = name.charAt(0).toUpperCase() + name.slice(1),
+ origName = name,
+ i = cssPrefixes.length;
+
+ while ( i-- ) {
+ name = cssPrefixes[ i ] + capName;
+ if ( name in style ) {
+ return name;
+ }
+ }
+
+ return origName;
+}
+
+function isHidden( elem, el ) {
+ // isHidden might be called from jQuery#filter function;
+ // in that case, element will be second argument
+ elem = el || elem;
+ return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
+}
+
+// NOTE: we've included the "window" in window.getComputedStyle
+// because jsdom on node.js will break without it.
+function getStyles( elem ) {
+ return window.getComputedStyle( elem, null );
+}
+
+function showHide( elements, show ) {
+ var display, elem, hidden,
+ values = [],
+ index = 0,
+ length = elements.length;
+
+ for ( ; index < length; index++ ) {
+ elem = elements[ index ];
+ if ( !elem.style ) {
+ continue;
+ }
+
+ values[ index ] = data_priv.get( elem, "olddisplay" );
+ display = elem.style.display;
+ if ( show ) {
+ // Reset the inline display of this element to learn if it is
+ // being hidden by cascaded rules or not
+ if ( !values[ index ] && display === "none" ) {
+ elem.style.display = "";
+ }
+
+ // Set elements which have been overridden with display: none
+ // in a stylesheet to whatever the default browser style is
+ // for such an element
+ if ( elem.style.display === "" && isHidden( elem ) ) {
+ values[ index ] = data_priv.access( elem, "olddisplay", css_defaultDisplay(elem.nodeName) );
+ }
+ } else {
+
+ if ( !values[ index ] ) {
+ hidden = isHidden( elem );
+
+ if ( display && display !== "none" || !hidden ) {
+ data_priv.set( elem, "olddisplay", hidden ? display : jQuery.css(elem, "display") );
+ }
+ }
+ }
+ }
+
+ // Set the display of most of the elements in a second loop
+ // to avoid the constant reflow
+ for ( index = 0; index < length; index++ ) {
+ elem = elements[ index ];
+ if ( !elem.style ) {
+ continue;
+ }
+ if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
+ elem.style.display = show ? values[ index ] || "" : "none";
+ }
+ }
+
+ return elements;
+}
+
+jQuery.fn.extend({
+ css: function( name, value ) {
+ return jQuery.access( this, function( elem, name, value ) {
+ var styles, len,
+ map = {},
+ i = 0;
+
+ if ( jQuery.isArray( name ) ) {
+ styles = getStyles( elem );
+ len = name.length;
+
+ for ( ; i < len; i++ ) {
+ map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
+ }
+
+ return map;
+ }
+
+ return value !== undefined ?
+ jQuery.style( elem, name, value ) :
+ jQuery.css( elem, name );
+ }, name, value, arguments.length > 1 );
+ },
+ show: function() {
+ return showHide( this, true );
+ },
+ hide: function() {
+ return showHide( this );
+ },
+ toggle: function( state ) {
+ if ( typeof state === "boolean" ) {
+ return state ? this.show() : this.hide();
+ }
+
+ return this.each(function() {
+ if ( isHidden( this ) ) {
+ jQuery( this ).show();
+ } else {
+ jQuery( this ).hide();
+ }
+ });
+ }
+});
+
+jQuery.extend({
+ // Add in style property hooks for overriding the default
+ // behavior of getting and setting a style property
+ cssHooks: {
+ opacity: {
+ get: function( elem, computed ) {
+ if ( computed ) {
+ // We should always get a number back from opacity
+ var ret = curCSS( elem, "opacity" );
+ return ret === "" ? "1" : ret;
+ }
+ }
+ }
+ },
+
+ // Don't automatically add "px" to these possibly-unitless properties
+ cssNumber: {
+ "columnCount": true,
+ "fillOpacity": true,
+ "fontWeight": true,
+ "lineHeight": true,
+ "opacity": true,
+ "order": true,
+ "orphans": true,
+ "widows": true,
+ "zIndex": true,
+ "zoom": true
+ },
+
+ // Add in properties whose names you wish to fix before
+ // setting or getting the value
+ cssProps: {
+ // normalize float css property
+ "float": "cssFloat"
+ },
+
+ // Get and set the style property on a DOM Node
+ style: function( elem, name, value, extra ) {
+ // Don't set styles on text and comment nodes
+ if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
+ return;
+ }
+
+ // Make sure that we're working with the right name
+ var ret, type, hooks,
+ origName = jQuery.camelCase( name ),
+ style = elem.style;
+
+ name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
+
+ // gets hook for the prefixed version
+ // followed by the unprefixed version
+ hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
+
+ // Check if we're setting a value
+ if ( value !== undefined ) {
+ type = typeof value;
+
+ // convert relative number strings (+= or -=) to relative numbers. #7345
+ if ( type === "string" && (ret = rrelNum.exec( value )) ) {
+ value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
+ // Fixes bug #9237
+ type = "number";
+ }
+
+ // Make sure that NaN and null values aren't set. See: #7116
+ if ( value == null || type === "number" && isNaN( value ) ) {
+ return;
+ }
+
+ // If a number was passed in, add 'px' to the (except for certain CSS properties)
+ if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
+ value += "px";
+ }
+
+ // Fixes #8908, it can be done more correctly by specifying setters in cssHooks,
+ // but it would mean to define eight (for every problematic property) identical functions
+ if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) {
+ style[ name ] = "inherit";
+ }
+
+ // If a hook was provided, use that value, otherwise just set the specified value
+ if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {
+ style[ name ] = value;
+ }
+
+ } else {
+ // If a hook was provided get the non-computed value from there
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
+ return ret;
+ }
+
+ // Otherwise just get the value from the style object
+ return style[ name ];
+ }
+ },
+
+ css: function( elem, name, extra, styles ) {
+ var val, num, hooks,
+ origName = jQuery.camelCase( name );
+
+ // Make sure that we're working with the right name
+ name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
+
+ // gets hook for the prefixed version
+ // followed by the unprefixed version
+ hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
+
+ // If a hook was provided get the computed value from there
+ if ( hooks && "get" in hooks ) {
+ val = hooks.get( elem, true, extra );
+ }
+
+ // Otherwise, if a way to get the computed value exists, use that
+ if ( val === undefined ) {
+ val = curCSS( elem, name, styles );
+ }
+
+ //convert "normal" to computed value
+ if ( val === "normal" && name in cssNormalTransform ) {
+ val = cssNormalTransform[ name ];
+ }
+
+ // Return, converting to number if forced or a qualifier was provided and val looks numeric
+ if ( extra === "" || extra ) {
+ num = parseFloat( val );
+ return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
+ }
+ return val;
+ }
+});
+
+curCSS = function( elem, name, _computed ) {
+ var width, minWidth, maxWidth,
+ computed = _computed || getStyles( elem ),
+
+ // Support: IE9
+ // getPropertyValue is only needed for .css('filter') in IE9, see #12537
+ ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined,
+ style = elem.style;
+
+ if ( computed ) {
+
+ if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
+ ret = jQuery.style( elem, name );
+ }
+
+ // Support: Safari 5.1
+ // A tribute to the "awesome hack by Dean Edwards"
+ // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
+ // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
+ if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
+
+ // Remember the original values
+ width = style.width;
+ minWidth = style.minWidth;
+ maxWidth = style.maxWidth;
+
+ // Put in the new values to get a computed value out
+ style.minWidth = style.maxWidth = style.width = ret;
+ ret = computed.width;
+
+ // Revert the changed values
+ style.width = width;
+ style.minWidth = minWidth;
+ style.maxWidth = maxWidth;
+ }
+ }
+
+ return ret;
+};
+
+
+function setPositiveNumber( elem, value, subtract ) {
+ var matches = rnumsplit.exec( value );
+ return matches ?
+ // Guard against undefined "subtract", e.g., when used as in cssHooks
+ Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
+ value;
+}
+
+function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
+ var i = extra === ( isBorderBox ? "border" : "content" ) ?
+ // If we already have the right measurement, avoid augmentation
+ 4 :
+ // Otherwise initialize for horizontal or vertical properties
+ name === "width" ? 1 : 0,
+
+ val = 0;
+
+ for ( ; i < 4; i += 2 ) {
+ // both box models exclude margin, so add it if we want it
+ if ( extra === "margin" ) {
+ val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
+ }
+
+ if ( isBorderBox ) {
+ // border-box includes padding, so remove it if we want content
+ if ( extra === "content" ) {
+ val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
+ }
+
+ // at this point, extra isn't border nor margin, so remove border
+ if ( extra !== "margin" ) {
+ val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
+ }
+ } else {
+ // at this point, extra isn't content, so add padding
+ val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
+
+ // at this point, extra isn't content nor padding, so add border
+ if ( extra !== "padding" ) {
+ val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
+ }
+ }
+ }
+
+ return val;
+}
+
+function getWidthOrHeight( elem, name, extra ) {
+
+ // Start with offset property, which is equivalent to the border-box value
+ var valueIsBorderBox = true,
+ val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
+ styles = getStyles( elem ),
+ isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
+
+ // some non-html elements return undefined for offsetWidth, so check for null/undefined
+ // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
+ // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
+ if ( val <= 0 || val == null ) {
+ // Fall back to computed then uncomputed css if necessary
+ val = curCSS( elem, name, styles );
+ if ( val < 0 || val == null ) {
+ val = elem.style[ name ];
+ }
+
+ // Computed unit is not pixels. Stop here and return.
+ if ( rnumnonpx.test(val) ) {
+ return val;
+ }
+
+ // we need the check for style in case a browser which returns unreliable values
+ // for getComputedStyle silently falls back to the reliable elem.style
+ valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] );
+
+ // Normalize "", auto, and prepare for extra
+ val = parseFloat( val ) || 0;
+ }
+
+ // use the active box-sizing model to add/subtract irrelevant styles
+ return ( val +
+ augmentWidthOrHeight(
+ elem,
+ name,
+ extra || ( isBorderBox ? "border" : "content" ),
+ valueIsBorderBox,
+ styles
+ )
+ ) + "px";
+}
+
+// Try to determine the default display value of an element
+function css_defaultDisplay( nodeName ) {
+ var doc = document,
+ display = elemdisplay[ nodeName ];
+
+ if ( !display ) {
+ display = actualDisplay( nodeName, doc );
+
+ // If the simple way fails, read from inside an iframe
+ if ( display === "none" || !display ) {
+ // Use the already-created iframe if possible
+ iframe = ( iframe ||
+ jQuery("<iframe frameborder='0' width='0' height='0'/>")
+ .css( "cssText", "display:block !important" )
+ ).appendTo( doc.documentElement );
+
+ // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
+ doc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;
+ doc.write("<!doctype html><html><body>");
+ doc.close();
+
+ display = actualDisplay( nodeName, doc );
+ iframe.detach();
+ }
+
+ // Store the correct default display
+ elemdisplay[ nodeName ] = display;
+ }
+
+ return display;
+}
+
+// Called ONLY from within css_defaultDisplay
+function actualDisplay( name, doc ) {
+ var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
+ display = jQuery.css( elem[0], "display" );
+ elem.remove();
+ return display;
+}
+
+jQuery.each([ "height", "width" ], function( i, name ) {
+ jQuery.cssHooks[ name ] = {
+ get: function( elem, computed, extra ) {
+ if ( computed ) {
+ // certain elements can have dimension info if we invisibly show them
+ // however, it must have a current display style that would benefit from this
+ return elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, "display" ) ) ?
+ jQuery.swap( elem, cssShow, function() {
+ return getWidthOrHeight( elem, name, extra );
+ }) :
+ getWidthOrHeight( elem, name, extra );
+ }
+ },
+
+ set: function( elem, value, extra ) {
+ var styles = extra && getStyles( elem );
+ return setPositiveNumber( elem, value, extra ?
+ augmentWidthOrHeight(
+ elem,
+ name,
+ extra,
+ jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
+ styles
+ ) : 0
+ );
+ }
+ };
+});
+
+// These hooks cannot be added until DOM ready because the support test
+// for it is not run until after DOM ready
+jQuery(function() {
+ // Support: Android 2.3
+ if ( !jQuery.support.reliableMarginRight ) {
+ jQuery.cssHooks.marginRight = {
+ get: function( elem, computed ) {
+ if ( computed ) {
+ // Support: Android 2.3
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
+ // Work around by temporarily setting element display to inline-block
+ return jQuery.swap( elem, { "display": "inline-block" },
+ curCSS, [ elem, "marginRight" ] );
+ }
+ }
+ };
+ }
+
+ // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
+ // getComputedStyle returns percent when specified for top/left/bottom/right
+ // rather than make the css module depend on the offset module, we just check for it here
+ if ( !jQuery.support.pixelPosition && jQuery.fn.position ) {
+ jQuery.each( [ "top", "left" ], function( i, prop ) {
+ jQuery.cssHooks[ prop ] = {
+ get: function( elem, computed ) {
+ if ( computed ) {
+ computed = curCSS( elem, prop );
+ // if curCSS returns percentage, fallback to offset
+ return rnumnonpx.test( computed ) ?
+ jQuery( elem ).position()[ prop ] + "px" :
+ computed;
+ }
+ }
+ };
+ });
+ }
+
+});
+
+if ( jQuery.expr && jQuery.expr.filters ) {
+ jQuery.expr.filters.hidden = function( elem ) {
+ // Support: Opera <= 12.12
+ // Opera reports offsetWidths and offsetHeights less than zero on some elements
+ return elem.offsetWidth <= 0 && elem.offsetHeight <= 0;
+ };
+
+ jQuery.expr.filters.visible = function( elem ) {
+ return !jQuery.expr.filters.hidden( elem );
+ };
+}
+
+// These hooks are used by animate to expand properties
+jQuery.each({
+ margin: "",
+ padding: "",
+ border: "Width"
+}, function( prefix, suffix ) {
+ jQuery.cssHooks[ prefix + suffix ] = {
+ expand: function( value ) {
+ var i = 0,
+ expanded = {},
+
+ // assumes a single number if not a string
+ parts = typeof value === "string" ? value.split(" ") : [ value ];
+
+ for ( ; i < 4; i++ ) {
+ expanded[ prefix + cssExpand[ i ] + suffix ] =
+ parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
+ }
+
+ return expanded;
+ }
+ };
+
+ if ( !rmargin.test( prefix ) ) {
+ jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
+ }
+});
+var r20 = /%20/g,
+ rbracket = /\[\]$/,
+ rCRLF = /\r?\n/g,
+ rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
+ rsubmittable = /^(?:input|select|textarea|keygen)/i;
+
+jQuery.fn.extend({
+ serialize: function() {
+ return jQuery.param( this.serializeArray() );
+ },
+ serializeArray: function() {
+ return this.map(function(){
+ // Can add propHook for "elements" to filter or add form elements
+ var elements = jQuery.prop( this, "elements" );
+ return elements ? jQuery.makeArray( elements ) : this;
+ })
+ .filter(function(){
+ var type = this.type;
+ // Use .is(":disabled") so that fieldset[disabled] works
+ return this.name && !jQuery( this ).is( ":disabled" ) &&
+ rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
+ ( this.checked || !manipulation_rcheckableType.test( type ) );
+ })
+ .map(function( i, elem ){
+ var val = jQuery( this ).val();
+
+ return val == null ?
+ null :
+ jQuery.isArray( val ) ?
+ jQuery.map( val, function( val ){
+ return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
+ }) :
+ { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
+ }).get();
+ }
+});
+
+//Serialize an array of form elements or a set of
+//key/values into a query string
+jQuery.param = function( a, traditional ) {
+ var prefix,
+ s = [],
+ add = function( key, value ) {
+ // If value is a function, invoke it and return its value
+ value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
+ s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
+ };
+
+ // Set traditional to true for jQuery <= 1.3.2 behavior.
+ if ( traditional === undefined ) {
+ traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
+ }
+
+ // If an array was passed in, assume that it is an array of form elements.
+ if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
+ // Serialize the form elements
+ jQuery.each( a, function() {
+ add( this.name, this.value );
+ });
+
+ } else {
+ // If traditional, encode the "old" way (the way 1.3.2 or older
+ // did it), otherwise encode params recursively.
+ for ( prefix in a ) {
+ buildParams( prefix, a[ prefix ], traditional, add );
+ }
+ }
+
+ // Return the resulting serialization
+ return s.join( "&" ).replace( r20, "+" );
+};
+
+function buildParams( prefix, obj, traditional, add ) {
+ var name;
+
+ if ( jQuery.isArray( obj ) ) {
+ // Serialize array item.
+ jQuery.each( obj, function( i, v ) {
+ if ( traditional || rbracket.test( prefix ) ) {
+ // Treat each array item as a scalar.
+ add( prefix, v );
+
+ } else {
+ // Item is non-scalar (array or object), encode its numeric index.
+ buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
+ }
+ });
+
+ } else if ( !traditional && jQuery.type( obj ) === "object" ) {
+ // Serialize object item.
+ for ( name in obj ) {
+ buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
+ }
+
+ } else {
+ // Serialize scalar item.
+ add( prefix, obj );
+ }
+}
+jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
+ "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
+ "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
+
+ // Handle event binding
+ jQuery.fn[ name ] = function( data, fn ) {
+ return arguments.length > 0 ?
+ this.on( name, null, data, fn ) :
+ this.trigger( name );
+ };
+});
+
+jQuery.fn.extend({
+ hover: function( fnOver, fnOut ) {
+ return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
+ },
+
+ bind: function( types, data, fn ) {
+ return this.on( types, null, data, fn );
+ },
+ unbind: function( types, fn ) {
+ return this.off( types, null, fn );
+ },
+
+ delegate: function( selector, types, data, fn ) {
+ return this.on( types, selector, data, fn );
+ },
+ undelegate: function( selector, types, fn ) {
+ // ( namespace ) or ( selector, types [, fn] )
+ return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
+ }
+});
+var
+ // Document location
+ ajaxLocParts,
+ ajaxLocation,
+
+ ajax_nonce = jQuery.now(),
+
+ ajax_rquery = /\?/,
+ rhash = /#.*$/,
+ rts = /([?&])_=[^&]*/,
+ rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
+ // #7653, #8125, #8152: local protocol detection
+ rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
+ rnoContent = /^(?:GET|HEAD)$/,
+ rprotocol = /^\/\//,
+ rurl = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,
+
+ // Keep a copy of the old load method
+ _load = jQuery.fn.load,
+
+ /* Prefilters
+ * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
+ * 2) These are called:
+ * - BEFORE asking for a transport
+ * - AFTER param serialization (s.data is a string if s.processData is true)
+ * 3) key is the dataType
+ * 4) the catchall symbol "*" can be used
+ * 5) execution will start with transport dataType and THEN continue down to "*" if needed
+ */
+ prefilters = {},
+
+ /* Transports bindings
+ * 1) key is the dataType
+ * 2) the catchall symbol "*" can be used
+ * 3) selection will start with transport dataType and THEN go to "*" if needed
+ */
+ transports = {},
+
+ // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
+ allTypes = "*/".concat("*");
+
+// #8138, IE may throw an exception when accessing
+// a field from window.location if document.domain has been set
+try {
+ ajaxLocation = location.href;
+} catch( e ) {
+ // Use the href attribute of an A element
+ // since IE will modify it given document.location
+ ajaxLocation = document.createElement( "a" );
+ ajaxLocation.href = "";
+ ajaxLocation = ajaxLocation.href;
+}
+
+// Segment location into parts
+ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
+
+// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
+function addToPrefiltersOrTransports( structure ) {
+
+ // dataTypeExpression is optional and defaults to "*"
+ return function( dataTypeExpression, func ) {
+
+ if ( typeof dataTypeExpression !== "string" ) {
+ func = dataTypeExpression;
+ dataTypeExpression = "*";
+ }
+
+ var dataType,
+ i = 0,
+ dataTypes = dataTypeExpression.toLowerCase().match( core_rnotwhite ) || [];
+
+ if ( jQuery.isFunction( func ) ) {
+ // For each dataType in the dataTypeExpression
+ while ( (dataType = dataTypes[i++]) ) {
+ // Prepend if requested
+ if ( dataType[0] === "+" ) {
+ dataType = dataType.slice( 1 ) || "*";
+ (structure[ dataType ] = structure[ dataType ] || []).unshift( func );
+
+ // Otherwise append
+ } else {
+ (structure[ dataType ] = structure[ dataType ] || []).push( func );
+ }
+ }
+ }
+ };
+}
+
+// Base inspection function for prefilters and transports
+function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
+
+ var inspected = {},
+ seekingTransport = ( structure === transports );
+
+ function inspect( dataType ) {
+ var selected;
+ inspected[ dataType ] = true;
+ jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
+ var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
+ if( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
+ options.dataTypes.unshift( dataTypeOrTransport );
+ inspect( dataTypeOrTransport );
+ return false;
+ } else if ( seekingTransport ) {
+ return !( selected = dataTypeOrTransport );
+ }
+ });
+ return selected;
+ }
+
+ return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
+}
+
+// A special extend for ajax options
+// that takes "flat" options (not to be deep extended)
+// Fixes #9887
+function ajaxExtend( target, src ) {
+ var key, deep,
+ flatOptions = jQuery.ajaxSettings.flatOptions || {};
+
+ for ( key in src ) {
+ if ( src[ key ] !== undefined ) {
+ ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];
+ }
+ }
+ if ( deep ) {
+ jQuery.extend( true, target, deep );
+ }
+
+ return target;
+}
+
+jQuery.fn.load = function( url, params, callback ) {
+ if ( typeof url !== "string" && _load ) {
+ return _load.apply( this, arguments );
+ }
+
+ var selector, type, response,
+ self = this,
+ off = url.indexOf(" ");
+
+ if ( off >= 0 ) {
+ selector = url.slice( off );
+ url = url.slice( 0, off );
+ }
+
+ // If it's a function
+ if ( jQuery.isFunction( params ) ) {
+
+ // We assume that it's the callback
+ callback = params;
+ params = undefined;
+
+ // Otherwise, build a param string
+ } else if ( params && typeof params === "object" ) {
+ type = "POST";
+ }
+
+ // If we have elements to modify, make the request
+ if ( self.length > 0 ) {
+ jQuery.ajax({
+ url: url,
+
+ // if "type" variable is undefined, then "GET" method will be used
+ type: type,
+ dataType: "html",
+ data: params
+ }).done(function( responseText ) {
+
+ // Save response for use in complete callback
+ response = arguments;
+
+ self.html( selector ?
+
+ // If a selector was specified, locate the right elements in a dummy div
+ // Exclude scripts to avoid IE 'Permission Denied' errors
+ jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) :
+
+ // Otherwise use the full result
+ responseText );
+
+ }).complete( callback && function( jqXHR, status ) {
+ self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
+ });
+ }
+
+ return this;
+};
+
+// Attach a bunch of functions for handling common AJAX events
+jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ){
+ jQuery.fn[ type ] = function( fn ){
+ return this.on( type, fn );
+ };
+});
+
+jQuery.extend({
+
+ // Counter for holding the number of active queries
+ active: 0,
+
+ // Last-Modified header cache for next request
+ lastModified: {},
+ etag: {},
+
+ ajaxSettings: {
+ url: ajaxLocation,
+ type: "GET",
+ isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
+ global: true,
+ processData: true,
+ async: true,
+ contentType: "application/x-www-form-urlencoded; charset=UTF-8",
+ /*
+ timeout: 0,
+ data: null,
+ dataType: null,
+ username: null,
+ password: null,
+ cache: null,
+ throws: false,
+ traditional: false,
+ headers: {},
+ */
+
+ accepts: {
+ "*": allTypes,
+ text: "text/plain",
+ html: "text/html",
+ xml: "application/xml, text/xml",
+ json: "application/json, text/javascript"
+ },
+
+ contents: {
+ xml: /xml/,
+ html: /html/,
+ json: /json/
+ },
+
+ responseFields: {
+ xml: "responseXML",
+ text: "responseText",
+ json: "responseJSON"
+ },
+
+ // Data converters
+ // Keys separate source (or catchall "*") and destination types with a single space
+ converters: {
+
+ // Convert anything to text
+ "* text": String,
+
+ // Text to html (true = no transformation)
+ "text html": true,
+
+ // Evaluate text as a json expression
+ "text json": jQuery.parseJSON,
+
+ // Parse text as xml
+ "text xml": jQuery.parseXML
+ },
+
+ // For options that shouldn't be deep extended:
+ // you can add your own custom options here if
+ // and when you create one that shouldn't be
+ // deep extended (see ajaxExtend)
+ flatOptions: {
+ url: true,
+ context: true
+ }
+ },
+
+ // Creates a full fledged settings object into target
+ // with both ajaxSettings and settings fields.
+ // If target is omitted, writes into ajaxSettings.
+ ajaxSetup: function( target, settings ) {
+ return settings ?
+
+ // Building a settings object
+ ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
+
+ // Extending ajaxSettings
+ ajaxExtend( jQuery.ajaxSettings, target );
+ },
+
+ ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
+ ajaxTransport: addToPrefiltersOrTransports( transports ),
+
+ // Main method
+ ajax: function( url, options ) {
+
+ // If url is an object, simulate pre-1.5 signature
+ if ( typeof url === "object" ) {
+ options = url;
+ url = undefined;
+ }
+
+ // Force options to be an object
+ options = options || {};
+
+ var transport,
+ // URL without anti-cache param
+ cacheURL,
+ // Response headers
+ responseHeadersString,
+ responseHeaders,
+ // timeout handle
+ timeoutTimer,
+ // Cross-domain detection vars
+ parts,
+ // To know if global events are to be dispatched
+ fireGlobals,
+ // Loop variable
+ i,
+ // Create the final options object
+ s = jQuery.ajaxSetup( {}, options ),
+ // Callbacks context
+ callbackContext = s.context || s,
+ // Context for global events is callbackContext if it is a DOM node or jQuery collection
+ globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
+ jQuery( callbackContext ) :
+ jQuery.event,
+ // Deferreds
+ deferred = jQuery.Deferred(),
+ completeDeferred = jQuery.Callbacks("once memory"),
+ // Status-dependent callbacks
+ statusCode = s.statusCode || {},
+ // Headers (they are sent all at once)
+ requestHeaders = {},
+ requestHeadersNames = {},
+ // The jqXHR state
+ state = 0,
+ // Default abort message
+ strAbort = "canceled",
+ // Fake xhr
+ jqXHR = {
+ readyState: 0,
+
+ // Builds headers hashtable if needed
+ getResponseHeader: function( key ) {
+ var match;
+ if ( state === 2 ) {
+ if ( !responseHeaders ) {
+ responseHeaders = {};
+ while ( (match = rheaders.exec( responseHeadersString )) ) {
+ responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
+ }
+ }
+ match = responseHeaders[ key.toLowerCase() ];
+ }
+ return match == null ? null : match;
+ },
+
+ // Raw string
+ getAllResponseHeaders: function() {
+ return state === 2 ? responseHeadersString : null;
+ },
+
+ // Caches the header
+ setRequestHeader: function( name, value ) {
+ var lname = name.toLowerCase();
+ if ( !state ) {
+ name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
+ requestHeaders[ name ] = value;
+ }
+ return this;
+ },
+
+ // Overrides response content-type header
+ overrideMimeType: function( type ) {
+ if ( !state ) {
+ s.mimeType = type;
+ }
+ return this;
+ },
+
+ // Status-dependent callbacks
+ statusCode: function( map ) {
+ var code;
+ if ( map ) {
+ if ( state < 2 ) {
+ for ( code in map ) {
+ // Lazy-add the new callback in a way that preserves old ones
+ statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
+ }
+ } else {
+ // Execute the appropriate callbacks
+ jqXHR.always( map[ jqXHR.status ] );
+ }
+ }
+ return this;
+ },
+
+ // Cancel the request
+ abort: function( statusText ) {
+ var finalText = statusText || strAbort;
+ if ( transport ) {
+ transport.abort( finalText );
+ }
+ done( 0, finalText );
+ return this;
+ }
+ };
+
+ // Attach deferreds
+ deferred.promise( jqXHR ).complete = completeDeferred.add;
+ jqXHR.success = jqXHR.done;
+ jqXHR.error = jqXHR.fail;
+
+ // Remove hash character (#7531: and string promotion)
+ // Add protocol if not provided (prefilters might expect it)
+ // Handle falsy url in the settings object (#10093: consistency with old signature)
+ // We also use the url parameter if available
+ s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" )
+ .replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
+
+ // Alias method option to type as per ticket #12004
+ s.type = options.method || options.type || s.method || s.type;
+
+ // Extract dataTypes list
+ s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( core_rnotwhite ) || [""];
+
+ // A cross-domain request is in order when we have a protocol:host:port mismatch
+ if ( s.crossDomain == null ) {
+ parts = rurl.exec( s.url.toLowerCase() );
+ s.crossDomain = !!( parts &&
+ ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
+ ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
+ ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) )
+ );
+ }
+
+ // Convert data if not already a string
+ if ( s.data && s.processData && typeof s.data !== "string" ) {
+ s.data = jQuery.param( s.data, s.traditional );
+ }
+
+ // Apply prefilters
+ inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
+
+ // If request was aborted inside a prefilter, stop there
+ if ( state === 2 ) {
+ return jqXHR;
+ }
+
+ // We can fire global events as of now if asked to
+ fireGlobals = s.global;
+
+ // Watch for a new set of requests
+ if ( fireGlobals && jQuery.active++ === 0 ) {
+ jQuery.event.trigger("ajaxStart");
+ }
+
+ // Uppercase the type
+ s.type = s.type.toUpperCase();
+
+ // Determine if request has content
+ s.hasContent = !rnoContent.test( s.type );
+
+ // Save the URL in case we're toying with the If-Modified-Since
+ // and/or If-None-Match header later on
+ cacheURL = s.url;
+
+ // More options handling for requests with no content
+ if ( !s.hasContent ) {
+
+ // If data is available, append data to url
+ if ( s.data ) {
+ cacheURL = ( s.url += ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
+ // #9682: remove data so that it's not used in an eventual retry
+ delete s.data;
+ }
+
+ // Add anti-cache in url if needed
+ if ( s.cache === false ) {
+ s.url = rts.test( cacheURL ) ?
+
+ // If there is already a '_' parameter, set its value
+ cacheURL.replace( rts, "$1_=" + ajax_nonce++ ) :
+
+ // Otherwise add one to the end
+ cacheURL + ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ajax_nonce++;
+ }
+ }
+
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+ if ( s.ifModified ) {
+ if ( jQuery.lastModified[ cacheURL ] ) {
+ jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
+ }
+ if ( jQuery.etag[ cacheURL ] ) {
+ jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
+ }
+ }
+
+ // Set the correct header, if data is being sent
+ if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
+ jqXHR.setRequestHeader( "Content-Type", s.contentType );
+ }
+
+ // Set the Accepts header for the server, depending on the dataType
+ jqXHR.setRequestHeader(
+ "Accept",
+ s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
+ s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
+ s.accepts[ "*" ]
+ );
+
+ // Check for headers option
+ for ( i in s.headers ) {
+ jqXHR.setRequestHeader( i, s.headers[ i ] );
+ }
+
+ // Allow custom headers/mimetypes and early abort
+ if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
+ // Abort if not done already and return
+ return jqXHR.abort();
+ }
+
+ // aborting is no longer a cancellation
+ strAbort = "abort";
+
+ // Install callbacks on deferreds
+ for ( i in { success: 1, error: 1, complete: 1 } ) {
+ jqXHR[ i ]( s[ i ] );
+ }
+
+ // Get transport
+ transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
+
+ // If no transport, we auto-abort
+ if ( !transport ) {
+ done( -1, "No Transport" );
+ } else {
+ jqXHR.readyState = 1;
+
+ // Send global event
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
+ }
+ // Timeout
+ if ( s.async && s.timeout > 0 ) {
+ timeoutTimer = setTimeout(function() {
+ jqXHR.abort("timeout");
+ }, s.timeout );
+ }
+
+ try {
+ state = 1;
+ transport.send( requestHeaders, done );
+ } catch ( e ) {
+ // Propagate exception as error if not done
+ if ( state < 2 ) {
+ done( -1, e );
+ // Simply rethrow otherwise
+ } else {
+ throw e;
+ }
+ }
+ }
+
+ // Callback for when everything is done
+ function done( status, nativeStatusText, responses, headers ) {
+ var isSuccess, success, error, response, modified,
+ statusText = nativeStatusText;
+
+ // Called once
+ if ( state === 2 ) {
+ return;
+ }
+
+ // State is "done" now
+ state = 2;
+
+ // Clear timeout if it exists
+ if ( timeoutTimer ) {
+ clearTimeout( timeoutTimer );
+ }
+
+ // Dereference transport for early garbage collection
+ // (no matter how long the jqXHR object will be used)
+ transport = undefined;
+
+ // Cache response headers
+ responseHeadersString = headers || "";
+
+ // Set readyState
+ jqXHR.readyState = status > 0 ? 4 : 0;
+
+ // Determine if successful
+ isSuccess = status >= 200 && status < 300 || status === 304;
+
+ // Get response data
+ if ( responses ) {
+ response = ajaxHandleResponses( s, jqXHR, responses );
+ }
+
+ // Convert no matter what (that way responseXXX fields are always set)
+ response = ajaxConvert( s, response, jqXHR, isSuccess );
+
+ // If successful, handle type chaining
+ if ( isSuccess ) {
+
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+ if ( s.ifModified ) {
+ modified = jqXHR.getResponseHeader("Last-Modified");
+ if ( modified ) {
+ jQuery.lastModified[ cacheURL ] = modified;
+ }
+ modified = jqXHR.getResponseHeader("etag");
+ if ( modified ) {
+ jQuery.etag[ cacheURL ] = modified;
+ }
+ }
+
+ // if no content
+ if ( status === 204 || s.type === "HEAD" ) {
+ statusText = "nocontent";
+
+ // if not modified
+ } else if ( status === 304 ) {
+ statusText = "notmodified";
+
+ // If we have data, let's convert it
+ } else {
+ statusText = response.state;
+ success = response.data;
+ error = response.error;
+ isSuccess = !error;
+ }
+ } else {
+ // We extract error from statusText
+ // then normalize statusText and status for non-aborts
+ error = statusText;
+ if ( status || !statusText ) {
+ statusText = "error";
+ if ( status < 0 ) {
+ status = 0;
+ }
+ }
+ }
+
+ // Set data for the fake xhr object
+ jqXHR.status = status;
+ jqXHR.statusText = ( nativeStatusText || statusText ) + "";
+
+ // Success/Error
+ if ( isSuccess ) {
+ deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
+ } else {
+ deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
+ }
+
+ // Status-dependent callbacks
+ jqXHR.statusCode( statusCode );
+ statusCode = undefined;
+
+ if ( fireGlobals ) {
+ globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
+ [ jqXHR, s, isSuccess ? success : error ] );
+ }
+
+ // Complete
+ completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
+
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
+ // Handle the global AJAX counter
+ if ( !( --jQuery.active ) ) {
+ jQuery.event.trigger("ajaxStop");
+ }
+ }
+ }
+
+ return jqXHR;
+ },
+
+ getJSON: function( url, data, callback ) {
+ return jQuery.get( url, data, callback, "json" );
+ },
+
+ getScript: function( url, callback ) {
+ return jQuery.get( url, undefined, callback, "script" );
+ }
+});
+
+jQuery.each( [ "get", "post" ], function( i, method ) {
+ jQuery[ method ] = function( url, data, callback, type ) {
+ // shift arguments if data argument was omitted
+ if ( jQuery.isFunction( data ) ) {
+ type = type || callback;
+ callback = data;
+ data = undefined;
+ }
+
+ return jQuery.ajax({
+ url: url,
+ type: method,
+ dataType: type,
+ data: data,
+ success: callback
+ });
+ };
+});
+
+/* Handles responses to an ajax request:
+ * - finds the right dataType (mediates between content-type and expected dataType)
+ * - returns the corresponding response
+ */
+function ajaxHandleResponses( s, jqXHR, responses ) {
+
+ var ct, type, finalDataType, firstDataType,
+ contents = s.contents,
+ dataTypes = s.dataTypes;
+
+ // Remove auto dataType and get content-type in the process
+ while( dataTypes[ 0 ] === "*" ) {
+ dataTypes.shift();
+ if ( ct === undefined ) {
+ ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
+ }
+ }
+
+ // Check if we're dealing with a known content-type
+ if ( ct ) {
+ for ( type in contents ) {
+ if ( contents[ type ] && contents[ type ].test( ct ) ) {
+ dataTypes.unshift( type );
+ break;
+ }
+ }
+ }
+
+ // Check to see if we have a response for the expected dataType
+ if ( dataTypes[ 0 ] in responses ) {
+ finalDataType = dataTypes[ 0 ];
+ } else {
+ // Try convertible dataTypes
+ for ( type in responses ) {
+ if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
+ finalDataType = type;
+ break;
+ }
+ if ( !firstDataType ) {
+ firstDataType = type;
+ }
+ }
+ // Or just use first one
+ finalDataType = finalDataType || firstDataType;
+ }
+
+ // If we found a dataType
+ // We add the dataType to the list if needed
+ // and return the corresponding response
+ if ( finalDataType ) {
+ if ( finalDataType !== dataTypes[ 0 ] ) {
+ dataTypes.unshift( finalDataType );
+ }
+ return responses[ finalDataType ];
+ }
+}
+
+/* Chain conversions given the request and the original response
+ * Also sets the responseXXX fields on the jqXHR instance
+ */
+function ajaxConvert( s, response, jqXHR, isSuccess ) {
+ var conv2, current, conv, tmp, prev,
+ converters = {},
+ // Work with a copy of dataTypes in case we need to modify it for conversion
+ dataTypes = s.dataTypes.slice();
+
+ // Create converters map with lowercased keys
+ if ( dataTypes[ 1 ] ) {
+ for ( conv in s.converters ) {
+ converters[ conv.toLowerCase() ] = s.converters[ conv ];
+ }
+ }
+
+ current = dataTypes.shift();
+
+ // Convert to each sequential dataType
+ while ( current ) {
+
+ if ( s.responseFields[ current ] ) {
+ jqXHR[ s.responseFields[ current ] ] = response;
+ }
+
+ // Apply the dataFilter if provided
+ if ( !prev && isSuccess && s.dataFilter ) {
+ response = s.dataFilter( response, s.dataType );
+ }
+
+ prev = current;
+ current = dataTypes.shift();
+
+ if ( current ) {
+
+ // There's only work to do if current dataType is non-auto
+ if ( current === "*" ) {
+
+ current = prev;
+
+ // Convert response if prev dataType is non-auto and differs from current
+ } else if ( prev !== "*" && prev !== current ) {
+
+ // Seek a direct converter
+ conv = converters[ prev + " " + current ] || converters[ "* " + current ];
+
+ // If none found, seek a pair
+ if ( !conv ) {
+ for ( conv2 in converters ) {
+
+ // If conv2 outputs current
+ tmp = conv2.split( " " );
+ if ( tmp[ 1 ] === current ) {
+
+ // If prev can be converted to accepted input
+ conv = converters[ prev + " " + tmp[ 0 ] ] ||
+ converters[ "* " + tmp[ 0 ] ];
+ if ( conv ) {
+ // Condense equivalence converters
+ if ( conv === true ) {
+ conv = converters[ conv2 ];
+
+ // Otherwise, insert the intermediate dataType
+ } else if ( converters[ conv2 ] !== true ) {
+ current = tmp[ 0 ];
+ dataTypes.unshift( tmp[ 1 ] );
+ }
+ break;
+ }
+ }
+ }
+ }
+
+ // Apply converter (if not an equivalence)
+ if ( conv !== true ) {
+
+ // Unless errors are allowed to bubble, catch and return them
+ if ( conv && s[ "throws" ] ) {
+ response = conv( response );
+ } else {
+ try {
+ response = conv( response );
+ } catch ( e ) {
+ return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return { state: "success", data: response };
+}
+// Install script dataType
+jQuery.ajaxSetup({
+ accepts: {
+ script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
+ },
+ contents: {
+ script: /(?:java|ecma)script/
+ },
+ converters: {
+ "text script": function( text ) {
+ jQuery.globalEval( text );
+ return text;
+ }
+ }
+});
+
+// Handle cache's special case and crossDomain
+jQuery.ajaxPrefilter( "script", function( s ) {
+ if ( s.cache === undefined ) {
+ s.cache = false;
+ }
+ if ( s.crossDomain ) {
+ s.type = "GET";
+ }
+});
+
+// Bind script tag hack transport
+jQuery.ajaxTransport( "script", function( s ) {
+ // This transport only deals with cross domain requests
+ if ( s.crossDomain ) {
+ var script, callback;
+ return {
+ send: function( _, complete ) {
+ script = jQuery("<script>").prop({
+ async: true,
+ charset: s.scriptCharset,
+ src: s.url
+ }).on(
+ "load error",
+ callback = function( evt ) {
+ script.remove();
+ callback = null;
+ if ( evt ) {
+ complete( evt.type === "error" ? 404 : 200, evt.type );
+ }
+ }
+ );
+ document.head.appendChild( script[ 0 ] );
+ },
+ abort: function() {
+ if ( callback ) {
+ callback();
+ }
+ }
+ };
+ }
+});
+var oldCallbacks = [],
+ rjsonp = /(=)\?(?=&|$)|\?\?/;
+
+// Default jsonp settings
+jQuery.ajaxSetup({
+ jsonp: "callback",
+ jsonpCallback: function() {
+ var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( ajax_nonce++ ) );
+ this[ callback ] = true;
+ return callback;
+ }
+});
+
+// Detect, normalize options and install callbacks for jsonp requests
+jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
+
+ var callbackName, overwritten, responseContainer,
+ jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
+ "url" :
+ typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"
+ );
+
+ // Handle iff the expected data type is "jsonp" or we have a parameter to set
+ if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
+
+ // Get callback name, remembering preexisting value associated with it
+ callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
+ s.jsonpCallback() :
+ s.jsonpCallback;
+
+ // Insert callback into url or form data
+ if ( jsonProp ) {
+ s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
+ } else if ( s.jsonp !== false ) {
+ s.url += ( ajax_rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
+ }
+
+ // Use data converter to retrieve json after script execution
+ s.converters["script json"] = function() {
+ if ( !responseContainer ) {
+ jQuery.error( callbackName + " was not called" );
+ }
+ return responseContainer[ 0 ];
+ };
+
+ // force json dataType
+ s.dataTypes[ 0 ] = "json";
+
+ // Install callback
+ overwritten = window[ callbackName ];
+ window[ callbackName ] = function() {
+ responseContainer = arguments;
+ };
+
+ // Clean-up function (fires after converters)
+ jqXHR.always(function() {
+ // Restore preexisting value
+ window[ callbackName ] = overwritten;
+
+ // Save back as free
+ if ( s[ callbackName ] ) {
+ // make sure that re-using the options doesn't screw things around
+ s.jsonpCallback = originalSettings.jsonpCallback;
+
+ // save the callback name for future use
+ oldCallbacks.push( callbackName );
+ }
+
+ // Call if it was a function and we have a response
+ if ( responseContainer && jQuery.isFunction( overwritten ) ) {
+ overwritten( responseContainer[ 0 ] );
+ }
+
+ responseContainer = overwritten = undefined;
+ });
+
+ // Delegate to script
+ return "script";
+ }
+});
+jQuery.ajaxSettings.xhr = function() {
+ try {
+ return new XMLHttpRequest();
+ } catch( e ) {}
+};
+
+var xhrSupported = jQuery.ajaxSettings.xhr(),
+ xhrSuccessStatus = {
+ // file protocol always yields status code 0, assume 200
+ 0: 200,
+ // Support: IE9
+ // #1450: sometimes IE returns 1223 when it should be 204
+ 1223: 204
+ },
+ // Support: IE9
+ // We need to keep track of outbound xhr and abort them manually
+ // because IE is not smart enough to do it all by itself
+ xhrId = 0,
+ xhrCallbacks = {};
+
+if ( window.ActiveXObject ) {
+ jQuery( window ).on( "unload", function() {
+ for( var key in xhrCallbacks ) {
+ xhrCallbacks[ key ]();
+ }
+ xhrCallbacks = undefined;
+ });
+}
+
+jQuery.support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
+jQuery.support.ajax = xhrSupported = !!xhrSupported;
+
+jQuery.ajaxTransport(function( options ) {
+ var callback;
+ // Cross domain only allowed if supported through XMLHttpRequest
+ if ( jQuery.support.cors || xhrSupported && !options.crossDomain ) {
+ return {
+ send: function( headers, complete ) {
+ var i, id,
+ xhr = options.xhr();
+ xhr.open( options.type, options.url, options.async, options.username, options.password );
+ // Apply custom fields if provided
+ if ( options.xhrFields ) {
+ for ( i in options.xhrFields ) {
+ xhr[ i ] = options.xhrFields[ i ];
+ }
+ }
+ // Override mime type if needed
+ if ( options.mimeType && xhr.overrideMimeType ) {
+ xhr.overrideMimeType( options.mimeType );
+ }
+ // X-Requested-With header
+ // For cross-domain requests, seeing as conditions for a preflight are
+ // akin to a jigsaw puzzle, we simply never set it to be sure.
+ // (it can always be set on a per-request basis or even using ajaxSetup)
+ // For same-domain requests, won't change header if already provided.
+ if ( !options.crossDomain && !headers["X-Requested-With"] ) {
+ headers["X-Requested-With"] = "XMLHttpRequest";
+ }
+ // Set headers
+ for ( i in headers ) {
+ xhr.setRequestHeader( i, headers[ i ] );
+ }
+ // Callback
+ callback = function( type ) {
+ return function() {
+ if ( callback ) {
+ delete xhrCallbacks[ id ];
+ callback = xhr.onload = xhr.onerror = null;
+ if ( type === "abort" ) {
+ xhr.abort();
+ } else if ( type === "error" ) {
+ complete(
+ // file protocol always yields status 0, assume 404
+ xhr.status || 404,
+ xhr.statusText
+ );
+ } else {
+ complete(
+ xhrSuccessStatus[ xhr.status ] || xhr.status,
+ xhr.statusText,
+ // Support: IE9
+ // #11426: When requesting binary data, IE9 will throw an exception
+ // on any attempt to access responseText
+ typeof xhr.responseText === "string" ? {
+ text: xhr.responseText
+ } : undefined,
+ xhr.getAllResponseHeaders()
+ );
+ }
+ }
+ };
+ };
+ // Listen to events
+ xhr.onload = callback();
+ xhr.onerror = callback("error");
+ // Create the abort callback
+ callback = xhrCallbacks[( id = xhrId++ )] = callback("abort");
+ // Do send the request
+ // This may raise an exception which is actually
+ // handled in jQuery.ajax (so no try/catch here)
+ xhr.send( options.hasContent && options.data || null );
+ },
+ abort: function() {
+ if ( callback ) {
+ callback();
+ }
+ }
+ };
+ }
+});
+var fxNow, timerId,
+ rfxtypes = /^(?:toggle|show|hide)$/,
+ rfxnum = new RegExp( "^(?:([+-])=|)(" + core_pnum + ")([a-z%]*)$", "i" ),
+ rrun = /queueHooks$/,
+ animationPrefilters = [ defaultPrefilter ],
+ tweeners = {
+ "*": [function( prop, value ) {
+ var tween = this.createTween( prop, value ),
+ target = tween.cur(),
+ parts = rfxnum.exec( value ),
+ unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
+
+ // Starting value computation is required for potential unit mismatches
+ start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) &&
+ rfxnum.exec( jQuery.css( tween.elem, prop ) ),
+ scale = 1,
+ maxIterations = 20;
+
+ if ( start && start[ 3 ] !== unit ) {
+ // Trust units reported by jQuery.css
+ unit = unit || start[ 3 ];
+
+ // Make sure we update the tween properties later on
+ parts = parts || [];
+
+ // Iteratively approximate from a nonzero starting point
+ start = +target || 1;
+
+ do {
+ // If previous iteration zeroed out, double until we get *something*
+ // Use a string for doubling factor so we don't accidentally see scale as unchanged below
+ scale = scale || ".5";
+
+ // Adjust and apply
+ start = start / scale;
+ jQuery.style( tween.elem, prop, start + unit );
+
+ // Update scale, tolerating zero or NaN from tween.cur()
+ // And breaking the loop if scale is unchanged or perfect, or if we've just had enough
+ } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
+ }
+
+ // Update tween properties
+ if ( parts ) {
+ start = tween.start = +start || +target || 0;
+ tween.unit = unit;
+ // If a +=/-= token was provided, we're doing a relative animation
+ tween.end = parts[ 1 ] ?
+ start + ( parts[ 1 ] + 1 ) * parts[ 2 ] :
+ +parts[ 2 ];
+ }
+
+ return tween;
+ }]
+ };
+
+// Animations created synchronously will run synchronously
+function createFxNow() {
+ setTimeout(function() {
+ fxNow = undefined;
+ });
+ return ( fxNow = jQuery.now() );
+}
+
+function createTween( value, prop, animation ) {
+ var tween,
+ collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
+ index = 0,
+ length = collection.length;
+ for ( ; index < length; index++ ) {
+ if ( (tween = collection[ index ].call( animation, prop, value )) ) {
+
+ // we're done with this property
+ return tween;
+ }
+ }
+}
+
+function Animation( elem, properties, options ) {
+ var result,
+ stopped,
+ index = 0,
+ length = animationPrefilters.length,
+ deferred = jQuery.Deferred().always( function() {
+ // don't match elem in the :animated selector
+ delete tick.elem;
+ }),
+ tick = function() {
+ if ( stopped ) {
+ return false;
+ }
+ var currentTime = fxNow || createFxNow(),
+ remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
+ // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
+ temp = remaining / animation.duration || 0,
+ percent = 1 - temp,
+ index = 0,
+ length = animation.tweens.length;
+
+ for ( ; index < length ; index++ ) {
+ animation.tweens[ index ].run( percent );
+ }
+
+ deferred.notifyWith( elem, [ animation, percent, remaining ]);
+
+ if ( percent < 1 && length ) {
+ return remaining;
+ } else {
+ deferred.resolveWith( elem, [ animation ] );
+ return false;
+ }
+ },
+ animation = deferred.promise({
+ elem: elem,
+ props: jQuery.extend( {}, properties ),
+ opts: jQuery.extend( true, { specialEasing: {} }, options ),
+ originalProperties: properties,
+ originalOptions: options,
+ startTime: fxNow || createFxNow(),
+ duration: options.duration,
+ tweens: [],
+ createTween: function( prop, end ) {
+ var tween = jQuery.Tween( elem, animation.opts, prop, end,
+ animation.opts.specialEasing[ prop ] || animation.opts.easing );
+ animation.tweens.push( tween );
+ return tween;
+ },
+ stop: function( gotoEnd ) {
+ var index = 0,
+ // if we are going to the end, we want to run all the tweens
+ // otherwise we skip this part
+ length = gotoEnd ? animation.tweens.length : 0;
+ if ( stopped ) {
+ return this;
+ }
+ stopped = true;
+ for ( ; index < length ; index++ ) {
+ animation.tweens[ index ].run( 1 );
+ }
+
+ // resolve when we played the last frame
+ // otherwise, reject
+ if ( gotoEnd ) {
+ deferred.resolveWith( elem, [ animation, gotoEnd ] );
+ } else {
+ deferred.rejectWith( elem, [ animation, gotoEnd ] );
+ }
+ return this;
+ }
+ }),
+ props = animation.props;
+
+ propFilter( props, animation.opts.specialEasing );
+
+ for ( ; index < length ; index++ ) {
+ result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
+ if ( result ) {
+ return result;
+ }
+ }
+
+ jQuery.map( props, createTween, animation );
+
+ if ( jQuery.isFunction( animation.opts.start ) ) {
+ animation.opts.start.call( elem, animation );
+ }
+
+ jQuery.fx.timer(
+ jQuery.extend( tick, {
+ elem: elem,
+ anim: animation,
+ queue: animation.opts.queue
+ })
+ );
+
+ // attach callbacks from options
+ return animation.progress( animation.opts.progress )
+ .done( animation.opts.done, animation.opts.complete )
+ .fail( animation.opts.fail )
+ .always( animation.opts.always );
+}
+
+function propFilter( props, specialEasing ) {
+ var index, name, easing, value, hooks;
+
+ // camelCase, specialEasing and expand cssHook pass
+ for ( index in props ) {
+ name = jQuery.camelCase( index );
+ easing = specialEasing[ name ];
+ value = props[ index ];
+ if ( jQuery.isArray( value ) ) {
+ easing = value[ 1 ];
+ value = props[ index ] = value[ 0 ];
+ }
+
+ if ( index !== name ) {
+ props[ name ] = value;
+ delete props[ index ];
+ }
+
+ hooks = jQuery.cssHooks[ name ];
+ if ( hooks && "expand" in hooks ) {
+ value = hooks.expand( value );
+ delete props[ name ];
+
+ // not quite $.extend, this wont overwrite keys already present.
+ // also - reusing 'index' from above because we have the correct "name"
+ for ( index in value ) {
+ if ( !( index in props ) ) {
+ props[ index ] = value[ index ];
+ specialEasing[ index ] = easing;
+ }
+ }
+ } else {
+ specialEasing[ name ] = easing;
+ }
+ }
+}
+
+jQuery.Animation = jQuery.extend( Animation, {
+
+ tweener: function( props, callback ) {
+ if ( jQuery.isFunction( props ) ) {
+ callback = props;
+ props = [ "*" ];
+ } else {
+ props = props.split(" ");
+ }
+
+ var prop,
+ index = 0,
+ length = props.length;
+
+ for ( ; index < length ; index++ ) {
+ prop = props[ index ];
+ tweeners[ prop ] = tweeners[ prop ] || [];
+ tweeners[ prop ].unshift( callback );
+ }
+ },
+
+ prefilter: function( callback, prepend ) {
+ if ( prepend ) {
+ animationPrefilters.unshift( callback );
+ } else {
+ animationPrefilters.push( callback );
+ }
+ }
+});
+
+function defaultPrefilter( elem, props, opts ) {
+ /* jshint validthis: true */
+ var prop, value, toggle, tween, hooks, oldfire,
+ anim = this,
+ orig = {},
+ style = elem.style,
+ hidden = elem.nodeType && isHidden( elem ),
+ dataShow = data_priv.get( elem, "fxshow" );
+
+ // handle queue: false promises
+ if ( !opts.queue ) {
+ hooks = jQuery._queueHooks( elem, "fx" );
+ if ( hooks.unqueued == null ) {
+ hooks.unqueued = 0;
+ oldfire = hooks.empty.fire;
+ hooks.empty.fire = function() {
+ if ( !hooks.unqueued ) {
+ oldfire();
+ }
+ };
+ }
+ hooks.unqueued++;
+
+ anim.always(function() {
+ // doing this makes sure that the complete handler will be called
+ // before this completes
+ anim.always(function() {
+ hooks.unqueued--;
+ if ( !jQuery.queue( elem, "fx" ).length ) {
+ hooks.empty.fire();
+ }
+ });
+ });
+ }
+
+ // height/width overflow pass
+ if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
+ // Make sure that nothing sneaks out
+ // Record all 3 overflow attributes because IE9-10 do not
+ // change the overflow attribute when overflowX and
+ // overflowY are set to the same value
+ opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
+
+ // Set display property to inline-block for height/width
+ // animations on inline elements that are having width/height animated
+ if ( jQuery.css( elem, "display" ) === "inline" &&
+ jQuery.css( elem, "float" ) === "none" ) {
+
+ style.display = "inline-block";
+ }
+ }
+
+ if ( opts.overflow ) {
+ style.overflow = "hidden";
+ anim.always(function() {
+ style.overflow = opts.overflow[ 0 ];
+ style.overflowX = opts.overflow[ 1 ];
+ style.overflowY = opts.overflow[ 2 ];
+ });
+ }
+
+
+ // show/hide pass
+ for ( prop in props ) {
+ value = props[ prop ];
+ if ( rfxtypes.exec( value ) ) {
+ delete props[ prop ];
+ toggle = toggle || value === "toggle";
+ if ( value === ( hidden ? "hide" : "show" ) ) {
+
+ // If there is dataShow left over from a stopped hide or show and we are going to proceed with show, we should pretend to be hidden
+ if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
+ hidden = true;
+ } else {
+ continue;
+ }
+ }
+ orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
+ }
+ }
+
+ if ( !jQuery.isEmptyObject( orig ) ) {
+ if ( dataShow ) {
+ if ( "hidden" in dataShow ) {
+ hidden = dataShow.hidden;
+ }
+ } else {
+ dataShow = data_priv.access( elem, "fxshow", {} );
+ }
+
+ // store state if its toggle - enables .stop().toggle() to "reverse"
+ if ( toggle ) {
+ dataShow.hidden = !hidden;
+ }
+ if ( hidden ) {
+ jQuery( elem ).show();
+ } else {
+ anim.done(function() {
+ jQuery( elem ).hide();
+ });
+ }
+ anim.done(function() {
+ var prop;
+
+ data_priv.remove( elem, "fxshow" );
+ for ( prop in orig ) {
+ jQuery.style( elem, prop, orig[ prop ] );
+ }
+ });
+ for ( prop in orig ) {
+ tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
+
+ if ( !( prop in dataShow ) ) {
+ dataShow[ prop ] = tween.start;
+ if ( hidden ) {
+ tween.end = tween.start;
+ tween.start = prop === "width" || prop === "height" ? 1 : 0;
+ }
+ }
+ }
+ }
+}
+
+function Tween( elem, options, prop, end, easing ) {
+ return new Tween.prototype.init( elem, options, prop, end, easing );
+}
+jQuery.Tween = Tween;
+
+Tween.prototype = {
+ constructor: Tween,
+ init: function( elem, options, prop, end, easing, unit ) {
+ this.elem = elem;
+ this.prop = prop;
+ this.easing = easing || "swing";
+ this.options = options;
+ this.start = this.now = this.cur();
+ this.end = end;
+ this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
+ },
+ cur: function() {
+ var hooks = Tween.propHooks[ this.prop ];
+
+ return hooks && hooks.get ?
+ hooks.get( this ) :
+ Tween.propHooks._default.get( this );
+ },
+ run: function( percent ) {
+ var eased,
+ hooks = Tween.propHooks[ this.prop ];
+
+ if ( this.options.duration ) {
+ this.pos = eased = jQuery.easing[ this.easing ](
+ percent, this.options.duration * percent, 0, 1, this.options.duration
+ );
+ } else {
+ this.pos = eased = percent;
+ }
+ this.now = ( this.end - this.start ) * eased + this.start;
+
+ if ( this.options.step ) {
+ this.options.step.call( this.elem, this.now, this );
+ }
+
+ if ( hooks && hooks.set ) {
+ hooks.set( this );
+ } else {
+ Tween.propHooks._default.set( this );
+ }
+ return this;
+ }
+};
+
+Tween.prototype.init.prototype = Tween.prototype;
+
+Tween.propHooks = {
+ _default: {
+ get: function( tween ) {
+ var result;
+
+ if ( tween.elem[ tween.prop ] != null &&
+ (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
+ return tween.elem[ tween.prop ];
+ }
+
+ // passing an empty string as a 3rd parameter to .css will automatically
+ // attempt a parseFloat and fallback to a string if the parse fails
+ // so, simple values such as "10px" are parsed to Float.
+ // complex values such as "rotate(1rad)" are returned as is.
+ result = jQuery.css( tween.elem, tween.prop, "" );
+ // Empty strings, null, undefined and "auto" are converted to 0.
+ return !result || result === "auto" ? 0 : result;
+ },
+ set: function( tween ) {
+ // use step hook for back compat - use cssHook if its there - use .style if its
+ // available and use plain properties where available
+ if ( jQuery.fx.step[ tween.prop ] ) {
+ jQuery.fx.step[ tween.prop ]( tween );
+ } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
+ jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
+ } else {
+ tween.elem[ tween.prop ] = tween.now;
+ }
+ }
+ }
+};
+
+// Support: IE9
+// Panic based approach to setting things on disconnected nodes
+
+Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
+ set: function( tween ) {
+ if ( tween.elem.nodeType && tween.elem.parentNode ) {
+ tween.elem[ tween.prop ] = tween.now;
+ }
+ }
+};
+
+jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
+ var cssFn = jQuery.fn[ name ];
+ jQuery.fn[ name ] = function( speed, easing, callback ) {
+ return speed == null || typeof speed === "boolean" ?
+ cssFn.apply( this, arguments ) :
+ this.animate( genFx( name, true ), speed, easing, callback );
+ };
+});
+
+jQuery.fn.extend({
+ fadeTo: function( speed, to, easing, callback ) {
+
+ // show any hidden elements after setting opacity to 0
+ return this.filter( isHidden ).css( "opacity", 0 ).show()
+
+ // animate to the value specified
+ .end().animate({ opacity: to }, speed, easing, callback );
+ },
+ animate: function( prop, speed, easing, callback ) {
+ var empty = jQuery.isEmptyObject( prop ),
+ optall = jQuery.speed( speed, easing, callback ),
+ doAnimation = function() {
+ // Operate on a copy of prop so per-property easing won't be lost
+ var anim = Animation( this, jQuery.extend( {}, prop ), optall );
+
+ // Empty animations, or finishing resolves immediately
+ if ( empty || data_priv.get( this, "finish" ) ) {
+ anim.stop( true );
+ }
+ };
+ doAnimation.finish = doAnimation;
+
+ return empty || optall.queue === false ?
+ this.each( doAnimation ) :
+ this.queue( optall.queue, doAnimation );
+ },
+ stop: function( type, clearQueue, gotoEnd ) {
+ var stopQueue = function( hooks ) {
+ var stop = hooks.stop;
+ delete hooks.stop;
+ stop( gotoEnd );
+ };
+
+ if ( typeof type !== "string" ) {
+ gotoEnd = clearQueue;
+ clearQueue = type;
+ type = undefined;
+ }
+ if ( clearQueue && type !== false ) {
+ this.queue( type || "fx", [] );
+ }
+
+ return this.each(function() {
+ var dequeue = true,
+ index = type != null && type + "queueHooks",
+ timers = jQuery.timers,
+ data = data_priv.get( this );
+
+ if ( index ) {
+ if ( data[ index ] && data[ index ].stop ) {
+ stopQueue( data[ index ] );
+ }
+ } else {
+ for ( index in data ) {
+ if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
+ stopQueue( data[ index ] );
+ }
+ }
+ }
+
+ for ( index = timers.length; index--; ) {
+ if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
+ timers[ index ].anim.stop( gotoEnd );
+ dequeue = false;
+ timers.splice( index, 1 );
+ }
+ }
+
+ // start the next in the queue if the last step wasn't forced
+ // timers currently will call their complete callbacks, which will dequeue
+ // but only if they were gotoEnd
+ if ( dequeue || !gotoEnd ) {
+ jQuery.dequeue( this, type );
+ }
+ });
+ },
+ finish: function( type ) {
+ if ( type !== false ) {
+ type = type || "fx";
+ }
+ return this.each(function() {
+ var index,
+ data = data_priv.get( this ),
+ queue = data[ type + "queue" ],
+ hooks = data[ type + "queueHooks" ],
+ timers = jQuery.timers,
+ length = queue ? queue.length : 0;
+
+ // enable finishing flag on private data
+ data.finish = true;
+
+ // empty the queue first
+ jQuery.queue( this, type, [] );
+
+ if ( hooks && hooks.stop ) {
+ hooks.stop.call( this, true );
+ }
+
+ // look for any active animations, and finish them
+ for ( index = timers.length; index--; ) {
+ if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
+ timers[ index ].anim.stop( true );
+ timers.splice( index, 1 );
+ }
+ }
+
+ // look for any animations in the old queue and finish them
+ for ( index = 0; index < length; index++ ) {
+ if ( queue[ index ] && queue[ index ].finish ) {
+ queue[ index ].finish.call( this );
+ }
+ }
+
+ // turn off finishing flag
+ delete data.finish;
+ });
+ }
+});
+
+// Generate parameters to create a standard animation
+function genFx( type, includeWidth ) {
+ var which,
+ attrs = { height: type },
+ i = 0;
+
+ // if we include width, step value is 1 to do all cssExpand values,
+ // if we don't include width, step value is 2 to skip over Left and Right
+ includeWidth = includeWidth? 1 : 0;
+ for( ; i < 4 ; i += 2 - includeWidth ) {
+ which = cssExpand[ i ];
+ attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
+ }
+
+ if ( includeWidth ) {
+ attrs.opacity = attrs.width = type;
+ }
+
+ return attrs;
+}
+
+// Generate shortcuts for custom animations
+jQuery.each({
+ slideDown: genFx("show"),
+ slideUp: genFx("hide"),
+ slideToggle: genFx("toggle"),
+ fadeIn: { opacity: "show" },
+ fadeOut: { opacity: "hide" },
+ fadeToggle: { opacity: "toggle" }
+}, function( name, props ) {
+ jQuery.fn[ name ] = function( speed, easing, callback ) {
+ return this.animate( props, speed, easing, callback );
+ };
+});
+
+jQuery.speed = function( speed, easing, fn ) {
+ var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
+ complete: fn || !fn && easing ||
+ jQuery.isFunction( speed ) && speed,
+ duration: speed,
+ easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
+ };
+
+ opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
+ opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
+
+ // normalize opt.queue - true/undefined/null -> "fx"
+ if ( opt.queue == null || opt.queue === true ) {
+ opt.queue = "fx";
+ }
+
+ // Queueing
+ opt.old = opt.complete;
+
+ opt.complete = function() {
+ if ( jQuery.isFunction( opt.old ) ) {
+ opt.old.call( this );
+ }
+
+ if ( opt.queue ) {
+ jQuery.dequeue( this, opt.queue );
+ }
+ };
+
+ return opt;
+};
+
+jQuery.easing = {
+ linear: function( p ) {
+ return p;
+ },
+ swing: function( p ) {
+ return 0.5 - Math.cos( p*Math.PI ) / 2;
+ }
+};
+
+jQuery.timers = [];
+jQuery.fx = Tween.prototype.init;
+jQuery.fx.tick = function() {
+ var timer,
+ timers = jQuery.timers,
+ i = 0;
+
+ fxNow = jQuery.now();
+
+ for ( ; i < timers.length; i++ ) {
+ timer = timers[ i ];
+ // Checks the timer has not already been removed
+ if ( !timer() && timers[ i ] === timer ) {
+ timers.splice( i--, 1 );
+ }
+ }
+
+ if ( !timers.length ) {
+ jQuery.fx.stop();
+ }
+ fxNow = undefined;
+};
+
+jQuery.fx.timer = function( timer ) {
+ if ( timer() && jQuery.timers.push( timer ) ) {
+ jQuery.fx.start();
+ }
+};
+
+jQuery.fx.interval = 13;
+
+jQuery.fx.start = function() {
+ if ( !timerId ) {
+ timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
+ }
+};
+
+jQuery.fx.stop = function() {
+ clearInterval( timerId );
+ timerId = null;
+};
+
+jQuery.fx.speeds = {
+ slow: 600,
+ fast: 200,
+ // Default speed
+ _default: 400
+};
+
+// Back Compat <1.8 extension point
+jQuery.fx.step = {};
+
+if ( jQuery.expr && jQuery.expr.filters ) {
+ jQuery.expr.filters.animated = function( elem ) {
+ return jQuery.grep(jQuery.timers, function( fn ) {
+ return elem === fn.elem;
+ }).length;
+ };
+}
+jQuery.fn.offset = function( options ) {
+ if ( arguments.length ) {
+ return options === undefined ?
+ this :
+ this.each(function( i ) {
+ jQuery.offset.setOffset( this, options, i );
+ });
+ }
+
+ var docElem, win,
+ elem = this[ 0 ],
+ box = { top: 0, left: 0 },
+ doc = elem && elem.ownerDocument;
+
+ if ( !doc ) {
+ return;
+ }
+
+ docElem = doc.documentElement;
+
+ // Make sure it's not a disconnected DOM node
+ if ( !jQuery.contains( docElem, elem ) ) {
+ return box;
+ }
+
+ // If we don't have gBCR, just use 0,0 rather than error
+ // BlackBerry 5, iOS 3 (original iPhone)
+ if ( typeof elem.getBoundingClientRect !== core_strundefined ) {
+ box = elem.getBoundingClientRect();
+ }
+ win = getWindow( doc );
+ return {
+ top: box.top + win.pageYOffset - docElem.clientTop,
+ left: box.left + win.pageXOffset - docElem.clientLeft
+ };
+};
+
+jQuery.offset = {
+
+ setOffset: function( elem, options, i ) {
+ var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
+ position = jQuery.css( elem, "position" ),
+ curElem = jQuery( elem ),
+ props = {};
+
+ // Set position first, in-case top/left are set even on static elem
+ if ( position === "static" ) {
+ elem.style.position = "relative";
+ }
+
+ curOffset = curElem.offset();
+ curCSSTop = jQuery.css( elem, "top" );
+ curCSSLeft = jQuery.css( elem, "left" );
+ calculatePosition = ( position === "absolute" || position === "fixed" ) && ( curCSSTop + curCSSLeft ).indexOf("auto") > -1;
+
+ // Need to be able to calculate position if either top or left is auto and position is either absolute or fixed
+ if ( calculatePosition ) {
+ curPosition = curElem.position();
+ curTop = curPosition.top;
+ curLeft = curPosition.left;
+
+ } else {
+ curTop = parseFloat( curCSSTop ) || 0;
+ curLeft = parseFloat( curCSSLeft ) || 0;
+ }
+
+ if ( jQuery.isFunction( options ) ) {
+ options = options.call( elem, i, curOffset );
+ }
+
+ if ( options.top != null ) {
+ props.top = ( options.top - curOffset.top ) + curTop;
+ }
+ if ( options.left != null ) {
+ props.left = ( options.left - curOffset.left ) + curLeft;
+ }
+
+ if ( "using" in options ) {
+ options.using.call( elem, props );
+
+ } else {
+ curElem.css( props );
+ }
+ }
+};
+
+
+jQuery.fn.extend({
+
+ position: function() {
+ if ( !this[ 0 ] ) {
+ return;
+ }
+
+ var offsetParent, offset,
+ elem = this[ 0 ],
+ parentOffset = { top: 0, left: 0 };
+
+ // Fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent
+ if ( jQuery.css( elem, "position" ) === "fixed" ) {
+ // We assume that getBoundingClientRect is available when computed position is fixed
+ offset = elem.getBoundingClientRect();
+
+ } else {
+ // Get *real* offsetParent
+ offsetParent = this.offsetParent();
+
+ // Get correct offsets
+ offset = this.offset();
+ if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
+ parentOffset = offsetParent.offset();
+ }
+
+ // Add offsetParent borders
+ parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
+ parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
+ }
+
+ // Subtract parent offsets and element margins
+ return {
+ top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
+ left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
+ };
+ },
+
+ offsetParent: function() {
+ return this.map(function() {
+ var offsetParent = this.offsetParent || docElem;
+
+ while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position") === "static" ) ) {
+ offsetParent = offsetParent.offsetParent;
+ }
+
+ return offsetParent || docElem;
+ });
+ }
+});
+
+
+// Create scrollLeft and scrollTop methods
+jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) {
+ var top = "pageYOffset" === prop;
+
+ jQuery.fn[ method ] = function( val ) {
+ return jQuery.access( this, function( elem, method, val ) {
+ var win = getWindow( elem );
+
+ if ( val === undefined ) {
+ return win ? win[ prop ] : elem[ method ];
+ }
+
+ if ( win ) {
+ win.scrollTo(
+ !top ? val : window.pageXOffset,
+ top ? val : window.pageYOffset
+ );
+
+ } else {
+ elem[ method ] = val;
+ }
+ }, method, val, arguments.length, null );
+ };
+});
+
+function getWindow( elem ) {
+ return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;
+}
+// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
+jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
+ jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
+ // margin is only for outerHeight, outerWidth
+ jQuery.fn[ funcName ] = function( margin, value ) {
+ var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
+ extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
+
+ return jQuery.access( this, function( elem, type, value ) {
+ var doc;
+
+ if ( jQuery.isWindow( elem ) ) {
+ // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
+ // isn't a whole lot we can do. See pull request at this URL for discussion:
+ // https://github.com/jquery/jquery/pull/764
+ return elem.document.documentElement[ "client" + name ];
+ }
+
+ // Get document width or height
+ if ( elem.nodeType === 9 ) {
+ doc = elem.documentElement;
+
+ // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
+ // whichever is greatest
+ return Math.max(
+ elem.body[ "scroll" + name ], doc[ "scroll" + name ],
+ elem.body[ "offset" + name ], doc[ "offset" + name ],
+ doc[ "client" + name ]
+ );
+ }
+
+ return value === undefined ?
+ // Get width or height on the element, requesting but not forcing parseFloat
+ jQuery.css( elem, type, extra ) :
+
+ // Set width or height on the element
+ jQuery.style( elem, type, value, extra );
+ }, type, chainable ? margin : undefined, chainable, null );
+ };
+ });
+});
+// Limit scope pollution from any deprecated API
+// (function() {
+
+// The number of elements contained in the matched element set
+jQuery.fn.size = function() {
+ return this.length;
+};
+
+jQuery.fn.andSelf = jQuery.fn.addBack;
+
+// })();
+if ( typeof module === "object" && module && typeof module.exports === "object" ) {
+ // Expose jQuery as module.exports in loaders that implement the Node
+ // module pattern (including browserify). Do not create the global, since
+ // the user will be storing it themselves locally, and globals are frowned
+ // upon in the Node module world.
+ module.exports = jQuery;
+} else {
+ // Register as a named AMD module, since jQuery can be concatenated with other
+ // files that may use define, but not via a proper concatenation script that
+ // understands anonymous AMD modules. A named AMD is safest and most robust
+ // way to register. Lowercase jquery is used because AMD module names are
+ // derived from file names, and jQuery is normally delivered in a lowercase
+ // file name. Do this after creating the global so that if an AMD module wants
+ // to call noConflict to hide this version of jQuery, it will work.
+ if ( typeof define === "function" && define.amd ) {
+ define( "jquery", [], function () { return jQuery; } );
+ }
+}
+
+// If there is a window object, that at least has a document property,
+// define jQuery and $ identifiers
+if ( typeof window === "object" && typeof window.document === "object" ) {
+ window.jQuery = window.$ = jQuery;
+}
+
+})( window );
diff --git a/public_html/data/js/vendor/jquery-2.0.3.min.js b/public_html/data/js/vendor/jquery-2.0.3.min.js
new file mode 100644
index 000000000..2be209dd2
--- /dev/null
+++ b/public_html/data/js/vendor/jquery-2.0.3.min.js
@@ -0,0 +1,6 @@
+/*! jQuery v2.0.3 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license
+//@ sourceMappingURL=jquery-2.0.3.min.map
+*/
+(function(e,undefined){var t,n,r=typeof undefined,i=e.location,o=e.document,s=o.documentElement,a=e.jQuery,u=e.$,l={},c=[],p="2.0.3",f=c.concat,h=c.push,d=c.slice,g=c.indexOf,m=l.toString,y=l.hasOwnProperty,v=p.trim,x=function(e,n){return new x.fn.init(e,n,t)},b=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,w=/\S+/g,T=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,k=/^-ms-/,N=/-([\da-z])/gi,E=function(e,t){return t.toUpperCase()},S=function(){o.removeEventListener("DOMContentLoaded",S,!1),e.removeEventListener("load",S,!1),x.ready()};x.fn=x.prototype={jquery:p,constructor:x,init:function(e,t,n){var r,i;if(!e)return this;if("string"==typeof e){if(r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:T.exec(e),!r||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof x?t[0]:t,x.merge(this,x.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:o,!0)),C.test(r[1])&&x.isPlainObject(t))for(r in t)x.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return i=o.getElementById(r[2]),i&&i.parentNode&&(this.length=1,this[0]=i),this.context=o,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):x.isFunction(e)?n.ready(e):(e.selector!==undefined&&(this.selector=e.selector,this.context=e.context),x.makeArray(e,this))},selector:"",length:0,toArray:function(){return d.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return x.each(this,e,t)},ready:function(e){return x.ready.promise().done(e),this},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(x.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:h,sort:[].sort,splice:[].splice},x.fn.init.prototype=x.fn,x.extend=x.fn.extend=function(){var e,t,n,r,i,o,s=arguments[0]||{},a=1,u=arguments.length,l=!1;for("boolean"==typeof s&&(l=s,s=arguments[1]||{},a=2),"object"==typeof s||x.isFunction(s)||(s={}),u===a&&(s=this,--a);u>a;a++)if(null!=(e=arguments[a]))for(t in e)n=s[t],r=e[t],s!==r&&(l&&r&&(x.isPlainObject(r)||(i=x.isArray(r)))?(i?(i=!1,o=n&&x.isArray(n)?n:[]):o=n&&x.isPlainObject(n)?n:{},s[t]=x.extend(l,o,r)):r!==undefined&&(s[t]=r));return s},x.extend({expando:"jQuery"+(p+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===x&&(e.$=u),t&&e.jQuery===x&&(e.jQuery=a),x},isReady:!1,readyWait:1,holdReady:function(e){e?x.readyWait++:x.ready(!0)},ready:function(e){(e===!0?--x.readyWait:x.isReady)||(x.isReady=!0,e!==!0&&--x.readyWait>0||(n.resolveWith(o,[x]),x.fn.trigger&&x(o).trigger("ready").off("ready")))},isFunction:function(e){return"function"===x.type(e)},isArray:Array.isArray,isWindow:function(e){return null!=e&&e===e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[m.call(e)]||"object":typeof e},isPlainObject:function(e){if("object"!==x.type(e)||e.nodeType||x.isWindow(e))return!1;try{if(e.constructor&&!y.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}return!0},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||o;var r=C.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=x.buildFragment([e],t,i),i&&x(i).remove(),x.merge([],r.childNodes))},parseJSON:JSON.parse,parseXML:function(e){var t,n;if(!e||"string"!=typeof e)return null;try{n=new DOMParser,t=n.parseFromString(e,"text/xml")}catch(r){t=undefined}return(!t||t.getElementsByTagName("parsererror").length)&&x.error("Invalid XML: "+e),t},noop:function(){},globalEval:function(e){var t,n=eval;e=x.trim(e),e&&(1===e.indexOf("use strict")?(t=o.createElement("script"),t.text=e,o.head.appendChild(t).parentNode.removeChild(t)):n(e))},camelCase:function(e){return e.replace(k,"ms-").replace(N,E)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,s=j(e);if(n){if(s){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(s){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:function(e){return null==e?"":v.call(e)},makeArray:function(e,t){var n=t||[];return null!=e&&(j(Object(e))?x.merge(n,"string"==typeof e?[e]:e):h.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:g.call(t,e,n)},merge:function(e,t){var n=t.length,r=e.length,i=0;if("number"==typeof n)for(;n>i;i++)e[r++]=t[i];else while(t[i]!==undefined)e[r++]=t[i++];return e.length=r,e},grep:function(e,t,n){var r,i=[],o=0,s=e.length;for(n=!!n;s>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,s=j(e),a=[];if(s)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(a[a.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(a[a.length]=r);return f.apply([],a)},guid:1,proxy:function(e,t){var n,r,i;return"string"==typeof t&&(n=e[t],t=e,e=n),x.isFunction(e)?(r=d.call(arguments,2),i=function(){return e.apply(t||this,r.concat(d.call(arguments)))},i.guid=e.guid=e.guid||x.guid++,i):undefined},access:function(e,t,n,r,i,o,s){var a=0,u=e.length,l=null==n;if("object"===x.type(n)){i=!0;for(a in n)x.access(e,t,a,n[a],!0,o,s)}else if(r!==undefined&&(i=!0,x.isFunction(r)||(s=!0),l&&(s?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(x(e),n)})),t))for(;u>a;a++)t(e[a],n,s?r:r.call(e[a],a,t(e[a],n)));return i?e:l?t.call(e):u?t(e[0],n):o},now:Date.now,swap:function(e,t,n,r){var i,o,s={};for(o in t)s[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=s[o];return i}}),x.ready.promise=function(t){return n||(n=x.Deferred(),"complete"===o.readyState?setTimeout(x.ready):(o.addEventListener("DOMContentLoaded",S,!1),e.addEventListener("load",S,!1))),n.promise(t)},x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});function j(e){var t=e.length,n=x.type(e);return x.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}t=x(o),function(e,undefined){var t,n,r,i,o,s,a,u,l,c,p,f,h,d,g,m,y,v="sizzle"+-new Date,b=e.document,w=0,T=0,C=st(),k=st(),N=st(),E=!1,S=function(e,t){return e===t?(E=!0,0):0},j=typeof undefined,D=1<<31,A={}.hasOwnProperty,L=[],q=L.pop,H=L.push,O=L.push,F=L.slice,P=L.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},R="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",W="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",$=W.replace("w","w#"),B="\\["+M+"*("+W+")"+M+"*(?:([*^$|!~]?=)"+M+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+$+")|)|)"+M+"*\\]",I=":("+W+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+B.replace(3,8)+")*)|.*)\\)|)",z=RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),_=RegExp("^"+M+"*,"+M+"*"),X=RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=RegExp(M+"*[+~]"),Y=RegExp("="+M+"*([^\\]'\"]*)"+M+"*\\]","g"),V=RegExp(I),G=RegExp("^"+$+"$"),J={ID:RegExp("^#("+W+")"),CLASS:RegExp("^\\.("+W+")"),TAG:RegExp("^("+W.replace("w","w*")+")"),ATTR:RegExp("^"+B),PSEUDO:RegExp("^"+I),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:RegExp("^(?:"+R+")$","i"),needsContext:RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Q=/^[^{]+\{\s*\[native \w/,K=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Z=/^(?:input|select|textarea|button)$/i,et=/^h\d$/i,tt=/'|\\/g,nt=RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),rt=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(55296|r>>10,56320|1023&r)};try{O.apply(L=F.call(b.childNodes),b.childNodes),L[b.childNodes.length].nodeType}catch(it){O={apply:L.length?function(e,t){H.apply(e,F.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function ot(e,t,r,i){var o,s,a,u,l,f,g,m,x,w;if((t?t.ownerDocument||t:b)!==p&&c(t),t=t||p,r=r||[],!e||"string"!=typeof e)return r;if(1!==(u=t.nodeType)&&9!==u)return[];if(h&&!i){if(o=K.exec(e))if(a=o[1]){if(9===u){if(s=t.getElementById(a),!s||!s.parentNode)return r;if(s.id===a)return r.push(s),r}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(a))&&y(t,s)&&s.id===a)return r.push(s),r}else{if(o[2])return O.apply(r,t.getElementsByTagName(e)),r;if((a=o[3])&&n.getElementsByClassName&&t.getElementsByClassName)return O.apply(r,t.getElementsByClassName(a)),r}if(n.qsa&&(!d||!d.test(e))){if(m=g=v,x=t,w=9===u&&e,1===u&&"object"!==t.nodeName.toLowerCase()){f=gt(e),(g=t.getAttribute("id"))?m=g.replace(tt,"\\$&"):t.setAttribute("id",m),m="[id='"+m+"'] ",l=f.length;while(l--)f[l]=m+mt(f[l]);x=U.test(e)&&t.parentNode||t,w=f.join(",")}if(w)try{return O.apply(r,x.querySelectorAll(w)),r}catch(T){}finally{g||t.removeAttribute("id")}}}return kt(e.replace(z,"$1"),t,r,i)}function st(){var e=[];function t(n,r){return e.push(n+=" ")>i.cacheLength&&delete t[e.shift()],t[n]=r}return t}function at(e){return e[v]=!0,e}function ut(e){var t=p.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function lt(e,t){var n=e.split("|"),r=e.length;while(r--)i.attrHandle[n[r]]=t}function ct(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||D)-(~e.sourceIndex||D);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function pt(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function ft(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ht(e){return at(function(t){return t=+t,at(function(n,r){var i,o=e([],n.length,t),s=o.length;while(s--)n[i=o[s]]&&(n[i]=!(r[i]=n[i]))})})}s=ot.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},n=ot.support={},c=ot.setDocument=function(e){var t=e?e.ownerDocument||e:b,r=t.defaultView;return t!==p&&9===t.nodeType&&t.documentElement?(p=t,f=t.documentElement,h=!s(t),r&&r.attachEvent&&r!==r.top&&r.attachEvent("onbeforeunload",function(){c()}),n.attributes=ut(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ut(function(e){return e.appendChild(t.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=ut(function(e){return e.innerHTML="<div class='a'></div><div class='a i'></div>",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),n.getById=ut(function(e){return f.appendChild(e).id=v,!t.getElementsByName||!t.getElementsByName(v).length}),n.getById?(i.find.ID=function(e,t){if(typeof t.getElementById!==j&&h){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},i.filter.ID=function(e){var t=e.replace(nt,rt);return function(e){return e.getAttribute("id")===t}}):(delete i.find.ID,i.filter.ID=function(e){var t=e.replace(nt,rt);return function(e){var n=typeof e.getAttributeNode!==j&&e.getAttributeNode("id");return n&&n.value===t}}),i.find.TAG=n.getElementsByTagName?function(e,t){return typeof t.getElementsByTagName!==j?t.getElementsByTagName(e):undefined}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},i.find.CLASS=n.getElementsByClassName&&function(e,t){return typeof t.getElementsByClassName!==j&&h?t.getElementsByClassName(e):undefined},g=[],d=[],(n.qsa=Q.test(t.querySelectorAll))&&(ut(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||d.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll(":checked").length||d.push(":checked")}),ut(function(e){var n=t.createElement("input");n.setAttribute("type","hidden"),e.appendChild(n).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&d.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||d.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),d.push(",.*:")})),(n.matchesSelector=Q.test(m=f.webkitMatchesSelector||f.mozMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&ut(function(e){n.disconnectedMatch=m.call(e,"div"),m.call(e,"[s!='']:x"),g.push("!=",I)}),d=d.length&&RegExp(d.join("|")),g=g.length&&RegExp(g.join("|")),y=Q.test(f.contains)||f.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},S=f.compareDocumentPosition?function(e,r){if(e===r)return E=!0,0;var i=r.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(r);return i?1&i||!n.sortDetached&&r.compareDocumentPosition(e)===i?e===t||y(b,e)?-1:r===t||y(b,r)?1:l?P.call(l,e)-P.call(l,r):0:4&i?-1:1:e.compareDocumentPosition?-1:1}:function(e,n){var r,i=0,o=e.parentNode,s=n.parentNode,a=[e],u=[n];if(e===n)return E=!0,0;if(!o||!s)return e===t?-1:n===t?1:o?-1:s?1:l?P.call(l,e)-P.call(l,n):0;if(o===s)return ct(e,n);r=e;while(r=r.parentNode)a.unshift(r);r=n;while(r=r.parentNode)u.unshift(r);while(a[i]===u[i])i++;return i?ct(a[i],u[i]):a[i]===b?-1:u[i]===b?1:0},t):p},ot.matches=function(e,t){return ot(e,null,null,t)},ot.matchesSelector=function(e,t){if((e.ownerDocument||e)!==p&&c(e),t=t.replace(Y,"='$1']"),!(!n.matchesSelector||!h||g&&g.test(t)||d&&d.test(t)))try{var r=m.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(i){}return ot(t,p,null,[e]).length>0},ot.contains=function(e,t){return(e.ownerDocument||e)!==p&&c(e),y(e,t)},ot.attr=function(e,t){(e.ownerDocument||e)!==p&&c(e);var r=i.attrHandle[t.toLowerCase()],o=r&&A.call(i.attrHandle,t.toLowerCase())?r(e,t,!h):undefined;return o===undefined?n.attributes||!h?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null:o},ot.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},ot.uniqueSort=function(e){var t,r=[],i=0,o=0;if(E=!n.detectDuplicates,l=!n.sortStable&&e.slice(0),e.sort(S),E){while(t=e[o++])t===e[o]&&(i=r.push(o));while(i--)e.splice(r[i],1)}return e},o=ot.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=o(t);return n},i=ot.selectors={cacheLength:50,createPseudo:at,match:J,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(nt,rt),e[3]=(e[4]||e[5]||"").replace(nt,rt),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||ot.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&ot.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return J.CHILD.test(e[0])?null:(e[3]&&e[4]!==undefined?e[2]=e[4]:n&&V.test(n)&&(t=gt(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(nt,rt).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=C[e+" "];return t||(t=RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&C(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==j&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=ot.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),s="last"!==e.slice(-4),a="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,p,f,h,d,g=o!==s?"nextSibling":"previousSibling",m=t.parentNode,y=a&&t.nodeName.toLowerCase(),x=!u&&!a;if(m){if(o){while(g){p=t;while(p=p[g])if(a?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;d=g="only"===e&&!d&&"nextSibling"}return!0}if(d=[s?m.firstChild:m.lastChild],s&&x){c=m[v]||(m[v]={}),l=c[e]||[],h=l[0]===w&&l[1],f=l[0]===w&&l[2],p=h&&m.childNodes[h];while(p=++h&&p&&p[g]||(f=h=0)||d.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[w,h,f];break}}else if(x&&(l=(t[v]||(t[v]={}))[e])&&l[0]===w)f=l[1];else while(p=++h&&p&&p[g]||(f=h=0)||d.pop())if((a?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(x&&((p[v]||(p[v]={}))[e]=[w,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||ot.error("unsupported pseudo: "+e);return r[v]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?at(function(e,n){var i,o=r(e,t),s=o.length;while(s--)i=P.call(e,o[s]),e[i]=!(n[i]=o[s])}):function(e){return r(e,0,n)}):r}},pseudos:{not:at(function(e){var t=[],n=[],r=a(e.replace(z,"$1"));return r[v]?at(function(e,t,n,i){var o,s=r(e,null,i,[]),a=e.length;while(a--)(o=s[a])&&(e[a]=!(t[a]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:at(function(e){return function(t){return ot(e,t).length>0}}),contains:at(function(e){return function(t){return(t.textContent||t.innerText||o(t)).indexOf(e)>-1}}),lang:at(function(e){return G.test(e||"")||ot.error("unsupported lang: "+e),e=e.replace(nt,rt).toLowerCase(),function(t){var n;do if(n=h?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===f},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!i.pseudos.empty(e)},header:function(e){return et.test(e.nodeName)},input:function(e){return Z.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:ht(function(){return[0]}),last:ht(function(e,t){return[t-1]}),eq:ht(function(e,t,n){return[0>n?n+t:n]}),even:ht(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:ht(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:ht(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:ht(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}},i.pseudos.nth=i.pseudos.eq;for(t in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})i.pseudos[t]=pt(t);for(t in{submit:!0,reset:!0})i.pseudos[t]=ft(t);function dt(){}dt.prototype=i.filters=i.pseudos,i.setFilters=new dt;function gt(e,t){var n,r,o,s,a,u,l,c=k[e+" "];if(c)return t?0:c.slice(0);a=e,u=[],l=i.preFilter;while(a){(!n||(r=_.exec(a)))&&(r&&(a=a.slice(r[0].length)||a),u.push(o=[])),n=!1,(r=X.exec(a))&&(n=r.shift(),o.push({value:n,type:r[0].replace(z," ")}),a=a.slice(n.length));for(s in i.filter)!(r=J[s].exec(a))||l[s]&&!(r=l[s](r))||(n=r.shift(),o.push({value:n,type:s,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?ot.error(e):k(e,u).slice(0)}function mt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function yt(e,t,n){var i=t.dir,o=n&&"parentNode"===i,s=T++;return t.first?function(t,n,r){while(t=t[i])if(1===t.nodeType||o)return e(t,n,r)}:function(t,n,a){var u,l,c,p=w+" "+s;if(a){while(t=t[i])if((1===t.nodeType||o)&&e(t,n,a))return!0}else while(t=t[i])if(1===t.nodeType||o)if(c=t[v]||(t[v]={}),(l=c[i])&&l[0]===p){if((u=l[1])===!0||u===r)return u===!0}else if(l=c[i]=[p],l[1]=e(t,n,a)||r,l[1]===!0)return!0}}function vt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function xt(e,t,n,r,i){var o,s=[],a=0,u=e.length,l=null!=t;for(;u>a;a++)(o=e[a])&&(!n||n(o,r,i))&&(s.push(o),l&&t.push(a));return s}function bt(e,t,n,r,i,o){return r&&!r[v]&&(r=bt(r)),i&&!i[v]&&(i=bt(i,o)),at(function(o,s,a,u){var l,c,p,f=[],h=[],d=s.length,g=o||Ct(t||"*",a.nodeType?[a]:a,[]),m=!e||!o&&t?g:xt(g,f,e,a,u),y=n?i||(o?e:d||r)?[]:s:m;if(n&&n(m,y,a,u),r){l=xt(y,h),r(l,[],a,u),c=l.length;while(c--)(p=l[c])&&(y[h[c]]=!(m[h[c]]=p))}if(o){if(i||e){if(i){l=[],c=y.length;while(c--)(p=y[c])&&l.push(m[c]=p);i(null,y=[],l,u)}c=y.length;while(c--)(p=y[c])&&(l=i?P.call(o,p):f[c])>-1&&(o[l]=!(s[l]=p))}}else y=xt(y===s?y.splice(d,y.length):y),i?i(null,s,y,u):O.apply(s,y)})}function wt(e){var t,n,r,o=e.length,s=i.relative[e[0].type],a=s||i.relative[" "],l=s?1:0,c=yt(function(e){return e===t},a,!0),p=yt(function(e){return P.call(t,e)>-1},a,!0),f=[function(e,n,r){return!s&&(r||n!==u)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;o>l;l++)if(n=i.relative[e[l].type])f=[yt(vt(f),n)];else{if(n=i.filter[e[l].type].apply(null,e[l].matches),n[v]){for(r=++l;o>r;r++)if(i.relative[e[r].type])break;return bt(l>1&&vt(f),l>1&&mt(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(z,"$1"),n,r>l&&wt(e.slice(l,r)),o>r&&wt(e=e.slice(r)),o>r&&mt(e))}f.push(n)}return vt(f)}function Tt(e,t){var n=0,o=t.length>0,s=e.length>0,a=function(a,l,c,f,h){var d,g,m,y=[],v=0,x="0",b=a&&[],T=null!=h,C=u,k=a||s&&i.find.TAG("*",h&&l.parentNode||l),N=w+=null==C?1:Math.random()||.1;for(T&&(u=l!==p&&l,r=n);null!=(d=k[x]);x++){if(s&&d){g=0;while(m=e[g++])if(m(d,l,c)){f.push(d);break}T&&(w=N,r=++n)}o&&((d=!m&&d)&&v--,a&&b.push(d))}if(v+=x,o&&x!==v){g=0;while(m=t[g++])m(b,y,l,c);if(a){if(v>0)while(x--)b[x]||y[x]||(y[x]=q.call(f));y=xt(y)}O.apply(f,y),T&&!a&&y.length>0&&v+t.length>1&&ot.uniqueSort(f)}return T&&(w=N,u=C),b};return o?at(a):a}a=ot.compile=function(e,t){var n,r=[],i=[],o=N[e+" "];if(!o){t||(t=gt(e)),n=t.length;while(n--)o=wt(t[n]),o[v]?r.push(o):i.push(o);o=N(e,Tt(i,r))}return o};function Ct(e,t,n){var r=0,i=t.length;for(;i>r;r++)ot(e,t[r],n);return n}function kt(e,t,r,o){var s,u,l,c,p,f=gt(e);if(!o&&1===f.length){if(u=f[0]=f[0].slice(0),u.length>2&&"ID"===(l=u[0]).type&&n.getById&&9===t.nodeType&&h&&i.relative[u[1].type]){if(t=(i.find.ID(l.matches[0].replace(nt,rt),t)||[])[0],!t)return r;e=e.slice(u.shift().value.length)}s=J.needsContext.test(e)?0:u.length;while(s--){if(l=u[s],i.relative[c=l.type])break;if((p=i.find[c])&&(o=p(l.matches[0].replace(nt,rt),U.test(u[0].type)&&t.parentNode||t))){if(u.splice(s,1),e=o.length&&mt(u),!e)return O.apply(r,o),r;break}}}return a(e,f)(o,t,!h,r,U.test(e)),r}n.sortStable=v.split("").sort(S).join("")===v,n.detectDuplicates=E,c(),n.sortDetached=ut(function(e){return 1&e.compareDocumentPosition(p.createElement("div"))}),ut(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||lt("type|href|height|width",function(e,t,n){return n?undefined:e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ut(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||lt("value",function(e,t,n){return n||"input"!==e.nodeName.toLowerCase()?undefined:e.defaultValue}),ut(function(e){return null==e.getAttribute("disabled")})||lt(R,function(e,t,n){var r;return n?undefined:(r=e.getAttributeNode(t))&&r.specified?r.value:e[t]===!0?t.toLowerCase():null}),x.find=ot,x.expr=ot.selectors,x.expr[":"]=x.expr.pseudos,x.unique=ot.uniqueSort,x.text=ot.getText,x.isXMLDoc=ot.isXML,x.contains=ot.contains}(e);var D={};function A(e){var t=D[e]={};return x.each(e.match(w)||[],function(e,n){t[n]=!0}),t}x.Callbacks=function(e){e="string"==typeof e?D[e]||A(e):x.extend({},e);var t,n,r,i,o,s,a=[],u=!e.once&&[],l=function(p){for(t=e.memory&&p,n=!0,s=i||0,i=0,o=a.length,r=!0;a&&o>s;s++)if(a[s].apply(p[0],p[1])===!1&&e.stopOnFalse){t=!1;break}r=!1,a&&(u?u.length&&l(u.shift()):t?a=[]:c.disable())},c={add:function(){if(a){var n=a.length;(function s(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&c.has(n)||a.push(n):n&&n.length&&"string"!==r&&s(n)})})(arguments),r?o=a.length:t&&(i=n,l(t))}return this},remove:function(){return a&&x.each(arguments,function(e,t){var n;while((n=x.inArray(t,a,n))>-1)a.splice(n,1),r&&(o>=n&&o--,s>=n&&s--)}),this},has:function(e){return e?x.inArray(e,a)>-1:!(!a||!a.length)},empty:function(){return a=[],o=0,this},disable:function(){return a=u=t=undefined,this},disabled:function(){return!a},lock:function(){return u=undefined,t||c.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!a||n&&!u||(t=t||[],t=[e,t.slice?t.slice():t],r?u.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!n}};return c},x.extend({Deferred:function(e){var t=[["resolve","done",x.Callbacks("once memory"),"resolved"],["reject","fail",x.Callbacks("once memory"),"rejected"],["notify","progress",x.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return x.Deferred(function(n){x.each(t,function(t,o){var s=o[0],a=x.isFunction(e[t])&&e[t];i[o[1]](function(){var e=a&&a.apply(this,arguments);e&&x.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===r?n.promise():this,a?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?x.extend(e,r):r}},i={};return r.pipe=r.then,x.each(t,function(e,o){var s=o[2],a=o[3];r[o[1]]=s.add,a&&s.add(function(){n=a},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=s.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=d.call(arguments),r=n.length,i=1!==r||e&&x.isFunction(e.promise)?r:0,o=1===i?e:x.Deferred(),s=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?d.call(arguments):r,n===a?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},a,u,l;if(r>1)for(a=Array(r),u=Array(r),l=Array(r);r>t;t++)n[t]&&x.isFunction(n[t].promise)?n[t].promise().done(s(t,l,n)).fail(o.reject).progress(s(t,u,a)):--i;return i||o.resolveWith(l,n),o.promise()}}),x.support=function(t){var n=o.createElement("input"),r=o.createDocumentFragment(),i=o.createElement("div"),s=o.createElement("select"),a=s.appendChild(o.createElement("option"));return n.type?(n.type="checkbox",t.checkOn=""!==n.value,t.optSelected=a.selected,t.reliableMarginRight=!0,t.boxSizingReliable=!0,t.pixelPosition=!1,n.checked=!0,t.noCloneChecked=n.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!a.disabled,n=o.createElement("input"),n.value="t",n.type="radio",t.radioValue="t"===n.value,n.setAttribute("checked","t"),n.setAttribute("name","t"),r.appendChild(n),t.checkClone=r.cloneNode(!0).cloneNode(!0).lastChild.checked,t.focusinBubbles="onfocusin"in e,i.style.backgroundClip="content-box",i.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===i.style.backgroundClip,x(function(){var n,r,s="padding:0;margin:0;border:0;display:block;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box",a=o.getElementsByTagName("body")[0];a&&(n=o.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",a.appendChild(n).appendChild(i),i.innerHTML="",i.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%",x.swap(a,null!=a.style.zoom?{zoom:1}:{},function(){t.boxSizing=4===i.offsetWidth}),e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(i,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(i,null)||{width:"4px"}).width,r=i.appendChild(o.createElement("div")),r.style.cssText=i.style.cssText=s,r.style.marginRight=r.style.width="0",i.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),a.removeChild(n))}),t):t}({});var L,q,H=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,O=/([A-Z])/g;function F(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=x.expando+Math.random()}F.uid=1,F.accepts=function(e){return e.nodeType?1===e.nodeType||9===e.nodeType:!0},F.prototype={key:function(e){if(!F.accepts(e))return 0;var t={},n=e[this.expando];if(!n){n=F.uid++;try{t[this.expando]={value:n},Object.defineProperties(e,t)}catch(r){t[this.expando]=n,x.extend(e,t)}}return this.cache[n]||(this.cache[n]={}),n},set:function(e,t,n){var r,i=this.key(e),o=this.cache[i];if("string"==typeof t)o[t]=n;else if(x.isEmptyObject(o))x.extend(this.cache[i],t);else for(r in t)o[r]=t[r];return o},get:function(e,t){var n=this.cache[this.key(e)];return t===undefined?n:n[t]},access:function(e,t,n){var r;return t===undefined||t&&"string"==typeof t&&n===undefined?(r=this.get(e,t),r!==undefined?r:this.get(e,x.camelCase(t))):(this.set(e,t,n),n!==undefined?n:t)},remove:function(e,t){var n,r,i,o=this.key(e),s=this.cache[o];if(t===undefined)this.cache[o]={};else{x.isArray(t)?r=t.concat(t.map(x.camelCase)):(i=x.camelCase(t),t in s?r=[t,i]:(r=i,r=r in s?[r]:r.match(w)||[])),n=r.length;while(n--)delete s[r[n]]}},hasData:function(e){return!x.isEmptyObject(this.cache[e[this.expando]]||{})},discard:function(e){e[this.expando]&&delete this.cache[e[this.expando]]}},L=new F,q=new F,x.extend({acceptData:F.accepts,hasData:function(e){return L.hasData(e)||q.hasData(e)},data:function(e,t,n){return L.access(e,t,n)},removeData:function(e,t){L.remove(e,t)},_data:function(e,t,n){return q.access(e,t,n)},_removeData:function(e,t){q.remove(e,t)}}),x.fn.extend({data:function(e,t){var n,r,i=this[0],o=0,s=null;if(e===undefined){if(this.length&&(s=L.get(i),1===i.nodeType&&!q.get(i,"hasDataAttrs"))){for(n=i.attributes;n.length>o;o++)r=n[o].name,0===r.indexOf("data-")&&(r=x.camelCase(r.slice(5)),P(i,r,s[r]));q.set(i,"hasDataAttrs",!0)}return s}return"object"==typeof e?this.each(function(){L.set(this,e)}):x.access(this,function(t){var n,r=x.camelCase(e);if(i&&t===undefined){if(n=L.get(i,e),n!==undefined)return n;if(n=L.get(i,r),n!==undefined)return n;if(n=P(i,r,undefined),n!==undefined)return n}else this.each(function(){var n=L.get(this,r);L.set(this,r,t),-1!==e.indexOf("-")&&n!==undefined&&L.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){L.remove(this,e)})}});function P(e,t,n){var r;if(n===undefined&&1===e.nodeType)if(r="data-"+t.replace(O,"-$1").toLowerCase(),n=e.getAttribute(r),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:H.test(n)?JSON.parse(n):n}catch(i){}L.set(e,t,n)}else n=undefined;return n}x.extend({queue:function(e,t,n){var r;return e?(t=(t||"fx")+"queue",r=q.get(e,t),n&&(!r||x.isArray(n)?r=q.access(e,t,x.makeArray(n)):r.push(n)),r||[]):undefined},dequeue:function(e,t){t=t||"fx";var n=x.queue(e,t),r=n.length,i=n.shift(),o=x._queueHooks(e,t),s=function(){x.dequeue(e,t)
+};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,s,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return q.get(e,n)||q.access(e,n,{empty:x.Callbacks("once memory").add(function(){q.remove(e,[t+"queue",n])})})}}),x.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),n>arguments.length?x.queue(this[0],e):t===undefined?this:this.each(function(){var n=x.queue(this,e,t);x._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&x.dequeue(this,e)})},dequeue:function(e){return this.each(function(){x.dequeue(this,e)})},delay:function(e,t){return e=x.fx?x.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=x.Deferred(),o=this,s=this.length,a=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=undefined),e=e||"fx";while(s--)n=q.get(o[s],e+"queueHooks"),n&&n.empty&&(r++,n.empty.add(a));return a(),i.promise(t)}});var R,M,W=/[\t\r\n\f]/g,$=/\r/g,B=/^(?:input|select|textarea|button)$/i;x.fn.extend({attr:function(e,t){return x.access(this,x.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){x.removeAttr(this,e)})},prop:function(e,t){return x.access(this,x.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[x.propFix[e]||e]})},addClass:function(e){var t,n,r,i,o,s=0,a=this.length,u="string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];a>s;s++)if(n=this[s],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(W," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=x.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,s=0,a=this.length,u=0===arguments.length||"string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];a>s;s++)if(n=this[s],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(W," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?x.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):x.isFunction(e)?this.each(function(n){x(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var t,i=0,o=x(this),s=e.match(w)||[];while(t=s[i++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else(n===r||"boolean"===n)&&(this.className&&q.set(this,"__className__",this.className),this.className=this.className||e===!1?"":q.get(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(W," ").indexOf(t)>=0)return!0;return!1},val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=x.isFunction(e),this.each(function(n){var i;1===this.nodeType&&(i=r?e.call(this,n,x(this).val()):e,null==i?i="":"number"==typeof i?i+="":x.isArray(i)&&(i=x.map(i,function(e){return null==e?"":e+""})),t=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&t.set(this,i,"value")!==undefined||(this.value=i))});if(i)return t=x.valHooks[i.type]||x.valHooks[i.nodeName.toLowerCase()],t&&"get"in t&&(n=t.get(i,"value"))!==undefined?n:(n=i.value,"string"==typeof n?n.replace($,""):null==n?"":n)}}}),x.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,s=o?null:[],a=o?i+1:r.length,u=0>i?a:o?i:0;for(;a>u;u++)if(n=r[u],!(!n.selected&&u!==i||(x.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&x.nodeName(n.parentNode,"optgroup"))){if(t=x(n).val(),o)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=x.makeArray(t),s=i.length;while(s--)r=i[s],(r.selected=x.inArray(x(r).val(),o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}},attr:function(e,t,n){var i,o,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return typeof e.getAttribute===r?x.prop(e,t,n):(1===s&&x.isXMLDoc(e)||(t=t.toLowerCase(),i=x.attrHooks[t]||(x.expr.match.bool.test(t)?M:R)),n===undefined?i&&"get"in i&&null!==(o=i.get(e,t))?o:(o=x.find.attr(e,t),null==o?undefined:o):null!==n?i&&"set"in i&&(o=i.set(e,n,t))!==undefined?o:(e.setAttribute(t,n+""),n):(x.removeAttr(e,t),undefined))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(w);if(o&&1===e.nodeType)while(n=o[i++])r=x.propFix[n]||n,x.expr.match.bool.test(n)&&(e[r]=!1),e.removeAttribute(n)},attrHooks:{type:{set:function(e,t){if(!x.support.radioValue&&"radio"===t&&x.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(e,t,n){var r,i,o,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return o=1!==s||!x.isXMLDoc(e),o&&(t=x.propFix[t]||t,i=x.propHooks[t]),n!==undefined?i&&"set"in i&&(r=i.set(e,n,t))!==undefined?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){return e.hasAttribute("tabindex")||B.test(e.nodeName)||e.href?e.tabIndex:-1}}}}),M={set:function(e,t,n){return t===!1?x.removeAttr(e,n):e.setAttribute(n,n),n}},x.each(x.expr.match.bool.source.match(/\w+/g),function(e,t){var n=x.expr.attrHandle[t]||x.find.attr;x.expr.attrHandle[t]=function(e,t,r){var i=x.expr.attrHandle[t],o=r?undefined:(x.expr.attrHandle[t]=undefined)!=n(e,t,r)?t.toLowerCase():null;return x.expr.attrHandle[t]=i,o}}),x.support.optSelected||(x.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){x.propFix[this.toLowerCase()]=this}),x.each(["radio","checkbox"],function(){x.valHooks[this]={set:function(e,t){return x.isArray(t)?e.checked=x.inArray(x(e).val(),t)>=0:undefined}},x.support.checkOn||(x.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var I=/^key/,z=/^(?:mouse|contextmenu)|click/,_=/^(?:focusinfocus|focusoutblur)$/,X=/^([^.]*)(?:\.(.+)|)$/;function U(){return!0}function Y(){return!1}function V(){try{return o.activeElement}catch(e){}}x.event={global:{},add:function(e,t,n,i,o){var s,a,u,l,c,p,f,h,d,g,m,y=q.get(e);if(y){n.handler&&(s=n,n=s.handler,o=s.selector),n.guid||(n.guid=x.guid++),(l=y.events)||(l=y.events={}),(a=y.handle)||(a=y.handle=function(e){return typeof x===r||e&&x.event.triggered===e.type?undefined:x.event.dispatch.apply(a.elem,arguments)},a.elem=e),t=(t||"").match(w)||[""],c=t.length;while(c--)u=X.exec(t[c])||[],d=m=u[1],g=(u[2]||"").split(".").sort(),d&&(f=x.event.special[d]||{},d=(o?f.delegateType:f.bindType)||d,f=x.event.special[d]||{},p=x.extend({type:d,origType:m,data:i,handler:n,guid:n.guid,selector:o,needsContext:o&&x.expr.match.needsContext.test(o),namespace:g.join(".")},s),(h=l[d])||(h=l[d]=[],h.delegateCount=0,f.setup&&f.setup.call(e,i,g,a)!==!1||e.addEventListener&&e.addEventListener(d,a,!1)),f.add&&(f.add.call(e,p),p.handler.guid||(p.handler.guid=n.guid)),o?h.splice(h.delegateCount++,0,p):h.push(p),x.event.global[d]=!0);e=null}},remove:function(e,t,n,r,i){var o,s,a,u,l,c,p,f,h,d,g,m=q.hasData(e)&&q.get(e);if(m&&(u=m.events)){t=(t||"").match(w)||[""],l=t.length;while(l--)if(a=X.exec(t[l])||[],h=g=a[1],d=(a[2]||"").split(".").sort(),h){p=x.event.special[h]||{},h=(r?p.delegateType:p.bindType)||h,f=u[h]||[],a=a[2]&&RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=f.length;while(o--)c=f[o],!i&&g!==c.origType||n&&n.guid!==c.guid||a&&!a.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(f.splice(o,1),c.selector&&f.delegateCount--,p.remove&&p.remove.call(e,c));s&&!f.length&&(p.teardown&&p.teardown.call(e,d,m.handle)!==!1||x.removeEvent(e,h,m.handle),delete u[h])}else for(h in u)x.event.remove(e,h+t[l],n,r,!0);x.isEmptyObject(u)&&(delete m.handle,q.remove(e,"events"))}},trigger:function(t,n,r,i){var s,a,u,l,c,p,f,h=[r||o],d=y.call(t,"type")?t.type:t,g=y.call(t,"namespace")?t.namespace.split("."):[];if(a=u=r=r||o,3!==r.nodeType&&8!==r.nodeType&&!_.test(d+x.event.triggered)&&(d.indexOf(".")>=0&&(g=d.split("."),d=g.shift(),g.sort()),c=0>d.indexOf(":")&&"on"+d,t=t[x.expando]?t:new x.Event(d,"object"==typeof t&&t),t.isTrigger=i?2:3,t.namespace=g.join("."),t.namespace_re=t.namespace?RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=undefined,t.target||(t.target=r),n=null==n?[t]:x.makeArray(n,[t]),f=x.event.special[d]||{},i||!f.trigger||f.trigger.apply(r,n)!==!1)){if(!i&&!f.noBubble&&!x.isWindow(r)){for(l=f.delegateType||d,_.test(l+d)||(a=a.parentNode);a;a=a.parentNode)h.push(a),u=a;u===(r.ownerDocument||o)&&h.push(u.defaultView||u.parentWindow||e)}s=0;while((a=h[s++])&&!t.isPropagationStopped())t.type=s>1?l:f.bindType||d,p=(q.get(a,"events")||{})[t.type]&&q.get(a,"handle"),p&&p.apply(a,n),p=c&&a[c],p&&x.acceptData(a)&&p.apply&&p.apply(a,n)===!1&&t.preventDefault();return t.type=d,i||t.isDefaultPrevented()||f._default&&f._default.apply(h.pop(),n)!==!1||!x.acceptData(r)||c&&x.isFunction(r[d])&&!x.isWindow(r)&&(u=r[c],u&&(r[c]=null),x.event.triggered=d,r[d](),x.event.triggered=undefined,u&&(r[c]=u)),t.result}},dispatch:function(e){e=x.event.fix(e);var t,n,r,i,o,s=[],a=d.call(arguments),u=(q.get(this,"events")||{})[e.type]||[],l=x.event.special[e.type]||{};if(a[0]=e,e.delegateTarget=this,!l.preDispatch||l.preDispatch.call(this,e)!==!1){s=x.event.handlers.call(this,e,u),t=0;while((i=s[t++])&&!e.isPropagationStopped()){e.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(o.namespace))&&(e.handleObj=o,e.data=o.data,r=((x.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,a),r!==undefined&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return l.postDispatch&&l.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,r,i,o,s=[],a=t.delegateCount,u=e.target;if(a&&u.nodeType&&(!e.button||"click"!==e.type))for(;u!==this;u=u.parentNode||this)if(u.disabled!==!0||"click"!==e.type){for(r=[],n=0;a>n;n++)o=t[n],i=o.selector+" ",r[i]===undefined&&(r[i]=o.needsContext?x(i,this).index(u)>=0:x.find(i,this,null,[u]).length),r[i]&&r.push(o);r.length&&s.push({elem:u,handlers:r})}return t.length>a&&s.push({elem:this,handlers:t.slice(a)}),s},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(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,t){var n,r,i,s=t.button;return null==e.pageX&&null!=t.clientX&&(n=e.target.ownerDocument||o,r=n.documentElement,i=n.body,e.pageX=t.clientX+(r&&r.scrollLeft||i&&i.scrollLeft||0)-(r&&r.clientLeft||i&&i.clientLeft||0),e.pageY=t.clientY+(r&&r.scrollTop||i&&i.scrollTop||0)-(r&&r.clientTop||i&&i.clientTop||0)),e.which||s===undefined||(e.which=1&s?1:2&s?3:4&s?2:0),e}},fix:function(e){if(e[x.expando])return e;var t,n,r,i=e.type,s=e,a=this.fixHooks[i];a||(this.fixHooks[i]=a=z.test(i)?this.mouseHooks:I.test(i)?this.keyHooks:{}),r=a.props?this.props.concat(a.props):this.props,e=new x.Event(s),t=r.length;while(t--)n=r[t],e[n]=s[n];return e.target||(e.target=o),3===e.target.nodeType&&(e.target=e.target.parentNode),a.filter?a.filter(e,s):e},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==V()&&this.focus?(this.focus(),!1):undefined},delegateType:"focusin"},blur:{trigger:function(){return this===V()&&this.blur?(this.blur(),!1):undefined},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&x.nodeName(this,"input")?(this.click(),!1):undefined},_default:function(e){return x.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==undefined&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=x.extend(new x.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?x.event.trigger(i,null,t):x.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},x.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)},x.Event=function(e,t){return this instanceof x.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.getPreventDefault&&e.getPreventDefault()?U:Y):this.type=e,t&&x.extend(this,t),this.timeStamp=e&&e.timeStamp||x.now(),this[x.expando]=!0,undefined):new x.Event(e,t)},x.Event.prototype={isDefaultPrevented:Y,isPropagationStopped:Y,isImmediatePropagationStopped:Y,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=U,e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=U,e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=U,this.stopPropagation()}},x.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){x.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!x.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),x.support.focusinBubbles||x.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){x.event.simulate(t,e.target,x.event.fix(e),!0)};x.event.special[t]={setup:function(){0===n++&&o.addEventListener(e,r,!0)},teardown:function(){0===--n&&o.removeEventListener(e,r,!0)}}}),x.fn.extend({on:function(e,t,n,r,i){var o,s;if("object"==typeof e){"string"!=typeof t&&(n=n||t,t=undefined);for(s in e)this.on(s,t,n,e[s],i);return this}if(null==n&&null==r?(r=t,n=t=undefined):null==r&&("string"==typeof t?(r=n,n=undefined):(r=n,n=t,t=undefined)),r===!1)r=Y;else if(!r)return this;return 1===i&&(o=r,r=function(e){return x().off(e),o.apply(this,arguments)},r.guid=o.guid||(o.guid=x.guid++)),this.each(function(){x.event.add(this,e,r,n,t)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,x(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return(t===!1||"function"==typeof t)&&(n=t,t=undefined),n===!1&&(n=Y),this.each(function(){x.event.remove(this,e,n,t)})},trigger:function(e,t){return this.each(function(){x.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];return n?x.event.trigger(e,t,n,!0):undefined}});var G=/^.[^:#\[\.,]*$/,J=/^(?:parents|prev(?:Until|All))/,Q=x.expr.match.needsContext,K={children:!0,contents:!0,next:!0,prev:!0};x.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(x(e).filter(function(){for(t=0;i>t;t++)if(x.contains(r[t],this))return!0}));for(t=0;i>t;t++)x.find(e,r[t],n);return n=this.pushStack(i>1?x.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},has:function(e){var t=x(e,this),n=t.length;return this.filter(function(){var e=0;for(;n>e;e++)if(x.contains(this,t[e]))return!0})},not:function(e){return this.pushStack(et(this,e||[],!0))},filter:function(e){return this.pushStack(et(this,e||[],!1))},is:function(e){return!!et(this,"string"==typeof e&&Q.test(e)?x(e):e||[],!1).length},closest:function(e,t){var n,r=0,i=this.length,o=[],s=Q.test(e)||"string"!=typeof e?x(e,t||this.context):0;for(;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(11>n.nodeType&&(s?s.index(n)>-1:1===n.nodeType&&x.find.matchesSelector(n,e))){n=o.push(n);break}return this.pushStack(o.length>1?x.unique(o):o)},index:function(e){return e?"string"==typeof e?g.call(x(e),this[0]):g.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?x(e,t):x.makeArray(e&&e.nodeType?[e]:e),r=x.merge(this.get(),n);return this.pushStack(x.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function Z(e,t){while((e=e[t])&&1!==e.nodeType);return e}x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return x.dir(e,"parentNode")},parentsUntil:function(e,t,n){return x.dir(e,"parentNode",n)},next:function(e){return Z(e,"nextSibling")},prev:function(e){return Z(e,"previousSibling")},nextAll:function(e){return x.dir(e,"nextSibling")},prevAll:function(e){return x.dir(e,"previousSibling")},nextUntil:function(e,t,n){return x.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return x.dir(e,"previousSibling",n)},siblings:function(e){return x.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return x.sibling(e.firstChild)},contents:function(e){return e.contentDocument||x.merge([],e.childNodes)}},function(e,t){x.fn[e]=function(n,r){var i=x.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=x.filter(r,i)),this.length>1&&(K[e]||x.unique(i),J.test(e)&&i.reverse()),this.pushStack(i)}}),x.extend({filter:function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?x.find.matchesSelector(r,e)?[r]:[]:x.find.matches(e,x.grep(t,function(e){return 1===e.nodeType}))},dir:function(e,t,n){var r=[],i=n!==undefined;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&x(e).is(n))break;r.push(e)}return r},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function et(e,t,n){if(x.isFunction(t))return x.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return x.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(G.test(t))return x.filter(t,e,n);t=x.filter(t,e)}return x.grep(e,function(e){return g.call(t,e)>=0!==n})}var tt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,nt=/<([\w:]+)/,rt=/<|&#?\w+;/,it=/<(?:script|style|link)/i,ot=/^(?:checkbox|radio)$/i,st=/checked\s*(?:[^=]|=\s*.checked.)/i,at=/^$|\/(?:java|ecma)script/i,ut=/^true\/(.*)/,lt=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,ct={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,"",""]};ct.optgroup=ct.option,ct.tbody=ct.tfoot=ct.colgroup=ct.caption=ct.thead,ct.th=ct.td,x.fn.extend({text:function(e){return x.access(this,function(e){return e===undefined?x.text(this):this.empty().append((this[0]&&this[0].ownerDocument||o).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=pt(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=pt(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=e?x.filter(e,this):this,i=0;for(;null!=(n=r[i]);i++)t||1!==n.nodeType||x.cleanData(mt(n)),n.parentNode&&(t&&x.contains(n.ownerDocument,n)&&dt(mt(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++)1===e.nodeType&&(x.cleanData(mt(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return x.clone(this,e,t)})},html:function(e){return x.access(this,function(e){var t=this[0]||{},n=0,r=this.length;if(e===undefined&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!it.test(e)&&!ct[(nt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(tt,"<$1></$2>");try{for(;r>n;n++)t=this[n]||{},1===t.nodeType&&(x.cleanData(mt(t,!1)),t.innerHTML=e);t=0}catch(i){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=x.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(n){var r=e[t++],i=e[t++];i&&(r&&r.parentNode!==i&&(r=this.nextSibling),x(this).remove(),i.insertBefore(n,r))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,n){e=f.apply([],e);var r,i,o,s,a,u,l=0,c=this.length,p=this,h=c-1,d=e[0],g=x.isFunction(d);if(g||!(1>=c||"string"!=typeof d||x.support.checkClone)&&st.test(d))return this.each(function(r){var i=p.eq(r);g&&(e[0]=d.call(this,r,i.html())),i.domManip(e,t,n)});if(c&&(r=x.buildFragment(e,this[0].ownerDocument,!1,!n&&this),i=r.firstChild,1===r.childNodes.length&&(r=i),i)){for(o=x.map(mt(r,"script"),ft),s=o.length;c>l;l++)a=r,l!==h&&(a=x.clone(a,!0,!0),s&&x.merge(o,mt(a,"script"))),t.call(this[l],a,l);if(s)for(u=o[o.length-1].ownerDocument,x.map(o,ht),l=0;s>l;l++)a=o[l],at.test(a.type||"")&&!q.access(a,"globalEval")&&x.contains(u,a)&&(a.src?x._evalUrl(a.src):x.globalEval(a.textContent.replace(lt,"")))}return this}}),x.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){x.fn[e]=function(e){var n,r=[],i=x(e),o=i.length-1,s=0;for(;o>=s;s++)n=s===o?this:this.clone(!0),x(i[s])[t](n),h.apply(r,n.get());return this.pushStack(r)}}),x.extend({clone:function(e,t,n){var r,i,o,s,a=e.cloneNode(!0),u=x.contains(e.ownerDocument,e);if(!(x.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||x.isXMLDoc(e)))for(s=mt(a),o=mt(e),r=0,i=o.length;i>r;r++)yt(o[r],s[r]);if(t)if(n)for(o=o||mt(e),s=s||mt(a),r=0,i=o.length;i>r;r++)gt(o[r],s[r]);else gt(e,a);return s=mt(a,"script"),s.length>0&&dt(s,!u&&mt(e,"script")),a},buildFragment:function(e,t,n,r){var i,o,s,a,u,l,c=0,p=e.length,f=t.createDocumentFragment(),h=[];for(;p>c;c++)if(i=e[c],i||0===i)if("object"===x.type(i))x.merge(h,i.nodeType?[i]:i);else if(rt.test(i)){o=o||f.appendChild(t.createElement("div")),s=(nt.exec(i)||["",""])[1].toLowerCase(),a=ct[s]||ct._default,o.innerHTML=a[1]+i.replace(tt,"<$1></$2>")+a[2],l=a[0];while(l--)o=o.lastChild;x.merge(h,o.childNodes),o=f.firstChild,o.textContent=""}else h.push(t.createTextNode(i));f.textContent="",c=0;while(i=h[c++])if((!r||-1===x.inArray(i,r))&&(u=x.contains(i.ownerDocument,i),o=mt(f.appendChild(i),"script"),u&&dt(o),n)){l=0;while(i=o[l++])at.test(i.type||"")&&n.push(i)}return f},cleanData:function(e){var t,n,r,i,o,s,a=x.event.special,u=0;for(;(n=e[u])!==undefined;u++){if(F.accepts(n)&&(o=n[q.expando],o&&(t=q.cache[o]))){if(r=Object.keys(t.events||{}),r.length)for(s=0;(i=r[s])!==undefined;s++)a[i]?x.event.remove(n,i):x.removeEvent(n,i,t.handle);q.cache[o]&&delete q.cache[o]}delete L.cache[n[L.expando]]}},_evalUrl:function(e){return x.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})}});function pt(e,t){return x.nodeName(e,"table")&&x.nodeName(1===t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function ft(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function ht(e){var t=ut.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function dt(e,t){var n=e.length,r=0;for(;n>r;r++)q.set(e[r],"globalEval",!t||q.get(t[r],"globalEval"))}function gt(e,t){var n,r,i,o,s,a,u,l;if(1===t.nodeType){if(q.hasData(e)&&(o=q.access(e),s=q.set(t,o),l=o.events)){delete s.handle,s.events={};for(i in l)for(n=0,r=l[i].length;r>n;n++)x.event.add(t,i,l[i][n])}L.hasData(e)&&(a=L.access(e),u=x.extend({},a),L.set(t,u))}}function mt(e,t){var n=e.getElementsByTagName?e.getElementsByTagName(t||"*"):e.querySelectorAll?e.querySelectorAll(t||"*"):[];return t===undefined||t&&x.nodeName(e,t)?x.merge([e],n):n}function yt(e,t){var n=t.nodeName.toLowerCase();"input"===n&&ot.test(e.type)?t.checked=e.checked:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}x.fn.extend({wrapAll:function(e){var t;return x.isFunction(e)?this.each(function(t){x(this).wrapAll(e.call(this,t))}):(this[0]&&(t=x(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this)},wrapInner:function(e){return x.isFunction(e)?this.each(function(t){x(this).wrapInner(e.call(this,t))}):this.each(function(){var t=x(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=x.isFunction(e);return this.each(function(n){x(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){x.nodeName(this,"body")||x(this).replaceWith(this.childNodes)}).end()}});var vt,xt,bt=/^(none|table(?!-c[ea]).+)/,wt=/^margin/,Tt=RegExp("^("+b+")(.*)$","i"),Ct=RegExp("^("+b+")(?!px)[a-z%]+$","i"),kt=RegExp("^([+-])=("+b+")","i"),Nt={BODY:"block"},Et={position:"absolute",visibility:"hidden",display:"block"},St={letterSpacing:0,fontWeight:400},jt=["Top","Right","Bottom","Left"],Dt=["Webkit","O","Moz","ms"];function At(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=Dt.length;while(i--)if(t=Dt[i]+n,t in e)return t;return r}function Lt(e,t){return e=t||e,"none"===x.css(e,"display")||!x.contains(e.ownerDocument,e)}function qt(t){return e.getComputedStyle(t,null)}function Ht(e,t){var n,r,i,o=[],s=0,a=e.length;for(;a>s;s++)r=e[s],r.style&&(o[s]=q.get(r,"olddisplay"),n=r.style.display,t?(o[s]||"none"!==n||(r.style.display=""),""===r.style.display&&Lt(r)&&(o[s]=q.access(r,"olddisplay",Rt(r.nodeName)))):o[s]||(i=Lt(r),(n&&"none"!==n||!i)&&q.set(r,"olddisplay",i?n:x.css(r,"display"))));for(s=0;a>s;s++)r=e[s],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[s]||"":"none"));return e}x.fn.extend({css:function(e,t){return x.access(this,function(e,t,n){var r,i,o={},s=0;if(x.isArray(t)){for(r=qt(e),i=t.length;i>s;s++)o[t[s]]=x.css(e,t[s],!1,r);return o}return n!==undefined?x.style(e,t,n):x.css(e,t)},e,t,arguments.length>1)},show:function(){return Ht(this,!0)},hide:function(){return Ht(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){Lt(this)?x(this).show():x(this).hide()})}}),x.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=vt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,s,a=x.camelCase(t),u=e.style;return t=x.cssProps[a]||(x.cssProps[a]=At(u,a)),s=x.cssHooks[t]||x.cssHooks[a],n===undefined?s&&"get"in s&&(i=s.get(e,!1,r))!==undefined?i:u[t]:(o=typeof n,"string"===o&&(i=kt.exec(n))&&(n=(i[1]+1)*i[2]+parseFloat(x.css(e,t)),o="number"),null==n||"number"===o&&isNaN(n)||("number"!==o||x.cssNumber[a]||(n+="px"),x.support.clearCloneStyle||""!==n||0!==t.indexOf("background")||(u[t]="inherit"),s&&"set"in s&&(n=s.set(e,n,r))===undefined||(u[t]=n)),undefined)}},css:function(e,t,n,r){var i,o,s,a=x.camelCase(t);return t=x.cssProps[a]||(x.cssProps[a]=At(e.style,a)),s=x.cssHooks[t]||x.cssHooks[a],s&&"get"in s&&(i=s.get(e,!0,n)),i===undefined&&(i=vt(e,t,r)),"normal"===i&&t in St&&(i=St[t]),""===n||n?(o=parseFloat(i),n===!0||x.isNumeric(o)?o||0:i):i}}),vt=function(e,t,n){var r,i,o,s=n||qt(e),a=s?s.getPropertyValue(t)||s[t]:undefined,u=e.style;return s&&(""!==a||x.contains(e.ownerDocument,e)||(a=x.style(e,t)),Ct.test(a)&&wt.test(t)&&(r=u.width,i=u.minWidth,o=u.maxWidth,u.minWidth=u.maxWidth=u.width=a,a=s.width,u.width=r,u.minWidth=i,u.maxWidth=o)),a};function Ot(e,t,n){var r=Tt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function Ft(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,s=0;for(;4>o;o+=2)"margin"===n&&(s+=x.css(e,n+jt[o],!0,i)),r?("content"===n&&(s-=x.css(e,"padding"+jt[o],!0,i)),"margin"!==n&&(s-=x.css(e,"border"+jt[o]+"Width",!0,i))):(s+=x.css(e,"padding"+jt[o],!0,i),"padding"!==n&&(s+=x.css(e,"border"+jt[o]+"Width",!0,i)));return s}function Pt(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=qt(e),s=x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=vt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Ct.test(i))return i;r=s&&(x.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+Ft(e,t,n||(s?"border":"content"),r,o)+"px"}function Rt(e){var t=o,n=Nt[e];return n||(n=Mt(e,t),"none"!==n&&n||(xt=(xt||x("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(xt[0].contentWindow||xt[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=Mt(e,t),xt.detach()),Nt[e]=n),n}function Mt(e,t){var n=x(t.createElement(e)).appendTo(t.body),r=x.css(n[0],"display");return n.remove(),r}x.each(["height","width"],function(e,t){x.cssHooks[t]={get:function(e,n,r){return n?0===e.offsetWidth&&bt.test(x.css(e,"display"))?x.swap(e,Et,function(){return Pt(e,t,r)}):Pt(e,t,r):undefined},set:function(e,n,r){var i=r&&qt(e);return Ot(e,n,r?Ft(e,t,r,x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,i),i):0)}}}),x(function(){x.support.reliableMarginRight||(x.cssHooks.marginRight={get:function(e,t){return t?x.swap(e,{display:"inline-block"},vt,[e,"marginRight"]):undefined}}),!x.support.pixelPosition&&x.fn.position&&x.each(["top","left"],function(e,t){x.cssHooks[t]={get:function(e,n){return n?(n=vt(e,t),Ct.test(n)?x(e).position()[t]+"px":n):undefined}}})}),x.expr&&x.expr.filters&&(x.expr.filters.hidden=function(e){return 0>=e.offsetWidth&&0>=e.offsetHeight},x.expr.filters.visible=function(e){return!x.expr.filters.hidden(e)}),x.each({margin:"",padding:"",border:"Width"},function(e,t){x.cssHooks[e+t]={expand:function(n){var r=0,i={},o="string"==typeof n?n.split(" "):[n];for(;4>r;r++)i[e+jt[r]+t]=o[r]||o[r-2]||o[0];return i}},wt.test(e)||(x.cssHooks[e+t].set=Ot)});var Wt=/%20/g,$t=/\[\]$/,Bt=/\r?\n/g,It=/^(?:submit|button|image|reset|file)$/i,zt=/^(?:input|select|textarea|keygen)/i;x.fn.extend({serialize:function(){return x.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=x.prop(this,"elements");return e?x.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!x(this).is(":disabled")&&zt.test(this.nodeName)&&!It.test(e)&&(this.checked||!ot.test(e))}).map(function(e,t){var n=x(this).val();return null==n?null:x.isArray(n)?x.map(n,function(e){return{name:t.name,value:e.replace(Bt,"\r\n")}}):{name:t.name,value:n.replace(Bt,"\r\n")}}).get()}}),x.param=function(e,t){var n,r=[],i=function(e,t){t=x.isFunction(t)?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(t===undefined&&(t=x.ajaxSettings&&x.ajaxSettings.traditional),x.isArray(e)||e.jquery&&!x.isPlainObject(e))x.each(e,function(){i(this.name,this.value)});else for(n in e)_t(n,e[n],t,i);return r.join("&").replace(Wt,"+")};function _t(e,t,n,r){var i;if(x.isArray(t))x.each(t,function(t,i){n||$t.test(e)?r(e,i):_t(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==x.type(t))r(e,t);else for(i in t)_t(e+"["+i+"]",t[i],n,r)}x.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(e,t){x.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),x.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)
+},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}});var Xt,Ut,Yt=x.now(),Vt=/\?/,Gt=/#.*$/,Jt=/([?&])_=[^&]*/,Qt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Kt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Zt=/^(?:GET|HEAD)$/,en=/^\/\//,tn=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,nn=x.fn.load,rn={},on={},sn="*/".concat("*");try{Ut=i.href}catch(an){Ut=o.createElement("a"),Ut.href="",Ut=Ut.href}Xt=tn.exec(Ut.toLowerCase())||[];function un(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(w)||[];if(x.isFunction(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function ln(e,t,n,r){var i={},o=e===on;function s(a){var u;return i[a]=!0,x.each(e[a]||[],function(e,a){var l=a(t,n,r);return"string"!=typeof l||o||i[l]?o?!(u=l):undefined:(t.dataTypes.unshift(l),s(l),!1)}),u}return s(t.dataTypes[0])||!i["*"]&&s("*")}function cn(e,t){var n,r,i=x.ajaxSettings.flatOptions||{};for(n in t)t[n]!==undefined&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&x.extend(!0,e,r),e}x.fn.load=function(e,t,n){if("string"!=typeof e&&nn)return nn.apply(this,arguments);var r,i,o,s=this,a=e.indexOf(" ");return a>=0&&(r=e.slice(a),e=e.slice(0,a)),x.isFunction(t)?(n=t,t=undefined):t&&"object"==typeof t&&(i="POST"),s.length>0&&x.ajax({url:e,type:i,dataType:"html",data:t}).done(function(e){o=arguments,s.html(r?x("<div>").append(x.parseHTML(e)).find(r):e)}).complete(n&&function(e,t){s.each(n,o||[e.responseText,t,e])}),this},x.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){x.fn[t]=function(e){return this.on(t,e)}}),x.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ut,type:"GET",isLocal:Kt.test(Xt[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":sn,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":x.parseJSON,"text xml":x.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?cn(cn(e,x.ajaxSettings),t):cn(x.ajaxSettings,e)},ajaxPrefilter:un(rn),ajaxTransport:un(on),ajax:function(e,t){"object"==typeof e&&(t=e,e=undefined),t=t||{};var n,r,i,o,s,a,u,l,c=x.ajaxSetup({},t),p=c.context||c,f=c.context&&(p.nodeType||p.jquery)?x(p):x.event,h=x.Deferred(),d=x.Callbacks("once memory"),g=c.statusCode||{},m={},y={},v=0,b="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(2===v){if(!o){o={};while(t=Qt.exec(i))o[t[1].toLowerCase()]=t[2]}t=o[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===v?i:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return v||(e=y[n]=y[n]||e,m[e]=t),this},overrideMimeType:function(e){return v||(c.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>v)for(t in e)g[t]=[g[t],e[t]];else T.always(e[T.status]);return this},abort:function(e){var t=e||b;return n&&n.abort(t),k(0,t),this}};if(h.promise(T).complete=d.add,T.success=T.done,T.error=T.fail,c.url=((e||c.url||Ut)+"").replace(Gt,"").replace(en,Xt[1]+"//"),c.type=t.method||t.type||c.method||c.type,c.dataTypes=x.trim(c.dataType||"*").toLowerCase().match(w)||[""],null==c.crossDomain&&(a=tn.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]===Xt[1]&&a[2]===Xt[2]&&(a[3]||("http:"===a[1]?"80":"443"))===(Xt[3]||("http:"===Xt[1]?"80":"443")))),c.data&&c.processData&&"string"!=typeof c.data&&(c.data=x.param(c.data,c.traditional)),ln(rn,c,t,T),2===v)return T;u=c.global,u&&0===x.active++&&x.event.trigger("ajaxStart"),c.type=c.type.toUpperCase(),c.hasContent=!Zt.test(c.type),r=c.url,c.hasContent||(c.data&&(r=c.url+=(Vt.test(r)?"&":"?")+c.data,delete c.data),c.cache===!1&&(c.url=Jt.test(r)?r.replace(Jt,"$1_="+Yt++):r+(Vt.test(r)?"&":"?")+"_="+Yt++)),c.ifModified&&(x.lastModified[r]&&T.setRequestHeader("If-Modified-Since",x.lastModified[r]),x.etag[r]&&T.setRequestHeader("If-None-Match",x.etag[r])),(c.data&&c.hasContent&&c.contentType!==!1||t.contentType)&&T.setRequestHeader("Content-Type",c.contentType),T.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+("*"!==c.dataTypes[0]?", "+sn+"; q=0.01":""):c.accepts["*"]);for(l in c.headers)T.setRequestHeader(l,c.headers[l]);if(c.beforeSend&&(c.beforeSend.call(p,T,c)===!1||2===v))return T.abort();b="abort";for(l in{success:1,error:1,complete:1})T[l](c[l]);if(n=ln(on,c,t,T)){T.readyState=1,u&&f.trigger("ajaxSend",[T,c]),c.async&&c.timeout>0&&(s=setTimeout(function(){T.abort("timeout")},c.timeout));try{v=1,n.send(m,k)}catch(C){if(!(2>v))throw C;k(-1,C)}}else k(-1,"No Transport");function k(e,t,o,a){var l,m,y,b,w,C=t;2!==v&&(v=2,s&&clearTimeout(s),n=undefined,i=a||"",T.readyState=e>0?4:0,l=e>=200&&300>e||304===e,o&&(b=pn(c,T,o)),b=fn(c,b,T,l),l?(c.ifModified&&(w=T.getResponseHeader("Last-Modified"),w&&(x.lastModified[r]=w),w=T.getResponseHeader("etag"),w&&(x.etag[r]=w)),204===e||"HEAD"===c.type?C="nocontent":304===e?C="notmodified":(C=b.state,m=b.data,y=b.error,l=!y)):(y=C,(e||!C)&&(C="error",0>e&&(e=0))),T.status=e,T.statusText=(t||C)+"",l?h.resolveWith(p,[m,C,T]):h.rejectWith(p,[T,C,y]),T.statusCode(g),g=undefined,u&&f.trigger(l?"ajaxSuccess":"ajaxError",[T,c,l?m:y]),d.fireWith(p,[T,C]),u&&(f.trigger("ajaxComplete",[T,c]),--x.active||x.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return x.get(e,t,n,"json")},getScript:function(e,t){return x.get(e,undefined,t,"script")}}),x.each(["get","post"],function(e,t){x[t]=function(e,n,r,i){return x.isFunction(n)&&(i=i||r,r=n,n=undefined),x.ajax({url:e,type:t,dataType:i,data:n,success:r})}});function pn(e,t,n){var r,i,o,s,a=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),r===undefined&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in a)if(a[i]&&a[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}s||(s=i)}o=o||s}return o?(o!==u[0]&&u.unshift(o),n[o]):undefined}function fn(e,t,n,r){var i,o,s,a,u,l={},c=e.dataTypes.slice();if(c[1])for(s in e.converters)l[s.toLowerCase()]=e.converters[s];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(s=l[u+" "+o]||l["* "+o],!s)for(i in l)if(a=i.split(" "),a[1]===o&&(s=l[u+" "+a[0]]||l["* "+a[0]])){s===!0?s=l[i]:l[i]!==!0&&(o=a[0],c.unshift(a[1]));break}if(s!==!0)if(s&&e["throws"])t=s(t);else try{t=s(t)}catch(p){return{state:"parsererror",error:s?p:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}x.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return x.globalEval(e),e}}}),x.ajaxPrefilter("script",function(e){e.cache===undefined&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),x.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(r,i){t=x("<script>").prop({async:!0,charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),o.head.appendChild(t[0])},abort:function(){n&&n()}}}});var hn=[],dn=/(=)\?(?=&|$)|\?\?/;x.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=hn.pop()||x.expando+"_"+Yt++;return this[e]=!0,e}}),x.ajaxPrefilter("json jsonp",function(t,n,r){var i,o,s,a=t.jsonp!==!1&&(dn.test(t.url)?"url":"string"==typeof t.data&&!(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&dn.test(t.data)&&"data");return a||"jsonp"===t.dataTypes[0]?(i=t.jsonpCallback=x.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(dn,"$1"+i):t.jsonp!==!1&&(t.url+=(Vt.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return s||x.error(i+" was not called"),s[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){s=arguments},r.always(function(){e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,hn.push(i)),s&&x.isFunction(o)&&o(s[0]),s=o=undefined}),"script"):undefined}),x.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(e){}};var gn=x.ajaxSettings.xhr(),mn={0:200,1223:204},yn=0,vn={};e.ActiveXObject&&x(e).on("unload",function(){for(var e in vn)vn[e]();vn=undefined}),x.support.cors=!!gn&&"withCredentials"in gn,x.support.ajax=gn=!!gn,x.ajaxTransport(function(e){var t;return x.support.cors||gn&&!e.crossDomain?{send:function(n,r){var i,o,s=e.xhr();if(s.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(i in e.xhrFields)s[i]=e.xhrFields[i];e.mimeType&&s.overrideMimeType&&s.overrideMimeType(e.mimeType),e.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest");for(i in n)s.setRequestHeader(i,n[i]);t=function(e){return function(){t&&(delete vn[o],t=s.onload=s.onerror=null,"abort"===e?s.abort():"error"===e?r(s.status||404,s.statusText):r(mn[s.status]||s.status,s.statusText,"string"==typeof s.responseText?{text:s.responseText}:undefined,s.getAllResponseHeaders()))}},s.onload=t(),s.onerror=t("error"),t=vn[o=yn++]=t("abort"),s.send(e.hasContent&&e.data||null)},abort:function(){t&&t()}}:undefined});var xn,bn,wn=/^(?:toggle|show|hide)$/,Tn=RegExp("^(?:([+-])=|)("+b+")([a-z%]*)$","i"),Cn=/queueHooks$/,kn=[An],Nn={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=Tn.exec(t),o=i&&i[3]||(x.cssNumber[e]?"":"px"),s=(x.cssNumber[e]||"px"!==o&&+r)&&Tn.exec(x.css(n.elem,e)),a=1,u=20;if(s&&s[3]!==o){o=o||s[3],i=i||[],s=+r||1;do a=a||".5",s/=a,x.style(n.elem,e,s+o);while(a!==(a=n.cur()/r)&&1!==a&&--u)}return i&&(s=n.start=+s||+r||0,n.unit=o,n.end=i[1]?s+(i[1]+1)*i[2]:+i[2]),n}]};function En(){return setTimeout(function(){xn=undefined}),xn=x.now()}function Sn(e,t,n){var r,i=(Nn[t]||[]).concat(Nn["*"]),o=0,s=i.length;for(;s>o;o++)if(r=i[o].call(n,t,e))return r}function jn(e,t,n){var r,i,o=0,s=kn.length,a=x.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;var t=xn||En(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,o=1-r,s=0,u=l.tweens.length;for(;u>s;s++)l.tweens[s].run(o);return a.notifyWith(e,[l,o,n]),1>o&&u?n:(a.resolveWith(e,[l]),!1)},l=a.promise({elem:e,props:x.extend({},t),opts:x.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:xn||En(),duration:n.duration,tweens:[],createTween:function(t,n){var r=x.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)l.tweens[n].run(1);return t?a.resolveWith(e,[l,t]):a.rejectWith(e,[l,t]),this}}),c=l.props;for(Dn(c,l.opts.specialEasing);s>o;o++)if(r=kn[o].call(l,e,c,l.opts))return r;return x.map(c,Sn,l),x.isFunction(l.opts.start)&&l.opts.start.call(e,l),x.fx.timer(x.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function Dn(e,t){var n,r,i,o,s;for(n in e)if(r=x.camelCase(n),i=t[r],o=e[n],x.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),s=x.cssHooks[r],s&&"expand"in s){o=s.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}x.Animation=x.extend(jn,{tweener:function(e,t){x.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;i>r;r++)n=e[r],Nn[n]=Nn[n]||[],Nn[n].unshift(t)},prefilter:function(e,t){t?kn.unshift(e):kn.push(e)}});function An(e,t,n){var r,i,o,s,a,u,l=this,c={},p=e.style,f=e.nodeType&&Lt(e),h=q.get(e,"fxshow");n.queue||(a=x._queueHooks(e,"fx"),null==a.unqueued&&(a.unqueued=0,u=a.empty.fire,a.empty.fire=function(){a.unqueued||u()}),a.unqueued++,l.always(function(){l.always(function(){a.unqueued--,x.queue(e,"fx").length||a.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],"inline"===x.css(e,"display")&&"none"===x.css(e,"float")&&(p.display="inline-block")),n.overflow&&(p.overflow="hidden",l.always(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}));for(r in t)if(i=t[r],wn.exec(i)){if(delete t[r],o=o||"toggle"===i,i===(f?"hide":"show")){if("show"!==i||!h||h[r]===undefined)continue;f=!0}c[r]=h&&h[r]||x.style(e,r)}if(!x.isEmptyObject(c)){h?"hidden"in h&&(f=h.hidden):h=q.access(e,"fxshow",{}),o&&(h.hidden=!f),f?x(e).show():l.done(function(){x(e).hide()}),l.done(function(){var t;q.remove(e,"fxshow");for(t in c)x.style(e,t,c[t])});for(r in c)s=Sn(f?h[r]:0,r,l),r in h||(h[r]=s.start,f&&(s.end=s.start,s.start="width"===r||"height"===r?1:0))}}function Ln(e,t,n,r,i){return new Ln.prototype.init(e,t,n,r,i)}x.Tween=Ln,Ln.prototype={constructor:Ln,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(x.cssNumber[n]?"":"px")},cur:function(){var e=Ln.propHooks[this.prop];return e&&e.get?e.get(this):Ln.propHooks._default.get(this)},run:function(e){var t,n=Ln.propHooks[this.prop];return this.pos=t=this.options.duration?x.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Ln.propHooks._default.set(this),this}},Ln.prototype.init.prototype=Ln.prototype,Ln.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=x.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){x.fx.step[e.prop]?x.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[x.cssProps[e.prop]]||x.cssHooks[e.prop])?x.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},Ln.propHooks.scrollTop=Ln.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},x.each(["toggle","show","hide"],function(e,t){var n=x.fn[t];x.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(qn(t,!0),e,r,i)}}),x.fn.extend({fadeTo:function(e,t,n,r){return this.filter(Lt).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=x.isEmptyObject(e),o=x.speed(t,n,r),s=function(){var t=jn(this,x.extend({},e),o);(i||q.get(this,"finish"))&&t.stop(!0)};return s.finish=s,i||o.queue===!1?this.each(s):this.queue(o.queue,s)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=undefined),t&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",o=x.timers,s=q.get(this);if(i)s[i]&&s[i].stop&&r(s[i]);else for(i in s)s[i]&&s[i].stop&&Cn.test(i)&&r(s[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));(t||!n)&&x.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=q.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=x.timers,s=r?r.length:0;for(n.finish=!0,x.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;s>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}});function qn(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=jt[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}x.each({slideDown:qn("show"),slideUp:qn("hide"),slideToggle:qn("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){x.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),x.speed=function(e,t,n){var r=e&&"object"==typeof e?x.extend({},e):{complete:n||!n&&t||x.isFunction(e)&&e,duration:e,easing:n&&t||t&&!x.isFunction(t)&&t};return r.duration=x.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in x.fx.speeds?x.fx.speeds[r.duration]:x.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){x.isFunction(r.old)&&r.old.call(this),r.queue&&x.dequeue(this,r.queue)},r},x.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},x.timers=[],x.fx=Ln.prototype.init,x.fx.tick=function(){var e,t=x.timers,n=0;for(xn=x.now();t.length>n;n++)e=t[n],e()||t[n]!==e||t.splice(n--,1);t.length||x.fx.stop(),xn=undefined},x.fx.timer=function(e){e()&&x.timers.push(e)&&x.fx.start()},x.fx.interval=13,x.fx.start=function(){bn||(bn=setInterval(x.fx.tick,x.fx.interval))},x.fx.stop=function(){clearInterval(bn),bn=null},x.fx.speeds={slow:600,fast:200,_default:400},x.fx.step={},x.expr&&x.expr.filters&&(x.expr.filters.animated=function(e){return x.grep(x.timers,function(t){return e===t.elem}).length}),x.fn.offset=function(e){if(arguments.length)return e===undefined?this:this.each(function(t){x.offset.setOffset(this,e,t)});var t,n,i=this[0],o={top:0,left:0},s=i&&i.ownerDocument;if(s)return t=s.documentElement,x.contains(t,i)?(typeof i.getBoundingClientRect!==r&&(o=i.getBoundingClientRect()),n=Hn(s),{top:o.top+n.pageYOffset-t.clientTop,left:o.left+n.pageXOffset-t.clientLeft}):o},x.offset={setOffset:function(e,t,n){var r,i,o,s,a,u,l,c=x.css(e,"position"),p=x(e),f={};"static"===c&&(e.style.position="relative"),a=p.offset(),o=x.css(e,"top"),u=x.css(e,"left"),l=("absolute"===c||"fixed"===c)&&(o+u).indexOf("auto")>-1,l?(r=p.position(),s=r.top,i=r.left):(s=parseFloat(o)||0,i=parseFloat(u)||0),x.isFunction(t)&&(t=t.call(e,n,a)),null!=t.top&&(f.top=t.top-a.top+s),null!=t.left&&(f.left=t.left-a.left+i),"using"in t?t.using.call(e,f):p.css(f)}},x.fn.extend({position:function(){if(this[0]){var e,t,n=this[0],r={top:0,left:0};return"fixed"===x.css(n,"position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),x.nodeName(e[0],"html")||(r=e.offset()),r.top+=x.css(e[0],"borderTopWidth",!0),r.left+=x.css(e[0],"borderLeftWidth",!0)),{top:t.top-r.top-x.css(n,"marginTop",!0),left:t.left-r.left-x.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||s;while(e&&!x.nodeName(e,"html")&&"static"===x.css(e,"position"))e=e.offsetParent;return e||s})}}),x.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,n){var r="pageYOffset"===n;x.fn[t]=function(i){return x.access(this,function(t,i,o){var s=Hn(t);return o===undefined?s?s[n]:t[i]:(s?s.scrollTo(r?e.pageXOffset:o,r?o:e.pageYOffset):t[i]=o,undefined)},t,i,arguments.length,null)}});function Hn(e){return x.isWindow(e)?e:9===e.nodeType&&e.defaultView}x.each({Height:"height",Width:"width"},function(e,t){x.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){x.fn[r]=function(r,i){var o=arguments.length&&(n||"boolean"!=typeof r),s=n||(r===!0||i===!0?"margin":"border");return x.access(this,function(t,n,r){var i;return x.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):r===undefined?x.css(t,n,s):x.style(t,n,r,s)},t,o?r:undefined,o,null)}})}),x.fn.size=function(){return this.length},x.fn.andSelf=x.fn.addBack,"object"==typeof module&&module&&"object"==typeof module.exports?module.exports=x:"function"==typeof define&&define.amd&&define("jquery",[],function(){return x}),"object"==typeof e&&"object"==typeof e.document&&(e.jQuery=e.$=x)})(window);
diff --git a/public_html/data/js/vendor/jquery-2.0.3.min.map b/public_html/data/js/vendor/jquery-2.0.3.min.map
new file mode 100644
index 000000000..472d71bb0
--- /dev/null
+++ b/public_html/data/js/vendor/jquery-2.0.3.min.map
@@ -0,0 +1 @@
+{"version":3,"file":"jquery-2.0.3.min.js","sources":["jquery-2.0.3.js"],"names":["window","undefined","rootjQuery","readyList","core_strundefined","location","document","docElem","documentElement","_jQuery","jQuery","_$","$","class2type","core_deletedIds","core_version","core_concat","concat","core_push","push","core_slice","slice","core_indexOf","indexOf","core_toString","toString","core_hasOwn","hasOwnProperty","core_trim","trim","selector","context","fn","init","core_pnum","source","core_rnotwhite","rquickExpr","rsingleTag","rmsPrefix","rdashAlpha","fcamelCase","all","letter","toUpperCase","completed","removeEventListener","ready","prototype","jquery","constructor","match","elem","this","charAt","length","exec","find","merge","parseHTML","nodeType","ownerDocument","test","isPlainObject","isFunction","attr","getElementById","parentNode","makeArray","toArray","call","get","num","pushStack","elems","ret","prevObject","each","callback","args","promise","done","apply","arguments","first","eq","last","i","len","j","map","end","sort","splice","extend","options","name","src","copy","copyIsArray","clone","target","deep","isArray","expando","Math","random","replace","noConflict","isReady","readyWait","holdReady","hold","wait","resolveWith","trigger","off","obj","type","Array","isWindow","isNumeric","isNaN","parseFloat","isFinite","String","e","isEmptyObject","error","msg","Error","data","keepScripts","parsed","scripts","createElement","buildFragment","remove","childNodes","parseJSON","JSON","parse","parseXML","xml","tmp","DOMParser","parseFromString","getElementsByTagName","noop","globalEval","code","script","indirect","eval","text","head","appendChild","removeChild","camelCase","string","nodeName","toLowerCase","value","isArraylike","arr","results","Object","inArray","second","l","grep","inv","retVal","arg","guid","proxy","access","key","chainable","emptyGet","raw","bulk","now","Date","swap","old","style","Deferred","readyState","setTimeout","addEventListener","split","support","cachedruns","Expr","getText","isXML","compile","outermostContext","sortInput","setDocument","documentIsHTML","rbuggyQSA","rbuggyMatches","matches","contains","preferredDoc","dirruns","classCache","createCache","tokenCache","compilerCache","hasDuplicate","sortOrder","a","b","strundefined","MAX_NEGATIVE","hasOwn","pop","push_native","booleans","whitespace","characterEncoding","identifier","attributes","pseudos","rtrim","RegExp","rcomma","rcombinators","rsibling","rattributeQuotes","rpseudo","ridentifier","matchExpr","ID","CLASS","TAG","ATTR","PSEUDO","CHILD","bool","needsContext","rnative","rinputs","rheader","rescape","runescape","funescape","_","escaped","escapedWhitespace","high","fromCharCode","els","Sizzle","seed","m","groups","nid","newContext","newSelector","id","getElementsByClassName","qsa","tokenize","getAttribute","setAttribute","toSelector","join","querySelectorAll","qsaError","removeAttribute","select","keys","cache","cacheLength","shift","markFunction","assert","div","addHandle","attrs","handler","attrHandle","siblingCheck","cur","diff","sourceIndex","nextSibling","createInputPseudo","createButtonPseudo","createPositionalPseudo","argument","matchIndexes","node","doc","parent","defaultView","attachEvent","top","className","createComment","innerHTML","firstChild","getById","getElementsByName","filter","attrId","getAttributeNode","tag","input","matchesSelector","webkitMatchesSelector","mozMatchesSelector","oMatchesSelector","msMatchesSelector","disconnectedMatch","compareDocumentPosition","adown","bup","compare","sortDetached","aup","ap","bp","unshift","expr","elements","val","specified","uniqueSort","duplicates","detectDuplicates","sortStable","textContent","nodeValue","selectors","createPseudo","relative",">","dir"," ","+","~","preFilter","excess","unquoted","nodeNameSelector","pattern","operator","check","result","what","simple","forward","ofType","outerCache","nodeIndex","start","useCache","lastChild","pseudo","setFilters","idx","matched","not","matcher","unmatched","has","innerText","lang","elemLang","hash","root","focus","activeElement","hasFocus","href","tabIndex","enabled","disabled","checked","selected","selectedIndex","empty","header","button","even","odd","lt","gt","radio","checkbox","file","password","image","submit","reset","filters","parseOnly","tokens","soFar","preFilters","cached","addCombinator","combinator","base","checkNonElements","doneName","dirkey","elementMatcher","matchers","condense","newUnmatched","mapped","setMatcher","postFilter","postFinder","postSelector","temp","preMap","postMap","preexisting","multipleContexts","matcherIn","matcherOut","matcherFromTokens","checkContext","leadingRelative","implicitRelative","matchContext","matchAnyContext","matcherFromGroupMatchers","elementMatchers","setMatchers","matcherCachedRuns","bySet","byElement","superMatcher","expandContext","setMatched","matchedCount","outermost","contextBackup","dirrunsUnique","group","contexts","token","div1","defaultValue","unique","isXMLDoc","optionsCache","createOptions","object","flag","Callbacks","memory","fired","firing","firingStart","firingLength","firingIndex","list","stack","once","fire","stopOnFalse","self","disable","add","index","lock","locked","fireWith","func","tuples","state","always","deferred","fail","then","fns","newDefer","tuple","action","returned","resolve","reject","progress","notify","pipe","stateString","when","subordinate","resolveValues","remaining","updateFunc","values","progressValues","notifyWith","progressContexts","resolveContexts","fragment","createDocumentFragment","opt","checkOn","optSelected","reliableMarginRight","boxSizingReliable","pixelPosition","noCloneChecked","cloneNode","optDisabled","radioValue","checkClone","focusinBubbles","backgroundClip","clearCloneStyle","container","marginDiv","divReset","body","cssText","zoom","boxSizing","offsetWidth","getComputedStyle","width","marginRight","data_user","data_priv","rbrace","rmultiDash","Data","defineProperty","uid","accepts","owner","descriptor","unlock","defineProperties","set","prop","stored","camel","hasData","discard","acceptData","removeData","_data","_removeData","dataAttr","camelKey","queue","dequeue","startLength","hooks","_queueHooks","next","stop","setter","delay","time","fx","speeds","timeout","clearTimeout","clearQueue","count","defer","nodeHook","boolHook","rclass","rreturn","rfocusable","removeAttr","removeProp","propFix","addClass","classes","clazz","proceed","removeClass","toggleClass","stateVal","classNames","hasClass","valHooks","option","one","max","optionSet","nType","attrHooks","propName","attrNames","for","class","notxml","propHooks","hasAttribute","getter","rkeyEvent","rmouseEvent","rfocusMorph","rtypenamespace","returnTrue","returnFalse","safeActiveElement","err","event","global","types","handleObjIn","eventHandle","events","t","handleObj","special","handlers","namespaces","origType","elemData","handle","triggered","dispatch","delegateType","bindType","namespace","delegateCount","setup","mappedTypes","origCount","teardown","removeEvent","onlyHandlers","bubbleType","ontype","eventPath","Event","isTrigger","namespace_re","noBubble","parentWindow","isPropagationStopped","preventDefault","isDefaultPrevented","_default","fix","handlerQueue","delegateTarget","preDispatch","currentTarget","isImmediatePropagationStopped","stopPropagation","postDispatch","sel","props","fixHooks","keyHooks","original","which","charCode","keyCode","mouseHooks","eventDoc","pageX","clientX","scrollLeft","clientLeft","pageY","clientY","scrollTop","clientTop","originalEvent","fixHook","load","blur","click","beforeunload","returnValue","simulate","bubble","isSimulated","defaultPrevented","getPreventDefault","timeStamp","stopImmediatePropagation","mouseenter","mouseleave","orig","related","relatedTarget","attaches","on","origFn","triggerHandler","isSimple","rparentsprev","rneedsContext","guaranteedUnique","children","contents","prev","targets","winnow","is","closest","pos","prevAll","addBack","sibling","parents","parentsUntil","until","nextAll","nextUntil","prevUntil","siblings","contentDocument","reverse","truncate","n","qualifier","rxhtmlTag","rtagName","rhtml","rnoInnerhtml","manipulation_rcheckableType","rchecked","rscriptType","rscriptTypeMasked","rcleanScript","wrapMap","thead","col","tr","td","optgroup","tbody","tfoot","colgroup","caption","th","append","createTextNode","domManip","manipulationTarget","prepend","insertBefore","before","after","keepData","cleanData","getAll","setGlobalEval","dataAndEvents","deepDataAndEvents","html","replaceWith","detach","allowIntersection","hasScripts","iNoClone","disableScript","restoreScript","_evalUrl","appendTo","prependTo","insertAfter","replaceAll","insert","srcElements","destElements","inPage","fixInput","cloneCopyEvent","selection","wrap","nodes","url","ajax","dataType","async","throws","content","refElements","dest","pdataOld","pdataCur","udataOld","udataCur","wrapAll","firstElementChild","wrapInner","unwrap","curCSS","iframe","rdisplayswap","rmargin","rnumsplit","rnumnonpx","rrelNum","elemdisplay","BODY","cssShow","position","visibility","display","cssNormalTransform","letterSpacing","fontWeight","cssExpand","cssPrefixes","vendorPropName","capName","origName","isHidden","el","css","getStyles","showHide","show","hidden","css_defaultDisplay","styles","hide","toggle","cssHooks","opacity","computed","cssNumber","columnCount","fillOpacity","lineHeight","order","orphans","widows","zIndex","cssProps","float","extra","_computed","minWidth","maxWidth","getPropertyValue","setPositiveNumber","subtract","augmentWidthOrHeight","isBorderBox","getWidthOrHeight","valueIsBorderBox","offsetHeight","actualDisplay","contentWindow","write","close","visible","margin","padding","border","prefix","suffix","expand","expanded","parts","r20","rbracket","rCRLF","rsubmitterTypes","rsubmittable","serialize","param","serializeArray","traditional","s","encodeURIComponent","ajaxSettings","buildParams","v","hover","fnOver","fnOut","bind","unbind","delegate","undelegate","ajaxLocParts","ajaxLocation","ajax_nonce","ajax_rquery","rhash","rts","rheaders","rlocalProtocol","rnoContent","rprotocol","rurl","_load","prefilters","transports","allTypes","addToPrefiltersOrTransports","structure","dataTypeExpression","dataTypes","inspectPrefiltersOrTransports","originalOptions","jqXHR","inspected","seekingTransport","inspect","prefilterOrFactory","dataTypeOrTransport","ajaxExtend","flatOptions","params","response","responseText","complete","status","active","lastModified","etag","isLocal","processData","contentType","*","json","responseFields","converters","* text","text html","text json","text xml","ajaxSetup","settings","ajaxPrefilter","ajaxTransport","transport","cacheURL","responseHeadersString","responseHeaders","timeoutTimer","fireGlobals","callbackContext","globalEventContext","completeDeferred","statusCode","requestHeaders","requestHeadersNames","strAbort","getResponseHeader","getAllResponseHeaders","setRequestHeader","lname","overrideMimeType","mimeType","abort","statusText","finalText","success","method","crossDomain","hasContent","ifModified","headers","beforeSend","send","nativeStatusText","responses","isSuccess","modified","ajaxHandleResponses","ajaxConvert","rejectWith","getJSON","getScript","ct","finalDataType","firstDataType","conv2","current","conv","dataFilter","text script","charset","scriptCharset","evt","oldCallbacks","rjsonp","jsonp","jsonpCallback","originalSettings","callbackName","overwritten","responseContainer","jsonProp","xhr","XMLHttpRequest","xhrSupported","xhrSuccessStatus",1223,"xhrId","xhrCallbacks","ActiveXObject","cors","open","username","xhrFields","onload","onerror","fxNow","timerId","rfxtypes","rfxnum","rrun","animationPrefilters","defaultPrefilter","tweeners","tween","createTween","unit","scale","maxIterations","createFxNow","animation","collection","Animation","properties","stopped","tick","currentTime","startTime","duration","percent","tweens","run","opts","specialEasing","originalProperties","Tween","easing","gotoEnd","propFilter","timer","anim","tweener","prefilter","oldfire","dataShow","unqueued","overflow","overflowX","overflowY","eased","step","cssFn","speed","animate","genFx","fadeTo","to","optall","doAnimation","finish","stopQueue","timers","includeWidth","height","slideDown","slideUp","slideToggle","fadeIn","fadeOut","fadeToggle","linear","p","swing","cos","PI","interval","setInterval","clearInterval","slow","fast","animated","offset","setOffset","win","box","left","getBoundingClientRect","getWindow","pageYOffset","pageXOffset","curPosition","curLeft","curCSSTop","curTop","curOffset","curCSSLeft","calculatePosition","curElem","using","offsetParent","parentOffset","scrollTo","Height","Width","defaultExtra","funcName","size","andSelf","module","exports","define","amd"],"mappings":";;;CAaA,SAAWA,EAAQC,WAOnB,GAECC,GAGAC,EAIAC,QAA2BH,WAG3BI,EAAWL,EAAOK,SAClBC,EAAWN,EAAOM,SAClBC,EAAUD,EAASE,gBAGnBC,EAAUT,EAAOU,OAGjBC,EAAKX,EAAOY,EAGZC,KAGAC,KAEAC,EAAe,QAGfC,EAAcF,EAAgBG,OAC9BC,EAAYJ,EAAgBK,KAC5BC,EAAaN,EAAgBO,MAC7BC,EAAeR,EAAgBS,QAC/BC,EAAgBX,EAAWY,SAC3BC,EAAcb,EAAWc,eACzBC,EAAYb,EAAac,KAGzBnB,EAAS,SAAUoB,EAAUC,GAE5B,MAAO,IAAIrB,GAAOsB,GAAGC,KAAMH,EAAUC,EAAS7B,IAI/CgC,EAAY,sCAAsCC,OAGlDC,EAAiB,OAKjBC,EAAa,sCAGbC,EAAa,6BAGbC,EAAY,QACZC,EAAa,eAGbC,EAAa,SAAUC,EAAKC,GAC3B,MAAOA,GAAOC,eAIfC,EAAY,WACXvC,EAASwC,oBAAqB,mBAAoBD,GAAW,GAC7D7C,EAAO8C,oBAAqB,OAAQD,GAAW,GAC/CnC,EAAOqC,QAGTrC,GAAOsB,GAAKtB,EAAOsC,WAElBC,OAAQlC,EAERmC,YAAaxC,EACbuB,KAAM,SAAUH,EAAUC,EAAS7B,GAClC,GAAIiD,GAAOC,CAGX,KAAMtB,EACL,MAAOuB,KAIR,IAAyB,gBAAbvB,GAAwB,CAUnC,GAPCqB,EAF2B,MAAvBrB,EAASwB,OAAO,IAAyD,MAA3CxB,EAASwB,OAAQxB,EAASyB,OAAS,IAAezB,EAASyB,QAAU,GAE7F,KAAMzB,EAAU,MAGlBO,EAAWmB,KAAM1B,IAIrBqB,IAAUA,EAAM,IAAOpB,EA+CrB,OAAMA,GAAWA,EAAQkB,QACtBlB,GAAW7B,GAAauD,KAAM3B,GAKhCuB,KAAKH,YAAanB,GAAU0B,KAAM3B,EAlDzC,IAAKqB,EAAM,GAAK,CAWf,GAVApB,EAAUA,YAAmBrB,GAASqB,EAAQ,GAAKA,EAGnDrB,EAAOgD,MAAOL,KAAM3C,EAAOiD,UAC1BR,EAAM,GACNpB,GAAWA,EAAQ6B,SAAW7B,EAAQ8B,eAAiB9B,EAAUzB,GACjE,IAIIgC,EAAWwB,KAAMX,EAAM,KAAQzC,EAAOqD,cAAehC,GACzD,IAAMoB,IAASpB,GAETrB,EAAOsD,WAAYX,KAAMF,IAC7BE,KAAMF,GAASpB,EAASoB,IAIxBE,KAAKY,KAAMd,EAAOpB,EAASoB,GAK9B,OAAOE,MAgBP,MAZAD,GAAO9C,EAAS4D,eAAgBf,EAAM,IAIjCC,GAAQA,EAAKe,aAEjBd,KAAKE,OAAS,EACdF,KAAK,GAAKD,GAGXC,KAAKtB,QAAUzB,EACf+C,KAAKvB,SAAWA,EACTuB,KAcH,MAAKvB,GAAS8B,UACpBP,KAAKtB,QAAUsB,KAAK,GAAKvB,EACzBuB,KAAKE,OAAS,EACPF,MAII3C,EAAOsD,WAAYlC,GACvB5B,EAAW6C,MAAOjB,IAGrBA,EAASA,WAAa7B,YAC1BoD,KAAKvB,SAAWA,EAASA,SACzBuB,KAAKtB,QAAUD,EAASC,SAGlBrB,EAAO0D,UAAWtC,EAAUuB,QAIpCvB,SAAU,GAGVyB,OAAQ,EAERc,QAAS,WACR,MAAOjD,GAAWkD,KAAMjB,OAKzBkB,IAAK,SAAUC,GACd,MAAc,OAAPA,EAGNnB,KAAKgB,UAGG,EAANG,EAAUnB,KAAMA,KAAKE,OAASiB,GAAQnB,KAAMmB,IAKhDC,UAAW,SAAUC,GAGpB,GAAIC,GAAMjE,EAAOgD,MAAOL,KAAKH,cAAewB,EAO5C,OAJAC,GAAIC,WAAavB,KACjBsB,EAAI5C,QAAUsB,KAAKtB,QAGZ4C,GAMRE,KAAM,SAAUC,EAAUC,GACzB,MAAOrE,GAAOmE,KAAMxB,KAAMyB,EAAUC,IAGrChC,MAAO,SAAUf,GAIhB,MAFAtB,GAAOqC,MAAMiC,UAAUC,KAAMjD,GAEtBqB,MAGRhC,MAAO,WACN,MAAOgC,MAAKoB,UAAWrD,EAAW8D,MAAO7B,KAAM8B,aAGhDC,MAAO,WACN,MAAO/B,MAAKgC,GAAI,IAGjBC,KAAM,WACL,MAAOjC,MAAKgC,GAAI,KAGjBA,GAAI,SAAUE,GACb,GAAIC,GAAMnC,KAAKE,OACdkC,GAAKF,GAAU,EAAJA,EAAQC,EAAM,EAC1B,OAAOnC,MAAKoB,UAAWgB,GAAK,GAASD,EAAJC,GAAYpC,KAAKoC,SAGnDC,IAAK,SAAUZ,GACd,MAAOzB,MAAKoB,UAAW/D,EAAOgF,IAAIrC,KAAM,SAAUD,EAAMmC,GACvD,MAAOT,GAASR,KAAMlB,EAAMmC,EAAGnC,OAIjCuC,IAAK,WACJ,MAAOtC,MAAKuB,YAAcvB,KAAKH,YAAY,OAK5C/B,KAAMD,EACN0E,QAASA,KACTC,UAAWA,QAIZnF,EAAOsB,GAAGC,KAAKe,UAAYtC,EAAOsB,GAElCtB,EAAOoF,OAASpF,EAAOsB,GAAG8D,OAAS,WAClC,GAAIC,GAASC,EAAMC,EAAKC,EAAMC,EAAaC,EAC1CC,EAASlB,UAAU,OACnBI,EAAI,EACJhC,EAAS4B,UAAU5B,OACnB+C,GAAO,CAqBR,KAlBuB,iBAAXD,KACXC,EAAOD,EACPA,EAASlB,UAAU,OAEnBI,EAAI,GAIkB,gBAAXc,IAAwB3F,EAAOsD,WAAWqC,KACrDA,MAII9C,IAAWgC,IACfc,EAAShD,OACPkC,GAGShC,EAAJgC,EAAYA,IAEnB,GAAmC,OAA7BQ,EAAUZ,UAAWI,IAE1B,IAAMS,IAAQD,GACbE,EAAMI,EAAQL,GACdE,EAAOH,EAASC,GAGXK,IAAWH,IAKXI,GAAQJ,IAAUxF,EAAOqD,cAAcmC,KAAUC,EAAczF,EAAO6F,QAAQL,MAC7EC,GACJA,GAAc,EACdC,EAAQH,GAAOvF,EAAO6F,QAAQN,GAAOA,MAGrCG,EAAQH,GAAOvF,EAAOqD,cAAckC,GAAOA,KAI5CI,EAAQL,GAAStF,EAAOoF,OAAQQ,EAAMF,EAAOF,IAGlCA,IAASjG,YACpBoG,EAAQL,GAASE,GAOrB,OAAOG,IAGR3F,EAAOoF,QAENU,QAAS,UAAazF,EAAe0F,KAAKC,UAAWC,QAAS,MAAO,IAErEC,WAAY,SAAUN,GASrB,MARKtG,GAAOY,IAAMF,IACjBV,EAAOY,EAAID,GAGP2F,GAAQtG,EAAOU,SAAWA,IAC9BV,EAAOU,OAASD,GAGVC,GAIRmG,SAAS,EAITC,UAAW,EAGXC,UAAW,SAAUC,GACfA,EACJtG,EAAOoG,YAEPpG,EAAOqC,OAAO,IAKhBA,MAAO,SAAUkE,IAGXA,KAAS,IAASvG,EAAOoG,UAAYpG,EAAOmG,WAKjDnG,EAAOmG,SAAU,EAGZI,KAAS,KAAUvG,EAAOoG,UAAY,IAK3C3G,EAAU+G,YAAa5G,GAAYI,IAG9BA,EAAOsB,GAAGmF,SACdzG,EAAQJ,GAAW6G,QAAQ,SAASC,IAAI,YAO1CpD,WAAY,SAAUqD,GACrB,MAA4B,aAArB3G,EAAO4G,KAAKD,IAGpBd,QAASgB,MAAMhB,QAEfiB,SAAU,SAAUH,GACnB,MAAc,OAAPA,GAAeA,IAAQA,EAAIrH,QAGnCyH,UAAW,SAAUJ,GACpB,OAAQK,MAAOC,WAAWN,KAAUO,SAAUP,IAG/CC,KAAM,SAAUD,GACf,MAAY,OAAPA,EACWA,EAARQ,GAGc,gBAARR,IAAmC,kBAARA,GACxCxG,EAAYW,EAAc8C,KAAK+C,KAAU,eAClCA,IAGTtD,cAAe,SAAUsD,GAKxB,GAA4B,WAAvB3G,EAAO4G,KAAMD,IAAsBA,EAAIzD,UAAYlD,EAAO8G,SAAUH,GACxE,OAAO,CAOR,KACC,GAAKA,EAAInE,cACNxB,EAAY4C,KAAM+C,EAAInE,YAAYF,UAAW,iBAC/C,OAAO,EAEP,MAAQ8E,GACT,OAAO,EAKR,OAAO,GAGRC,cAAe,SAAUV,GACxB,GAAIrB,EACJ,KAAMA,IAAQqB,GACb,OAAO,CAER,QAAO,GAGRW,MAAO,SAAUC,GAChB,KAAUC,OAAOD,IAMlBtE,UAAW,SAAUwE,EAAMpG,EAASqG,GACnC,IAAMD,GAAwB,gBAATA,GACpB,MAAO,KAEgB,kBAAZpG,KACXqG,EAAcrG,EACdA,GAAU,GAEXA,EAAUA,GAAWzB,CAErB,IAAI+H,GAAS/F,EAAWkB,KAAM2E,GAC7BG,GAAWF,KAGZ,OAAKC,IACKtG,EAAQwG,cAAeF,EAAO,MAGxCA,EAAS3H,EAAO8H,eAAiBL,GAAQpG,EAASuG,GAE7CA,GACJ5H,EAAQ4H,GAAUG,SAGZ/H,EAAOgD,SAAW2E,EAAOK,cAGjCC,UAAWC,KAAKC,MAGhBC,SAAU,SAAUX,GACnB,GAAIY,GAAKC,CACT,KAAMb,GAAwB,gBAATA,GACpB,MAAO,KAIR,KACCa,EAAM,GAAIC,WACVF,EAAMC,EAAIE,gBAAiBf,EAAO,YACjC,MAAQL,GACTiB,EAAM9I,UAMP,QAHM8I,GAAOA,EAAII,qBAAsB,eAAgB5F,SACtD7C,EAAOsH,MAAO,gBAAkBG,GAE1BY,GAGRK,KAAM,aAGNC,WAAY,SAAUC,GACrB,GAAIC,GACFC,EAAWC,IAEbH,GAAO5I,EAAOmB,KAAMyH,GAEfA,IAIgC,IAA/BA,EAAK/H,QAAQ,eACjBgI,EAASjJ,EAASiI,cAAc,UAChCgB,EAAOG,KAAOJ,EACdhJ,EAASqJ,KAAKC,YAAaL,GAASpF,WAAW0F,YAAaN,IAI5DC,EAAUF,KAObQ,UAAW,SAAUC,GACpB,MAAOA,GAAOpD,QAASpE,EAAW,OAAQoE,QAASnE,EAAYC,IAGhEuH,SAAU,SAAU5G,EAAM4C,GACzB,MAAO5C,GAAK4G,UAAY5G,EAAK4G,SAASC,gBAAkBjE,EAAKiE,eAI9DpF,KAAM,SAAUwC,EAAKvC,EAAUC,GAC9B,GAAImF,GACH3E,EAAI,EACJhC,EAAS8D,EAAI9D,OACbgD,EAAU4D,EAAa9C,EAExB,IAAKtC,GACJ,GAAKwB,GACJ,KAAYhD,EAAJgC,EAAYA,IAGnB,GAFA2E,EAAQpF,EAASI,MAAOmC,EAAK9B,GAAKR,GAE7BmF,KAAU,EACd,UAIF,KAAM3E,IAAK8B,GAGV,GAFA6C,EAAQpF,EAASI,MAAOmC,EAAK9B,GAAKR,GAE7BmF,KAAU,EACd,UAOH,IAAK3D,GACJ,KAAYhD,EAAJgC,EAAYA,IAGnB,GAFA2E,EAAQpF,EAASR,KAAM+C,EAAK9B,GAAKA,EAAG8B,EAAK9B,IAEpC2E,KAAU,EACd,UAIF,KAAM3E,IAAK8B,GAGV,GAFA6C,EAAQpF,EAASR,KAAM+C,EAAK9B,GAAKA,EAAG8B,EAAK9B,IAEpC2E,KAAU,EACd,KAMJ,OAAO7C,IAGRxF,KAAM,SAAU6H,GACf,MAAe,OAARA,EAAe,GAAK9H,EAAU0C,KAAMoF,IAI5CtF,UAAW,SAAUgG,EAAKC,GACzB,GAAI1F,GAAM0F,KAaV,OAXY,OAAPD,IACCD,EAAaG,OAAOF,IACxB1J,EAAOgD,MAAOiB,EACE,gBAARyF,IACLA,GAAQA,GAGXlJ,EAAUoD,KAAMK,EAAKyF,IAIhBzF,GAGR4F,QAAS,SAAUnH,EAAMgH,EAAK7E,GAC7B,MAAc,OAAP6E,EAAc,GAAK9I,EAAagD,KAAM8F,EAAKhH,EAAMmC,IAGzD7B,MAAO,SAAU0B,EAAOoF,GACvB,GAAIC,GAAID,EAAOjH,OACdgC,EAAIH,EAAM7B,OACVkC,EAAI,CAEL,IAAkB,gBAANgF,GACX,KAAYA,EAAJhF,EAAOA,IACdL,EAAOG,KAAQiF,EAAQ/E,OAGxB,OAAQ+E,EAAO/E,KAAOxF,UACrBmF,EAAOG,KAAQiF,EAAQ/E,IAMzB,OAFAL,GAAM7B,OAASgC,EAERH,GAGRsF,KAAM,SAAUhG,EAAOI,EAAU6F,GAChC,GAAIC,GACHjG,KACAY,EAAI,EACJhC,EAASmB,EAAMnB,MAKhB,KAJAoH,IAAQA,EAIIpH,EAAJgC,EAAYA,IACnBqF,IAAW9F,EAAUJ,EAAOa,GAAKA,GAC5BoF,IAAQC,GACZjG,EAAIxD,KAAMuD,EAAOa,GAInB,OAAOZ,IAIRe,IAAK,SAAUhB,EAAOI,EAAU+F,GAC/B,GAAIX,GACH3E,EAAI,EACJhC,EAASmB,EAAMnB,OACfgD,EAAU4D,EAAazF,GACvBC,IAGD,IAAK4B,EACJ,KAAYhD,EAAJgC,EAAYA,IACnB2E,EAAQpF,EAAUJ,EAAOa,GAAKA,EAAGsF,GAEnB,MAATX,IACJvF,EAAKA,EAAIpB,QAAW2G,OAMtB,KAAM3E,IAAKb,GACVwF,EAAQpF,EAAUJ,EAAOa,GAAKA,EAAGsF,GAEnB,MAATX,IACJvF,EAAKA,EAAIpB,QAAW2G,EAMvB,OAAOlJ,GAAYkE,SAAWP,IAI/BmG,KAAM,EAINC,MAAO,SAAU/I,EAAID,GACpB,GAAIiH,GAAKjE,EAAMgG,CAUf,OARwB,gBAAZhJ,KACXiH,EAAMhH,EAAID,GACVA,EAAUC,EACVA,EAAKgH,GAKAtI,EAAOsD,WAAYhC,IAKzB+C,EAAO3D,EAAWkD,KAAMa,UAAW,GACnC4F,EAAQ,WACP,MAAO/I,GAAGkD,MAAOnD,GAAWsB,KAAM0B,EAAK9D,OAAQG,EAAWkD,KAAMa,cAIjE4F,EAAMD,KAAO9I,EAAG8I,KAAO9I,EAAG8I,MAAQpK,EAAOoK,OAElCC,GAZC9K,WAiBT+K,OAAQ,SAAUtG,EAAO1C,EAAIiJ,EAAKf,EAAOgB,EAAWC,EAAUC,GAC7D,GAAI7F,GAAI,EACPhC,EAASmB,EAAMnB,OACf8H,EAAc,MAAPJ,CAGR,IAA4B,WAAvBvK,EAAO4G,KAAM2D,GAAqB,CACtCC,GAAY,CACZ,KAAM3F,IAAK0F,GACVvK,EAAOsK,OAAQtG,EAAO1C,EAAIuD,EAAG0F,EAAI1F,IAAI,EAAM4F,EAAUC,OAIhD,IAAKlB,IAAUjK,YACrBiL,GAAY,EAENxK,EAAOsD,WAAYkG,KACxBkB,GAAM,GAGFC,IAECD,GACJpJ,EAAGsC,KAAMI,EAAOwF,GAChBlI,EAAK,OAILqJ,EAAOrJ,EACPA,EAAK,SAAUoB,EAAM6H,EAAKf,GACzB,MAAOmB,GAAK/G,KAAM5D,EAAQ0C,GAAQ8G,MAKhClI,GACJ,KAAYuB,EAAJgC,EAAYA,IACnBvD,EAAI0C,EAAMa,GAAI0F,EAAKG,EAAMlB,EAAQA,EAAM5F,KAAMI,EAAMa,GAAIA,EAAGvD,EAAI0C,EAAMa,GAAI0F,IAK3E,OAAOC,GACNxG,EAGA2G,EACCrJ,EAAGsC,KAAMI,GACTnB,EAASvB,EAAI0C,EAAM,GAAIuG,GAAQE,GAGlCG,IAAKC,KAAKD,IAKVE,KAAM,SAAUpI,EAAM2C,EAASjB,EAAUC,GACxC,GAAIJ,GAAKqB,EACRyF,IAGD,KAAMzF,IAAQD,GACb0F,EAAKzF,GAAS5C,EAAKsI,MAAO1F,GAC1B5C,EAAKsI,MAAO1F,GAASD,EAASC,EAG/BrB,GAAMG,EAASI,MAAO9B,EAAM2B,MAG5B,KAAMiB,IAAQD,GACb3C,EAAKsI,MAAO1F,GAASyF,EAAKzF,EAG3B,OAAOrB,MAITjE,EAAOqC,MAAMiC,QAAU,SAAUqC,GAqBhC,MApBMlH,KAELA,EAAYO,EAAOiL,WAKU,aAAxBrL,EAASsL,WAEbC,WAAYnL,EAAOqC,QAKnBzC,EAASwL,iBAAkB,mBAAoBjJ,GAAW,GAG1D7C,EAAO8L,iBAAkB,OAAQjJ,GAAW,KAGvC1C,EAAU6E,QAASqC,IAI3B3G,EAAOmE,KAAK,gEAAgEkH,MAAM,KAAM,SAASxG,EAAGS,GACnGnF,EAAY,WAAamF,EAAO,KAAQA,EAAKiE,eAG9C,SAASE,GAAa9C,GACrB,GAAI9D,GAAS8D,EAAI9D,OAChB+D,EAAO5G,EAAO4G,KAAMD,EAErB,OAAK3G,GAAO8G,SAAUH,IACd,EAGc,IAAjBA,EAAIzD,UAAkBL,GACnB,EAGQ,UAAT+D,GAA6B,aAATA,IACb,IAAX/D,GACgB,gBAAXA,IAAuBA,EAAS,GAAOA,EAAS,IAAO8D,IAIhEnH,EAAaQ,EAAOJ,GAWpB,SAAWN,EAAQC,WAEnB,GAAIsF,GACHyG,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EAGAC,EACAlM,EACAC,EACAkM,EACAC,EACAC,EACAC,EACAC,EAGArG,EAAU,UAAY,GAAK+E,MAC3BuB,EAAe9M,EAAOM,SACtByM,EAAU,EACV9H,EAAO,EACP+H,EAAaC,KACbC,EAAaD,KACbE,EAAgBF,KAChBG,GAAe,EACfC,EAAY,SAAUC,EAAGC,GACxB,MAAKD,KAAMC,GACVH,GAAe,EACR,GAED,GAIRI,QAAsBvN,WACtBwN,EAAe,GAAK,GAGpBC,KAAc/L,eACdyI,KACAuD,EAAMvD,EAAIuD,IACVC,EAAcxD,EAAIjJ,KAClBA,EAAOiJ,EAAIjJ,KACXE,EAAQ+I,EAAI/I,MAEZE,EAAU6I,EAAI7I,SAAW,SAAU6B,GAClC,GAAImC,GAAI,EACPC,EAAMnC,KAAKE,MACZ,MAAYiC,EAAJD,EAASA,IAChB,GAAKlC,KAAKkC,KAAOnC,EAChB,MAAOmC,EAGT,OAAO,IAGRsI,EAAW,6HAKXC,EAAa,sBAEbC,EAAoB,mCAKpBC,EAAaD,EAAkBpH,QAAS,IAAK,MAG7CsH,EAAa,MAAQH,EAAa,KAAOC,EAAoB,IAAMD,EAClE,mBAAqBA,EAAa,wCAA0CE,EAAa,QAAUF,EAAa,OAQjHI,EAAU,KAAOH,EAAoB,mEAAqEE,EAAWtH,QAAS,EAAG,GAAM,eAGvIwH,EAAYC,OAAQ,IAAMN,EAAa,8BAAgCA,EAAa,KAAM,KAE1FO,EAAaD,OAAQ,IAAMN,EAAa,KAAOA,EAAa,KAC5DQ,EAAmBF,OAAQ,IAAMN,EAAa,WAAaA,EAAa,IAAMA,EAAa,KAE3FS,EAAeH,OAAQN,EAAa,SACpCU,EAAuBJ,OAAQ,IAAMN,EAAa,gBAAkBA,EAAa,OAAQ,KAEzFW,EAAcL,OAAQF,GACtBQ,EAAkBN,OAAQ,IAAMJ,EAAa,KAE7CW,GACCC,GAAUR,OAAQ,MAAQL,EAAoB,KAC9Cc,MAAaT,OAAQ,QAAUL,EAAoB,KACnDe,IAAWV,OAAQ,KAAOL,EAAkBpH,QAAS,IAAK,MAAS,KACnEoI,KAAYX,OAAQ,IAAMH,GAC1Be,OAAcZ,OAAQ,IAAMF,GAC5Be,MAAab,OAAQ,yDAA2DN,EAC/E,+BAAiCA,EAAa,cAAgBA,EAC9D,aAAeA,EAAa,SAAU,KACvCoB,KAAYd,OAAQ,OAASP,EAAW,KAAM,KAG9CsB,aAAoBf,OAAQ,IAAMN,EAAa,mDAC9CA,EAAa,mBAAqBA,EAAa,mBAAoB,MAGrEsB,EAAU,yBAGV/M,EAAa,mCAEbgN,EAAU,sCACVC,GAAU,SAEVC,GAAU,QAGVC,GAAgBpB,OAAQ,qBAAuBN,EAAa,MAAQA,EAAa,OAAQ,MACzF2B,GAAY,SAAUC,EAAGC,EAASC,GACjC,GAAIC,GAAO,KAAOF,EAAU,KAI5B,OAAOE,KAASA,GAAQD,EACvBD,EAEO,EAAPE,EACChI,OAAOiI,aAAcD,EAAO,OAE5BhI,OAAOiI,aAA2B,MAAbD,GAAQ,GAA4B,MAAR,KAAPA,GAI9C,KACC1O,EAAK+D,MACHkF,EAAM/I,EAAMiD,KAAMwI,EAAapE,YAChCoE,EAAapE,YAId0B,EAAK0C,EAAapE,WAAWnF,QAASK,SACrC,MAAQkE,IACT3G,GAAS+D,MAAOkF,EAAI7G,OAGnB,SAAU8C,EAAQ0J,GACjBnC,EAAY1I,MAAOmB,EAAQhF,EAAMiD,KAAKyL,KAKvC,SAAU1J,EAAQ0J,GACjB,GAAItK,GAAIY,EAAO9C,OACdgC,EAAI,CAEL,OAASc,EAAOZ,KAAOsK,EAAIxK,MAC3Bc,EAAO9C,OAASkC,EAAI,IAKvB,QAASuK,IAAQlO,EAAUC,EAASsI,EAAS4F,GAC5C,GAAI9M,GAAOC,EAAM8M,EAAGtM,EAEnB2B,EAAG4K,EAAQ1E,EAAK2E,EAAKC,EAAYC,CASlC,KAPOvO,EAAUA,EAAQ8B,eAAiB9B,EAAU+K,KAAmBxM,GACtEkM,EAAazK,GAGdA,EAAUA,GAAWzB,EACrB+J,EAAUA,OAEJvI,GAAgC,gBAAbA,GACxB,MAAOuI,EAGR,IAAuC,KAAjCzG,EAAW7B,EAAQ6B,WAAgC,IAAbA,EAC3C,QAGD,IAAK6I,IAAmBwD,EAAO,CAG9B,GAAM9M,EAAQd,EAAWmB,KAAM1B,GAE9B,GAAMoO,EAAI/M,EAAM,IACf,GAAkB,IAAbS,EAAiB,CAIrB,GAHAR,EAAOrB,EAAQmC,eAAgBgM,IAG1B9M,IAAQA,EAAKe,WAQjB,MAAOkG,EALP,IAAKjH,EAAKmN,KAAOL,EAEhB,MADA7F,GAAQlJ,KAAMiC,GACPiH,MAOT,IAAKtI,EAAQ8B,gBAAkBT,EAAOrB,EAAQ8B,cAAcK,eAAgBgM,KAC3ErD,EAAU9K,EAASqB,IAAUA,EAAKmN,KAAOL,EAEzC,MADA7F,GAAQlJ,KAAMiC,GACPiH,MAKH,CAAA,GAAKlH,EAAM,GAEjB,MADAhC,GAAK+D,MAAOmF,EAAStI,EAAQoH,qBAAsBrH,IAC5CuI,CAGD,KAAM6F,EAAI/M,EAAM,KAAO6I,EAAQwE,wBAA0BzO,EAAQyO,uBAEvE,MADArP,GAAK+D,MAAOmF,EAAStI,EAAQyO,uBAAwBN,IAC9C7F,EAKT,GAAK2B,EAAQyE,OAAS/D,IAAcA,EAAU5I,KAAMhC,IAAc,CASjE,GARAsO,EAAM3E,EAAMjF,EACZ6J,EAAatO,EACbuO,EAA2B,IAAb1M,GAAkB9B,EAMd,IAAb8B,GAAqD,WAAnC7B,EAAQiI,SAASC,cAA6B,CACpEkG,EAASO,GAAU5O,IAEb2J,EAAM1J,EAAQ4O,aAAa,OAChCP,EAAM3E,EAAI9E,QAAS4I,GAAS,QAE5BxN,EAAQ6O,aAAc,KAAMR,GAE7BA,EAAM,QAAUA,EAAM,MAEtB7K,EAAI4K,EAAO5M,MACX,OAAQgC,IACP4K,EAAO5K,GAAK6K,EAAMS,GAAYV,EAAO5K,GAEtC8K,GAAa9B,EAASzK,KAAMhC,IAAcC,EAAQoC,YAAcpC,EAChEuO,EAAcH,EAAOW,KAAK,KAG3B,GAAKR,EACJ,IAIC,MAHAnP,GAAK+D,MAAOmF,EACXgG,EAAWU,iBAAkBT,IAEvBjG,EACN,MAAM2G,IACN,QACKvF,GACL1J,EAAQkP,gBAAgB,QAQ7B,MAAOC,IAAQpP,EAAS6E,QAASwH,EAAO,MAAQpM,EAASsI,EAAS4F,GASnE,QAAShD,MACR,GAAIkE,KAEJ,SAASC,GAAOnG,EAAKf,GAMpB,MAJKiH,GAAKhQ,KAAM8J,GAAO,KAAQiB,EAAKmF,mBAE5BD,GAAOD,EAAKG,SAEZF,EAAOnG,GAAQf,EAExB,MAAOkH,GAOR,QAASG,IAAcvP,GAEtB,MADAA,GAAIwE,IAAY,EACTxE,EAOR,QAASwP,IAAQxP,GAChB,GAAIyP,GAAMnR,EAASiI,cAAc,MAEjC,KACC,QAASvG,EAAIyP,GACZ,MAAO3J,GACR,OAAO,EACN,QAEI2J,EAAItN,YACRsN,EAAItN,WAAW0F,YAAa4H,GAG7BA,EAAM,MASR,QAASC,IAAWC,EAAOC,GAC1B,GAAIxH,GAAMuH,EAAM5F,MAAM,KACrBxG,EAAIoM,EAAMpO,MAEX,OAAQgC,IACP2G,EAAK2F,WAAYzH,EAAI7E,IAAOqM,EAU9B,QAASE,IAAcxE,EAAGC,GACzB,GAAIwE,GAAMxE,GAAKD,EACd0E,EAAOD,GAAsB,IAAfzE,EAAE1J,UAAiC,IAAf2J,EAAE3J,YAChC2J,EAAE0E,aAAexE,KACjBH,EAAE2E,aAAexE,EAGtB,IAAKuE,EACJ,MAAOA,EAIR,IAAKD,EACJ,MAASA,EAAMA,EAAIG,YAClB,GAAKH,IAAQxE,EACZ,MAAO,EAKV,OAAOD,GAAI,EAAI,GAOhB,QAAS6E,IAAmB7K,GAC3B,MAAO,UAAUlE,GAChB,GAAI4C,GAAO5C,EAAK4G,SAASC,aACzB,OAAgB,UAATjE,GAAoB5C,EAAKkE,OAASA,GAQ3C,QAAS8K,IAAoB9K,GAC5B,MAAO,UAAUlE,GAChB,GAAI4C,GAAO5C,EAAK4G,SAASC,aACzB,QAAiB,UAATjE,GAA6B,WAATA,IAAsB5C,EAAKkE,OAASA,GAQlE,QAAS+K,IAAwBrQ,GAChC,MAAOuP,IAAa,SAAUe,GAE7B,MADAA,IAAYA,EACLf,GAAa,SAAUtB,EAAMrD,GACnC,GAAInH,GACH8M,EAAevQ,KAAQiO,EAAK1M,OAAQ+O,GACpC/M,EAAIgN,EAAahP,MAGlB,OAAQgC,IACF0K,EAAOxK,EAAI8M,EAAahN,MAC5B0K,EAAKxK,KAAOmH,EAAQnH,GAAKwK,EAAKxK,SAWnC2G,EAAQ4D,GAAO5D,MAAQ,SAAUhJ,GAGhC,GAAI5C,GAAkB4C,IAASA,EAAKS,eAAiBT,GAAM5C,eAC3D,OAAOA,GAA+C,SAA7BA,EAAgBwJ,UAAsB,GAIhEgC,EAAUgE,GAAOhE,WAOjBQ,EAAcwD,GAAOxD,YAAc,SAAUgG,GAC5C,GAAIC,GAAMD,EAAOA,EAAK3O,eAAiB2O,EAAO1F,EAC7C4F,EAASD,EAAIE,WAGd,OAAKF,KAAQnS,GAA6B,IAAjBmS,EAAI7O,UAAmB6O,EAAIjS,iBAKpDF,EAAWmS,EACXlS,EAAUkS,EAAIjS,gBAGdiM,GAAkBL,EAAOqG,GAMpBC,GAAUA,EAAOE,aAAeF,IAAWA,EAAOG,KACtDH,EAAOE,YAAa,iBAAkB,WACrCpG,MASFR,EAAQiC,WAAauD,GAAO,SAAUC,GAErC,MADAA,GAAIqB,UAAY,KACRrB,EAAId,aAAa,eAO1B3E,EAAQ7C,qBAAuBqI,GAAO,SAAUC,GAE/C,MADAA,GAAI7H,YAAa6I,EAAIM,cAAc,MAC3BtB,EAAItI,qBAAqB,KAAK5F,SAIvCyI,EAAQwE,uBAAyBgB,GAAO,SAAUC,GAQjD,MAPAA,GAAIuB,UAAY,+CAIhBvB,EAAIwB,WAAWH,UAAY,IAGuB,IAA3CrB,EAAIjB,uBAAuB,KAAKjN,SAOxCyI,EAAQkH,QAAU1B,GAAO,SAAUC,GAElC,MADAlR,GAAQqJ,YAAa6H,GAAMlB,GAAK/J,GACxBiM,EAAIU,oBAAsBV,EAAIU,kBAAmB3M,GAAUjD,SAI/DyI,EAAQkH,SACZhH,EAAKzI,KAAS,GAAI,SAAU8M,EAAIxO,GAC/B,SAAYA,GAAQmC,iBAAmBsJ,GAAgBf,EAAiB,CACvE,GAAIyD,GAAInO,EAAQmC,eAAgBqM,EAGhC,OAAOL,IAAKA,EAAE/L,YAAc+L,QAG9BhE,EAAKkH,OAAW,GAAI,SAAU7C,GAC7B,GAAI8C,GAAS9C,EAAG5J,QAAS6I,GAAWC,GACpC,OAAO,UAAUrM,GAChB,MAAOA,GAAKuN,aAAa,QAAU0C,YAM9BnH,GAAKzI,KAAS,GAErByI,EAAKkH,OAAW,GAAK,SAAU7C,GAC9B,GAAI8C,GAAS9C,EAAG5J,QAAS6I,GAAWC,GACpC,OAAO,UAAUrM,GAChB,GAAIoP,SAAcpP,GAAKkQ,mBAAqB9F,GAAgBpK,EAAKkQ,iBAAiB,KAClF,OAAOd,IAAQA,EAAKtI,QAAUmJ,KAMjCnH,EAAKzI,KAAU,IAAIuI,EAAQ7C,qBAC1B,SAAUoK,EAAKxR,GACd,aAAYA,GAAQoH,uBAAyBqE,EACrCzL,EAAQoH,qBAAsBoK,GADtC,WAID,SAAUA,EAAKxR,GACd,GAAIqB,GACH4F,KACAzD,EAAI,EACJ8E,EAAUtI,EAAQoH,qBAAsBoK,EAGzC,IAAa,MAARA,EAAc,CAClB,MAASnQ,EAAOiH,EAAQ9E,KACA,IAAlBnC,EAAKQ,UACToF,EAAI7H,KAAMiC,EAIZ,OAAO4F,GAER,MAAOqB,IAIT6B,EAAKzI,KAAY,MAAIuI,EAAQwE,wBAA0B,SAAUsC,EAAW/Q,GAC3E,aAAYA,GAAQyO,yBAA2BhD,GAAgBf,EACvD1K,EAAQyO,uBAAwBsC,GADxC,WAWDnG,KAOAD,MAEMV,EAAQyE,IAAMrB,EAAQtL,KAAM2O,EAAI1B,qBAGrCS,GAAO,SAAUC,GAMhBA,EAAIuB,UAAY,iDAIVvB,EAAIV,iBAAiB,cAAcxN,QACxCmJ,EAAUvL,KAAM,MAAQ2M,EAAa,aAAeD,EAAW,KAM1D4D,EAAIV,iBAAiB,YAAYxN,QACtCmJ,EAAUvL,KAAK,cAIjBqQ,GAAO,SAAUC,GAOhB,GAAI+B,GAAQf,EAAIlK,cAAc,QAC9BiL,GAAM5C,aAAc,OAAQ,UAC5Ba,EAAI7H,YAAa4J,GAAQ5C,aAAc,IAAK,IAEvCa,EAAIV,iBAAiB,WAAWxN,QACpCmJ,EAAUvL,KAAM,SAAW2M,EAAa,gBAKnC2D,EAAIV,iBAAiB,YAAYxN,QACtCmJ,EAAUvL,KAAM,WAAY,aAI7BsQ,EAAIV,iBAAiB,QACrBrE,EAAUvL,KAAK,YAIX6K,EAAQyH,gBAAkBrE,EAAQtL,KAAO8I,EAAUrM,EAAQmT,uBAChEnT,EAAQoT,oBACRpT,EAAQqT,kBACRrT,EAAQsT,qBAERrC,GAAO,SAAUC,GAGhBzF,EAAQ8H,kBAAoBlH,EAAQtI,KAAMmN,EAAK,OAI/C7E,EAAQtI,KAAMmN,EAAK,aACnB9E,EAAcxL,KAAM,KAAM+M,KAI5BxB,EAAYA,EAAUnJ,QAAc6K,OAAQ1B,EAAUoE,KAAK,MAC3DnE,EAAgBA,EAAcpJ,QAAc6K,OAAQzB,EAAcmE,KAAK,MAQvEjE,EAAWuC,EAAQtL,KAAMvD,EAAQsM,WAActM,EAAQwT,wBACtD,SAAUzG,EAAGC,GACZ,GAAIyG,GAAuB,IAAf1G,EAAE1J,SAAiB0J,EAAE9M,gBAAkB8M,EAClD2G,EAAM1G,GAAKA,EAAEpJ,UACd,OAAOmJ,KAAM2G,MAAWA,GAAwB,IAAjBA,EAAIrQ,YAClCoQ,EAAMnH,SACLmH,EAAMnH,SAAUoH,GAChB3G,EAAEyG,yBAA8D,GAAnCzG,EAAEyG,wBAAyBE,MAG3D,SAAU3G,EAAGC,GACZ,GAAKA,EACJ,MAASA,EAAIA,EAAEpJ,WACd,GAAKoJ,IAAMD,EACV,OAAO,CAIV,QAAO,GAOTD,EAAY9M,EAAQwT,wBACpB,SAAUzG,EAAGC,GAGZ,GAAKD,IAAMC,EAEV,MADAH,IAAe,EACR,CAGR,IAAI8G,GAAU3G,EAAEwG,yBAA2BzG,EAAEyG,yBAA2BzG,EAAEyG,wBAAyBxG,EAEnG,OAAK2G,GAEW,EAAVA,IACFlI,EAAQmI,cAAgB5G,EAAEwG,wBAAyBzG,KAAQ4G,EAGxD5G,IAAMmF,GAAO5F,EAASC,EAAcQ,GACjC,GAEHC,IAAMkF,GAAO5F,EAASC,EAAcS,GACjC,EAIDhB,EACJhL,EAAQ+C,KAAMiI,EAAWe,GAAM/L,EAAQ+C,KAAMiI,EAAWgB,GAC1D,EAGe,EAAV2G,EAAc,GAAK,EAIpB5G,EAAEyG,wBAA0B,GAAK,GAEzC,SAAUzG,EAAGC,GACZ,GAAIwE,GACHxM,EAAI,EACJ6O,EAAM9G,EAAEnJ,WACR8P,EAAM1G,EAAEpJ,WACRkQ,GAAO/G,GACPgH,GAAO/G,EAGR,IAAKD,IAAMC,EAEV,MADAH,IAAe,EACR,CAGD,KAAMgH,IAAQH,EACpB,MAAO3G,KAAMmF,EAAM,GAClBlF,IAAMkF,EAAM,EACZ2B,EAAM,GACNH,EAAM,EACN1H,EACEhL,EAAQ+C,KAAMiI,EAAWe,GAAM/L,EAAQ+C,KAAMiI,EAAWgB,GAC1D,CAGK,IAAK6G,IAAQH,EACnB,MAAOnC,IAAcxE,EAAGC,EAIzBwE,GAAMzE,CACN,OAASyE,EAAMA,EAAI5N,WAClBkQ,EAAGE,QAASxC,EAEbA,GAAMxE,CACN,OAASwE,EAAMA,EAAI5N,WAClBmQ,EAAGC,QAASxC,EAIb,OAAQsC,EAAG9O,KAAO+O,EAAG/O,GACpBA,GAGD,OAAOA,GAENuM,GAAcuC,EAAG9O,GAAI+O,EAAG/O,IAGxB8O,EAAG9O,KAAOuH,EAAe,GACzBwH,EAAG/O,KAAOuH,EAAe,EACzB,GAGK2F,GA1UCnS,GA6UT0P,GAAOpD,QAAU,SAAU4H,EAAMC,GAChC,MAAOzE,IAAQwE,EAAM,KAAM,KAAMC,IAGlCzE,GAAOyD,gBAAkB,SAAUrQ,EAAMoR,GASxC,IAPOpR,EAAKS,eAAiBT,KAAW9C,GACvCkM,EAAapJ,GAIdoR,EAAOA,EAAK7N,QAAS6H,EAAkB,aAElCxC,EAAQyH,kBAAmBhH,GAC5BE,GAAkBA,EAAc7I,KAAM0Q,IACtC9H,GAAkBA,EAAU5I,KAAM0Q,IAErC,IACC,GAAI7P,GAAMiI,EAAQtI,KAAMlB,EAAMoR,EAG9B,IAAK7P,GAAOqH,EAAQ8H,mBAGlB1Q,EAAK9C,UAAuC,KAA3B8C,EAAK9C,SAASsD,SAChC,MAAOe,GAEP,MAAMmD,IAGT,MAAOkI,IAAQwE,EAAMlU,EAAU,MAAO8C,IAAQG,OAAS,GAGxDyM,GAAOnD,SAAW,SAAU9K,EAASqB,GAKpC,OAHOrB,EAAQ8B,eAAiB9B,KAAczB,GAC7CkM,EAAazK,GAEP8K,EAAU9K,EAASqB,IAG3B4M,GAAO/L,KAAO,SAAUb,EAAM4C,IAEtB5C,EAAKS,eAAiBT,KAAW9C,GACvCkM,EAAapJ,EAGd,IAAIpB,GAAKkK,EAAK2F,WAAY7L,EAAKiE,eAE9ByK,EAAM1S,GAAM0L,EAAOpJ,KAAM4H,EAAK2F,WAAY7L,EAAKiE,eAC9CjI,EAAIoB,EAAM4C,GAAOyG,GACjBxM,SAEF,OAAOyU,KAAQzU,UACd+L,EAAQiC,aAAexB,EACtBrJ,EAAKuN,aAAc3K,IAClB0O,EAAMtR,EAAKkQ,iBAAiBtN,KAAU0O,EAAIC,UAC1CD,EAAIxK,MACJ,KACFwK,GAGF1E,GAAOhI,MAAQ,SAAUC,GACxB,KAAUC,OAAO,0CAA4CD,IAO9D+H,GAAO4E,WAAa,SAAUvK,GAC7B,GAAIjH,GACHyR,KACApP,EAAI,EACJF,EAAI,CAOL,IAJA6H,GAAgBpB,EAAQ8I,iBACxBvI,GAAaP,EAAQ+I,YAAc1K,EAAQhJ,MAAO,GAClDgJ,EAAQzE,KAAMyH,GAETD,EAAe,CACnB,MAAShK,EAAOiH,EAAQ9E,KAClBnC,IAASiH,EAAS9E,KACtBE,EAAIoP,EAAW1T,KAAMoE,GAGvB,OAAQE,IACP4E,EAAQxE,OAAQgP,EAAYpP,GAAK,GAInC,MAAO4E,IAOR8B,EAAU6D,GAAO7D,QAAU,SAAU/I,GACpC,GAAIoP,GACH7N,EAAM,GACNY,EAAI,EACJ3B,EAAWR,EAAKQ,QAEjB,IAAMA,GAMC,GAAkB,IAAbA,GAA+B,IAAbA,GAA+B,KAAbA,EAAkB,CAGjE,GAAiC,gBAArBR,GAAK4R,YAChB,MAAO5R,GAAK4R,WAGZ,KAAM5R,EAAOA,EAAK6P,WAAY7P,EAAMA,EAAOA,EAAK8O,YAC/CvN,GAAOwH,EAAS/I,OAGZ,IAAkB,IAAbQ,GAA+B,IAAbA,EAC7B,MAAOR,GAAK6R,cAhBZ,MAASzC,EAAOpP,EAAKmC,GAAKA,IAEzBZ,GAAOwH,EAASqG,EAkBlB,OAAO7N,IAGRuH,EAAO8D,GAAOkF,WAGb7D,YAAa,GAEb8D,aAAc5D,GAEdpO,MAAOwL,EAEPkD,cAEApO,QAEA2R,UACCC,KAAOC,IAAK,aAAclQ,OAAO,GACjCmQ,KAAOD,IAAK,cACZE,KAAOF,IAAK,kBAAmBlQ,OAAO,GACtCqQ,KAAOH,IAAK,oBAGbI,WACC3G,KAAQ,SAAU5L,GAUjB,MATAA,GAAM,GAAKA,EAAM,GAAGwD,QAAS6I,GAAWC,IAGxCtM,EAAM,IAAOA,EAAM,IAAMA,EAAM,IAAM,IAAKwD,QAAS6I,GAAWC,IAE5C,OAAbtM,EAAM,KACVA,EAAM,GAAK,IAAMA,EAAM,GAAK,KAGtBA,EAAM9B,MAAO,EAAG,IAGxB4N,MAAS,SAAU9L,GA6BlB,MAlBAA,GAAM,GAAKA,EAAM,GAAG8G,cAEY,QAA3B9G,EAAM,GAAG9B,MAAO,EAAG,IAEjB8B,EAAM,IACX6M,GAAOhI,MAAO7E,EAAM,IAKrBA,EAAM,KAAQA,EAAM,GAAKA,EAAM,IAAMA,EAAM,IAAM,GAAK,GAAmB,SAAbA,EAAM,IAA8B,QAAbA,EAAM,KACzFA,EAAM,KAAUA,EAAM,GAAKA,EAAM,IAAqB,QAAbA,EAAM,KAGpCA,EAAM,IACjB6M,GAAOhI,MAAO7E,EAAM,IAGdA,GAGR6L,OAAU,SAAU7L,GACnB,GAAIwS,GACHC,GAAYzS,EAAM,IAAMA,EAAM,EAE/B,OAAKwL,GAAiB,MAAE7K,KAAMX,EAAM,IAC5B,MAIHA,EAAM,IAAMA,EAAM,KAAOlD,UAC7BkD,EAAM,GAAKA,EAAM,GAGNyS,GAAYnH,EAAQ3K,KAAM8R,KAEpCD,EAASjF,GAAUkF,GAAU,MAE7BD,EAASC,EAASrU,QAAS,IAAKqU,EAASrS,OAASoS,GAAWC,EAASrS,UAGvEJ,EAAM,GAAKA,EAAM,GAAG9B,MAAO,EAAGsU,GAC9BxS,EAAM,GAAKyS,EAASvU,MAAO,EAAGsU,IAIxBxS,EAAM9B,MAAO,EAAG,MAIzB+R,QAECtE,IAAO,SAAU+G,GAChB,GAAI7L,GAAW6L,EAAiBlP,QAAS6I,GAAWC,IAAYxF,aAChE,OAA4B,MAArB4L,EACN,WAAa,OAAO,GACpB,SAAUzS,GACT,MAAOA,GAAK4G,UAAY5G,EAAK4G,SAASC,gBAAkBD,IAI3D6E,MAAS,SAAUiE,GAClB,GAAIgD,GAAU9I,EAAY8F,EAAY,IAEtC,OAAOgD,KACLA,EAAc1H,OAAQ,MAAQN,EAAa,IAAMgF,EAAY,IAAMhF,EAAa,SACjFd,EAAY8F,EAAW,SAAU1P,GAChC,MAAO0S,GAAQhS,KAAgC,gBAAnBV,GAAK0P,WAA0B1P,EAAK0P,iBAAoB1P,GAAKuN,eAAiBnD,GAAgBpK,EAAKuN,aAAa,UAAY,OAI3J5B,KAAQ,SAAU/I,EAAM+P,EAAUC,GACjC,MAAO,UAAU5S,GAChB,GAAI6S,GAASjG,GAAO/L,KAAMb,EAAM4C,EAEhC,OAAe,OAAViQ,EACgB,OAAbF,EAEFA,GAINE,GAAU,GAEU,MAAbF,EAAmBE,IAAWD,EACvB,OAAbD,EAAoBE,IAAWD,EAClB,OAAbD,EAAoBC,GAAqC,IAA5BC,EAAO1U,QAASyU,GAChC,OAAbD,EAAoBC,GAASC,EAAO1U,QAASyU,GAAU,GAC1C,OAAbD,EAAoBC,GAASC,EAAO5U,OAAQ2U,EAAMzS,UAAayS,EAClD,OAAbD,GAAsB,IAAME,EAAS,KAAM1U,QAASyU,GAAU,GACjD,OAAbD,EAAoBE,IAAWD,GAASC,EAAO5U,MAAO,EAAG2U,EAAMzS,OAAS,KAAQyS,EAAQ,KACxF,IAZO,IAgBV/G,MAAS,SAAU3H,EAAM4O,EAAM5D,EAAUlN,EAAOE,GAC/C,GAAI6Q,GAAgC,QAAvB7O,EAAKjG,MAAO,EAAG,GAC3B+U,EAA+B,SAArB9O,EAAKjG,MAAO,IACtBgV,EAAkB,YAATH,CAEV,OAAiB,KAAV9Q,GAAwB,IAATE,EAGrB,SAAUlC,GACT,QAASA,EAAKe,YAGf,SAAUf,EAAMrB,EAASgH,GACxB,GAAIqI,GAAOkF,EAAY9D,EAAMR,EAAMuE,EAAWC,EAC7ClB,EAAMa,IAAWC,EAAU,cAAgB,kBAC3C1D,EAAStP,EAAKe,WACd6B,EAAOqQ,GAAUjT,EAAK4G,SAASC,cAC/BwM,GAAY1N,IAAQsN,CAErB,IAAK3D,EAAS,CAGb,GAAKyD,EAAS,CACb,MAAQb,EAAM,CACb9C,EAAOpP,CACP,OAASoP,EAAOA,EAAM8C,GACrB,GAAKe,EAAS7D,EAAKxI,SAASC,gBAAkBjE,EAAyB,IAAlBwM,EAAK5O,SACzD,OAAO,CAIT4S,GAAQlB,EAAe,SAAThO,IAAoBkP,GAAS,cAE5C,OAAO,EAMR,GAHAA,GAAUJ,EAAU1D,EAAOO,WAAaP,EAAOgE,WAG1CN,GAAWK,EAAW,CAE1BH,EAAa5D,EAAQlM,KAAckM,EAAQlM,OAC3C4K,EAAQkF,EAAYhP,OACpBiP,EAAYnF,EAAM,KAAOrE,GAAWqE,EAAM,GAC1CY,EAAOZ,EAAM,KAAOrE,GAAWqE,EAAM,GACrCoB,EAAO+D,GAAa7D,EAAOhK,WAAY6N,EAEvC,OAAS/D,IAAS+D,GAAa/D,GAAQA,EAAM8C,KAG3CtD,EAAOuE,EAAY,IAAMC,EAAM7I,MAGhC,GAAuB,IAAlB6E,EAAK5O,YAAoBoO,GAAQQ,IAASpP,EAAO,CACrDkT,EAAYhP,IAAWyF,EAASwJ,EAAWvE,EAC3C,YAKI,IAAKyE,IAAarF,GAAShO,EAAMoD,KAAcpD,EAAMoD,QAAkBc,KAAW8J,EAAM,KAAOrE,EACrGiF,EAAOZ,EAAM,OAKb,OAASoB,IAAS+D,GAAa/D,GAAQA,EAAM8C,KAC3CtD,EAAOuE,EAAY,IAAMC,EAAM7I,MAEhC,IAAO0I,EAAS7D,EAAKxI,SAASC,gBAAkBjE,EAAyB,IAAlBwM,EAAK5O,aAAsBoO,IAE5EyE,KACHjE,EAAMhM,KAAcgM,EAAMhM,QAAkBc,IAAWyF,EAASiF,IAG7DQ,IAASpP,GACb,KAQJ,OADA4O,IAAQ1M,EACD0M,IAAS5M,GAA4B,IAAjB4M,EAAO5M,GAAe4M,EAAO5M,GAAS,KAKrE4J,OAAU,SAAU2H,EAAQrE,GAK3B,GAAIvN,GACH/C,EAAKkK,EAAKgC,QAASyI,IAAYzK,EAAK0K,WAAYD,EAAO1M,gBACtD+F,GAAOhI,MAAO,uBAAyB2O,EAKzC,OAAK3U,GAAIwE,GACDxE,EAAIsQ,GAIPtQ,EAAGuB,OAAS,GAChBwB,GAAS4R,EAAQA,EAAQ,GAAIrE,GACtBpG,EAAK0K,WAAWjV,eAAgBgV,EAAO1M,eAC7CsH,GAAa,SAAUtB,EAAMrD,GAC5B,GAAIiK,GACHC,EAAU9U,EAAIiO,EAAMqC,GACpB/M,EAAIuR,EAAQvT,MACb,OAAQgC,IACPsR,EAAMtV,EAAQ+C,KAAM2L,EAAM6G,EAAQvR,IAClC0K,EAAM4G,KAAWjK,EAASiK,GAAQC,EAAQvR,MAG5C,SAAUnC,GACT,MAAOpB,GAAIoB,EAAM,EAAG2B,KAIhB/C,IAITkM,SAEC6I,IAAOxF,GAAa,SAAUzP,GAI7B,GAAI0R,MACHnJ,KACA2M,EAAU3K,EAASvK,EAAS6E,QAASwH,EAAO,MAE7C,OAAO6I,GAASxQ,GACf+K,GAAa,SAAUtB,EAAMrD,EAAS7K,EAASgH,GAC9C,GAAI3F,GACH6T,EAAYD,EAAS/G,EAAM,KAAMlH,MACjCxD,EAAI0K,EAAK1M,MAGV,OAAQgC,KACDnC,EAAO6T,EAAU1R,MACtB0K,EAAK1K,KAAOqH,EAAQrH,GAAKnC,MAI5B,SAAUA,EAAMrB,EAASgH,GAGxB,MAFAyK,GAAM,GAAKpQ,EACX4T,EAASxD,EAAO,KAAMzK,EAAKsB,IACnBA,EAAQsD,SAInBuJ,IAAO3F,GAAa,SAAUzP,GAC7B,MAAO,UAAUsB,GAChB,MAAO4M,IAAQlO,EAAUsB,GAAOG,OAAS,KAI3CsJ,SAAY0E,GAAa,SAAU7H,GAClC,MAAO,UAAUtG,GAChB,OAASA,EAAK4R,aAAe5R,EAAK+T,WAAahL,EAAS/I,IAAS7B,QAASmI,GAAS,MAWrF0N,KAAQ7F,GAAc,SAAU6F,GAM/B,MAJM1I,GAAY5K,KAAKsT,GAAQ,KAC9BpH,GAAOhI,MAAO,qBAAuBoP,GAEtCA,EAAOA,EAAKzQ,QAAS6I,GAAWC,IAAYxF,cACrC,SAAU7G,GAChB,GAAIiU,EACJ,GACC,IAAMA,EAAW5K,EAChBrJ,EAAKgU,KACLhU,EAAKuN,aAAa,aAAevN,EAAKuN,aAAa,QAGnD,MADA0G,GAAWA,EAASpN,cACboN,IAAaD,GAA2C,IAAnCC,EAAS9V,QAAS6V,EAAO,YAE5ChU,EAAOA,EAAKe,aAAiC,IAAlBf,EAAKQ,SAC3C,QAAO,KAKTyC,OAAU,SAAUjD,GACnB,GAAIkU,GAAOtX,EAAOK,UAAYL,EAAOK,SAASiX,IAC9C,OAAOA,IAAQA,EAAKjW,MAAO,KAAQ+B,EAAKmN,IAGzCgH,KAAQ,SAAUnU,GACjB,MAAOA,KAAS7C,GAGjBiX,MAAS,SAAUpU,GAClB,MAAOA,KAAS9C,EAASmX,iBAAmBnX,EAASoX,UAAYpX,EAASoX,gBAAkBtU,EAAKkE,MAAQlE,EAAKuU,OAASvU,EAAKwU,WAI7HC,QAAW,SAAUzU,GACpB,MAAOA,GAAK0U,YAAa,GAG1BA,SAAY,SAAU1U,GACrB,MAAOA,GAAK0U,YAAa,GAG1BC,QAAW,SAAU3U,GAGpB,GAAI4G,GAAW5G,EAAK4G,SAASC,aAC7B,OAAqB,UAAbD,KAA0B5G,EAAK2U,SAA0B,WAAb/N,KAA2B5G,EAAK4U,UAGrFA,SAAY,SAAU5U,GAOrB,MAJKA,GAAKe,YACTf,EAAKe,WAAW8T,cAGV7U,EAAK4U,YAAa,GAI1BE,MAAS,SAAU9U,GAMlB,IAAMA,EAAOA,EAAK6P,WAAY7P,EAAMA,EAAOA,EAAK8O,YAC/C,GAAK9O,EAAK4G,SAAW,KAAyB,IAAlB5G,EAAKQ,UAAoC,IAAlBR,EAAKQ,SACvD,OAAO,CAGT,QAAO,GAGR8O,OAAU,SAAUtP,GACnB,OAAQ8I,EAAKgC,QAAe,MAAG9K,IAIhC+U,OAAU,SAAU/U,GACnB,MAAOkM,IAAQxL,KAAMV,EAAK4G,WAG3BwJ,MAAS,SAAUpQ,GAClB,MAAOiM,GAAQvL,KAAMV,EAAK4G,WAG3BoO,OAAU,SAAUhV,GACnB,GAAI4C,GAAO5C,EAAK4G,SAASC,aACzB,OAAgB,UAATjE,GAAkC,WAAd5C,EAAKkE,MAA8B,WAATtB,GAGtD0D,KAAQ,SAAUtG,GACjB,GAAIa,EAGJ,OAAuC,UAAhCb,EAAK4G,SAASC,eACN,SAAd7G,EAAKkE,OACmC,OAArCrD,EAAOb,EAAKuN,aAAa,UAAoB1M,EAAKgG,gBAAkB7G,EAAKkE,OAI9ElC,MAASiN,GAAuB,WAC/B,OAAS,KAGV/M,KAAQ+M,GAAuB,SAAUE,EAAchP,GACtD,OAASA,EAAS,KAGnB8B,GAAMgN,GAAuB,SAAUE,EAAchP,EAAQ+O,GAC5D,OAAoB,EAAXA,EAAeA,EAAW/O,EAAS+O,KAG7C+F,KAAQhG,GAAuB,SAAUE,EAAchP,GACtD,GAAIgC,GAAI,CACR,MAAYhC,EAAJgC,EAAYA,GAAK,EACxBgN,EAAapR,KAAMoE,EAEpB,OAAOgN,KAGR+F,IAAOjG,GAAuB,SAAUE,EAAchP,GACrD,GAAIgC,GAAI,CACR,MAAYhC,EAAJgC,EAAYA,GAAK,EACxBgN,EAAapR,KAAMoE,EAEpB,OAAOgN,KAGRgG,GAAMlG,GAAuB,SAAUE,EAAchP,EAAQ+O,GAC5D,GAAI/M,GAAe,EAAX+M,EAAeA,EAAW/O,EAAS+O,CAC3C,QAAU/M,GAAK,GACdgN,EAAapR,KAAMoE,EAEpB,OAAOgN,KAGRiG,GAAMnG,GAAuB,SAAUE,EAAchP,EAAQ+O,GAC5D,GAAI/M,GAAe,EAAX+M,EAAeA,EAAW/O,EAAS+O,CAC3C,MAAc/O,IAAJgC,GACTgN,EAAapR,KAAMoE,EAEpB,OAAOgN,OAKVrG,EAAKgC,QAAa,IAAIhC,EAAKgC,QAAY,EAGvC,KAAM3I,KAAOkT,OAAO,EAAMC,UAAU,EAAMC,MAAM,EAAMC,UAAU,EAAMC,OAAO,GAC5E3M,EAAKgC,QAAS3I,GAAM4M,GAAmB5M,EAExC,KAAMA,KAAOuT,QAAQ,EAAMC,OAAO,GACjC7M,EAAKgC,QAAS3I,GAAM6M,GAAoB7M,EAIzC,SAASqR,OACTA,GAAW5T,UAAYkJ,EAAK8M,QAAU9M,EAAKgC,QAC3ChC,EAAK0K,WAAa,GAAIA,GAEtB,SAASlG,IAAU5O,EAAUmX,GAC5B,GAAInC,GAAS3T,EAAO+V,EAAQ5R,EAC3B6R,EAAOhJ,EAAQiJ,EACfC,EAASnM,EAAYpL,EAAW,IAEjC,IAAKuX,EACJ,MAAOJ,GAAY,EAAII,EAAOhY,MAAO,EAGtC8X,GAAQrX,EACRqO,KACAiJ,EAAalN,EAAKwJ,SAElB,OAAQyD,EAAQ,GAGTrC,IAAY3T,EAAQkL,EAAO7K,KAAM2V,OACjChW,IAEJgW,EAAQA,EAAM9X,MAAO8B,EAAM,GAAGI,SAAY4V,GAE3ChJ,EAAOhP,KAAM+X,OAGdpC,GAAU,GAGJ3T,EAAQmL,EAAa9K,KAAM2V,MAChCrC,EAAU3T,EAAMmO,QAChB4H,EAAO/X,MACN+I,MAAO4M,EAEPxP,KAAMnE,EAAM,GAAGwD,QAASwH,EAAO,OAEhCgL,EAAQA,EAAM9X,MAAOyV,EAAQvT,QAI9B,KAAM+D,IAAQ4E,GAAKkH,SACZjQ,EAAQwL,EAAWrH,GAAO9D,KAAM2V,KAAcC,EAAY9R,MAC9DnE,EAAQiW,EAAY9R,GAAQnE,MAC7B2T,EAAU3T,EAAMmO,QAChB4H,EAAO/X,MACN+I,MAAO4M,EACPxP,KAAMA,EACNsF,QAASzJ,IAEVgW,EAAQA,EAAM9X,MAAOyV,EAAQvT,QAI/B,KAAMuT,EACL,MAOF,MAAOmC,GACNE,EAAM5V,OACN4V,EACCnJ,GAAOhI,MAAOlG,GAEdoL,EAAYpL,EAAUqO,GAAS9O,MAAO,GAGzC,QAASwP,IAAYqI,GACpB,GAAI3T,GAAI,EACPC,EAAM0T,EAAO3V,OACbzB,EAAW,EACZ,MAAY0D,EAAJD,EAASA,IAChBzD,GAAYoX,EAAO3T,GAAG2E,KAEvB,OAAOpI,GAGR,QAASwX,IAAetC,EAASuC,EAAYC,GAC5C,GAAIlE,GAAMiE,EAAWjE,IACpBmE,EAAmBD,GAAgB,eAARlE,EAC3BoE,EAAWzU,GAEZ,OAAOsU,GAAWnU,MAEjB,SAAUhC,EAAMrB,EAASgH,GACxB,MAAS3F,EAAOA,EAAMkS,GACrB,GAAuB,IAAlBlS,EAAKQ,UAAkB6V,EAC3B,MAAOzC,GAAS5T,EAAMrB,EAASgH,IAMlC,SAAU3F,EAAMrB,EAASgH,GACxB,GAAIZ,GAAMiJ,EAAOkF,EAChBqD,EAAS5M,EAAU,IAAM2M,CAG1B,IAAK3Q,GACJ,MAAS3F,EAAOA,EAAMkS,GACrB,IAAuB,IAAlBlS,EAAKQ,UAAkB6V,IACtBzC,EAAS5T,EAAMrB,EAASgH,GAC5B,OAAO,MAKV,OAAS3F,EAAOA,EAAMkS,GACrB,GAAuB,IAAlBlS,EAAKQ,UAAkB6V,EAE3B,GADAnD,EAAalT,EAAMoD,KAAcpD,EAAMoD,QACjC4K,EAAQkF,EAAYhB,KAAUlE,EAAM,KAAOuI,GAChD,IAAMxR,EAAOiJ,EAAM,OAAQ,GAAQjJ,IAAS8D,EAC3C,MAAO9D,MAAS,MAKjB,IAFAiJ,EAAQkF,EAAYhB,IAAUqE,GAC9BvI,EAAM,GAAK4F,EAAS5T,EAAMrB,EAASgH,IAASkD,EACvCmF,EAAM,MAAO,EACjB,OAAO,GASf,QAASwI,IAAgBC,GACxB,MAAOA,GAAStW,OAAS,EACxB,SAAUH,EAAMrB,EAASgH,GACxB,GAAIxD,GAAIsU,EAAStW,MACjB,OAAQgC,IACP,IAAMsU,EAAStU,GAAInC,EAAMrB,EAASgH,GACjC,OAAO,CAGT,QAAO,GAER8Q,EAAS,GAGX,QAASC,IAAU7C,EAAWvR,EAAK0N,EAAQrR,EAASgH,GACnD,GAAI3F,GACH2W,KACAxU,EAAI,EACJC,EAAMyR,EAAU1T,OAChByW,EAAgB,MAAPtU,CAEV,MAAYF,EAAJD,EAASA,KACVnC,EAAO6T,EAAU1R,OAChB6N,GAAUA,EAAQhQ,EAAMrB,EAASgH,MACtCgR,EAAa5Y,KAAMiC,GACd4W,GACJtU,EAAIvE,KAAMoE,GAMd,OAAOwU,GAGR,QAASE,IAAYvE,EAAW5T,EAAUkV,EAASkD,EAAYC,EAAYC,GAO1E,MANKF,KAAeA,EAAY1T,KAC/B0T,EAAaD,GAAYC,IAErBC,IAAeA,EAAY3T,KAC/B2T,EAAaF,GAAYE,EAAYC,IAE/B7I,GAAa,SAAUtB,EAAM5F,EAAStI,EAASgH,GACrD,GAAIsR,GAAM9U,EAAGnC,EACZkX,KACAC,KACAC,EAAcnQ,EAAQ9G,OAGtBmB,EAAQuL,GAAQwK,GAAkB3Y,GAAY,IAAKC,EAAQ6B,UAAa7B,GAAYA,MAGpF2Y,GAAYhF,IAAezF,GAASnO,EAEnC4C,EADAoV,GAAUpV,EAAO4V,EAAQ5E,EAAW3T,EAASgH,GAG9C4R,EAAa3D,EAEZmD,IAAgBlK,EAAOyF,EAAY8E,GAAeN,MAMjD7P,EACDqQ,CAQF,IALK1D,GACJA,EAAS0D,EAAWC,EAAY5Y,EAASgH,GAIrCmR,EAAa,CACjBG,EAAOP,GAAUa,EAAYJ,GAC7BL,EAAYG,KAAUtY,EAASgH,GAG/BxD,EAAI8U,EAAK9W,MACT,OAAQgC,KACDnC,EAAOiX,EAAK9U,MACjBoV,EAAYJ,EAAQhV,MAASmV,EAAWH,EAAQhV,IAAOnC,IAK1D,GAAK6M,GACJ,GAAKkK,GAAczE,EAAY,CAC9B,GAAKyE,EAAa,CAEjBE,KACA9U,EAAIoV,EAAWpX,MACf,OAAQgC,KACDnC,EAAOuX,EAAWpV,KAEvB8U,EAAKlZ,KAAOuZ,EAAUnV,GAAKnC,EAG7B+W,GAAY,KAAOQ,KAAkBN,EAAMtR,GAI5CxD,EAAIoV,EAAWpX,MACf,OAAQgC,KACDnC,EAAOuX,EAAWpV,MACtB8U,EAAOF,EAAa5Y,EAAQ+C,KAAM2L,EAAM7M,GAASkX,EAAO/U,IAAM,KAE/D0K,EAAKoK,KAAUhQ,EAAQgQ,GAAQjX,SAOlCuX,GAAab,GACZa,IAAetQ,EACdsQ,EAAW9U,OAAQ2U,EAAaG,EAAWpX,QAC3CoX,GAEGR,EACJA,EAAY,KAAM9P,EAASsQ,EAAY5R,GAEvC5H,EAAK+D,MAAOmF,EAASsQ,KAMzB,QAASC,IAAmB1B,GAC3B,GAAI2B,GAAc7D,EAASvR,EAC1BD,EAAM0T,EAAO3V,OACbuX,EAAkB5O,EAAKkJ,SAAU8D,EAAO,GAAG5R,MAC3CyT,EAAmBD,GAAmB5O,EAAKkJ,SAAS,KACpD7P,EAAIuV,EAAkB,EAAI,EAG1BE,EAAe1B,GAAe,SAAUlW,GACvC,MAAOA,KAASyX,GACdE,GAAkB,GACrBE,EAAkB3B,GAAe,SAAUlW,GAC1C,MAAO7B,GAAQ+C,KAAMuW,EAAczX,GAAS,IAC1C2X,GAAkB,GACrBlB,GAAa,SAAUzW,EAAMrB,EAASgH,GACrC,OAAU+R,IAAqB/R,GAAOhH,IAAYuK,MAChDuO,EAAe9Y,GAAS6B,SACxBoX,EAAc5X,EAAMrB,EAASgH,GAC7BkS,EAAiB7X,EAAMrB,EAASgH,KAGpC,MAAYvD,EAAJD,EAASA,IAChB,GAAMyR,EAAU9K,EAAKkJ,SAAU8D,EAAO3T,GAAG+B,MACxCuS,GAAaP,GAAcM,GAAgBC,GAAY7C,QACjD,CAIN,GAHAA,EAAU9K,EAAKkH,OAAQ8F,EAAO3T,GAAG+B,MAAOpC,MAAO,KAAMgU,EAAO3T,GAAGqH,SAG1DoK,EAASxQ,GAAY,CAGzB,IADAf,IAAMF,EACMC,EAAJC,EAASA,IAChB,GAAKyG,EAAKkJ,SAAU8D,EAAOzT,GAAG6B,MAC7B,KAGF,OAAO2S,IACN1U,EAAI,GAAKqU,GAAgBC,GACzBtU,EAAI,GAAKsL,GAERqI,EAAO7X,MAAO,EAAGkE,EAAI,GAAItE,QAASiJ,MAAgC,MAAzBgP,EAAQ3T,EAAI,GAAI+B,KAAe,IAAM,MAC7EX,QAASwH,EAAO,MAClB6I,EACIvR,EAAJF,GAASqV,GAAmB1B,EAAO7X,MAAOkE,EAAGE,IACzCD,EAAJC,GAAWmV,GAAoB1B,EAASA,EAAO7X,MAAOoE,IAClDD,EAAJC,GAAWoL,GAAYqI,IAGzBW,EAAS1Y,KAAM6V,GAIjB,MAAO4C,IAAgBC,GAGxB,QAASqB,IAA0BC,EAAiBC,GAEnD,GAAIC,GAAoB,EACvBC,EAAQF,EAAY7X,OAAS,EAC7BgY,EAAYJ,EAAgB5X,OAAS,EACrCiY,EAAe,SAAUvL,EAAMlO,EAASgH,EAAKsB,EAASoR,GACrD,GAAIrY,GAAMqC,EAAGuR,EACZ0E,KACAC,EAAe,EACfpW,EAAI,IACJ0R,EAAYhH,MACZ2L,EAA6B,MAAjBH,EACZI,EAAgBvP,EAEhB5H,EAAQuL,GAAQsL,GAAarP,EAAKzI,KAAU,IAAG,IAAKgY,GAAiB1Z,EAAQoC,YAAcpC,GAE3F+Z,EAAiB/O,GAA4B,MAAjB8O,EAAwB,EAAIpV,KAAKC,UAAY,EAS1E,KAPKkV,IACJtP,EAAmBvK,IAAYzB,GAAYyB,EAC3CkK,EAAaoP,GAKe,OAApBjY,EAAOsB,EAAMa,IAAaA,IAAM,CACxC,GAAKgW,GAAanY,EAAO,CACxBqC,EAAI,CACJ,OAASuR,EAAUmE,EAAgB1V,KAClC,GAAKuR,EAAS5T,EAAMrB,EAASgH,GAAQ,CACpCsB,EAAQlJ,KAAMiC,EACd,OAGGwY,IACJ7O,EAAU+O,EACV7P,IAAeoP,GAKZC,KAEElY,GAAQ4T,GAAW5T,IACxBuY,IAII1L,GACJgH,EAAU9V,KAAMiC,IAOnB,GADAuY,GAAgBpW,EACX+V,GAAS/V,IAAMoW,EAAe,CAClClW,EAAI,CACJ,OAASuR,EAAUoE,EAAY3V,KAC9BuR,EAASC,EAAWyE,EAAY3Z,EAASgH,EAG1C,IAAKkH,EAAO,CAEX,GAAK0L,EAAe,EACnB,MAAQpW,IACA0R,EAAU1R,IAAMmW,EAAWnW,KACjCmW,EAAWnW,GAAKoI,EAAIrJ,KAAM+F,GAM7BqR,GAAa5B,GAAU4B,GAIxBva,EAAK+D,MAAOmF,EAASqR,GAGhBE,IAAc3L,GAAQyL,EAAWnY,OAAS,GAC5CoY,EAAeP,EAAY7X,OAAW,GAExCyM,GAAO4E,WAAYvK,GAUrB,MALKuR,KACJ7O,EAAU+O,EACVxP,EAAmBuP,GAGb5E,EAGT,OAAOqE,GACN/J,GAAciK,GACdA,EAGFnP,EAAU2D,GAAO3D,QAAU,SAAUvK,EAAUia,GAC9C,GAAIxW,GACH6V,KACAD,KACA9B,EAASlM,EAAerL,EAAW,IAEpC,KAAMuX,EAAS,CAER0C,IACLA,EAAQrL,GAAU5O,IAEnByD,EAAIwW,EAAMxY,MACV,OAAQgC,IACP8T,EAASuB,GAAmBmB,EAAMxW,IAC7B8T,EAAQ7S,GACZ4U,EAAYja,KAAMkY,GAElB8B,EAAgBha,KAAMkY,EAKxBA,GAASlM,EAAerL,EAAUoZ,GAA0BC,EAAiBC,IAE9E,MAAO/B,GAGR,SAASoB,IAAkB3Y,EAAUka,EAAU3R,GAC9C,GAAI9E,GAAI,EACPC,EAAMwW,EAASzY,MAChB,MAAYiC,EAAJD,EAASA,IAChByK,GAAQlO,EAAUka,EAASzW,GAAI8E,EAEhC,OAAOA,GAGR,QAAS6G,IAAQpP,EAAUC,EAASsI,EAAS4F,GAC5C,GAAI1K,GAAG2T,EAAQ+C,EAAO3U,EAAM7D,EAC3BN,EAAQuN,GAAU5O,EAEnB,KAAMmO,GAEiB,IAAjB9M,EAAMI,OAAe,CAIzB,GADA2V,EAAS/V,EAAM,GAAKA,EAAM,GAAG9B,MAAO,GAC/B6X,EAAO3V,OAAS,GAAkC,QAA5B0Y,EAAQ/C,EAAO,IAAI5R,MAC5C0E,EAAQkH,SAAgC,IAArBnR,EAAQ6B,UAAkB6I,GAC7CP,EAAKkJ,SAAU8D,EAAO,GAAG5R,MAAS,CAGnC,GADAvF,GAAYmK,EAAKzI,KAAS,GAAGwY,EAAMrP,QAAQ,GAAGjG,QAAQ6I,GAAWC,IAAY1N,QAAkB,IACzFA,EACL,MAAOsI,EAERvI,GAAWA,EAAST,MAAO6X,EAAO5H,QAAQpH,MAAM3G,QAIjDgC,EAAIoJ,EAAwB,aAAE7K,KAAMhC,GAAa,EAAIoX,EAAO3V,MAC5D,OAAQgC,IAAM,CAIb,GAHA0W,EAAQ/C,EAAO3T,GAGV2G,EAAKkJ,SAAW9N,EAAO2U,EAAM3U,MACjC,KAED,KAAM7D,EAAOyI,EAAKzI,KAAM6D,MAEjB2I,EAAOxM,EACZwY,EAAMrP,QAAQ,GAAGjG,QAAS6I,GAAWC,IACrClB,EAASzK,KAAMoV,EAAO,GAAG5R,OAAUvF,EAAQoC,YAAcpC,IACrD,CAKJ,GAFAmX,EAAOrT,OAAQN,EAAG,GAClBzD,EAAWmO,EAAK1M,QAAUsN,GAAYqI,IAChCpX,EAEL,MADAX,GAAK+D,MAAOmF,EAAS4F,GACd5F,CAGR,SAgBL,MAPAgC,GAASvK,EAAUqB,GAClB8M,EACAlO,GACC0K,EACDpC,EACAkE,EAASzK,KAAMhC,IAETuI,EAMR2B,EAAQ+I,WAAavO,EAAQuF,MAAM,IAAInG,KAAMyH,GAAYyD,KAAK,MAAQtK,EAItEwF,EAAQ8I,iBAAmB1H,EAG3BZ,IAIAR,EAAQmI,aAAe3C,GAAO,SAAU0K,GAEvC,MAAuE,GAAhEA,EAAKnI,wBAAyBzT,EAASiI,cAAc,UAMvDiJ,GAAO,SAAUC,GAEtB,MADAA,GAAIuB,UAAY,mBAC+B,MAAxCvB,EAAIwB,WAAWtC,aAAa,WAEnCe,GAAW,yBAA0B,SAAUtO,EAAM4C,EAAMoG,GAC1D,MAAMA,GAAN,UACQhJ,EAAKuN,aAAc3K,EAA6B,SAAvBA,EAAKiE,cAA2B,EAAI,KAOjE+B,EAAQiC,YAAeuD,GAAO,SAAUC,GAG7C,MAFAA,GAAIuB,UAAY,WAChBvB,EAAIwB,WAAWrC,aAAc,QAAS,IACY,KAA3Ca,EAAIwB,WAAWtC,aAAc,YAEpCe,GAAW,QAAS,SAAUtO,EAAM4C,EAAMoG,GACzC,MAAMA,IAAyC,UAAhChJ,EAAK4G,SAASC,cAA7B,UACQ7G,EAAK+Y,eAOT3K,GAAO,SAAUC,GACtB,MAAuC,OAAhCA,EAAId,aAAa,eAExBe,GAAW7D,EAAU,SAAUzK,EAAM4C,EAAMoG,GAC1C,GAAIsI,EACJ,OAAMtI,GAAN,WACSsI,EAAMtR,EAAKkQ,iBAAkBtN,KAAW0O,EAAIC,UACnDD,EAAIxK,MACJ9G,EAAM4C,MAAW,EAAOA,EAAKiE,cAAgB,OAKjDvJ,EAAO+C,KAAOuM,GACdtP,EAAO8T,KAAOxE,GAAOkF,UACrBxU,EAAO8T,KAAK,KAAO9T,EAAO8T,KAAKtG,QAC/BxN,EAAO0b,OAASpM,GAAO4E,WACvBlU,EAAOgJ,KAAOsG,GAAO7D,QACrBzL,EAAO2b,SAAWrM,GAAO5D,MACzB1L,EAAOmM,SAAWmD,GAAOnD,UAGrB7M,EAEJ,IAAIsc,KAGJ,SAASC,GAAexW,GACvB,GAAIyW,GAASF,EAAcvW,KAI3B,OAHArF,GAAOmE,KAAMkB,EAAQ5C,MAAOf,OAAwB,SAAUsN,EAAG+M,GAChED,EAAQC,IAAS,IAEXD,EAyBR9b,EAAOgc,UAAY,SAAU3W,GAI5BA,EAA6B,gBAAZA,GACduW,EAAcvW,IAAawW,EAAexW,GAC5CrF,EAAOoF,UAAYC,EAEpB,IACC4W,GAEAC,EAEAC,EAEAC,EAEAC,EAEAC,EAEAC,KAEAC,GAASnX,EAAQoX,SAEjBC,EAAO,SAAUjV,GAOhB,IANAwU,EAAS5W,EAAQ4W,QAAUxU,EAC3ByU,GAAQ,EACRI,EAAcF,GAAe,EAC7BA,EAAc,EACdC,EAAeE,EAAK1Z,OACpBsZ,GAAS,EACDI,GAAsBF,EAAdC,EAA4BA,IAC3C,GAAKC,EAAMD,GAAc9X,MAAOiD,EAAM,GAAKA,EAAM,OAAU,GAASpC,EAAQsX,YAAc,CACzFV,GAAS,CACT,OAGFE,GAAS,EACJI,IACCC,EACCA,EAAM3Z,QACV6Z,EAAMF,EAAM5L,SAEFqL,EACXM,KAEAK,EAAKC,YAKRD,GAECE,IAAK,WACJ,GAAKP,EAAO,CAEX,GAAIzG,GAAQyG,EAAK1Z,QACjB,QAAUia,GAAKzY,GACdrE,EAAOmE,KAAME,EAAM,SAAU2K,EAAG7E,GAC/B,GAAIvD,GAAO5G,EAAO4G,KAAMuD,EACV,cAATvD,EACEvB,EAAQqW,QAAWkB,EAAKpG,IAAKrM,IAClCoS,EAAK9b,KAAM0J,GAEDA,GAAOA,EAAItH,QAAmB,WAAT+D,GAEhCkW,EAAK3S,OAGJ1F,WAGC0X,EACJE,EAAeE,EAAK1Z,OAGToZ,IACXG,EAActG,EACd4G,EAAMT,IAGR,MAAOtZ,OAGRoF,OAAQ,WAkBP,MAjBKwU,IACJvc,EAAOmE,KAAMM,UAAW,SAAUuK,EAAG7E,GACpC,GAAI4S,EACJ,QAASA,EAAQ/c,EAAO6J,QAASM,EAAKoS,EAAMQ,IAAY,GACvDR,EAAKpX,OAAQ4X,EAAO,GAEfZ,IACUE,GAATU,GACJV,IAEaC,GAATS,GACJT,OAME3Z,MAIR6T,IAAK,SAAUlV,GACd,MAAOA,GAAKtB,EAAO6J,QAASvI,EAAIib,GAAS,MAASA,IAAQA,EAAK1Z,SAGhE2U,MAAO,WAGN,MAFA+E,MACAF,EAAe,EACR1Z,MAGRka,QAAS,WAER,MADAN,GAAOC,EAAQP,EAAS1c,UACjBoD,MAGRyU,SAAU,WACT,OAAQmF,GAGTS,KAAM,WAKL,MAJAR,GAAQjd,UACF0c,GACLW,EAAKC,UAECla,MAGRsa,OAAQ,WACP,OAAQT,GAGTU,SAAU,SAAU7b,EAASgD,GAU5B,OATKkY,GAAWL,IAASM,IACxBnY,EAAOA,MACPA,GAAShD,EAASgD,EAAK1D,MAAQ0D,EAAK1D,QAAU0D,GACzC8X,EACJK,EAAM/b,KAAM4D,GAEZqY,EAAMrY,IAGD1B,MAGR+Z,KAAM,WAEL,MADAE,GAAKM,SAAUva,KAAM8B,WACd9B,MAGRuZ,MAAO,WACN,QAASA,GAIZ,OAAOU,IAER5c,EAAOoF,QAEN6F,SAAU,SAAUkS,GACnB,GAAIC,KAEA,UAAW,OAAQpd,EAAOgc,UAAU,eAAgB,aACpD,SAAU,OAAQhc,EAAOgc,UAAU,eAAgB,aACnD,SAAU,WAAYhc,EAAOgc,UAAU,YAE1CqB,EAAQ,UACR/Y,GACC+Y,MAAO,WACN,MAAOA,IAERC,OAAQ,WAEP,MADAC,GAAShZ,KAAME,WAAY+Y,KAAM/Y,WAC1B9B,MAER8a,KAAM,WACL,GAAIC,GAAMjZ,SACV,OAAOzE,GAAOiL,SAAS,SAAU0S,GAChC3d,EAAOmE,KAAMiZ,EAAQ,SAAUvY,EAAG+Y,GACjC,GAAIC,GAASD,EAAO,GACnBtc,EAAKtB,EAAOsD,WAAYoa,EAAK7Y,KAAS6Y,EAAK7Y,EAE5C0Y,GAAUK,EAAM,IAAK,WACpB,GAAIE,GAAWxc,GAAMA,EAAGkD,MAAO7B,KAAM8B,UAChCqZ,IAAY9d,EAAOsD,WAAYwa,EAASxZ,SAC5CwZ,EAASxZ,UACPC,KAAMoZ,EAASI,SACfP,KAAMG,EAASK,QACfC,SAAUN,EAASO,QAErBP,EAAUE,EAAS,QAAUlb,OAAS2B,EAAUqZ,EAASrZ,UAAY3B,KAAMrB,GAAOwc,GAAarZ,eAIlGiZ,EAAM,OACJpZ,WAIJA,QAAS,SAAUqC,GAClB,MAAc,OAAPA,EAAc3G,EAAOoF,OAAQuB,EAAKrC,GAAYA,IAGvDiZ,IAwCD,OArCAjZ,GAAQ6Z,KAAO7Z,EAAQmZ,KAGvBzd,EAAOmE,KAAMiZ,EAAQ,SAAUvY,EAAG+Y,GACjC,GAAIrB,GAAOqB,EAAO,GACjBQ,EAAcR,EAAO,EAGtBtZ,GAASsZ,EAAM,IAAOrB,EAAKO,IAGtBsB,GACJ7B,EAAKO,IAAI,WAERO,EAAQe,GAGNhB,EAAY,EAAJvY,GAAS,GAAIgY,QAASO,EAAQ,GAAK,GAAIJ,MAInDO,EAAUK,EAAM,IAAO,WAEtB,MADAL,GAAUK,EAAM,GAAK,QAAUjb,OAAS4a,EAAWjZ,EAAU3B,KAAM8B,WAC5D9B,MAER4a,EAAUK,EAAM,GAAK,QAAWrB,EAAKW,WAItC5Y,EAAQA,QAASiZ,GAGZJ,GACJA,EAAKvZ,KAAM2Z,EAAUA,GAIfA,GAIRc,KAAM,SAAUC,GACf,GAAIzZ,GAAI,EACP0Z,EAAgB7d,EAAWkD,KAAMa,WACjC5B,EAAS0b,EAAc1b,OAGvB2b,EAAuB,IAAX3b,GAAkByb,GAAete,EAAOsD,WAAYgb,EAAYha,SAAczB,EAAS,EAGnG0a,EAAyB,IAAdiB,EAAkBF,EAActe,EAAOiL,WAGlDwT,EAAa,SAAU5Z,EAAGyW,EAAUoD,GACnC,MAAO,UAAUlV,GAChB8R,EAAUzW,GAAMlC,KAChB+b,EAAQ7Z,GAAMJ,UAAU5B,OAAS,EAAInC,EAAWkD,KAAMa,WAAc+E,EAChEkV,IAAWC,EACdpB,EAASqB,WAAYtD,EAAUoD,KACfF,GAChBjB,EAAS/W,YAAa8U,EAAUoD,KAKnCC,EAAgBE,EAAkBC,CAGnC,IAAKjc,EAAS,EAIb,IAHA8b,EAAqB9X,MAAOhE,GAC5Bgc,EAAuBhY,MAAOhE,GAC9Bic,EAAsBjY,MAAOhE,GACjBA,EAAJgC,EAAYA,IACd0Z,EAAe1Z,IAAO7E,EAAOsD,WAAYib,EAAe1Z,GAAIP,SAChEia,EAAe1Z,GAAIP,UACjBC,KAAMka,EAAY5Z,EAAGia,EAAiBP,IACtCf,KAAMD,EAASS,QACfC,SAAUQ,EAAY5Z,EAAGga,EAAkBF,MAE3CH,CAUL,OAJMA,IACLjB,EAAS/W,YAAasY,EAAiBP,GAGjChB,EAASjZ,aAGlBtE,EAAOsL,QAAU,SAAWA,GAC3B,GAAIwH,GAAQlT,EAASiI,cAAc,SAClCkX,EAAWnf,EAASof,yBACpBjO,EAAMnR,EAASiI,cAAc,OAC7B2I,EAAS5Q,EAASiI,cAAc,UAChCoX,EAAMzO,EAAOtH,YAAatJ,EAASiI,cAAc,UAGlD,OAAMiL,GAAMlM,MAIZkM,EAAMlM,KAAO,WAIb0E,EAAQ4T,QAA0B,KAAhBpM,EAAMtJ,MAIxB8B,EAAQ6T,YAAcF,EAAI3H,SAG1BhM,EAAQ8T,qBAAsB,EAC9B9T,EAAQ+T,mBAAoB,EAC5B/T,EAAQgU,eAAgB,EAIxBxM,EAAMuE,SAAU,EAChB/L,EAAQiU,eAAiBzM,EAAM0M,WAAW,GAAOnI,QAIjD7G,EAAO4G,UAAW,EAClB9L,EAAQmU,aAAeR,EAAI7H,SAI3BtE,EAAQlT,EAASiI,cAAc,SAC/BiL,EAAMtJ,MAAQ,IACdsJ,EAAMlM,KAAO,QACb0E,EAAQoU,WAA6B,MAAhB5M,EAAMtJ,MAG3BsJ,EAAM5C,aAAc,UAAW,KAC/B4C,EAAM5C,aAAc,OAAQ,KAE5B6O,EAAS7V,YAAa4J,GAItBxH,EAAQqU,WAAaZ,EAASS,WAAW,GAAOA,WAAW,GAAOxJ,UAAUqB,QAI5E/L,EAAQsU,eAAiB,aAAetgB,GAExCyR,EAAI/F,MAAM6U,eAAiB,cAC3B9O,EAAIyO,WAAW,GAAOxU,MAAM6U,eAAiB,GAC7CvU,EAAQwU,gBAA+C,gBAA7B/O,EAAI/F,MAAM6U,eAGpC7f,EAAO,WACN,GAAI+f,GAAWC,EAEdC,EAAW,8HACXC,EAAOtgB,EAAS6I,qBAAqB,QAAS,EAEzCyX,KAKNH,EAAYngB,EAASiI,cAAc,OACnCkY,EAAU/U,MAAMmV,QAAU,gFAG1BD,EAAKhX,YAAa6W,GAAY7W,YAAa6H,GAC3CA,EAAIuB,UAAY,GAEhBvB,EAAI/F,MAAMmV,QAAU,uKAIpBngB,EAAO8K,KAAMoV,EAAyB,MAAnBA,EAAKlV,MAAMoV,MAAiBA,KAAM,MAAU,WAC9D9U,EAAQ+U,UAAgC,IAApBtP,EAAIuP,cAIpBhhB,EAAOihB,mBACXjV,EAAQgU,cAAuE,QAArDhgB,EAAOihB,iBAAkBxP,EAAK,WAAeoB,IACvE7G,EAAQ+T,kBAA2F,SAArE/f,EAAOihB,iBAAkBxP,EAAK,QAAYyP,MAAO,QAAUA,MAMzFR,EAAYjP,EAAI7H,YAAatJ,EAASiI,cAAc,QACpDmY,EAAUhV,MAAMmV,QAAUpP,EAAI/F,MAAMmV,QAAUF,EAC9CD,EAAUhV,MAAMyV,YAAcT,EAAUhV,MAAMwV,MAAQ,IACtDzP,EAAI/F,MAAMwV,MAAQ,MAElBlV,EAAQ8T,qBACNnY,YAAc3H,EAAOihB,iBAAkBP,EAAW,WAAeS,cAGpEP,EAAK/W,YAAa4W,MAGZzU,GArGCA,MAmHT,IAAIoV,GAAWC,EACdC,EAAS,+BACTC,EAAa,UAEd,SAASC,KAIRlX,OAAOmX,eAAgBpe,KAAK+N,SAAY,GACvC7M,IAAK,WACJ,YAIFlB,KAAKmD,QAAU9F,EAAO8F,QAAUC,KAAKC,SAGtC8a,EAAKE,IAAM,EAEXF,EAAKG,QAAU,SAAUC,GAOxB,MAAOA,GAAMhe,SACO,IAAnBge,EAAMhe,UAAqC,IAAnBge,EAAMhe,UAAiB,GAGjD4d,EAAKxe,WACJiI,IAAK,SAAU2W,GAId,IAAMJ,EAAKG,QAASC,GACnB,MAAO,EAGR,IAAIC,MAEHC,EAASF,EAAOve,KAAKmD,QAGtB,KAAMsb,EAAS,CACdA,EAASN,EAAKE,KAGd,KACCG,EAAYxe,KAAKmD,UAAc0D,MAAO4X,GACtCxX,OAAOyX,iBAAkBH,EAAOC,GAI/B,MAAQ/Z,GACT+Z,EAAYxe,KAAKmD,SAAYsb,EAC7BphB,EAAOoF,OAAQ8b,EAAOC,IASxB,MAJMxe,MAAK+N,MAAO0Q,KACjBze,KAAK+N,MAAO0Q,OAGNA,GAERE,IAAK,SAAUJ,EAAOzZ,EAAM+B,GAC3B,GAAI+X,GAIHH,EAASze,KAAK4H,IAAK2W,GACnBxQ,EAAQ/N,KAAK+N,MAAO0Q,EAGrB,IAAqB,gBAAT3Z,GACXiJ,EAAOjJ,GAAS+B,MAKhB,IAAKxJ,EAAOqH,cAAeqJ,GAC1B1Q,EAAOoF,OAAQzC,KAAK+N,MAAO0Q,GAAU3Z,OAGrC,KAAM8Z,IAAQ9Z,GACbiJ,EAAO6Q,GAAS9Z,EAAM8Z,EAIzB,OAAO7Q,IAER7M,IAAK,SAAUqd,EAAO3W,GAKrB,GAAImG,GAAQ/N,KAAK+N,MAAO/N,KAAK4H,IAAK2W,GAElC,OAAO3W,KAAQhL,UACdmR,EAAQA,EAAOnG,IAEjBD,OAAQ,SAAU4W,EAAO3W,EAAKf,GAC7B,GAAIgY,EAYJ,OAAKjX,KAAQhL,WACTgL,GAAsB,gBAARA,IAAqBf,IAAUjK,WAEhDiiB,EAAS7e,KAAKkB,IAAKqd,EAAO3W,GAEnBiX,IAAWjiB,UACjBiiB,EAAS7e,KAAKkB,IAAKqd,EAAOlhB,EAAOoJ,UAAUmB,MAS7C5H,KAAK2e,IAAKJ,EAAO3W,EAAKf,GAIfA,IAAUjK,UAAYiK,EAAQe,IAEtCxC,OAAQ,SAAUmZ,EAAO3W,GACxB,GAAI1F,GAAGS,EAAMmc,EACZL,EAASze,KAAK4H,IAAK2W,GACnBxQ,EAAQ/N,KAAK+N,MAAO0Q,EAErB,IAAK7W,IAAQhL,UACZoD,KAAK+N,MAAO0Q,UAEN,CAEDphB,EAAO6F,QAAS0E,GAOpBjF,EAAOiF,EAAIhK,OAAQgK,EAAIvF,IAAKhF,EAAOoJ,aAEnCqY,EAAQzhB,EAAOoJ,UAAWmB,GAErBA,IAAOmG,GACXpL,GAASiF,EAAKkX,IAIdnc,EAAOmc,EACPnc,EAAOA,IAAQoL,IACZpL,GAAWA,EAAK7C,MAAOf,SAI5BmD,EAAIS,EAAKzC,MACT,OAAQgC,UACA6L,GAAOpL,EAAMT,MAIvB6c,QAAS,SAAUR,GAClB,OAAQlhB,EAAOqH,cACd1E,KAAK+N,MAAOwQ,EAAOve,KAAKmD,gBAG1B6b,QAAS,SAAUT,GACbA,EAAOve,KAAKmD,gBACTnD,MAAK+N,MAAOwQ,EAAOve,KAAKmD,YAMlC4a,EAAY,GAAII,GAChBH,EAAY,GAAIG,GAGhB9gB,EAAOoF,QACNwc,WAAYd,EAAKG,QAEjBS,QAAS,SAAUhf,GAClB,MAAOge,GAAUgB,QAAShf,IAAUie,EAAUe,QAAShf,IAGxD+E,KAAM,SAAU/E,EAAM4C,EAAMmC,GAC3B,MAAOiZ,GAAUpW,OAAQ5H,EAAM4C,EAAMmC,IAGtCoa,WAAY,SAAUnf,EAAM4C,GAC3Bob,EAAU3Y,OAAQrF,EAAM4C,IAKzBwc,MAAO,SAAUpf,EAAM4C,EAAMmC,GAC5B,MAAOkZ,GAAUrW,OAAQ5H,EAAM4C,EAAMmC,IAGtCsa,YAAa,SAAUrf,EAAM4C,GAC5Bqb,EAAU5Y,OAAQrF,EAAM4C,MAI1BtF,EAAOsB,GAAG8D,QACTqC,KAAM,SAAU8C,EAAKf,GACpB,GAAIyH,GAAO3L,EACV5C,EAAOC,KAAM,GACbkC,EAAI,EACJ4C,EAAO,IAGR,IAAK8C,IAAQhL,UAAY,CACxB,GAAKoD,KAAKE,SACT4E,EAAOiZ,EAAU7c,IAAKnB,GAEC,IAAlBA,EAAKQ,WAAmByd,EAAU9c,IAAKnB,EAAM,iBAAmB,CAEpE,IADAuO,EAAQvO,EAAK6K,WACD0D,EAAMpO,OAAVgC,EAAkBA,IACzBS,EAAO2L,EAAOpM,GAAIS,KAEe,IAA5BA,EAAKzE,QAAS,WAClByE,EAAOtF,EAAOoJ,UAAW9D,EAAK3E,MAAM,IACpCqhB,EAAUtf,EAAM4C,EAAMmC,EAAMnC,IAG9Bqb,GAAUW,IAAK5e,EAAM,gBAAgB,GAIvC,MAAO+E,GAIR,MAAoB,gBAAR8C,GACJ5H,KAAKwB,KAAK,WAChBuc,EAAUY,IAAK3e,KAAM4H,KAIhBvK,EAAOsK,OAAQ3H,KAAM,SAAU6G,GACrC,GAAI/B,GACHwa,EAAWjiB,EAAOoJ,UAAWmB,EAO9B,IAAK7H,GAAQ8G,IAAUjK,UAAvB,CAIC,GADAkI,EAAOiZ,EAAU7c,IAAKnB,EAAM6H,GACvB9C,IAASlI,UACb,MAAOkI,EAMR,IADAA,EAAOiZ,EAAU7c,IAAKnB,EAAMuf,GACvBxa,IAASlI,UACb,MAAOkI,EAMR,IADAA,EAAOua,EAAUtf,EAAMuf,EAAU1iB,WAC5BkI,IAASlI,UACb,MAAOkI,OAQT9E,MAAKwB,KAAK,WAGT,GAAIsD,GAAOiZ,EAAU7c,IAAKlB,KAAMsf,EAKhCvB,GAAUY,IAAK3e,KAAMsf,EAAUzY,GAKL,KAArBe,EAAI1J,QAAQ,MAAe4G,IAASlI,WACxCmhB,EAAUY,IAAK3e,KAAM4H,EAAKf,MAG1B,KAAMA,EAAO/E,UAAU5B,OAAS,EAAG,MAAM,IAG7Cgf,WAAY,SAAUtX,GACrB,MAAO5H,MAAKwB,KAAK,WAChBuc,EAAU3Y,OAAQpF,KAAM4H,OAK3B,SAASyX,GAAUtf,EAAM6H,EAAK9C,GAC7B,GAAInC,EAIJ,IAAKmC,IAASlI,WAA+B,IAAlBmD,EAAKQ,SAI/B,GAHAoC,EAAO,QAAUiF,EAAItE,QAAS4a,EAAY,OAAQtX,cAClD9B,EAAO/E,EAAKuN,aAAc3K,GAEL,gBAATmC,GAAoB,CAC/B,IACCA,EAAgB,SAATA,GAAkB,EACf,UAATA,GAAmB,EACV,SAATA,EAAkB,MAEjBA,EAAO,KAAOA,GAAQA,EACvBmZ,EAAOxd,KAAMqE,GAASS,KAAKC,MAAOV,GAClCA,EACA,MAAOL,IAGTsZ,EAAUY,IAAK5e,EAAM6H,EAAK9C,OAE1BA,GAAOlI,SAGT,OAAOkI,GAERzH,EAAOoF,QACN8c,MAAO,SAAUxf,EAAMkE,EAAMa,GAC5B,GAAIya,EAEJ,OAAKxf,IACJkE,GAASA,GAAQ,MAAS,QAC1Bsb,EAAQvB,EAAU9c,IAAKnB,EAAMkE,GAGxBa,KACEya,GAASliB,EAAO6F,QAAS4B,GAC9Bya,EAAQvB,EAAUrW,OAAQ5H,EAAMkE,EAAM5G,EAAO0D,UAAU+D,IAEvDya,EAAMzhB,KAAMgH,IAGPya,OAZR,WAgBDC,QAAS,SAAUzf,EAAMkE,GACxBA,EAAOA,GAAQ,IAEf,IAAIsb,GAAQliB,EAAOkiB,MAAOxf,EAAMkE,GAC/Bwb,EAAcF,EAAMrf,OACpBvB,EAAK4gB,EAAMtR,QACXyR,EAAQriB,EAAOsiB,YAAa5f,EAAMkE,GAClC2b,EAAO,WACNviB,EAAOmiB,QAASzf,EAAMkE;CAIZ,gBAAPtF,IACJA,EAAK4gB,EAAMtR,QACXwR,KAGI9gB,IAIU,OAATsF,GACJsb,EAAMrO,QAAS,oBAITwO,GAAMG,KACblhB,EAAGsC,KAAMlB,EAAM6f,EAAMF,KAGhBD,GAAeC,GACpBA,EAAM7K,MAAMkF,QAKd4F,YAAa,SAAU5f,EAAMkE,GAC5B,GAAI2D,GAAM3D,EAAO,YACjB,OAAO+Z,GAAU9c,IAAKnB,EAAM6H,IAASoW,EAAUrW,OAAQ5H,EAAM6H,GAC5DiN,MAAOxX,EAAOgc,UAAU,eAAec,IAAI,WAC1C6D,EAAU5Y,OAAQrF,GAAQkE,EAAO,QAAS2D,WAM9CvK,EAAOsB,GAAG8D,QACT8c,MAAO,SAAUtb,EAAMa,GACtB,GAAIgb,GAAS,CAQb,OANqB,gBAAT7b,KACXa,EAAOb,EACPA,EAAO,KACP6b,KAGuBA,EAAnBhe,UAAU5B,OACP7C,EAAOkiB,MAAOvf,KAAK,GAAIiE,GAGxBa,IAASlI,UACfoD,KACAA,KAAKwB,KAAK,WACT,GAAI+d,GAAQliB,EAAOkiB,MAAOvf,KAAMiE,EAAMa,EAGtCzH,GAAOsiB,YAAa3f,KAAMiE,GAEZ,OAATA,GAA8B,eAAbsb,EAAM,IAC3BliB,EAAOmiB,QAASxf,KAAMiE,MAI1Bub,QAAS,SAAUvb,GAClB,MAAOjE,MAAKwB,KAAK,WAChBnE,EAAOmiB,QAASxf,KAAMiE,MAKxB8b,MAAO,SAAUC,EAAM/b,GAItB,MAHA+b,GAAO3iB,EAAO4iB,GAAK5iB,EAAO4iB,GAAGC,OAAQF,IAAUA,EAAOA,EACtD/b,EAAOA,GAAQ,KAERjE,KAAKuf,MAAOtb,EAAM,SAAU2b,EAAMF,GACxC,GAAIS,GAAU3X,WAAYoX,EAAMI,EAChCN,GAAMG,KAAO,WACZO,aAAcD,OAIjBE,WAAY,SAAUpc,GACrB,MAAOjE,MAAKuf,MAAOtb,GAAQ,UAI5BtC,QAAS,SAAUsC,EAAMD,GACxB,GAAI2B,GACH2a,EAAQ,EACRC,EAAQljB,EAAOiL,WACf8I,EAAWpR,KACXkC,EAAIlC,KAAKE,OACTkb,EAAU,aACCkF,GACTC,EAAM1c,YAAauN,GAAYA,IAIb,iBAATnN,KACXD,EAAMC,EACNA,EAAOrH,WAERqH,EAAOA,GAAQ,IAEf,OAAO/B,IACNyD,EAAMqY,EAAU9c,IAAKkQ,EAAUlP,GAAK+B,EAAO,cACtC0B,GAAOA,EAAIkP,QACfyL,IACA3a,EAAIkP,MAAMsF,IAAKiB,GAIjB,OADAA,KACOmF,EAAM5e,QAASqC,KAGxB,IAAIwc,GAAUC,EACbC,EAAS,cACTC,EAAU,MACVC,EAAa,qCAEdvjB,GAAOsB,GAAG8D,QACT7B,KAAM,SAAU+B,EAAMkE,GACrB,MAAOxJ,GAAOsK,OAAQ3H,KAAM3C,EAAOuD,KAAM+B,EAAMkE,EAAO/E,UAAU5B,OAAS,IAG1E2gB,WAAY,SAAUle,GACrB,MAAO3C,MAAKwB,KAAK,WAChBnE,EAAOwjB,WAAY7gB,KAAM2C,MAI3Bic,KAAM,SAAUjc,EAAMkE,GACrB,MAAOxJ,GAAOsK,OAAQ3H,KAAM3C,EAAOuhB,KAAMjc,EAAMkE,EAAO/E,UAAU5B,OAAS,IAG1E4gB,WAAY,SAAUne,GACrB,MAAO3C,MAAKwB,KAAK,iBACTxB,MAAM3C,EAAO0jB,QAASpe,IAAUA,MAIzCqe,SAAU,SAAUna,GACnB,GAAIoa,GAASlhB,EAAM2O,EAAKwS,EAAO9e,EAC9BF,EAAI,EACJC,EAAMnC,KAAKE,OACXihB,EAA2B,gBAAVta,IAAsBA,CAExC,IAAKxJ,EAAOsD,WAAYkG,GACvB,MAAO7G,MAAKwB,KAAK,SAAUY,GAC1B/E,EAAQ2C,MAAOghB,SAAUna,EAAM5F,KAAMjB,KAAMoC,EAAGpC,KAAKyP,aAIrD,IAAK0R,EAIJ,IAFAF,GAAYpa,GAAS,IAAK/G,MAAOf,OAErBoD,EAAJD,EAASA,IAOhB,GANAnC,EAAOC,KAAMkC,GACbwM,EAAwB,IAAlB3O,EAAKQ,WAAoBR,EAAK0P,WACjC,IAAM1P,EAAK0P,UAAY,KAAMnM,QAASod,EAAQ,KAChD,KAGU,CACVte,EAAI,CACJ,OAAS8e,EAAQD,EAAQ7e,KACgB,EAAnCsM,EAAIxQ,QAAS,IAAMgjB,EAAQ,OAC/BxS,GAAOwS,EAAQ,IAGjBnhB,GAAK0P,UAAYpS,EAAOmB,KAAMkQ,GAMjC,MAAO1O,OAGRohB,YAAa,SAAUva,GACtB,GAAIoa,GAASlhB,EAAM2O,EAAKwS,EAAO9e,EAC9BF,EAAI,EACJC,EAAMnC,KAAKE,OACXihB,EAA+B,IAArBrf,UAAU5B,QAAiC,gBAAV2G,IAAsBA,CAElE,IAAKxJ,EAAOsD,WAAYkG,GACvB,MAAO7G,MAAKwB,KAAK,SAAUY,GAC1B/E,EAAQ2C,MAAOohB,YAAava,EAAM5F,KAAMjB,KAAMoC,EAAGpC,KAAKyP,aAGxD,IAAK0R,EAGJ,IAFAF,GAAYpa,GAAS,IAAK/G,MAAOf,OAErBoD,EAAJD,EAASA,IAQhB,GAPAnC,EAAOC,KAAMkC,GAEbwM,EAAwB,IAAlB3O,EAAKQ,WAAoBR,EAAK0P,WACjC,IAAM1P,EAAK0P,UAAY,KAAMnM,QAASod,EAAQ,KAChD,IAGU,CACVte,EAAI,CACJ,OAAS8e,EAAQD,EAAQ7e,KAExB,MAAQsM,EAAIxQ,QAAS,IAAMgjB,EAAQ,MAAS,EAC3CxS,EAAMA,EAAIpL,QAAS,IAAM4d,EAAQ,IAAK,IAGxCnhB,GAAK0P,UAAY5I,EAAQxJ,EAAOmB,KAAMkQ,GAAQ,GAKjD,MAAO1O,OAGRqhB,YAAa,SAAUxa,EAAOya,GAC7B,GAAIrd,SAAc4C,EAElB,OAAyB,iBAAbya,IAAmC,WAATrd,EAC9Bqd,EAAWthB,KAAKghB,SAAUna,GAAU7G,KAAKohB,YAAava,GAGzDxJ,EAAOsD,WAAYkG,GAChB7G,KAAKwB,KAAK,SAAUU,GAC1B7E,EAAQ2C,MAAOqhB,YAAaxa,EAAM5F,KAAKjB,KAAMkC,EAAGlC,KAAKyP,UAAW6R,GAAWA,KAItEthB,KAAKwB,KAAK,WAChB,GAAc,WAATyC,EAAoB,CAExB,GAAIwL,GACHvN,EAAI,EACJ+X,EAAO5c,EAAQ2C,MACfuhB,EAAa1a,EAAM/G,MAAOf,MAE3B,OAAS0Q,EAAY8R,EAAYrf,KAE3B+X,EAAKuH,SAAU/R,GACnBwK,EAAKmH,YAAa3R,GAElBwK,EAAK+G,SAAUvR,QAKNxL,IAASlH,GAA8B,YAATkH,KACpCjE,KAAKyP,WAETuO,EAAUW,IAAK3e,KAAM,gBAAiBA,KAAKyP,WAO5CzP,KAAKyP,UAAYzP,KAAKyP,WAAa5I,KAAU,EAAQ,GAAKmX,EAAU9c,IAAKlB,KAAM,kBAAqB,OAKvGwhB,SAAU,SAAU/iB,GACnB,GAAIgR,GAAY,IAAMhR,EAAW,IAChCyD,EAAI,EACJkF,EAAIpH,KAAKE,MACV,MAAYkH,EAAJlF,EAAOA,IACd,GAA0B,IAArBlC,KAAKkC,GAAG3B,WAAmB,IAAMP,KAAKkC,GAAGuN,UAAY,KAAKnM,QAAQod,EAAQ,KAAKxiB,QAASuR,IAAe,EAC3G,OAAO,CAIT,QAAO,GAGR4B,IAAK,SAAUxK,GACd,GAAI6Y,GAAOpe,EAAKX,EACfZ,EAAOC,KAAK,EAEb,EAAA,GAAM8B,UAAU5B,OAsBhB,MAFAS,GAAatD,EAAOsD,WAAYkG,GAEzB7G,KAAKwB,KAAK,SAAUU,GAC1B,GAAImP,EAEmB,KAAlBrR,KAAKO,WAKT8Q,EADI1Q,EACEkG,EAAM5F,KAAMjB,KAAMkC,EAAG7E,EAAQ2C,MAAOqR,OAEpCxK,EAIK,MAAPwK,EACJA,EAAM,GACoB,gBAARA,GAClBA,GAAO,GACIhU,EAAO6F,QAASmO,KAC3BA,EAAMhU,EAAOgF,IAAIgP,EAAK,SAAWxK,GAChC,MAAgB,OAATA,EAAgB,GAAKA,EAAQ,MAItC6Y,EAAQriB,EAAOokB,SAAUzhB,KAAKiE,OAAU5G,EAAOokB,SAAUzhB,KAAK2G,SAASC,eAGjE8Y,GAAW,OAASA,IAAUA,EAAMf,IAAK3e,KAAMqR,EAAK,WAAczU,YACvEoD,KAAK6G,MAAQwK,KAjDd,IAAKtR,EAGJ,MAFA2f,GAAQriB,EAAOokB,SAAU1hB,EAAKkE,OAAU5G,EAAOokB,SAAU1hB,EAAK4G,SAASC,eAElE8Y,GAAS,OAASA,KAAUpe,EAAMoe,EAAMxe,IAAKnB,EAAM,YAAenD,UAC/D0E,GAGRA,EAAMvB,EAAK8G,MAEW,gBAARvF,GAEbA,EAAIgC,QAAQqd,EAAS,IAEd,MAAPrf,EAAc,GAAKA,OA0CxBjE,EAAOoF,QACNgf,UACCC,QACCxgB,IAAK,SAAUnB,GAGd,GAAIsR,GAAMtR,EAAK6K,WAAW/D,KAC1B,QAAQwK,GAAOA,EAAIC,UAAYvR,EAAK8G,MAAQ9G,EAAKsG,OAGnDwH,QACC3M,IAAK,SAAUnB,GACd,GAAI8G,GAAO6a,EACVhf,EAAU3C,EAAK2C,QACf0X,EAAQra,EAAK6U,cACb+M,EAAoB,eAAd5hB,EAAKkE,MAAiC,EAARmW,EACpC2B,EAAS4F,EAAM,QACfC,EAAMD,EAAMvH,EAAQ,EAAI1X,EAAQxC,OAChCgC,EAAY,EAARkY,EACHwH,EACAD,EAAMvH,EAAQ,CAGhB,MAAYwH,EAAJ1f,EAASA,IAIhB,GAHAwf,EAAShf,EAASR,MAGXwf,EAAO/M,UAAYzS,IAAMkY,IAE5B/c,EAAOsL,QAAQmU,YAAe4E,EAAOjN,SAA+C,OAApCiN,EAAOpU,aAAa,cACnEoU,EAAO5gB,WAAW2T,UAAapX,EAAOsJ,SAAU+a,EAAO5gB,WAAY,aAAiB,CAMxF,GAHA+F,EAAQxJ,EAAQqkB,GAASrQ,MAGpBsQ,EACJ,MAAO9a,EAIRkV,GAAOje,KAAM+I,GAIf,MAAOkV,IAGR4C,IAAK,SAAU5e,EAAM8G,GACpB,GAAIgb,GAAWH,EACdhf,EAAU3C,EAAK2C,QACfqZ,EAAS1e,EAAO0D,UAAW8F,GAC3B3E,EAAIQ,EAAQxC,MAEb,OAAQgC,IACPwf,EAAShf,EAASR,IACZwf,EAAO/M,SAAWtX,EAAO6J,QAAS7J,EAAOqkB,GAAQrQ,MAAO0K,IAAY,KACzE8F,GAAY,EAQd,OAHMA,KACL9hB,EAAK6U,cAAgB,IAEfmH,KAKVnb,KAAM,SAAUb,EAAM4C,EAAMkE,GAC3B,GAAI6Y,GAAOpe,EACVwgB,EAAQ/hB,EAAKQ,QAGd,IAAMR,GAAkB,IAAV+hB,GAAyB,IAAVA,GAAyB,IAAVA,EAK5C,aAAY/hB,GAAKuN,eAAiBvQ,EAC1BM,EAAOuhB,KAAM7e,EAAM4C,EAAMkE,IAKlB,IAAVib,GAAgBzkB,EAAO2b,SAAUjZ,KACrC4C,EAAOA,EAAKiE,cACZ8Y,EAAQriB,EAAO0kB,UAAWpf,KACvBtF,EAAO8T,KAAKrR,MAAM+L,KAAKpL,KAAMkC,GAAS8d,EAAWD,IAGhD3Z,IAAUjK,UAaH8iB,GAAS,OAASA,IAA6C,QAAnCpe,EAAMoe,EAAMxe,IAAKnB,EAAM4C,IACvDrB,GAGPA,EAAMjE,EAAO+C,KAAKQ,KAAMb,EAAM4C,GAGhB,MAAPrB,EACN1E,UACA0E,GApBc,OAAVuF,EAGO6Y,GAAS,OAASA,KAAUpe,EAAMoe,EAAMf,IAAK5e,EAAM8G,EAAOlE,MAAY/F,UAC1E0E,GAGPvB,EAAKwN,aAAc5K,EAAMkE,EAAQ,IAC1BA,IAPPxJ,EAAOwjB,WAAY9gB,EAAM4C,GAAzBtF,aAuBHwjB,WAAY,SAAU9gB,EAAM8G,GAC3B,GAAIlE,GAAMqf,EACT9f,EAAI,EACJ+f,EAAYpb,GAASA,EAAM/G,MAAOf,EAEnC,IAAKkjB,GAA+B,IAAlBliB,EAAKQ,SACtB,MAASoC,EAAOsf,EAAU/f,KACzB8f,EAAW3kB,EAAO0jB,QAASpe,IAAUA,EAGhCtF,EAAO8T,KAAKrR,MAAM+L,KAAKpL,KAAMkC,KAEjC5C,EAAMiiB,IAAa,GAGpBjiB,EAAK6N,gBAAiBjL,IAKzBof,WACC9d,MACC0a,IAAK,SAAU5e,EAAM8G,GACpB,IAAMxJ,EAAOsL,QAAQoU,YAAwB,UAAVlW,GAAqBxJ,EAAOsJ,SAAS5G,EAAM,SAAW,CAGxF,GAAIsR,GAAMtR,EAAK8G,KAKf,OAJA9G,GAAKwN,aAAc,OAAQ1G,GACtBwK,IACJtR,EAAK8G,MAAQwK,GAEPxK,MAMXka,SACCmB,MAAO,UACPC,QAAS,aAGVvD,KAAM,SAAU7e,EAAM4C,EAAMkE,GAC3B,GAAIvF,GAAKoe,EAAO0C,EACfN,EAAQ/hB,EAAKQ,QAGd,IAAMR,GAAkB,IAAV+hB,GAAyB,IAAVA,GAAyB,IAAVA,EAY5C,MARAM,GAAmB,IAAVN,IAAgBzkB,EAAO2b,SAAUjZ,GAErCqiB,IAEJzf,EAAOtF,EAAO0jB,QAASpe,IAAUA,EACjC+c,EAAQriB,EAAOglB,UAAW1f,IAGtBkE,IAAUjK,UACP8iB,GAAS,OAASA,KAAUpe,EAAMoe,EAAMf,IAAK5e,EAAM8G,EAAOlE,MAAY/F,UAC5E0E,EACEvB,EAAM4C,GAASkE,EAGX6Y,GAAS,OAASA,IAA6C,QAAnCpe,EAAMoe,EAAMxe,IAAKnB,EAAM4C,IACzDrB,EACAvB,EAAM4C,IAIT0f,WACC9N,UACCrT,IAAK,SAAUnB,GACd,MAAOA,GAAKuiB,aAAc,aAAgB1B,EAAWngB,KAAMV,EAAK4G,WAAc5G,EAAKuU,KAClFvU,EAAKwU,SACL,QAOLkM,GACC9B,IAAK,SAAU5e,EAAM8G,EAAOlE,GAO3B,MANKkE,MAAU,EAEdxJ,EAAOwjB,WAAY9gB,EAAM4C,GAEzB5C,EAAKwN,aAAc5K,EAAMA,GAEnBA,IAGTtF,EAAOmE,KAAMnE,EAAO8T,KAAKrR,MAAM+L,KAAK/M,OAAOgB,MAAO,QAAU,SAAUoC,EAAGS,GACxE,GAAI4f,GAASllB,EAAO8T,KAAK3C,WAAY7L,IAAUtF,EAAO+C,KAAKQ,IAE3DvD,GAAO8T,KAAK3C,WAAY7L,GAAS,SAAU5C,EAAM4C,EAAMoG,GACtD,GAAIpK,GAAKtB,EAAO8T,KAAK3C,WAAY7L,GAChCrB,EAAMyH,EACLnM,WAGCS,EAAO8T,KAAK3C,WAAY7L,GAAS/F,YACjC2lB,EAAQxiB,EAAM4C,EAAMoG,GAEpBpG,EAAKiE,cACL,IAKH,OAFAvJ,GAAO8T,KAAK3C,WAAY7L,GAAShE,EAE1B2C,KAMHjE,EAAOsL,QAAQ6T,cACpBnf,EAAOglB,UAAU1N,UAChBzT,IAAK,SAAUnB,GACd,GAAIsP,GAAStP,EAAKe,UAIlB,OAHKuO,IAAUA,EAAOvO,YACrBuO,EAAOvO,WAAW8T,cAEZ,QAKVvX,EAAOmE,MACN,WACA,WACA,YACA,cACA,cACA,UACA,UACA,SACA,cACA,mBACE,WACFnE,EAAO0jB,QAAS/gB,KAAK4G,eAAkB5G,OAIxC3C,EAAOmE,MAAO,QAAS,YAAc,WACpCnE,EAAOokB,SAAUzhB,OAChB2e,IAAK,SAAU5e,EAAM8G,GACpB,MAAKxJ,GAAO6F,QAAS2D,GACX9G,EAAK2U,QAAUrX,EAAO6J,QAAS7J,EAAO0C,GAAMsR,MAAOxK,IAAW,EADxE,YAKIxJ,EAAOsL,QAAQ4T,UACpBlf,EAAOokB,SAAUzhB,MAAOkB,IAAM,SAAUnB,GAGvC,MAAsC,QAA/BA,EAAKuN,aAAa,SAAoB,KAAOvN,EAAK8G,SAI5D,IAAI2b,GAAY,OACfC,EAAc,+BACdC,EAAc,kCACdC,EAAiB,sBAElB,SAASC,KACR,OAAO,EAGR,QAASC,KACR,OAAO,EAGR,QAASC,KACR,IACC,MAAO7lB,GAASmX,cACf,MAAQ2O,KAOX1lB,EAAO2lB,OAENC,UAEA9I,IAAK,SAAUpa,EAAMmjB,EAAO3U,EAASzJ,EAAMrG,GAE1C,GAAI0kB,GAAaC,EAAazd,EAC7B0d,EAAQC,EAAGC,EACXC,EAASC,EAAUxf,EAAMyf,EAAYC,EACrCC,EAAW5F,EAAU9c,IAAKnB,EAG3B,IAAM6jB,EAAN,CAKKrV,EAAQA,UACZ4U,EAAc5U,EACdA,EAAU4U,EAAY5U,QACtB9P,EAAW0kB,EAAY1kB,UAIlB8P,EAAQ9G,OACb8G,EAAQ9G,KAAOpK,EAAOoK,SAIhB4b,EAASO,EAASP,UACxBA,EAASO,EAASP,YAEZD,EAAcQ,EAASC,UAC7BT,EAAcQ,EAASC,OAAS,SAAUpf,GAGzC,aAAcpH,KAAWN,GAAuB0H,GAAKpH,EAAO2lB,MAAMc,YAAcrf,EAAER,KAEjFrH,UADAS,EAAO2lB,MAAMe,SAASliB,MAAOuhB,EAAYrjB,KAAM+B,YAIjDshB,EAAYrjB,KAAOA,GAIpBmjB,GAAUA,GAAS,IAAKpjB,MAAOf,KAAqB,IACpDukB,EAAIJ,EAAMhjB,MACV,OAAQojB,IACP3d,EAAMgd,EAAexiB,KAAM+iB,EAAMI,QACjCrf,EAAO0f,EAAWhe,EAAI,GACtB+d,GAAe/d,EAAI,IAAM,IAAK+C,MAAO,KAAMnG,OAGrC0B,IAKNuf,EAAUnmB,EAAO2lB,MAAMQ,QAASvf,OAGhCA,GAASxF,EAAW+kB,EAAQQ,aAAeR,EAAQS,WAAchgB,EAGjEuf,EAAUnmB,EAAO2lB,MAAMQ,QAASvf,OAGhCsf,EAAYlmB,EAAOoF,QAClBwB,KAAMA,EACN0f,SAAUA,EACV7e,KAAMA,EACNyJ,QAASA,EACT9G,KAAM8G,EAAQ9G,KACdhJ,SAAUA,EACVqN,aAAcrN,GAAYpB,EAAO8T,KAAKrR,MAAMgM,aAAarL,KAAMhC,GAC/DylB,UAAWR,EAAWjW,KAAK,MACzB0V,IAGIM,EAAWJ,EAAQpf,MACzBwf,EAAWJ,EAAQpf,MACnBwf,EAASU,cAAgB,EAGnBX,EAAQY,OAASZ,EAAQY,MAAMnjB,KAAMlB,EAAM+E,EAAM4e,EAAYN,MAAkB,GAC/ErjB,EAAK0I,kBACT1I,EAAK0I,iBAAkBxE,EAAMmf,GAAa,IAKxCI,EAAQrJ,MACZqJ,EAAQrJ,IAAIlZ,KAAMlB,EAAMwjB,GAElBA,EAAUhV,QAAQ9G,OACvB8b,EAAUhV,QAAQ9G,KAAO8G,EAAQ9G,OAK9BhJ,EACJglB,EAASjhB,OAAQihB,EAASU,gBAAiB,EAAGZ,GAE9CE,EAAS3lB,KAAMylB,GAIhBlmB,EAAO2lB,MAAMC,OAAQhf,IAAS,EAI/BlE,GAAO,OAIRqF,OAAQ,SAAUrF,EAAMmjB,EAAO3U,EAAS9P,EAAU4lB,GAEjD,GAAIjiB,GAAGkiB,EAAW3e,EACjB0d,EAAQC,EAAGC,EACXC,EAASC,EAAUxf,EAAMyf,EAAYC,EACrCC,EAAW5F,EAAUe,QAAShf,IAAUie,EAAU9c,IAAKnB,EAExD,IAAM6jB,IAAcP,EAASO,EAASP,QAAtC,CAKAH,GAAUA,GAAS,IAAKpjB,MAAOf,KAAqB,IACpDukB,EAAIJ,EAAMhjB,MACV,OAAQojB,IAMP,GALA3d,EAAMgd,EAAexiB,KAAM+iB,EAAMI,QACjCrf,EAAO0f,EAAWhe,EAAI,GACtB+d,GAAe/d,EAAI,IAAM,IAAK+C,MAAO,KAAMnG,OAGrC0B,EAAN,CAOAuf,EAAUnmB,EAAO2lB,MAAMQ,QAASvf,OAChCA,GAASxF,EAAW+kB,EAAQQ,aAAeR,EAAQS,WAAchgB,EACjEwf,EAAWJ,EAAQpf,OACnB0B,EAAMA,EAAI,IAAUoF,OAAQ,UAAY2Y,EAAWjW,KAAK,iBAAmB,WAG3E6W,EAAYliB,EAAIqhB,EAASvjB,MACzB,OAAQkC,IACPmhB,EAAYE,EAAUrhB,IAEfiiB,GAAeV,IAAaJ,EAAUI,UACzCpV,GAAWA,EAAQ9G,OAAS8b,EAAU9b,MACtC9B,IAAOA,EAAIlF,KAAM8iB,EAAUW,YAC3BzlB,GAAYA,IAAa8kB,EAAU9kB,WAAyB,OAAbA,IAAqB8kB,EAAU9kB,YACjFglB,EAASjhB,OAAQJ,EAAG,GAEfmhB,EAAU9kB,UACdglB,EAASU,gBAELX,EAAQpe,QACZoe,EAAQpe,OAAOnE,KAAMlB,EAAMwjB,GAOzBe,KAAcb,EAASvjB,SACrBsjB,EAAQe,UAAYf,EAAQe,SAAStjB,KAAMlB,EAAM2jB,EAAYE,EAASC,WAAa,GACxFxmB,EAAOmnB,YAAazkB,EAAMkE,EAAM2f,EAASC,cAGnCR,GAAQpf,QAtCf,KAAMA,IAAQof,GACbhmB,EAAO2lB,MAAM5d,OAAQrF,EAAMkE,EAAOif,EAAOI,GAAK/U,EAAS9P,GAAU,EA0C/DpB,GAAOqH,cAAe2e,WACnBO,GAASC,OAChB7F,EAAU5Y,OAAQrF,EAAM,aAI1B+D,QAAS,SAAUkf,EAAOle,EAAM/E,EAAM0kB,GAErC,GAAIviB,GAAGwM,EAAK/I,EAAK+e,EAAYC,EAAQd,EAAQL,EAC5CoB,GAAc7kB,GAAQ9C,GACtBgH,EAAO5F,EAAY4C,KAAM+hB,EAAO,QAAWA,EAAM/e,KAAO+e,EACxDU,EAAarlB,EAAY4C,KAAM+hB,EAAO,aAAgBA,EAAMkB,UAAUxb,MAAM,OAK7E,IAHAgG,EAAM/I,EAAM5F,EAAOA,GAAQ9C,EAGJ,IAAlB8C,EAAKQ,UAAoC,IAAlBR,EAAKQ,WAK5BmiB,EAAYjiB,KAAMwD,EAAO5G,EAAO2lB,MAAMc,aAItC7f,EAAK/F,QAAQ,MAAQ,IAEzBwlB,EAAazf,EAAKyE,MAAM,KACxBzE,EAAOyf,EAAWzV,QAClByV,EAAWnhB,QAEZoiB,EAA6B,EAApB1gB,EAAK/F,QAAQ,MAAY,KAAO+F,EAGzC+e,EAAQA,EAAO3lB,EAAO8F,SACrB6f,EACA,GAAI3lB,GAAOwnB,MAAO5gB,EAAuB,gBAAV+e,IAAsBA,GAGtDA,EAAM8B,UAAYL,EAAe,EAAI,EACrCzB,EAAMkB,UAAYR,EAAWjW,KAAK,KAClCuV,EAAM+B,aAAe/B,EAAMkB,UACtBnZ,OAAQ,UAAY2Y,EAAWjW,KAAK,iBAAmB,WAC3D,KAGDuV,EAAMpQ,OAAShW,UACTomB,EAAMhgB,SACXggB,EAAMhgB,OAASjD,GAIhB+E,EAAe,MAARA,GACJke,GACF3lB,EAAO0D,UAAW+D,GAAQke,IAG3BQ,EAAUnmB,EAAO2lB,MAAMQ,QAASvf,OAC1BwgB,IAAgBjB,EAAQ1f,SAAW0f,EAAQ1f,QAAQjC,MAAO9B,EAAM+E,MAAW,GAAjF,CAMA,IAAM2f,IAAiBjB,EAAQwB,WAAa3nB,EAAO8G,SAAUpE,GAAS,CAMrE,IAJA2kB,EAAalB,EAAQQ,cAAgB/f,EAC/Bye,EAAYjiB,KAAMikB,EAAazgB,KACpCyK,EAAMA,EAAI5N,YAEH4N,EAAKA,EAAMA,EAAI5N,WACtB8jB,EAAU9mB,KAAM4Q,GAChB/I,EAAM+I,CAIF/I,MAAS5F,EAAKS,eAAiBvD,IACnC2nB,EAAU9mB,KAAM6H,EAAI2J,aAAe3J,EAAIsf,cAAgBtoB,GAKzDuF,EAAI,CACJ,QAASwM,EAAMkW,EAAU1iB,QAAU8gB,EAAMkC,uBAExClC,EAAM/e,KAAO/B,EAAI,EAChBwiB,EACAlB,EAAQS,UAAYhgB,EAGrB4f,GAAW7F,EAAU9c,IAAKwN,EAAK,eAAoBsU,EAAM/e,OAAU+Z,EAAU9c,IAAKwN,EAAK,UAClFmV,GACJA,EAAOhiB,MAAO6M,EAAK5J,GAIpB+e,EAASc,GAAUjW,EAAKiW,GACnBd,GAAUxmB,EAAO4hB,WAAYvQ,IAASmV,EAAOhiB,OAASgiB,EAAOhiB,MAAO6M,EAAK5J,MAAW,GACxFke,EAAMmC,gBAkCR,OA/BAnC,GAAM/e,KAAOA,EAGPwgB,GAAiBzB,EAAMoC,sBAErB5B,EAAQ6B,UAAY7B,EAAQ6B,SAASxjB,MAAO+iB,EAAUta,MAAOxF,MAAW,IAC9EzH,EAAO4hB,WAAYlf,IAId4kB,GAAUtnB,EAAOsD,WAAYZ,EAAMkE,MAAa5G,EAAO8G,SAAUpE,KAGrE4F,EAAM5F,EAAM4kB,GAEPhf,IACJ5F,EAAM4kB,GAAW,MAIlBtnB,EAAO2lB,MAAMc,UAAY7f,EACzBlE,EAAMkE,KACN5G,EAAO2lB,MAAMc,UAAYlnB,UAEpB+I,IACJ5F,EAAM4kB,GAAWhf,IAMdqd,EAAMpQ,SAGdmR,SAAU,SAAUf,GAGnBA,EAAQ3lB,EAAO2lB,MAAMsC,IAAKtC,EAE1B,IAAI9gB,GAAGE,EAAGd,EAAKmS,EAAS8P,EACvBgC,KACA7jB,EAAO3D,EAAWkD,KAAMa,WACxB2hB,GAAazF,EAAU9c,IAAKlB,KAAM,eAAoBgjB,EAAM/e,UAC5Duf,EAAUnmB,EAAO2lB,MAAMQ,QAASR,EAAM/e,SAOvC,IAJAvC,EAAK,GAAKshB,EACVA,EAAMwC,eAAiBxlB,MAGlBwjB,EAAQiC,aAAejC,EAAQiC,YAAYxkB,KAAMjB,KAAMgjB,MAAY,EAAxE,CAKAuC,EAAeloB,EAAO2lB,MAAMS,SAASxiB,KAAMjB,KAAMgjB,EAAOS,GAGxDvhB,EAAI,CACJ,QAASuR,EAAU8R,EAAcrjB,QAAW8gB,EAAMkC,uBAAyB,CAC1ElC,EAAM0C,cAAgBjS,EAAQ1T,KAE9BqC,EAAI,CACJ,QAASmhB,EAAY9P,EAAQgQ,SAAUrhB,QAAW4gB,EAAM2C,kCAIjD3C,EAAM+B,cAAgB/B,EAAM+B,aAAatkB,KAAM8iB,EAAUW,cAE9DlB,EAAMO,UAAYA,EAClBP,EAAMle,KAAOye,EAAUze,KAEvBxD,IAASjE,EAAO2lB,MAAMQ,QAASD,EAAUI,eAAkBE,QAAUN,EAAUhV,SAC5E1M,MAAO4R,EAAQ1T,KAAM2B,GAEnBJ,IAAQ1E,YACNomB,EAAMpQ,OAAStR,MAAS,IAC7B0hB,EAAMmC,iBACNnC,EAAM4C,oBAYX,MAJKpC,GAAQqC,cACZrC,EAAQqC,aAAa5kB,KAAMjB,KAAMgjB,GAG3BA,EAAMpQ,SAGd6Q,SAAU,SAAUT,EAAOS,GAC1B,GAAIvhB,GAAGqH,EAASuc,EAAKvC,EACpBgC,KACApB,EAAgBV,EAASU,cACzBzV,EAAMsU,EAAMhgB,MAKb,IAAKmhB,GAAiBzV,EAAInO,YAAcyiB,EAAMjO,QAAyB,UAAfiO,EAAM/e,MAE7D,KAAQyK,IAAQ1O,KAAM0O,EAAMA,EAAI5N,YAAcd,KAG7C,GAAK0O,EAAI+F,YAAa,GAAuB,UAAfuO,EAAM/e,KAAmB,CAEtD,IADAsF,KACMrH,EAAI,EAAOiiB,EAAJjiB,EAAmBA,IAC/BqhB,EAAYE,EAAUvhB,GAGtB4jB,EAAMvC,EAAU9kB,SAAW,IAEtB8K,EAASuc,KAAUlpB,YACvB2M,EAASuc,GAAQvC,EAAUzX,aAC1BzO,EAAQyoB,EAAK9lB,MAAOoa,MAAO1L,IAAS,EACpCrR,EAAO+C,KAAM0lB,EAAK9lB,KAAM,MAAQ0O,IAAQxO,QAErCqJ,EAASuc,IACbvc,EAAQzL,KAAMylB,EAGXha,GAAQrJ,QACZqlB,EAAaznB,MAAOiC,KAAM2O,EAAK+U,SAAUla,IAW7C,MAJqBka,GAASvjB,OAAzBikB,GACJoB,EAAaznB,MAAOiC,KAAMC,KAAMyjB,SAAUA,EAASzlB,MAAOmmB,KAGpDoB,GAIRQ,MAAO,wHAAwHrd,MAAM,KAErIsd,YAEAC,UACCF,MAAO,4BAA4Brd,MAAM,KACzCqH,OAAQ,SAAUiT,EAAOkD,GAOxB,MAJoB,OAAflD,EAAMmD,QACVnD,EAAMmD,MAA6B,MAArBD,EAASE,SAAmBF,EAASE,SAAWF,EAASG,SAGjErD,IAITsD,YACCP,MAAO,uFAAuFrd,MAAM,KACpGqH,OAAQ,SAAUiT,EAAOkD,GACxB,GAAIK,GAAUnX,EAAKmO,EAClBxI,EAASmR,EAASnR,MAkBnB,OAfoB,OAAfiO,EAAMwD,OAAqC,MAApBN,EAASO,UACpCF,EAAWvD,EAAMhgB,OAAOxC,eAAiBvD,EACzCmS,EAAMmX,EAASppB,gBACfogB,EAAOgJ,EAAShJ,KAEhByF,EAAMwD,MAAQN,EAASO,SAAYrX,GAAOA,EAAIsX,YAAcnJ,GAAQA,EAAKmJ,YAAc,IAAQtX,GAAOA,EAAIuX,YAAcpJ,GAAQA,EAAKoJ,YAAc,GACnJ3D,EAAM4D,MAAQV,EAASW,SAAYzX,GAAOA,EAAI0X,WAAcvJ,GAAQA,EAAKuJ,WAAc,IAAQ1X,GAAOA,EAAI2X,WAAcxJ,GAAQA,EAAKwJ,WAAc,IAK9I/D,EAAMmD,OAASpR,IAAWnY,YAC/BomB,EAAMmD,MAAmB,EAATpR,EAAa,EAAe,EAATA,EAAa,EAAe,EAATA,EAAa,EAAI,GAGjEiO,IAITsC,IAAK,SAAUtC,GACd,GAAKA,EAAO3lB,EAAO8F,SAClB,MAAO6f,EAIR,IAAI9gB,GAAG0c,EAAM/b,EACZoB,EAAO+e,EAAM/e,KACb+iB,EAAgBhE,EAChBiE,EAAUjnB,KAAKgmB,SAAU/hB,EAEpBgjB,KACLjnB,KAAKgmB,SAAU/hB,GAASgjB,EACvBxE,EAAYhiB,KAAMwD,GAASjE,KAAKsmB,WAChC9D,EAAU/hB,KAAMwD,GAASjE,KAAKimB,aAGhCpjB,EAAOokB,EAAQlB,MAAQ/lB,KAAK+lB,MAAMnoB,OAAQqpB,EAAQlB,OAAU/lB,KAAK+lB,MAEjE/C,EAAQ,GAAI3lB,GAAOwnB,MAAOmC,GAE1B9kB,EAAIW,EAAK3C,MACT,OAAQgC,IACP0c,EAAO/b,EAAMX,GACb8gB,EAAOpE,GAASoI,EAAepI,EAehC,OAVMoE,GAAMhgB,SACXggB,EAAMhgB,OAAS/F,GAKe,IAA1B+lB,EAAMhgB,OAAOzC,WACjByiB,EAAMhgB,OAASggB,EAAMhgB,OAAOlC,YAGtBmmB,EAAQlX,OAAQkX,EAAQlX,OAAQiT,EAAOgE,GAAkBhE,GAGjEQ,SACC0D,MAEClC,UAAU,GAEX7Q,OAECrQ,QAAS,WACR,MAAK9D,QAAS8iB,KAAuB9iB,KAAKmU,OACzCnU,KAAKmU,SACE,GAFR,WAKD6P,aAAc,WAEfmD,MACCrjB,QAAS,WACR,MAAK9D,QAAS8iB,KAAuB9iB,KAAKmnB,MACzCnnB,KAAKmnB,QACE,GAFR,WAKDnD,aAAc,YAEfoD,OAECtjB,QAAS,WACR,MAAmB,aAAd9D,KAAKiE,MAAuBjE,KAAKonB,OAAS/pB,EAAOsJ,SAAU3G,KAAM,UACrEA,KAAKonB,SACE,GAFR,WAOD/B,SAAU,SAAUrC,GACnB,MAAO3lB,GAAOsJ,SAAUqc,EAAMhgB,OAAQ,OAIxCqkB,cACCxB,aAAc,SAAU7C,GAIlBA,EAAMpQ,SAAWhW,YACrBomB,EAAMgE,cAAcM,YAActE,EAAMpQ,WAM5C2U,SAAU,SAAUtjB,EAAMlE,EAAMijB,EAAOwE,GAItC,GAAI/iB,GAAIpH,EAAOoF,OACd,GAAIpF,GAAOwnB,MACX7B,GAEC/e,KAAMA,EACNwjB,aAAa,EACbT,kBAGGQ,GACJnqB,EAAO2lB,MAAMlf,QAASW,EAAG,KAAM1E,GAE/B1C,EAAO2lB,MAAMe,SAAS9iB,KAAMlB,EAAM0E,GAE9BA,EAAE2gB,sBACNpC,EAAMmC,mBAKT9nB,EAAOmnB,YAAc,SAAUzkB,EAAMkE,EAAM4f,GACrC9jB,EAAKN,qBACTM,EAAKN,oBAAqBwE,EAAM4f,GAAQ,IAI1CxmB,EAAOwnB,MAAQ,SAAUjiB,EAAKmjB,GAE7B,MAAO/lB,gBAAgB3C,GAAOwnB,OAKzBjiB,GAAOA,EAAIqB,MACfjE,KAAKgnB,cAAgBpkB,EACrB5C,KAAKiE,KAAOrB,EAAIqB,KAIhBjE,KAAKolB,mBAAuBxiB,EAAI8kB,kBAC/B9kB,EAAI+kB,mBAAqB/kB,EAAI+kB,oBAAwB/E,EAAaC,GAInE7iB,KAAKiE,KAAOrB,EAIRmjB,GACJ1oB,EAAOoF,OAAQzC,KAAM+lB,GAItB/lB,KAAK4nB,UAAYhlB,GAAOA,EAAIglB,WAAavqB,EAAO4K,MAGhDjI,KAAM3C,EAAO8F,UAAY,EAvBzB,WAJQ,GAAI9F,GAAOwnB,MAAOjiB,EAAKmjB,IAgChC1oB,EAAOwnB,MAAMllB,WACZylB,mBAAoBvC,EACpBqC,qBAAsBrC,EACtB8C,8BAA+B9C,EAE/BsC,eAAgB,WACf,GAAI1gB,GAAIzE,KAAKgnB,aAEbhnB,MAAKolB,mBAAqBxC,EAErBne,GAAKA,EAAE0gB,gBACX1gB,EAAE0gB,kBAGJS,gBAAiB,WAChB,GAAInhB,GAAIzE,KAAKgnB,aAEbhnB,MAAKklB,qBAAuBtC,EAEvBne,GAAKA,EAAEmhB,iBACXnhB,EAAEmhB,mBAGJiC,yBAA0B,WACzB7nB,KAAK2lB,8BAAgC/C,EACrC5iB,KAAK4lB,oBAMPvoB,EAAOmE,MACNsmB,WAAY,YACZC,WAAY,YACV,SAAUC,EAAM1C,GAClBjoB,EAAO2lB,MAAMQ,QAASwE,IACrBhE,aAAcsB,EACdrB,SAAUqB,EAEVzB,OAAQ,SAAUb,GACjB,GAAI1hB,GACH0B,EAAShD,KACTioB,EAAUjF,EAAMkF,cAChB3E,EAAYP,EAAMO,SASnB,SALM0E,GAAYA,IAAYjlB,IAAW3F,EAAOmM,SAAUxG,EAAQilB,MACjEjF,EAAM/e,KAAOsf,EAAUI,SACvBriB,EAAMiiB,EAAUhV,QAAQ1M,MAAO7B,KAAM8B,WACrCkhB,EAAM/e,KAAOqhB,GAEPhkB,MAOJjE,EAAOsL,QAAQsU,gBACpB5f,EAAOmE,MAAO2S,MAAO,UAAWgT,KAAM,YAAc,SAAUa,EAAM1C,GAGnE,GAAI6C,GAAW,EACd5Z,EAAU,SAAUyU,GACnB3lB,EAAO2lB,MAAMuE,SAAUjC,EAAKtC,EAAMhgB,OAAQ3F,EAAO2lB,MAAMsC,IAAKtC,IAAS,GAGvE3lB,GAAO2lB,MAAMQ,QAAS8B,IACrBlB,MAAO,WACc,IAAf+D,KACJlrB,EAASwL,iBAAkBuf,EAAMzZ,GAAS,IAG5CgW,SAAU,WACW,MAAb4D,GACNlrB,EAASwC,oBAAqBuoB,EAAMzZ,GAAS,OAOlDlR,EAAOsB,GAAG8D,QAET2lB,GAAI,SAAUlF,EAAOzkB,EAAUqG,EAAMnG,EAAiBgjB,GACrD,GAAI0G,GAAQpkB,CAGZ,IAAsB,gBAAVif,GAAqB,CAEP,gBAAbzkB,KAEXqG,EAAOA,GAAQrG,EACfA,EAAW7B,UAEZ,KAAMqH,IAAQif,GACbljB,KAAKooB,GAAInkB,EAAMxF,EAAUqG,EAAMoe,EAAOjf,GAAQ0d,EAE/C,OAAO3hB,MAmBR,GAhBa,MAAR8E,GAAsB,MAANnG,GAEpBA,EAAKF,EACLqG,EAAOrG,EAAW7B,WACD,MAAN+B,IACc,gBAAbF,IAEXE,EAAKmG,EACLA,EAAOlI,YAGP+B,EAAKmG,EACLA,EAAOrG,EACPA,EAAW7B,YAGR+B,KAAO,EACXA,EAAKkkB,MACC,KAAMlkB,EACZ,MAAOqB,KAaR,OAVa,KAAR2hB,IACJ0G,EAAS1pB,EACTA,EAAK,SAAUqkB,GAGd,MADA3lB,KAAS0G,IAAKif,GACPqF,EAAOxmB,MAAO7B,KAAM8B,YAG5BnD,EAAG8I,KAAO4gB,EAAO5gB,OAAU4gB,EAAO5gB,KAAOpK,EAAOoK,SAE1CzH,KAAKwB,KAAM,WACjBnE,EAAO2lB,MAAM7I,IAAKna,KAAMkjB,EAAOvkB,EAAImG,EAAMrG,MAG3CkjB,IAAK,SAAUuB,EAAOzkB,EAAUqG,EAAMnG,GACrC,MAAOqB,MAAKooB,GAAIlF,EAAOzkB,EAAUqG,EAAMnG,EAAI,IAE5CoF,IAAK,SAAUmf,EAAOzkB,EAAUE,GAC/B,GAAI4kB,GAAWtf,CACf,IAAKif,GAASA,EAAMiC,gBAAkBjC,EAAMK,UAQ3C,MANAA,GAAYL,EAAMK,UAClBlmB,EAAQ6lB,EAAMsC,gBAAiBzhB,IAC9Bwf,EAAUW,UAAYX,EAAUI,SAAW,IAAMJ,EAAUW,UAAYX,EAAUI,SACjFJ,EAAU9kB,SACV8kB,EAAUhV,SAEJvO,IAER,IAAsB,gBAAVkjB,GAAqB,CAEhC,IAAMjf,IAAQif,GACbljB,KAAK+D,IAAKE,EAAMxF,EAAUykB,EAAOjf,GAElC,OAAOjE,MAUR,OARKvB,KAAa,GAA6B,kBAAbA,MAEjCE,EAAKF,EACLA,EAAW7B,WAEP+B,KAAO,IACXA,EAAKkkB,GAEC7iB,KAAKwB,KAAK,WAChBnE,EAAO2lB,MAAM5d,OAAQpF,KAAMkjB,EAAOvkB,EAAIF,MAIxCqF,QAAS,SAAUG,EAAMa,GACxB,MAAO9E,MAAKwB,KAAK,WAChBnE,EAAO2lB,MAAMlf,QAASG,EAAMa,EAAM9E,SAGpCsoB,eAAgB,SAAUrkB,EAAMa,GAC/B,GAAI/E,GAAOC,KAAK,EAChB,OAAKD,GACG1C,EAAO2lB,MAAMlf,QAASG,EAAMa,EAAM/E,GAAM,GADhD,YAKF,IAAIwoB,GAAW,iBACdC,EAAe,iCACfC,EAAgBprB,EAAO8T,KAAKrR,MAAMgM,aAElC4c,GACCC,UAAU,EACVC,UAAU,EACVhJ,MAAM,EACNiJ,MAAM,EAGRxrB,GAAOsB,GAAG8D,QACTrC,KAAM,SAAU3B,GACf,GAAIyD,GACHZ,KACA2Y,EAAOja,KACPmC,EAAM8X,EAAK/Z,MAEZ,IAAyB,gBAAbzB,GACX,MAAOuB,MAAKoB,UAAW/D,EAAQoB,GAAWsR,OAAO,WAChD,IAAM7N,EAAI,EAAOC,EAAJD,EAASA,IACrB,GAAK7E,EAAOmM,SAAUyQ,EAAM/X,GAAKlC,MAChC,OAAO,IAMX,KAAMkC,EAAI,EAAOC,EAAJD,EAASA,IACrB7E,EAAO+C,KAAM3B,EAAUwb,EAAM/X,GAAKZ,EAMnC,OAFAA,GAAMtB,KAAKoB,UAAWe,EAAM,EAAI9E,EAAO0b,OAAQzX,GAAQA,GACvDA,EAAI7C,SAAWuB,KAAKvB,SAAWuB,KAAKvB,SAAW,IAAMA,EAAWA,EACzD6C,GAGRuS,IAAK,SAAU7Q,GACd,GAAI8lB,GAAUzrB,EAAQ2F,EAAQhD,MAC7BoH,EAAI0hB,EAAQ5oB,MAEb,OAAOF,MAAK+P,OAAO,WAClB,GAAI7N,GAAI,CACR,MAAYkF,EAAJlF,EAAOA,IACd,GAAK7E,EAAOmM,SAAUxJ,KAAM8oB,EAAQ5mB,IACnC,OAAO,KAMXwR,IAAK,SAAUjV,GACd,MAAOuB,MAAKoB,UAAW2nB,GAAO/oB,KAAMvB,OAAgB,KAGrDsR,OAAQ,SAAUtR,GACjB,MAAOuB,MAAKoB,UAAW2nB,GAAO/oB,KAAMvB,OAAgB,KAGrDuqB,GAAI,SAAUvqB,GACb,QAASsqB,GACR/oB,KAIoB,gBAAbvB,IAAyBgqB,EAAchoB,KAAMhC,GACnDpB,EAAQoB,GACRA,OACD,GACCyB,QAGH+oB,QAAS,SAAUpX,EAAWnT,GAC7B,GAAIgQ,GACHxM,EAAI,EACJkF,EAAIpH,KAAKE,OACTuT,KACAyV,EAAQT,EAAchoB,KAAMoR,IAAoC,gBAAdA,GACjDxU,EAAQwU,EAAWnT,GAAWsB,KAAKtB,SACnC,CAEF,MAAY0I,EAAJlF,EAAOA,IACd,IAAMwM,EAAM1O,KAAKkC,GAAIwM,GAAOA,IAAQhQ,EAASgQ,EAAMA,EAAI5N,WAEtD,GAAoB,GAAf4N,EAAInO,WAAkB2oB,EAC1BA,EAAI9O,MAAM1L,GAAO,GAGA,IAAjBA,EAAInO,UACHlD,EAAO+C,KAAKgQ,gBAAgB1B,EAAKmD,IAAc,CAEhDnD,EAAM+E,EAAQ3V,KAAM4Q,EACpB,OAKH,MAAO1O,MAAKoB,UAAWqS,EAAQvT,OAAS,EAAI7C,EAAO0b,OAAQtF,GAAYA,IAKxE2G,MAAO,SAAUra,GAGhB,MAAMA,GAKe,gBAATA,GACJ9B,EAAagD,KAAM5D,EAAQ0C,GAAQC,KAAM,IAI1C/B,EAAagD,KAAMjB,KAGzBD,EAAKH,OAASG,EAAM,GAAMA,GAZjBC,KAAM,IAAOA,KAAM,GAAIc,WAAed,KAAK+B,QAAQonB,UAAUjpB,OAAS,IAgBjFia,IAAK,SAAU1b,EAAUC,GACxB,GAAIigB,GAA0B,gBAAblgB,GACfpB,EAAQoB,EAAUC,GAClBrB,EAAO0D,UAAWtC,GAAYA,EAAS8B,UAAa9B,GAAaA,GAClEY,EAAMhC,EAAOgD,MAAOL,KAAKkB,MAAOyd,EAEjC,OAAO3e,MAAKoB,UAAW/D,EAAO0b,OAAO1Z,KAGtC+pB,QAAS,SAAU3qB,GAClB,MAAOuB,MAAKma,IAAiB,MAAZ1b,EAChBuB,KAAKuB,WAAavB,KAAKuB,WAAWwO,OAAOtR,MAK5C,SAAS4qB,GAAS3a,EAAKuD,GACtB,OAASvD,EAAMA,EAAIuD,KAA0B,IAAjBvD,EAAInO,UAEhC,MAAOmO,GAGRrR,EAAOmE,MACN6N,OAAQ,SAAUtP,GACjB,GAAIsP,GAAStP,EAAKe,UAClB,OAAOuO,IAA8B,KAApBA,EAAO9O,SAAkB8O,EAAS,MAEpDia,QAAS,SAAUvpB,GAClB,MAAO1C,GAAO4U,IAAKlS,EAAM,eAE1BwpB,aAAc,SAAUxpB,EAAMmC,EAAGsnB,GAChC,MAAOnsB,GAAO4U,IAAKlS,EAAM,aAAcypB,IAExC5J,KAAM,SAAU7f,GACf,MAAOspB,GAAStpB,EAAM,gBAEvB8oB,KAAM,SAAU9oB,GACf,MAAOspB,GAAStpB,EAAM,oBAEvB0pB,QAAS,SAAU1pB,GAClB,MAAO1C,GAAO4U,IAAKlS,EAAM,gBAE1BopB,QAAS,SAAUppB,GAClB,MAAO1C,GAAO4U,IAAKlS,EAAM,oBAE1B2pB,UAAW,SAAU3pB,EAAMmC,EAAGsnB,GAC7B,MAAOnsB,GAAO4U,IAAKlS,EAAM,cAAeypB,IAEzCG,UAAW,SAAU5pB,EAAMmC,EAAGsnB,GAC7B,MAAOnsB,GAAO4U,IAAKlS,EAAM,kBAAmBypB,IAE7CI,SAAU,SAAU7pB,GACnB,MAAO1C,GAAOgsB,SAAWtpB,EAAKe,gBAAmB8O,WAAY7P,IAE9D4oB,SAAU,SAAU5oB,GACnB,MAAO1C,GAAOgsB,QAAStpB,EAAK6P,aAE7BgZ,SAAU,SAAU7oB,GACnB,MAAOA,GAAK8pB,iBAAmBxsB,EAAOgD,SAAWN,EAAKsF,cAErD,SAAU1C,EAAMhE,GAClBtB,EAAOsB,GAAIgE,GAAS,SAAU6mB,EAAO/qB,GACpC,GAAIgV,GAAUpW,EAAOgF,IAAKrC,KAAMrB,EAAI6qB,EAsBpC,OApB0B,UAArB7mB,EAAK3E,MAAO,MAChBS,EAAW+qB,GAGP/qB,GAAgC,gBAAbA,KACvBgV,EAAUpW,EAAO0S,OAAQtR,EAAUgV,IAG/BzT,KAAKE,OAAS,IAEZwoB,EAAkB/lB,IACvBtF,EAAO0b,OAAQtF,GAIX+U,EAAa/nB,KAAMkC,IACvB8Q,EAAQqW,WAIH9pB,KAAKoB,UAAWqS,MAIzBpW,EAAOoF,QACNsN,OAAQ,SAAUoB,EAAM9P,EAAOqS,GAC9B,GAAI3T,GAAOsB,EAAO,EAMlB,OAJKqS,KACJvC,EAAO,QAAUA,EAAO,KAGD,IAAjB9P,EAAMnB,QAAkC,IAAlBH,EAAKQ,SACjClD,EAAO+C,KAAKgQ,gBAAiBrQ,EAAMoR,IAAWpR,MAC9C1C,EAAO+C,KAAKmJ,QAAS4H,EAAM9T,EAAOgK,KAAMhG,EAAO,SAAUtB,GACxD,MAAyB,KAAlBA,EAAKQ,aAIf0R,IAAK,SAAUlS,EAAMkS,EAAKuX,GACzB,GAAI/V,MACHsW,EAAWP,IAAU5sB,SAEtB,QAASmD,EAAOA,EAAMkS,KAA4B,IAAlBlS,EAAKQ,SACpC,GAAuB,IAAlBR,EAAKQ,SAAiB,CAC1B,GAAKwpB,GAAY1sB,EAAQ0C,GAAOipB,GAAIQ,GACnC,KAED/V,GAAQ3V,KAAMiC,GAGhB,MAAO0T,IAGR4V,QAAS,SAAUW,EAAGjqB,GACrB,GAAI0T,KAEJ,MAAQuW,EAAGA,EAAIA,EAAEnb,YACI,IAAfmb,EAAEzpB,UAAkBypB,IAAMjqB,GAC9B0T,EAAQ3V,KAAMksB,EAIhB,OAAOvW,KAKT,SAASsV,IAAQ3X,EAAU6Y,EAAWvW,GACrC,GAAKrW,EAAOsD,WAAYspB,GACvB,MAAO5sB,GAAOgK,KAAM+J,EAAU,SAAUrR,EAAMmC,GAE7C,QAAS+nB,EAAUhpB,KAAMlB,EAAMmC,EAAGnC,KAAW2T,GAK/C,IAAKuW,EAAU1pB,SACd,MAAOlD,GAAOgK,KAAM+J,EAAU,SAAUrR,GACvC,MAASA,KAASkqB,IAAgBvW,GAKpC,IAA0B,gBAAduW,GAAyB,CACpC,GAAK1B,EAAS9nB,KAAMwpB,GACnB,MAAO5sB,GAAO0S,OAAQka,EAAW7Y,EAAUsC,EAG5CuW,GAAY5sB,EAAO0S,OAAQka,EAAW7Y,GAGvC,MAAO/T,GAAOgK,KAAM+J,EAAU,SAAUrR,GACvC,MAAS9B,GAAagD,KAAMgpB,EAAWlqB,IAAU,IAAQ2T,IAG3D,GAAIwW,IAAY,0EACfC,GAAW,YACXC,GAAQ,YACRC,GAAe,0BACfC,GAA8B,wBAE9BC,GAAW,oCACXC,GAAc,4BACdC,GAAoB,cACpBC,GAAe,2CAGfC,IAGCjJ,QAAU,EAAG,+BAAgC,aAE7CkJ,OAAS,EAAG,UAAW,YACvBC,KAAO,EAAG,oBAAqB,uBAC/BC,IAAM,EAAG,iBAAkB,oBAC3BC,IAAM,EAAG,qBAAsB,yBAE/B1F,UAAY,EAAG,GAAI,IAIrBsF,IAAQK,SAAWL,GAAQjJ,OAE3BiJ,GAAQM,MAAQN,GAAQO,MAAQP,GAAQQ,SAAWR,GAAQS,QAAUT,GAAQC,MAC7ED,GAAQU,GAAKV,GAAQI,GAErB1tB,EAAOsB,GAAG8D,QACT4D,KAAM,SAAUQ,GACf,MAAOxJ,GAAOsK,OAAQ3H,KAAM,SAAU6G,GACrC,MAAOA,KAAUjK,UAChBS,EAAOgJ,KAAMrG,MACbA,KAAK6U,QAAQyW,QAAUtrB,KAAM,IAAOA,KAAM,GAAIQ,eAAiBvD,GAAWsuB,eAAgB1kB,KACzF,KAAMA,EAAO/E,UAAU5B,SAG3BorB,OAAQ,WACP,MAAOtrB,MAAKwrB,SAAU1pB,UAAW,SAAU/B,GAC1C,GAAuB,IAAlBC,KAAKO,UAAoC,KAAlBP,KAAKO,UAAqC,IAAlBP,KAAKO,SAAiB,CACzE,GAAIyC,GAASyoB,GAAoBzrB,KAAMD,EACvCiD,GAAOuD,YAAaxG,OAKvB2rB,QAAS,WACR,MAAO1rB,MAAKwrB,SAAU1pB,UAAW,SAAU/B,GAC1C,GAAuB,IAAlBC,KAAKO,UAAoC,KAAlBP,KAAKO,UAAqC,IAAlBP,KAAKO,SAAiB,CACzE,GAAIyC,GAASyoB,GAAoBzrB,KAAMD,EACvCiD,GAAO2oB,aAAc5rB,EAAMiD,EAAO4M,gBAKrCgc,OAAQ,WACP,MAAO5rB,MAAKwrB,SAAU1pB,UAAW,SAAU/B,GACrCC,KAAKc,YACTd,KAAKc,WAAW6qB,aAAc5rB,EAAMC,SAKvC6rB,MAAO,WACN,MAAO7rB,MAAKwrB,SAAU1pB,UAAW,SAAU/B,GACrCC,KAAKc,YACTd,KAAKc,WAAW6qB,aAAc5rB,EAAMC,KAAK6O,gBAM5CzJ,OAAQ,SAAU3G,EAAUqtB,GAC3B,GAAI/rB,GACHsB,EAAQ5C,EAAWpB,EAAO0S,OAAQtR,EAAUuB,MAASA,KACrDkC,EAAI,CAEL,MAA6B,OAApBnC,EAAOsB,EAAMa,IAAaA,IAC5B4pB,GAA8B,IAAlB/rB,EAAKQ,UACtBlD,EAAO0uB,UAAWC,GAAQjsB,IAGtBA,EAAKe,aACJgrB,GAAYzuB,EAAOmM,SAAUzJ,EAAKS,cAAeT,IACrDksB,GAAeD,GAAQjsB,EAAM,WAE9BA,EAAKe,WAAW0F,YAAazG,GAI/B,OAAOC,OAGR6U,MAAO,WACN,GAAI9U,GACHmC,EAAI,CAEL,MAA4B,OAAnBnC,EAAOC,KAAKkC,IAAaA,IACV,IAAlBnC,EAAKQ,WAGTlD,EAAO0uB,UAAWC,GAAQjsB,GAAM,IAGhCA,EAAK4R,YAAc,GAIrB,OAAO3R,OAGR+C,MAAO,SAAUmpB,EAAeC,GAI/B,MAHAD,GAAiC,MAAjBA,GAAwB,EAAQA,EAChDC,EAAyC,MAArBA,EAA4BD,EAAgBC,EAEzDnsB,KAAKqC,IAAK,WAChB,MAAOhF,GAAO0F,MAAO/C,KAAMksB,EAAeC,MAI5CC,KAAM,SAAUvlB,GACf,MAAOxJ,GAAOsK,OAAQ3H,KAAM,SAAU6G,GACrC,GAAI9G,GAAOC,KAAM,OAChBkC,EAAI,EACJkF,EAAIpH,KAAKE,MAEV,IAAK2G,IAAUjK,WAA+B,IAAlBmD,EAAKQ,SAChC,MAAOR,GAAK4P,SAIb,IAAsB,gBAAV9I,KAAuBwjB,GAAa5pB,KAAMoG,KACpD8jB,IAAWR,GAAShqB,KAAM0G,KAAa,GAAI,KAAQ,GAAID,eAAkB,CAE1EC,EAAQA,EAAMvD,QAAS4mB,GAAW,YAElC,KACC,KAAY9iB,EAAJlF,EAAOA,IACdnC,EAAOC,KAAMkC,OAGU,IAAlBnC,EAAKQ,WACTlD,EAAO0uB,UAAWC,GAAQjsB,GAAM,IAChCA,EAAK4P,UAAY9I,EAInB9G,GAAO,EAGN,MAAO0E,KAGL1E,GACJC,KAAK6U,QAAQyW,OAAQzkB,IAEpB,KAAMA,EAAO/E,UAAU5B,SAG3BmsB,YAAa,WACZ,GAEC3qB,GAAOrE,EAAOgF,IAAKrC,KAAM,SAAUD,GAClC,OAASA,EAAK8O,YAAa9O,EAAKe,cAEjCoB,EAAI,CAmBL,OAhBAlC,MAAKwrB,SAAU1pB,UAAW,SAAU/B,GACnC,GAAI6f,GAAOle,EAAMQ,KAChBmN,EAAS3N,EAAMQ,IAEXmN,KAECuQ,GAAQA,EAAK9e,aAAeuO,IAChCuQ,EAAO5f,KAAK6O,aAEbxR,EAAQ2C,MAAOoF,SACfiK,EAAOsc,aAAc5rB,EAAM6f,MAG1B,GAGI1d,EAAIlC,KAAOA,KAAKoF,UAGxBknB,OAAQ,SAAU7tB,GACjB,MAAOuB,MAAKoF,OAAQ3G,GAAU,IAG/B+sB,SAAU,SAAU9pB,EAAMD,EAAU8qB,GAGnC7qB,EAAO/D,EAAYkE,SAAWH,EAE9B,IAAI0a,GAAUra,EAAOkD,EAASunB,EAAYrd,EAAMC,EAC/ClN,EAAI,EACJkF,EAAIpH,KAAKE,OACTye,EAAM3e,KACNysB,EAAWrlB,EAAI,EACfP,EAAQnF,EAAM,GACdf,EAAatD,EAAOsD,WAAYkG,EAGjC,IAAKlG,KAAsB,GAALyG,GAA2B,gBAAVP,IAAsBxJ,EAAOsL,QAAQqU,aAAeuN,GAAS9pB,KAAMoG,GACzG,MAAO7G,MAAKwB,KAAK,SAAU4Y,GAC1B,GAAIH,GAAO0E,EAAI3c,GAAIoY,EACdzZ,KACJe,EAAM,GAAMmF,EAAM5F,KAAMjB,KAAMoa,EAAOH,EAAKmS,SAE3CnS,EAAKuR,SAAU9pB,EAAMD,EAAU8qB,IAIjC,IAAKnlB,IACJgV,EAAW/e,EAAO8H,cAAezD,EAAM1B,KAAM,GAAIQ,eAAe,GAAQ+rB,GAAqBvsB,MAC7F+B,EAAQqa,EAASxM,WAEmB,IAA/BwM,EAAS/W,WAAWnF,SACxBkc,EAAWra,GAGPA,GAAQ,CAMZ,IALAkD,EAAU5H,EAAOgF,IAAK2pB,GAAQ5P,EAAU,UAAYsQ,IACpDF,EAAavnB,EAAQ/E,OAITkH,EAAJlF,EAAOA,IACdiN,EAAOiN,EAEFla,IAAMuqB,IACVtd,EAAO9R,EAAO0F,MAAOoM,GAAM,GAAM,GAG5Bqd,GAGJnvB,EAAOgD,MAAO4E,EAAS+mB,GAAQ7c,EAAM,YAIvC1N,EAASR,KAAMjB,KAAMkC,GAAKiN,EAAMjN,EAGjC,IAAKsqB,EAOJ,IANApd,EAAMnK,EAASA,EAAQ/E,OAAS,GAAIM,cAGpCnD,EAAOgF,IAAK4C,EAAS0nB,IAGfzqB,EAAI,EAAOsqB,EAAJtqB,EAAgBA,IAC5BiN,EAAOlK,EAAS/C,GACXsoB,GAAY/pB,KAAM0O,EAAKlL,MAAQ,MAClC+Z,EAAUrW,OAAQwH,EAAM,eAAkB9R,EAAOmM,SAAU4F,EAAKD,KAE5DA,EAAKvM,IAETvF,EAAOuvB,SAAUzd,EAAKvM,KAEtBvF,EAAO2I,WAAYmJ,EAAKwC,YAAYrO,QAASonB,GAAc,MAQjE,MAAO1qB,SAIT3C,EAAOmE,MACNqrB,SAAU,SACVC,UAAW,UACXnB,aAAc,SACdoB,YAAa,QACbC,WAAY,eACV,SAAUrqB,EAAMujB,GAClB7oB,EAAOsB,GAAIgE,GAAS,SAAUlE,GAC7B,GAAI4C,GACHC,KACA2rB,EAAS5vB,EAAQoB,GACjBwD,EAAOgrB,EAAO/sB,OAAS,EACvBgC,EAAI,CAEL,MAAaD,GAALC,EAAWA,IAClBb,EAAQa,IAAMD,EAAOjC,KAAOA,KAAK+C,OAAO,GACxC1F,EAAQ4vB,EAAQ/qB,IAAOgkB,GAAY7kB,GAInCxD,EAAUgE,MAAOP,EAAKD,EAAMH,MAG7B,OAAOlB,MAAKoB,UAAWE,MAIzBjE,EAAOoF,QACNM,MAAO,SAAUhD,EAAMmsB,EAAeC,GACrC,GAAIjqB,GAAGkF,EAAG8lB,EAAaC,EACtBpqB,EAAQhD,EAAK8c,WAAW,GACxBuQ,EAAS/vB,EAAOmM,SAAUzJ,EAAKS,cAAeT,EAI/C,MAAM1C,EAAOsL,QAAQiU,gBAAsC,IAAlB7c,EAAKQ,UAAoC,KAAlBR,EAAKQ,UAAsBlD,EAAO2b,SAAUjZ,IAM3G,IAHAotB,EAAenB,GAAQjpB,GACvBmqB,EAAclB,GAAQjsB,GAEhBmC,EAAI,EAAGkF,EAAI8lB,EAAYhtB,OAAYkH,EAAJlF,EAAOA,IAC3CmrB,GAAUH,EAAahrB,GAAKirB,EAAcjrB,GAK5C,IAAKgqB,EACJ,GAAKC,EAIJ,IAHAe,EAAcA,GAAelB,GAAQjsB,GACrCotB,EAAeA,GAAgBnB,GAAQjpB,GAEjCb,EAAI,EAAGkF,EAAI8lB,EAAYhtB,OAAYkH,EAAJlF,EAAOA,IAC3CorB,GAAgBJ,EAAahrB,GAAKirB,EAAcjrB,QAGjDorB,IAAgBvtB,EAAMgD,EAWxB,OANAoqB,GAAenB,GAAQjpB,EAAO,UACzBoqB,EAAajtB,OAAS,GAC1B+rB,GAAekB,GAAeC,GAAUpB,GAAQjsB,EAAM,WAIhDgD,GAGRoC,cAAe,SAAU9D,EAAO3C,EAASuG,EAASsoB,GACjD,GAAIxtB,GAAM4F,EAAKuK,EAAKsd,EAAMhkB,EAAUpH,EACnCF,EAAI,EACJkF,EAAI/F,EAAMnB,OACVkc,EAAW1d,EAAQ2d,yBACnBoR,IAED,MAAYrmB,EAAJlF,EAAOA,IAGd,GAFAnC,EAAOsB,EAAOa,GAETnC,GAAiB,IAATA,EAGZ,GAA6B,WAAxB1C,EAAO4G,KAAMlE,GAGjB1C,EAAOgD,MAAOotB,EAAO1tB,EAAKQ,UAAaR,GAASA,OAG1C,IAAMqqB,GAAM3pB,KAAMV,GAIlB,CACN4F,EAAMA,GAAOyW,EAAS7V,YAAa7H,EAAQwG,cAAc,QAGzDgL,GAAQia,GAAShqB,KAAMJ,KAAW,GAAI,KAAO,GAAI6G,cACjD4mB,EAAO7C,GAASza,IAASya,GAAQtF,SACjC1f,EAAIgK,UAAY6d,EAAM,GAAMztB,EAAKuD,QAAS4mB,GAAW,aAAgBsD,EAAM,GAG3EprB,EAAIorB,EAAM,EACV,OAAQprB,IACPuD,EAAMA,EAAI0N,SAKXhW,GAAOgD,MAAOotB,EAAO9nB,EAAIN,YAGzBM,EAAMyW,EAASxM,WAIfjK,EAAIgM,YAAc,OA1BlB8b,GAAM3vB,KAAMY,EAAQ6sB,eAAgBxrB,GAgCvCqc,GAASzK,YAAc,GAEvBzP,EAAI,CACJ,OAASnC,EAAO0tB,EAAOvrB,KAItB,KAAKqrB,GAAmD,KAAtClwB,EAAO6J,QAASnH,EAAMwtB,MAIxC/jB,EAAWnM,EAAOmM,SAAUzJ,EAAKS,cAAeT,GAGhD4F,EAAMqmB,GAAQ5P,EAAS7V,YAAaxG,GAAQ,UAGvCyJ,GACJyiB,GAAetmB,GAIXV,GAAU,CACd7C,EAAI,CACJ,OAASrC,EAAO4F,EAAKvD,KACfooB,GAAY/pB,KAAMV,EAAKkE,MAAQ,KACnCgB,EAAQnH,KAAMiC,GAMlB,MAAOqc,IAGR2P,UAAW,SAAU1qB,GACpB,GAAIyD,GAAM/E,EAAMsjB,EAAQpf,EAAM2D,EAAKxF,EAClCohB,EAAUnmB,EAAO2lB,MAAMQ,QACvBthB,EAAI,CAEL,OAASnC,EAAOsB,EAAOa,MAAStF,UAAWsF,IAAM,CAChD,GAAKic,EAAKG,QAASve,KAClB6H,EAAM7H,EAAMie,EAAU7a,SAEjByE,IAAQ9C,EAAOkZ,EAAUjQ,MAAOnG,KAAS,CAE7C,GADAyb,EAASpc,OAAO6G,KAAMhJ,EAAKue,YACtBA,EAAOnjB,OACX,IAAMkC,EAAI,GAAI6B,EAAOof,EAAOjhB,MAAQxF,UAAWwF,IACzCohB,EAASvf,GACb5G,EAAO2lB,MAAM5d,OAAQrF,EAAMkE,GAI3B5G,EAAOmnB,YAAazkB,EAAMkE,EAAMa,EAAK+e,OAInC7F,GAAUjQ,MAAOnG,UAEdoW,GAAUjQ,MAAOnG,SAKpBmW,GAAUhQ,MAAOhO,EAAMge,EAAU5a,YAI1CypB,SAAU,SAAUc,GACnB,MAAOrwB,GAAOswB,MACbD,IAAKA,EACLzpB,KAAM,MACN2pB,SAAU,SACVC,OAAO,EACP5K,QAAQ,EACR6K,UAAU,MAOb,SAASrC,IAAoB1rB,EAAMguB,GAClC,MAAO1wB,GAAOsJ,SAAU5G,EAAM,UAC7B1C,EAAOsJ,SAA+B,IAArBonB,EAAQxtB,SAAiBwtB,EAAUA,EAAQne,WAAY,MAExE7P,EAAK+F,qBAAqB,SAAS,IAClC/F,EAAKwG,YAAaxG,EAAKS,cAAc0E,cAAc,UACpDnF,EAIF,QAAS2sB,IAAe3sB,GAEvB,MADAA,GAAKkE,MAAsC,OAA9BlE,EAAKuN,aAAa,SAAoB,IAAMvN,EAAKkE,KACvDlE,EAER,QAAS4sB,IAAe5sB,GACvB,GAAID,GAAQ2qB,GAAkBtqB,KAAMJ,EAAKkE,KAQzC,OANKnE,GACJC,EAAKkE,KAAOnE,EAAO,GAEnBC,EAAK6N,gBAAgB,QAGf7N,EAIR,QAASksB,IAAe5qB,EAAO2sB,GAC9B,GAAI5mB,GAAI/F,EAAMnB,OACbgC,EAAI,CAEL,MAAYkF,EAAJlF,EAAOA,IACd8b,EAAUW,IACTtd,EAAOa,GAAK,cAAe8rB,GAAehQ,EAAU9c,IAAK8sB,EAAa9rB,GAAK,eAK9E,QAASorB,IAAgB1qB,EAAKqrB,GAC7B,GAAI/rB,GAAGkF,EAAGnD,EAAMiqB,EAAUC,EAAUC,EAAUC,EAAUhL,CAExD,IAAuB,IAAlB4K,EAAK1tB,SAAV,CAKA,GAAKyd,EAAUe,QAASnc,KACvBsrB,EAAWlQ,EAAUrW,OAAQ/E,GAC7BurB,EAAWnQ,EAAUW,IAAKsP,EAAMC,GAChC7K,EAAS6K,EAAS7K,QAEJ,OACN8K,GAAStK,OAChBsK,EAAS9K,SAET,KAAMpf,IAAQof,GACb,IAAMnhB,EAAI,EAAGkF,EAAIic,EAAQpf,GAAO/D,OAAYkH,EAAJlF,EAAOA,IAC9C7E,EAAO2lB,MAAM7I,IAAK8T,EAAMhqB,EAAMof,EAAQpf,GAAQ/B,IAO7C6b,EAAUgB,QAASnc,KACvBwrB,EAAWrQ,EAAUpW,OAAQ/E,GAC7ByrB,EAAWhxB,EAAOoF,UAAY2rB,GAE9BrQ,EAAUY,IAAKsP,EAAMI,KAKvB,QAASrC,IAAQttB,EAASwR,GACzB,GAAI5O,GAAM5C,EAAQoH,qBAAuBpH,EAAQoH,qBAAsBoK,GAAO,KAC5ExR,EAAQgP,iBAAmBhP,EAAQgP,iBAAkBwC,GAAO,OAG9D,OAAOA,KAAQtT,WAAasT,GAAO7S,EAAOsJ,SAAUjI,EAASwR,GAC5D7S,EAAOgD,OAAS3B,GAAW4C,GAC3BA,EAIF,QAAS+rB,IAAUzqB,EAAKqrB,GACvB,GAAItnB,GAAWsnB,EAAKtnB,SAASC,aAGX,WAAbD,GAAwB2jB,GAA4B7pB,KAAMmC,EAAIqB,MAClEgqB,EAAKvZ,QAAU9R,EAAI8R,SAGK,UAAb/N,GAAqC,aAAbA,KACnCsnB,EAAKnV,aAAelW,EAAIkW,cAG1Bzb,EAAOsB,GAAG8D,QACT6rB,QAAS,SAAUlC,GAClB,GAAIoB,EAEJ,OAAKnwB,GAAOsD,WAAYyrB,GAChBpsB,KAAKwB,KAAK,SAAUU,GAC1B7E,EAAQ2C,MAAOsuB,QAASlC,EAAKnrB,KAAKjB,KAAMkC,OAIrClC,KAAM,KAGVwtB,EAAOnwB,EAAQ+uB,EAAMpsB,KAAM,GAAIQ,eAAgBwB,GAAI,GAAIe,OAAO,GAEzD/C,KAAM,GAAIc,YACd0sB,EAAK7B,aAAc3rB,KAAM,IAG1BwtB,EAAKnrB,IAAI,WACR,GAAItC,GAAOC,IAEX,OAAQD,EAAKwuB,kBACZxuB,EAAOA,EAAKwuB,iBAGb,OAAOxuB,KACLurB,OAAQtrB,OAGLA,OAGRwuB,UAAW,SAAUpC,GACpB,MAAK/uB,GAAOsD,WAAYyrB,GAChBpsB,KAAKwB,KAAK,SAAUU,GAC1B7E,EAAQ2C,MAAOwuB,UAAWpC,EAAKnrB,KAAKjB,KAAMkC,MAIrClC,KAAKwB,KAAK,WAChB,GAAIyY,GAAO5c,EAAQ2C,MAClB4oB,EAAW3O,EAAK2O,UAEZA,GAAS1oB,OACb0oB,EAAS0F,QAASlC,GAGlBnS,EAAKqR,OAAQc,MAKhBoB,KAAM,SAAUpB,GACf,GAAIzrB,GAAatD,EAAOsD,WAAYyrB,EAEpC,OAAOpsB,MAAKwB,KAAK,SAAUU,GAC1B7E,EAAQ2C,MAAOsuB,QAAS3tB,EAAayrB,EAAKnrB,KAAKjB,KAAMkC,GAAKkqB,MAI5DqC,OAAQ,WACP,MAAOzuB,MAAKqP,SAAS7N,KAAK,WACnBnE,EAAOsJ,SAAU3G,KAAM,SAC5B3C,EAAQ2C,MAAOqsB,YAAarsB,KAAKqF,cAEhC/C,QAGL,IAAIosB,IAAQC,GAGXC,GAAe,4BACfC,GAAU,UACVC,GAAgB/jB,OAAQ,KAAOlM,EAAY,SAAU,KACrDkwB,GAAgBhkB,OAAQ,KAAOlM,EAAY,kBAAmB,KAC9DmwB,GAAcjkB,OAAQ,YAAclM,EAAY,IAAK,KACrDowB,IAAgBC,KAAM,SAEtBC,IAAYC,SAAU,WAAYC,WAAY,SAAUC,QAAS,SACjEC,IACCC,cAAe,EACfC,WAAY,KAGbC,IAAc,MAAO,QAAS,SAAU,QACxCC,IAAgB,SAAU,IAAK,MAAO,KAGvC,SAASC,IAAgBvnB,EAAO1F,GAG/B,GAAKA,IAAQ0F,GACZ,MAAO1F,EAIR,IAAIktB,GAAUltB,EAAK1C,OAAO,GAAGV,cAAgBoD,EAAK3E,MAAM,GACvD8xB,EAAWntB,EACXT,EAAIytB,GAAYzvB,MAEjB,OAAQgC,IAEP,GADAS,EAAOgtB,GAAaztB,GAAM2tB,EACrBltB,IAAQ0F,GACZ,MAAO1F,EAIT,OAAOmtB,GAGR,QAASC,IAAUhwB,EAAMiwB,GAIxB,MADAjwB,GAAOiwB,GAAMjwB,EAC4B,SAAlC1C,EAAO4yB,IAAKlwB,EAAM,aAA2B1C,EAAOmM,SAAUzJ,EAAKS,cAAeT,GAK1F,QAASmwB,IAAWnwB,GACnB,MAAOpD,GAAOihB,iBAAkB7d,EAAM,MAGvC,QAASowB,IAAU/e,EAAUgf,GAC5B,GAAId,GAASvvB,EAAMswB,EAClBtU,KACA3B,EAAQ,EACRla,EAASkR,EAASlR,MAEnB,MAAgBA,EAARka,EAAgBA,IACvBra,EAAOqR,EAAUgJ,GACXra,EAAKsI,QAIX0T,EAAQ3B,GAAU4D,EAAU9c,IAAKnB,EAAM,cACvCuvB,EAAUvvB,EAAKsI,MAAMinB,QAChBc,GAGErU,EAAQ3B,IAAuB,SAAZkV,IACxBvvB,EAAKsI,MAAMinB,QAAU,IAMM,KAAvBvvB,EAAKsI,MAAMinB,SAAkBS,GAAUhwB,KAC3Cgc,EAAQ3B,GAAU4D,EAAUrW,OAAQ5H,EAAM,aAAcuwB,GAAmBvwB,EAAK4G,aAI3EoV,EAAQ3B,KACbiW,EAASN,GAAUhwB,IAEduvB,GAAuB,SAAZA,IAAuBe,IACtCrS,EAAUW,IAAK5e,EAAM,aAAcswB,EAASf,EAAUjyB,EAAO4yB,IAAIlwB,EAAM,aAQ3E,KAAMqa,EAAQ,EAAWla,EAARka,EAAgBA,IAChCra,EAAOqR,EAAUgJ,GACXra,EAAKsI,QAGL+nB,GAA+B,SAAvBrwB,EAAKsI,MAAMinB,SAA6C,KAAvBvvB,EAAKsI,MAAMinB,UACzDvvB,EAAKsI,MAAMinB,QAAUc,EAAOrU,EAAQ3B,IAAW,GAAK,QAItD,OAAOhJ,GAGR/T,EAAOsB,GAAG8D,QACTwtB,IAAK,SAAUttB,EAAMkE,GACpB,MAAOxJ,GAAOsK,OAAQ3H,KAAM,SAAUD,EAAM4C,EAAMkE,GACjD,GAAI0pB,GAAQpuB,EACXE,KACAH,EAAI,CAEL,IAAK7E,EAAO6F,QAASP,GAAS,CAI7B,IAHA4tB,EAASL,GAAWnwB,GACpBoC,EAAMQ,EAAKzC,OAECiC,EAAJD,EAASA,IAChBG,EAAKM,EAAMT,IAAQ7E,EAAO4yB,IAAKlwB,EAAM4C,EAAMT,IAAK,EAAOquB,EAGxD,OAAOluB,GAGR,MAAOwE,KAAUjK,UAChBS,EAAOgL,MAAOtI,EAAM4C,EAAMkE,GAC1BxJ,EAAO4yB,IAAKlwB,EAAM4C,IACjBA,EAAMkE,EAAO/E,UAAU5B,OAAS,IAEpCkwB,KAAM,WACL,MAAOD,IAAUnwB,MAAM,IAExBwwB,KAAM,WACL,MAAOL,IAAUnwB,OAElBywB,OAAQ,SAAU/V,GACjB,MAAsB,iBAAVA,GACJA,EAAQ1a,KAAKowB,OAASpwB,KAAKwwB,OAG5BxwB,KAAKwB,KAAK,WACXuuB,GAAU/vB,MACd3C,EAAQ2C,MAAOowB,OAEf/yB,EAAQ2C,MAAOwwB,YAMnBnzB,EAAOoF,QAGNiuB,UACCC,SACCzvB,IAAK,SAAUnB,EAAM6wB,GACpB,GAAKA,EAAW,CAEf,GAAItvB,GAAMotB,GAAQ3uB,EAAM,UACxB,OAAe,KAARuB,EAAa,IAAMA,MAO9BuvB,WACCC,aAAe,EACfC,aAAe,EACftB,YAAc,EACduB,YAAc,EACdL,SAAW,EACXM,OAAS,EACTC,SAAW,EACXC,QAAU,EACVC,QAAU,EACV3T,MAAQ,GAKT4T,UAECC,QAAS,YAIVjpB,MAAO,SAAUtI,EAAM4C,EAAMkE,EAAO0qB,GAEnC,GAAMxxB,GAA0B,IAAlBA,EAAKQ,UAAoC,IAAlBR,EAAKQ,UAAmBR,EAAKsI,MAAlE,CAKA,GAAI/G,GAAK2C,EAAMyb,EACdoQ,EAAWzyB,EAAOoJ,UAAW9D,GAC7B0F,EAAQtI,EAAKsI,KASd,OAPA1F,GAAOtF,EAAOg0B,SAAUvB,KAAgBzyB,EAAOg0B,SAAUvB,GAAaF,GAAgBvnB,EAAOynB,IAI7FpQ,EAAQriB,EAAOqzB,SAAU/tB,IAAUtF,EAAOqzB,SAAUZ,GAG/CjpB,IAAUjK,UAiCT8iB,GAAS,OAASA,KAAUpe,EAAMoe,EAAMxe,IAAKnB,GAAM,EAAOwxB,MAAa30B,UACpE0E,EAID+G,EAAO1F,IArCdsB,QAAc4C,GAGA,WAAT5C,IAAsB3C,EAAM0tB,GAAQ7uB,KAAM0G,MAC9CA,GAAUvF,EAAI,GAAK,GAAMA,EAAI,GAAKgD,WAAYjH,EAAO4yB,IAAKlwB,EAAM4C,IAEhEsB,EAAO,UAIM,MAAT4C,GAA0B,WAAT5C,GAAqBI,MAAOwC,KAKpC,WAAT5C,GAAsB5G,EAAOwzB,UAAWf,KAC5CjpB,GAAS,MAKJxJ,EAAOsL,QAAQwU,iBAA6B,KAAVtW,GAA+C,IAA/BlE,EAAKzE,QAAQ,gBACpEmK,EAAO1F,GAAS,WAIX+c,GAAW,OAASA,KAAW7Y,EAAQ6Y,EAAMf,IAAK5e,EAAM8G,EAAO0qB,MAAa30B,YACjFyL,EAAO1F,GAASkE,IAjBjB,aA+BFopB,IAAK,SAAUlwB,EAAM4C,EAAM4uB,EAAOhB,GACjC,GAAIlf,GAAKlQ,EAAKue,EACboQ,EAAWzyB,EAAOoJ,UAAW9D,EAyB9B,OAtBAA,GAAOtF,EAAOg0B,SAAUvB,KAAgBzyB,EAAOg0B,SAAUvB,GAAaF,GAAgB7vB,EAAKsI,MAAOynB,IAIlGpQ,EAAQriB,EAAOqzB,SAAU/tB,IAAUtF,EAAOqzB,SAAUZ,GAG/CpQ,GAAS,OAASA,KACtBrO,EAAMqO,EAAMxe,IAAKnB,GAAM,EAAMwxB,IAIzBlgB,IAAQzU,YACZyU,EAAMqd,GAAQ3uB,EAAM4C,EAAM4tB,IAId,WAARlf,GAAoB1O,IAAQ4sB,MAChCle,EAAMke,GAAoB5sB,IAIZ,KAAV4uB,GAAgBA,GACpBpwB,EAAMmD,WAAY+M,GACXkgB,KAAU,GAAQl0B,EAAO+G,UAAWjD,GAAQA,GAAO,EAAIkQ,GAExDA,KAITqd,GAAS,SAAU3uB,EAAM4C,EAAM6uB,GAC9B,GAAI3T,GAAO4T,EAAUC,EACpBd,EAAWY,GAAatB,GAAWnwB,GAInCuB,EAAMsvB,EAAWA,EAASe,iBAAkBhvB,IAAUiuB,EAAUjuB,GAAS/F,UACzEyL,EAAQtI,EAAKsI,KA8Bd,OA5BKuoB,KAES,KAARtvB,GAAejE,EAAOmM,SAAUzJ,EAAKS,cAAeT,KACxDuB,EAAMjE,EAAOgL,MAAOtI,EAAM4C,IAOtBosB,GAAUtuB,KAAMa,IAASutB,GAAQpuB,KAAMkC,KAG3Ckb,EAAQxV,EAAMwV,MACd4T,EAAWppB,EAAMopB,SACjBC,EAAWrpB,EAAMqpB,SAGjBrpB,EAAMopB,SAAWppB,EAAMqpB,SAAWrpB,EAAMwV,MAAQvc,EAChDA,EAAMsvB,EAAS/S,MAGfxV,EAAMwV,MAAQA,EACdxV,EAAMopB,SAAWA,EACjBppB,EAAMqpB,SAAWA,IAIZpwB,EAIR,SAASswB,IAAmB7xB,EAAM8G,EAAOgrB,GACxC,GAAItoB,GAAUulB,GAAU3uB,KAAM0G,EAC9B,OAAO0C,GAENnG,KAAKwe,IAAK,EAAGrY,EAAS,IAAQsoB,GAAY,KAAUtoB,EAAS,IAAO,MACpE1C,EAGF,QAASirB,IAAsB/xB,EAAM4C,EAAM4uB,EAAOQ,EAAaxB,GAC9D,GAAIruB,GAAIqvB,KAAYQ,EAAc,SAAW,WAE5C,EAES,UAATpvB,EAAmB,EAAI,EAEvB0O,EAAM,CAEP,MAAY,EAAJnP,EAAOA,GAAK,EAEJ,WAAVqvB,IACJlgB,GAAOhU,EAAO4yB,IAAKlwB,EAAMwxB,EAAQ7B,GAAWxtB,IAAK,EAAMquB,IAGnDwB,GAEW,YAAVR,IACJlgB,GAAOhU,EAAO4yB,IAAKlwB,EAAM,UAAY2vB,GAAWxtB,IAAK,EAAMquB,IAI7C,WAAVgB,IACJlgB,GAAOhU,EAAO4yB,IAAKlwB,EAAM,SAAW2vB,GAAWxtB,GAAM,SAAS,EAAMquB,MAIrElf,GAAOhU,EAAO4yB,IAAKlwB,EAAM,UAAY2vB,GAAWxtB,IAAK,EAAMquB,GAG5C,YAAVgB,IACJlgB,GAAOhU,EAAO4yB,IAAKlwB,EAAM,SAAW2vB,GAAWxtB,GAAM,SAAS,EAAMquB,IAKvE,OAAOlf,GAGR,QAAS2gB,IAAkBjyB,EAAM4C,EAAM4uB,GAGtC,GAAIU,IAAmB,EACtB5gB,EAAe,UAAT1O,EAAmB5C,EAAK4d,YAAc5d,EAAKmyB,aACjD3B,EAASL,GAAWnwB,GACpBgyB,EAAc10B,EAAOsL,QAAQ+U,WAAgE,eAAnDrgB,EAAO4yB,IAAKlwB,EAAM,aAAa,EAAOwwB,EAKjF,IAAY,GAAPlf,GAAmB,MAAPA,EAAc,CAQ9B,GANAA,EAAMqd,GAAQ3uB,EAAM4C,EAAM4tB,IACf,EAANlf,GAAkB,MAAPA,KACfA,EAAMtR,EAAKsI,MAAO1F,IAIdosB,GAAUtuB,KAAK4Q,GACnB,MAAOA,EAKR4gB,GAAmBF,IAAiB10B,EAAOsL,QAAQ+T,mBAAqBrL,IAAQtR,EAAKsI,MAAO1F,IAG5F0O,EAAM/M,WAAY+M,IAAS,EAI5B,MAASA,GACRygB,GACC/xB,EACA4C,EACA4uB,IAAWQ,EAAc,SAAW,WACpCE,EACA1B,GAEE,KAIL,QAASD,IAAoB3pB,GAC5B,GAAIyI,GAAMnS,EACTqyB,EAAUL,GAAatoB,EA0BxB,OAxBM2oB,KACLA,EAAU6C,GAAexrB,EAAUyI,GAGlB,SAAZkgB,GAAuBA,IAE3BX,IAAWA,IACVtxB,EAAO,kDACN4yB,IAAK,UAAW,6BAChBpD,SAAUzd,EAAIjS,iBAGhBiS,GAAQuf,GAAO,GAAGyD,eAAiBzD,GAAO,GAAG9E,iBAAkB5sB,SAC/DmS,EAAIijB,MAAM,+BACVjjB,EAAIkjB,QAEJhD,EAAU6C,GAAexrB,EAAUyI,GACnCuf,GAAOrC,UAIR2C,GAAatoB,GAAa2oB,GAGpBA,EAIR,QAAS6C,IAAexvB,EAAMyM,GAC7B,GAAIrP,GAAO1C,EAAQ+R,EAAIlK,cAAevC,IAASkqB,SAAUzd,EAAImO,MAC5D+R,EAAUjyB,EAAO4yB,IAAKlwB,EAAK,GAAI,UAEhC,OADAA,GAAKqF,SACEkqB,EAGRjyB,EAAOmE,MAAO,SAAU,SAAW,SAAUU,EAAGS,GAC/CtF,EAAOqzB,SAAU/tB,IAChBzB,IAAK,SAAUnB,EAAM6wB,EAAUW,GAC9B,MAAKX,GAGwB,IAArB7wB,EAAK4d,aAAqBiR,GAAanuB,KAAMpD,EAAO4yB,IAAKlwB,EAAM,YACrE1C,EAAO8K,KAAMpI,EAAMovB,GAAS,WAC3B,MAAO6C,IAAkBjyB,EAAM4C,EAAM4uB,KAEtCS,GAAkBjyB,EAAM4C,EAAM4uB,GAPhC,WAWD5S,IAAK,SAAU5e,EAAM8G,EAAO0qB,GAC3B,GAAIhB,GAASgB,GAASrB,GAAWnwB,EACjC,OAAO6xB,IAAmB7xB,EAAM8G,EAAO0qB,EACtCO,GACC/xB,EACA4C,EACA4uB,EACAl0B,EAAOsL,QAAQ+U,WAAgE,eAAnDrgB,EAAO4yB,IAAKlwB,EAAM,aAAa,EAAOwwB,GAClEA,GACG,OAQRlzB,EAAO,WAEAA,EAAOsL,QAAQ8T,sBACpBpf,EAAOqzB,SAAS5S,aACf5c,IAAK,SAAUnB,EAAM6wB,GACpB,MAAKA,GAIGvzB,EAAO8K,KAAMpI,GAAQuvB,QAAW,gBACtCZ,IAAU3uB,EAAM,gBALlB,cAcG1C,EAAOsL,QAAQgU,eAAiBtf,EAAOsB,GAAGywB,UAC/C/xB,EAAOmE,MAAQ,MAAO,QAAU,SAAUU,EAAG0c,GAC5CvhB,EAAOqzB,SAAU9R,IAChB1d,IAAK,SAAUnB,EAAM6wB,GACpB,MAAKA,IACJA,EAAWlC,GAAQ3uB,EAAM6e,GAElBmQ,GAAUtuB,KAAMmwB,GACtBvzB,EAAQ0C,GAAOqvB,WAAYxQ,GAAS,KACpCgS,GALF,gBAcAvzB,EAAO8T,MAAQ9T,EAAO8T,KAAKwE,UAC/BtY,EAAO8T,KAAKwE,QAAQ0a,OAAS,SAAUtwB,GAGtC,MAA2B,IAApBA,EAAK4d,aAAyC,GAArB5d,EAAKmyB,cAGtC70B,EAAO8T,KAAKwE,QAAQ4c,QAAU,SAAUxyB,GACvC,OAAQ1C,EAAO8T,KAAKwE,QAAQ0a,OAAQtwB,KAKtC1C,EAAOmE,MACNgxB,OAAQ,GACRC,QAAS,GACTC,OAAQ,SACN,SAAUC,EAAQC,GACpBv1B,EAAOqzB,SAAUiC,EAASC,IACzBC,OAAQ,SAAUhsB,GACjB,GAAI3E,GAAI,EACP4wB,KAGAC,EAAyB,gBAAVlsB,GAAqBA,EAAM6B,MAAM,MAAS7B,EAE1D,MAAY,EAAJ3E,EAAOA,IACd4wB,EAAUH,EAASjD,GAAWxtB,GAAM0wB,GACnCG,EAAO7wB,IAAO6wB,EAAO7wB,EAAI,IAAO6wB,EAAO,EAGzC,OAAOD,KAIHjE,GAAQpuB,KAAMkyB,KACnBt1B,EAAOqzB,SAAUiC,EAASC,GAASjU,IAAMiT,KAG3C,IAAIoB,IAAM,OACTC,GAAW,QACXC,GAAQ,SACRC,GAAkB,wCAClBC,GAAe,oCAEhB/1B,GAAOsB,GAAG8D,QACT4wB,UAAW,WACV,MAAOh2B,GAAOi2B,MAAOtzB,KAAKuzB,mBAE3BA,eAAgB,WACf,MAAOvzB,MAAKqC,IAAI,WAEf,GAAI+O,GAAW/T,EAAOuhB,KAAM5e,KAAM,WAClC,OAAOoR,GAAW/T,EAAO0D,UAAWqQ,GAAapR,OAEjD+P,OAAO,WACP,GAAI9L,GAAOjE,KAAKiE,IAEhB,OAAOjE,MAAK2C,OAAStF,EAAQ2C,MAAOgpB,GAAI,cACvCoK,GAAa3yB,KAAMT,KAAK2G,YAAewsB,GAAgB1yB,KAAMwD,KAC3DjE,KAAK0U,UAAY4V,GAA4B7pB,KAAMwD,MAEtD5B,IAAI,SAAUH,EAAGnC,GACjB,GAAIsR,GAAMhU,EAAQ2C,MAAOqR,KAEzB,OAAc,OAAPA,EACN,KACAhU,EAAO6F,QAASmO,GACfhU,EAAOgF,IAAKgP,EAAK,SAAUA,GAC1B,OAAS1O,KAAM5C,EAAK4C,KAAMkE,MAAOwK,EAAI/N,QAAS4vB,GAAO,YAEpDvwB,KAAM5C,EAAK4C,KAAMkE,MAAOwK,EAAI/N,QAAS4vB,GAAO,WAC9ChyB,SAML7D,EAAOi2B,MAAQ,SAAUrpB,EAAGupB,GAC3B,GAAIb,GACHc,KACAtZ,EAAM,SAAUvS,EAAKf,GAEpBA,EAAQxJ,EAAOsD,WAAYkG,GAAUA,IAAqB,MAATA,EAAgB,GAAKA,EACtE4sB,EAAGA,EAAEvzB,QAAWwzB,mBAAoB9rB,GAAQ,IAAM8rB,mBAAoB7sB,GASxE,IALK2sB,IAAgB52B,YACpB42B,EAAcn2B,EAAOs2B,cAAgBt2B,EAAOs2B,aAAaH,aAIrDn2B,EAAO6F,QAAS+G,IAASA,EAAErK,SAAWvC,EAAOqD,cAAeuJ,GAEhE5M,EAAOmE,KAAMyI,EAAG,WACfkQ,EAAKna,KAAK2C,KAAM3C,KAAK6G,aAMtB,KAAM8rB,IAAU1oB,GACf2pB,GAAajB,EAAQ1oB,EAAG0oB,GAAUa,EAAarZ,EAKjD,OAAOsZ,GAAEhmB,KAAM,KAAMnK,QAAS0vB,GAAK,KAGpC,SAASY,IAAajB,EAAQ3uB,EAAKwvB,EAAarZ,GAC/C,GAAIxX,EAEJ,IAAKtF,EAAO6F,QAASc,GAEpB3G,EAAOmE,KAAMwC,EAAK,SAAU9B,EAAG2xB,GACzBL,GAAeP,GAASxyB,KAAMkyB,GAElCxY,EAAKwY,EAAQkB,GAIbD,GAAajB,EAAS,KAAqB,gBAANkB,GAAiB3xB,EAAI,IAAO,IAAK2xB,EAAGL,EAAarZ,SAIlF,IAAMqZ,GAAsC,WAAvBn2B,EAAO4G,KAAMD,GAQxCmW,EAAKwY,EAAQ3uB,OANb,KAAMrB,IAAQqB,GACb4vB,GAAajB,EAAS,IAAMhwB,EAAO,IAAKqB,EAAKrB,GAAQ6wB,EAAarZ,GAQrE9c,EAAOmE,KAAM,0MAEqDkH,MAAM,KAAM,SAAUxG,EAAGS,GAG1FtF,EAAOsB,GAAIgE,GAAS,SAAUmC,EAAMnG,GACnC,MAAOmD,WAAU5B,OAAS,EACzBF,KAAKooB,GAAIzlB,EAAM,KAAMmC,EAAMnG,GAC3BqB,KAAK8D,QAASnB,MAIjBtF,EAAOsB,GAAG8D,QACTqxB,MAAO,SAAUC,EAAQC,GACxB,MAAOh0B,MAAK8nB,WAAYiM,GAAShM,WAAYiM,GAASD,IAGvDE,KAAM,SAAU/Q,EAAOpe,EAAMnG,GAC5B,MAAOqB,MAAKooB,GAAIlF,EAAO,KAAMpe,EAAMnG,IAEpCu1B,OAAQ,SAAUhR,EAAOvkB,GACxB,MAAOqB,MAAK+D,IAAKmf,EAAO,KAAMvkB;EAG/Bw1B,SAAU,SAAU11B,EAAUykB,EAAOpe,EAAMnG,GAC1C,MAAOqB,MAAKooB,GAAIlF,EAAOzkB,EAAUqG,EAAMnG,IAExCy1B,WAAY,SAAU31B,EAAUykB,EAAOvkB,GAEtC,MAA4B,KAArBmD,UAAU5B,OAAeF,KAAK+D,IAAKtF,EAAU,MAASuB,KAAK+D,IAAKmf,EAAOzkB,GAAY,KAAME,KAGlG,IAEC01B,IACAC,GAEAC,GAAal3B,EAAO4K,MAEpBusB,GAAc,KACdC,GAAQ,OACRC,GAAM,gBACNC,GAAW,6BAEXC,GAAiB,4DACjBC,GAAa,iBACbC,GAAY,QACZC,GAAO,8CAGPC,GAAQ33B,EAAOsB,GAAGuoB,KAWlB+N,MAOAC,MAGAC,GAAW,KAAKv3B,OAAO,IAIxB,KACC02B,GAAet3B,EAASsX,KACvB,MAAO7P,IAGR6vB,GAAer3B,EAASiI,cAAe,KACvCovB,GAAahgB,KAAO,GACpBggB,GAAeA,GAAahgB,KAI7B+f,GAAeU,GAAK50B,KAAMm0B,GAAa1tB,kBAGvC,SAASwuB,IAA6BC,GAGrC,MAAO,UAAUC,EAAoB9a,GAED,gBAAvB8a,KACX9a,EAAO8a,EACPA,EAAqB,IAGtB,IAAI1H,GACH1rB,EAAI,EACJqzB,EAAYD,EAAmB1uB,cAAc9G,MAAOf,MAErD,IAAK1B,EAAOsD,WAAY6Z,GAEvB,MAASoT,EAAW2H,EAAUrzB,KAER,MAAhB0rB,EAAS,IACbA,EAAWA,EAAS5vB,MAAO,IAAO,KACjCq3B,EAAWzH,GAAayH,EAAWzH,QAAkB1c,QAASsJ,KAI9D6a,EAAWzH,GAAayH,EAAWzH,QAAkB9vB,KAAM0c,IAQjE,QAASgb,IAA+BH,EAAW3yB,EAAS+yB,EAAiBC,GAE5E,GAAIC,MACHC,EAAqBP,IAAcH,EAEpC,SAASW,GAASjI,GACjB,GAAIjZ,EAYJ,OAXAghB,GAAW/H,IAAa,EACxBvwB,EAAOmE,KAAM6zB,EAAWzH,OAAkB,SAAUvhB,EAAGypB,GACtD,GAAIC,GAAsBD,EAAoBpzB,EAAS+yB,EAAiBC,EACxE,OAAmC,gBAAxBK,IAAqCH,GAAqBD,EAAWI,GAIpEH,IACDjhB,EAAWohB,GADf,WAHNrzB,EAAQ6yB,UAAUrkB,QAAS6kB,GAC3BF,EAASE,IACF,KAKFphB,EAGR,MAAOkhB,GAASnzB,EAAQ6yB,UAAW,MAAUI,EAAW,MAASE,EAAS,KAM3E,QAASG,IAAYhzB,EAAQJ,GAC5B,GAAIgF,GAAK3E,EACRgzB,EAAc54B,EAAOs2B,aAAasC,eAEnC,KAAMruB,IAAOhF,GACPA,EAAKgF,KAAUhL,aACjBq5B,EAAaruB,GAAQ5E,EAAWC,IAASA,OAAgB2E,GAAQhF,EAAKgF,GAO1E,OAJK3E,IACJ5F,EAAOoF,QAAQ,EAAMO,EAAQC,GAGvBD,EAGR3F,EAAOsB,GAAGuoB,KAAO,SAAUwG,EAAKwI,EAAQz0B,GACvC,GAAoB,gBAARisB,IAAoBsH,GAC/B,MAAOA,IAAMnzB,MAAO7B,KAAM8B,UAG3B,IAAIrD,GAAUwF,EAAMkyB,EACnBlc,EAAOja,KACP+D,EAAM2pB,EAAIxvB,QAAQ,IA+CnB,OA7CK6F,IAAO,IACXtF,EAAWivB,EAAI1vB,MAAO+F,GACtB2pB,EAAMA,EAAI1vB,MAAO,EAAG+F,IAIhB1G,EAAOsD,WAAYu1B,IAGvBz0B,EAAWy0B,EACXA,EAASt5B,WAGEs5B,GAA4B,gBAAXA,KAC5BjyB,EAAO,QAIHgW,EAAK/Z,OAAS,GAClB7C,EAAOswB,MACND,IAAKA,EAGLzpB,KAAMA,EACN2pB,SAAU,OACV9oB,KAAMoxB,IACJt0B,KAAK,SAAUw0B,GAGjBD,EAAWr0B,UAEXmY,EAAKmS,KAAM3tB,EAIVpB,EAAO,SAASiuB,OAAQjuB,EAAOiD,UAAW81B,IAAiBh2B,KAAM3B,GAGjE23B,KAECC,SAAU50B,GAAY,SAAUi0B,EAAOY,GACzCrc,EAAKzY,KAAMC,EAAU00B,IAAcT,EAAMU,aAAcE,EAAQZ,MAI1D11B,MAIR3C,EAAOmE,MAAQ,YAAa,WAAY,eAAgB,YAAa,cAAe,YAAc,SAAUU,EAAG+B,GAC9G5G,EAAOsB,GAAIsF,GAAS,SAAUtF,GAC7B,MAAOqB,MAAKooB,GAAInkB,EAAMtF,MAIxBtB,EAAOoF,QAGN8zB,OAAQ,EAGRC,gBACAC,QAEA9C,cACCjG,IAAK4G,GACLrwB,KAAM,MACNyyB,QAAS9B,GAAen0B,KAAM4zB,GAAc,IAC5CpR,QAAQ,EACR0T,aAAa,EACb9I,OAAO,EACP+I,YAAa,mDAabtY,SACCuY,IAAK1B,GACL9uB,KAAM,aACN+lB,KAAM,YACN1mB,IAAK,4BACLoxB,KAAM,qCAGPlO,UACCljB,IAAK,MACL0mB,KAAM,OACN0K,KAAM,QAGPC,gBACCrxB,IAAK,cACLW,KAAM,eACNywB,KAAM,gBAKPE,YAGCC,SAAUzyB,OAGV0yB,aAAa,EAGbC,YAAa95B,EAAOiI,UAGpB8xB,WAAY/5B,EAAOoI,UAOpBwwB,aACCvI,KAAK,EACLhvB,SAAS,IAOX24B,UAAW,SAAUr0B,EAAQs0B,GAC5B,MAAOA,GAGNtB,GAAYA,GAAYhzB,EAAQ3F,EAAOs2B,cAAgB2D,GAGvDtB,GAAY34B,EAAOs2B,aAAc3wB,IAGnCu0B,cAAenC,GAA6BH,IAC5CuC,cAAepC,GAA6BF,IAG5CvH,KAAM,SAAUD,EAAKhrB,GAGA,gBAARgrB,KACXhrB,EAAUgrB,EACVA,EAAM9wB,WAIP8F,EAAUA,KAEV,IAAI+0B,GAEHC,EAEAC,EACAC,EAEAC,EAEA9E,EAEA+E,EAEA51B,EAEAuxB,EAAIp2B,EAAOg6B,aAAe30B,GAE1Bq1B,EAAkBtE,EAAE/0B,SAAW+0B,EAE/BuE,EAAqBvE,EAAE/0B,UAAaq5B,EAAgBx3B,UAAYw3B,EAAgBn4B,QAC/EvC,EAAQ06B,GACR16B,EAAO2lB,MAERpI,EAAWvd,EAAOiL,WAClB2vB,EAAmB56B,EAAOgc,UAAU,eAEpC6e,EAAazE,EAAEyE,eAEfC,KACAC,KAEA1d,EAAQ,EAER2d,EAAW,WAEX3C,GACCntB,WAAY,EAGZ+vB,kBAAmB,SAAU1wB,GAC5B,GAAI9H,EACJ,IAAe,IAAV4a,EAAc,CAClB,IAAMkd,EAAkB,CACvBA,IACA,OAAS93B,EAAQ60B,GAASx0B,KAAMw3B,GAC/BC,EAAiB93B,EAAM,GAAG8G,eAAkB9G,EAAO,GAGrDA,EAAQ83B,EAAiBhwB,EAAIhB,eAE9B,MAAgB,OAAT9G,EAAgB,KAAOA,GAI/By4B,sBAAuB,WACtB,MAAiB,KAAV7d,EAAcid,EAAwB,MAI9Ca,iBAAkB,SAAU71B,EAAMkE,GACjC,GAAI4xB,GAAQ91B,EAAKiE,aAKjB,OAJM8T,KACL/X,EAAOy1B,EAAqBK,GAAUL,EAAqBK,IAAW91B,EACtEw1B,EAAgBx1B,GAASkE,GAEnB7G,MAIR04B,iBAAkB,SAAUz0B,GAI3B,MAHMyW,KACL+Y,EAAEkF,SAAW10B,GAEPjE,MAIRk4B,WAAY,SAAU71B,GACrB,GAAI4D,EACJ,IAAK5D,EACJ,GAAa,EAARqY,EACJ,IAAMzU,IAAQ5D,GAEb61B,EAAYjyB,IAAWiyB,EAAYjyB,GAAQ5D,EAAK4D,QAIjDyvB,GAAM/a,OAAQtY,EAAKqzB,EAAMY,QAG3B,OAAOt2B,OAIR44B,MAAO,SAAUC,GAChB,GAAIC,GAAYD,GAAcR,CAK9B,OAJKZ,IACJA,EAAUmB,MAAOE,GAElBl3B,EAAM,EAAGk3B,GACF94B,MAyCV,IApCA4a,EAASjZ,QAAS+zB,GAAQW,SAAW4B,EAAiB9d,IACtDub,EAAMqD,QAAUrD,EAAM9zB,KACtB8zB,EAAM/wB,MAAQ+wB,EAAM7a,KAMpB4Y,EAAE/F,MAAUA,GAAO+F,EAAE/F,KAAO4G,IAAiB,IAAKhxB,QAASmxB,GAAO,IAChEnxB,QAASwxB,GAAWT,GAAc,GAAM,MAG1CZ,EAAExvB,KAAOvB,EAAQs2B,QAAUt2B,EAAQuB,MAAQwvB,EAAEuF,QAAUvF,EAAExvB,KAGzDwvB,EAAE8B,UAAYl4B,EAAOmB,KAAMi1B,EAAE7F,UAAY,KAAMhnB,cAAc9G,MAAOf,KAAqB,IAGnE,MAAjB00B,EAAEwF,cACNlG,EAAQgC,GAAK50B,KAAMszB,EAAE/F,IAAI9mB,eACzB6sB,EAAEwF,eAAkBlG,GACjBA,EAAO,KAAQsB,GAAc,IAAOtB,EAAO,KAAQsB,GAAc,KAChEtB,EAAO,KAAwB,UAAfA,EAAO,GAAkB,KAAO,WAC/CsB,GAAc,KAA+B,UAAtBA,GAAc,GAAkB,KAAO,UAK/DZ,EAAE3uB,MAAQ2uB,EAAEkD,aAAiC,gBAAXlD,GAAE3uB,OACxC2uB,EAAE3uB,KAAOzH,EAAOi2B,MAAOG,EAAE3uB,KAAM2uB,EAAED,cAIlCgC,GAA+BP,GAAYxB,EAAG/wB,EAASgzB,GAGxC,IAAVhb,EACJ,MAAOgb,EAIRoC,GAAcrE,EAAExQ,OAGX6U,GAAmC,IAApBz6B,EAAOk5B,UAC1Bl5B,EAAO2lB,MAAMlf,QAAQ,aAItB2vB,EAAExvB,KAAOwvB,EAAExvB,KAAK1E,cAGhBk0B,EAAEyF,YAAcrE,GAAWp0B,KAAMgzB,EAAExvB,MAInCyzB,EAAWjE,EAAE/F,IAGP+F,EAAEyF,aAGFzF,EAAE3uB,OACN4yB,EAAajE,EAAE/F,MAAS8G,GAAY/zB,KAAMi3B,GAAa,IAAM,KAAQjE,EAAE3uB,WAEhE2uB,GAAE3uB,MAIL2uB,EAAE1lB,SAAU,IAChB0lB,EAAE/F,IAAMgH,GAAIj0B,KAAMi3B,GAGjBA,EAASp0B,QAASoxB,GAAK,OAASH,MAGhCmD,GAAalD,GAAY/zB,KAAMi3B,GAAa,IAAM,KAAQ,KAAOnD,OAK/Dd,EAAE0F,aACD97B,EAAOm5B,aAAckB,IACzBhC,EAAM8C,iBAAkB,oBAAqBn7B,EAAOm5B,aAAckB,IAE9Dr6B,EAAOo5B,KAAMiB,IACjBhC,EAAM8C,iBAAkB,gBAAiBn7B,EAAOo5B,KAAMiB,MAKnDjE,EAAE3uB,MAAQ2uB,EAAEyF,YAAczF,EAAEmD,eAAgB,GAASl0B,EAAQk0B,cACjElB,EAAM8C,iBAAkB,eAAgB/E,EAAEmD,aAI3ClB,EAAM8C,iBACL,SACA/E,EAAE8B,UAAW,IAAO9B,EAAEnV,QAASmV,EAAE8B,UAAU,IAC1C9B,EAAEnV,QAASmV,EAAE8B,UAAU,KAA8B,MAArB9B,EAAE8B,UAAW,GAAc,KAAOJ,GAAW,WAAa,IAC1F1B,EAAEnV,QAAS,KAIb,KAAMpc,IAAKuxB,GAAE2F,QACZ1D,EAAM8C,iBAAkBt2B,EAAGuxB,EAAE2F,QAASl3B,GAIvC,IAAKuxB,EAAE4F,aAAgB5F,EAAE4F,WAAWp4B,KAAM82B,EAAiBrC,EAAOjC,MAAQ,GAAmB,IAAV/Y,GAElF,MAAOgb,GAAMkD,OAIdP,GAAW,OAGX,KAAMn2B,KAAO62B,QAAS,EAAGp0B,MAAO,EAAG0xB,SAAU,GAC5CX,EAAOxzB,GAAKuxB,EAAGvxB,GAOhB,IAHAu1B,EAAYjC,GAA+BN,GAAYzB,EAAG/wB,EAASgzB,GAK5D,CACNA,EAAMntB,WAAa,EAGduvB,GACJE,EAAmBl0B,QAAS,YAAc4xB,EAAOjC,IAG7CA,EAAE5F,OAAS4F,EAAEtT,QAAU,IAC3B0X,EAAervB,WAAW,WACzBktB,EAAMkD,MAAM,YACVnF,EAAEtT,SAGN,KACCzF,EAAQ,EACR+c,EAAU6B,KAAMnB,EAAgBv2B,GAC/B,MAAQ6C,GAET,KAAa,EAARiW,GAIJ,KAAMjW,EAHN7C,GAAM,GAAI6C,QArBZ7C,GAAM,GAAI,eA8BX,SAASA,GAAM00B,EAAQiD,EAAkBC,EAAWJ,GACnD,GAAIK,GAAWV,EAASp0B,EAAOwxB,EAAUuD,EACxCb,EAAaU,CAGC,KAAV7e,IAKLA,EAAQ,EAGHmd,GACJzX,aAAcyX,GAKfJ,EAAY76B,UAGZ+6B,EAAwByB,GAAW,GAGnC1D,EAAMntB,WAAa+tB,EAAS,EAAI,EAAI,EAGpCmD,EAAYnD,GAAU,KAAgB,IAATA,GAA2B,MAAXA,EAGxCkD,IACJrD,EAAWwD,GAAqBlG,EAAGiC,EAAO8D,IAI3CrD,EAAWyD,GAAanG,EAAG0C,EAAUT,EAAO+D,GAGvCA,GAGChG,EAAE0F,aACNO,EAAWhE,EAAM4C,kBAAkB,iBAC9BoB,IACJr8B,EAAOm5B,aAAckB,GAAagC,GAEnCA,EAAWhE,EAAM4C,kBAAkB,QAC9BoB,IACJr8B,EAAOo5B,KAAMiB,GAAagC,IAKZ,MAAXpD,GAA6B,SAAX7C,EAAExvB,KACxB40B,EAAa,YAGS,MAAXvC,EACXuC,EAAa,eAIbA,EAAa1C,EAASzb,MACtBqe,EAAU5C,EAASrxB,KACnBH,EAAQwxB,EAASxxB,MACjB80B,GAAa90B,KAKdA,EAAQk0B,GACHvC,IAAWuC,KACfA,EAAa,QACC,EAATvC,IACJA,EAAS,KAMZZ,EAAMY,OAASA,EACfZ,EAAMmD,YAAeU,GAAoBV,GAAe,GAGnDY,EACJ7e,EAAS/W,YAAak0B,GAAmBgB,EAASF,EAAYnD,IAE9D9a,EAASif,WAAY9B,GAAmBrC,EAAOmD,EAAYl0B,IAI5D+wB,EAAMwC,WAAYA,GAClBA,EAAat7B,UAERk7B,GACJE,EAAmBl0B,QAAS21B,EAAY,cAAgB,aACrD/D,EAAOjC,EAAGgG,EAAYV,EAAUp0B,IAIpCszB,EAAiB1d,SAAUwd,GAAmBrC,EAAOmD,IAEhDf,IACJE,EAAmBl0B,QAAS,gBAAkB4xB,EAAOjC,MAE3Cp2B,EAAOk5B,QAChBl5B,EAAO2lB,MAAMlf,QAAQ,cAKxB,MAAO4xB,IAGRoE,QAAS,SAAUpM,EAAK5oB,EAAMrD,GAC7B,MAAOpE,GAAO6D,IAAKwsB,EAAK5oB,EAAMrD,EAAU,SAGzCs4B,UAAW,SAAUrM,EAAKjsB,GACzB,MAAOpE,GAAO6D,IAAKwsB,EAAK9wB,UAAW6E,EAAU,aAI/CpE,EAAOmE,MAAQ,MAAO,QAAU,SAAUU,EAAG82B,GAC5C37B,EAAQ27B,GAAW,SAAUtL,EAAK5oB,EAAMrD,EAAUwC,GAQjD,MANK5G,GAAOsD,WAAYmE,KACvBb,EAAOA,GAAQxC,EACfA,EAAWqD,EACXA,EAAOlI,WAGDS,EAAOswB,MACbD,IAAKA,EACLzpB,KAAM+0B,EACNpL,SAAU3pB,EACVa,KAAMA,EACNi0B,QAASt3B,MASZ,SAASk4B,IAAqBlG,EAAGiC,EAAO8D,GAEvC,GAAIQ,GAAI/1B,EAAMg2B,EAAeC,EAC5BtR,EAAW6K,EAAE7K,SACb2M,EAAY9B,EAAE8B,SAGf,OAA0B,MAAnBA,EAAW,GACjBA,EAAUtnB,QACL+rB,IAAOp9B,YACXo9B,EAAKvG,EAAEkF,UAAYjD,EAAM4C,kBAAkB,gBAK7C,IAAK0B,EACJ,IAAM/1B,IAAQ2kB,GACb,GAAKA,EAAU3kB,IAAU2kB,EAAU3kB,GAAOxD,KAAMu5B,GAAO,CACtDzE,EAAUrkB,QAASjN,EACnB,OAMH,GAAKsxB,EAAW,IAAOiE,GACtBS,EAAgB1E,EAAW,OACrB,CAEN,IAAMtxB,IAAQu1B,GAAY,CACzB,IAAMjE,EAAW,IAAO9B,EAAEuD,WAAY/yB,EAAO,IAAMsxB,EAAU,IAAO,CACnE0E,EAAgBh2B,CAChB,OAEKi2B,IACLA,EAAgBj2B,GAIlBg2B,EAAgBA,GAAiBC,EAMlC,MAAKD,IACCA,IAAkB1E,EAAW,IACjCA,EAAUrkB,QAAS+oB,GAEbT,EAAWS,IAJnB,UAWD,QAASL,IAAanG,EAAG0C,EAAUT,EAAO+D,GACzC,GAAIU,GAAOC,EAASC,EAAM10B,EAAKkjB,EAC9BmO,KAEAzB,EAAY9B,EAAE8B,UAAUv3B,OAGzB,IAAKu3B,EAAW,GACf,IAAM8E,IAAQ5G,GAAEuD,WACfA,EAAYqD,EAAKzzB,eAAkB6sB,EAAEuD,WAAYqD,EAInDD,GAAU7E,EAAUtnB,OAGpB,OAAQmsB,EAcP,GAZK3G,EAAEsD,eAAgBqD,KACtB1E,EAAOjC,EAAEsD,eAAgBqD,IAAcjE,IAIlCtN,GAAQ4Q,GAAahG,EAAE6G,aAC5BnE,EAAW1C,EAAE6G,WAAYnE,EAAU1C,EAAE7F,WAGtC/E,EAAOuR,EACPA,EAAU7E,EAAUtnB,QAKnB,GAAiB,MAAZmsB,EAEJA,EAAUvR,MAGJ,IAAc,MAATA,GAAgBA,IAASuR,EAAU,CAM9C,GAHAC,EAAOrD,EAAYnO,EAAO,IAAMuR,IAAapD,EAAY,KAAOoD,IAG1DC,EACL,IAAMF,IAASnD,GAId,GADArxB,EAAMw0B,EAAMzxB,MAAO,KACd/C,EAAK,KAAQy0B,IAGjBC,EAAOrD,EAAYnO,EAAO,IAAMljB,EAAK,KACpCqxB,EAAY,KAAOrxB,EAAK,KACb,CAEN00B,KAAS,EACbA,EAAOrD,EAAYmD,GAGRnD,EAAYmD,MAAY,IACnCC,EAAUz0B,EAAK,GACf4vB,EAAUrkB,QAASvL,EAAK,IAEzB,OAOJ,GAAK00B,KAAS,EAGb,GAAKA,GAAQ5G,EAAG,UACf0C,EAAWkE,EAAMlE,OAEjB,KACCA,EAAWkE,EAAMlE,GAChB,MAAQ1xB,GACT,OAASiW,MAAO,cAAe/V,MAAO01B,EAAO51B,EAAI,sBAAwBokB,EAAO,OAASuR,IAQ/F,OAAS1f,MAAO,UAAW5V,KAAMqxB,GAGlC94B,EAAOg6B,WACN/Y,SACCpY,OAAQ,6FAET0iB,UACC1iB,OAAQ,uBAET8wB,YACCuD,cAAe,SAAUl0B,GAExB,MADAhJ,GAAO2I,WAAYK,GACZA,MAMVhJ,EAAOk6B,cAAe,SAAU,SAAU9D,GACpCA,EAAE1lB,QAAUnR,YAChB62B,EAAE1lB,OAAQ,GAEN0lB,EAAEwF,cACNxF,EAAExvB,KAAO,SAKX5G,EAAOm6B,cAAe,SAAU,SAAU/D,GAEzC,GAAKA,EAAEwF,YAAc,CACpB,GAAI/yB,GAAQzE,CACZ,QACC63B,KAAM,SAAUjtB,EAAGgqB,GAClBnwB,EAAS7I,EAAO,YAAYuhB,MAC3BiP,OAAO,EACP2M,QAAS/G,EAAEgH,cACX73B,IAAK6wB,EAAE/F,MACLtF,GACF,aACA3mB,EAAW,SAAUi5B,GACpBx0B,EAAOd,SACP3D,EAAW,KACNi5B,GACJrE,EAAuB,UAAbqE,EAAIz2B,KAAmB,IAAM,IAAKy2B,EAAIz2B,QAInDhH,EAASqJ,KAAKC,YAAaL,EAAQ,KAEpC0yB,MAAO,WACDn3B,GACJA,QAML,IAAIk5B,OACHC,GAAS,mBAGVv9B,GAAOg6B,WACNwD,MAAO,WACPC,cAAe,WACd,GAAIr5B,GAAWk5B,GAAarwB,OAAWjN,EAAO8F,QAAU,IAAQoxB,IAEhE,OADAv0B,MAAMyB,IAAa,EACZA,KAKTpE,EAAOk6B,cAAe,aAAc,SAAU9D,EAAGsH,EAAkBrF,GAElE,GAAIsF,GAAcC,EAAaC,EAC9BC,EAAW1H,EAAEoH,SAAU,IAAWD,GAAOn6B,KAAMgzB,EAAE/F,KAChD,MACkB,gBAAX+F,GAAE3uB,QAAwB2uB,EAAEmD,aAAe,IAAK14B,QAAQ,sCAAwC08B,GAAOn6B,KAAMgzB,EAAE3uB,OAAU,OAIlI,OAAKq2B,IAAiC,UAArB1H,EAAE8B,UAAW,IAG7ByF,EAAevH,EAAEqH,cAAgBz9B,EAAOsD,WAAY8yB,EAAEqH,eACrDrH,EAAEqH,gBACFrH,EAAEqH,cAGEK,EACJ1H,EAAG0H,GAAa1H,EAAG0H,GAAW73B,QAASs3B,GAAQ,KAAOI,GAC3CvH,EAAEoH,SAAU,IACvBpH,EAAE/F,MAAS8G,GAAY/zB,KAAMgzB,EAAE/F,KAAQ,IAAM,KAAQ+F,EAAEoH,MAAQ,IAAMG,GAItEvH,EAAEuD,WAAW,eAAiB,WAI7B,MAHMkE,IACL79B,EAAOsH,MAAOq2B,EAAe,mBAEvBE,EAAmB,IAI3BzH,EAAE8B,UAAW,GAAM,OAGnB0F,EAAct+B,EAAQq+B,GACtBr+B,EAAQq+B,GAAiB,WACxBE,EAAoBp5B,WAIrB4zB,EAAM/a,OAAO,WAEZhe,EAAQq+B,GAAiBC,EAGpBxH,EAAGuH,KAEPvH,EAAEqH,cAAgBC,EAAiBD,cAGnCH,GAAa78B,KAAMk9B,IAIfE,GAAqB79B,EAAOsD,WAAYs6B,IAC5CA,EAAaC,EAAmB,IAGjCA,EAAoBD,EAAcr+B,YAI5B,UAtDR,YAyDDS,EAAOs2B,aAAayH,IAAM,WACzB,IACC,MAAO,IAAIC,gBACV,MAAO52B,KAGV,IAAI62B,IAAej+B,EAAOs2B,aAAayH,MACtCG,IAEC,EAAG,IAGHC,KAAM,KAKPC,GAAQ,EACRC,KAEI/+B,GAAOg/B,eACXt+B,EAAQV,GAASyrB,GAAI,SAAU,WAC9B,IAAK,GAAIxgB,KAAO8zB,IACfA,GAAc9zB,IAEf8zB,IAAe9+B,YAIjBS,EAAOsL,QAAQizB,OAASN,IAAkB,mBAAqBA,IAC/Dj+B,EAAOsL,QAAQglB,KAAO2N,KAAiBA,GAEvCj+B,EAAOm6B,cAAc,SAAU90B,GAC9B,GAAIjB,EAEJ,OAAKpE,GAAOsL,QAAQizB,MAAQN,KAAiB54B,EAAQu2B,aAEnDK,KAAM,SAAUF,EAAS/C,GACxB,GAAIn0B,GAAGgL,EACNkuB,EAAM14B,EAAQ04B,KAGf,IAFAA,EAAIS,KAAMn5B,EAAQuB,KAAMvB,EAAQgrB,IAAKhrB,EAAQmrB,MAAOnrB,EAAQo5B,SAAUp5B,EAAQ6S,UAEzE7S,EAAQq5B,UACZ,IAAM75B,IAAKQ,GAAQq5B,UAClBX,EAAKl5B,GAAMQ,EAAQq5B,UAAW75B,EAI3BQ,GAAQi2B,UAAYyC,EAAI1C,kBAC5B0C,EAAI1C,iBAAkBh2B,EAAQi2B,UAOzBj2B,EAAQu2B,aAAgBG,EAAQ,sBACrCA,EAAQ,oBAAsB,iBAG/B,KAAMl3B,IAAKk3B,GACVgC,EAAI5C,iBAAkBt2B,EAAGk3B,EAASl3B,GAGnCT,GAAW,SAAUwC,GACpB,MAAO,YACDxC,UACGi6B,IAAcxuB,GACrBzL,EAAW25B,EAAIY,OAASZ,EAAIa,QAAU,KACxB,UAATh4B,EACJm3B,EAAIxC,QACgB,UAAT30B,EACXoyB,EAEC+E,EAAI9E,QAAU,IACd8E,EAAIvC,YAGLxC,EACCkF,GAAkBH,EAAI9E,SAAY8E,EAAI9E,OACtC8E,EAAIvC,WAIwB,gBAArBuC,GAAIhF,cACV/vB,KAAM+0B,EAAIhF,cACPx5B,UACJw+B,EAAI7C,4BAOT6C,EAAIY,OAASv6B,IACb25B,EAAIa,QAAUx6B,EAAS,SAEvBA,EAAWi6B,GAAexuB,EAAKuuB,MAAah6B,EAAS,SAIrD25B,EAAI9B,KAAM52B,EAAQw2B,YAAcx2B,EAAQoC,MAAQ,OAEjD8zB,MAAO,WACDn3B,GACJA,MAtEJ,WA4ED,IAAIy6B,IAAOC,GACVC,GAAW,yBACXC,GAAatxB,OAAQ,iBAAmBlM,EAAY,cAAe,KACnEy9B,GAAO,cACPC,IAAwBC,IACxBC,IACC5F,KAAM,SAAUjY,EAAM/X,GACrB,GAAI61B,GAAQ18B,KAAK28B,YAAa/d,EAAM/X,GACnC7D,EAAS05B,EAAMhuB,MACfqkB,EAAQsJ,GAAOl8B,KAAM0G,GACrB+1B,EAAO7J,GAASA,EAAO,KAAS11B,EAAOwzB,UAAWjS,GAAS,GAAK,MAGhEzL,GAAU9V,EAAOwzB,UAAWjS,IAAmB,OAATge,IAAkB55B,IACvDq5B,GAAOl8B,KAAM9C,EAAO4yB,IAAKyM,EAAM38B,KAAM6e,IACtCie,EAAQ,EACRC,EAAgB,EAEjB,IAAK3pB,GAASA,EAAO,KAAQypB,EAAO,CAEnCA,EAAOA,GAAQzpB,EAAO,GAGtB4f,EAAQA,MAGR5f,GAASnQ,GAAU,CAEnB,GAGC65B,GAAQA,GAAS,KAGjB1pB,GAAgB0pB,EAChBx/B,EAAOgL,MAAOq0B,EAAM38B,KAAM6e,EAAMzL,EAAQypB,SAI/BC,KAAWA,EAAQH,EAAMhuB,MAAQ1L,IAAqB,IAAV65B,KAAiBC,GAaxE,MATK/J,KACJ5f,EAAQupB,EAAMvpB,OAASA,IAAUnQ,GAAU,EAC3C05B,EAAME,KAAOA,EAEbF,EAAMp6B,IAAMywB,EAAO,GAClB5f,GAAU4f,EAAO,GAAM,GAAMA,EAAO,IACnCA,EAAO,IAGH2J,IAKV,SAASK,MAIR,MAHAv0B,YAAW,WACV0zB,GAAQt/B,YAEAs/B,GAAQ7+B,EAAO4K,MAGzB,QAAS00B,IAAa91B,EAAO+X,EAAMoe,GAClC,GAAIN,GACHO,GAAeR,GAAU7d,QAAehhB,OAAQ6+B,GAAU,MAC1DriB,EAAQ,EACRla,EAAS+8B,EAAW/8B,MACrB,MAAgBA,EAARka,EAAgBA,IACvB,GAAMsiB,EAAQO,EAAY7iB,GAAQnZ,KAAM+7B,EAAWpe,EAAM/X,GAGxD,MAAO61B,GAKV,QAASQ,IAAWn9B,EAAMo9B,EAAYz6B,GACrC,GAAIkQ,GACHwqB,EACAhjB,EAAQ,EACRla,EAASq8B,GAAoBr8B,OAC7B0a,EAAWvd,EAAOiL,WAAWqS,OAAQ,iBAE7B0iB,GAAKt9B,OAEbs9B,EAAO,WACN,GAAKD,EACJ,OAAO,CAER,IAAIE,GAAcpB,IAASa,KAC1BlhB,EAAYzY,KAAKwe,IAAK,EAAGob,EAAUO,UAAYP,EAAUQ,SAAWF,GAEpEtmB,EAAO6E,EAAYmhB,EAAUQ,UAAY,EACzCC,EAAU,EAAIzmB,EACdoD,EAAQ,EACRla,EAAS88B,EAAUU,OAAOx9B,MAE3B,MAAgBA,EAARka,EAAiBA,IACxB4iB,EAAUU,OAAQtjB,GAAQujB,IAAKF,EAKhC,OAFA7iB,GAASqB,WAAYlc,GAAQi9B,EAAWS,EAAS5hB,IAElC,EAAV4hB,GAAev9B,EACZ2b,GAEPjB,EAAS/W,YAAa9D,GAAQi9B,KACvB,IAGTA,EAAYpiB,EAASjZ,SACpB5B,KAAMA,EACNgmB,MAAO1oB,EAAOoF,UAAY06B,GAC1BS,KAAMvgC,EAAOoF,QAAQ,GAAQo7B,kBAAqBn7B,GAClDo7B,mBAAoBX,EACpB1H,gBAAiB/yB,EACjB66B,UAAWrB,IAASa,KACpBS,SAAU96B,EAAQ86B,SAClBE,UACAf,YAAa,SAAU/d,EAAMtc,GAC5B,GAAIo6B,GAAQr/B,EAAO0gC,MAAOh+B,EAAMi9B,EAAUY,KAAMhf,EAAMtc,EACpD06B,EAAUY,KAAKC,cAAejf,IAAUoe,EAAUY,KAAKI,OAEzD,OADAhB,GAAUU,OAAO5/B,KAAM4+B,GAChBA,GAER7c,KAAM,SAAUoe,GACf,GAAI7jB,GAAQ,EAGXla,EAAS+9B,EAAUjB,EAAUU,OAAOx9B,OAAS,CAC9C,IAAKk9B,EACJ,MAAOp9B,KAGR,KADAo9B,GAAU,EACMl9B,EAARka,EAAiBA,IACxB4iB,EAAUU,OAAQtjB,GAAQujB,IAAK,EAUhC,OALKM,GACJrjB,EAAS/W,YAAa9D,GAAQi9B,EAAWiB,IAEzCrjB,EAASif,WAAY95B,GAAQi9B,EAAWiB,IAElCj+B,QAGT+lB,EAAQiX,EAAUjX,KAInB,KAFAmY,GAAYnY,EAAOiX,EAAUY,KAAKC,eAElB39B,EAARka,EAAiBA,IAExB,GADAxH,EAAS2pB,GAAqBniB,GAAQnZ,KAAM+7B,EAAWj9B,EAAMgmB,EAAOiX,EAAUY,MAE7E,MAAOhrB,EAmBT,OAfAvV,GAAOgF,IAAK0jB,EAAO4W,GAAaK,GAE3B3/B,EAAOsD,WAAYq8B,EAAUY,KAAKzqB,QACtC6pB,EAAUY,KAAKzqB,MAAMlS,KAAMlB,EAAMi9B,GAGlC3/B,EAAO4iB,GAAGke,MACT9gC,EAAOoF,OAAQ46B,GACdt9B,KAAMA,EACNq+B,KAAMpB,EACNzd,MAAOyd,EAAUY,KAAKre,SAKjByd,EAAU1hB,SAAU0hB,EAAUY,KAAKtiB,UACxC1Z,KAAMo7B,EAAUY,KAAKh8B,KAAMo7B,EAAUY,KAAKvH,UAC1Cxb,KAAMmiB,EAAUY,KAAK/iB,MACrBF,OAAQqiB,EAAUY,KAAKjjB,QAG1B,QAASujB,IAAYnY,EAAO8X,GAC3B,GAAIzjB,GAAOzX,EAAMq7B,EAAQn3B,EAAO6Y,CAGhC,KAAMtF,IAAS2L,GAed,GAdApjB,EAAOtF,EAAOoJ,UAAW2T,GACzB4jB,EAASH,EAAel7B,GACxBkE,EAAQkf,EAAO3L,GACV/c,EAAO6F,QAAS2D,KACpBm3B,EAASn3B,EAAO,GAChBA,EAAQkf,EAAO3L,GAAUvT,EAAO,IAG5BuT,IAAUzX,IACdojB,EAAOpjB,GAASkE,QACTkf,GAAO3L,IAGfsF,EAAQriB,EAAOqzB,SAAU/tB,GACpB+c,GAAS,UAAYA,GAAQ,CACjC7Y,EAAQ6Y,EAAMmT,OAAQhsB,SACfkf,GAAOpjB,EAId,KAAMyX,IAASvT,GACNuT,IAAS2L,KAChBA,EAAO3L,GAAUvT,EAAOuT,GACxByjB,EAAezjB,GAAU4jB,OAI3BH,GAAel7B,GAASq7B,EAK3B3gC,EAAO6/B,UAAY7/B,EAAOoF,OAAQy6B,IAEjCmB,QAAS,SAAUtY,EAAOtkB,GACpBpE,EAAOsD,WAAYolB,IACvBtkB,EAAWskB,EACXA,GAAU,MAEVA,EAAQA,EAAMrd,MAAM,IAGrB,IAAIkW,GACHxE,EAAQ,EACRla,EAAS6lB,EAAM7lB,MAEhB,MAAgBA,EAARka,EAAiBA,IACxBwE,EAAOmH,EAAO3L,GACdqiB,GAAU7d,GAAS6d,GAAU7d,OAC7B6d,GAAU7d,GAAO1N,QAASzP,IAI5B68B,UAAW,SAAU78B,EAAUiqB,GACzBA,EACJ6Q,GAAoBrrB,QAASzP,GAE7B86B,GAAoBz+B,KAAM2D,KAK7B,SAAS+6B,IAAkBz8B,EAAMgmB,EAAO6X,GAEvC,GAAIhf,GAAM/X,EAAO4pB,EAAQiM,EAAOhd,EAAO6e,EACtCH,EAAOp+B,KACPgoB,KACA3f,EAAQtI,EAAKsI,MACbgoB,EAAStwB,EAAKQ,UAAYwvB,GAAUhwB,GACpCy+B,EAAWxgB,EAAU9c,IAAKnB,EAAM,SAG3B69B,GAAKre,QACVG,EAAQriB,EAAOsiB,YAAa5f,EAAM,MACX,MAAlB2f,EAAM+e,WACV/e,EAAM+e,SAAW,EACjBF,EAAU7e,EAAM7K,MAAMkF,KACtB2F,EAAM7K,MAAMkF,KAAO,WACZ2F,EAAM+e,UACXF,MAIH7e,EAAM+e,WAENL,EAAKzjB,OAAO,WAGXyjB,EAAKzjB,OAAO,WACX+E,EAAM+e,WACAphC,EAAOkiB,MAAOxf,EAAM,MAAOG,QAChCwf,EAAM7K,MAAMkF,YAOO,IAAlBha,EAAKQ,WAAoB,UAAYwlB,IAAS,SAAWA,MAK7D6X,EAAKc,UAAar2B,EAAMq2B,SAAUr2B,EAAMs2B,UAAWt2B,EAAMu2B,WAIlB,WAAlCvhC,EAAO4yB,IAAKlwB,EAAM,YACW,SAAhC1C,EAAO4yB,IAAKlwB,EAAM,WAEnBsI,EAAMinB,QAAU,iBAIbsO,EAAKc,WACTr2B,EAAMq2B,SAAW,SACjBN,EAAKzjB,OAAO,WACXtS,EAAMq2B,SAAWd,EAAKc,SAAU,GAChCr2B,EAAMs2B,UAAYf,EAAKc,SAAU,GACjCr2B,EAAMu2B,UAAYhB,EAAKc,SAAU,KAMnC,KAAM9f,IAAQmH,GAEb,GADAlf,EAAQkf,EAAOnH,GACVwd,GAASj8B,KAAM0G,GAAU,CAG7B,SAFOkf,GAAOnH,GACd6R,EAASA,GAAoB,WAAV5pB,EACdA,KAAYwpB,EAAS,OAAS,QAAW,CAG7C,GAAe,SAAVxpB,IAAoB23B,GAAYA,EAAU5f,KAAWhiB,UAGzD,QAFAyzB,IAAS,EAKXrI,EAAMpJ,GAAS4f,GAAYA,EAAU5f,IAAUvhB,EAAOgL,MAAOtI,EAAM6e,GAIrE,IAAMvhB,EAAOqH,cAAesjB,GAAS,CAC/BwW,EACC,UAAYA,KAChBnO,EAASmO,EAASnO,QAGnBmO,EAAWxgB,EAAUrW,OAAQ5H,EAAM,aAI/B0wB,IACJ+N,EAASnO,QAAUA,GAEfA,EACJhzB,EAAQ0C,GAAOqwB,OAEfgO,EAAKx8B,KAAK,WACTvE,EAAQ0C,GAAOywB,SAGjB4N,EAAKx8B,KAAK,WACT,GAAIgd,EAEJZ,GAAU5Y,OAAQrF,EAAM,SACxB,KAAM6e,IAAQoJ,GACb3qB,EAAOgL,MAAOtI,EAAM6e,EAAMoJ,EAAMpJ,KAGlC,KAAMA,IAAQoJ,GACb0U,EAAQC,GAAatM,EAASmO,EAAU5f,GAAS,EAAGA,EAAMwf,GAElDxf,IAAQ4f,KACfA,EAAU5f,GAAS8d,EAAMvpB,MACpBkd,IACJqM,EAAMp6B,IAAMo6B,EAAMvpB,MAClBupB,EAAMvpB,MAAiB,UAATyL,GAA6B,WAATA,EAAoB,EAAI,KAO/D,QAASmf,IAAOh+B,EAAM2C,EAASkc,EAAMtc,EAAK07B,GACzC,MAAO,IAAID,IAAMp+B,UAAUf,KAAMmB,EAAM2C,EAASkc,EAAMtc,EAAK07B,GAE5D3gC,EAAO0gC,MAAQA,GAEfA,GAAMp+B,WACLE,YAAak+B,GACbn/B,KAAM,SAAUmB,EAAM2C,EAASkc,EAAMtc,EAAK07B,EAAQpB,GACjD58B,KAAKD,KAAOA,EACZC,KAAK4e,KAAOA,EACZ5e,KAAKg+B,OAASA,GAAU,QACxBh+B,KAAK0C,QAAUA,EACf1C,KAAKmT,MAAQnT,KAAKiI,IAAMjI,KAAK0O,MAC7B1O,KAAKsC,IAAMA,EACXtC,KAAK48B,KAAOA,IAAUv/B,EAAOwzB,UAAWjS,GAAS,GAAK,OAEvDlQ,IAAK,WACJ,GAAIgR,GAAQqe,GAAM1b,UAAWriB,KAAK4e,KAElC,OAAOc,IAASA,EAAMxe,IACrBwe,EAAMxe,IAAKlB,MACX+9B,GAAM1b,UAAUgD,SAASnkB,IAAKlB,OAEhC29B,IAAK,SAAUF,GACd,GAAIoB,GACHnf,EAAQqe,GAAM1b,UAAWriB,KAAK4e,KAoB/B,OAjBC5e,MAAKkpB,IAAM2V,EADP7+B,KAAK0C,QAAQ86B,SACEngC,EAAO2gC,OAAQh+B,KAAKg+B,QACtCP,EAASz9B,KAAK0C,QAAQ86B,SAAWC,EAAS,EAAG,EAAGz9B,KAAK0C,QAAQ86B,UAG3CC,EAEpBz9B,KAAKiI,KAAQjI,KAAKsC,IAAMtC,KAAKmT,OAAU0rB,EAAQ7+B,KAAKmT,MAE/CnT,KAAK0C,QAAQo8B,MACjB9+B,KAAK0C,QAAQo8B,KAAK79B,KAAMjB,KAAKD,KAAMC,KAAKiI,IAAKjI,MAGzC0f,GAASA,EAAMf,IACnBe,EAAMf,IAAK3e,MAEX+9B,GAAM1b,UAAUgD,SAAS1G,IAAK3e,MAExBA,OAIT+9B,GAAMp+B,UAAUf,KAAKe,UAAYo+B,GAAMp+B,UAEvCo+B,GAAM1b,WACLgD,UACCnkB,IAAK,SAAUw7B,GACd,GAAI9pB,EAEJ,OAAiC,OAA5B8pB,EAAM38B,KAAM28B,EAAM9d,OACpB8d,EAAM38B,KAAKsI,OAA2C,MAAlCq0B,EAAM38B,KAAKsI,MAAOq0B,EAAM9d,OAQ/ChM,EAASvV,EAAO4yB,IAAKyM,EAAM38B,KAAM28B,EAAM9d,KAAM,IAErChM,GAAqB,SAAXA,EAAwBA,EAAJ,GAT9B8pB,EAAM38B,KAAM28B,EAAM9d,OAW3BD,IAAK,SAAU+d,GAGTr/B,EAAO4iB,GAAG6e,KAAMpC,EAAM9d,MAC1BvhB,EAAO4iB,GAAG6e,KAAMpC,EAAM9d,MAAQ8d,GACnBA,EAAM38B,KAAKsI,QAAgE,MAArDq0B,EAAM38B,KAAKsI,MAAOhL,EAAOg0B,SAAUqL,EAAM9d,QAAoBvhB,EAAOqzB,SAAUgM,EAAM9d,OACrHvhB,EAAOgL,MAAOq0B,EAAM38B,KAAM28B,EAAM9d,KAAM8d,EAAMz0B,IAAMy0B,EAAME,MAExDF,EAAM38B,KAAM28B,EAAM9d,MAAS8d,EAAMz0B,OASrC81B,GAAM1b,UAAUyE,UAAYiX,GAAM1b,UAAUqE,YAC3C/H,IAAK,SAAU+d,GACTA,EAAM38B,KAAKQ,UAAYm8B,EAAM38B,KAAKe,aACtC47B,EAAM38B,KAAM28B,EAAM9d,MAAS8d,EAAMz0B,OAKpC5K,EAAOmE,MAAO,SAAU,OAAQ,QAAU,SAAUU,EAAGS,GACtD,GAAIo8B,GAAQ1hC,EAAOsB,GAAIgE,EACvBtF,GAAOsB,GAAIgE,GAAS,SAAUq8B,EAAOhB,EAAQv8B,GAC5C,MAAgB,OAATu9B,GAAkC,iBAAVA,GAC9BD,EAAMl9B,MAAO7B,KAAM8B,WACnB9B,KAAKi/B,QAASC,GAAOv8B,GAAM,GAAQq8B,EAAOhB,EAAQv8B,MAIrDpE,EAAOsB,GAAG8D,QACT08B,OAAQ,SAAUH,EAAOI,EAAIpB,EAAQv8B,GAGpC,MAAOzB,MAAK+P,OAAQggB,IAAWE,IAAK,UAAW,GAAIG,OAGjD9tB,MAAM28B,SAAUtO,QAASyO,GAAMJ,EAAOhB,EAAQv8B,IAEjDw9B,QAAS,SAAUrgB,EAAMogB,EAAOhB,EAAQv8B,GACvC,GAAIoT,GAAQxX,EAAOqH,cAAeka,GACjCygB,EAAShiC,EAAO2hC,MAAOA,EAAOhB,EAAQv8B,GACtC69B,EAAc,WAEb,GAAIlB,GAAOlB,GAAWl9B,KAAM3C,EAAOoF,UAAYmc,GAAQygB,IAGlDxqB,GAASmJ,EAAU9c,IAAKlB,KAAM,YAClCo+B,EAAKve,MAAM,GAKd,OAFCyf,GAAYC,OAASD,EAEfzqB,GAASwqB,EAAO9f,SAAU,EAChCvf,KAAKwB,KAAM89B,GACXt/B,KAAKuf,MAAO8f,EAAO9f,MAAO+f,IAE5Bzf,KAAM,SAAU5b,EAAMoc,EAAY4d,GACjC,GAAIuB,GAAY,SAAU9f,GACzB,GAAIG,GAAOH,EAAMG,WACVH,GAAMG,KACbA,EAAMoe,GAYP,OATqB,gBAATh6B,KACXg6B,EAAU5d,EACVA,EAAapc,EACbA,EAAOrH,WAEHyjB,GAAcpc,KAAS,GAC3BjE,KAAKuf,MAAOtb,GAAQ,SAGdjE,KAAKwB,KAAK,WAChB,GAAIge,IAAU,EACbpF,EAAgB,MAARnW,GAAgBA,EAAO,aAC/Bw7B,EAASpiC,EAAOoiC,OAChB36B,EAAOkZ,EAAU9c,IAAKlB,KAEvB,IAAKoa,EACCtV,EAAMsV,IAAWtV,EAAMsV,GAAQyF,MACnC2f,EAAW16B,EAAMsV,QAGlB,KAAMA,IAAStV,GACTA,EAAMsV,IAAWtV,EAAMsV,GAAQyF,MAAQyc,GAAK77B,KAAM2Z,IACtDolB,EAAW16B,EAAMsV,GAKpB,KAAMA,EAAQqlB,EAAOv/B,OAAQka,KACvBqlB,EAAQrlB,GAAQra,OAASC,MAAiB,MAARiE,GAAgBw7B,EAAQrlB,GAAQmF,QAAUtb,IAChFw7B,EAAQrlB,GAAQgkB,KAAKve,KAAMoe,GAC3Bze,GAAU,EACVigB,EAAOj9B,OAAQ4X,EAAO,KAOnBoF,IAAYye,IAChB5gC,EAAOmiB,QAASxf,KAAMiE,MAIzBs7B,OAAQ,SAAUt7B,GAIjB,MAHKA,MAAS,IACbA,EAAOA,GAAQ,MAETjE,KAAKwB,KAAK,WAChB,GAAI4Y,GACHtV,EAAOkZ,EAAU9c,IAAKlB,MACtBuf,EAAQza,EAAMb,EAAO,SACrByb,EAAQ5a,EAAMb,EAAO,cACrBw7B,EAASpiC,EAAOoiC,OAChBv/B,EAASqf,EAAQA,EAAMrf,OAAS,CAajC,KAVA4E,EAAKy6B,QAAS,EAGdliC,EAAOkiB,MAAOvf,KAAMiE,MAEfyb,GAASA,EAAMG,MACnBH,EAAMG,KAAK5e,KAAMjB,MAAM,GAIlBoa,EAAQqlB,EAAOv/B,OAAQka,KACvBqlB,EAAQrlB,GAAQra,OAASC,MAAQy/B,EAAQrlB,GAAQmF,QAAUtb,IAC/Dw7B,EAAQrlB,GAAQgkB,KAAKve,MAAM,GAC3B4f,EAAOj9B,OAAQ4X,EAAO,GAKxB,KAAMA,EAAQ,EAAWla,EAARka,EAAgBA,IAC3BmF,EAAOnF,IAAWmF,EAAOnF,GAAQmlB,QACrChgB,EAAOnF,GAAQmlB,OAAOt+B,KAAMjB,YAKvB8E,GAAKy6B,WAMf,SAASL,IAAOj7B,EAAMy7B,GACrB,GAAIvZ,GACH7X,GAAUqxB,OAAQ17B,GAClB/B,EAAI,CAKL,KADAw9B,EAAeA,EAAc,EAAI,EACtB,EAAJx9B,EAAQA,GAAK,EAAIw9B,EACvBvZ,EAAQuJ,GAAWxtB,GACnBoM,EAAO,SAAW6X,GAAU7X,EAAO,UAAY6X,GAAUliB,CAO1D,OAJKy7B,KACJpxB,EAAMqiB,QAAUriB,EAAMuP,MAAQ5Z,GAGxBqK,EAIRjR,EAAOmE,MACNo+B,UAAWV,GAAM,QACjBW,QAASX,GAAM,QACfY,YAAaZ,GAAM,UACnBa,QAAUpP,QAAS,QACnBqP,SAAWrP,QAAS,QACpBsP,YAActP,QAAS,WACrB,SAAUhuB,EAAMojB,GAClB1oB,EAAOsB,GAAIgE,GAAS,SAAUq8B,EAAOhB,EAAQv8B,GAC5C,MAAOzB,MAAKi/B,QAASlZ,EAAOiZ,EAAOhB,EAAQv8B,MAI7CpE,EAAO2hC,MAAQ,SAAUA,EAAOhB,EAAQr/B,GACvC,GAAI2d,GAAM0iB,GAA0B,gBAAVA,GAAqB3hC,EAAOoF,UAAYu8B,IACjE3I,SAAU13B,IAAOA,GAAMq/B,GACtB3gC,EAAOsD,WAAYq+B,IAAWA,EAC/BxB,SAAUwB,EACVhB,OAAQr/B,GAAMq/B,GAAUA,IAAW3gC,EAAOsD,WAAYq9B,IAAYA,EAwBnE,OArBA1hB,GAAIkhB,SAAWngC,EAAO4iB,GAAGlc,IAAM,EAA4B,gBAAjBuY,GAAIkhB,SAAwBlhB,EAAIkhB,SACzElhB,EAAIkhB,WAAYngC,GAAO4iB,GAAGC,OAAS7iB,EAAO4iB,GAAGC,OAAQ5D,EAAIkhB,UAAangC,EAAO4iB,GAAGC,OAAOmF,UAGtE,MAAb/I,EAAIiD,OAAiBjD,EAAIiD,SAAU,KACvCjD,EAAIiD,MAAQ,MAIbjD,EAAIlU,IAAMkU,EAAI+Z,SAEd/Z,EAAI+Z,SAAW,WACTh5B,EAAOsD,WAAY2b,EAAIlU,MAC3BkU,EAAIlU,IAAInH,KAAMjB,MAGVsc,EAAIiD,OACRliB,EAAOmiB,QAASxf,KAAMsc,EAAIiD,QAIrBjD,GAGRjf,EAAO2gC,QACNkC,OAAQ,SAAUC,GACjB,MAAOA,IAERC,MAAO,SAAUD,GAChB,MAAO,GAAM/8B,KAAKi9B,IAAKF,EAAE/8B,KAAKk9B,IAAO,IAIvCjjC,EAAOoiC,UACPpiC,EAAO4iB,GAAK8d,GAAMp+B,UAAUf,KAC5BvB,EAAO4iB,GAAGod,KAAO,WAChB,GAAIc,GACHsB,EAASpiC,EAAOoiC,OAChBv9B,EAAI,CAIL,KAFAg6B,GAAQ7+B,EAAO4K,MAEHw3B,EAAOv/B,OAAXgC,EAAmBA,IAC1Bi8B,EAAQsB,EAAQv9B,GAEVi8B,KAAWsB,EAAQv9B,KAAQi8B,GAChCsB,EAAOj9B,OAAQN,IAAK,EAIhBu9B,GAAOv/B,QACZ7C,EAAO4iB,GAAGJ,OAEXqc,GAAQt/B,WAGTS,EAAO4iB,GAAGke,MAAQ,SAAUA,GACtBA,KAAW9gC,EAAOoiC,OAAO3hC,KAAMqgC,IACnC9gC,EAAO4iB,GAAG9M,SAIZ9V,EAAO4iB,GAAGsgB,SAAW,GAErBljC,EAAO4iB,GAAG9M,MAAQ,WACXgpB,KACLA,GAAUqE,YAAanjC,EAAO4iB,GAAGod,KAAMhgC,EAAO4iB,GAAGsgB,YAInDljC,EAAO4iB,GAAGJ,KAAO,WAChB4gB,cAAetE,IACfA,GAAU,MAGX9+B,EAAO4iB,GAAGC,QACTwgB,KAAM,IACNC,KAAM,IAENtb,SAAU,KAIXhoB,EAAO4iB,GAAG6e,QAELzhC,EAAO8T,MAAQ9T,EAAO8T,KAAKwE,UAC/BtY,EAAO8T,KAAKwE,QAAQirB,SAAW,SAAU7gC,GACxC,MAAO1C,GAAOgK,KAAKhK,EAAOoiC,OAAQ,SAAU9gC,GAC3C,MAAOoB,KAASpB,EAAGoB,OACjBG,SAGL7C,EAAOsB,GAAGkiC,OAAS,SAAUn+B,GAC5B,GAAKZ,UAAU5B,OACd,MAAOwC,KAAY9F,UAClBoD,KACAA,KAAKwB,KAAK,SAAUU,GACnB7E,EAAOwjC,OAAOC,UAAW9gC,KAAM0C,EAASR,IAI3C,IAAIhF,GAAS6jC,EACZhhC,EAAOC,KAAM,GACbghC,GAAQxxB,IAAK,EAAGyxB,KAAM,GACtB7xB,EAAMrP,GAAQA,EAAKS,aAEpB,IAAM4O,EAON,MAHAlS,GAAUkS,EAAIjS,gBAGRE,EAAOmM,SAAUtM,EAAS6C,UAMpBA,GAAKmhC,wBAA0BnkC,IAC1CikC,EAAMjhC,EAAKmhC,yBAEZH,EAAMI,GAAW/xB,IAEhBI,IAAKwxB,EAAIxxB,IAAMuxB,EAAIK,YAAclkC,EAAQ6pB,UACzCka,KAAMD,EAAIC,KAAOF,EAAIM,YAAcnkC,EAAQypB,aAXpCqa,GAeT3jC,EAAOwjC,QAENC,UAAW,SAAU/gC,EAAM2C,EAASR,GACnC,GAAIo/B,GAAaC,EAASC,EAAWC,EAAQC,EAAWC,EAAYC,EACnExS,EAAW/xB,EAAO4yB,IAAKlwB,EAAM,YAC7B8hC,EAAUxkC,EAAQ0C,GAClBgmB,IAGiB,YAAbqJ,IACJrvB,EAAKsI,MAAM+mB,SAAW,YAGvBsS,EAAYG,EAAQhB,SACpBW,EAAYnkC,EAAO4yB,IAAKlwB,EAAM,OAC9B4hC,EAAatkC,EAAO4yB,IAAKlwB,EAAM,QAC/B6hC,GAAmC,aAAbxS,GAAwC,UAAbA,KAA4BoS,EAAYG,GAAazjC,QAAQ,QAAU,GAGnH0jC,GACJN,EAAcO,EAAQzS,WACtBqS,EAASH,EAAY9xB,IACrB+xB,EAAUD,EAAYL,OAGtBQ,EAASn9B,WAAYk9B,IAAe,EACpCD,EAAUj9B,WAAYq9B,IAAgB,GAGlCtkC,EAAOsD,WAAY+B,KACvBA,EAAUA,EAAQzB,KAAMlB,EAAMmC,EAAGw/B,IAGd,MAAfh/B,EAAQ8M,MACZuW,EAAMvW,IAAQ9M,EAAQ8M,IAAMkyB,EAAUlyB,IAAQiyB,GAE1B,MAAhB/+B,EAAQu+B,OACZlb,EAAMkb,KAASv+B,EAAQu+B,KAAOS,EAAUT,KAASM,GAG7C,SAAW7+B,GACfA,EAAQo/B,MAAM7gC,KAAMlB,EAAMgmB,GAG1B8b,EAAQ5R,IAAKlK,KAMhB1oB,EAAOsB,GAAG8D,QAET2sB,SAAU,WACT,GAAMpvB,KAAM,GAAZ,CAIA,GAAI+hC,GAAclB,EACjB9gC,EAAOC,KAAM,GACbgiC,GAAiBxyB,IAAK,EAAGyxB,KAAM,EAuBhC,OApBwC,UAAnC5jC,EAAO4yB,IAAKlwB,EAAM,YAEtB8gC,EAAS9gC,EAAKmhC,yBAIda,EAAe/hC,KAAK+hC,eAGpBlB,EAAS7gC,KAAK6gC,SACRxjC,EAAOsJ,SAAUo7B,EAAc,GAAK,UACzCC,EAAeD,EAAalB,UAI7BmB,EAAaxyB,KAAOnS,EAAO4yB,IAAK8R,EAAc,GAAK,kBAAkB,GACrEC,EAAaf,MAAQ5jC,EAAO4yB,IAAK8R,EAAc,GAAK,mBAAmB,KAKvEvyB,IAAKqxB,EAAOrxB,IAAMwyB,EAAaxyB,IAAMnS,EAAO4yB,IAAKlwB,EAAM,aAAa,GACpEkhC,KAAMJ,EAAOI,KAAOe,EAAaf,KAAO5jC,EAAO4yB,IAAKlwB,EAAM,cAAc,MAI1EgiC,aAAc,WACb,MAAO/hC,MAAKqC,IAAI,WACf,GAAI0/B,GAAe/hC,KAAK+hC,cAAgB7kC,CAExC,OAAQ6kC,IAAmB1kC,EAAOsJ,SAAUo7B,EAAc,SAAsD,WAA1C1kC,EAAO4yB,IAAK8R,EAAc,YAC/FA,EAAeA,EAAaA,YAG7B,OAAOA,IAAgB7kC,OAO1BG,EAAOmE,MAAOklB,WAAY,cAAeI,UAAW,eAAgB,SAAUkS,EAAQpa,GACrF,GAAIpP,GAAM,gBAAkBoP,CAE5BvhB,GAAOsB,GAAIq6B,GAAW,SAAU3nB,GAC/B,MAAOhU,GAAOsK,OAAQ3H,KAAM,SAAUD,EAAMi5B,EAAQ3nB,GACnD,GAAI0vB,GAAMI,GAAWphC,EAErB,OAAKsR,KAAQzU,UACLmkC,EAAMA,EAAKniB,GAAS7e,EAAMi5B,IAG7B+H,EACJA,EAAIkB,SACFzyB,EAAY7S,EAAO0kC,YAAbhwB,EACP7B,EAAM6B,EAAM1U,EAAOykC,aAIpBrhC,EAAMi5B,GAAW3nB,EAPlB,YASE2nB,EAAQ3nB,EAAKvP,UAAU5B,OAAQ,QAIpC,SAASihC,IAAWphC,GACnB,MAAO1C,GAAO8G,SAAUpE,GAASA,EAAyB,IAAlBA,EAAKQ,UAAkBR,EAAKuP,YAGrEjS,EAAOmE,MAAQ0gC,OAAQ,SAAUC,MAAO,SAAW,SAAUx/B,EAAMsB,GAClE5G,EAAOmE,MAAQixB,QAAS,QAAU9vB,EAAMorB,QAAS9pB,EAAM,GAAI,QAAUtB,GAAQ,SAAUy/B,EAAcC,GAEpGhlC,EAAOsB,GAAI0jC,GAAa,SAAU7P,EAAQ3rB,GACzC,GAAIgB,GAAY/F,UAAU5B,SAAYkiC,GAAkC,iBAAX5P,IAC5DjB,EAAQ6Q,IAAkB5P,KAAW,GAAQ3rB,KAAU,EAAO,SAAW,SAE1E,OAAOxJ,GAAOsK,OAAQ3H,KAAM,SAAUD,EAAMkE,EAAM4C,GACjD,GAAIuI,EAEJ,OAAK/R,GAAO8G,SAAUpE,GAIdA,EAAK9C,SAASE,gBAAiB,SAAWwF,GAI3B,IAAlB5C,EAAKQ,UACT6O,EAAMrP,EAAK5C,gBAIJiG,KAAKwe,IACX7hB,EAAKwd,KAAM,SAAW5a,GAAQyM,EAAK,SAAWzM,GAC9C5C,EAAKwd,KAAM,SAAW5a,GAAQyM,EAAK,SAAWzM,GAC9CyM,EAAK,SAAWzM,KAIXkE,IAAUjK,UAEhBS,EAAO4yB,IAAKlwB,EAAMkE,EAAMstB,GAGxBl0B,EAAOgL,MAAOtI,EAAMkE,EAAM4C,EAAO0qB,IAChCttB,EAAM4D,EAAY2qB,EAAS51B,UAAWiL,EAAW,WAQvDxK,EAAOsB,GAAG2jC,KAAO,WAChB,MAAOtiC,MAAKE,QAGb7C,EAAOsB,GAAG4jC,QAAUllC,EAAOsB,GAAGyqB,QAGP,gBAAXoZ,SAAuBA,QAAoC,gBAAnBA,QAAOC,QAK1DD,OAAOC,QAAUplC,EASM,kBAAXqlC,SAAyBA,OAAOC,KAC3CD,OAAQ,YAAc,WAAc,MAAOrlC,KAMtB,gBAAXV,IAAkD,gBAApBA,GAAOM,WAChDN,EAAOU,OAASV,EAAOY,EAAIF,KAGxBV"} \ No newline at end of file
diff --git a/public_html/data/js/vendor/jquery-ui-1.10.3.custom.min.js b/public_html/data/js/vendor/jquery-ui-1.10.3.custom.min.js
new file mode 100644
index 000000000..ad955d90d
--- /dev/null
+++ b/public_html/data/js/vendor/jquery-ui-1.10.3.custom.min.js
@@ -0,0 +1,6 @@
+/*! jQuery UI - v1.10.3 - 2013-06-08
+* http://jqueryui.com
+* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.position.js, jquery.ui.autocomplete.js, jquery.ui.menu.js
+* Copyright 2013 jQuery Foundation and other contributors Licensed MIT */
+
+(function(e,t){function i(t,i){var a,n,r,o=t.nodeName.toLowerCase();return"area"===o?(a=t.parentNode,n=a.name,t.href&&n&&"map"===a.nodeName.toLowerCase()?(r=e("img[usemap=#"+n+"]")[0],!!r&&s(r)):!1):(/input|select|textarea|button|object/.test(o)?!t.disabled:"a"===o?t.href||i:i)&&s(t)}function s(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}var a=0,n=/^ui-id-\d+$/;e.ui=e.ui||{},e.extend(e.ui,{version:"1.10.3",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),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),scrollParent:function(){var t;return t=e.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.css(this,"position"))&&/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!t.length?e(document):t},zIndex:function(i){if(i!==t)return this.css("zIndex",i);if(this.length)for(var s,a,n=e(this[0]);n.length&&n[0]!==document;){if(s=n.css("position"),("absolute"===s||"relative"===s||"fixed"===s)&&(a=parseInt(n.css("zIndex"),10),!isNaN(a)&&0!==a))return a;n=n.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++a)})},removeUniqueId:function(){return this.each(function(){n.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(t){return i(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var s=e.attr(t,"tabindex"),a=isNaN(s);return(a||s>=0)&&i(t,!a)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(i,s){function a(t,i,s,a){return e.each(n,function(){i-=parseFloat(e.css(t,"padding"+this))||0,s&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),a&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var n="Width"===s?["Left","Right"]:["Top","Bottom"],r=s.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+s]=function(i){return i===t?o["inner"+s].call(this):this.each(function(){e(this).css(r,a(this,i)+"px")})},e.fn["outer"+s]=function(t,i){return"number"!=typeof t?o["outer"+s].call(this,t):this.each(function(){e(this).css(r,a(this,t,!0,i)+"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.support.selectstart="onselectstart"in document.createElement("div"),e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),e.extend(e.ui,{plugin:{add:function(t,i,s){var a,n=e.ui[t].prototype;for(a in s)n.plugins[a]=n.plugins[a]||[],n.plugins[a].push([i,s[a]])},call:function(e,t,i){var s,a=e.plugins[t];if(a&&e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType)for(s=0;a.length>s;s++)e.options[a[s][0]]&&a[s][1].apply(e.element,i)}},hasScroll:function(t,i){if("hidden"===e(t).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",a=!1;return t[s]>0?!0:(t[s]=1,a=t[s]>0,t[s]=0,a)}})})(jQuery);(function(e,t){var i=0,s=Array.prototype.slice,n=e.cleanData;e.cleanData=function(t){for(var i,s=0;null!=(i=t[s]);s++)try{e(i).triggerHandler("remove")}catch(a){}n(t)},e.widget=function(i,s,n){var a,r,o,h,l={},u=i.split(".")[0];i=i.split(".")[1],a=u+"-"+i,n||(n=s,s=e.Widget),e.expr[":"][a.toLowerCase()]=function(t){return!!e.data(t,a)},e[u]=e[u]||{},r=e[u][i],o=e[u][i]=function(e,i){return this._createWidget?(arguments.length&&this._createWidget(e,i),t):new o(e,i)},e.extend(o,r,{version:n.version,_proto:e.extend({},n),_childConstructors:[]}),h=new s,h.options=e.widget.extend({},h.options),e.each(n,function(i,n){return e.isFunction(n)?(l[i]=function(){var e=function(){return s.prototype[i].apply(this,arguments)},t=function(e){return s.prototype[i].apply(this,e)};return function(){var i,s=this._super,a=this._superApply;return this._super=e,this._superApply=t,i=n.apply(this,arguments),this._super=s,this._superApply=a,i}}(),t):(l[i]=n,t)}),o.prototype=e.widget.extend(h,{widgetEventPrefix:r?h.widgetEventPrefix:i},l,{constructor:o,namespace:u,widgetName:i,widgetFullName:a}),r?(e.each(r._childConstructors,function(t,i){var s=i.prototype;e.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete r._childConstructors):s._childConstructors.push(o),e.widget.bridge(i,o)},e.widget.extend=function(i){for(var n,a,r=s.call(arguments,1),o=0,h=r.length;h>o;o++)for(n in r[o])a=r[o][n],r[o].hasOwnProperty(n)&&a!==t&&(i[n]=e.isPlainObject(a)?e.isPlainObject(i[n])?e.widget.extend({},i[n],a):e.widget.extend({},a):a);return i},e.widget.bridge=function(i,n){var a=n.prototype.widgetFullName||i;e.fn[i]=function(r){var o="string"==typeof r,h=s.call(arguments,1),l=this;return r=!o&&h.length?e.widget.extend.apply(null,[r].concat(h)):r,o?this.each(function(){var s,n=e.data(this,a);return n?e.isFunction(n[r])&&"_"!==r.charAt(0)?(s=n[r].apply(n,h),s!==n&&s!==t?(l=s&&s.jquery?l.pushStack(s.get()):s,!1):t):e.error("no such method '"+r+"' for "+i+" widget instance"):e.error("cannot call methods on "+i+" prior to initialization; "+"attempted to call method '"+r+"'")}):this.each(function(){var t=e.data(this,a);t?t.option(r||{})._init():e.data(this,a,new n(r,this))}),l}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,s){s=e(s||this.defaultElement||this)[0],this.element=e(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=e(),this.hoverable=e(),this.focusable=e(),s!==this&&(e.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===s&&this.destroy()}}),this.document=e(s.style?s.ownerDocument:s.document||s),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),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.widgetName).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(i,s){var n,a,r,o=i;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof i)if(o={},n=i.split("."),i=n.shift(),n.length){for(a=o[i]=e.widget.extend({},this.options[i]),r=0;n.length-1>r;r++)a[n[r]]=a[n[r]]||{},a=a[n[r]];if(i=n.pop(),s===t)return a[i]===t?null:a[i];a[i]=s}else{if(s===t)return this.options[i]===t?null:this.options[i];o[i]=s}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!t).attr("aria-disabled",t),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(i,s,n){var a,r=this;"boolean"!=typeof i&&(n=s,s=i,i=!1),n?(s=a=e(s),this.bindings=this.bindings.add(s)):(n=s,s=this.element,a=this.widget()),e.each(n,function(n,o){function h(){return i||r.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof o?r[o]:o).apply(r,arguments):t}"string"!=typeof o&&(h.guid=o.guid=o.guid||h.guid||e.guid++);var l=n.match(/^(\w+)\s*(.*)$/),u=l[1]+r.eventNamespace,c=l[2];c?a.delegate(c,u,h):s.bind(u,h)})},_off:function(e,t){t=(t||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.unbind(t).undelegate(t)},_delay:function(e,t){function i(){return("string"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,s){var n,a,r=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],a=i.originalEvent)for(n in a)n in i||(i[n]=a[n]);return this.element.trigger(i,s),!(e.isFunction(r)&&r.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(s,n,a){"string"==typeof n&&(n={effect:n});var r,o=n?n===!0||"number"==typeof n?i:n.effect||i:t;n=n||{},"number"==typeof n&&(n={duration:n}),r=!e.isEmptyObject(n),n.complete=a,n.delay&&s.delay(n.delay),r&&e.effects&&e.effects.effect[o]?s[t](n):o!==t&&s[o]?s[o](n.duration,n.easing,a):s.queue(function(i){e(this)[t](),a&&a.call(s[0]),i()})}})})(jQuery);(function(t,e){function i(t,e,i){return[parseFloat(t[0])*(p.test(t[0])?e/100:1),parseFloat(t[1])*(p.test(t[1])?i/100:1)]}function s(e,i){return parseInt(t.css(e,i),10)||0}function n(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}t.ui=t.ui||{};var a,o=Math.max,r=Math.abs,h=Math.round,l=/left|center|right/,c=/top|center|bottom/,u=/[\+\-]\d+(\.[\d]+)?%?/,d=/^\w+/,p=/%$/,f=t.fn.position;t.position={scrollbarWidth:function(){if(a!==e)return a;var i,s,n=t("<div style='display:block;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=n.children()[0];return t("body").append(n),i=o.offsetWidth,n.css("overflow","scroll"),s=o.offsetWidth,i===s&&(s=n[0].clientWidth),n.remove(),a=i-s},getScrollInfo:function(e){var i=e.isWindow?"":e.element.css("overflow-x"),s=e.isWindow?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.width<e.element[0].scrollWidth,a="scroll"===s||"auto"===s&&e.height<e.element[0].scrollHeight;return{width:a?t.position.scrollbarWidth():0,height:n?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var i=t(e||window),s=t.isWindow(i[0]);return{element:i,isWindow:s,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:s?i.width():i.outerWidth(),height:s?i.height():i.outerHeight()}}},t.fn.position=function(e){if(!e||!e.of)return f.apply(this,arguments);e=t.extend({},e);var a,p,m,g,v,b,_=t(e.of),y=t.position.getWithinInfo(e.within),w=t.position.getScrollInfo(y),x=(e.collision||"flip").split(" "),k={};return b=n(_),_[0].preventDefault&&(e.at="left top"),p=b.width,m=b.height,g=b.offset,v=t.extend({},g),t.each(["my","at"],function(){var t,i,s=(e[this]||"").split(" ");1===s.length&&(s=l.test(s[0])?s.concat(["center"]):c.test(s[0])?["center"].concat(s):["center","center"]),s[0]=l.test(s[0])?s[0]:"center",s[1]=c.test(s[1])?s[1]:"center",t=u.exec(s[0]),i=u.exec(s[1]),k[this]=[t?t[0]:0,i?i[0]:0],e[this]=[d.exec(s[0])[0],d.exec(s[1])[0]]}),1===x.length&&(x[1]=x[0]),"right"===e.at[0]?v.left+=p:"center"===e.at[0]&&(v.left+=p/2),"bottom"===e.at[1]?v.top+=m:"center"===e.at[1]&&(v.top+=m/2),a=i(k.at,p,m),v.left+=a[0],v.top+=a[1],this.each(function(){var n,l,c=t(this),u=c.outerWidth(),d=c.outerHeight(),f=s(this,"marginLeft"),b=s(this,"marginTop"),D=u+f+s(this,"marginRight")+w.width,T=d+b+s(this,"marginBottom")+w.height,C=t.extend({},v),M=i(k.my,c.outerWidth(),c.outerHeight());"right"===e.my[0]?C.left-=u:"center"===e.my[0]&&(C.left-=u/2),"bottom"===e.my[1]?C.top-=d:"center"===e.my[1]&&(C.top-=d/2),C.left+=M[0],C.top+=M[1],t.support.offsetFractions||(C.left=h(C.left),C.top=h(C.top)),n={marginLeft:f,marginTop:b},t.each(["left","top"],function(i,s){t.ui.position[x[i]]&&t.ui.position[x[i]][s](C,{targetWidth:p,targetHeight:m,elemWidth:u,elemHeight:d,collisionPosition:n,collisionWidth:D,collisionHeight:T,offset:[a[0]+M[0],a[1]+M[1]],my:e.my,at:e.at,within:y,elem:c})}),e.using&&(l=function(t){var i=g.left-C.left,s=i+p-u,n=g.top-C.top,a=n+m-d,h={target:{element:_,left:g.left,top:g.top,width:p,height:m},element:{element:c,left:C.left,top:C.top,width:u,height:d},horizontal:0>s?"left":i>0?"right":"center",vertical:0>a?"top":n>0?"bottom":"middle"};u>p&&p>r(i+s)&&(h.horizontal="center"),d>m&&m>r(n+a)&&(h.vertical="middle"),h.important=o(r(i),r(s))>o(r(n),r(a))?"horizontal":"vertical",e.using.call(this,t,h)}),c.offset(t.extend(C,{using:l}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=t.left-e.collisionPosition.marginLeft,h=n-r,l=r+e.collisionWidth-a-n;e.collisionWidth>a?h>0&&0>=l?(i=t.left+h+e.collisionWidth-a-n,t.left+=h-i):t.left=l>0&&0>=h?n:h>l?n+a-e.collisionWidth:n:h>0?t.left+=h:l>0?t.left-=l:t.left=o(t.left-r,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,a=e.within.height,r=t.top-e.collisionPosition.marginTop,h=n-r,l=r+e.collisionHeight-a-n;e.collisionHeight>a?h>0&&0>=l?(i=t.top+h+e.collisionHeight-a-n,t.top+=h-i):t.top=l>0&&0>=h?n:h>l?n+a-e.collisionHeight:n:h>0?t.top+=h:l>0?t.top-=l:t.top=o(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,a=n.offset.left+n.scrollLeft,o=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=t.left-e.collisionPosition.marginLeft,c=l-h,u=l+e.collisionWidth-o-h,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(i=t.left+d+p+f+e.collisionWidth-o-a,(0>i||r(c)>i)&&(t.left+=d+p+f)):u>0&&(s=t.left-e.collisionPosition.marginLeft+d+p+f-h,(s>0||u>r(s))&&(t.left+=d+p+f))},top:function(t,e){var i,s,n=e.within,a=n.offset.top+n.scrollTop,o=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=t.top-e.collisionPosition.marginTop,c=l-h,u=l+e.collisionHeight-o-h,d="top"===e.my[1],p=d?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,m=-2*e.offset[1];0>c?(s=t.top+p+f+m+e.collisionHeight-o-a,t.top+p+f+m>c&&(0>s||r(c)>s)&&(t.top+=p+f+m)):u>0&&(i=t.top-e.collisionPosition.marginTop+p+f+m-h,t.top+p+f+m>u&&(i>0||u>r(i))&&(t.top+=p+f+m))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}},function(){var e,i,s,n,a,o=document.getElementsByTagName("body")[0],r=document.createElement("div");e=document.createElement(o?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},o&&t.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"});for(a in s)e.style[a]=s[a];e.appendChild(r),i=o||document.documentElement,i.insertBefore(e,i.firstChild),r.style.cssText="position: absolute; left: 10.7432222px;",n=t(r).offset().left,t.support.offsetFractions=n>10&&11>n,e.innerHTML="",i.removeChild(e)}()})(jQuery);(function(t){var e=0;t.widget("ui.autocomplete",{version:"1.10.3",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},pending:0,_create:function(){var e,i,s,n=this.element[0].nodeName.toLowerCase(),a="textarea"===n,o="input"===n;this.isMultiLine=a?!0:o?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[a||o?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return e=!0,s=!0,i=!0,undefined;e=!1,s=!1,i=!1;var a=t.ui.keyCode;switch(n.keyCode){case a.PAGE_UP:e=!0,this._move("previousPage",n);break;case a.PAGE_DOWN:e=!0,this._move("nextPage",n);break;case a.UP:e=!0,this._keyEvent("previous",n);break;case a.DOWN:e=!0,this._keyEvent("next",n);break;case a.ENTER:case a.NUMPAD_ENTER:this.menu.active&&(e=!0,n.preventDefault(),this.menu.select(n));break;case a.TAB:this.menu.active&&this.menu.select(n);break;case a.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(e)return e=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),undefined;if(!i){var n=t.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(t){return s?(s=!1,t.preventDefault(),undefined):(this._searchTimeout(t),undefined)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(t){return this.cancelBlur?(delete this.cancelBlur,undefined):(clearTimeout(this.searching),this.close(t),this._change(t),undefined)}}),this._initSource(),this.menu=t("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().data("ui-menu"),this._on(this.menu.element,{mousedown:function(e){e.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var i=this.menu.element[0];t(e.target).closest(".ui-menu-item").length||this._delay(function(){var e=this;this.document.one("mousedown",function(s){s.target===e.element[0]||s.target===i||t.contains(i,s.target)||e.close()})})},menufocus:function(e,i){if(this.isNewMenu&&(this.isNewMenu=!1,e.originalEvent&&/^mouse/.test(e.originalEvent.type)))return this.menu.blur(),this.document.one("mousemove",function(){t(e.target).trigger(e.originalEvent)}),undefined;var s=i.item.data("ui-autocomplete-item");!1!==this._trigger("focus",e,{item:s})?e.originalEvent&&/^key/.test(e.originalEvent.type)&&this._value(s.value):this.liveRegion.text(s.value)},menuselect:function(t,e){var i=e.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",t,{item:i})&&this._value(i.value),this.term=this._value(),this.close(t),this.selectedItem=i}}),this.liveRegion=t("<span>",{role:"status","aria-live":"polite"}).addClass("ui-helper-hidden-accessible").insertBefore(this.element),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(t,e){this._super(t,e),"source"===t&&this._initSource(),"appendTo"===t&&this.menu.element.appendTo(this._appendTo()),"disabled"===t&&e&&this.xhr&&this.xhr.abort()},_appendTo:function(){var e=this.options.appendTo;return e&&(e=e.jquery||e.nodeType?t(e):this.document.find(e).eq(0)),e||(e=this.element.closest(".ui-front")),e.length||(e=this.document[0].body),e},_initSource:function(){var e,i,s=this;t.isArray(this.options.source)?(e=this.options.source,this.source=function(i,s){s(t.ui.autocomplete.filter(e,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(e,n){s.xhr&&s.xhr.abort(),s.xhr=t.ajax({url:i,data:e,dataType:"json",success:function(t){n(t)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(t){clearTimeout(this.searching),this.searching=this._delay(function(){this.term!==this._value()&&(this.selectedItem=null,this.search(null,t))},this.options.delay)},search:function(t,e){return t=null!=t?t:this._value(),this.term=this._value(),t.length<this.options.minLength?this.close(e):this._trigger("search",e)!==!1?this._search(t):undefined},_search:function(t){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:t},this._response())},_response:function(){var t=this,i=++e;return function(s){i===e&&t.__response(s),t.pending--,t.pending||t.element.removeClass("ui-autocomplete-loading")}},__response:function(t){t&&(t=this._normalize(t)),this._trigger("response",null,{content:t}),!this.options.disabled&&t&&t.length&&!this.cancelSearch?(this._suggest(t),this._trigger("open")):this._close()},close:function(t){this.cancelSearch=!0,this._close(t)},_close:function(t){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",t))},_change:function(t){this.previous!==this._value()&&this._trigger("change",t,{item:this.selectedItem})},_normalize:function(e){return e.length&&e[0].label&&e[0].value?e:t.map(e,function(e){return"string"==typeof e?{label:e,value:e}:t.extend({label:e.label||e.value,value:e.value||e.label},e)})},_suggest:function(e){var i=this.menu.element.empty();this._renderMenu(i,e),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(t.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var t=this.menu.element;t.outerWidth(Math.max(t.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(e,i){var s=this;t.each(i,function(t,i){s._renderItemData(e,i)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-autocomplete-item",e)},_renderItem:function(e,i){return t("<li>").append(t("<a>").text(i.label)).appendTo(e)},_move:function(t,e){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(t)||this.menu.isLastItem()&&/^next/.test(t)?(this._value(this.term),this.menu.blur(),undefined):(this.menu[t](e),undefined):(this.search(null,e),undefined)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(t,e){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(t,e),e.preventDefault())}}),t.extend(t.ui.autocomplete,{escapeRegex:function(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(e,i){var s=RegExp(t.ui.autocomplete.escapeRegex(i),"i");return t.grep(e,function(t){return s.test(t.label||t.value||t)})}}),t.widget("ui.autocomplete",t.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(t){return t+(t>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){var e;this._superApply(arguments),this.options.disabled||this.cancelSearch||(e=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,this.liveRegion.text(e))}})})(jQuery);(function(t){t.widget("ui.menu",{version:"1.10.3",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content ui-corner-all").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}).bind("click"+this.eventNamespace,t.proxy(function(t){this.options.disabled&&t.preventDefault()},this)),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item > a":function(t){t.preventDefault()},"click .ui-state-disabled > a":function(t){t.preventDefault()},"click .ui-menu-item:has(a)":function(e){var i=t(e.target).closest(".ui-menu-item");!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.mouseHandled=!0,this.select(e),i.has(".ui-menu").length?this.expand(e):this.element.is(":focus")||(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(e){var i=t(e.currentTarget);i.siblings().children(".ui-state-active").removeClass("ui-state-active"),this.focus(e,i)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this.element.children(".ui-menu-item").eq(0);e||this.focus(t,i)},blur:function(e){this._delay(function(){t.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){t(e.target).closest(".ui-menu").length||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-corner-all ui-menu-icons").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").children("a").removeUniqueId().removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var e=t(this);e.data("ui-menu-submenu-carat")&&e.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(e){function i(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var s,n,a,o,r,h=!0;switch(e.keyCode){case t.ui.keyCode.PAGE_UP:this.previousPage(e);break;case t.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case t.ui.keyCode.HOME:this._move("first","first",e);break;case t.ui.keyCode.END:this._move("last","last",e);break;case t.ui.keyCode.UP:this.previous(e);break;case t.ui.keyCode.DOWN:this.next(e);break;case t.ui.keyCode.LEFT:this.collapse(e);break;case t.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:this._activate(e);break;case t.ui.keyCode.ESCAPE:this.collapse(e);break;default:h=!1,n=this.previousFilter||"",a=String.fromCharCode(e.keyCode),o=!1,clearTimeout(this.filterTimer),a===n?o=!0:a=n+a,r=RegExp("^"+i(a),"i"),s=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(t(this).children("a").text())}),s=o&&-1!==s.index(this.active.next())?this.active.nextAll(".ui-menu-item"):s,s.length||(a=String.fromCharCode(e.keyCode),r=RegExp("^"+i(a),"i"),s=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(t(this).children("a").text())})),s.length?(this.focus(e,s),s.length>1?(this.previousFilter=a,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}h&&e.preventDefault()},_activate:function(t){this.active.is(".ui-state-disabled")||(this.active.children("a[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var e,i=this.options.icons.submenu,s=this.element.find(this.options.menus);s.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=t(this),s=e.prev("a"),n=t("<span>").addClass("ui-menu-icon ui-icon "+i).data("ui-menu-submenu-carat",!0);s.attr("aria-haspopup","true").prepend(n),e.attr("aria-labelledby",s.attr("id"))}),e=s.add(this.element),e.children(":not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","presentation").children("a").uniqueId().addClass("ui-corner-all").attr({tabIndex:-1,role:this._itemRole()}),e.children(":not(.ui-menu-item)").each(function(){var e=t(this);/[^\-\u2014\u2013\s]/.test(e.text())||e.addClass("ui-widget-content ui-menu-divider")}),e.children(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!t.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){"icons"===t&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(e.submenu),this._super(t,e)},focus:function(t,e){var i,s;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),s=this.active.children("a").addClass("ui-state-focus"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=e.children(".ui-menu"),i.length&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(e){var i,s,n,a,o,r;this._hasScroll()&&(i=parseFloat(t.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(t.css(this.activeMenu[0],"paddingTop"))||0,n=e.offset().top-this.activeMenu.offset().top-i-s,a=this.activeMenu.scrollTop(),o=this.activeMenu.height(),r=e.height(),0>n?this.activeMenu.scrollTop(a+n):n+r>o&&this.activeMenu.scrollTop(a+n-o+r))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this.active.children("a").removeClass("ui-state-focus"),this.active=null,this._trigger("blur",t,{item:this.active}))},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(e){var i=t.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true"),e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(e,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:t(e&&e.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(e),this.activeMenu=s},this.delay)},_close:function(t){t||(t=this.active?this.active.parent():this.element),t.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active")},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},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(t,e,i){var s;this.active&&(s="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.children(".ui-menu-item")[e]()),this.focus(i,s)},nextPage:function(e){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=t(this),0>i.offset().top-s-n}),this.focus(e,i)):this.focus(e,this.activeMenu.children(".ui-menu-item")[this.active?"last":"first"]())),undefined):(this.next(e),undefined)},previousPage:function(e){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=t(this),i.offset().top-s+n>0}),this.focus(e,i)):this.focus(e,this.activeMenu.children(".ui-menu-item").first())),undefined):(this.next(e),undefined)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(e){this.active=this.active||t(e.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(e,!0),this._trigger("select",e,i)}})})(jQuery); \ No newline at end of file
diff --git a/public_html/data/js/vendor/jquery-ui.js b/public_html/data/js/vendor/jquery-ui.js
new file mode 100644
index 000000000..b17df82bd
--- /dev/null
+++ b/public_html/data/js/vendor/jquery-ui.js
@@ -0,0 +1,4825 @@
+/*! jQuery UI - v1.12.1 - 2016-09-19
+* http://jqueryui.com
+* Includes: widget.js, position.js, data.js, disable-selection.js, focusable.js, form-reset-mixin.js, jquery-1-7.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/sortable.js, widgets/autocomplete.js, widgets/menu.js, widgets/mouse.js
+* Copyright jQuery Foundation and other contributors; Licensed MIT */
+
+(function( factory ) {
+ if ( typeof define === "function" && define.amd ) {
+
+ // AMD. Register as an anonymous module.
+ define([ "jquery" ], factory );
+ } else {
+
+ // Browser globals
+ factory( jQuery );
+ }
+}(function( $ ) {
+
+$.ui = $.ui || {};
+
+var version = $.ui.version = "1.12.1";
+
+
+/*!
+ * jQuery UI Widget 1.12.1
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ */
+
+//>>label: Widget
+//>>group: Core
+//>>description: Provides a factory for creating stateful widgets with a common API.
+//>>docs: http://api.jqueryui.com/jQuery.widget/
+//>>demos: http://jqueryui.com/widget/
+
+
+
+var widgetUuid = 0;
+var widgetSlice = Array.prototype.slice;
+
+$.cleanData = ( function( orig ) {
+ return function( elems ) {
+ var events, elem, i;
+ for ( i = 0; ( elem = elems[ i ] ) != null; i++ ) {
+ try {
+
+ // Only trigger remove when necessary to save time
+ events = $._data( elem, "events" );
+ if ( events && events.remove ) {
+ $( elem ).triggerHandler( "remove" );
+ }
+
+ // Http://bugs.jquery.com/ticket/8235
+ } catch ( e ) {}
+ }
+ orig( elems );
+ };
+} )( $.cleanData );
+
+$.widget = function( name, base, prototype ) {
+ var existingConstructor, constructor, basePrototype;
+
+ // ProxiedPrototype allows the provided prototype to remain unmodified
+ // so that it can be used as a mixin for multiple widgets (#8876)
+ var proxiedPrototype = {};
+
+ var namespace = name.split( "." )[ 0 ];
+ name = name.split( "." )[ 1 ];
+ var fullName = namespace + "-" + name;
+
+ if ( !prototype ) {
+ prototype = base;
+ base = $.Widget;
+ }
+
+ if ( $.isArray( prototype ) ) {
+ prototype = $.extend.apply( null, [ {} ].concat( prototype ) );
+ }
+
+ // Create selector for plugin
+ $.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) {
+ return !!$.data( elem, fullName );
+ };
+
+ $[ namespace ] = $[ namespace ] || {};
+ existingConstructor = $[ namespace ][ name ];
+ constructor = $[ namespace ][ name ] = function( options, element ) {
+
+ // Allow instantiation without "new" keyword
+ if ( !this._createWidget ) {
+ return new constructor( options, element );
+ }
+
+ // Allow instantiation without initializing for simple inheritance
+ // must use "new" keyword (the code above always passes args)
+ if ( arguments.length ) {
+ this._createWidget( options, element );
+ }
+ };
+
+ // Extend with the existing constructor to carry over any static properties
+ $.extend( constructor, existingConstructor, {
+ version: prototype.version,
+
+ // Copy the object used to create the prototype in case we need to
+ // redefine the widget later
+ _proto: $.extend( {}, prototype ),
+
+ // Track widgets that inherit from this widget in case this widget is
+ // redefined after a widget inherits from it
+ _childConstructors: []
+ } );
+
+ basePrototype = new base();
+
+ // We need to make the options hash a property directly on the new instance
+ // otherwise we'll modify the options hash on the prototype that we're
+ // inheriting from
+ basePrototype.options = $.widget.extend( {}, basePrototype.options );
+ $.each( prototype, function( prop, value ) {
+ if ( !$.isFunction( value ) ) {
+ proxiedPrototype[ prop ] = value;
+ return;
+ }
+ proxiedPrototype[ prop ] = ( function() {
+ function _super() {
+ return base.prototype[ prop ].apply( this, arguments );
+ }
+
+ function _superApply( args ) {
+ return base.prototype[ prop ].apply( this, args );
+ }
+
+ return function() {
+ var __super = this._super;
+ var __superApply = this._superApply;
+ var returnValue;
+
+ this._super = _super;
+ this._superApply = _superApply;
+
+ returnValue = value.apply( this, arguments );
+
+ this._super = __super;
+ this._superApply = __superApply;
+
+ return returnValue;
+ };
+ } )();
+ } );
+ constructor.prototype = $.widget.extend( basePrototype, {
+
+ // TODO: remove support for widgetEventPrefix
+ // always use the name + a colon as the prefix, e.g., draggable:start
+ // don't prefix for widgets that aren't DOM-based
+ widgetEventPrefix: existingConstructor ? ( basePrototype.widgetEventPrefix || name ) : name
+ }, proxiedPrototype, {
+ constructor: constructor,
+ namespace: namespace,
+ widgetName: name,
+ widgetFullName: fullName
+ } );
+
+ // If this widget is being redefined then we need to find all widgets that
+ // are inheriting from it and redefine all of them so that they inherit from
+ // the new version of this widget. We're essentially trying to replace one
+ // level in the prototype chain.
+ if ( existingConstructor ) {
+ $.each( existingConstructor._childConstructors, function( i, child ) {
+ var childPrototype = child.prototype;
+
+ // Redefine the child widget using the same prototype that was
+ // originally used, but inherit from the new version of the base
+ $.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor,
+ child._proto );
+ } );
+
+ // Remove the list of existing child constructors from the old constructor
+ // so the old child constructors can be garbage collected
+ delete existingConstructor._childConstructors;
+ } else {
+ base._childConstructors.push( constructor );
+ }
+
+ $.widget.bridge( name, constructor );
+
+ return constructor;
+};
+
+$.widget.extend = function( target ) {
+ var input = widgetSlice.call( arguments, 1 );
+ var inputIndex = 0;
+ var inputLength = input.length;
+ var key;
+ var value;
+
+ for ( ; inputIndex < inputLength; inputIndex++ ) {
+ for ( key in input[ inputIndex ] ) {
+ value = input[ inputIndex ][ key ];
+ if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) {
+
+ // Clone objects
+ if ( $.isPlainObject( value ) ) {
+ target[ key ] = $.isPlainObject( target[ key ] ) ?
+ $.widget.extend( {}, target[ key ], value ) :
+
+ // Don't extend strings, arrays, etc. with objects
+ $.widget.extend( {}, value );
+
+ // Copy everything else by reference
+ } else {
+ target[ key ] = value;
+ }
+ }
+ }
+ }
+ return target;
+};
+
+$.widget.bridge = function( name, object ) {
+ var fullName = object.prototype.widgetFullName || name;
+ $.fn[ name ] = function( options ) {
+ var isMethodCall = typeof options === "string";
+ var args = widgetSlice.call( arguments, 1 );
+ var returnValue = this;
+
+ if ( isMethodCall ) {
+
+ // If this is an empty collection, we need to have the instance method
+ // return undefined instead of the jQuery instance
+ if ( !this.length && options === "instance" ) {
+ returnValue = undefined;
+ } else {
+ this.each( function() {
+ var methodValue;
+ var instance = $.data( this, fullName );
+
+ if ( options === "instance" ) {
+ returnValue = instance;
+ return false;
+ }
+
+ if ( !instance ) {
+ return $.error( "cannot call methods on " + name +
+ " prior to initialization; " +
+ "attempted to call method '" + options + "'" );
+ }
+
+ if ( !$.isFunction( instance[ options ] ) || options.charAt( 0 ) === "_" ) {
+ return $.error( "no such method '" + options + "' for " + name +
+ " widget instance" );
+ }
+
+ methodValue = instance[ options ].apply( instance, args );
+
+ if ( methodValue !== instance && methodValue !== undefined ) {
+ returnValue = methodValue && methodValue.jquery ?
+ returnValue.pushStack( methodValue.get() ) :
+ methodValue;
+ return false;
+ }
+ } );
+ }
+ } else {
+
+ // Allow multiple hashes to be passed on init
+ if ( args.length ) {
+ options = $.widget.extend.apply( null, [ options ].concat( args ) );
+ }
+
+ this.each( function() {
+ var instance = $.data( this, fullName );
+ if ( instance ) {
+ instance.option( options || {} );
+ if ( instance._init ) {
+ instance._init();
+ }
+ } else {
+ $.data( this, fullName, new object( options, this ) );
+ }
+ } );
+ }
+
+ return returnValue;
+ };
+};
+
+$.Widget = function( /* options, element */ ) {};
+$.Widget._childConstructors = [];
+
+$.Widget.prototype = {
+ widgetName: "widget",
+ widgetEventPrefix: "",
+ defaultElement: "<div>",
+
+ options: {
+ classes: {},
+ disabled: false,
+
+ // Callbacks
+ create: null
+ },
+
+ _createWidget: function( options, element ) {
+ element = $( element || this.defaultElement || this )[ 0 ];
+ this.element = $( element );
+ this.uuid = widgetUuid++;
+ this.eventNamespace = "." + this.widgetName + this.uuid;
+
+ this.bindings = $();
+ this.hoverable = $();
+ this.focusable = $();
+ this.classesElementLookup = {};
+
+ if ( element !== this ) {
+ $.data( element, this.widgetFullName, this );
+ this._on( true, this.element, {
+ remove: function( event ) {
+ if ( event.target === element ) {
+ this.destroy();
+ }
+ }
+ } );
+ this.document = $( element.style ?
+
+ // Element within the document
+ element.ownerDocument :
+
+ // Element is window or document
+ element.document || element );
+ this.window = $( this.document[ 0 ].defaultView || this.document[ 0 ].parentWindow );
+ }
+
+ this.options = $.widget.extend( {},
+ this.options,
+ this._getCreateOptions(),
+ options );
+
+ this._create();
+
+ if ( this.options.disabled ) {
+ this._setOptionDisabled( this.options.disabled );
+ }
+
+ this._trigger( "create", null, this._getCreateEventData() );
+ this._init();
+ },
+
+ _getCreateOptions: function() {
+ return {};
+ },
+
+ _getCreateEventData: $.noop,
+
+ _create: $.noop,
+
+ _init: $.noop,
+
+ destroy: function() {
+ var that = this;
+
+ this._destroy();
+ $.each( this.classesElementLookup, function( key, value ) {
+ that._removeClass( value, key );
+ } );
+
+ // We can probably remove the unbind calls in 2.0
+ // all event bindings should go through this._on()
+ this.element
+ .off( this.eventNamespace )
+ .removeData( this.widgetFullName );
+ this.widget()
+ .off( this.eventNamespace )
+ .removeAttr( "aria-disabled" );
+
+ // Clean up events and states
+ this.bindings.off( this.eventNamespace );
+ },
+
+ _destroy: $.noop,
+
+ widget: function() {
+ return this.element;
+ },
+
+ option: function( key, value ) {
+ var options = key;
+ var parts;
+ var curOption;
+ var i;
+
+ if ( arguments.length === 0 ) {
+
+ // Don't return a reference to the internal hash
+ return $.widget.extend( {}, this.options );
+ }
+
+ if ( typeof key === "string" ) {
+
+ // Handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } }
+ options = {};
+ parts = key.split( "." );
+ key = parts.shift();
+ if ( parts.length ) {
+ curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] );
+ for ( i = 0; i < parts.length - 1; i++ ) {
+ curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {};
+ curOption = curOption[ parts[ i ] ];
+ }
+ key = parts.pop();
+ if ( arguments.length === 1 ) {
+ return curOption[ key ] === undefined ? null : curOption[ key ];
+ }
+ curOption[ key ] = value;
+ } else {
+ if ( arguments.length === 1 ) {
+ return this.options[ key ] === undefined ? null : this.options[ key ];
+ }
+ options[ key ] = value;
+ }
+ }
+
+ this._setOptions( options );
+
+ return this;
+ },
+
+ _setOptions: function( options ) {
+ var key;
+
+ for ( key in options ) {
+ this._setOption( key, options[ key ] );
+ }
+
+ return this;
+ },
+
+ _setOption: function( key, value ) {
+ if ( key === "classes" ) {
+ this._setOptionClasses( value );
+ }
+
+ this.options[ key ] = value;
+
+ if ( key === "disabled" ) {
+ this._setOptionDisabled( value );
+ }
+
+ return this;
+ },
+
+ _setOptionClasses: function( value ) {
+ var classKey, elements, currentElements;
+
+ for ( classKey in value ) {
+ currentElements = this.classesElementLookup[ classKey ];
+ if ( value[ classKey ] === this.options.classes[ classKey ] ||
+ !currentElements ||
+ !currentElements.length ) {
+ continue;
+ }
+
+ // We are doing this to create a new jQuery object because the _removeClass() call
+ // on the next line is going to destroy the reference to the current elements being
+ // tracked. We need to save a copy of this collection so that we can add the new classes
+ // below.
+ elements = $( currentElements.get() );
+ this._removeClass( currentElements, classKey );
+
+ // We don't use _addClass() here, because that uses this.options.classes
+ // for generating the string of classes. We want to use the value passed in from
+ // _setOption(), this is the new value of the classes option which was passed to
+ // _setOption(). We pass this value directly to _classes().
+ elements.addClass( this._classes( {
+ element: elements,
+ keys: classKey,
+ classes: value,
+ add: true
+ } ) );
+ }
+ },
+
+ _setOptionDisabled: function( value ) {
+ this._toggleClass( this.widget(), this.widgetFullName + "-disabled", null, !!value );
+
+ // If the widget is becoming disabled, then nothing is interactive
+ if ( value ) {
+ this._removeClass( this.hoverable, null, "ui-state-hover" );
+ this._removeClass( this.focusable, null, "ui-state-focus" );
+ }
+ },
+
+ enable: function() {
+ return this._setOptions( { disabled: false } );
+ },
+
+ disable: function() {
+ return this._setOptions( { disabled: true } );
+ },
+
+ _classes: function( options ) {
+ var full = [];
+ var that = this;
+
+ options = $.extend( {
+ element: this.element,
+ classes: this.options.classes || {}
+ }, options );
+
+ function processClassString( classes, checkOption ) {
+ var current, i;
+ for ( i = 0; i < classes.length; i++ ) {
+ current = that.classesElementLookup[ classes[ i ] ] || $();
+ if ( options.add ) {
+ current = $( $.unique( current.get().concat( options.element.get() ) ) );
+ } else {
+ current = $( current.not( options.element ).get() );
+ }
+ that.classesElementLookup[ classes[ i ] ] = current;
+ full.push( classes[ i ] );
+ if ( checkOption && options.classes[ classes[ i ] ] ) {
+ full.push( options.classes[ classes[ i ] ] );
+ }
+ }
+ }
+
+ this._on( options.element, {
+ "remove": "_untrackClassesElement"
+ } );
+
+ if ( options.keys ) {
+ processClassString( options.keys.match( /\S+/g ) || [], true );
+ }
+ if ( options.extra ) {
+ processClassString( options.extra.match( /\S+/g ) || [] );
+ }
+
+ return full.join( " " );
+ },
+
+ _untrackClassesElement: function( event ) {
+ var that = this;
+ $.each( that.classesElementLookup, function( key, value ) {
+ if ( $.inArray( event.target, value ) !== -1 ) {
+ that.classesElementLookup[ key ] = $( value.not( event.target ).get() );
+ }
+ } );
+ },
+
+ _removeClass: function( element, keys, extra ) {
+ return this._toggleClass( element, keys, extra, false );
+ },
+
+ _addClass: function( element, keys, extra ) {
+ return this._toggleClass( element, keys, extra, true );
+ },
+
+ _toggleClass: function( element, keys, extra, add ) {
+ add = ( typeof add === "boolean" ) ? add : extra;
+ var shift = ( typeof element === "string" || element === null ),
+ options = {
+ extra: shift ? keys : extra,
+ keys: shift ? element : keys,
+ element: shift ? this.element : element,
+ add: add
+ };
+ options.element.toggleClass( this._classes( options ), add );
+ return this;
+ },
+
+ _on: function( suppressDisabledCheck, element, handlers ) {
+ var delegateElement;
+ var instance = this;
+
+ // No suppressDisabledCheck flag, shuffle arguments
+ if ( typeof suppressDisabledCheck !== "boolean" ) {
+ handlers = element;
+ element = suppressDisabledCheck;
+ suppressDisabledCheck = false;
+ }
+
+ // No element argument, shuffle and use this.element
+ if ( !handlers ) {
+ handlers = element;
+ element = this.element;
+ delegateElement = this.widget();
+ } else {
+ element = delegateElement = $( element );
+ this.bindings = this.bindings.add( element );
+ }
+
+ $.each( handlers, function( event, handler ) {
+ function handlerProxy() {
+
+ // Allow widgets to customize the disabled handling
+ // - disabled as an array instead of boolean
+ // - disabled class as method for disabling individual parts
+ if ( !suppressDisabledCheck &&
+ ( instance.options.disabled === true ||
+ $( this ).hasClass( "ui-state-disabled" ) ) ) {
+ return;
+ }
+ return ( typeof handler === "string" ? instance[ handler ] : handler )
+ .apply( instance, arguments );
+ }
+
+ // Copy the guid so direct unbinding works
+ if ( typeof handler !== "string" ) {
+ handlerProxy.guid = handler.guid =
+ handler.guid || handlerProxy.guid || $.guid++;
+ }
+
+ var match = event.match( /^([\w:-]*)\s*(.*)$/ );
+ var eventName = match[ 1 ] + instance.eventNamespace;
+ var selector = match[ 2 ];
+
+ if ( selector ) {
+ delegateElement.on( eventName, selector, handlerProxy );
+ } else {
+ element.on( eventName, handlerProxy );
+ }
+ } );
+ },
+
+ _off: function( element, eventName ) {
+ eventName = ( eventName || "" ).split( " " ).join( this.eventNamespace + " " ) +
+ this.eventNamespace;
+ element.off( eventName ).off( eventName );
+
+ // Clear the stack to avoid memory leaks (#10056)
+ this.bindings = $( this.bindings.not( element ).get() );
+ this.focusable = $( this.focusable.not( element ).get() );
+ this.hoverable = $( this.hoverable.not( element ).get() );
+ },
+
+ _delay: function( handler, delay ) {
+ function handlerProxy() {
+ return ( typeof handler === "string" ? instance[ handler ] : handler )
+ .apply( instance, arguments );
+ }
+ var instance = this;
+ return setTimeout( handlerProxy, delay || 0 );
+ },
+
+ _hoverable: function( element ) {
+ this.hoverable = this.hoverable.add( element );
+ this._on( element, {
+ mouseenter: function( event ) {
+ this._addClass( $( event.currentTarget ), null, "ui-state-hover" );
+ },
+ mouseleave: function( event ) {
+ this._removeClass( $( event.currentTarget ), null, "ui-state-hover" );
+ }
+ } );
+ },
+
+ _focusable: function( element ) {
+ this.focusable = this.focusable.add( element );
+ this._on( element, {
+ focusin: function( event ) {
+ this._addClass( $( event.currentTarget ), null, "ui-state-focus" );
+ },
+ focusout: function( event ) {
+ this._removeClass( $( event.currentTarget ), null, "ui-state-focus" );
+ }
+ } );
+ },
+
+ _trigger: function( type, event, data ) {
+ var prop, orig;
+ var callback = this.options[ type ];
+
+ data = data || {};
+ event = $.Event( event );
+ event.type = ( type === this.widgetEventPrefix ?
+ type :
+ this.widgetEventPrefix + type ).toLowerCase();
+
+ // The original event may come from any element
+ // so we need to reset the target on the new event
+ event.target = this.element[ 0 ];
+
+ // Copy original event properties over to the new event
+ orig = event.originalEvent;
+ if ( orig ) {
+ for ( prop in orig ) {
+ if ( !( prop in event ) ) {
+ event[ prop ] = orig[ prop ];
+ }
+ }
+ }
+
+ this.element.trigger( event, data );
+ return !( $.isFunction( callback ) &&
+ callback.apply( this.element[ 0 ], [ event ].concat( data ) ) === false ||
+ event.isDefaultPrevented() );
+ }
+};
+
+$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
+ $.Widget.prototype[ "_" + method ] = function( element, options, callback ) {
+ if ( typeof options === "string" ) {
+ options = { effect: options };
+ }
+
+ var hasOptions;
+ var effectName = !options ?
+ method :
+ options === true || typeof options === "number" ?
+ defaultEffect :
+ options.effect || defaultEffect;
+
+ options = options || {};
+ if ( typeof options === "number" ) {
+ options = { duration: options };
+ }
+
+ hasOptions = !$.isEmptyObject( options );
+ options.complete = callback;
+
+ if ( options.delay ) {
+ element.delay( options.delay );
+ }
+
+ if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) {
+ element[ method ]( options );
+ } else if ( effectName !== method && element[ effectName ] ) {
+ element[ effectName ]( options.duration, options.easing, callback );
+ } else {
+ element.queue( function( next ) {
+ $( this )[ method ]();
+ if ( callback ) {
+ callback.call( element[ 0 ] );
+ }
+ next();
+ } );
+ }
+ };
+} );
+
+var widget = $.widget;
+
+
+/*!
+ * jQuery UI Position 1.12.1
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/position/
+ */
+
+//>>label: Position
+//>>group: Core
+//>>description: Positions elements relative to other elements.
+//>>docs: http://api.jqueryui.com/position/
+//>>demos: http://jqueryui.com/position/
+
+
+( function() {
+var cachedScrollbarWidth,
+ max = Math.max,
+ abs = Math.abs,
+ rhorizontal = /left|center|right/,
+ rvertical = /top|center|bottom/,
+ roffset = /[\+\-]\d+(\.[\d]+)?%?/,
+ rposition = /^\w+/,
+ rpercent = /%$/,
+ _position = $.fn.position;
+
+function getOffsets( offsets, width, height ) {
+ return [
+ parseFloat( offsets[ 0 ] ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ),
+ parseFloat( offsets[ 1 ] ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 )
+ ];
+}
+
+function parseCss( element, property ) {
+ return parseInt( $.css( element, property ), 10 ) || 0;
+}
+
+function getDimensions( elem ) {
+ var raw = elem[ 0 ];
+ if ( raw.nodeType === 9 ) {
+ return {
+ width: elem.width(),
+ height: elem.height(),
+ offset: { top: 0, left: 0 }
+ };
+ }
+ if ( $.isWindow( raw ) ) {
+ return {
+ width: elem.width(),
+ height: elem.height(),
+ offset: { top: elem.scrollTop(), left: elem.scrollLeft() }
+ };
+ }
+ if ( raw.preventDefault ) {
+ return {
+ width: 0,
+ height: 0,
+ offset: { top: raw.pageY, left: raw.pageX }
+ };
+ }
+ return {
+ width: elem.outerWidth(),
+ height: elem.outerHeight(),
+ offset: elem.offset()
+ };
+}
+
+$.position = {
+ scrollbarWidth: function() {
+ if ( cachedScrollbarWidth !== undefined ) {
+ return cachedScrollbarWidth;
+ }
+ var w1, w2,
+ div = $( "<div " +
+ "style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'>" +
+ "<div style='height:100px;width:auto;'></div></div>" ),
+ innerDiv = div.children()[ 0 ];
+
+ $( "body" ).append( div );
+ w1 = innerDiv.offsetWidth;
+ div.css( "overflow", "scroll" );
+
+ w2 = innerDiv.offsetWidth;
+
+ if ( w1 === w2 ) {
+ w2 = div[ 0 ].clientWidth;
+ }
+
+ div.remove();
+
+ return ( cachedScrollbarWidth = w1 - w2 );
+ },
+ getScrollInfo: function( within ) {
+ var overflowX = within.isWindow || within.isDocument ? "" :
+ within.element.css( "overflow-x" ),
+ overflowY = within.isWindow || within.isDocument ? "" :
+ within.element.css( "overflow-y" ),
+ hasOverflowX = overflowX === "scroll" ||
+ ( overflowX === "auto" && within.width < within.element[ 0 ].scrollWidth ),
+ hasOverflowY = overflowY === "scroll" ||
+ ( overflowY === "auto" && within.height < within.element[ 0 ].scrollHeight );
+ return {
+ width: hasOverflowY ? $.position.scrollbarWidth() : 0,
+ height: hasOverflowX ? $.position.scrollbarWidth() : 0
+ };
+ },
+ getWithinInfo: function( element ) {
+ var withinElement = $( element || window ),
+ isWindow = $.isWindow( withinElement[ 0 ] ),
+ isDocument = !!withinElement[ 0 ] && withinElement[ 0 ].nodeType === 9,
+ hasOffset = !isWindow && !isDocument;
+ return {
+ element: withinElement,
+ isWindow: isWindow,
+ isDocument: isDocument,
+ offset: hasOffset ? $( element ).offset() : { left: 0, top: 0 },
+ scrollLeft: withinElement.scrollLeft(),
+ scrollTop: withinElement.scrollTop(),
+ width: withinElement.outerWidth(),
+ height: withinElement.outerHeight()
+ };
+ }
+};
+
+$.fn.position = function( options ) {
+ if ( !options || !options.of ) {
+ return _position.apply( this, arguments );
+ }
+
+ // Make a copy, we don't want to modify arguments
+ options = $.extend( {}, options );
+
+ var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions,
+ target = $( options.of ),
+ within = $.position.getWithinInfo( options.within ),
+ scrollInfo = $.position.getScrollInfo( within ),
+ collision = ( options.collision || "flip" ).split( " " ),
+ offsets = {};
+
+ dimensions = getDimensions( target );
+ if ( target[ 0 ].preventDefault ) {
+
+ // Force left top to allow flipping
+ options.at = "left top";
+ }
+ targetWidth = dimensions.width;
+ targetHeight = dimensions.height;
+ targetOffset = dimensions.offset;
+
+ // Clone to reuse original targetOffset later
+ basePosition = $.extend( {}, targetOffset );
+
+ // Force my and at to have valid horizontal and vertical positions
+ // if a value is missing or invalid, it will be converted to center
+ $.each( [ "my", "at" ], function() {
+ var pos = ( options[ this ] || "" ).split( " " ),
+ horizontalOffset,
+ verticalOffset;
+
+ if ( pos.length === 1 ) {
+ pos = rhorizontal.test( pos[ 0 ] ) ?
+ pos.concat( [ "center" ] ) :
+ rvertical.test( pos[ 0 ] ) ?
+ [ "center" ].concat( pos ) :
+ [ "center", "center" ];
+ }
+ pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center";
+ pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center";
+
+ // Calculate offsets
+ horizontalOffset = roffset.exec( pos[ 0 ] );
+ verticalOffset = roffset.exec( pos[ 1 ] );
+ offsets[ this ] = [
+ horizontalOffset ? horizontalOffset[ 0 ] : 0,
+ verticalOffset ? verticalOffset[ 0 ] : 0
+ ];
+
+ // Reduce to just the positions without the offsets
+ options[ this ] = [
+ rposition.exec( pos[ 0 ] )[ 0 ],
+ rposition.exec( pos[ 1 ] )[ 0 ]
+ ];
+ } );
+
+ // Normalize collision option
+ if ( collision.length === 1 ) {
+ collision[ 1 ] = collision[ 0 ];
+ }
+
+ if ( options.at[ 0 ] === "right" ) {
+ basePosition.left += targetWidth;
+ } else if ( options.at[ 0 ] === "center" ) {
+ basePosition.left += targetWidth / 2;
+ }
+
+ if ( options.at[ 1 ] === "bottom" ) {
+ basePosition.top += targetHeight;
+ } else if ( options.at[ 1 ] === "center" ) {
+ basePosition.top += targetHeight / 2;
+ }
+
+ atOffset = getOffsets( offsets.at, targetWidth, targetHeight );
+ basePosition.left += atOffset[ 0 ];
+ basePosition.top += atOffset[ 1 ];
+
+ return this.each( function() {
+ var collisionPosition, using,
+ elem = $( this ),
+ elemWidth = elem.outerWidth(),
+ elemHeight = elem.outerHeight(),
+ marginLeft = parseCss( this, "marginLeft" ),
+ marginTop = parseCss( this, "marginTop" ),
+ collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) +
+ scrollInfo.width,
+ collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) +
+ scrollInfo.height,
+ position = $.extend( {}, basePosition ),
+ myOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() );
+
+ if ( options.my[ 0 ] === "right" ) {
+ position.left -= elemWidth;
+ } else if ( options.my[ 0 ] === "center" ) {
+ position.left -= elemWidth / 2;
+ }
+
+ if ( options.my[ 1 ] === "bottom" ) {
+ position.top -= elemHeight;
+ } else if ( options.my[ 1 ] === "center" ) {
+ position.top -= elemHeight / 2;
+ }
+
+ position.left += myOffset[ 0 ];
+ position.top += myOffset[ 1 ];
+
+ collisionPosition = {
+ marginLeft: marginLeft,
+ marginTop: marginTop
+ };
+
+ $.each( [ "left", "top" ], function( i, dir ) {
+ if ( $.ui.position[ collision[ i ] ] ) {
+ $.ui.position[ collision[ i ] ][ dir ]( position, {
+ targetWidth: targetWidth,
+ targetHeight: targetHeight,
+ elemWidth: elemWidth,
+ elemHeight: elemHeight,
+ collisionPosition: collisionPosition,
+ collisionWidth: collisionWidth,
+ collisionHeight: collisionHeight,
+ offset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ],
+ my: options.my,
+ at: options.at,
+ within: within,
+ elem: elem
+ } );
+ }
+ } );
+
+ if ( options.using ) {
+
+ // Adds feedback as second argument to using callback, if present
+ using = function( props ) {
+ var left = targetOffset.left - position.left,
+ right = left + targetWidth - elemWidth,
+ top = targetOffset.top - position.top,
+ bottom = top + targetHeight - elemHeight,
+ feedback = {
+ target: {
+ element: target,
+ left: targetOffset.left,
+ top: targetOffset.top,
+ width: targetWidth,
+ height: targetHeight
+ },
+ element: {
+ element: elem,
+ left: position.left,
+ top: position.top,
+ width: elemWidth,
+ height: elemHeight
+ },
+ horizontal: right < 0 ? "left" : left > 0 ? "right" : "center",
+ vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle"
+ };
+ if ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) {
+ feedback.horizontal = "center";
+ }
+ if ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) {
+ feedback.vertical = "middle";
+ }
+ if ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) {
+ feedback.important = "horizontal";
+ } else {
+ feedback.important = "vertical";
+ }
+ options.using.call( this, props, feedback );
+ };
+ }
+
+ elem.offset( $.extend( position, { using: using } ) );
+ } );
+};
+
+$.ui.position = {
+ fit: {
+ left: function( position, data ) {
+ var within = data.within,
+ withinOffset = within.isWindow ? within.scrollLeft : within.offset.left,
+ outerWidth = within.width,
+ collisionPosLeft = position.left - data.collisionPosition.marginLeft,
+ overLeft = withinOffset - collisionPosLeft,
+ overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset,
+ newOverRight;
+
+ // Element is wider than within
+ if ( data.collisionWidth > outerWidth ) {
+
+ // Element is initially over the left side of within
+ if ( overLeft > 0 && overRight <= 0 ) {
+ newOverRight = position.left + overLeft + data.collisionWidth - outerWidth -
+ withinOffset;
+ position.left += overLeft - newOverRight;
+
+ // Element is initially over right side of within
+ } else if ( overRight > 0 && overLeft <= 0 ) {
+ position.left = withinOffset;
+
+ // Element is initially over both left and right sides of within
+ } else {
+ if ( overLeft > overRight ) {
+ position.left = withinOffset + outerWidth - data.collisionWidth;
+ } else {
+ position.left = withinOffset;
+ }
+ }
+
+ // Too far left -> align with left edge
+ } else if ( overLeft > 0 ) {
+ position.left += overLeft;
+
+ // Too far right -> align with right edge
+ } else if ( overRight > 0 ) {
+ position.left -= overRight;
+
+ // Adjust based on position and margin
+ } else {
+ position.left = max( position.left - collisionPosLeft, position.left );
+ }
+ },
+ top: function( position, data ) {
+ var within = data.within,
+ withinOffset = within.isWindow ? within.scrollTop : within.offset.top,
+ outerHeight = data.within.height,
+ collisionPosTop = position.top - data.collisionPosition.marginTop,
+ overTop = withinOffset - collisionPosTop,
+ overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset,
+ newOverBottom;
+
+ // Element is taller than within
+ if ( data.collisionHeight > outerHeight ) {
+
+ // Element is initially over the top of within
+ if ( overTop > 0 && overBottom <= 0 ) {
+ newOverBottom = position.top + overTop + data.collisionHeight - outerHeight -
+ withinOffset;
+ position.top += overTop - newOverBottom;
+
+ // Element is initially over bottom of within
+ } else if ( overBottom > 0 && overTop <= 0 ) {
+ position.top = withinOffset;
+
+ // Element is initially over both top and bottom of within
+ } else {
+ if ( overTop > overBottom ) {
+ position.top = withinOffset + outerHeight - data.collisionHeight;
+ } else {
+ position.top = withinOffset;
+ }
+ }
+
+ // Too far up -> align with top
+ } else if ( overTop > 0 ) {
+ position.top += overTop;
+
+ // Too far down -> align with bottom edge
+ } else if ( overBottom > 0 ) {
+ position.top -= overBottom;
+
+ // Adjust based on position and margin
+ } else {
+ position.top = max( position.top - collisionPosTop, position.top );
+ }
+ }
+ },
+ flip: {
+ left: function( position, data ) {
+ var within = data.within,
+ withinOffset = within.offset.left + within.scrollLeft,
+ outerWidth = within.width,
+ offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,
+ collisionPosLeft = position.left - data.collisionPosition.marginLeft,
+ overLeft = collisionPosLeft - offsetLeft,
+ overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft,
+ myOffset = data.my[ 0 ] === "left" ?
+ -data.elemWidth :
+ data.my[ 0 ] === "right" ?
+ data.elemWidth :
+ 0,
+ atOffset = data.at[ 0 ] === "left" ?
+ data.targetWidth :
+ data.at[ 0 ] === "right" ?
+ -data.targetWidth :
+ 0,
+ offset = -2 * data.offset[ 0 ],
+ newOverRight,
+ newOverLeft;
+
+ if ( overLeft < 0 ) {
+ newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth -
+ outerWidth - withinOffset;
+ if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) {
+ position.left += myOffset + atOffset + offset;
+ }
+ } else if ( overRight > 0 ) {
+ newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset +
+ atOffset + offset - offsetLeft;
+ if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) {
+ position.left += myOffset + atOffset + offset;
+ }
+ }
+ },
+ top: function( position, data ) {
+ var within = data.within,
+ withinOffset = within.offset.top + within.scrollTop,
+ outerHeight = within.height,
+ offsetTop = within.isWindow ? within.scrollTop : within.offset.top,
+ collisionPosTop = position.top - data.collisionPosition.marginTop,
+ overTop = collisionPosTop - offsetTop,
+ overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop,
+ top = data.my[ 1 ] === "top",
+ myOffset = top ?
+ -data.elemHeight :
+ data.my[ 1 ] === "bottom" ?
+ data.elemHeight :
+ 0,
+ atOffset = data.at[ 1 ] === "top" ?
+ data.targetHeight :
+ data.at[ 1 ] === "bottom" ?
+ -data.targetHeight :
+ 0,
+ offset = -2 * data.offset[ 1 ],
+ newOverTop,
+ newOverBottom;
+ if ( overTop < 0 ) {
+ newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight -
+ outerHeight - withinOffset;
+ if ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) {
+ position.top += myOffset + atOffset + offset;
+ }
+ } else if ( overBottom > 0 ) {
+ newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset +
+ offset - offsetTop;
+ if ( newOverTop > 0 || abs( newOverTop ) < overBottom ) {
+ position.top += myOffset + atOffset + offset;
+ }
+ }
+ }
+ },
+ flipfit: {
+ left: function() {
+ $.ui.position.flip.left.apply( this, arguments );
+ $.ui.position.fit.left.apply( this, arguments );
+ },
+ top: function() {
+ $.ui.position.flip.top.apply( this, arguments );
+ $.ui.position.fit.top.apply( this, arguments );
+ }
+ }
+};
+
+} )();
+
+var position = $.ui.position;
+
+
+/*!
+ * jQuery UI :data 1.12.1
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ */
+
+//>>label: :data Selector
+//>>group: Core
+//>>description: Selects elements which have data stored under the specified key.
+//>>docs: http://api.jqueryui.com/data-selector/
+
+
+var data = $.extend( $.expr[ ":" ], {
+ data: $.expr.createPseudo ?
+ $.expr.createPseudo( function( dataName ) {
+ return function( elem ) {
+ return !!$.data( elem, dataName );
+ };
+ } ) :
+
+ // Support: jQuery <1.8
+ function( elem, i, match ) {
+ return !!$.data( elem, match[ 3 ] );
+ }
+} );
+
+/*!
+ * jQuery UI Disable Selection 1.12.1
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ */
+
+//>>label: disableSelection
+//>>group: Core
+//>>description: Disable selection of text content within the set of matched elements.
+//>>docs: http://api.jqueryui.com/disableSelection/
+
+// This file is deprecated
+
+
+var disableSelection = $.fn.extend( {
+ disableSelection: ( function() {
+ var eventType = "onselectstart" in document.createElement( "div" ) ?
+ "selectstart" :
+ "mousedown";
+
+ return function() {
+ return this.on( eventType + ".ui-disableSelection", function( event ) {
+ event.preventDefault();
+ } );
+ };
+ } )(),
+
+ enableSelection: function() {
+ return this.off( ".ui-disableSelection" );
+ }
+} );
+
+
+/*!
+ * jQuery UI Focusable 1.12.1
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ */
+
+//>>label: :focusable Selector
+//>>group: Core
+//>>description: Selects elements which can be focused.
+//>>docs: http://api.jqueryui.com/focusable-selector/
+
+
+
+// Selectors
+$.ui.focusable = function( element, hasTabindex ) {
+ var map, mapName, img, focusableIfVisible, fieldset,
+ nodeName = element.nodeName.toLowerCase();
+
+ if ( "area" === nodeName ) {
+ map = element.parentNode;
+ mapName = map.name;
+ if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) {
+ return false;
+ }
+ img = $( "img[usemap='#" + mapName + "']" );
+ return img.length > 0 && img.is( ":visible" );
+ }
+
+ if ( /^(input|select|textarea|button|object)$/.test( nodeName ) ) {
+ focusableIfVisible = !element.disabled;
+
+ if ( focusableIfVisible ) {
+
+ // Form controls within a disabled fieldset are disabled.
+ // However, controls within the fieldset's legend do not get disabled.
+ // Since controls generally aren't placed inside legends, we skip
+ // this portion of the check.
+ fieldset = $( element ).closest( "fieldset" )[ 0 ];
+ if ( fieldset ) {
+ focusableIfVisible = !fieldset.disabled;
+ }
+ }
+ } else if ( "a" === nodeName ) {
+ focusableIfVisible = element.href || hasTabindex;
+ } else {
+ focusableIfVisible = hasTabindex;
+ }
+
+ return focusableIfVisible && $( element ).is( ":visible" ) && visible( $( element ) );
+};
+
+// Support: IE 8 only
+// IE 8 doesn't resolve inherit to visible/hidden for computed values
+function visible( element ) {
+ var visibility = element.css( "visibility" );
+ while ( visibility === "inherit" ) {
+ element = element.parent();
+ visibility = element.css( "visibility" );
+ }
+ return visibility !== "hidden";
+}
+
+$.extend( $.expr[ ":" ], {
+ focusable: function( element ) {
+ return $.ui.focusable( element, $.attr( element, "tabindex" ) != null );
+ }
+} );
+
+var focusable = $.ui.focusable;
+
+
+
+
+// Support: IE8 Only
+// IE8 does not support the form attribute and when it is supplied. It overwrites the form prop
+// with a string, so we need to find the proper form.
+var form = $.fn.form = function() {
+ return typeof this[ 0 ].form === "string" ? this.closest( "form" ) : $( this[ 0 ].form );
+};
+
+
+/*!
+ * jQuery UI Form Reset Mixin 1.12.1
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ */
+
+//>>label: Form Reset Mixin
+//>>group: Core
+//>>description: Refresh input widgets when their form is reset
+//>>docs: http://api.jqueryui.com/form-reset-mixin/
+
+
+
+var formResetMixin = $.ui.formResetMixin = {
+ _formResetHandler: function() {
+ var form = $( this );
+
+ // Wait for the form reset to actually happen before refreshing
+ setTimeout( function() {
+ var instances = form.data( "ui-form-reset-instances" );
+ $.each( instances, function() {
+ this.refresh();
+ } );
+ } );
+ },
+
+ _bindFormResetHandler: function() {
+ this.form = this.element.form();
+ if ( !this.form.length ) {
+ return;
+ }
+
+ var instances = this.form.data( "ui-form-reset-instances" ) || [];
+ if ( !instances.length ) {
+
+ // We don't use _on() here because we use a single event handler per form
+ this.form.on( "reset.ui-form-reset", this._formResetHandler );
+ }
+ instances.push( this );
+ this.form.data( "ui-form-reset-instances", instances );
+ },
+
+ _unbindFormResetHandler: function() {
+ if ( !this.form.length ) {
+ return;
+ }
+
+ var instances = this.form.data( "ui-form-reset-instances" );
+ instances.splice( $.inArray( this, instances ), 1 );
+ if ( instances.length ) {
+ this.form.data( "ui-form-reset-instances", instances );
+ } else {
+ this.form
+ .removeData( "ui-form-reset-instances" )
+ .off( "reset.ui-form-reset" );
+ }
+ }
+};
+
+
+/*!
+ * jQuery UI Support for jQuery core 1.7.x 1.12.1
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ */
+
+//>>label: jQuery 1.7 Support
+//>>group: Core
+//>>description: Support version 1.7.x of jQuery core
+
+
+
+// Support: jQuery 1.7 only
+// Not a great way to check versions, but since we only support 1.7+ and only
+// need to detect <1.8, this is a simple check that should suffice. Checking
+// for "1.7." would be a bit safer, but the version string is 1.7, not 1.7.0
+// and we'll never reach 1.70.0 (if we do, we certainly won't be supporting
+// 1.7 anymore). See #11197 for why we're not using feature detection.
+if ( $.fn.jquery.substring( 0, 3 ) === "1.7" ) {
+
+ // Setters for .innerWidth(), .innerHeight(), .outerWidth(), .outerHeight()
+ // Unlike jQuery Core 1.8+, these only support numeric values to set the
+ // dimensions in pixels
+ $.each( [ "Width", "Height" ], function( i, name ) {
+ var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ],
+ type = name.toLowerCase(),
+ orig = {
+ innerWidth: $.fn.innerWidth,
+ innerHeight: $.fn.innerHeight,
+ outerWidth: $.fn.outerWidth,
+ outerHeight: $.fn.outerHeight
+ };
+
+ function reduce( elem, size, border, margin ) {
+ $.each( side, function() {
+ size -= parseFloat( $.css( elem, "padding" + this ) ) || 0;
+ if ( border ) {
+ size -= parseFloat( $.css( elem, "border" + this + "Width" ) ) || 0;
+ }
+ if ( margin ) {
+ size -= parseFloat( $.css( elem, "margin" + this ) ) || 0;
+ }
+ } );
+ return size;
+ }
+
+ $.fn[ "inner" + name ] = function( size ) {
+ if ( size === undefined ) {
+ return orig[ "inner" + name ].call( this );
+ }
+
+ return this.each( function() {
+ $( this ).css( type, reduce( this, size ) + "px" );
+ } );
+ };
+
+ $.fn[ "outer" + name ] = function( size, margin ) {
+ if ( typeof size !== "number" ) {
+ return orig[ "outer" + name ].call( this, size );
+ }
+
+ return this.each( function() {
+ $( this ).css( type, reduce( this, size, true, margin ) + "px" );
+ } );
+ };
+ } );
+
+ $.fn.addBack = function( selector ) {
+ return this.add( selector == null ?
+ this.prevObject : this.prevObject.filter( selector )
+ );
+ };
+}
+
+;
+/*!
+ * jQuery UI Keycode 1.12.1
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ */
+
+//>>label: Keycode
+//>>group: Core
+//>>description: Provide keycodes as keynames
+//>>docs: http://api.jqueryui.com/jQuery.ui.keyCode/
+
+
+var keycode = $.ui.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
+};
+
+
+
+
+// Internal use only
+var escapeSelector = $.ui.escapeSelector = ( function() {
+ var selectorEscape = /([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g;
+ return function( selector ) {
+ return selector.replace( selectorEscape, "\\$1" );
+ };
+} )();
+
+
+/*!
+ * jQuery UI Labels 1.12.1
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ */
+
+//>>label: labels
+//>>group: Core
+//>>description: Find all the labels associated with a given input
+//>>docs: http://api.jqueryui.com/labels/
+
+
+
+var labels = $.fn.labels = function() {
+ var ancestor, selector, id, labels, ancestors;
+
+ // Check control.labels first
+ if ( this[ 0 ].labels && this[ 0 ].labels.length ) {
+ return this.pushStack( this[ 0 ].labels );
+ }
+
+ // Support: IE <= 11, FF <= 37, Android <= 2.3 only
+ // Above browsers do not support control.labels. Everything below is to support them
+ // as well as document fragments. control.labels does not work on document fragments
+ labels = this.eq( 0 ).parents( "label" );
+
+ // Look for the label based on the id
+ id = this.attr( "id" );
+ if ( id ) {
+
+ // We don't search against the document in case the element
+ // is disconnected from the DOM
+ ancestor = this.eq( 0 ).parents().last();
+
+ // Get a full set of top level ancestors
+ ancestors = ancestor.add( ancestor.length ? ancestor.siblings() : this.siblings() );
+
+ // Create a selector for the label based on the id
+ selector = "label[for='" + $.ui.escapeSelector( id ) + "']";
+
+ labels = labels.add( ancestors.find( selector ).addBack( selector ) );
+
+ }
+
+ // Return whatever we have found for labels
+ return this.pushStack( labels );
+};
+
+
+/*!
+ * jQuery UI Scroll Parent 1.12.1
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ */
+
+//>>label: scrollParent
+//>>group: Core
+//>>description: Get the closest ancestor element that is scrollable.
+//>>docs: http://api.jqueryui.com/scrollParent/
+
+
+
+var scrollParent = $.fn.scrollParent = function( includeHidden ) {
+ var position = this.css( "position" ),
+ excludeStaticParent = position === "absolute",
+ overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/,
+ scrollParent = this.parents().filter( function() {
+ var parent = $( this );
+ if ( excludeStaticParent && parent.css( "position" ) === "static" ) {
+ return false;
+ }
+ return overflowRegex.test( parent.css( "overflow" ) + parent.css( "overflow-y" ) +
+ parent.css( "overflow-x" ) );
+ } ).eq( 0 );
+
+ return position === "fixed" || !scrollParent.length ?
+ $( this[ 0 ].ownerDocument || document ) :
+ scrollParent;
+};
+
+
+/*!
+ * jQuery UI Tabbable 1.12.1
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ */
+
+//>>label: :tabbable Selector
+//>>group: Core
+//>>description: Selects elements which can be tabbed to.
+//>>docs: http://api.jqueryui.com/tabbable-selector/
+
+
+
+var tabbable = $.extend( $.expr[ ":" ], {
+ tabbable: function( element ) {
+ var tabIndex = $.attr( element, "tabindex" ),
+ hasTabindex = tabIndex != null;
+ return ( !hasTabindex || tabIndex >= 0 ) && $.ui.focusable( element, hasTabindex );
+ }
+} );
+
+
+/*!
+ * jQuery UI Unique ID 1.12.1
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ */
+
+//>>label: uniqueId
+//>>group: Core
+//>>description: Functions to generate and remove uniqueId's
+//>>docs: http://api.jqueryui.com/uniqueId/
+
+
+
+var uniqueId = $.fn.extend( {
+ uniqueId: ( function() {
+ var uuid = 0;
+
+ return function() {
+ return this.each( function() {
+ if ( !this.id ) {
+ this.id = "ui-id-" + ( ++uuid );
+ }
+ } );
+ };
+ } )(),
+
+ removeUniqueId: function() {
+ return this.each( function() {
+ if ( /^ui-id-\d+$/.test( this.id ) ) {
+ $( this ).removeAttr( "id" );
+ }
+ } );
+ }
+} );
+
+
+
+
+// This file is deprecated
+var ie = $.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() );
+
+/*!
+ * jQuery UI Mouse 1.12.1
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ */
+
+//>>label: Mouse
+//>>group: Widgets
+//>>description: Abstracts mouse-based interactions to assist in creating certain widgets.
+//>>docs: http://api.jqueryui.com/mouse/
+
+
+
+var mouseHandled = false;
+$( document ).on( "mouseup", function() {
+ mouseHandled = false;
+} );
+
+var widgetsMouse = $.widget( "ui.mouse", {
+ version: "1.12.1",
+ options: {
+ cancel: "input, textarea, button, select, option",
+ distance: 1,
+ delay: 0
+ },
+ _mouseInit: function() {
+ var that = this;
+
+ this.element
+ .on( "mousedown." + this.widgetName, function( event ) {
+ return that._mouseDown( event );
+ } )
+ .on( "click." + this.widgetName, function( event ) {
+ if ( true === $.data( event.target, that.widgetName + ".preventClickEvent" ) ) {
+ $.removeData( event.target, that.widgetName + ".preventClickEvent" );
+ event.stopImmediatePropagation();
+ return false;
+ }
+ } );
+
+ this.started = false;
+ },
+
+ // TODO: make sure destroying one instance of mouse doesn't mess with
+ // other instances of mouse
+ _mouseDestroy: function() {
+ this.element.off( "." + this.widgetName );
+ if ( this._mouseMoveDelegate ) {
+ this.document
+ .off( "mousemove." + this.widgetName, this._mouseMoveDelegate )
+ .off( "mouseup." + this.widgetName, this._mouseUpDelegate );
+ }
+ },
+
+ _mouseDown: function( event ) {
+
+ // don't let more than one widget handle mouseStart
+ if ( mouseHandled ) {
+ return;
+ }
+
+ this._mouseMoved = false;
+
+ // We may have missed mouseup (out of window)
+ ( this._mouseStarted && this._mouseUp( event ) );
+
+ this._mouseDownEvent = event;
+
+ var that = this,
+ btnIsLeft = ( event.which === 1 ),
+
+ // event.target.nodeName works around a bug in IE 8 with
+ // disabled inputs (#7620)
+ elIsCancel = ( typeof this.options.cancel === "string" && event.target.nodeName ?
+ $( event.target ).closest( this.options.cancel ).length : false );
+ if ( !btnIsLeft || elIsCancel || !this._mouseCapture( event ) ) {
+ return true;
+ }
+
+ this.mouseDelayMet = !this.options.delay;
+ if ( !this.mouseDelayMet ) {
+ this._mouseDelayTimer = setTimeout( function() {
+ that.mouseDelayMet = true;
+ }, this.options.delay );
+ }
+
+ if ( this._mouseDistanceMet( event ) && this._mouseDelayMet( event ) ) {
+ this._mouseStarted = ( this._mouseStart( event ) !== false );
+ if ( !this._mouseStarted ) {
+ event.preventDefault();
+ return true;
+ }
+ }
+
+ // Click event may never have fired (Gecko & Opera)
+ if ( true === $.data( event.target, this.widgetName + ".preventClickEvent" ) ) {
+ $.removeData( event.target, this.widgetName + ".preventClickEvent" );
+ }
+
+ // These delegates are required to keep context
+ this._mouseMoveDelegate = function( event ) {
+ return that._mouseMove( event );
+ };
+ this._mouseUpDelegate = function( event ) {
+ return that._mouseUp( event );
+ };
+
+ this.document
+ .on( "mousemove." + this.widgetName, this._mouseMoveDelegate )
+ .on( "mouseup." + this.widgetName, this._mouseUpDelegate );
+
+ event.preventDefault();
+
+ mouseHandled = true;
+ return true;
+ },
+
+ _mouseMove: function( event ) {
+
+ // Only check for mouseups outside the document if you've moved inside the document
+ // at least once. This prevents the firing of mouseup in the case of IE<9, which will
+ // fire a mousemove event if content is placed under the cursor. See #7778
+ // Support: IE <9
+ if ( this._mouseMoved ) {
+
+ // IE mouseup check - mouseup happened when mouse was out of window
+ if ( $.ui.ie && ( !document.documentMode || document.documentMode < 9 ) &&
+ !event.button ) {
+ return this._mouseUp( event );
+
+ // Iframe mouseup check - mouseup occurred in another document
+ } else if ( !event.which ) {
+
+ // Support: Safari <=8 - 9
+ // Safari sets which to 0 if you press any of the following keys
+ // during a drag (#14461)
+ if ( event.originalEvent.altKey || event.originalEvent.ctrlKey ||
+ event.originalEvent.metaKey || event.originalEvent.shiftKey ) {
+ this.ignoreMissingWhich = true;
+ } else if ( !this.ignoreMissingWhich ) {
+ return this._mouseUp( event );
+ }
+ }
+ }
+
+ if ( event.which || event.button ) {
+ this._mouseMoved = true;
+ }
+
+ if ( this._mouseStarted ) {
+ this._mouseDrag( event );
+ return event.preventDefault();
+ }
+
+ if ( this._mouseDistanceMet( event ) && this._mouseDelayMet( event ) ) {
+ this._mouseStarted =
+ ( this._mouseStart( this._mouseDownEvent, event ) !== false );
+ ( this._mouseStarted ? this._mouseDrag( event ) : this._mouseUp( event ) );
+ }
+
+ return !this._mouseStarted;
+ },
+
+ _mouseUp: function( event ) {
+ this.document
+ .off( "mousemove." + this.widgetName, this._mouseMoveDelegate )
+ .off( "mouseup." + this.widgetName, this._mouseUpDelegate );
+
+ if ( this._mouseStarted ) {
+ this._mouseStarted = false;
+
+ if ( event.target === this._mouseDownEvent.target ) {
+ $.data( event.target, this.widgetName + ".preventClickEvent", true );
+ }
+
+ this._mouseStop( event );
+ }
+
+ if ( this._mouseDelayTimer ) {
+ clearTimeout( this._mouseDelayTimer );
+ delete this._mouseDelayTimer;
+ }
+
+ this.ignoreMissingWhich = false;
+ mouseHandled = false;
+ event.preventDefault();
+ },
+
+ _mouseDistanceMet: function( event ) {
+ return ( Math.max(
+ Math.abs( this._mouseDownEvent.pageX - event.pageX ),
+ Math.abs( this._mouseDownEvent.pageY - event.pageY )
+ ) >= this.options.distance
+ );
+ },
+
+ _mouseDelayMet: function( /* event */ ) {
+ return this.mouseDelayMet;
+ },
+
+ // These are placeholder methods, to be overriden by extending plugin
+ _mouseStart: function( /* event */ ) {},
+ _mouseDrag: function( /* event */ ) {},
+ _mouseStop: function( /* event */ ) {},
+ _mouseCapture: function( /* event */ ) { return true; }
+} );
+
+
+/*!
+ * jQuery UI Sortable 1.12.1
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ */
+
+//>>label: Sortable
+//>>group: Interactions
+//>>description: Enables items in a list to be sorted using the mouse.
+//>>docs: http://api.jqueryui.com/sortable/
+//>>demos: http://jqueryui.com/sortable/
+//>>css.structure: ../../themes/base/sortable.css
+
+
+
+var widgetsSortable = $.widget( "ui.sortable", $.ui.mouse, {
+ version: "1.12.1",
+ widgetEventPrefix: "sort",
+ ready: false,
+ options: {
+ appendTo: "parent",
+ axis: false,
+ connectWith: false,
+ containment: false,
+ cursor: "auto",
+ cursorAt: false,
+ dropOnEmpty: true,
+ forcePlaceholderSize: false,
+ forceHelperSize: false,
+ grid: false,
+ handle: false,
+ helper: "original",
+ items: "> *",
+ opacity: false,
+ placeholder: false,
+ revert: false,
+ scroll: true,
+ scrollSensitivity: 20,
+ scrollSpeed: 20,
+ scope: "default",
+ tolerance: "intersect",
+ zIndex: 1000,
+
+ // Callbacks
+ activate: null,
+ beforeStop: null,
+ change: null,
+ deactivate: null,
+ out: null,
+ over: null,
+ receive: null,
+ remove: null,
+ sort: null,
+ start: null,
+ stop: null,
+ update: null
+ },
+
+ _isOverAxis: function( x, reference, size ) {
+ return ( x >= reference ) && ( x < ( reference + size ) );
+ },
+
+ _isFloating: function( item ) {
+ return ( /left|right/ ).test( item.css( "float" ) ) ||
+ ( /inline|table-cell/ ).test( item.css( "display" ) );
+ },
+
+ _create: function() {
+ this.containerCache = {};
+ this._addClass( "ui-sortable" );
+
+ //Get the items
+ this.refresh();
+
+ //Let's determine the parent's offset
+ this.offset = this.element.offset();
+
+ //Initialize mouse events for interaction
+ this._mouseInit();
+
+ this._setHandleClassName();
+
+ //We're ready to go
+ this.ready = true;
+
+ },
+
+ _setOption: function( key, value ) {
+ this._super( key, value );
+
+ if ( key === "handle" ) {
+ this._setHandleClassName();
+ }
+ },
+
+ _setHandleClassName: function() {
+ var that = this;
+ this._removeClass( this.element.find( ".ui-sortable-handle" ), "ui-sortable-handle" );
+ $.each( this.items, function() {
+ that._addClass(
+ this.instance.options.handle ?
+ this.item.find( this.instance.options.handle ) :
+ this.item,
+ "ui-sortable-handle"
+ );
+ } );
+ },
+
+ _destroy: function() {
+ this._mouseDestroy();
+
+ for ( var i = this.items.length - 1; i >= 0; i-- ) {
+ this.items[ i ].item.removeData( this.widgetName + "-item" );
+ }
+
+ return this;
+ },
+
+ _mouseCapture: function( event, overrideHandle ) {
+ var currentItem = null,
+ validHandle = false,
+ that = this;
+
+ if ( this.reverting ) {
+ return false;
+ }
+
+ if ( this.options.disabled || this.options.type === "static" ) {
+ return false;
+ }
+
+ //We have to refresh the items data once first
+ this._refreshItems( event );
+
+ //Find out if the clicked node (or one of its parents) is a actual item in this.items
+ $( event.target ).parents().each( function() {
+ if ( $.data( this, that.widgetName + "-item" ) === that ) {
+ currentItem = $( this );
+ return false;
+ }
+ } );
+ if ( $.data( event.target, that.widgetName + "-item" ) === that ) {
+ currentItem = $( event.target );
+ }
+
+ if ( !currentItem ) {
+ return false;
+ }
+ if ( this.options.handle && !overrideHandle ) {
+ $( this.options.handle, currentItem ).find( "*" ).addBack().each( function() {
+ if ( this === event.target ) {
+ validHandle = true;
+ }
+ } );
+ if ( !validHandle ) {
+ return false;
+ }
+ }
+
+ this.currentItem = currentItem;
+ this._removeCurrentsFromItems();
+ return true;
+
+ },
+
+ _mouseStart: function( event, overrideHandle, noActivation ) {
+
+ var i, body,
+ o = this.options;
+
+ this.currentContainer = this;
+
+ //We only need to call refreshPositions, because the refreshItems call has been moved to
+ // mouseCapture
+ this.refreshPositions();
+
+ //Create and append the visible helper
+ this.helper = this._createHelper( event );
+
+ //Cache the helper size
+ this._cacheHelperProportions();
+
+ /*
+ * - Position generation -
+ * This block generates everything position related - it's the core of draggables.
+ */
+
+ //Cache the margins of the original element
+ this._cacheMargins();
+
+ //Get the next scrolling parent
+ this.scrollParent = this.helper.scrollParent();
+
+ //The element's absolute position on the page minus margins
+ this.offset = this.currentItem.offset();
+ this.offset = {
+ top: this.offset.top - this.margins.top,
+ left: this.offset.left - this.margins.left
+ };
+
+ $.extend( this.offset, {
+ click: { //Where the click happened, relative to the element
+ left: event.pageX - this.offset.left,
+ top: event.pageY - this.offset.top
+ },
+ parent: this._getParentOffset(),
+
+ // This is a relative to absolute position minus the actual position calculation -
+ // only used for relative positioned helper
+ relative: this._getRelativeOffset()
+ } );
+
+ // Only after we got the offset, we can change the helper's position to absolute
+ // TODO: Still need to figure out a way to make relative sorting possible
+ this.helper.css( "position", "absolute" );
+ this.cssPosition = this.helper.css( "position" );
+
+ //Generate the original position
+ this.originalPosition = this._generatePosition( event );
+ this.originalPageX = event.pageX;
+ this.originalPageY = event.pageY;
+
+ //Adjust the mouse offset relative to the helper if "cursorAt" is supplied
+ ( o.cursorAt && this._adjustOffsetFromHelper( o.cursorAt ) );
+
+ //Cache the former DOM position
+ this.domPosition = {
+ prev: this.currentItem.prev()[ 0 ],
+ parent: this.currentItem.parent()[ 0 ]
+ };
+
+ // If the helper is not the original, hide the original so it's not playing any role during
+ // the drag, won't cause anything bad this way
+ if ( this.helper[ 0 ] !== this.currentItem[ 0 ] ) {
+ this.currentItem.hide();
+ }
+
+ //Create the placeholder
+ this._createPlaceholder();
+
+ //Set a containment if given in the options
+ if ( o.containment ) {
+ this._setContainment();
+ }
+
+ if ( o.cursor && o.cursor !== "auto" ) { // cursor option
+ body = this.document.find( "body" );
+
+ // Support: IE
+ this.storedCursor = body.css( "cursor" );
+ body.css( "cursor", o.cursor );
+
+ this.storedStylesheet =
+ $( "<style>*{ cursor: " + o.cursor + " !important; }</style>" ).appendTo( body );
+ }
+
+ if ( o.opacity ) { // opacity option
+ if ( this.helper.css( "opacity" ) ) {
+ this._storedOpacity = this.helper.css( "opacity" );
+ }
+ this.helper.css( "opacity", o.opacity );
+ }
+
+ if ( o.zIndex ) { // zIndex option
+ if ( this.helper.css( "zIndex" ) ) {
+ this._storedZIndex = this.helper.css( "zIndex" );
+ }
+ this.helper.css( "zIndex", o.zIndex );
+ }
+
+ //Prepare scrolling
+ if ( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
+ this.scrollParent[ 0 ].tagName !== "HTML" ) {
+ this.overflowOffset = this.scrollParent.offset();
+ }
+
+ //Call callbacks
+ this._trigger( "start", event, this._uiHash() );
+
+ //Recache the helper size
+ if ( !this._preserveHelperProportions ) {
+ this._cacheHelperProportions();
+ }
+
+ //Post "activate" events to possible containers
+ if ( !noActivation ) {
+ for ( i = this.containers.length - 1; i >= 0; i-- ) {
+ this.containers[ i ]._trigger( "activate", event, this._uiHash( this ) );
+ }
+ }
+
+ //Prepare possible droppables
+ if ( $.ui.ddmanager ) {
+ $.ui.ddmanager.current = this;
+ }
+
+ if ( $.ui.ddmanager && !o.dropBehaviour ) {
+ $.ui.ddmanager.prepareOffsets( this, event );
+ }
+
+ this.dragging = true;
+
+ this._addClass( this.helper, "ui-sortable-helper" );
+
+ // Execute the drag once - this causes the helper not to be visiblebefore getting its
+ // correct position
+ this._mouseDrag( event );
+ return true;
+
+ },
+
+ _mouseDrag: function( event ) {
+ var i, item, itemElement, intersection,
+ o = this.options,
+ scrolled = false;
+
+ //Compute the helpers position
+ this.position = this._generatePosition( event );
+ this.positionAbs = this._convertPositionTo( "absolute" );
+
+ if ( !this.lastPositionAbs ) {
+ this.lastPositionAbs = this.positionAbs;
+ }
+
+ //Do scrolling
+ if ( this.options.scroll ) {
+ if ( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
+ this.scrollParent[ 0 ].tagName !== "HTML" ) {
+
+ if ( ( this.overflowOffset.top + this.scrollParent[ 0 ].offsetHeight ) -
+ event.pageY < o.scrollSensitivity ) {
+ this.scrollParent[ 0 ].scrollTop =
+ scrolled = this.scrollParent[ 0 ].scrollTop + o.scrollSpeed;
+ } else if ( event.pageY - this.overflowOffset.top < o.scrollSensitivity ) {
+ this.scrollParent[ 0 ].scrollTop =
+ scrolled = this.scrollParent[ 0 ].scrollTop - o.scrollSpeed;
+ }
+
+ if ( ( this.overflowOffset.left + this.scrollParent[ 0 ].offsetWidth ) -
+ event.pageX < o.scrollSensitivity ) {
+ this.scrollParent[ 0 ].scrollLeft = scrolled =
+ this.scrollParent[ 0 ].scrollLeft + o.scrollSpeed;
+ } else if ( event.pageX - this.overflowOffset.left < o.scrollSensitivity ) {
+ this.scrollParent[ 0 ].scrollLeft = scrolled =
+ this.scrollParent[ 0 ].scrollLeft - o.scrollSpeed;
+ }
+
+ } else {
+
+ if ( event.pageY - this.document.scrollTop() < o.scrollSensitivity ) {
+ scrolled = this.document.scrollTop( this.document.scrollTop() - o.scrollSpeed );
+ } else if ( this.window.height() - ( event.pageY - this.document.scrollTop() ) <
+ o.scrollSensitivity ) {
+ scrolled = this.document.scrollTop( this.document.scrollTop() + o.scrollSpeed );
+ }
+
+ if ( event.pageX - this.document.scrollLeft() < o.scrollSensitivity ) {
+ scrolled = this.document.scrollLeft(
+ this.document.scrollLeft() - o.scrollSpeed
+ );
+ } else if ( this.window.width() - ( event.pageX - this.document.scrollLeft() ) <
+ o.scrollSensitivity ) {
+ scrolled = this.document.scrollLeft(
+ this.document.scrollLeft() + o.scrollSpeed
+ );
+ }
+
+ }
+
+ if ( scrolled !== false && $.ui.ddmanager && !o.dropBehaviour ) {
+ $.ui.ddmanager.prepareOffsets( this, event );
+ }
+ }
+
+ //Regenerate the absolute position used for position checks
+ this.positionAbs = this._convertPositionTo( "absolute" );
+
+ //Set the helper position
+ if ( !this.options.axis || this.options.axis !== "y" ) {
+ this.helper[ 0 ].style.left = this.position.left + "px";
+ }
+ if ( !this.options.axis || this.options.axis !== "x" ) {
+ this.helper[ 0 ].style.top = this.position.top + "px";
+ }
+
+ //Rearrange
+ for ( i = this.items.length - 1; i >= 0; i-- ) {
+
+ //Cache variables and intersection, continue if no intersection
+ item = this.items[ i ];
+ itemElement = item.item[ 0 ];
+ intersection = this._intersectsWithPointer( item );
+ if ( !intersection ) {
+ continue;
+ }
+
+ // Only put the placeholder inside the current Container, skip all
+ // items from other containers. This works because when moving
+ // an item from one container to another the
+ // currentContainer is switched before the placeholder is moved.
+ //
+ // Without this, moving items in "sub-sortables" can cause
+ // the placeholder to jitter between the outer and inner container.
+ if ( item.instance !== this.currentContainer ) {
+ continue;
+ }
+
+ // Cannot intersect with itself
+ // no useless actions that have been done before
+ // no action if the item moved is the parent of the item checked
+ if ( itemElement !== this.currentItem[ 0 ] &&
+ this.placeholder[ intersection === 1 ? "next" : "prev" ]()[ 0 ] !== itemElement &&
+ !$.contains( this.placeholder[ 0 ], itemElement ) &&
+ ( this.options.type === "semi-dynamic" ?
+ !$.contains( this.element[ 0 ], itemElement ) :
+ true
+ )
+ ) {
+
+ this.direction = intersection === 1 ? "down" : "up";
+
+ if ( this.options.tolerance === "pointer" || this._intersectsWithSides( item ) ) {
+ this._rearrange( event, item );
+ } else {
+ break;
+ }
+
+ this._trigger( "change", event, this._uiHash() );
+ break;
+ }
+ }
+
+ //Post events to containers
+ this._contactContainers( event );
+
+ //Interconnect with droppables
+ if ( $.ui.ddmanager ) {
+ $.ui.ddmanager.drag( this, event );
+ }
+
+ //Call callbacks
+ this._trigger( "sort", event, this._uiHash() );
+
+ this.lastPositionAbs = this.positionAbs;
+ return false;
+
+ },
+
+ _mouseStop: function( event, noPropagation ) {
+
+ if ( !event ) {
+ return;
+ }
+
+ //If we are using droppables, inform the manager about the drop
+ if ( $.ui.ddmanager && !this.options.dropBehaviour ) {
+ $.ui.ddmanager.drop( this, event );
+ }
+
+ if ( this.options.revert ) {
+ var that = this,
+ cur = this.placeholder.offset(),
+ axis = this.options.axis,
+ animation = {};
+
+ if ( !axis || axis === "x" ) {
+ animation.left = cur.left - this.offset.parent.left - this.margins.left +
+ ( this.offsetParent[ 0 ] === this.document[ 0 ].body ?
+ 0 :
+ this.offsetParent[ 0 ].scrollLeft
+ );
+ }
+ if ( !axis || axis === "y" ) {
+ animation.top = cur.top - this.offset.parent.top - this.margins.top +
+ ( this.offsetParent[ 0 ] === this.document[ 0 ].body ?
+ 0 :
+ this.offsetParent[ 0 ].scrollTop
+ );
+ }
+ this.reverting = true;
+ $( this.helper ).animate(
+ animation,
+ parseInt( this.options.revert, 10 ) || 500,
+ function() {
+ that._clear( event );
+ }
+ );
+ } else {
+ this._clear( event, noPropagation );
+ }
+
+ return false;
+
+ },
+
+ cancel: function() {
+
+ if ( this.dragging ) {
+
+ this._mouseUp( new $.Event( "mouseup", { target: null } ) );
+
+ if ( this.options.helper === "original" ) {
+ this.currentItem.css( this._storedCSS );
+ this._removeClass( this.currentItem, "ui-sortable-helper" );
+ } else {
+ this.currentItem.show();
+ }
+
+ //Post deactivating events to containers
+ for ( var i = this.containers.length - 1; i >= 0; i-- ) {
+ this.containers[ i ]._trigger( "deactivate", null, this._uiHash( this ) );
+ if ( this.containers[ i ].containerCache.over ) {
+ this.containers[ i ]._trigger( "out", null, this._uiHash( this ) );
+ this.containers[ i ].containerCache.over = 0;
+ }
+ }
+
+ }
+
+ if ( this.placeholder ) {
+
+ //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately,
+ // it unbinds ALL events from the original node!
+ if ( this.placeholder[ 0 ].parentNode ) {
+ this.placeholder[ 0 ].parentNode.removeChild( this.placeholder[ 0 ] );
+ }
+ if ( this.options.helper !== "original" && this.helper &&
+ this.helper[ 0 ].parentNode ) {
+ this.helper.remove();
+ }
+
+ $.extend( this, {
+ helper: null,
+ dragging: false,
+ reverting: false,
+ _noFinalSort: null
+ } );
+
+ if ( this.domPosition.prev ) {
+ $( this.domPosition.prev ).after( this.currentItem );
+ } else {
+ $( this.domPosition.parent ).prepend( this.currentItem );
+ }
+ }
+
+ return this;
+
+ },
+
+ serialize: function( o ) {
+
+ var items = this._getItemsAsjQuery( o && o.connected ),
+ str = [];
+ o = o || {};
+
+ $( items ).each( function() {
+ var res = ( $( o.item || this ).attr( o.attribute || "id" ) || "" )
+ .match( o.expression || ( /(.+)[\-=_](.+)/ ) );
+ if ( res ) {
+ str.push(
+ ( o.key || res[ 1 ] + "[]" ) +
+ "=" + ( o.key && o.expression ? res[ 1 ] : res[ 2 ] ) );
+ }
+ } );
+
+ if ( !str.length && o.key ) {
+ str.push( o.key + "=" );
+ }
+
+ return str.join( "&" );
+
+ },
+
+ toArray: function( o ) {
+
+ var items = this._getItemsAsjQuery( o && o.connected ),
+ ret = [];
+
+ o = o || {};
+
+ items.each( function() {
+ ret.push( $( o.item || this ).attr( o.attribute || "id" ) || "" );
+ } );
+ return ret;
+
+ },
+
+ /* Be careful with the following core functions */
+ _intersectsWith: function( item ) {
+
+ var x1 = this.positionAbs.left,
+ x2 = x1 + this.helperProportions.width,
+ y1 = this.positionAbs.top,
+ y2 = y1 + this.helperProportions.height,
+ l = item.left,
+ r = l + item.width,
+ t = item.top,
+ b = t + item.height,
+ dyClick = this.offset.click.top,
+ dxClick = this.offset.click.left,
+ isOverElementHeight = ( this.options.axis === "x" ) || ( ( y1 + dyClick ) > t &&
+ ( y1 + dyClick ) < b ),
+ isOverElementWidth = ( this.options.axis === "y" ) || ( ( x1 + dxClick ) > l &&
+ ( x1 + dxClick ) < r ),
+ isOverElement = isOverElementHeight && isOverElementWidth;
+
+ if ( this.options.tolerance === "pointer" ||
+ this.options.forcePointerForContainers ||
+ ( this.options.tolerance !== "pointer" &&
+ this.helperProportions[ this.floating ? "width" : "height" ] >
+ item[ this.floating ? "width" : "height" ] )
+ ) {
+ return isOverElement;
+ } else {
+
+ return ( l < x1 + ( this.helperProportions.width / 2 ) && // Right Half
+ x2 - ( this.helperProportions.width / 2 ) < r && // Left Half
+ t < y1 + ( this.helperProportions.height / 2 ) && // Bottom Half
+ y2 - ( this.helperProportions.height / 2 ) < b ); // Top Half
+
+ }
+ },
+
+ _intersectsWithPointer: function( item ) {
+ var verticalDirection, horizontalDirection,
+ isOverElementHeight = ( this.options.axis === "x" ) ||
+ this._isOverAxis(
+ this.positionAbs.top + this.offset.click.top, item.top, item.height ),
+ isOverElementWidth = ( this.options.axis === "y" ) ||
+ this._isOverAxis(
+ this.positionAbs.left + this.offset.click.left, item.left, item.width ),
+ isOverElement = isOverElementHeight && isOverElementWidth;
+
+ if ( !isOverElement ) {
+ return false;
+ }
+
+ verticalDirection = this._getDragVerticalDirection();
+ horizontalDirection = this._getDragHorizontalDirection();
+
+ return this.floating ?
+ ( ( horizontalDirection === "right" || verticalDirection === "down" ) ? 2 : 1 )
+ : ( verticalDirection && ( verticalDirection === "down" ? 2 : 1 ) );
+
+ },
+
+ _intersectsWithSides: function( item ) {
+
+ var isOverBottomHalf = this._isOverAxis( this.positionAbs.top +
+ this.offset.click.top, item.top + ( item.height / 2 ), item.height ),
+ isOverRightHalf = this._isOverAxis( this.positionAbs.left +
+ this.offset.click.left, item.left + ( item.width / 2 ), item.width ),
+ verticalDirection = this._getDragVerticalDirection(),
+ horizontalDirection = this._getDragHorizontalDirection();
+
+ if ( this.floating && horizontalDirection ) {
+ return ( ( horizontalDirection === "right" && isOverRightHalf ) ||
+ ( horizontalDirection === "left" && !isOverRightHalf ) );
+ } else {
+ return verticalDirection && ( ( verticalDirection === "down" && isOverBottomHalf ) ||
+ ( verticalDirection === "up" && !isOverBottomHalf ) );
+ }
+
+ },
+
+ _getDragVerticalDirection: function() {
+ var delta = this.positionAbs.top - this.lastPositionAbs.top;
+ return delta !== 0 && ( delta > 0 ? "down" : "up" );
+ },
+
+ _getDragHorizontalDirection: function() {
+ var delta = this.positionAbs.left - this.lastPositionAbs.left;
+ return delta !== 0 && ( delta > 0 ? "right" : "left" );
+ },
+
+ refresh: function( event ) {
+ this._refreshItems( event );
+ this._setHandleClassName();
+ this.refreshPositions();
+ return this;
+ },
+
+ _connectWith: function() {
+ var options = this.options;
+ return options.connectWith.constructor === String ?
+ [ options.connectWith ] :
+ options.connectWith;
+ },
+
+ _getItemsAsjQuery: function( connected ) {
+
+ var i, j, cur, inst,
+ items = [],
+ queries = [],
+ connectWith = this._connectWith();
+
+ if ( connectWith && connected ) {
+ for ( i = connectWith.length - 1; i >= 0; i-- ) {
+ cur = $( connectWith[ i ], this.document[ 0 ] );
+ for ( j = cur.length - 1; j >= 0; j-- ) {
+ inst = $.data( cur[ j ], this.widgetFullName );
+ if ( inst && inst !== this && !inst.options.disabled ) {
+ queries.push( [ $.isFunction( inst.options.items ) ?
+ inst.options.items.call( inst.element ) :
+ $( inst.options.items, inst.element )
+ .not( ".ui-sortable-helper" )
+ .not( ".ui-sortable-placeholder" ), inst ] );
+ }
+ }
+ }
+ }
+
+ queries.push( [ $.isFunction( this.options.items ) ?
+ this.options.items
+ .call( this.element, null, { options: this.options, item: this.currentItem } ) :
+ $( this.options.items, this.element )
+ .not( ".ui-sortable-helper" )
+ .not( ".ui-sortable-placeholder" ), this ] );
+
+ function addItems() {
+ items.push( this );
+ }
+ for ( i = queries.length - 1; i >= 0; i-- ) {
+ queries[ i ][ 0 ].each( addItems );
+ }
+
+ return $( items );
+
+ },
+
+ _removeCurrentsFromItems: function() {
+
+ var list = this.currentItem.find( ":data(" + this.widgetName + "-item)" );
+
+ this.items = $.grep( this.items, function( item ) {
+ for ( var j = 0; j < list.length; j++ ) {
+ if ( list[ j ] === item.item[ 0 ] ) {
+ return false;
+ }
+ }
+ return true;
+ } );
+
+ },
+
+ _refreshItems: function( event ) {
+
+ this.items = [];
+ this.containers = [ this ];
+
+ var i, j, cur, inst, targetData, _queries, item, queriesLength,
+ items = this.items,
+ queries = [ [ $.isFunction( this.options.items ) ?
+ this.options.items.call( this.element[ 0 ], event, { item: this.currentItem } ) :
+ $( this.options.items, this.element ), this ] ],
+ connectWith = this._connectWith();
+
+ //Shouldn't be run the first time through due to massive slow-down
+ if ( connectWith && this.ready ) {
+ for ( i = connectWith.length - 1; i >= 0; i-- ) {
+ cur = $( connectWith[ i ], this.document[ 0 ] );
+ for ( j = cur.length - 1; j >= 0; j-- ) {
+ inst = $.data( cur[ j ], this.widgetFullName );
+ if ( inst && inst !== this && !inst.options.disabled ) {
+ queries.push( [ $.isFunction( inst.options.items ) ?
+ inst.options.items
+ .call( inst.element[ 0 ], event, { item: this.currentItem } ) :
+ $( inst.options.items, inst.element ), inst ] );
+ this.containers.push( inst );
+ }
+ }
+ }
+ }
+
+ for ( i = queries.length - 1; i >= 0; i-- ) {
+ targetData = queries[ i ][ 1 ];
+ _queries = queries[ i ][ 0 ];
+
+ for ( j = 0, queriesLength = _queries.length; j < queriesLength; j++ ) {
+ item = $( _queries[ j ] );
+
+ // Data for target checking (mouse manager)
+ item.data( this.widgetName + "-item", targetData );
+
+ items.push( {
+ item: item,
+ instance: targetData,
+ width: 0, height: 0,
+ left: 0, top: 0
+ } );
+ }
+ }
+
+ },
+
+ refreshPositions: function( fast ) {
+
+ // Determine whether items are being displayed horizontally
+ this.floating = this.items.length ?
+ this.options.axis === "x" || this._isFloating( this.items[ 0 ].item ) :
+ false;
+
+ //This has to be redone because due to the item being moved out/into the offsetParent,
+ // the offsetParent's position will change
+ if ( this.offsetParent && this.helper ) {
+ this.offset.parent = this._getParentOffset();
+ }
+
+ var i, item, t, p;
+
+ for ( i = this.items.length - 1; i >= 0; i-- ) {
+ item = this.items[ i ];
+
+ //We ignore calculating positions of all connected containers when we're not over them
+ if ( item.instance !== this.currentContainer && this.currentContainer &&
+ item.item[ 0 ] !== this.currentItem[ 0 ] ) {
+ continue;
+ }
+
+ t = this.options.toleranceElement ?
+ $( this.options.toleranceElement, item.item ) :
+ item.item;
+
+ if ( !fast ) {
+ item.width = t.outerWidth();
+ item.height = t.outerHeight();
+ }
+
+ p = t.offset();
+ item.left = p.left;
+ item.top = p.top;
+ }
+
+ if ( this.options.custom && this.options.custom.refreshContainers ) {
+ this.options.custom.refreshContainers.call( this );
+ } else {
+ for ( i = this.containers.length - 1; i >= 0; i-- ) {
+ p = this.containers[ i ].element.offset();
+ this.containers[ i ].containerCache.left = p.left;
+ this.containers[ i ].containerCache.top = p.top;
+ this.containers[ i ].containerCache.width =
+ this.containers[ i ].element.outerWidth();
+ this.containers[ i ].containerCache.height =
+ this.containers[ i ].element.outerHeight();
+ }
+ }
+
+ return this;
+ },
+
+ _createPlaceholder: function( that ) {
+ that = that || this;
+ var className,
+ o = that.options;
+
+ if ( !o.placeholder || o.placeholder.constructor === String ) {
+ className = o.placeholder;
+ o.placeholder = {
+ element: function() {
+
+ var nodeName = that.currentItem[ 0 ].nodeName.toLowerCase(),
+ element = $( "<" + nodeName + ">", that.document[ 0 ] );
+
+ that._addClass( element, "ui-sortable-placeholder",
+ className || that.currentItem[ 0 ].className )
+ ._removeClass( element, "ui-sortable-helper" );
+
+ if ( nodeName === "tbody" ) {
+ that._createTrPlaceholder(
+ that.currentItem.find( "tr" ).eq( 0 ),
+ $( "<tr>", that.document[ 0 ] ).appendTo( element )
+ );
+ } else if ( nodeName === "tr" ) {
+ that._createTrPlaceholder( that.currentItem, element );
+ } else if ( nodeName === "img" ) {
+ element.attr( "src", that.currentItem.attr( "src" ) );
+ }
+
+ if ( !className ) {
+ element.css( "visibility", "hidden" );
+ }
+
+ return element;
+ },
+ update: function( container, p ) {
+
+ // 1. If a className is set as 'placeholder option, we don't force sizes -
+ // the class is responsible for that
+ // 2. The option 'forcePlaceholderSize can be enabled to force it even if a
+ // class name is specified
+ if ( className && !o.forcePlaceholderSize ) {
+ return;
+ }
+
+ //If the element doesn't have a actual height by itself (without styles coming
+ // from a stylesheet), it receives the inline height from the dragged item
+ if ( !p.height() ) {
+ p.height(
+ that.currentItem.innerHeight() -
+ parseInt( that.currentItem.css( "paddingTop" ) || 0, 10 ) -
+ parseInt( that.currentItem.css( "paddingBottom" ) || 0, 10 ) );
+ }
+ if ( !p.width() ) {
+ p.width(
+ that.currentItem.innerWidth() -
+ parseInt( that.currentItem.css( "paddingLeft" ) || 0, 10 ) -
+ parseInt( that.currentItem.css( "paddingRight" ) || 0, 10 ) );
+ }
+ }
+ };
+ }
+
+ //Create the placeholder
+ that.placeholder = $( o.placeholder.element.call( that.element, that.currentItem ) );
+
+ //Append it after the actual current item
+ that.currentItem.after( that.placeholder );
+
+ //Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317)
+ o.placeholder.update( that, that.placeholder );
+
+ },
+
+ _createTrPlaceholder: function( sourceTr, targetTr ) {
+ var that = this;
+
+ sourceTr.children().each( function() {
+ $( "<td>&#160;</td>", that.document[ 0 ] )
+ .attr( "colspan", $( this ).attr( "colspan" ) || 1 )
+ .appendTo( targetTr );
+ } );
+ },
+
+ _contactContainers: function( event ) {
+ var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, cur, nearBottom,
+ floating, axis,
+ innermostContainer = null,
+ innermostIndex = null;
+
+ // Get innermost container that intersects with item
+ for ( i = this.containers.length - 1; i >= 0; i-- ) {
+
+ // Never consider a container that's located within the item itself
+ if ( $.contains( this.currentItem[ 0 ], this.containers[ i ].element[ 0 ] ) ) {
+ continue;
+ }
+
+ if ( this._intersectsWith( this.containers[ i ].containerCache ) ) {
+
+ // If we've already found a container and it's more "inner" than this, then continue
+ if ( innermostContainer &&
+ $.contains(
+ this.containers[ i ].element[ 0 ],
+ innermostContainer.element[ 0 ] ) ) {
+ continue;
+ }
+
+ innermostContainer = this.containers[ i ];
+ innermostIndex = i;
+
+ } else {
+
+ // container doesn't intersect. trigger "out" event if necessary
+ if ( this.containers[ i ].containerCache.over ) {
+ this.containers[ i ]._trigger( "out", event, this._uiHash( this ) );
+ this.containers[ i ].containerCache.over = 0;
+ }
+ }
+
+ }
+
+ // If no intersecting containers found, return
+ if ( !innermostContainer ) {
+ return;
+ }
+
+ // Move the item into the container if it's not there already
+ if ( this.containers.length === 1 ) {
+ if ( !this.containers[ innermostIndex ].containerCache.over ) {
+ this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash( this ) );
+ this.containers[ innermostIndex ].containerCache.over = 1;
+ }
+ } else {
+
+ // When entering a new container, we will find the item with the least distance and
+ // append our item near it
+ dist = 10000;
+ itemWithLeastDistance = null;
+ floating = innermostContainer.floating || this._isFloating( this.currentItem );
+ posProperty = floating ? "left" : "top";
+ sizeProperty = floating ? "width" : "height";
+ axis = floating ? "pageX" : "pageY";
+
+ for ( j = this.items.length - 1; j >= 0; j-- ) {
+ if ( !$.contains(
+ this.containers[ innermostIndex ].element[ 0 ], this.items[ j ].item[ 0 ] )
+ ) {
+ continue;
+ }
+ if ( this.items[ j ].item[ 0 ] === this.currentItem[ 0 ] ) {
+ continue;
+ }
+
+ cur = this.items[ j ].item.offset()[ posProperty ];
+ nearBottom = false;
+ if ( event[ axis ] - cur > this.items[ j ][ sizeProperty ] / 2 ) {
+ nearBottom = true;
+ }
+
+ if ( Math.abs( event[ axis ] - cur ) < dist ) {
+ dist = Math.abs( event[ axis ] - cur );
+ itemWithLeastDistance = this.items[ j ];
+ this.direction = nearBottom ? "up" : "down";
+ }
+ }
+
+ //Check if dropOnEmpty is enabled
+ if ( !itemWithLeastDistance && !this.options.dropOnEmpty ) {
+ return;
+ }
+
+ if ( this.currentContainer === this.containers[ innermostIndex ] ) {
+ if ( !this.currentContainer.containerCache.over ) {
+ this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash() );
+ this.currentContainer.containerCache.over = 1;
+ }
+ return;
+ }
+
+ itemWithLeastDistance ?
+ this._rearrange( event, itemWithLeastDistance, null, true ) :
+ this._rearrange( event, null, this.containers[ innermostIndex ].element, true );
+ this._trigger( "change", event, this._uiHash() );
+ this.containers[ innermostIndex ]._trigger( "change", event, this._uiHash( this ) );
+ this.currentContainer = this.containers[ innermostIndex ];
+
+ //Update the placeholder
+ this.options.placeholder.update( this.currentContainer, this.placeholder );
+
+ this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash( this ) );
+ this.containers[ innermostIndex ].containerCache.over = 1;
+ }
+
+ },
+
+ _createHelper: function( event ) {
+
+ var o = this.options,
+ helper = $.isFunction( o.helper ) ?
+ $( o.helper.apply( this.element[ 0 ], [ event, this.currentItem ] ) ) :
+ ( o.helper === "clone" ? this.currentItem.clone() : this.currentItem );
+
+ //Add the helper to the DOM if that didn't happen already
+ if ( !helper.parents( "body" ).length ) {
+ $( o.appendTo !== "parent" ?
+ o.appendTo :
+ this.currentItem[ 0 ].parentNode )[ 0 ].appendChild( helper[ 0 ] );
+ }
+
+ if ( helper[ 0 ] === this.currentItem[ 0 ] ) {
+ this._storedCSS = {
+ width: this.currentItem[ 0 ].style.width,
+ height: this.currentItem[ 0 ].style.height,
+ position: this.currentItem.css( "position" ),
+ top: this.currentItem.css( "top" ),
+ left: this.currentItem.css( "left" )
+ };
+ }
+
+ if ( !helper[ 0 ].style.width || o.forceHelperSize ) {
+ helper.width( this.currentItem.width() );
+ }
+ if ( !helper[ 0 ].style.height || o.forceHelperSize ) {
+ helper.height( this.currentItem.height() );
+ }
+
+ return helper;
+
+ },
+
+ _adjustOffsetFromHelper: function( obj ) {
+ if ( typeof obj === "string" ) {
+ obj = obj.split( " " );
+ }
+ if ( $.isArray( obj ) ) {
+ obj = { left: +obj[ 0 ], top: +obj[ 1 ] || 0 };
+ }
+ if ( "left" in obj ) {
+ this.offset.click.left = obj.left + this.margins.left;
+ }
+ if ( "right" in obj ) {
+ this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
+ }
+ if ( "top" in obj ) {
+ this.offset.click.top = obj.top + this.margins.top;
+ }
+ if ( "bottom" in obj ) {
+ this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
+ }
+ },
+
+ _getParentOffset: function() {
+
+ //Get the offsetParent and cache its position
+ this.offsetParent = this.helper.offsetParent();
+ var po = this.offsetParent.offset();
+
+ // This is a special case where we need to modify a offset calculated on start, since the
+ // following happened:
+ // 1. The position of the helper is absolute, so it's position is calculated based on the
+ // next positioned parent
+ // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't
+ // the document, which means that the scroll is included in the initial calculation of the
+ // offset of the parent, and never recalculated upon drag
+ if ( this.cssPosition === "absolute" && this.scrollParent[ 0 ] !== this.document[ 0 ] &&
+ $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) {
+ po.left += this.scrollParent.scrollLeft();
+ po.top += this.scrollParent.scrollTop();
+ }
+
+ // This needs to be actually done for all browsers, since pageX/pageY includes this
+ // information with an ugly IE fix
+ if ( this.offsetParent[ 0 ] === this.document[ 0 ].body ||
+ ( this.offsetParent[ 0 ].tagName &&
+ this.offsetParent[ 0 ].tagName.toLowerCase() === "html" && $.ui.ie ) ) {
+ po = { top: 0, left: 0 };
+ }
+
+ return {
+ top: po.top + ( parseInt( this.offsetParent.css( "borderTopWidth" ), 10 ) || 0 ),
+ left: po.left + ( parseInt( this.offsetParent.css( "borderLeftWidth" ), 10 ) || 0 )
+ };
+
+ },
+
+ _getRelativeOffset: function() {
+
+ if ( this.cssPosition === "relative" ) {
+ var p = this.currentItem.position();
+ return {
+ top: p.top - ( parseInt( this.helper.css( "top" ), 10 ) || 0 ) +
+ this.scrollParent.scrollTop(),
+ left: p.left - ( parseInt( this.helper.css( "left" ), 10 ) || 0 ) +
+ this.scrollParent.scrollLeft()
+ };
+ } else {
+ return { top: 0, left: 0 };
+ }
+
+ },
+
+ _cacheMargins: function() {
+ this.margins = {
+ left: ( parseInt( this.currentItem.css( "marginLeft" ), 10 ) || 0 ),
+ top: ( parseInt( this.currentItem.css( "marginTop" ), 10 ) || 0 )
+ };
+ },
+
+ _cacheHelperProportions: function() {
+ this.helperProportions = {
+ width: this.helper.outerWidth(),
+ height: this.helper.outerHeight()
+ };
+ },
+
+ _setContainment: function() {
+
+ var ce, co, over,
+ o = this.options;
+ if ( o.containment === "parent" ) {
+ o.containment = this.helper[ 0 ].parentNode;
+ }
+ if ( o.containment === "document" || o.containment === "window" ) {
+ this.containment = [
+ 0 - this.offset.relative.left - this.offset.parent.left,
+ 0 - this.offset.relative.top - this.offset.parent.top,
+ o.containment === "document" ?
+ this.document.width() :
+ this.window.width() - this.helperProportions.width - this.margins.left,
+ ( o.containment === "document" ?
+ ( this.document.height() || document.body.parentNode.scrollHeight ) :
+ this.window.height() || this.document[ 0 ].body.parentNode.scrollHeight
+ ) - this.helperProportions.height - this.margins.top
+ ];
+ }
+
+ if ( !( /^(document|window|parent)$/ ).test( o.containment ) ) {
+ ce = $( o.containment )[ 0 ];
+ co = $( o.containment ).offset();
+ over = ( $( ce ).css( "overflow" ) !== "hidden" );
+
+ this.containment = [
+ co.left + ( parseInt( $( ce ).css( "borderLeftWidth" ), 10 ) || 0 ) +
+ ( parseInt( $( ce ).css( "paddingLeft" ), 10 ) || 0 ) - this.margins.left,
+ co.top + ( parseInt( $( ce ).css( "borderTopWidth" ), 10 ) || 0 ) +
+ ( parseInt( $( ce ).css( "paddingTop" ), 10 ) || 0 ) - this.margins.top,
+ co.left + ( over ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) -
+ ( parseInt( $( ce ).css( "borderLeftWidth" ), 10 ) || 0 ) -
+ ( parseInt( $( ce ).css( "paddingRight" ), 10 ) || 0 ) -
+ this.helperProportions.width - this.margins.left,
+ co.top + ( over ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) -
+ ( parseInt( $( ce ).css( "borderTopWidth" ), 10 ) || 0 ) -
+ ( parseInt( $( ce ).css( "paddingBottom" ), 10 ) || 0 ) -
+ this.helperProportions.height - this.margins.top
+ ];
+ }
+
+ },
+
+ _convertPositionTo: function( d, pos ) {
+
+ if ( !pos ) {
+ pos = this.position;
+ }
+ var mod = d === "absolute" ? 1 : -1,
+ scroll = this.cssPosition === "absolute" &&
+ !( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
+ $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ?
+ this.offsetParent :
+ this.scrollParent,
+ scrollIsRootNode = ( /(html|body)/i ).test( scroll[ 0 ].tagName );
+
+ return {
+ top: (
+
+ // The absolute mouse position
+ pos.top +
+
+ // Only for relative positioned nodes: Relative offset from element to offset parent
+ this.offset.relative.top * mod +
+
+ // The offsetParent's offset without borders (offset + border)
+ this.offset.parent.top * mod -
+ ( ( this.cssPosition === "fixed" ?
+ -this.scrollParent.scrollTop() :
+ ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod )
+ ),
+ left: (
+
+ // The absolute mouse position
+ pos.left +
+
+ // Only for relative positioned nodes: Relative offset from element to offset parent
+ this.offset.relative.left * mod +
+
+ // The offsetParent's offset without borders (offset + border)
+ this.offset.parent.left * mod -
+ ( ( this.cssPosition === "fixed" ?
+ -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 :
+ scroll.scrollLeft() ) * mod )
+ )
+ };
+
+ },
+
+ _generatePosition: function( event ) {
+
+ var top, left,
+ o = this.options,
+ pageX = event.pageX,
+ pageY = event.pageY,
+ scroll = this.cssPosition === "absolute" &&
+ !( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
+ $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ?
+ this.offsetParent :
+ this.scrollParent,
+ scrollIsRootNode = ( /(html|body)/i ).test( scroll[ 0 ].tagName );
+
+ // This is another very weird special case that only happens for relative elements:
+ // 1. If the css position is relative
+ // 2. and the scroll parent is the document or similar to the offset parent
+ // we have to refresh the relative offset during the scroll so there are no jumps
+ if ( this.cssPosition === "relative" && !( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
+ this.scrollParent[ 0 ] !== this.offsetParent[ 0 ] ) ) {
+ this.offset.relative = this._getRelativeOffset();
+ }
+
+ /*
+ * - Position constraining -
+ * Constrain the position to a mix of grid, containment.
+ */
+
+ if ( this.originalPosition ) { //If we are not dragging yet, we won't check for options
+
+ if ( this.containment ) {
+ if ( event.pageX - this.offset.click.left < this.containment[ 0 ] ) {
+ pageX = this.containment[ 0 ] + this.offset.click.left;
+ }
+ if ( event.pageY - this.offset.click.top < this.containment[ 1 ] ) {
+ pageY = this.containment[ 1 ] + this.offset.click.top;
+ }
+ if ( event.pageX - this.offset.click.left > this.containment[ 2 ] ) {
+ pageX = this.containment[ 2 ] + this.offset.click.left;
+ }
+ if ( event.pageY - this.offset.click.top > this.containment[ 3 ] ) {
+ pageY = this.containment[ 3 ] + this.offset.click.top;
+ }
+ }
+
+ if ( o.grid ) {
+ top = this.originalPageY + Math.round( ( pageY - this.originalPageY ) /
+ o.grid[ 1 ] ) * o.grid[ 1 ];
+ pageY = this.containment ?
+ ( ( top - this.offset.click.top >= this.containment[ 1 ] &&
+ top - this.offset.click.top <= this.containment[ 3 ] ) ?
+ top :
+ ( ( top - this.offset.click.top >= this.containment[ 1 ] ) ?
+ top - o.grid[ 1 ] : top + o.grid[ 1 ] ) ) :
+ top;
+
+ left = this.originalPageX + Math.round( ( pageX - this.originalPageX ) /
+ o.grid[ 0 ] ) * o.grid[ 0 ];
+ pageX = this.containment ?
+ ( ( left - this.offset.click.left >= this.containment[ 0 ] &&
+ left - this.offset.click.left <= this.containment[ 2 ] ) ?
+ left :
+ ( ( left - this.offset.click.left >= this.containment[ 0 ] ) ?
+ left - o.grid[ 0 ] : left + o.grid[ 0 ] ) ) :
+ left;
+ }
+
+ }
+
+ return {
+ top: (
+
+ // The absolute mouse position
+ pageY -
+
+ // Click offset (relative to the element)
+ this.offset.click.top -
+
+ // Only for relative positioned nodes: Relative offset from element to offset parent
+ this.offset.relative.top -
+
+ // The offsetParent's offset without borders (offset + border)
+ this.offset.parent.top +
+ ( ( this.cssPosition === "fixed" ?
+ -this.scrollParent.scrollTop() :
+ ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) )
+ ),
+ left: (
+
+ // The absolute mouse position
+ pageX -
+
+ // Click offset (relative to the element)
+ this.offset.click.left -
+
+ // Only for relative positioned nodes: Relative offset from element to offset parent
+ this.offset.relative.left -
+
+ // The offsetParent's offset without borders (offset + border)
+ this.offset.parent.left +
+ ( ( this.cssPosition === "fixed" ?
+ -this.scrollParent.scrollLeft() :
+ scrollIsRootNode ? 0 : scroll.scrollLeft() ) )
+ )
+ };
+
+ },
+
+ _rearrange: function( event, i, a, hardRefresh ) {
+
+ a ? a[ 0 ].appendChild( this.placeholder[ 0 ] ) :
+ i.item[ 0 ].parentNode.insertBefore( this.placeholder[ 0 ],
+ ( this.direction === "down" ? i.item[ 0 ] : i.item[ 0 ].nextSibling ) );
+
+ //Various things done here to improve the performance:
+ // 1. we create a setTimeout, that calls refreshPositions
+ // 2. on the instance, we have a counter variable, that get's higher after every append
+ // 3. on the local scope, we copy the counter variable, and check in the timeout,
+ // if it's still the same
+ // 4. this lets only the last addition to the timeout stack through
+ this.counter = this.counter ? ++this.counter : 1;
+ var counter = this.counter;
+
+ this._delay( function() {
+ if ( counter === this.counter ) {
+
+ //Precompute after each DOM insertion, NOT on mousemove
+ this.refreshPositions( !hardRefresh );
+ }
+ } );
+
+ },
+
+ _clear: function( event, noPropagation ) {
+
+ this.reverting = false;
+
+ // We delay all events that have to be triggered to after the point where the placeholder
+ // has been removed and everything else normalized again
+ var i,
+ delayedTriggers = [];
+
+ // We first have to update the dom position of the actual currentItem
+ // Note: don't do it if the current item is already removed (by a user), or it gets
+ // reappended (see #4088)
+ if ( !this._noFinalSort && this.currentItem.parent().length ) {
+ this.placeholder.before( this.currentItem );
+ }
+ this._noFinalSort = null;
+
+ if ( this.helper[ 0 ] === this.currentItem[ 0 ] ) {
+ for ( i in this._storedCSS ) {
+ if ( this._storedCSS[ i ] === "auto" || this._storedCSS[ i ] === "static" ) {
+ this._storedCSS[ i ] = "";
+ }
+ }
+ this.currentItem.css( this._storedCSS );
+ this._removeClass( this.currentItem, "ui-sortable-helper" );
+ } else {
+ this.currentItem.show();
+ }
+
+ if ( this.fromOutside && !noPropagation ) {
+ delayedTriggers.push( function( event ) {
+ this._trigger( "receive", event, this._uiHash( this.fromOutside ) );
+ } );
+ }
+ if ( ( this.fromOutside ||
+ this.domPosition.prev !==
+ this.currentItem.prev().not( ".ui-sortable-helper" )[ 0 ] ||
+ this.domPosition.parent !== this.currentItem.parent()[ 0 ] ) && !noPropagation ) {
+
+ // Trigger update callback if the DOM position has changed
+ delayedTriggers.push( function( event ) {
+ this._trigger( "update", event, this._uiHash() );
+ } );
+ }
+
+ // Check if the items Container has Changed and trigger appropriate
+ // events.
+ if ( this !== this.currentContainer ) {
+ if ( !noPropagation ) {
+ delayedTriggers.push( function( event ) {
+ this._trigger( "remove", event, this._uiHash() );
+ } );
+ delayedTriggers.push( ( function( c ) {
+ return function( event ) {
+ c._trigger( "receive", event, this._uiHash( this ) );
+ };
+ } ).call( this, this.currentContainer ) );
+ delayedTriggers.push( ( function( c ) {
+ return function( event ) {
+ c._trigger( "update", event, this._uiHash( this ) );
+ };
+ } ).call( this, this.currentContainer ) );
+ }
+ }
+
+ //Post events to containers
+ function delayEvent( type, instance, container ) {
+ return function( event ) {
+ container._trigger( type, event, instance._uiHash( instance ) );
+ };
+ }
+ for ( i = this.containers.length - 1; i >= 0; i-- ) {
+ if ( !noPropagation ) {
+ delayedTriggers.push( delayEvent( "deactivate", this, this.containers[ i ] ) );
+ }
+ if ( this.containers[ i ].containerCache.over ) {
+ delayedTriggers.push( delayEvent( "out", this, this.containers[ i ] ) );
+ this.containers[ i ].containerCache.over = 0;
+ }
+ }
+
+ //Do what was originally in plugins
+ if ( this.storedCursor ) {
+ this.document.find( "body" ).css( "cursor", this.storedCursor );
+ this.storedStylesheet.remove();
+ }
+ if ( this._storedOpacity ) {
+ this.helper.css( "opacity", this._storedOpacity );
+ }
+ if ( this._storedZIndex ) {
+ this.helper.css( "zIndex", this._storedZIndex === "auto" ? "" : this._storedZIndex );
+ }
+
+ this.dragging = false;
+
+ if ( !noPropagation ) {
+ this._trigger( "beforeStop", event, this._uiHash() );
+ }
+
+ //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately,
+ // it unbinds ALL events from the original node!
+ this.placeholder[ 0 ].parentNode.removeChild( this.placeholder[ 0 ] );
+
+ if ( !this.cancelHelperRemoval ) {
+ if ( this.helper[ 0 ] !== this.currentItem[ 0 ] ) {
+ this.helper.remove();
+ }
+ this.helper = null;
+ }
+
+ if ( !noPropagation ) {
+ for ( i = 0; i < delayedTriggers.length; i++ ) {
+
+ // Trigger all delayed events
+ delayedTriggers[ i ].call( this, event );
+ }
+ this._trigger( "stop", event, this._uiHash() );
+ }
+
+ this.fromOutside = false;
+ return !this.cancelHelperRemoval;
+
+ },
+
+ _trigger: function() {
+ if ( $.Widget.prototype._trigger.apply( this, arguments ) === false ) {
+ this.cancel();
+ }
+ },
+
+ _uiHash: function( _inst ) {
+ var inst = _inst || this;
+ return {
+ helper: inst.helper,
+ placeholder: inst.placeholder || $( [] ),
+ position: inst.position,
+ originalPosition: inst.originalPosition,
+ offset: inst.positionAbs,
+ item: inst.currentItem,
+ sender: _inst ? _inst.element : null
+ };
+ }
+
+} );
+
+
+
+var safeActiveElement = $.ui.safeActiveElement = function( document ) {
+ var activeElement;
+
+ // Support: IE 9 only
+ // IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe>
+ try {
+ activeElement = document.activeElement;
+ } catch ( error ) {
+ activeElement = document.body;
+ }
+
+ // Support: IE 9 - 11 only
+ // IE may return null instead of an element
+ // Interestingly, this only seems to occur when NOT in an iframe
+ if ( !activeElement ) {
+ activeElement = document.body;
+ }
+
+ // Support: IE 11 only
+ // IE11 returns a seemingly empty object in some cases when accessing
+ // document.activeElement from an <iframe>
+ if ( !activeElement.nodeName ) {
+ activeElement = document.body;
+ }
+
+ return activeElement;
+};
+
+
+/*!
+ * jQuery UI Menu 1.12.1
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ */
+
+//>>label: Menu
+//>>group: Widgets
+//>>description: Creates nestable menus.
+//>>docs: http://api.jqueryui.com/menu/
+//>>demos: http://jqueryui.com/menu/
+//>>css.structure: ../../themes/base/core.css
+//>>css.structure: ../../themes/base/menu.css
+//>>css.theme: ../../themes/base/theme.css
+
+
+
+var widgetsMenu = $.widget( "ui.menu", {
+ version: "1.12.1",
+ defaultElement: "<ul>",
+ delay: 300,
+ options: {
+ icons: {
+ submenu: "ui-icon-caret-1-e"
+ },
+ items: "> *",
+ menus: "ul",
+ position: {
+ my: "left top",
+ at: "right top"
+ },
+ role: "menu",
+
+ // Callbacks
+ blur: null,
+ focus: null,
+ select: null
+ },
+
+ _create: function() {
+ this.activeMenu = this.element;
+
+ // Flag used to prevent firing of the click handler
+ // as the event bubbles up through nested menus
+ this.mouseHandled = false;
+ this.element
+ .uniqueId()
+ .attr( {
+ role: this.options.role,
+ tabIndex: 0
+ } );
+
+ this._addClass( "ui-menu", "ui-widget ui-widget-content" );
+ this._on( {
+
+ // Prevent focus from sticking to links inside menu after clicking
+ // them (focus should always stay on UL during navigation).
+ "mousedown .ui-menu-item": function( event ) {
+ event.preventDefault();
+ },
+ "click .ui-menu-item": function( event ) {
+ var target = $( event.target );
+ var active = $( $.ui.safeActiveElement( this.document[ 0 ] ) );
+ if ( !this.mouseHandled && target.not( ".ui-state-disabled" ).length ) {
+ this.select( event );
+
+ // Only set the mouseHandled flag if the event will bubble, see #9469.
+ if ( !event.isPropagationStopped() ) {
+ this.mouseHandled = true;
+ }
+
+ // Open submenu on click
+ if ( target.has( ".ui-menu" ).length ) {
+ this.expand( event );
+ } else if ( !this.element.is( ":focus" ) &&
+ active.closest( ".ui-menu" ).length ) {
+
+ // Redirect focus to the menu
+ this.element.trigger( "focus", [ true ] );
+
+ // If the active item is on the top level, let it stay active.
+ // Otherwise, blur the active item since it is no longer visible.
+ if ( this.active && this.active.parents( ".ui-menu" ).length === 1 ) {
+ clearTimeout( this.timer );
+ }
+ }
+ }
+ },
+ "mouseenter .ui-menu-item": function( event ) {
+
+ // Ignore mouse events while typeahead is active, see #10458.
+ // Prevents focusing the wrong item when typeahead causes a scroll while the mouse
+ // is over an item in the menu
+ if ( this.previousFilter ) {
+ return;
+ }
+
+ var actualTarget = $( event.target ).closest( ".ui-menu-item" ),
+ target = $( event.currentTarget );
+
+ // Ignore bubbled events on parent items, see #11641
+ if ( actualTarget[ 0 ] !== target[ 0 ] ) {
+ return;
+ }
+
+ // Remove ui-state-active class from siblings of the newly focused menu item
+ // to avoid a jump caused by adjacent elements both having a class with a border
+ this._removeClass( target.siblings().children( ".ui-state-active" ),
+ null, "ui-state-active" );
+ this.focus( event, target );
+ },
+ mouseleave: "collapseAll",
+ "mouseleave .ui-menu": "collapseAll",
+ focus: function( event, keepActiveItem ) {
+
+ // If there's already an active item, keep it active
+ // If not, activate the first item
+ var item = this.active || this.element.find( this.options.items ).eq( 0 );
+
+ if ( !keepActiveItem ) {
+ this.focus( event, item );
+ }
+ },
+ blur: function( event ) {
+ this._delay( function() {
+ var notContained = !$.contains(
+ this.element[ 0 ],
+ $.ui.safeActiveElement( this.document[ 0 ] )
+ );
+ if ( notContained ) {
+ this.collapseAll( event );
+ }
+ } );
+ },
+ keydown: "_keydown"
+ } );
+
+ this.refresh();
+
+ // Clicks outside of a menu collapse any open menus
+ this._on( this.document, {
+ click: function( event ) {
+ if ( this._closeOnDocumentClick( event ) ) {
+ this.collapseAll( event );
+ }
+
+ // Reset the mouseHandled flag
+ this.mouseHandled = false;
+ }
+ } );
+ },
+
+ _destroy: function() {
+ var items = this.element.find( ".ui-menu-item" )
+ .removeAttr( "role aria-disabled" ),
+ submenus = items.children( ".ui-menu-item-wrapper" )
+ .removeUniqueId()
+ .removeAttr( "tabIndex role aria-haspopup" );
+
+ // Destroy (sub)menus
+ this.element
+ .removeAttr( "aria-activedescendant" )
+ .find( ".ui-menu" ).addBack()
+ .removeAttr( "role aria-labelledby aria-expanded aria-hidden aria-disabled " +
+ "tabIndex" )
+ .removeUniqueId()
+ .show();
+
+ submenus.children().each( function() {
+ var elem = $( this );
+ if ( elem.data( "ui-menu-submenu-caret" ) ) {
+ elem.remove();
+ }
+ } );
+ },
+
+ _keydown: function( event ) {
+ var match, prev, character, skip,
+ preventDefault = true;
+
+ switch ( event.keyCode ) {
+ case $.ui.keyCode.PAGE_UP:
+ this.previousPage( event );
+ break;
+ case $.ui.keyCode.PAGE_DOWN:
+ this.nextPage( event );
+ break;
+ case $.ui.keyCode.HOME:
+ this._move( "first", "first", event );
+ break;
+ case $.ui.keyCode.END:
+ this._move( "last", "last", event );
+ break;
+ case $.ui.keyCode.UP:
+ this.previous( event );
+ break;
+ case $.ui.keyCode.DOWN:
+ this.next( event );
+ break;
+ case $.ui.keyCode.LEFT:
+ this.collapse( event );
+ break;
+ case $.ui.keyCode.RIGHT:
+ if ( this.active && !this.active.is( ".ui-state-disabled" ) ) {
+ this.expand( event );
+ }
+ break;
+ case $.ui.keyCode.ENTER:
+ case $.ui.keyCode.SPACE:
+ this._activate( event );
+ break;
+ case $.ui.keyCode.ESCAPE:
+ this.collapse( event );
+ break;
+ default:
+ preventDefault = false;
+ prev = this.previousFilter || "";
+ skip = false;
+
+ // Support number pad values
+ character = event.keyCode >= 96 && event.keyCode <= 105 ?
+ ( event.keyCode - 96 ).toString() : String.fromCharCode( event.keyCode );
+
+ clearTimeout( this.filterTimer );
+
+ if ( character === prev ) {
+ skip = true;
+ } else {
+ character = prev + character;
+ }
+
+ match = this._filterMenuItems( character );
+ match = skip && match.index( this.active.next() ) !== -1 ?
+ this.active.nextAll( ".ui-menu-item" ) :
+ match;
+
+ // If no matches on the current filter, reset to the last character pressed
+ // to move down the menu to the first item that starts with that character
+ if ( !match.length ) {
+ character = String.fromCharCode( event.keyCode );
+ match = this._filterMenuItems( character );
+ }
+
+ if ( match.length ) {
+ this.focus( event, match );
+ this.previousFilter = character;
+ this.filterTimer = this._delay( function() {
+ delete this.previousFilter;
+ }, 1000 );
+ } else {
+ delete this.previousFilter;
+ }
+ }
+
+ if ( preventDefault ) {
+ event.preventDefault();
+ }
+ },
+
+ _activate: function( event ) {
+ if ( this.active && !this.active.is( ".ui-state-disabled" ) ) {
+ if ( this.active.children( "[aria-haspopup='true']" ).length ) {
+ this.expand( event );
+ } else {
+ this.select( event );
+ }
+ }
+ },
+
+ refresh: function() {
+ var menus, items, newSubmenus, newItems, newWrappers,
+ that = this,
+ icon = this.options.icons.submenu,
+ submenus = this.element.find( this.options.menus );
+
+ this._toggleClass( "ui-menu-icons", null, !!this.element.find( ".ui-icon" ).length );
+
+ // Initialize nested menus
+ newSubmenus = submenus.filter( ":not(.ui-menu)" )
+ .hide()
+ .attr( {
+ role: this.options.role,
+ "aria-hidden": "true",
+ "aria-expanded": "false"
+ } )
+ .each( function() {
+ var menu = $( this ),
+ item = menu.prev(),
+ submenuCaret = $( "<span>" ).data( "ui-menu-submenu-caret", true );
+
+ that._addClass( submenuCaret, "ui-menu-icon", "ui-icon " + icon );
+ item
+ .attr( "aria-haspopup", "true" )
+ .prepend( submenuCaret );
+ menu.attr( "aria-labelledby", item.attr( "id" ) );
+ } );
+
+ this._addClass( newSubmenus, "ui-menu", "ui-widget ui-widget-content ui-front" );
+
+ menus = submenus.add( this.element );
+ items = menus.find( this.options.items );
+
+ // Initialize menu-items containing spaces and/or dashes only as dividers
+ items.not( ".ui-menu-item" ).each( function() {
+ var item = $( this );
+ if ( that._isDivider( item ) ) {
+ that._addClass( item, "ui-menu-divider", "ui-widget-content" );
+ }
+ } );
+
+ // Don't refresh list items that are already adapted
+ newItems = items.not( ".ui-menu-item, .ui-menu-divider" );
+ newWrappers = newItems.children()
+ .not( ".ui-menu" )
+ .uniqueId()
+ .attr( {
+ tabIndex: -1,
+ role: this._itemRole()
+ } );
+ this._addClass( newItems, "ui-menu-item" )
+ ._addClass( newWrappers, "ui-menu-item-wrapper" );
+
+ // Add aria-disabled attribute to any disabled menu item
+ items.filter( ".ui-state-disabled" ).attr( "aria-disabled", "true" );
+
+ // If the active item has been removed, blur the menu
+ if ( this.active && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
+ this.blur();
+ }
+ },
+
+ _itemRole: function() {
+ return {
+ menu: "menuitem",
+ listbox: "option"
+ }[ this.options.role ];
+ },
+
+ _setOption: function( key, value ) {
+ if ( key === "icons" ) {
+ var icons = this.element.find( ".ui-menu-icon" );
+ this._removeClass( icons, null, this.options.icons.submenu )
+ ._addClass( icons, null, value.submenu );
+ }
+ this._super( key, value );
+ },
+
+ _setOptionDisabled: function( value ) {
+ this._super( value );
+
+ this.element.attr( "aria-disabled", String( value ) );
+ this._toggleClass( null, "ui-state-disabled", !!value );
+ },
+
+ focus: function( event, item ) {
+ var nested, focused, activeParent;
+ this.blur( event, event && event.type === "focus" );
+
+ this._scrollIntoView( item );
+
+ this.active = item.first();
+
+ focused = this.active.children( ".ui-menu-item-wrapper" );
+ this._addClass( focused, null, "ui-state-active" );
+
+ // Only update aria-activedescendant if there's a role
+ // otherwise we assume focus is managed elsewhere
+ if ( this.options.role ) {
+ this.element.attr( "aria-activedescendant", focused.attr( "id" ) );
+ }
+
+ // Highlight active parent menu item, if any
+ activeParent = this.active
+ .parent()
+ .closest( ".ui-menu-item" )
+ .children( ".ui-menu-item-wrapper" );
+ this._addClass( activeParent, null, "ui-state-active" );
+
+ if ( event && event.type === "keydown" ) {
+ this._close();
+ } else {
+ this.timer = this._delay( function() {
+ this._close();
+ }, this.delay );
+ }
+
+ nested = item.children( ".ui-menu" );
+ if ( nested.length && event && ( /^mouse/.test( event.type ) ) ) {
+ this._startOpening( nested );
+ }
+ this.activeMenu = item.parent();
+
+ this._trigger( "focus", event, { item: item } );
+ },
+
+ _scrollIntoView: function( item ) {
+ var borderTop, paddingTop, offset, scroll, elementHeight, itemHeight;
+ if ( this._hasScroll() ) {
+ borderTop = parseFloat( $.css( this.activeMenu[ 0 ], "borderTopWidth" ) ) || 0;
+ paddingTop = parseFloat( $.css( this.activeMenu[ 0 ], "paddingTop" ) ) || 0;
+ offset = item.offset().top - this.activeMenu.offset().top - borderTop - paddingTop;
+ scroll = this.activeMenu.scrollTop();
+ elementHeight = this.activeMenu.height();
+ itemHeight = item.outerHeight();
+
+ if ( offset < 0 ) {
+ this.activeMenu.scrollTop( scroll + offset );
+ } else if ( offset + itemHeight > elementHeight ) {
+ this.activeMenu.scrollTop( scroll + offset - elementHeight + itemHeight );
+ }
+ }
+ },
+
+ blur: function( event, fromFocus ) {
+ if ( !fromFocus ) {
+ clearTimeout( this.timer );
+ }
+
+ if ( !this.active ) {
+ return;
+ }
+
+ this._removeClass( this.active.children( ".ui-menu-item-wrapper" ),
+ null, "ui-state-active" );
+
+ this._trigger( "blur", event, { item: this.active } );
+ this.active = null;
+ },
+
+ _startOpening: function( submenu ) {
+ clearTimeout( this.timer );
+
+ // Don't open if already open fixes a Firefox bug that caused a .5 pixel
+ // shift in the submenu position when mousing over the caret icon
+ if ( submenu.attr( "aria-hidden" ) !== "true" ) {
+ return;
+ }
+
+ this.timer = this._delay( function() {
+ this._close();
+ this._open( submenu );
+ }, this.delay );
+ },
+
+ _open: function( submenu ) {
+ var position = $.extend( {
+ of: this.active
+ }, this.options.position );
+
+ clearTimeout( this.timer );
+ this.element.find( ".ui-menu" ).not( submenu.parents( ".ui-menu" ) )
+ .hide()
+ .attr( "aria-hidden", "true" );
+
+ submenu
+ .show()
+ .removeAttr( "aria-hidden" )
+ .attr( "aria-expanded", "true" )
+ .position( position );
+ },
+
+ collapseAll: function( event, all ) {
+ clearTimeout( this.timer );
+ this.timer = this._delay( function() {
+
+ // If we were passed an event, look for the submenu that contains the event
+ var currentMenu = all ? this.element :
+ $( event && event.target ).closest( this.element.find( ".ui-menu" ) );
+
+ // If we found no valid submenu ancestor, use the main menu to close all
+ // sub menus anyway
+ if ( !currentMenu.length ) {
+ currentMenu = this.element;
+ }
+
+ this._close( currentMenu );
+
+ this.blur( event );
+
+ // Work around active item staying active after menu is blurred
+ this._removeClass( currentMenu.find( ".ui-state-active" ), null, "ui-state-active" );
+
+ this.activeMenu = currentMenu;
+ }, this.delay );
+ },
+
+ // With no arguments, closes the currently active menu - if nothing is active
+ // it closes all menus. If passed an argument, it will search for menus BELOW
+ _close: function( startMenu ) {
+ if ( !startMenu ) {
+ startMenu = this.active ? this.active.parent() : this.element;
+ }
+
+ startMenu.find( ".ui-menu" )
+ .hide()
+ .attr( "aria-hidden", "true" )
+ .attr( "aria-expanded", "false" );
+ },
+
+ _closeOnDocumentClick: function( event ) {
+ return !$( event.target ).closest( ".ui-menu" ).length;
+ },
+
+ _isDivider: function( item ) {
+
+ // Match hyphen, em dash, en dash
+ return !/[^\-\u2014\u2013\s]/.test( item.text() );
+ },
+
+ collapse: function( event ) {
+ var newItem = this.active &&
+ this.active.parent().closest( ".ui-menu-item", this.element );
+ if ( newItem && newItem.length ) {
+ this._close();
+ this.focus( event, newItem );
+ }
+ },
+
+ expand: function( event ) {
+ var newItem = this.active &&
+ this.active
+ .children( ".ui-menu " )
+ .find( this.options.items )
+ .first();
+
+ if ( newItem && newItem.length ) {
+ this._open( newItem.parent() );
+
+ // Delay so Firefox will not hide activedescendant change in expanding submenu from AT
+ this._delay( function() {
+ this.focus( event, newItem );
+ } );
+ }
+ },
+
+ next: function( event ) {
+ this._move( "next", "first", event );
+ },
+
+ previous: function( event ) {
+ this._move( "prev", "last", event );
+ },
+
+ isFirstItem: function() {
+ return this.active && !this.active.prevAll( ".ui-menu-item" ).length;
+ },
+
+ isLastItem: function() {
+ return this.active && !this.active.nextAll( ".ui-menu-item" ).length;
+ },
+
+ _move: function( direction, filter, event ) {
+ var next;
+ if ( this.active ) {
+ if ( direction === "first" || direction === "last" ) {
+ next = this.active
+ [ direction === "first" ? "prevAll" : "nextAll" ]( ".ui-menu-item" )
+ .eq( -1 );
+ } else {
+ next = this.active
+ [ direction + "All" ]( ".ui-menu-item" )
+ .eq( 0 );
+ }
+ }
+ if ( !next || !next.length || !this.active ) {
+ next = this.activeMenu.find( this.options.items )[ filter ]();
+ }
+
+ this.focus( event, next );
+ },
+
+ nextPage: function( event ) {
+ var item, base, height;
+
+ if ( !this.active ) {
+ this.next( event );
+ return;
+ }
+ if ( this.isLastItem() ) {
+ return;
+ }
+ if ( this._hasScroll() ) {
+ base = this.active.offset().top;
+ height = this.element.height();
+ this.active.nextAll( ".ui-menu-item" ).each( function() {
+ item = $( this );
+ return item.offset().top - base - height < 0;
+ } );
+
+ this.focus( event, item );
+ } else {
+ this.focus( event, this.activeMenu.find( this.options.items )
+ [ !this.active ? "first" : "last" ]() );
+ }
+ },
+
+ previousPage: function( event ) {
+ var item, base, height;
+ if ( !this.active ) {
+ this.next( event );
+ return;
+ }
+ if ( this.isFirstItem() ) {
+ return;
+ }
+ if ( this._hasScroll() ) {
+ base = this.active.offset().top;
+ height = this.element.height();
+ this.active.prevAll( ".ui-menu-item" ).each( function() {
+ item = $( this );
+ return item.offset().top - base + height > 0;
+ } );
+
+ this.focus( event, item );
+ } else {
+ this.focus( event, this.activeMenu.find( this.options.items ).first() );
+ }
+ },
+
+ _hasScroll: function() {
+ return this.element.outerHeight() < this.element.prop( "scrollHeight" );
+ },
+
+ select: function( event ) {
+
+ // TODO: It should never be possible to not have an active item at this
+ // point, but the tests don't trigger mouseenter before click.
+ this.active = this.active || $( event.target ).closest( ".ui-menu-item" );
+ var ui = { item: this.active };
+ if ( !this.active.has( ".ui-menu" ).length ) {
+ this.collapseAll( event, true );
+ }
+ this._trigger( "select", event, ui );
+ },
+
+ _filterMenuItems: function( character ) {
+ var escapedCharacter = character.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" ),
+ regex = new RegExp( "^" + escapedCharacter, "i" );
+
+ return this.activeMenu
+ .find( this.options.items )
+
+ // Only match on items, not dividers or other content (#10571)
+ .filter( ".ui-menu-item" )
+ .filter( function() {
+ return regex.test(
+ $.trim( $( this ).children( ".ui-menu-item-wrapper" ).text() ) );
+ } );
+ }
+} );
+
+
+/*!
+ * jQuery UI Autocomplete 1.12.1
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ */
+
+//>>label: Autocomplete
+//>>group: Widgets
+//>>description: Lists suggested words as the user is typing.
+//>>docs: http://api.jqueryui.com/autocomplete/
+//>>demos: http://jqueryui.com/autocomplete/
+//>>css.structure: ../../themes/base/core.css
+//>>css.structure: ../../themes/base/autocomplete.css
+//>>css.theme: ../../themes/base/theme.css
+
+
+
+$.widget( "ui.autocomplete", {
+ version: "1.12.1",
+ defaultElement: "<input>",
+ options: {
+ appendTo: null,
+ autoFocus: false,
+ delay: 300,
+ minLength: 1,
+ position: {
+ my: "left top",
+ at: "left bottom",
+ collision: "none"
+ },
+ source: null,
+
+ // Callbacks
+ change: null,
+ close: null,
+ focus: null,
+ open: null,
+ response: null,
+ search: null,
+ select: null
+ },
+
+ requestIndex: 0,
+ pending: 0,
+
+ _create: function() {
+
+ // Some browsers only repeat keydown events, not keypress events,
+ // so we use the suppressKeyPress flag to determine if we've already
+ // handled the keydown event. #7269
+ // Unfortunately the code for & in keypress is the same as the up arrow,
+ // so we use the suppressKeyPressRepeat flag to avoid handling keypress
+ // events when we know the keydown event was used to modify the
+ // search term. #7799
+ var suppressKeyPress, suppressKeyPressRepeat, suppressInput,
+ nodeName = this.element[ 0 ].nodeName.toLowerCase(),
+ isTextarea = nodeName === "textarea",
+ isInput = nodeName === "input";
+
+ // Textareas are always multi-line
+ // Inputs are always single-line, even if inside a contentEditable element
+ // IE also treats inputs as contentEditable
+ // All other element types are determined by whether or not they're contentEditable
+ this.isMultiLine = isTextarea || !isInput && this._isContentEditable( this.element );
+
+ this.valueMethod = this.element[ isTextarea || isInput ? "val" : "text" ];
+ this.isNewMenu = true;
+
+ this._addClass( "ui-autocomplete-input" );
+ this.element.attr( "autocomplete", "off" );
+
+ this._on( this.element, {
+ keydown: function( event ) {
+ if ( this.element.prop( "readOnly" ) ) {
+ suppressKeyPress = true;
+ suppressInput = true;
+ suppressKeyPressRepeat = true;
+ return;
+ }
+
+ suppressKeyPress = false;
+ suppressInput = false;
+ suppressKeyPressRepeat = false;
+ var keyCode = $.ui.keyCode;
+ switch ( event.keyCode ) {
+ case keyCode.PAGE_UP:
+ suppressKeyPress = true;
+ this._move( "previousPage", event );
+ break;
+ case keyCode.PAGE_DOWN:
+ suppressKeyPress = true;
+ this._move( "nextPage", event );
+ break;
+ case keyCode.UP:
+ suppressKeyPress = true;
+ this._keyEvent( "previous", event );
+ break;
+ case keyCode.DOWN:
+ suppressKeyPress = true;
+ this._keyEvent( "next", event );
+ break;
+ case keyCode.ENTER:
+
+ // when menu is open and has focus
+ if ( this.menu.active ) {
+
+ // #6055 - Opera still allows the keypress to occur
+ // which causes forms to submit
+ suppressKeyPress = true;
+ event.preventDefault();
+ this.menu.select( event );
+ }
+ break;
+ case keyCode.TAB:
+ if ( this.menu.active ) {
+ this.menu.select( event );
+ }
+ break;
+ case keyCode.ESCAPE:
+ if ( this.menu.element.is( ":visible" ) ) {
+ if ( !this.isMultiLine ) {
+ this._value( this.term );
+ }
+ this.close( event );
+
+ // Different browsers have different default behavior for escape
+ // Single press can mean undo or clear
+ // Double press in IE means clear the whole form
+ event.preventDefault();
+ }
+ break;
+ default:
+ suppressKeyPressRepeat = true;
+
+ // search timeout should be triggered before the input value is changed
+ this._searchTimeout( event );
+ break;
+ }
+ },
+ keypress: function( event ) {
+ if ( suppressKeyPress ) {
+ suppressKeyPress = false;
+ if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
+ event.preventDefault();
+ }
+ return;
+ }
+ if ( suppressKeyPressRepeat ) {
+ return;
+ }
+
+ // Replicate some key handlers to allow them to repeat in Firefox and Opera
+ var keyCode = $.ui.keyCode;
+ switch ( event.keyCode ) {
+ case keyCode.PAGE_UP:
+ this._move( "previousPage", event );
+ break;
+ case keyCode.PAGE_DOWN:
+ this._move( "nextPage", event );
+ break;
+ case keyCode.UP:
+ this._keyEvent( "previous", event );
+ break;
+ case keyCode.DOWN:
+ this._keyEvent( "next", event );
+ break;
+ }
+ },
+ input: function( event ) {
+ if ( suppressInput ) {
+ suppressInput = false;
+ event.preventDefault();
+ return;
+ }
+ this._searchTimeout( event );
+ },
+ focus: function() {
+ this.selectedItem = null;
+ this.previous = this._value();
+ },
+ blur: function( event ) {
+ if ( this.cancelBlur ) {
+ delete this.cancelBlur;
+ return;
+ }
+
+ clearTimeout( this.searching );
+ this.close( event );
+ this._change( event );
+ }
+ } );
+
+ this._initSource();
+ this.menu = $( "<ul>" )
+ .appendTo( this._appendTo() )
+ .menu( {
+
+ // disable ARIA support, the live region takes care of that
+ role: null
+ } )
+ .hide()
+ .menu( "instance" );
+
+ this._addClass( this.menu.element, "ui-autocomplete", "ui-front" );
+ this._on( this.menu.element, {
+ mousedown: function( event ) {
+
+ // prevent moving focus out of the text field
+ event.preventDefault();
+
+ // IE doesn't prevent moving focus even with event.preventDefault()
+ // so we set a flag to know when we should ignore the blur event
+ this.cancelBlur = true;
+ this._delay( function() {
+ delete this.cancelBlur;
+
+ // Support: IE 8 only
+ // Right clicking a menu item or selecting text from the menu items will
+ // result in focus moving out of the input. However, we've already received
+ // and ignored the blur event because of the cancelBlur flag set above. So
+ // we restore focus to ensure that the menu closes properly based on the user's
+ // next actions.
+ if ( this.element[ 0 ] !== $.ui.safeActiveElement( this.document[ 0 ] ) ) {
+ this.element.trigger( "focus" );
+ }
+ } );
+ },
+ menufocus: function( event, ui ) {
+ var label, item;
+
+ // support: Firefox
+ // Prevent accidental activation of menu items in Firefox (#7024 #9118)
+ if ( this.isNewMenu ) {
+ this.isNewMenu = false;
+ if ( event.originalEvent && /^mouse/.test( event.originalEvent.type ) ) {
+ this.menu.blur();
+
+ this.document.one( "mousemove", function() {
+ $( event.target ).trigger( event.originalEvent );
+ } );
+
+ return;
+ }
+ }
+
+ item = ui.item.data( "ui-autocomplete-item" );
+ if ( false !== this._trigger( "focus", event, { item: item } ) ) {
+
+ // use value to match what will end up in the input, if it was a key event
+ if ( event.originalEvent && /^key/.test( event.originalEvent.type ) ) {
+ this._value( item.value );
+ }
+ }
+
+ // Announce the value in the liveRegion
+ label = ui.item.attr( "aria-label" ) || item.value;
+ if ( label && $.trim( label ).length ) {
+ this.liveRegion.children().hide();
+ $( "<div>" ).text( label ).appendTo( this.liveRegion );
+ }
+ },
+ menuselect: function( event, ui ) {
+ var item = ui.item.data( "ui-autocomplete-item" ),
+ previous = this.previous;
+
+ // Only trigger when focus was lost (click on menu)
+ if ( this.element[ 0 ] !== $.ui.safeActiveElement( this.document[ 0 ] ) ) {
+ this.element.trigger( "focus" );
+ this.previous = previous;
+
+ // #6109 - IE triggers two focus events and the second
+ // is asynchronous, so we need to reset the previous
+ // term synchronously and asynchronously :-(
+ this._delay( function() {
+ this.previous = previous;
+ this.selectedItem = item;
+ } );
+ }
+
+ if ( false !== this._trigger( "select", event, { item: item } ) ) {
+ this._value( item.value );
+ }
+
+ // reset the term after the select event
+ // this allows custom select handling to work properly
+ this.term = this._value();
+
+ this.close( event );
+ this.selectedItem = item;
+ }
+ } );
+
+ this.liveRegion = $( "<div>", {
+ role: "status",
+ "aria-live": "assertive",
+ "aria-relevant": "additions"
+ } )
+ .appendTo( this.document[ 0 ].body );
+
+ this._addClass( this.liveRegion, null, "ui-helper-hidden-accessible" );
+
+ // Turning off autocomplete prevents the browser from remembering the
+ // value when navigating through history, so we re-enable autocomplete
+ // if the page is unloaded before the widget is destroyed. #7790
+ this._on( this.window, {
+ beforeunload: function() {
+ this.element.removeAttr( "autocomplete" );
+ }
+ } );
+ },
+
+ _destroy: function() {
+ clearTimeout( this.searching );
+ this.element.removeAttr( "autocomplete" );
+ this.menu.element.remove();
+ this.liveRegion.remove();
+ },
+
+ _setOption: function( key, value ) {
+ this._super( key, value );
+ if ( key === "source" ) {
+ this._initSource();
+ }
+ if ( key === "appendTo" ) {
+ this.menu.element.appendTo( this._appendTo() );
+ }
+ if ( key === "disabled" && value && this.xhr ) {
+ this.xhr.abort();
+ }
+ },
+
+ _isEventTargetInWidget: function( event ) {
+ var menuElement = this.menu.element[ 0 ];
+
+ return event.target === this.element[ 0 ] ||
+ event.target === menuElement ||
+ $.contains( menuElement, event.target );
+ },
+
+ _closeOnClickOutside: function( event ) {
+ if ( !this._isEventTargetInWidget( event ) ) {
+ this.close();
+ }
+ },
+
+ _appendTo: function() {
+ var element = this.options.appendTo;
+
+ if ( element ) {
+ element = element.jquery || element.nodeType ?
+ $( element ) :
+ this.document.find( element ).eq( 0 );
+ }
+
+ if ( !element || !element[ 0 ] ) {
+ element = this.element.closest( ".ui-front, dialog" );
+ }
+
+ if ( !element.length ) {
+ element = this.document[ 0 ].body;
+ }
+
+ return element;
+ },
+
+ _initSource: function() {
+ var array, url,
+ that = this;
+ if ( $.isArray( this.options.source ) ) {
+ array = this.options.source;
+ this.source = function( request, response ) {
+ response( $.ui.autocomplete.filter( array, request.term ) );
+ };
+ } else if ( typeof this.options.source === "string" ) {
+ url = this.options.source;
+ this.source = function( request, response ) {
+ if ( that.xhr ) {
+ that.xhr.abort();
+ }
+ that.xhr = $.ajax( {
+ url: url,
+ data: request,
+ dataType: "json",
+ success: function( data ) {
+ response( data );
+ },
+ error: function() {
+ response( [] );
+ }
+ } );
+ };
+ } else {
+ this.source = this.options.source;
+ }
+ },
+
+ _searchTimeout: function( event ) {
+ clearTimeout( this.searching );
+ this.searching = this._delay( function() {
+
+ // Search if the value has changed, or if the user retypes the same value (see #7434)
+ var equalValues = this.term === this._value(),
+ menuVisible = this.menu.element.is( ":visible" ),
+ modifierKey = event.altKey || event.ctrlKey || event.metaKey || event.shiftKey;
+
+ if ( !equalValues || ( equalValues && !menuVisible && !modifierKey ) ) {
+ this.selectedItem = null;
+ this.search( null, event );
+ }
+ }, this.options.delay );
+ },
+
+ search: function( value, event ) {
+ value = value != null ? value : this._value();
+
+ // Always save the actual value, not the one passed as an argument
+ this.term = this._value();
+
+ if ( value.length < this.options.minLength ) {
+ return this.close( event );
+ }
+
+ if ( this._trigger( "search", event ) === false ) {
+ return;
+ }
+
+ return this._search( value );
+ },
+
+ _search: function( value ) {
+ this.pending++;
+ this._addClass( "ui-autocomplete-loading" );
+ this.cancelSearch = false;
+
+ this.source( { term: value }, this._response() );
+ },
+
+ _response: function() {
+ var index = ++this.requestIndex;
+
+ return $.proxy( function( content ) {
+ if ( index === this.requestIndex ) {
+ this.__response( content );
+ }
+
+ this.pending--;
+ if ( !this.pending ) {
+ this._removeClass( "ui-autocomplete-loading" );
+ }
+ }, this );
+ },
+
+ __response: function( content ) {
+ if ( content ) {
+ content = this._normalize( content );
+ }
+ this._trigger( "response", null, { content: content } );
+ if ( !this.options.disabled && content && content.length && !this.cancelSearch ) {
+ this._suggest( content );
+ this._trigger( "open" );
+ } else {
+
+ // use ._close() instead of .close() so we don't cancel future searches
+ this._close();
+ }
+ },
+
+ close: function( event ) {
+ this.cancelSearch = true;
+ this._close( event );
+ },
+
+ _close: function( event ) {
+
+ // Remove the handler that closes the menu on outside clicks
+ this._off( this.document, "mousedown" );
+
+ if ( this.menu.element.is( ":visible" ) ) {
+ this.menu.element.hide();
+ this.menu.blur();
+ this.isNewMenu = true;
+ this._trigger( "close", event );
+ }
+ },
+
+ _change: function( event ) {
+ if ( this.previous !== this._value() ) {
+ this._trigger( "change", event, { item: this.selectedItem } );
+ }
+ },
+
+ _normalize: function( items ) {
+
+ // assume all items have the right format when the first item is complete
+ if ( items.length && items[ 0 ].label && items[ 0 ].value ) {
+ return items;
+ }
+ return $.map( items, function( item ) {
+ if ( typeof item === "string" ) {
+ return {
+ label: item,
+ value: item
+ };
+ }
+ return $.extend( {}, item, {
+ label: item.label || item.value,
+ value: item.value || item.label
+ } );
+ } );
+ },
+
+ _suggest: function( items ) {
+ var ul = this.menu.element.empty();
+ this._renderMenu( ul, items );
+ this.isNewMenu = true;
+ this.menu.refresh();
+
+ // Size and position menu
+ ul.show();
+ this._resizeMenu();
+ ul.position( $.extend( {
+ of: this.element
+ }, this.options.position ) );
+
+ if ( this.options.autoFocus ) {
+ this.menu.next();
+ }
+
+ // Listen for interactions outside of the widget (#6642)
+ this._on( this.document, {
+ mousedown: "_closeOnClickOutside"
+ } );
+ },
+
+ _resizeMenu: function() {
+ var ul = this.menu.element;
+ ul.outerWidth( Math.max(
+
+ // Firefox wraps long text (possibly a rounding bug)
+ // so we add 1px to avoid the wrapping (#7513)
+ ul.width( "" ).outerWidth() + 1,
+ this.element.outerWidth()
+ ) );
+ },
+
+ _renderMenu: function( ul, items ) {
+ var that = this;
+ $.each( items, function( index, item ) {
+ that._renderItemData( ul, item );
+ } );
+ },
+
+ _renderItemData: function( ul, item ) {
+ return this._renderItem( ul, item ).data( "ui-autocomplete-item", item );
+ },
+
+ _renderItem: function( ul, item ) {
+ return $( "<li>" )
+ .append( $( "<div>" ).text( item.label ) )
+ .appendTo( ul );
+ },
+
+ _move: function( direction, event ) {
+ if ( !this.menu.element.is( ":visible" ) ) {
+ this.search( null, event );
+ return;
+ }
+ if ( this.menu.isFirstItem() && /^previous/.test( direction ) ||
+ this.menu.isLastItem() && /^next/.test( direction ) ) {
+
+ if ( !this.isMultiLine ) {
+ this._value( this.term );
+ }
+
+ this.menu.blur();
+ return;
+ }
+ this.menu[ direction ]( event );
+ },
+
+ widget: function() {
+ return this.menu.element;
+ },
+
+ _value: function() {
+ return this.valueMethod.apply( this.element, arguments );
+ },
+
+ _keyEvent: function( keyEvent, event ) {
+ if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
+ this._move( keyEvent, event );
+
+ // Prevents moving cursor to beginning/end of the text field in some browsers
+ event.preventDefault();
+ }
+ },
+
+ // Support: Chrome <=50
+ // We should be able to just use this.element.prop( "isContentEditable" )
+ // but hidden elements always report false in Chrome.
+ // https://code.google.com/p/chromium/issues/detail?id=313082
+ _isContentEditable: function( element ) {
+ if ( !element.length ) {
+ return false;
+ }
+
+ var editable = element.prop( "contentEditable" );
+
+ if ( editable === "inherit" ) {
+ return this._isContentEditable( element.parent() );
+ }
+
+ return editable === "true";
+ }
+} );
+
+$.extend( $.ui.autocomplete, {
+ escapeRegex: function( value ) {
+ return value.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" );
+ },
+ filter: function( array, term ) {
+ var matcher = new RegExp( $.ui.autocomplete.escapeRegex( term ), "i" );
+ return $.grep( array, function( value ) {
+ return matcher.test( value.label || value.value || value );
+ } );
+ }
+} );
+
+// Live region extension, adding a `messages` option
+// NOTE: This is an experimental API. We are still investigating
+// a full solution for string manipulation and internationalization.
+$.widget( "ui.autocomplete", $.ui.autocomplete, {
+ options: {
+ messages: {
+ noResults: "No search results.",
+ results: function( amount ) {
+ return amount + ( amount > 1 ? " results are" : " result is" ) +
+ " available, use up and down arrow keys to navigate.";
+ }
+ }
+ },
+
+ __response: function( content ) {
+ var message;
+ this._superApply( arguments );
+ if ( this.options.disabled || this.cancelSearch ) {
+ return;
+ }
+ if ( content && content.length ) {
+ message = this.options.messages.results( content.length );
+ } else {
+ message = this.options.messages.noResults;
+ }
+ this.liveRegion.children().hide();
+ $( "<div>" ).text( message ).appendTo( this.liveRegion );
+ }
+} );
+
+var widgetsAutocomplete = $.ui.autocomplete;
+
+
+
+
+})); \ No newline at end of file
diff --git a/public_html/data/js/vendor/jquery-ui.min.js b/public_html/data/js/vendor/jquery-ui.min.js
new file mode 100644
index 000000000..9d0ab21eb
--- /dev/null
+++ b/public_html/data/js/vendor/jquery-ui.min.js
@@ -0,0 +1,7 @@
+/*! jQuery UI - v1.12.1 - 2016-09-19
+* http://jqueryui.com
+* Includes: widget.js, position.js, data.js, disable-selection.js, focusable.js, form-reset-mixin.js, jquery-1-7.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/sortable.js, widgets/autocomplete.js, widgets/menu.js, widgets/mouse.js
+* Copyright jQuery Foundation and other contributors; Licensed MIT */
+
+(function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)})(function(t){function e(t){for(var e=t.css("visibility");"inherit"===e;)t=t.parent(),e=t.css("visibility");return"hidden"!==e}t.ui=t.ui||{},t.ui.version="1.12.1";var i=0,s=Array.prototype.slice;t.cleanData=function(e){return function(i){var s,n,o;for(o=0;null!=(n=i[o]);o++)try{s=t._data(n,"events"),s&&s.remove&&t(n).triggerHandler("remove")}catch(a){}e(i)}}(t.cleanData),t.widget=function(e,i,s){var n,o,a,r={},l=e.split(".")[0];e=e.split(".")[1];var h=l+"-"+e;return s||(s=i,i=t.Widget),t.isArray(s)&&(s=t.extend.apply(null,[{}].concat(s))),t.expr[":"][h.toLowerCase()]=function(e){return!!t.data(e,h)},t[l]=t[l]||{},n=t[l][e],o=t[l][e]=function(t,e){return this._createWidget?(arguments.length&&this._createWidget(t,e),void 0):new o(t,e)},t.extend(o,n,{version:s.version,_proto:t.extend({},s),_childConstructors:[]}),a=new i,a.options=t.widget.extend({},a.options),t.each(s,function(e,s){return t.isFunction(s)?(r[e]=function(){function t(){return i.prototype[e].apply(this,arguments)}function n(t){return i.prototype[e].apply(this,t)}return function(){var e,i=this._super,o=this._superApply;return this._super=t,this._superApply=n,e=s.apply(this,arguments),this._super=i,this._superApply=o,e}}(),void 0):(r[e]=s,void 0)}),o.prototype=t.widget.extend(a,{widgetEventPrefix:n?a.widgetEventPrefix||e:e},r,{constructor:o,namespace:l,widgetName:e,widgetFullName:h}),n?(t.each(n._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete n._childConstructors):i._childConstructors.push(o),t.widget.bridge(e,o),o},t.widget.extend=function(e){for(var i,n,o=s.call(arguments,1),a=0,r=o.length;r>a;a++)for(i in o[a])n=o[a][i],o[a].hasOwnProperty(i)&&void 0!==n&&(e[i]=t.isPlainObject(n)?t.isPlainObject(e[i])?t.widget.extend({},e[i],n):t.widget.extend({},n):n);return e},t.widget.bridge=function(e,i){var n=i.prototype.widgetFullName||e;t.fn[e]=function(o){var a="string"==typeof o,r=s.call(arguments,1),l=this;return a?this.length||"instance"!==o?this.each(function(){var i,s=t.data(this,n);return"instance"===o?(l=s,!1):s?t.isFunction(s[o])&&"_"!==o.charAt(0)?(i=s[o].apply(s,r),i!==s&&void 0!==i?(l=i&&i.jquery?l.pushStack(i.get()):i,!1):void 0):t.error("no such method '"+o+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; "+"attempted to call method '"+o+"'")}):l=void 0:(r.length&&(o=t.widget.extend.apply(null,[o].concat(r))),this.each(function(){var e=t.data(this,n);e?(e.option(o||{}),e._init&&e._init()):t.data(this,n,new i(o,this))})),l}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(e,s){s=t(s||this.defaultElement||this)[0],this.element=t(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),this.classesElementLookup={},s!==this&&(t.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===s&&this.destroy()}}),this.document=t(s.style?s.ownerDocument:s.document||s),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var e=this;this._destroy(),t.each(this.classesElementLookup,function(t,i){e._removeClass(i,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.element},option:function(e,i){var s,n,o,a=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(a={},s=e.split("."),e=s.shift(),s.length){for(n=a[e]=t.widget.extend({},this.options[e]),o=0;s.length-1>o;o++)n[s[o]]=n[s[o]]||{},n=n[s[o]];if(e=s.pop(),1===arguments.length)return void 0===n[e]?null:n[e];n[e]=i}else{if(1===arguments.length)return void 0===this.options[e]?null:this.options[e];a[e]=i}return this._setOptions(a),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(e){var i,s,n;for(i in e)n=this.classesElementLookup[i],e[i]!==this.options.classes[i]&&n&&n.length&&(s=t(n.get()),this._removeClass(n,i),s.addClass(this._classes({element:s,keys:i,classes:e,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(e){function i(i,o){var a,r;for(r=0;i.length>r;r++)a=n.classesElementLookup[i[r]]||t(),a=e.add?t(t.unique(a.get().concat(e.element.get()))):t(a.not(e.element).get()),n.classesElementLookup[i[r]]=a,s.push(i[r]),o&&e.classes[i[r]]&&s.push(e.classes[i[r]])}var s=[],n=this;return e=t.extend({element:this.element,classes:this.options.classes||{}},e),this._on(e.element,{remove:"_untrackClassesElement"}),e.keys&&i(e.keys.match(/\S+/g)||[],!0),e.extra&&i(e.extra.match(/\S+/g)||[]),s.join(" ")},_untrackClassesElement:function(e){var i=this;t.each(i.classesElementLookup,function(s,n){-1!==t.inArray(e.target,n)&&(i.classesElementLookup[s]=t(n.not(e.target).get()))})},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){s="boolean"==typeof s?s:i;var n="string"==typeof t||null===t,o={extra:n?e:i,keys:n?t:e,element:n?this.element:t,add:s};return o.element.toggleClass(this._classes(o),s),this},_on:function(e,i,s){var n,o=this;"boolean"!=typeof e&&(s=i,i=e,e=!1),s?(i=n=t(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),t.each(s,function(s,a){function r(){return e||o.options.disabled!==!0&&!t(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||t.guid++);var l=s.match(/^([\w:-]*)\s*(.*)$/),h=l[1]+o.eventNamespace,c=l[2];c?n.on(h,c,r):i.on(h,r)})},_off:function(e,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.off(i).off(i),this.bindings=t(this.bindings.not(e).get()),this.focusable=t(this.focusable.not(e).get()),this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){function i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){this._addClass(t(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){this._addClass(t(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,i,s){var n,o,a=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).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),!(t.isFunction(a)&&a.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var a,r=n?n===!0||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}}),t.widget,function(){function e(t,e,i){return[parseFloat(t[0])*(u.test(t[0])?e/100:1),parseFloat(t[1])*(u.test(t[1])?i/100:1)]}function i(e,i){return parseInt(t.css(e,i),10)||0}function s(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}var n,o=Math.max,a=Math.abs,r=/left|center|right/,l=/top|center|bottom/,h=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,u=/%$/,d=t.fn.position;t.position={scrollbarWidth:function(){if(void 0!==n)return n;var e,i,s=t("<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 t("body").append(s),e=o.offsetWidth,s.css("overflow","scroll"),i=o.offsetWidth,e===i&&(i=s[0].clientWidth),s.remove(),n=e-i},getScrollInfo:function(e){var i=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),s=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.width<e.element[0].scrollWidth,o="scroll"===s||"auto"===s&&e.height<e.element[0].scrollHeight;return{width:o?t.position.scrollbarWidth():0,height:n?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var i=t(e||window),s=t.isWindow(i[0]),n=!!i[0]&&9===i[0].nodeType,o=!s&&!n;return{element:i,isWindow:s,isDocument:n,offset:o?t(e).offset():{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:i.outerWidth(),height:i.outerHeight()}}},t.fn.position=function(n){if(!n||!n.of)return d.apply(this,arguments);n=t.extend({},n);var u,p,f,g,m,_,v=t(n.of),b=t.position.getWithinInfo(n.within),y=t.position.getScrollInfo(b),w=(n.collision||"flip").split(" "),k={};return _=s(v),v[0].preventDefault&&(n.at="left top"),p=_.width,f=_.height,g=_.offset,m=t.extend({},g),t.each(["my","at"],function(){var t,e,i=(n[this]||"").split(" ");1===i.length&&(i=r.test(i[0])?i.concat(["center"]):l.test(i[0])?["center"].concat(i):["center","center"]),i[0]=r.test(i[0])?i[0]:"center",i[1]=l.test(i[1])?i[1]:"center",t=h.exec(i[0]),e=h.exec(i[1]),k[this]=[t?t[0]:0,e?e[0]:0],n[this]=[c.exec(i[0])[0],c.exec(i[1])[0]]}),1===w.length&&(w[1]=w[0]),"right"===n.at[0]?m.left+=p:"center"===n.at[0]&&(m.left+=p/2),"bottom"===n.at[1]?m.top+=f:"center"===n.at[1]&&(m.top+=f/2),u=e(k.at,p,f),m.left+=u[0],m.top+=u[1],this.each(function(){var s,r,l=t(this),h=l.outerWidth(),c=l.outerHeight(),d=i(this,"marginLeft"),_=i(this,"marginTop"),x=h+d+i(this,"marginRight")+y.width,C=c+_+i(this,"marginBottom")+y.height,D=t.extend({},m),T=e(k.my,l.outerWidth(),l.outerHeight());"right"===n.my[0]?D.left-=h:"center"===n.my[0]&&(D.left-=h/2),"bottom"===n.my[1]?D.top-=c:"center"===n.my[1]&&(D.top-=c/2),D.left+=T[0],D.top+=T[1],s={marginLeft:d,marginTop:_},t.each(["left","top"],function(e,i){t.ui.position[w[e]]&&t.ui.position[w[e]][i](D,{targetWidth:p,targetHeight:f,elemWidth:h,elemHeight:c,collisionPosition:s,collisionWidth:x,collisionHeight:C,offset:[u[0]+T[0],u[1]+T[1]],my:n.my,at:n.at,within:b,elem:l})}),n.using&&(r=function(t){var e=g.left-D.left,i=e+p-h,s=g.top-D.top,r=s+f-c,u={target:{element:v,left:g.left,top:g.top,width:p,height:f},element:{element:l,left:D.left,top:D.top,width:h,height:c},horizontal:0>i?"left":e>0?"right":"center",vertical:0>r?"top":s>0?"bottom":"middle"};h>p&&p>a(e+i)&&(u.horizontal="center"),c>f&&f>a(s+r)&&(u.vertical="middle"),u.important=o(a(e),a(i))>o(a(s),a(r))?"horizontal":"vertical",n.using.call(this,t,u)}),l.offset(t.extend(D,{using:r}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=t.left-e.collisionPosition.marginLeft,l=n-r,h=r+e.collisionWidth-a-n;e.collisionWidth>a?l>0&&0>=h?(i=t.left+l+e.collisionWidth-a-n,t.left+=l-i):t.left=h>0&&0>=l?n:l>h?n+a-e.collisionWidth:n:l>0?t.left+=l:h>0?t.left-=h:t.left=o(t.left-r,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,a=e.within.height,r=t.top-e.collisionPosition.marginTop,l=n-r,h=r+e.collisionHeight-a-n;e.collisionHeight>a?l>0&&0>=h?(i=t.top+l+e.collisionHeight-a-n,t.top+=l-i):t.top=h>0&&0>=l?n:l>h?n+a-e.collisionHeight:n:l>0?t.top+=l:h>0?t.top-=h:t.top=o(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,o=n.offset.left+n.scrollLeft,r=n.width,l=n.isWindow?n.scrollLeft:n.offset.left,h=t.left-e.collisionPosition.marginLeft,c=h-l,u=h+e.collisionWidth-r-l,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(i=t.left+d+p+f+e.collisionWidth-r-o,(0>i||a(c)>i)&&(t.left+=d+p+f)):u>0&&(s=t.left-e.collisionPosition.marginLeft+d+p+f-l,(s>0||u>a(s))&&(t.left+=d+p+f))},top:function(t,e){var i,s,n=e.within,o=n.offset.top+n.scrollTop,r=n.height,l=n.isWindow?n.scrollTop:n.offset.top,h=t.top-e.collisionPosition.marginTop,c=h-l,u=h+e.collisionHeight-r-l,d="top"===e.my[1],p=d?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,g=-2*e.offset[1];0>c?(s=t.top+p+f+g+e.collisionHeight-r-o,(0>s||a(c)>s)&&(t.top+=p+f+g)):u>0&&(i=t.top-e.collisionPosition.marginTop+p+f+g-l,(i>0||u>a(i))&&(t.top+=p+f+g))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}}}(),t.ui.position,t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(i){return!!t.data(i,e)}}):function(e,i,s){return!!t.data(e,s[3])}}),t.fn.extend({disableSelection:function(){var t="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}}(),enableSelection:function(){return this.off(".ui-disableSelection")}}),t.ui.focusable=function(i,s){var n,o,a,r,l,h=i.nodeName.toLowerCase();return"area"===h?(n=i.parentNode,o=n.name,i.href&&o&&"map"===n.nodeName.toLowerCase()?(a=t("img[usemap='#"+o+"']"),a.length>0&&a.is(":visible")):!1):(/^(input|select|textarea|button|object)$/.test(h)?(r=!i.disabled,r&&(l=t(i).closest("fieldset")[0],l&&(r=!l.disabled))):r="a"===h?i.href||s:s,r&&t(i).is(":visible")&&e(t(i)))},t.extend(t.expr[":"],{focusable:function(e){return t.ui.focusable(e,null!=t.attr(e,"tabindex"))}}),t.ui.focusable,t.fn.form=function(){return"string"==typeof this[0].form?this.closest("form"):t(this[0].form)},t.ui.formResetMixin={_formResetHandler:function(){var e=t(this);setTimeout(function(){var i=e.data("ui-form-reset-instances");t.each(i,function(){this.refresh()})})},_bindFormResetHandler:function(){if(this.form=this.element.form(),this.form.length){var t=this.form.data("ui-form-reset-instances")||[];t.length||this.form.on("reset.ui-form-reset",this._formResetHandler),t.push(this),this.form.data("ui-form-reset-instances",t)}},_unbindFormResetHandler:function(){if(this.form.length){var e=this.form.data("ui-form-reset-instances");e.splice(t.inArray(this,e),1),e.length?this.form.data("ui-form-reset-instances",e):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset")}}},"1.7"===t.fn.jquery.substring(0,3)&&(t.each(["Width","Height"],function(e,i){function s(e,i,s,o){return t.each(n,function(){i-=parseFloat(t.css(e,"padding"+this))||0,s&&(i-=parseFloat(t.css(e,"border"+this+"Width"))||0),o&&(i-=parseFloat(t.css(e,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],o=i.toLowerCase(),a={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+i]=function(e){return void 0===e?a["inner"+i].call(this):this.each(function(){t(this).css(o,s(this,e)+"px")})},t.fn["outer"+i]=function(e,n){return"number"!=typeof e?a["outer"+i].call(this,e):this.each(function(){t(this).css(o,s(this,e,!0,n)+"px")})}}),t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.ui.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},t.ui.escapeSelector=function(){var t=/([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g;return function(e){return e.replace(t,"\\$1")}}(),t.fn.labels=function(){var e,i,s,n,o;return this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(n=this.eq(0).parents("label"),s=this.attr("id"),s&&(e=this.eq(0).parents().last(),o=e.add(e.length?e.siblings():this.siblings()),i="label[for='"+t.ui.escapeSelector(s)+"']",n=n.add(o.find(i).addBack(i))),this.pushStack(n))},t.fn.scrollParent=function(e){var i=this.css("position"),s="absolute"===i,n=e?/(auto|scroll|hidden)/:/(auto|scroll)/,o=this.parents().filter(function(){var e=t(this);return s&&"static"===e.css("position")?!1:n.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return"fixed"!==i&&o.length?o:t(this[0].ownerDocument||document)},t.extend(t.expr[":"],{tabbable:function(e){var i=t.attr(e,"tabindex"),s=null!=i;return(!s||i>=0)&&t.ui.focusable(e,s)}}),t.fn.extend({uniqueId:function(){var t=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++t)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&t(this).removeAttr("id")})}}),t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var n=!1;t(document).on("mouseup",function(){n=!1}),t.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(i){return!0===t.data(i.target,e.widgetName+".preventClickEvent")?(t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(e){if(!n){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(e),this._mouseDownEvent=e;var i=this,s=1===e.which,o="string"==typeof this.options.cancel&&e.target.nodeName?t(e.target).closest(this.options.cancel).length:!1;return s&&!o&&this._mouseCapture(e)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(e)!==!1,!this._mouseStarted)?(e.preventDefault(),!0):(!0===t.data(e.target,this.widgetName+".preventClickEvent")&&t.removeData(e.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return i._mouseMove(t)},this._mouseUpDelegate=function(t){return i._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),e.preventDefault(),n=!0,!0)):!0}},_mouseMove:function(e){if(this._mouseMoved){if(t.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button)return this._mouseUp(e);if(!e.which)if(e.originalEvent.altKey||e.originalEvent.ctrlKey||e.originalEvent.metaKey||e.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(e)}return(e.which||e.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==!1,this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,n=!1,e.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),t.widget("ui.sortable",t.ui.mouse,{version:"1.12.1",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(t,e,i){return t>=e&&e+i>t},_isFloating:function(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))},_create:function(){this.containerCache={},this._addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(t,e){this._super(t,e),"handle"===t&&this._setHandleClassName()},_setHandleClassName:function(){var e=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle"),t.each(this.items,function(){e._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle")})},_destroy:function(){this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(e,i){var s=null,n=!1,o=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(e),t(e.target).parents().each(function(){return t.data(this,o.widgetName+"-item")===o?(s=t(this),!1):void 0}),t.data(e.target,o.widgetName+"-item")===o&&(s=t(e.target)),s?!this.options.handle||i||(t(this.options.handle,s).find("*").addBack().each(function(){this===e.target&&(n=!0)}),n)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(e,i,s){var n,o,a=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),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},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.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(e),this.originalPageX=e.pageX,this.originalPageY=e.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=t("<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",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this._addClass(this.helper,"ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){var i,s,n,o,a=this.options,r=!1;for(this.position=this._generatePosition(e),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-e.pageY<a.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+a.scrollSpeed:e.pageY-this.overflowOffset.top<a.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-a.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-e.pageX<a.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+a.scrollSpeed:e.pageX-this.overflowOffset.left<a.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-a.scrollSpeed)):(e.pageY-this.document.scrollTop()<a.scrollSensitivity?r=this.document.scrollTop(this.document.scrollTop()-a.scrollSpeed):this.window.height()-(e.pageY-this.document.scrollTop())<a.scrollSensitivity&&(r=this.document.scrollTop(this.document.scrollTop()+a.scrollSpeed)),e.pageX-this.document.scrollLeft()<a.scrollSensitivity?r=this.document.scrollLeft(this.document.scrollLeft()-a.scrollSpeed):this.window.width()-(e.pageX-this.document.scrollLeft())<a.scrollSensitivity&&(r=this.document.scrollLeft(this.document.scrollLeft()+a.scrollSpeed))),r!==!1&&t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e)),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&&!t.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!t.contains(this.element[0],n):!0)){if(this.direction=1===o?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(e,s),this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,i){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),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,t(this.helper).animate(a,parseInt(this.options.revert,10)||500,function(){s._clear(e)})}else this._clear(e,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp(new t.Event("mouseup",{target:null})),"original"===this.options.helper?(this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].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(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},t(i).each(function(){var i=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);i&&s.push((e.key||i[1]+"[]")+"="+(e.key&&e.expression?i[1]:i[2]))}),!s.length&&e.key&&s.push(e.key+"="),s.join("&")},toArray:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},i.each(function(){s.push(t(e.item||this).attr(e.attribute||"id")||"")}),s},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,o=t.left,a=o+t.width,r=t.top,l=r+t.height,h=this.offset.click.top,c=this.offset.click.left,u="x"===this.options.axis||s+h>r&&l>s+h,d="y"===this.options.axis||e+c>o&&a>e+c,p=u&&d;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?p:e+this.helperProportions.width/2>o&&a>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&l>n-this.helperProportions.height/2},_intersectsWithPointer:function(t){var e,i,s="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,t.height),n="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width),o=s&&n;return o?(e=this._getDragVerticalDirection(),i=this._getDragHorizontalDirection(),this.floating?"right"===i||"down"===e?2:1:e&&("down"===e?2:1)):!1},_intersectsWithSides:function(t){var e=this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),s=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection();return this.floating&&n?"right"===n&&i||"left"===n&&!i:s&&("down"===s&&e||"up"===s&&!e)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!==t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){function i(){r.push(this)}var s,n,o,a,r=[],l=[],h=this._connectWith();if(h&&e)for(s=h.length-1;s>=0;s--)for(o=t(h[s],this.document[0]),n=o.length-1;n>=0;n--)a=t.data(o[n],this.widgetFullName),a&&a!==this&&!a.options.disabled&&l.push([t.isFunction(a.options.items)?a.options.items.call(a.element):t(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a]);for(l.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),s=l.length-1;s>=0;s--)l[s][0].each(i);return t(r)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");
+this.items=t.grep(this.items,function(t){for(var i=0;e.length>i;i++)if(e[i]===t.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[],this.containers=[this];var i,s,n,o,a,r,l,h,c=this.items,u=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],d=this._connectWith();if(d&&this.ready)for(i=d.length-1;i>=0;i--)for(n=t(d[i],this.document[0]),s=n.length-1;s>=0;s--)o=t.data(n[s],this.widgetFullName),o&&o!==this&&!o.options.disabled&&(u.push([t.isFunction(o.options.items)?o.options.items.call(o.element[0],e,{item:this.currentItem}):t(o.options.items,o.element),o]),this.containers.push(o));for(i=u.length-1;i>=0;i--)for(a=u[i][1],r=u[i][0],s=0,h=r.length;h>s;s++)l=t(r[s]),l.data(this.widgetName+"-item",a),c.push({item:l,instance:a,width:0,height:0,left:0,top:0})},refreshPositions:function(e){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?t(this.options.toleranceElement,s.item):s.item,e||(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(e){e=e||this;var i,s=e.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=e.currentItem[0].nodeName.toLowerCase(),n=t("<"+s+">",e.document[0]);return e._addClass(n,"ui-sortable-placeholder",i||e.currentItem[0].className)._removeClass(n,"ui-sortable-helper"),"tbody"===s?e._createTrPlaceholder(e.currentItem.find("tr").eq(0),t("<tr>",e.document[0]).appendTo(n)):"tr"===s?e._createTrPlaceholder(e.currentItem,n):"img"===s&&n.attr("src",e.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(t,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}),e.placeholder=t(s.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),s.placeholder.update(e,e.placeholder)},_createTrPlaceholder:function(e,i){var s=this;e.children().each(function(){t("<td>&#160;</td>",s.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(i)})},_contactContainers:function(e){var i,s,n,o,a,r,l,h,c,u,d=null,p=null;for(i=this.containers.length-1;i>=0;i--)if(!t.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(d&&t.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",e,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",e,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(n=1e4,o=null,c=d.floating||this._isFloating(this.currentItem),a=c?"left":"top",r=c?"width":"height",u=c?"pageX":"pageY",s=this.items.length-1;s>=0;s--)t.contains(this.containers[p].element[0],this.items[s].item[0])&&this.items[s].item[0]!==this.currentItem[0]&&(l=this.items[s].item.offset()[a],h=!1,e[u]-l>this.items[s][r]/2&&(h=!0),n>Math.abs(e[u]-l)&&(n=Math.abs(e[u]-l),o=this.items[s],this.direction=h?"up":"down"));if(!o&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[p])return this.currentContainer.containerCache.over||(this.containers[p]._trigger("over",e,this._uiHash()),this.currentContainer.containerCache.over=1),void 0;o?this._rearrange(e,o,null,!0):this._rearrange(e,null,this.containers[p].element,!0),this._trigger("change",e,this._uiHash()),this.containers[p]._trigger("change",e,this._uiHash(this)),this.currentContainer=this.containers[p],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[p]._trigger("over",e,this._uiHash(this)),this.containers[p].containerCache.over=1}},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||t("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(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.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 e,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.height()||document.body.parentNode.scrollHeight:this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(e=t(n.containment)[0],i=t(n.containment).offset(),s="hidden"!==t(e).css("overflow"),this.containment=[i.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(t(e).css("borderTopWidth"),10)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&t.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(e){var i,s,n=this.options,o=e.pageX,a=e.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,l=/(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&&(e.pageX-this.offset.click.left<this.containment[0]&&(o=this.containment[0]+this.offset.click.left),e.pageY-this.offset.click.top<this.containment[1]&&(a=this.containment[1]+this.offset.click.top),e.pageX-this.offset.click.left>this.containment[2]&&(o=this.containment[2]+this.offset.click.left),e.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():l?0:r.scrollTop()),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():l?0:r.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.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(t,e){function i(t,e,i){return function(s){i._trigger(t,s,e._uiHash(e))}}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),this._removeClass(this.currentItem,"ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!e&&n.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||n.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(n.push(function(t){this._trigger("remove",t,this._uiHash())}),n.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))),s=this.containers.length-1;s>=0;s--)e||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,e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!e){for(s=0;n.length>s;s++)n[s].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){t.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(e){var i=e||this;return{helper:i.helper,placeholder:i.placeholder||t([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:e?e.element:null}}}),t.ui.safeActiveElement=function(t){var e;try{e=t.activeElement}catch(i){e=t.body}return e||(e=t.body),e.nodeName||(e=t.body),e},t.widget("ui.menu",{version:"1.12.1",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().attr({role:this.options.role,tabIndex:0}),this._addClass("ui-menu","ui-widget ui-widget-content"),this._on({"mousedown .ui-menu-item":function(t){t.preventDefault()},"click .ui-menu-item":function(e){var i=t(e.target),s=t(t.ui.safeActiveElement(this.document[0]));!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(e),e.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(e):!this.element.is(":focus")&&s.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(e){if(!this.previousFilter){var i=t(e.target).closest(".ui-menu-item"),s=t(e.currentTarget);i[0]===s[0]&&(this._removeClass(s.siblings().children(".ui-state-active"),null,"ui-state-active"),this.focus(e,s))}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this.element.find(this.options.items).eq(0);e||this.focus(t,i)},blur:function(e){this._delay(function(){var i=!t.contains(this.element[0],t.ui.safeActiveElement(this.document[0]));i&&this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){this._closeOnDocumentClick(t)&&this.collapseAll(t),this.mouseHandled=!1}})},_destroy:function(){var e=this.element.find(".ui-menu-item").removeAttr("role aria-disabled"),i=e.children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled tabIndex").removeUniqueId().show(),i.children().each(function(){var e=t(this);e.data("ui-menu-submenu-caret")&&e.remove()})},_keydown:function(e){var i,s,n,o,a=!0;switch(e.keyCode){case t.ui.keyCode.PAGE_UP:this.previousPage(e);break;case t.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case t.ui.keyCode.HOME:this._move("first","first",e);break;case t.ui.keyCode.END:this._move("last","last",e);break;case t.ui.keyCode.UP:this.previous(e);break;case t.ui.keyCode.DOWN:this.next(e);break;case t.ui.keyCode.LEFT:this.collapse(e);break;case t.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:this._activate(e);break;case t.ui.keyCode.ESCAPE:this.collapse(e);break;default:a=!1,s=this.previousFilter||"",o=!1,n=e.keyCode>=96&&105>=e.keyCode?""+(e.keyCode-96):String.fromCharCode(e.keyCode),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(e.keyCode),i=this._filterMenuItems(n)),i.length?(this.focus(e,i),this.previousFilter=n,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}a&&e.preventDefault()},_activate:function(t){this.active&&!this.active.is(".ui-state-disabled")&&(this.active.children("[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var e,i,s,n,o,a=this,r=this.options.icons.submenu,l=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length),s=l.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=t(this),i=e.prev(),s=t("<span>").data("ui-menu-submenu-caret",!0);a._addClass(s,"ui-menu-icon","ui-icon "+r),i.attr("aria-haspopup","true").prepend(s),e.attr("aria-labelledby",i.attr("id"))}),this._addClass(s,"ui-menu","ui-widget ui-widget-content ui-front"),e=l.add(this.element),i=e.find(this.options.items),i.not(".ui-menu-item").each(function(){var e=t(this);a._isDivider(e)&&a._addClass(e,"ui-menu-divider","ui-widget-content")}),n=i.not(".ui-menu-item, .ui-menu-divider"),o=n.children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),this._addClass(n,"ui-menu-item")._addClass(o,"ui-menu-item-wrapper"),i.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!t.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){if("icons"===t){var i=this.element.find(".ui-menu-icon");this._removeClass(i,null,this.options.icons.submenu)._addClass(i,null,e.submenu)}this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t+""),this._toggleClass(null,"ui-state-disabled",!!t)},focus:function(t,e){var i,s,n;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),s=this.active.children(".ui-menu-item-wrapper"),this._addClass(s,null,"ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),n=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper"),this._addClass(n,null,"ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=e.children(".ui-menu"),i.length&&t&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(e){var i,s,n,o,a,r;this._hasScroll()&&(i=parseFloat(t.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(t.css(this.activeMenu[0],"paddingTop"))||0,n=e.offset().top-this.activeMenu.offset().top-i-s,o=this.activeMenu.scrollTop(),a=this.activeMenu.height(),r=e.outerHeight(),0>n?this.activeMenu.scrollTop(o+n):n+r>a&&this.activeMenu.scrollTop(o+n-a+r))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this._removeClass(this.active.children(".ui-menu-item-wrapper"),null,"ui-state-active"),this._trigger("blur",t,{item:this.active}),this.active=null)},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(e){var i=t.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true"),e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(e,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:t(e&&e.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(e),this._removeClass(s.find(".ui-state-active"),null,"ui-state-active"),this.activeMenu=s},this.delay)},_close:function(t){t||(t=this.active?this.active.parent():this.element),t.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false")},_closeOnDocumentClick:function(e){return!t(e.target).closest(".ui-menu").length},_isDivider:function(t){return!/[^\-\u2014\u2013\s]/.test(t.text())},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},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(t,e,i){var s;this.active&&(s="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.find(this.options.items)[e]()),this.focus(i,s)},nextPage:function(e){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=t(this),0>i.offset().top-s-n}),this.focus(e,i)):this.focus(e,this.activeMenu.find(this.options.items)[this.active?"last":"first"]())),void 0):(this.next(e),void 0)},previousPage:function(e){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=t(this),i.offset().top-s+n>0}),this.focus(e,i)):this.focus(e,this.activeMenu.find(this.options.items).first())),void 0):(this.next(e),void 0)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(e){this.active=this.active||t(e.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(e,!0),this._trigger("select",e,i)},_filterMenuItems:function(e){var i=e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),s=RegExp("^"+i,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return s.test(t.trim(t(this).children(".ui-menu-item-wrapper").text()))})}}),t.widget("ui.autocomplete",{version:"1.12.1",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 e,i,s,n=this.element[0].nodeName.toLowerCase(),o="textarea"===n,a="input"===n;this.isMultiLine=o||!a&&this._isContentEditable(this.element),this.valueMethod=this.element[o||a?"val":"text"],this.isNewMenu=!0,this._addClass("ui-autocomplete-input"),this.element.attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return e=!0,s=!0,i=!0,void 0;e=!1,s=!1,i=!1;var o=t.ui.keyCode;switch(n.keyCode){case o.PAGE_UP:e=!0,this._move("previousPage",n);break;case o.PAGE_DOWN:e=!0,this._move("nextPage",n);break;case o.UP:e=!0,this._keyEvent("previous",n);break;case o.DOWN:e=!0,this._keyEvent("next",n);break;case o.ENTER:this.menu.active&&(e=!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(e)return e=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),void 0;if(!i){var n=t.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(t){return s?(s=!1,t.preventDefault(),void 0):(this._searchTimeout(t),void 0)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(t){return this.cancelBlur?(delete this.cancelBlur,void 0):(clearTimeout(this.searching),this.close(t),this._change(t),void 0)}}),this._initSource(),this.menu=t("<ul>").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._addClass(this.menu.element,"ui-autocomplete","ui-front"),this._on(this.menu.element,{mousedown:function(e){e.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,this.element[0]!==t.ui.safeActiveElement(this.document[0])&&this.element.trigger("focus")})},menufocus:function(e,i){var s,n;return this.isNewMenu&&(this.isNewMenu=!1,e.originalEvent&&/^mouse/.test(e.originalEvent.type))?(this.menu.blur(),this.document.one("mousemove",function(){t(e.target).trigger(e.originalEvent)}),void 0):(n=i.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",e,{item:n})&&e.originalEvent&&/^key/.test(e.originalEvent.type)&&this._value(n.value),s=i.item.attr("aria-label")||n.value,s&&t.trim(s).length&&(this.liveRegion.children().hide(),t("<div>").text(s).appendTo(this.liveRegion)),void 0)},menuselect:function(e,i){var s=i.item.data("ui-autocomplete-item"),n=this.previous;this.element[0]!==t.ui.safeActiveElement(this.document[0])&&(this.element.trigger("focus"),this.previous=n,this._delay(function(){this.previous=n,this.selectedItem=s})),!1!==this._trigger("select",e,{item:s})&&this._value(s.value),this.term=this._value(),this.close(e),this.selectedItem=s}}),this.liveRegion=t("<div>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(t,e){this._super(t,e),"source"===t&&this._initSource(),"appendTo"===t&&this.menu.element.appendTo(this._appendTo()),"disabled"===t&&e&&this.xhr&&this.xhr.abort()},_isEventTargetInWidget:function(e){var i=this.menu.element[0];return e.target===this.element[0]||e.target===i||t.contains(i,e.target)},_closeOnClickOutside:function(t){this._isEventTargetInWidget(t)||this.close()},_appendTo:function(){var e=this.options.appendTo;return e&&(e=e.jquery||e.nodeType?t(e):this.document.find(e).eq(0)),e&&e[0]||(e=this.element.closest(".ui-front, dialog")),e.length||(e=this.document[0].body),e},_initSource:function(){var e,i,s=this;t.isArray(this.options.source)?(e=this.options.source,this.source=function(i,s){s(t.ui.autocomplete.filter(e,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(e,n){s.xhr&&s.xhr.abort(),s.xhr=t.ajax({url:i,data:e,dataType:"json",success:function(t){n(t)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(t){clearTimeout(this.searching),this.searching=this._delay(function(){var e=this.term===this._value(),i=this.menu.element.is(":visible"),s=t.altKey||t.ctrlKey||t.metaKey||t.shiftKey;(!e||e&&!i&&!s)&&(this.selectedItem=null,this.search(null,t))},this.options.delay)},search:function(t,e){return t=null!=t?t:this._value(),this.term=this._value(),t.length<this.options.minLength?this.close(e):this._trigger("search",e)!==!1?this._search(t):void 0},_search:function(t){this.pending++,this._addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:t},this._response())},_response:function(){var e=++this.requestIndex;return t.proxy(function(t){e===this.requestIndex&&this.__response(t),this.pending--,this.pending||this._removeClass("ui-autocomplete-loading")},this)},__response:function(t){t&&(t=this._normalize(t)),this._trigger("response",null,{content:t}),!this.options.disabled&&t&&t.length&&!this.cancelSearch?(this._suggest(t),this._trigger("open")):this._close()},close:function(t){this.cancelSearch=!0,this._close(t)},_close:function(t){this._off(this.document,"mousedown"),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",t))},_change:function(t){this.previous!==this._value()&&this._trigger("change",t,{item:this.selectedItem})},_normalize:function(e){return e.length&&e[0].label&&e[0].value?e:t.map(e,function(e){return"string"==typeof e?{label:e,value:e}:t.extend({},e,{label:e.label||e.value,value:e.value||e.label})})},_suggest:function(e){var i=this.menu.element.empty();this._renderMenu(i,e),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(t.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(),this._on(this.document,{mousedown:"_closeOnClickOutside"})},_resizeMenu:function(){var t=this.menu.element;t.outerWidth(Math.max(t.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(e,i){var s=this;t.each(i,function(t,i){s._renderItemData(e,i)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-autocomplete-item",e)},_renderItem:function(e,i){return t("<li>").append(t("<div>").text(i.label)).appendTo(e)},_move:function(t,e){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(t)||this.menu.isLastItem()&&/^next/.test(t)?(this.isMultiLine||this._value(this.term),this.menu.blur(),void 0):(this.menu[t](e),void 0):(this.search(null,e),void 0)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(t,e){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(t,e),e.preventDefault())},_isContentEditable:function(t){if(!t.length)return!1;var e=t.prop("contentEditable");return"inherit"===e?this._isContentEditable(t.parent()):"true"===e}}),t.extend(t.ui.autocomplete,{escapeRegex:function(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(e,i){var s=RegExp(t.ui.autocomplete.escapeRegex(i),"i");return t.grep(e,function(t){return s.test(t.label||t.value||t)})}}),t.widget("ui.autocomplete",t.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(t){return t+(t>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(e){var i;this._superApply(arguments),this.options.disabled||this.cancelSearch||(i=e&&e.length?this.options.messages.results(e.length):this.options.messages.noResults,this.liveRegion.children().hide(),t("<div>").text(i).appendTo(this.liveRegion))}}),t.ui.autocomplete}); \ No newline at end of file
diff --git a/public_html/data/js/vendor/jquery.checkboxes-1.0.6.min.js b/public_html/data/js/vendor/jquery.checkboxes-1.0.6.min.js
new file mode 100644
index 000000000..b8ab064ff
--- /dev/null
+++ b/public_html/data/js/vendor/jquery.checkboxes-1.0.6.min.js
@@ -0,0 +1 @@
+/*! checkboxes.js v1.0.6 | (c) 2013, 2014 Rubens Mariuzzo | http://github.com/rmariuzzo/checkboxes.js/LICENSE */"use strict";!function(a){var b=function(a){this.$context=a};b.prototype.check=function(){this.$context.find(":checkbox").filter(":not(:disabled)").prop("checked",!0)},b.prototype.uncheck=function(){this.$context.find(":checkbox").filter(":not(:disabled)").prop("checked",!1)},b.prototype.toggle=function(){this.$context.find(":checkbox").filter(":not(:disabled)").each(function(){var b=a(this);b.prop("checked",!b.is(":checked"))})},b.prototype.max=function(a){if(a>0){var b=this;this.$context.on("click.checkboxes.max",":checkbox",function(){b.$context.find(":checked").length===a?b.$context.find(":checkbox:not(:checked)").prop("disabled",!0):b.$context.find(":checkbox:not(:checked)").prop("disabled",!1)})}else this.$context.off("click.checkboxes")},b.prototype.range=function(b){if(b){var c=this;this.$context.on("click.checkboxes.range",":checkbox",function(b){var d=a(b.target);if(b.shiftKey&&c.$last){var e=c.$context.find(":checkbox"),f=e.index(c.$last),g=e.index(d),h=Math.min(f,g),i=Math.max(f,g)+1;e.slice(h,i).filter(":not(:disabled)").prop("checked",d.prop("checked"))}c.$last=d})}else this.$context.off("click.checkboxes.range")};var c=a.fn.checkboxes;a.fn.checkboxes=function(c){var d=Array.prototype.slice.call(arguments,1);return this.each(function(){var e=a(this),f=e.data("checkboxes");f||e.data("checkboxes",f=new b(e,"object"==typeof c&&c)),"string"==typeof c&&f[c]&&f[c].apply(f,d)})},a.fn.checkboxes.Constructor=b,a.fn.checkboxes.noConflict=function(){return a.fn.checkboxes=c,this};var d=function(b){var c=a(b.target),d=c.attr("href"),e=a(c.data("context")||d&&d.replace(/.*(?=#[^\s]+$)/,"")),f=c.data("action");e&&f&&(c.is(":checkbox")||b.preventDefault(),e.checkboxes(f))},e=function(){a("[data-toggle^=checkboxes]").each(function(){var b=a(this),c=b.data();delete c.toggle;for(var d in c)b.checkboxes(d,c[d])})};a(document).on("click.checkboxes.data-api","[data-toggle^=checkboxes]",d),a(document).on("ready.checkboxes.data-api",e)}(window.jQuery); \ No newline at end of file
diff --git a/public_html/data/js/vendor/jquery.colorbox.js b/public_html/data/js/vendor/jquery.colorbox.js
new file mode 100644
index 000000000..4c5025370
--- /dev/null
+++ b/public_html/data/js/vendor/jquery.colorbox.js
@@ -0,0 +1,1183 @@
+/*!
+ Colorbox 1.5.14
+ license: MIT
+ http://www.jacklmoore.com/colorbox
+*/
+(function ($, document, window) {
+ var
+ // Default settings object.
+ // See http://jacklmoore.com/colorbox for details.
+ defaults = {
+ // data sources
+ html: false,
+ photo: false,
+ iframe: false,
+ inline: false,
+
+ // behavior and appearance
+ transition: "elastic",
+ speed: 300,
+ fadeOut: 300,
+ width: false,
+ initialWidth: "600",
+ innerWidth: false,
+ maxWidth: false,
+ height: false,
+ initialHeight: "450",
+ innerHeight: false,
+ maxHeight: false,
+ scalePhotos: true,
+ scrolling: true,
+ opacity: 0.9,
+ preloading: true,
+ className: false,
+ overlayClose: true,
+ escKey: true,
+ arrowKey: true,
+ top: false,
+ bottom: false,
+ left: false,
+ right: false,
+ fixed: false,
+ data: undefined,
+ closeButton: true,
+ fastIframe: true,
+ open: false,
+ reposition: true,
+ loop: true,
+ slideshow: false,
+ slideshowAuto: true,
+ slideshowSpeed: 2500,
+ slideshowStart: "start slideshow",
+ slideshowStop: "stop slideshow",
+ photoRegex: /\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr|svg)((#|\?).*)?$/i,
+
+ // alternate image paths for high-res displays
+ retinaImage: false,
+ retinaUrl: false,
+ retinaSuffix: '@2x.$1',
+
+ // internationalization
+ current: "image {current} of {total}",
+ previous: "previous",
+ next: "next",
+ close: "close",
+ xhrError: "This content failed to load.",
+ imgError: "This image failed to load.",
+
+ // accessbility
+ returnFocus: true,
+ trapFocus: true,
+
+ // callbacks
+ onOpen: false,
+ onLoad: false,
+ onComplete: false,
+ onCleanup: false,
+ onClosed: false,
+
+ rel: function() {
+ return this.rel;
+ },
+ href: function() {
+ // using this.href would give the absolute url, when the href may have been inteded as a selector (e.g. '#container')
+ return $(this).attr('href');
+ },
+ title: function() {
+ return this.title;
+ },
+ orientation: function() {
+ return 0;
+ },
+ },
+
+ // Abstracting the HTML and event identifiers for easy rebranding
+ colorbox = 'colorbox',
+ prefix = 'cbox',
+ boxElement = prefix + 'Element',
+
+ // Events
+ event_open = prefix + '_open',
+ event_load = prefix + '_load',
+ event_complete = prefix + '_complete',
+ event_cleanup = prefix + '_cleanup',
+ event_closed = prefix + '_closed',
+ event_purge = prefix + '_purge',
+
+ // Cached jQuery Object Variables
+ $overlay,
+ $box,
+ $wrap,
+ $content,
+ $topBorder,
+ $leftBorder,
+ $rightBorder,
+ $bottomBorder,
+ $related,
+ $window,
+ $loaded,
+ $loadingBay,
+ $loadingOverlay,
+ $title,
+ $current,
+ $slideshow,
+ $next,
+ $prev,
+ $close,
+ $groupControls,
+ $events = $('<a/>'), // $({}) would be prefered, but there is an issue with jQuery 1.4.2
+
+ // Variables for cached values or use across multiple functions
+ settings,
+ interfaceHeight,
+ interfaceWidth,
+ loadedHeight,
+ loadedWidth,
+ index,
+ photo,
+ open,
+ active,
+ closing,
+ loadingTimer,
+ publicMethod,
+ div = "div",
+ requests = 0,
+ previousCSS = {},
+ init;
+
+ // ****************
+ // HELPER FUNCTIONS
+ // ****************
+
+ // Convenience function for creating new jQuery objects
+ function $tag(tag, id, css) {
+ var element = document.createElement(tag);
+
+ if (id) {
+ element.id = prefix + id;
+ }
+
+ if (css) {
+ element.style.cssText = css;
+ }
+
+ return $(element);
+ }
+
+ // Get the window height using innerHeight when available to avoid an issue with iOS
+ // http://bugs.jquery.com/ticket/6724
+ function winheight() {
+ return window.innerHeight ? window.innerHeight : $(window).height();
+ }
+
+ function Settings(element, options) {
+ if (options !== Object(options)) {
+ options = {};
+ }
+
+ this.cache = {};
+ this.el = element;
+
+ this.value = function(key) {
+ var dataAttr;
+
+ if (this.cache[key] === undefined) {
+ dataAttr = $(this.el).attr('data-cbox-'+key);
+
+ if (dataAttr !== undefined) {
+ this.cache[key] = dataAttr;
+ } else if (options[key] !== undefined) {
+ this.cache[key] = options[key];
+ } else if (defaults[key] !== undefined) {
+ this.cache[key] = defaults[key];
+ }
+ }
+
+ return this.cache[key];
+ };
+
+ this.get = function(key) {
+ var value = this.value(key);
+ return $.isFunction(value) ? value.call(this.el, this) : value;
+ };
+ }
+
+ // Determine the next and previous members in a group.
+ function getIndex(increment) {
+ var
+ max = $related.length,
+ newIndex = (index + increment) % max;
+
+ return (newIndex < 0) ? max + newIndex : newIndex;
+ }
+
+ // Convert '%' and 'px' values to integers
+ function setSize(size, dimension) {
+ return Math.round((/%/.test(size) ? ((dimension === 'x' ? $window.width() : winheight()) / 100) : 1) * parseInt(size, 10));
+ }
+
+ // Checks an href to see if it is a photo.
+ // There is a force photo option (photo: true) for hrefs that cannot be matched by the regex.
+ function isImage(settings, url) {
+ return settings.get('photo') || settings.get('photoRegex').test(url);
+ }
+
+ function retinaUrl(settings, url) {
+ return settings.get('retinaUrl') && window.devicePixelRatio > 1 ? url.replace(settings.get('photoRegex'), settings.get('retinaSuffix')) : url;
+ }
+
+ function trapFocus(e) {
+ if ('contains' in $box[0] && !$box[0].contains(e.target) && e.target !== $overlay[0]) {
+ e.stopPropagation();
+ $box.focus();
+ }
+ }
+
+ function setClass(str) {
+ if (setClass.str !== str) {
+ $box.add($overlay).removeClass(setClass.str).addClass(str);
+ setClass.str = str;
+ }
+ }
+
+ function getRelated(rel) {
+ index = 0;
+
+ if (rel && rel !== false && rel !== 'nofollow') {
+ $related = $('.' + boxElement).filter(function () {
+ var options = $.data(this, colorbox);
+ var settings = new Settings(this, options);
+ return (settings.get('rel') === rel);
+ });
+ index = $related.index(settings.el);
+
+ // Check direct calls to Colorbox.
+ if (index === -1) {
+ $related = $related.add(settings.el);
+ index = $related.length - 1;
+ }
+ } else {
+ $related = $(settings.el);
+ }
+ }
+
+ function trigger(event) {
+ // for external use
+ $(document).trigger(event);
+ // for internal use
+ $events.triggerHandler(event);
+ }
+
+ var slideshow = (function(){
+ var active,
+ className = prefix + "Slideshow_",
+ click = "click." + prefix,
+ timeOut;
+
+ function clear () {
+ clearTimeout(timeOut);
+ }
+
+ function set() {
+ if (settings.get('loop') || $related[index + 1]) {
+ clear();
+ timeOut = setTimeout(publicMethod.next, settings.get('slideshowSpeed'));
+ }
+ }
+
+ function start() {
+ $slideshow
+ .html(settings.get('slideshowStop'))
+ .unbind(click)
+ .one(click, stop);
+
+ $events
+ .bind(event_complete, set)
+ .bind(event_load, clear);
+
+ $box.removeClass(className + "off").addClass(className + "on");
+ }
+
+ function stop() {
+ clear();
+
+ $events
+ .unbind(event_complete, set)
+ .unbind(event_load, clear);
+
+ $slideshow
+ .html(settings.get('slideshowStart'))
+ .unbind(click)
+ .one(click, function () {
+ publicMethod.next();
+ start();
+ });
+
+ $box.removeClass(className + "on").addClass(className + "off");
+ }
+
+ function reset() {
+ active = false;
+ $slideshow.hide();
+ clear();
+ $events
+ .unbind(event_complete, set)
+ .unbind(event_load, clear);
+ $box.removeClass(className + "off " + className + "on");
+ }
+
+ return function(){
+ if (active) {
+ if (!settings.get('slideshow')) {
+ $events.unbind(event_cleanup, reset);
+ reset();
+ }
+ } else {
+ if (settings.get('slideshow') && $related[1]) {
+ active = true;
+ $events.one(event_cleanup, reset);
+ if (settings.get('slideshowAuto')) {
+ start();
+ } else {
+ stop();
+ }
+ $slideshow.show();
+ }
+ }
+ };
+
+ }());
+
+
+ function launch(element) {
+ var options;
+
+ if (!closing) {
+
+ options = $(element).data(colorbox);
+
+ settings = new Settings(element, options);
+
+ getRelated(settings.get('rel'));
+
+ if (!open) {
+ open = active = true; // Prevents the page-change action from queuing up if the visitor holds down the left or right keys.
+
+ setClass(settings.get('className'));
+
+ // Show colorbox so the sizes can be calculated in older versions of jQuery
+ $box.css({visibility:'hidden', display:'block', opacity:''});
+
+ $loaded = $tag(div, 'LoadedContent', 'width:0; height:0; overflow:hidden; visibility:hidden');
+ $content.css({width:'', height:''}).append($loaded);
+
+ // Cache values needed for size calculations
+ interfaceHeight = $topBorder.height() + $bottomBorder.height() + $content.outerHeight(true) - $content.height();
+ interfaceWidth = $leftBorder.width() + $rightBorder.width() + $content.outerWidth(true) - $content.width();
+ loadedHeight = $loaded.outerHeight(true);
+ loadedWidth = $loaded.outerWidth(true);
+
+ // Opens inital empty Colorbox prior to content being loaded.
+ var initialWidth = setSize(settings.get('initialWidth'), 'x');
+ var initialHeight = setSize(settings.get('initialHeight'), 'y');
+ var maxWidth = settings.get('maxWidth');
+ var maxHeight = settings.get('maxHeight');
+
+ settings.w = (maxWidth !== false ? Math.min(initialWidth, setSize(maxWidth, 'x')) : initialWidth) - loadedWidth - interfaceWidth;
+ settings.h = (maxHeight !== false ? Math.min(initialHeight, setSize(maxHeight, 'y')) : initialHeight) - loadedHeight - interfaceHeight;
+
+ $loaded.css({width:'', height:settings.h});
+ publicMethod.position();
+
+ trigger(event_open);
+ settings.get('onOpen');
+
+ $groupControls.add($title).hide();
+
+ $box.focus();
+
+ if (settings.get('trapFocus')) {
+ // Confine focus to the modal
+ // Uses event capturing that is not supported in IE8-
+ if (document.addEventListener) {
+
+ document.addEventListener('focus', trapFocus, true);
+
+ $events.one(event_closed, function () {
+ document.removeEventListener('focus', trapFocus, true);
+ });
+ }
+ }
+
+ // Return focus on closing
+ if (settings.get('returnFocus')) {
+ $events.one(event_closed, function () {
+ $(settings.el).focus();
+ });
+ }
+ }
+
+ var opacity = parseFloat(settings.get('opacity'));
+ $overlay.css({
+ opacity: opacity === opacity ? opacity : '',
+ cursor: settings.get('overlayClose') ? 'pointer' : '',
+ visibility: 'visible'
+ }).show();
+
+ if (settings.get('closeButton')) {
+ $close.html(settings.get('close')).appendTo($content);
+ } else {
+ $close.appendTo('<div/>'); // replace with .detach() when dropping jQuery < 1.4
+ }
+
+ load();
+ }
+ }
+
+ // Colorbox's markup needs to be added to the DOM prior to being called
+ // so that the browser will go ahead and load the CSS background images.
+ function appendHTML() {
+ if (!$box) {
+ init = false;
+ $window = $(window);
+ $box = $tag(div).attr({
+ id: colorbox,
+ 'class': $.support.opacity === false ? prefix + 'IE' : '', // class for optional IE8 & lower targeted CSS.
+ role: 'dialog',
+ tabindex: '-1'
+ }).hide();
+ $overlay = $tag(div, "Overlay").hide();
+ $loadingOverlay = $([$tag(div, "LoadingOverlay")[0],$tag(div, "LoadingGraphic")[0]]);
+ $wrap = $tag(div, "Wrapper");
+ $content = $tag(div, "Content").append(
+ $title = $tag(div, "Title"),
+ $current = $tag(div, "Current"),
+ $prev = $('<button type="button"/>').attr({id:prefix+'Previous'}),
+ $next = $('<button type="button"/>').attr({id:prefix+'Next'}),
+ $slideshow = $tag('button', "Slideshow"),
+ $loadingOverlay
+ );
+
+ $close = $('<button type="button"/>').attr({id:prefix+'Close'});
+
+ $wrap.append( // The 3x3 Grid that makes up Colorbox
+ $tag(div).append(
+ $tag(div, "TopLeft"),
+ $topBorder = $tag(div, "TopCenter"),
+ $tag(div, "TopRight")
+ ),
+ $tag(div, false, 'clear:left').append(
+ $leftBorder = $tag(div, "MiddleLeft"),
+ $content,
+ $rightBorder = $tag(div, "MiddleRight")
+ ),
+ $tag(div, false, 'clear:left').append(
+ $tag(div, "BottomLeft"),
+ $bottomBorder = $tag(div, "BottomCenter"),
+ $tag(div, "BottomRight")
+ )
+ ).find('div div').css({'float': 'left'});
+
+ $loadingBay = $tag(div, false, 'position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;');
+
+ $groupControls = $next.add($prev).add($current).add($slideshow);
+ }
+ if (document.body && !$box.parent().length) {
+ $(document.body).append($overlay, $box.append($wrap, $loadingBay));
+ }
+ }
+
+ // Add Colorbox's event bindings
+ function addBindings() {
+ function clickHandler(e) {
+ // ignore non-left-mouse-clicks and clicks modified with ctrl / command, shift, or alt.
+ // See: http://jacklmoore.com/notes/click-events/
+ if (!(e.which > 1 || e.shiftKey || e.altKey || e.metaKey || e.ctrlKey)) {
+ e.preventDefault();
+ launch(this);
+ }
+ }
+
+ if ($box) {
+ if (!init) {
+ init = true;
+
+ // Anonymous functions here keep the public method from being cached, thereby allowing them to be redefined on the fly.
+ $next.click(function () {
+ publicMethod.next();
+ });
+ $prev.click(function () {
+ publicMethod.prev();
+ });
+ $close.click(function () {
+ publicMethod.close();
+ });
+ $overlay.click(function () {
+ if (settings.get('overlayClose')) {
+ publicMethod.close();
+ }
+ });
+
+ // Key Bindings
+ $(document).bind('keydown.' + prefix, function (e) {
+ var key = e.keyCode;
+ if (open && settings.get('escKey') && key === 27) {
+ e.preventDefault();
+ publicMethod.close();
+ }
+ if (open && settings.get('arrowKey') && $related[1] && !e.altKey) {
+ if (key === 37 || key == 72) {
+ e.preventDefault();
+ $prev.click();
+ } else if (key === 39 || key === 76) {
+ e.preventDefault();
+ $next.click();
+ }
+ }
+ });
+
+ if ($.isFunction($.fn.on)) {
+ // For jQuery 1.7+
+ $(document).on('click.'+prefix, '.'+boxElement, clickHandler);
+ } else {
+ // For jQuery 1.3.x -> 1.6.x
+ // This code is never reached in jQuery 1.9, so do not contact me about 'live' being removed.
+ // This is not here for jQuery 1.9, it's here for legacy users.
+ $('.'+boxElement).live('click.'+prefix, clickHandler);
+ }
+ }
+ return true;
+ }
+ return false;
+ }
+
+ // Don't do anything if Colorbox already exists.
+ if ($[colorbox]) {
+ return;
+ }
+
+ // Append the HTML when the DOM loads
+ $(appendHTML);
+
+
+ // ****************
+ // PUBLIC FUNCTIONS
+ // Usage format: $.colorbox.close();
+ // Usage from within an iframe: parent.jQuery.colorbox.close();
+ // ****************
+
+ publicMethod = $.fn[colorbox] = $[colorbox] = function (options, callback) {
+ var settings;
+ var $obj = this;
+
+ options = options || {};
+
+ if ($.isFunction($obj)) { // assume a call to $.colorbox
+ $obj = $('<a/>');
+ options.open = true;
+ } else if (!$obj[0]) { // colorbox being applied to empty collection
+ return $obj;
+ }
+
+
+ if (!$obj[0]) { // colorbox being applied to empty collection
+ return $obj;
+ }
+
+ appendHTML();
+
+ if (addBindings()) {
+
+ if (callback) {
+ options.onComplete = callback;
+ }
+
+ $obj.each(function () {
+ var old = $.data(this, colorbox) || {};
+ $.data(this, colorbox, $.extend(old, options));
+ }).addClass(boxElement);
+
+ settings = new Settings($obj[0], options);
+
+ if (settings.get('open')) {
+ launch($obj[0]);
+ }
+ }
+
+ return $obj;
+ };
+
+ publicMethod.position = function (speed, loadedCallback) {
+ var
+ css,
+ top = 0,
+ left = 0,
+ offset = $box.offset(),
+ scrollTop,
+ scrollLeft;
+
+ $window.unbind('resize.' + prefix);
+
+ // remove the modal so that it doesn't influence the document width/height
+ $box.css({top: -9e4, left: -9e4});
+
+ scrollTop = $window.scrollTop();
+ scrollLeft = $window.scrollLeft();
+
+ if (settings.get('fixed')) {
+ offset.top -= scrollTop;
+ offset.left -= scrollLeft;
+ $box.css({position: 'fixed'});
+ } else {
+ top = scrollTop;
+ left = scrollLeft;
+ $box.css({position: 'absolute'});
+ }
+
+ // keeps the top and left positions within the browser's viewport.
+ if (settings.get('right') !== false) {
+ left += Math.max($window.width() - settings.w - loadedWidth - interfaceWidth - setSize(settings.get('right'), 'x'), 0);
+ } else if (settings.get('left') !== false) {
+ left += setSize(settings.get('left'), 'x');
+ } else {
+ left += Math.round(Math.max($window.width() - settings.w - loadedWidth - interfaceWidth, 0) / 2);
+ }
+
+ if (settings.get('bottom') !== false) {
+ top += Math.max(winheight() - settings.h - loadedHeight - interfaceHeight - setSize(settings.get('bottom'), 'y'), 0);
+ } else if (settings.get('top') !== false) {
+ top += setSize(settings.get('top'), 'y');
+ } else {
+ top += Math.round(Math.max(winheight() - settings.h - loadedHeight - interfaceHeight, 0) / 2);
+ }
+
+ $box.css({top: offset.top, left: offset.left, visibility:'visible'});
+
+ // this gives the wrapper plenty of breathing room so it's floated contents can move around smoothly,
+ // but it has to be shrank down around the size of div#colorbox when it's done. If not,
+ // it can invoke an obscure IE bug when using iframes.
+ $wrap[0].style.width = $wrap[0].style.height = "9999px";
+
+ function modalDimensions() {
+ $topBorder[0].style.width = $bottomBorder[0].style.width = $content[0].style.width = (parseInt($box[0].style.width,10) - interfaceWidth)+'px';
+ $content[0].style.height = $leftBorder[0].style.height = $rightBorder[0].style.height = (parseInt($box[0].style.height,10) - interfaceHeight)+'px';
+ }
+
+ css = {width: settings.w + loadedWidth + interfaceWidth, height: settings.h + loadedHeight + interfaceHeight, top: top, left: left};
+
+ // setting the speed to 0 if the content hasn't changed size or position
+ if (speed) {
+ var tempSpeed = 0;
+ $.each(css, function(i){
+ if (css[i] !== previousCSS[i]) {
+ tempSpeed = speed;
+ return;
+ }
+ });
+ speed = tempSpeed;
+ }
+
+ previousCSS = css;
+
+ if (!speed) {
+ $box.css(css);
+ }
+
+ $box.dequeue().animate(css, {
+ duration: speed || 0,
+ complete: function () {
+ modalDimensions();
+
+ active = false;
+
+ // shrink the wrapper down to exactly the size of colorbox to avoid a bug in IE's iframe implementation.
+ $wrap[0].style.width = (settings.w + loadedWidth + interfaceWidth) + "px";
+ $wrap[0].style.height = (settings.h + loadedHeight + interfaceHeight) + "px";
+
+ if (settings.get('reposition')) {
+ setTimeout(function () { // small delay before binding onresize due to an IE8 bug.
+ $window.bind('resize.' + prefix, publicMethod.position);
+ }, 1);
+ }
+
+ if ($.isFunction(loadedCallback)) {
+ loadedCallback();
+ }
+ },
+ step: modalDimensions
+ });
+ };
+
+ publicMethod.resize = function (options) {
+ var scrolltop;
+
+ if (open) {
+ options = options || {};
+
+ if (options.width) {
+ settings.w = setSize(options.width, 'x') - loadedWidth - interfaceWidth;
+ }
+
+ if (options.innerWidth) {
+ settings.w = setSize(options.innerWidth, 'x');
+ }
+
+ $loaded.css({width: settings.w});
+
+ if (options.height) {
+ settings.h = setSize(options.height, 'y') - loadedHeight - interfaceHeight;
+ }
+
+ if (options.innerHeight) {
+ settings.h = setSize(options.innerHeight, 'y');
+ }
+
+ if (!options.innerHeight && !options.height) {
+ scrolltop = $loaded.scrollTop();
+ $loaded.css({height: "auto"});
+ settings.h = $loaded.height();
+ }
+
+ $loaded.css({height: settings.h});
+
+ if(scrolltop) {
+ $loaded.scrollTop(scrolltop);
+ }
+
+ publicMethod.position(settings.get('transition') === "none" ? 0 : settings.get('speed'));
+ }
+ };
+
+ publicMethod.prep = function (object) {
+ if (!open) {
+ return;
+ }
+
+ var callback, speed = settings.get('transition') === "none" ? 0 : settings.get('speed');
+
+ $loaded.remove();
+
+ $loaded = $tag(div, 'LoadedContent').append(object);
+
+ function getWidth() {
+ if (typeof object.renderWidth !== "undefined") {
+ settings.w = object.renderWidth;
+ } else {
+ settings.w = settings.w || $loaded.width();
+ }
+ settings.w = settings.mw && settings.mw < settings.w ? settings.mw : settings.w;
+ return settings.w;
+ }
+ function getHeight() {
+ if (typeof object.renderHeight !== "undefined") {
+ settings.h = object.renderHeight;
+ } else {
+ settings.h = settings.h || $loaded.height();
+ }
+ settings.h = settings.mh && settings.mh < settings.h ? settings.mh : settings.h;
+ return settings.h;
+ }
+
+ $loaded.hide()
+ .appendTo($loadingBay.show())// content has to be appended to the DOM for accurate size calculations.
+ .css({width: getWidth(), overflow: settings.get('scrolling') ? 'auto' : 'hidden'})
+ .css({height: getHeight()})// sets the height independently from the width in case the new width influences the value of height.
+ .prependTo($content);
+
+ $loadingBay.hide();
+
+ // floating the IMG removes the bottom line-height and fixed a problem where IE miscalculates the width of the parent element as 100% of the document width.
+
+ $(photo).css({'float': 'none'});
+
+ setClass(settings.get('className'));
+
+ callback = function () {
+ var total = $related.length,
+ iframe,
+ complete;
+
+ if (!open) {
+ return;
+ }
+
+ function removeFilter() { // Needed for IE8 in versions of jQuery prior to 1.7.2
+ if ($.support.opacity === false) {
+ $box[0].style.removeAttribute('filter');
+ }
+ }
+
+ complete = function () {
+ clearTimeout(loadingTimer);
+ $loadingOverlay.hide();
+ trigger(event_complete);
+ settings.get('onComplete');
+ };
+
+
+ $title.html(settings.get('title')).show();
+ $loaded.show();
+
+ if (total > 1) { // handle grouping
+ if (typeof settings.get('current') === "string") {
+ $current.html(settings.get('current').replace('{current}', index + 1).replace('{total}', total)).show();
+ }
+
+ $next[(settings.get('loop') || index < total - 1) ? "show" : "hide"]().html(settings.get('next'));
+ $prev[(settings.get('loop') || index) ? "show" : "hide"]().html(settings.get('previous'));
+
+ slideshow();
+
+ // Preloads images within a rel group
+ if (settings.get('preloading')) {
+ $.each([getIndex(-1), getIndex(1)], function(){
+ var img,
+ i = $related[this],
+ settings = new Settings(i, $.data(i, colorbox)),
+ src = settings.get('href');
+
+ if (src && isImage(settings, src)) {
+ src = retinaUrl(settings, src);
+ img = document.createElement('img');
+ img.src = src;
+ }
+ });
+ }
+ } else {
+ $groupControls.hide();
+ }
+
+ if (settings.get('iframe')) {
+ iframe = document.createElement('iframe');
+
+ if ('frameBorder' in iframe) {
+ iframe.frameBorder = 0;
+ }
+
+ if ('allowTransparency' in iframe) {
+ iframe.allowTransparency = "true";
+ }
+
+ if (!settings.get('scrolling')) {
+ iframe.scrolling = "no";
+ }
+
+ $(iframe)
+ .attr({
+ src: settings.get('href'),
+ name: (new Date()).getTime(), // give the iframe a unique name to prevent caching
+ 'class': prefix + 'Iframe',
+ allowFullScreen : true // allow HTML5 video to go fullscreen
+ })
+ .one('load', complete)
+ .appendTo($loaded);
+
+ $events.one(event_purge, function () {
+ iframe.src = "//about:blank";
+ });
+
+ if (settings.get('fastIframe')) {
+ $(iframe).trigger('load');
+ }
+ } else {
+ complete();
+ }
+
+ if (settings.get('transition') === 'fade') {
+ $box.fadeTo(speed, 1, removeFilter);
+ } else {
+ removeFilter();
+ }
+ };
+
+ if (settings.get('transition') === 'fade') {
+ $box.fadeTo(speed, 0, function () {
+ publicMethod.position(0, callback);
+ });
+ } else {
+ publicMethod.position(speed, callback);
+ }
+ };
+
+ function load () {
+ var href, setResize, prep = publicMethod.prep, $inline, request = ++requests;
+
+ active = true;
+
+ photo = false;
+
+ trigger(event_purge);
+ trigger(event_load);
+ settings.get('onLoad');
+
+ settings.h = settings.get('height') ?
+ setSize(settings.get('height'), 'y') - loadedHeight - interfaceHeight :
+ settings.get('innerHeight') && setSize(settings.get('innerHeight'), 'y');
+
+ settings.w = settings.get('width') ?
+ setSize(settings.get('width'), 'x') - loadedWidth - interfaceWidth :
+ settings.get('innerWidth') && setSize(settings.get('innerWidth'), 'x');
+
+ // Sets the minimum dimensions for use in image scaling
+ settings.mw = settings.w;
+ settings.mh = settings.h;
+
+ // Re-evaluate the minimum width and height based on maxWidth and maxHeight values.
+ // If the width or height exceed the maxWidth or maxHeight, use the maximum values instead.
+ if (settings.get('maxWidth')) {
+ settings.mw = setSize(settings.get('maxWidth'), 'x') - loadedWidth - interfaceWidth;
+ settings.mw = settings.w && settings.w < settings.mw ? settings.w : settings.mw;
+ }
+ if (settings.get('maxHeight')) {
+ settings.mh = setSize(settings.get('maxHeight'), 'y') - loadedHeight - interfaceHeight;
+ settings.mh = settings.h && settings.h < settings.mh ? settings.h : settings.mh;
+ }
+
+ href = settings.get('href');
+
+ loadingTimer = setTimeout(function () {
+ $loadingOverlay.show();
+ }, 100);
+
+ if (settings.get('inline')) {
+ var $target = $(href);
+ // Inserts an empty placeholder where inline content is being pulled from.
+ // An event is bound to put inline content back when Colorbox closes or loads new content.
+ $inline = $('<div>').hide().insertBefore($target);
+
+ $events.one(event_purge, function () {
+ $inline.replaceWith($target);
+ });
+
+ prep($target);
+ } else if (settings.get('iframe')) {
+ // IFrame element won't be added to the DOM until it is ready to be displayed,
+ // to avoid problems with DOM-ready JS that might be trying to run in that iframe.
+ prep(" ");
+ } else if (settings.get('html')) {
+ prep(settings.get('html'));
+ } else if (isImage(settings, href)) {
+
+ href = retinaUrl(settings, href);
+
+ photo = new Image();
+
+ $(photo)
+ .addClass(prefix + 'Photo')
+ .bind('error',function () {
+ prep($tag(div, 'Error').html(settings.get('imgError')));
+ })
+ .one('load', function () {
+ if (request !== requests) {
+ return;
+ }
+
+ // A small pause because some browsers will occassionaly report a
+ // img.width and img.height of zero immediately after the img.onload fires
+ setTimeout(function(){
+ var percent;
+ var width, height;
+ var rotate = 0;
+ var mirror = false;
+ var translateX = false;
+ var translateY = false;
+ var transformation = "";
+
+ var orientation = settings.get('orientation');
+
+ switch (orientation) {
+ case 2:
+ mirror = true;
+ break;
+ case 3:
+ rotate = 180;
+ break;
+ case 4:
+ rotate = 180;
+ mirror = true;
+ break;
+ case 5:
+ rotate = 270;
+ mirror = true;
+ break;
+ case 6:
+ rotate = 90;
+ break;
+ case 7:
+ rotate = 90;
+ mirror = true;
+ break;
+ case 8:
+ rotate = 270;
+ break;
+ }
+
+ if (rotate%360 == 90) {
+ translateY = true;
+ }
+
+ if (rotate%360 == 180) {
+ translateY = true;
+ translateX = true;
+ }
+
+ if (rotate%360 == 270) {
+ translateX = true;
+ }
+
+ if (mirror) {
+ translateX = !translateX;
+ }
+
+ if (rotate%180 == 0) {
+ width = photo.width;
+ height = photo.height;
+ } else {
+ width = photo.height;
+ height = photo.width;
+ }
+ if (rotate != 0) {
+ transformation += "rotate("+rotate+"deg) ";
+ }
+ if (mirror) {
+ transformation +="scaleX(-1) ";
+ }
+ if (translateX) {
+ transformation += "translateX(-100%) ";
+ }
+ if (translateY) {
+ transformation += "translateY(-100%) ";
+ }
+ $(photo).css('transform-origin', '0 0');
+ $(photo).css('transform', transformation);
+
+ $.each(['alt', 'longdesc', 'aria-describedby'], function(i,val){
+ var attr = $(settings.el).attr(val) || $(settings.el).attr('data-'+val);
+ if (attr) {
+ photo.setAttribute(val, attr);
+ }
+ });
+
+ if (settings.get('retinaImage') && window.devicePixelRatio > 1) {
+ height = height / window.devicePixelRatio;
+ width = width / window.devicePixelRatio;
+ }
+
+ if (settings.get('scalePhotos')) {
+ setResize = function () {
+ height -= height * percent;
+ width -= width * percent;
+ };
+ if (settings.mw && width > settings.mw) {
+ percent = (width - settings.mw) / width;
+ setResize();
+ }
+ if (settings.mh && height > settings.mh) {
+ percent = (height - settings.mh) / height;
+ setResize();
+ }
+ }
+
+ if (settings.h) {
+ photo.style.marginTop = Math.max(settings.mh - height, 0) / 2 + 'px';
+ }
+
+ if ($related[1] && (settings.get('loop') || $related[index + 1])) {
+ photo.style.cursor = 'pointer';
+ photo.onclick = function () {
+ publicMethod.next();
+ };
+ }
+
+ photo.renderWidth = width;
+ photo.renderHeight = height;
+ if (rotate%180 == 0) {
+ photo.style.width = width + 'px';
+ photo.style.height = height + 'px';
+ } else {
+ photo.style.width = height + 'px';
+ photo.style.height = width + 'px';
+ }
+
+ prep(photo);
+ }, 1);
+ });
+
+ photo.src = href;
+
+ } else if (href) {
+ $loadingBay.load(href, settings.get('data'), function (data, status) {
+ if (request === requests) {
+ prep(status === 'error' ? $tag(div, 'Error').html(settings.get('xhrError')) : $(this).contents());
+ }
+ });
+ }
+ }
+
+ // Navigates to the next page/image in a set.
+ publicMethod.next = function () {
+ if (!active && $related[1] && (settings.get('loop') || $related[index + 1])) {
+ index = getIndex(1);
+ launch($related[index]);
+ }
+ };
+
+ publicMethod.prev = function () {
+ if (!active && $related[1] && (settings.get('loop') || index)) {
+ index = getIndex(-1);
+ launch($related[index]);
+ }
+ };
+
+ // Note: to use this within an iframe use the following format: parent.jQuery.colorbox.close();
+ publicMethod.close = function () {
+ if (open && !closing) {
+
+ closing = true;
+ open = false;
+ trigger(event_cleanup);
+ settings.get('onCleanup');
+ $window.unbind('.' + prefix);
+ $overlay.fadeTo(settings.get('fadeOut') || 0, 0);
+
+ $box.stop().fadeTo(settings.get('fadeOut') || 0, 0, function () {
+ $box.hide();
+ $overlay.hide();
+ trigger(event_purge);
+ $loaded.remove();
+
+ setTimeout(function () {
+ closing = false;
+ trigger(event_closed);
+ settings.get('onClosed');
+ }, 1);
+ });
+ }
+ };
+
+ // Removes changes Colorbox made to the document, but does not remove the plugin.
+ publicMethod.remove = function () {
+ if (!$box) { return; }
+
+ $box.stop();
+ $[colorbox].close();
+ $box.stop(false, true).remove();
+ $overlay.remove();
+ closing = false;
+ $box = null;
+ $('.' + boxElement)
+ .removeData(colorbox)
+ .removeClass(boxElement);
+
+ $(document).unbind('click.'+prefix).unbind('keydown.'+prefix);
+ };
+
+ // A method for fetching the current element Colorbox is referencing.
+ // returns a jQuery object.
+ publicMethod.element = function () {
+ return $(settings.el);
+ };
+
+ publicMethod.settings = defaults;
+
+}(jQuery, document, window));
diff --git a/public_html/data/js/vendor/jquery.lazyload.js b/public_html/data/js/vendor/jquery.lazyload.js
new file mode 100644
index 000000000..0b1b86e00
--- /dev/null
+++ b/public_html/data/js/vendor/jquery.lazyload.js
@@ -0,0 +1,242 @@
+/*
+ * Lazy Load - jQuery plugin for lazy loading images
+ *
+ * Copyright (c) 2007-2013 Mika Tuupola
+ *
+ * Licensed under the MIT license:
+ * http://www.opensource.org/licenses/mit-license.php
+ *
+ * Project home:
+ * http://www.appelsiini.net/projects/lazyload
+ *
+ * Version: 1.9.3
+ *
+ */
+
+(function($, window, document, undefined) {
+ var $window = $(window);
+
+ $.fn.lazyload = function(options) {
+ var elements = this;
+ var $container;
+ var settings = {
+ threshold : 0,
+ failure_limit : 0,
+ event : "scroll",
+ effect : "show",
+ container : window,
+ data_attribute : "original",
+ skip_invisible : true,
+ appear : null,
+ load : null,
+ placeholder : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC"
+ };
+
+ function update() {
+ var counter = 0;
+
+ elements.each(function() {
+ var $this = $(this);
+ if (settings.skip_invisible && !$this.is(":visible")) {
+ return;
+ }
+ if ($.abovethetop(this, settings) ||
+ $.leftofbegin(this, settings)) {
+ /* Nothing. */
+ } else if (!$.belowthefold(this, settings) &&
+ !$.rightoffold(this, settings)) {
+ $this.trigger("appear");
+ /* if we found an image we'll load, reset the counter */
+ counter = 0;
+ } else {
+ if (++counter > settings.failure_limit) {
+ return false;
+ }
+ }
+ });
+
+ }
+
+ if(options) {
+ /* Maintain BC for a couple of versions. */
+ if (undefined !== options.failurelimit) {
+ options.failure_limit = options.failurelimit;
+ delete options.failurelimit;
+ }
+ if (undefined !== options.effectspeed) {
+ options.effect_speed = options.effectspeed;
+ delete options.effectspeed;
+ }
+
+ $.extend(settings, options);
+ }
+
+ /* Cache container as jQuery as object. */
+ $container = (settings.container === undefined ||
+ settings.container === window) ? $window : $(settings.container);
+
+ /* Fire one scroll event per scroll. Not one scroll event per image. */
+ if (0 === settings.event.indexOf("scroll")) {
+ $container.bind(settings.event, function() {
+ return update();
+ });
+ }
+
+ this.each(function() {
+ var self = this;
+ var $self = $(self);
+
+ self.loaded = false;
+
+ /* If no src attribute given use data:uri. */
+ //if ($self.attr("src") === undefined || $self.attr("src") === false) {
+ //if ($self.is("img")) {
+ //$self.attr("src", settings.placeholder);
+ //}
+ //}
+
+ /* When appear is triggered load original image. */
+ $self.one("appear", function() {
+ if (!this.loaded) {
+ if (settings.appear) {
+ var elements_left = elements.length;
+ settings.appear.call(self, elements_left, settings);
+ }
+ $("<img />")
+ .bind("load", function() {
+
+ var original = $self.attr("data-" + settings.data_attribute);
+ $self.hide();
+ if ($self.is("img")) {
+ $self.attr("src", original);
+ } else {
+ $self.css("background-image", "url('" + original + "')");
+ }
+ $self[settings.effect](settings.effect_speed);
+
+ self.loaded = true;
+
+ /* Remove image from array so it is not looped next time. */
+ var temp = $.grep(elements, function(element) {
+ return !element.loaded;
+ });
+ elements = $(temp);
+
+ if (settings.load) {
+ var elements_left = elements.length;
+ settings.load.call(self, elements_left, settings);
+ }
+ })
+ .attr("src", $self.attr("data-" + settings.data_attribute));
+ }
+ });
+
+ /* When wanted event is triggered load original image */
+ /* by triggering appear. */
+ if (0 !== settings.event.indexOf("scroll")) {
+ $self.bind(settings.event, function() {
+ if (!self.loaded) {
+ $self.trigger("appear");
+ }
+ });
+ }
+ });
+
+ /* Check if something appears when window is resized. */
+ $window.bind("resize", function() {
+ update();
+ });
+
+ /* With IOS5 force loading images when navigating with back button. */
+ /* Non optimal workaround. */
+ if ((/(?:iphone|ipod|ipad).*os 5/gi).test(navigator.appVersion)) {
+ $window.bind("pageshow", function(event) {
+ if (event.originalEvent && event.originalEvent.persisted) {
+ elements.each(function() {
+ $(this).trigger("appear");
+ });
+ }
+ });
+ }
+
+ /* Force initial check if images should appear. */
+ $(document).ready(function() {
+ update();
+ });
+
+ return this;
+ };
+
+ /* Convenience methods in jQuery namespace. */
+ /* Use as $.belowthefold(element, {threshold : 100, container : window}) */
+
+ $.belowthefold = function(element, settings) {
+ var fold;
+
+ if (settings.container === undefined || settings.container === window) {
+ fold = (window.innerHeight ? window.innerHeight : $window.height()) + $window.scrollTop();
+ } else {
+ fold = $(settings.container).offset().top + $(settings.container).height();
+ }
+
+ return fold <= $(element).offset().top - settings.threshold;
+ };
+
+ $.rightoffold = function(element, settings) {
+ var fold;
+
+ if (settings.container === undefined || settings.container === window) {
+ fold = $window.width() + $window.scrollLeft();
+ } else {
+ fold = $(settings.container).offset().left + $(settings.container).width();
+ }
+
+ return fold <= $(element).offset().left - settings.threshold;
+ };
+
+ $.abovethetop = function(element, settings) {
+ var fold;
+
+ if (settings.container === undefined || settings.container === window) {
+ fold = $window.scrollTop();
+ } else {
+ fold = $(settings.container).offset().top;
+ }
+
+ return fold >= $(element).offset().top + settings.threshold + $(element).height();
+ };
+
+ $.leftofbegin = function(element, settings) {
+ var fold;
+
+ if (settings.container === undefined || settings.container === window) {
+ fold = $window.scrollLeft();
+ } else {
+ fold = $(settings.container).offset().left;
+ }
+
+ return fold >= $(element).offset().left + settings.threshold + $(element).width();
+ };
+
+ $.inviewport = function(element, settings) {
+ return !$.rightoffold(element, settings) && !$.leftofbegin(element, settings) &&
+ !$.belowthefold(element, settings) && !$.abovethetop(element, settings);
+ };
+
+ /* Custom selectors for your convenience. */
+ /* Use as $("img:below-the-fold").something() or */
+ /* $("img").filter(":below-the-fold").something() which is faster */
+
+ $.extend($.expr[":"], {
+ "below-the-fold" : function(a) { return $.belowthefold(a, {threshold : 0}); },
+ "above-the-top" : function(a) { return !$.belowthefold(a, {threshold : 0}); },
+ "right-of-screen": function(a) { return $.rightoffold(a, {threshold : 0}); },
+ "left-of-screen" : function(a) { return !$.rightoffold(a, {threshold : 0}); },
+ "in-viewport" : function(a) { return $.inviewport(a, {threshold : 0}); },
+ /* Maintain BC for couple of versions. */
+ "above-the-fold" : function(a) { return !$.belowthefold(a, {threshold : 0}); },
+ "right-of-fold" : function(a) { return $.rightoffold(a, {threshold : 0}); },
+ "left-of-fold" : function(a) { return !$.rightoffold(a, {threshold : 0}); }
+ });
+
+})(jQuery, window, document);
diff --git a/public_html/data/js/vendor/jquery.metadata.js b/public_html/data/js/vendor/jquery.metadata.js
new file mode 100644
index 000000000..eb98e80ad
--- /dev/null
+++ b/public_html/data/js/vendor/jquery.metadata.js
@@ -0,0 +1,120 @@
+/*
+ * Metadata - jQuery plugin for parsing metadata from elements
+ *
+ * Copyright (c) 2006 John Resig, Yehuda Katz, Jörn Zaefferer, Paul McLanahan
+ *
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ */
+
+/**
+ * Sets the type of metadata to use. Metadata is encoded in JSON, and each property
+ * in the JSON will become a property of the element itself.
+ *
+ * There are three supported types of metadata storage:
+ *
+ * attr: Inside an attribute. The name parameter indicates *which* attribute.
+ *
+ * class: Inside the class attribute, wrapped in curly braces: { }
+ *
+ * elem: Inside a child element (e.g. a script tag). The
+ * name parameter indicates *which* element.
+ *
+ * The metadata for an element is loaded the first time the element is accessed via jQuery.
+ *
+ * As a result, you can define the metadata type, use $(expr) to load the metadata into the elements
+ * matched by expr, then redefine the metadata type and run another $(expr) for other elements.
+ *
+ * @name $.metadata.setType
+ *
+ * @example <p id="one" class="some_class {item_id: 1, item_label: 'Label'}">This is a p</p>
+ * @before $.metadata.setType("class")
+ * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
+ * @desc Reads metadata from the class attribute
+ *
+ * @example <p id="one" class="some_class" data="{item_id: 1, item_label: 'Label'}">This is a p</p>
+ * @before $.metadata.setType("attr", "data")
+ * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
+ * @desc Reads metadata from a "data" attribute
+ *
+ * @example <p id="one" class="some_class"><script>{item_id: 1, item_label: 'Label'}</script>This is a p</p>
+ * @before $.metadata.setType("elem", "script")
+ * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
+ * @desc Reads metadata from a nested script element
+ *
+ * @param String type The encoding type
+ * @param String name The name of the attribute to be used to get metadata (optional)
+ * @cat Plugins/Metadata
+ * @descr Sets the type of encoding to be used when loading metadata for the first time
+ * @type undefined
+ * @see metadata()
+ */
+
+(function($) {
+
+$.extend({
+ metadata : {
+ defaults : {
+ type: 'class',
+ name: 'metadata',
+ cre: /({.*})/,
+ single: 'metadata'
+ },
+ setType: function( type, name ){
+ this.defaults.type = type;
+ this.defaults.name = name;
+ },
+ get: function( elem, opts ){
+ var settings = $.extend({},this.defaults,opts);
+ // check for empty string in single property
+ if ( !settings.single.length ) settings.single = 'metadata';
+
+ var data = $.data(elem, settings.single);
+ // returned cached data if it already exists
+ if ( data ) return data;
+
+ data = "{}";
+
+ if ( settings.type == "class" ) {
+ var m = settings.cre.exec( elem.className );
+ if ( m )
+ data = m[1];
+ } else if ( settings.type == "elem" ) {
+ if( !elem.getElementsByTagName )
+ return undefined;
+ var e = elem.getElementsByTagName(settings.name);
+ if ( e.length )
+ data = $.trim(e[0].innerHTML);
+ } else if ( elem.getAttribute != undefined ) {
+ var attr = elem.getAttribute( settings.name );
+ if ( attr )
+ data = attr;
+ }
+
+ if ( data.indexOf( '{' ) <0 )
+ data = "{" + data + "}";
+
+ data = eval("(" + data + ")");
+
+ $.data( elem, settings.single, data );
+ return data;
+ }
+ }
+});
+
+/**
+ * Returns the metadata object for the first member of the jQuery object.
+ *
+ * @name metadata
+ * @descr Returns element's metadata object
+ * @param Object opts An object contianing settings to override the defaults
+ * @type jQuery
+ * @cat Plugins/Metadata
+ */
+$.fn.metadata = function( opts ){
+ return $.metadata.get( this[0], opts );
+};
+
+})(jQuery); \ No newline at end of file
diff --git a/public_html/data/js/vendor/jquery.tablesorter.min.js b/public_html/data/js/vendor/jquery.tablesorter.min.js
new file mode 100644
index 000000000..b8605df1e
--- /dev/null
+++ b/public_html/data/js/vendor/jquery.tablesorter.min.js
@@ -0,0 +1,4 @@
+
+(function($){$.extend({tablesorter:new
+function(){var parsers=[],widgets=[];this.defaults={cssHeader:"header",cssAsc:"headerSortUp",cssDesc:"headerSortDown",cssChildRow:"expand-child",sortInitialOrder:"asc",sortMultiSortKey:"shiftKey",sortForce:null,sortAppend:null,sortLocaleCompare:true,textExtraction:"simple",parsers:{},widgets:[],widgetZebra:{css:["even","odd"]},headers:{},widthFixed:false,cancelSelection:true,sortList:[],headerList:[],dateFormat:"us",decimal:'/\.|\,/g',onRenderHeader:null,selectorHeaders:'thead th',debug:false};function benchmark(s,d){log(s+","+(new Date().getTime()-d.getTime())+"ms");}this.benchmark=benchmark;function log(s){if(typeof console!="undefined"&&typeof console.debug!="undefined"){console.log(s);}else{alert(s);}}function buildParserCache(table,$headers){if(table.config.debug){var parsersDebug="";}if(table.tBodies.length==0)return;var rows=table.tBodies[0].rows;if(rows[0]){var list=[],cells=rows[0].cells,l=cells.length;for(var i=0;i<l;i++){var p=false;if($.metadata&&($($headers[i]).metadata()&&$($headers[i]).metadata().sorter)){p=getParserById($($headers[i]).metadata().sorter);}else if((table.config.headers[i]&&table.config.headers[i].sorter)){p=getParserById(table.config.headers[i].sorter);}if(!p){p=detectParserForColumn(table,rows,-1,i);}if(table.config.debug){parsersDebug+="column:"+i+" parser:"+p.id+"\n";}list.push(p);}}if(table.config.debug){log(parsersDebug);}return list;};function detectParserForColumn(table,rows,rowIndex,cellIndex){var l=parsers.length,node=false,nodeValue=false,keepLooking=true;while(nodeValue==''&&keepLooking){rowIndex++;if(rows[rowIndex]){node=getNodeFromRowAndCellIndex(rows,rowIndex,cellIndex);nodeValue=trimAndGetNodeText(table.config,node);if(table.config.debug){log('Checking if value was empty on row:'+rowIndex);}}else{keepLooking=false;}}for(var i=1;i<l;i++){if(parsers[i].is(nodeValue,table,node)){return parsers[i];}}return parsers[0];}function getNodeFromRowAndCellIndex(rows,rowIndex,cellIndex){return rows[rowIndex].cells[cellIndex];}function trimAndGetNodeText(config,node){return $.trim(getElementText(config,node));}function getParserById(name){var l=parsers.length;for(var i=0;i<l;i++){if(parsers[i].id.toLowerCase()==name.toLowerCase()){return parsers[i];}}return false;}function buildCache(table){if(table.config.debug){var cacheTime=new Date();}var totalRows=(table.tBodies[0]&&table.tBodies[0].rows.length)||0,totalCells=(table.tBodies[0].rows[0]&&table.tBodies[0].rows[0].cells.length)||0,parsers=table.config.parsers,cache={row:[],normalized:[]};for(var i=0;i<totalRows;++i){var c=$(table.tBodies[0].rows[i]),cols=[];if(c.hasClass(table.config.cssChildRow)){cache.row[cache.row.length-1]=cache.row[cache.row.length-1].add(c);continue;}cache.row.push(c);for(var j=0;j<totalCells;++j){cols.push(parsers[j].format(getElementText(table.config,c[0].cells[j]),table,c[0].cells[j]));}cols.push(cache.normalized.length);cache.normalized.push(cols);cols=null;};if(table.config.debug){benchmark("Building cache for "+totalRows+" rows:",cacheTime);}return cache;};function getElementText(config,node){var text="";if(!node)return"";if(!config.supportsTextContent)config.supportsTextContent=node.textContent||false;if(config.textExtraction=="simple"){if(config.supportsTextContent){text=node.textContent;}else{if(node.childNodes[0]&&node.childNodes[0].hasChildNodes()){text=node.childNodes[0].innerHTML;}else{text=node.innerHTML;}}}else{if(typeof(config.textExtraction)=="function"){text=config.textExtraction(node);}else{text=$(node).text();}}return text;}function appendToTable(table,cache){if(table.config.debug){var appendTime=new Date()}var c=cache,r=c.row,n=c.normalized,totalRows=n.length,checkCell=(n[0].length-1),tableBody=$(table.tBodies[0]),rows=[];for(var i=0;i<totalRows;i++){var pos=n[i][checkCell];rows.push(r[pos]);if(!table.config.appender){var l=r[pos].length;for(var j=0;j<l;j++){tableBody[0].appendChild(r[pos][j]);}}}if(table.config.appender){table.config.appender(table,rows);}rows=null;if(table.config.debug){benchmark("Rebuilt table:",appendTime);}applyWidget(table);setTimeout(function(){$(table).trigger("sortEnd");},0);};function buildHeaders(table){if(table.config.debug){var time=new Date();}var meta=($.metadata)?true:false;var header_index=computeTableHeaderCellIndexes(table);$tableHeaders=$(table.config.selectorHeaders,table).each(function(index){this.column=header_index[this.parentNode.rowIndex+"-"+this.cellIndex];this.order=formatSortingOrder(table.config.sortInitialOrder);this.count=this.order;if(checkHeaderMetadata(this)||checkHeaderOptions(table,index))this.sortDisabled=true;if(checkHeaderOptionsSortingLocked(table,index))this.order=this.lockedOrder=checkHeaderOptionsSortingLocked(table,index);if(!this.sortDisabled){var $th=$(this).addClass(table.config.cssHeader);if(table.config.onRenderHeader)table.config.onRenderHeader.apply($th);}table.config.headerList[index]=this;});if(table.config.debug){benchmark("Built headers:",time);log($tableHeaders);}return $tableHeaders;};function computeTableHeaderCellIndexes(t){var matrix=[];var lookup={};var thead=t.getElementsByTagName('THEAD')[0];var trs=thead.getElementsByTagName('TR');for(var i=0;i<trs.length;i++){var cells=trs[i].cells;for(var j=0;j<cells.length;j++){var c=cells[j];var rowIndex=c.parentNode.rowIndex;var cellId=rowIndex+"-"+c.cellIndex;var rowSpan=c.rowSpan||1;var colSpan=c.colSpan||1
+var firstAvailCol;if(typeof(matrix[rowIndex])=="undefined"){matrix[rowIndex]=[];}for(var k=0;k<matrix[rowIndex].length+1;k++){if(typeof(matrix[rowIndex][k])=="undefined"){firstAvailCol=k;break;}}lookup[cellId]=firstAvailCol;for(var k=rowIndex;k<rowIndex+rowSpan;k++){if(typeof(matrix[k])=="undefined"){matrix[k]=[];}var matrixrow=matrix[k];for(var l=firstAvailCol;l<firstAvailCol+colSpan;l++){matrixrow[l]="x";}}}}return lookup;}function checkCellColSpan(table,rows,row){var arr=[],r=table.tHead.rows,c=r[row].cells;for(var i=0;i<c.length;i++){var cell=c[i];if(cell.colSpan>1){arr=arr.concat(checkCellColSpan(table,headerArr,row++));}else{if(table.tHead.length==1||(cell.rowSpan>1||!r[row+1])){arr.push(cell);}}}return arr;};function checkHeaderMetadata(cell){if(($.metadata)&&($(cell).metadata().sorter===false)){return true;};return false;}function checkHeaderOptions(table,i){if((table.config.headers[i])&&(table.config.headers[i].sorter===false)){return true;};return false;}function checkHeaderOptionsSortingLocked(table,i){if((table.config.headers[i])&&(table.config.headers[i].lockedOrder))return table.config.headers[i].lockedOrder;return false;}function applyWidget(table){var c=table.config.widgets;var l=c.length;for(var i=0;i<l;i++){getWidgetById(c[i]).format(table);}}function getWidgetById(name){var l=widgets.length;for(var i=0;i<l;i++){if(widgets[i].id.toLowerCase()==name.toLowerCase()){return widgets[i];}}};function formatSortingOrder(v){if(typeof(v)!="Number"){return(v.toLowerCase()=="desc")?1:0;}else{return(v==1)?1:0;}}function isValueInArray(v,a){var l=a.length;for(var i=0;i<l;i++){if(a[i][0]==v){return true;}}return false;}function setHeadersCss(table,$headers,list,css){$headers.removeClass(css[0]).removeClass(css[1]);var h=[];$headers.each(function(offset){if(!this.sortDisabled){h[this.column]=$(this);}});var l=list.length;for(var i=0;i<l;i++){h[list[i][0]].addClass(css[list[i][1]]);}}function fixColumnWidth(table,$headers){var c=table.config;if(c.widthFixed){var colgroup=$('<colgroup>');$("tr:first td",table.tBodies[0]).each(function(){colgroup.append($('<col>').css('width',$(this).width()));});$(table).prepend(colgroup);};}function updateHeaderSortCount(table,sortList){var c=table.config,l=sortList.length;for(var i=0;i<l;i++){var s=sortList[i],o=c.headerList[s[0]];o.count=s[1];o.count++;}}function multisort(table,sortList,cache){if(table.config.debug){var sortTime=new Date();}var dynamicExp="var sortWrapper = function(a,b) {",l=sortList.length;for(var i=0;i<l;i++){var c=sortList[i][0];var order=sortList[i][1];var s=(table.config.parsers[c].type=="text")?((order==0)?makeSortFunction("text","asc",c):makeSortFunction("text","desc",c)):((order==0)?makeSortFunction("numeric","asc",c):makeSortFunction("numeric","desc",c));var e="e"+i;dynamicExp+="var "+e+" = "+s;dynamicExp+="if("+e+") { return "+e+"; } ";dynamicExp+="else { ";}var orgOrderCol=cache.normalized[0].length-1;dynamicExp+="return a["+orgOrderCol+"]-b["+orgOrderCol+"];";for(var i=0;i<l;i++){dynamicExp+="}; ";}dynamicExp+="return 0; ";dynamicExp+="}; ";if(table.config.debug){benchmark("Evaling expression:"+dynamicExp,new Date());}eval(dynamicExp);cache.normalized.sort(sortWrapper);if(table.config.debug){benchmark("Sorting on "+sortList.toString()+" and dir "+order+" time:",sortTime);}return cache;};function makeSortFunction(type,direction,index){var a="a["+index+"]",b="b["+index+"]";if(type=='text'&&direction=='asc'){return"("+a+" == "+b+" ? 0 : ("+a+" === null ? Number.POSITIVE_INFINITY : ("+b+" === null ? Number.NEGATIVE_INFINITY : ("+a+" < "+b+") ? -1 : 1 )));";}else if(type=='text'&&direction=='desc'){return"("+a+" == "+b+" ? 0 : ("+a+" === null ? Number.POSITIVE_INFINITY : ("+b+" === null ? Number.NEGATIVE_INFINITY : ("+b+" < "+a+") ? -1 : 1 )));";}else if(type=='numeric'&&direction=='asc'){return"("+a+" === null && "+b+" === null) ? 0 :("+a+" === null ? Number.POSITIVE_INFINITY : ("+b+" === null ? Number.NEGATIVE_INFINITY : "+a+" - "+b+"));";}else if(type=='numeric'&&direction=='desc'){return"("+a+" === null && "+b+" === null) ? 0 :("+a+" === null ? Number.POSITIVE_INFINITY : ("+b+" === null ? Number.NEGATIVE_INFINITY : "+b+" - "+a+"));";}};function makeSortText(i){return"((a["+i+"] < b["+i+"]) ? -1 : ((a["+i+"] > b["+i+"]) ? 1 : 0));";};function makeSortTextDesc(i){return"((b["+i+"] < a["+i+"]) ? -1 : ((b["+i+"] > a["+i+"]) ? 1 : 0));";};function makeSortNumeric(i){return"a["+i+"]-b["+i+"];";};function makeSortNumericDesc(i){return"b["+i+"]-a["+i+"];";};function sortText(a,b){if(table.config.sortLocaleCompare)return a.localeCompare(b);return((a<b)?-1:((a>b)?1:0));};function sortTextDesc(a,b){if(table.config.sortLocaleCompare)return b.localeCompare(a);return((b<a)?-1:((b>a)?1:0));};function sortNumeric(a,b){return a-b;};function sortNumericDesc(a,b){return b-a;};function getCachedSortType(parsers,i){return parsers[i].type;};this.construct=function(settings){return this.each(function(){if(!this.tHead||!this.tBodies)return;var $this,$document,$headers,cache,config,shiftDown=0,sortOrder;this.config={};config=$.extend(this.config,$.tablesorter.defaults,settings);$this=$(this);$.data(this,"tablesorter",config);$headers=buildHeaders(this);this.config.parsers=buildParserCache(this,$headers);cache=buildCache(this);var sortCSS=[config.cssDesc,config.cssAsc];fixColumnWidth(this);$headers.click(function(e){var totalRows=($this[0].tBodies[0]&&$this[0].tBodies[0].rows.length)||0;if(!this.sortDisabled&&totalRows>0){$this.trigger("sortStart");var $cell=$(this);var i=this.column;this.order=this.count++%2;if(this.lockedOrder)this.order=this.lockedOrder;if(!e[config.sortMultiSortKey]){config.sortList=[];if(config.sortForce!=null){var a=config.sortForce;for(var j=0;j<a.length;j++){if(a[j][0]!=i){config.sortList.push(a[j]);}}}config.sortList.push([i,this.order]);}else{if(isValueInArray(i,config.sortList)){for(var j=0;j<config.sortList.length;j++){var s=config.sortList[j],o=config.headerList[s[0]];if(s[0]==i){o.count=s[1];o.count++;s[1]=o.count%2;}}}else{config.sortList.push([i,this.order]);}};setTimeout(function(){setHeadersCss($this[0],$headers,config.sortList,sortCSS);appendToTable($this[0],multisort($this[0],config.sortList,cache));},1);return false;}}).mousedown(function(){if(config.cancelSelection){this.onselectstart=function(){return false};return false;}});$this.bind("update",function(){var me=this;setTimeout(function(){me.config.parsers=buildParserCache(me,$headers);cache=buildCache(me);},1);}).bind("updateCell",function(e,cell){var config=this.config;var pos=[(cell.parentNode.rowIndex-1),cell.cellIndex];cache.normalized[pos[0]][pos[1]]=config.parsers[pos[1]].format(getElementText(config,cell),cell);}).bind("sorton",function(e,list){$(this).trigger("sortStart");config.sortList=list;var sortList=config.sortList;updateHeaderSortCount(this,sortList);setHeadersCss(this,$headers,sortList,sortCSS);appendToTable(this,multisort(this,sortList,cache));}).bind("appendCache",function(){appendToTable(this,cache);}).bind("applyWidgetId",function(e,id){getWidgetById(id).format(this);}).bind("applyWidgets",function(){applyWidget(this);});if($.metadata&&($(this).metadata()&&$(this).metadata().sortlist)){config.sortList=$(this).metadata().sortlist;}if(config.sortList.length>0){$this.trigger("sorton",[config.sortList]);}applyWidget(this);});};this.addParser=function(parser){var l=parsers.length,a=true;for(var i=0;i<l;i++){if(parsers[i].id.toLowerCase()==parser.id.toLowerCase()){a=false;}}if(a){parsers.push(parser);};};this.addWidget=function(widget){widgets.push(widget);};this.formatFloat=function(s){var i=parseFloat(s);return(isNaN(i))?0:i;};this.formatInt=function(s){var i=parseInt(s);return(isNaN(i))?0:i;};this.isDigit=function(s,config){return/^[-+]?\d*$/.test($.trim(s.replace(/[,.']/g,'')));};this.clearTableBody=function(table){if($.browser.msie){function empty(){while(this.firstChild)this.removeChild(this.firstChild);}empty.apply(table.tBodies[0]);}else{table.tBodies[0].innerHTML="";}};}});$.fn.extend({tablesorter:$.tablesorter.construct});var ts=$.tablesorter;ts.addParser({id:"text",is:function(s){return true;},format:function(s){return $.trim(s.toLocaleLowerCase());},type:"text"});ts.addParser({id:"digit",is:function(s,table){var c=table.config;return $.tablesorter.isDigit(s,c);},format:function(s){return $.tablesorter.formatFloat(s);},type:"numeric"});ts.addParser({id:"currency",is:function(s){return/^[£$€?.]/.test(s);},format:function(s){return $.tablesorter.formatFloat(s.replace(new RegExp(/[£$€]/g),""));},type:"numeric"});ts.addParser({id:"ipAddress",is:function(s){return/^\d{2,3}[\.]\d{2,3}[\.]\d{2,3}[\.]\d{2,3}$/.test(s);},format:function(s){var a=s.split("."),r="",l=a.length;for(var i=0;i<l;i++){var item=a[i];if(item.length==2){r+="0"+item;}else{r+=item;}}return $.tablesorter.formatFloat(r);},type:"numeric"});ts.addParser({id:"url",is:function(s){return/^(https?|ftp|file):\/\/$/.test(s);},format:function(s){return jQuery.trim(s.replace(new RegExp(/(https?|ftp|file):\/\//),''));},type:"text"});ts.addParser({id:"isoDate",is:function(s){return/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(s);},format:function(s){return $.tablesorter.formatFloat((s!="")?new Date(s.replace(new RegExp(/-/g),"/")).getTime():"0");},type:"numeric"});ts.addParser({id:"percent",is:function(s){return/\%$/.test($.trim(s));},format:function(s){return $.tablesorter.formatFloat(s.replace(new RegExp(/%/g),""));},type:"numeric"});ts.addParser({id:"usLongDate",is:function(s){return s.match(new RegExp(/^[A-Za-z]{3,10}\.? [0-9]{1,2}, ([0-9]{4}|'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(AM|PM)))$/));},format:function(s){return $.tablesorter.formatFloat(new Date(s).getTime());},type:"numeric"});ts.addParser({id:"shortDate",is:function(s){return/\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}/.test(s);},format:function(s,table){var c=table.config;s=s.replace(/\-/g,"/");if(c.dateFormat=="us"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$1/$2");}else if(c.dateFormat=="uk"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$2/$1");}else if(c.dateFormat=="dd/mm/yy"||c.dateFormat=="dd-mm-yy"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/,"$1/$2/$3");}return $.tablesorter.formatFloat(new Date(s).getTime());},type:"numeric"});ts.addParser({id:"time",is:function(s){return/^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/.test(s);},format:function(s){return $.tablesorter.formatFloat(new Date("2000/01/01 "+s).getTime());},type:"numeric"});ts.addParser({id:"metadata",is:function(s){return false;},format:function(s,table,cell){var c=table.config,p=(!c.parserMetadataName)?'sortValue':c.parserMetadataName;return $(cell).metadata()[p];},type:"numeric"});ts.addWidget({id:"zebra",format:function(table){if(table.config.debug){var time=new Date();}var $tr,row=-1,odd;$("tr:visible",table.tBodies[0]).each(function(i){$tr=$(this);if(!$tr.hasClass(table.config.cssChildRow))row++;odd=(row%2==0);$tr.removeClass(table.config.widgetZebra.css[odd?0:1]).addClass(table.config.widgetZebra.css[odd?1:0])});if(table.config.debug){$.tablesorter.benchmark("Applying Zebra widget",time);}}});})(jQuery); \ No newline at end of file
diff --git a/public_html/data/js/vendor/jquery.wheelzoom.js b/public_html/data/js/vendor/jquery.wheelzoom.js
new file mode 100644
index 000000000..85d75e56f
--- /dev/null
+++ b/public_html/data/js/vendor/jquery.wheelzoom.js
@@ -0,0 +1,162 @@
+/*!
+ Wheelzoom 2.0.1
+ license: MIT
+ http://www.jacklmoore.com/wheelzoom
+*/
+(function($){
+ var defaults = {
+ zoom: 0.10
+ };
+ var wheel;
+
+ function setSrcToBackground(img) {
+ var transparentPNG = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACklEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==";
+
+ // Explicitly set the size to the current dimensions,
+ // as the src is about to be changed to a 1x1 transparent png.
+ img.width = img.width;
+ img.height = img.height;
+
+ img.style.backgroundImage = "url('"+img.src+"')";
+ img.style.backgroundRepeat = 'no-repeat';
+ img.src = transparentPNG;
+ }
+
+ if ( document.onmousewheel !== undefined ) { // Webkit/Opera/IE
+ wheel = 'onmousewheel';
+ }
+ else if ( document.onwheel !== undefined) { // FireFox 17+
+ wheel = 'onwheel';
+ }
+
+ $.fn.wheelzoom = function(options){
+ var settings = $.extend({}, defaults, options);
+
+ if (!this[0] || !wheel || !('backgroundSize' in this[0].style)) { // do nothing in IE8 and lower
+ return this;
+ }
+
+ return this.each(function(){
+ var img = this,
+ $img = $(img);
+
+ function loaded() {
+ var width = $img.width(),
+ height = $img.height(),
+ bgWidth = width,
+ bgHeight = height,
+ bgPosX = 0,
+ bgPosY = 0;
+
+ function reset() {
+ bgWidth = width;
+ bgHeight = height;
+ bgPosX = bgPosY = 0;
+ updateBgStyle();
+ }
+
+ function updateBgStyle() {
+ if (bgPosX > 0) {
+ bgPosX = 0;
+ } else if (bgPosX < width - bgWidth) {
+ bgPosX = width - bgWidth;
+ }
+
+ if (bgPosY > 0) {
+ bgPosY = 0;
+ } else if (bgPosY < height - bgHeight) {
+ bgPosY = height - bgHeight;
+ }
+
+ img.style.backgroundSize = bgWidth+'px '+bgHeight+'px';
+ img.style.backgroundPosition = bgPosX+'px '+bgPosY+'px';
+ }
+
+ setSrcToBackground(img);
+
+ $img.css({
+ backgroundSize: width+'px '+height+'px',
+ backgroundPosition: '0 0'
+ }).bind('wheelzoom.reset', reset);
+
+ img[wheel] = function (e) {
+ var deltaY = 0;
+
+ e.preventDefault();
+
+ if (e.deltaY) { // FireFox 17+ (IE9+, Chrome 31+?)
+ deltaY = e.deltaY;
+ } else if (e.wheelDelta) {
+ deltaY = -e.wheelDelta;
+ }
+
+ // As far as I know, there is no good cross-browser way to get the cursor position relative to the event target.
+ // We have to calculate the target element's position relative to the document, and subtrack that from the
+ // cursor's position relative to the document.
+ var offsetParent = $img.offset();
+ var offsetX = e.pageX - offsetParent.left;
+ var offsetY = e.pageY - offsetParent.top;
+
+ // Record the offset between the bg edge and cursor:
+ var bgCursorX = offsetX - bgPosX;
+ var bgCursorY = offsetY - bgPosY;
+
+ // Use the previous offset to get the percent offset between the bg edge and cursor:
+ var bgRatioX = bgCursorX/bgWidth;
+ var bgRatioY = bgCursorY/bgHeight;
+
+ // Update the bg size:
+ if (deltaY < 0) {
+ bgWidth += bgWidth*settings.zoom;
+ bgHeight += bgHeight*settings.zoom;
+ } else {
+ bgWidth -= bgWidth*settings.zoom;
+ bgHeight -= bgHeight*settings.zoom;
+ }
+
+ // Take the percent offset and apply it to the new size:
+ bgPosX = offsetX - (bgWidth * bgRatioX);
+ bgPosY = offsetY - (bgHeight * bgRatioY);
+
+ // Prevent zooming out beyond the starting size
+ if (bgWidth <= width || bgHeight <= height) {
+ reset();
+ } else {
+ updateBgStyle();
+ }
+ };
+
+ // Make the background draggable
+ img.onmousedown = function(e){
+ var last = e;
+
+ e.preventDefault();
+
+ function drag(e) {
+ e.preventDefault();
+ bgPosX += (e.pageX - last.pageX);
+ bgPosY += (e.pageY - last.pageY);
+ last = e;
+ updateBgStyle();
+ }
+
+ $(document)
+ .on('mousemove', drag)
+ .one('mouseup', function () {
+ $(document).unbind('mousemove', drag);
+ });
+ };
+ }
+
+ if (img.complete) {
+ loaded();
+ } else {
+ $img.one('load', loaded);
+ }
+
+ });
+ };
+
+ $.fn.wheelzoom.defaults = defaults;
+
+}(window.jQuery));
diff --git a/public_html/data/js/vendor/require.js b/public_html/data/js/vendor/require.js
new file mode 100644
index 000000000..2205c616a
--- /dev/null
+++ b/public_html/data/js/vendor/require.js
@@ -0,0 +1,36 @@
+/*
+ RequireJS 2.1.17 Copyright (c) 2010-2015, The Dojo Foundation All Rights Reserved.
+ Available via the MIT or new BSD license.
+ see: http://github.com/jrburke/requirejs for details
+*/
+var requirejs,require,define;
+(function(ba){function G(b){return"[object Function]"===K.call(b)}function H(b){return"[object Array]"===K.call(b)}function v(b,c){if(b){var d;for(d=0;d<b.length&&(!b[d]||!c(b[d],d,b));d+=1);}}function T(b,c){if(b){var d;for(d=b.length-1;-1<d&&(!b[d]||!c(b[d],d,b));d-=1);}}function t(b,c){return fa.call(b,c)}function m(b,c){return t(b,c)&&b[c]}function B(b,c){for(var d in b)if(t(b,d)&&c(b[d],d))break}function U(b,c,d,e){c&&B(c,function(c,g){if(d||!t(b,g))e&&"object"===typeof c&&c&&!H(c)&&!G(c)&&!(c instanceof
+RegExp)?(b[g]||(b[g]={}),U(b[g],c,d,e)):b[g]=c});return b}function u(b,c){return function(){return c.apply(b,arguments)}}function ca(b){throw b;}function da(b){if(!b)return b;var c=ba;v(b.split("."),function(b){c=c[b]});return c}function C(b,c,d,e){c=Error(c+"\nhttp://requirejs.org/docs/errors.html#"+b);c.requireType=b;c.requireModules=e;d&&(c.originalError=d);return c}function ga(b){function c(a,k,b){var f,l,c,d,e,g,i,p,k=k&&k.split("/"),h=j.map,n=h&&h["*"];if(a){a=a.split("/");l=a.length-1;j.nodeIdCompat&&
+Q.test(a[l])&&(a[l]=a[l].replace(Q,""));"."===a[0].charAt(0)&&k&&(l=k.slice(0,k.length-1),a=l.concat(a));l=a;for(c=0;c<l.length;c++)if(d=l[c],"."===d)l.splice(c,1),c-=1;else if(".."===d&&!(0===c||1===c&&".."===l[2]||".."===l[c-1])&&0<c)l.splice(c-1,2),c-=2;a=a.join("/")}if(b&&h&&(k||n)){l=a.split("/");c=l.length;a:for(;0<c;c-=1){e=l.slice(0,c).join("/");if(k)for(d=k.length;0<d;d-=1)if(b=m(h,k.slice(0,d).join("/")))if(b=m(b,e)){f=b;g=c;break a}!i&&(n&&m(n,e))&&(i=m(n,e),p=c)}!f&&i&&(f=i,g=p);f&&(l.splice(0,
+g,f),a=l.join("/"))}return(f=m(j.pkgs,a))?f:a}function d(a){z&&v(document.getElementsByTagName("script"),function(k){if(k.getAttribute("data-requiremodule")===a&&k.getAttribute("data-requirecontext")===i.contextName)return k.parentNode.removeChild(k),!0})}function e(a){var k=m(j.paths,a);if(k&&H(k)&&1<k.length)return k.shift(),i.require.undef(a),i.makeRequire(null,{skipMap:!0})([a]),!0}function n(a){var k,c=a?a.indexOf("!"):-1;-1<c&&(k=a.substring(0,c),a=a.substring(c+1,a.length));return[k,a]}function p(a,
+k,b,f){var l,d,e=null,g=k?k.name:null,j=a,p=!0,h="";a||(p=!1,a="_@r"+(K+=1));a=n(a);e=a[0];a=a[1];e&&(e=c(e,g,f),d=m(r,e));a&&(e?h=d&&d.normalize?d.normalize(a,function(a){return c(a,g,f)}):-1===a.indexOf("!")?c(a,g,f):a:(h=c(a,g,f),a=n(h),e=a[0],h=a[1],b=!0,l=i.nameToUrl(h)));b=e&&!d&&!b?"_unnormalized"+(O+=1):"";return{prefix:e,name:h,parentMap:k,unnormalized:!!b,url:l,originalName:j,isDefine:p,id:(e?e+"!"+h:h)+b}}function s(a){var k=a.id,b=m(h,k);b||(b=h[k]=new i.Module(a));return b}function q(a,
+k,b){var f=a.id,c=m(h,f);if(t(r,f)&&(!c||c.defineEmitComplete))"defined"===k&&b(r[f]);else if(c=s(a),c.error&&"error"===k)b(c.error);else c.on(k,b)}function w(a,b){var c=a.requireModules,f=!1;if(b)b(a);else if(v(c,function(b){if(b=m(h,b))b.error=a,b.events.error&&(f=!0,b.emit("error",a))}),!f)g.onError(a)}function x(){R.length&&(ha.apply(A,[A.length,0].concat(R)),R=[])}function y(a){delete h[a];delete V[a]}function F(a,b,c){var f=a.map.id;a.error?a.emit("error",a.error):(b[f]=!0,v(a.depMaps,function(f,
+d){var e=f.id,g=m(h,e);g&&(!a.depMatched[d]&&!c[e])&&(m(b,e)?(a.defineDep(d,r[e]),a.check()):F(g,b,c))}),c[f]=!0)}function D(){var a,b,c=(a=1E3*j.waitSeconds)&&i.startTime+a<(new Date).getTime(),f=[],l=[],g=!1,h=!0;if(!W){W=!0;B(V,function(a){var i=a.map,j=i.id;if(a.enabled&&(i.isDefine||l.push(a),!a.error))if(!a.inited&&c)e(j)?g=b=!0:(f.push(j),d(j));else if(!a.inited&&(a.fetched&&i.isDefine)&&(g=!0,!i.prefix))return h=!1});if(c&&f.length)return a=C("timeout","Load timeout for modules: "+f,null,
+f),a.contextName=i.contextName,w(a);h&&v(l,function(a){F(a,{},{})});if((!c||b)&&g)if((z||ea)&&!X)X=setTimeout(function(){X=0;D()},50);W=!1}}function E(a){t(r,a[0])||s(p(a[0],null,!0)).init(a[1],a[2])}function I(a){var a=a.currentTarget||a.srcElement,b=i.onScriptLoad;a.detachEvent&&!Y?a.detachEvent("onreadystatechange",b):a.removeEventListener("load",b,!1);b=i.onScriptError;(!a.detachEvent||Y)&&a.removeEventListener("error",b,!1);return{node:a,id:a&&a.getAttribute("data-requiremodule")}}function J(){var a;
+for(x();A.length;){a=A.shift();if(null===a[0])return w(C("mismatch","Mismatched anonymous define() module: "+a[a.length-1]));E(a)}}var W,Z,i,L,X,j={waitSeconds:7,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},h={},V={},$={},A=[],r={},S={},aa={},K=1,O=1;L={require:function(a){return a.require?a.require:a.require=i.makeRequire(a.map)},exports:function(a){a.usingExports=!0;if(a.map.isDefine)return a.exports?r[a.map.id]=a.exports:a.exports=r[a.map.id]={}},module:function(a){return a.module?
+a.module:a.module={id:a.map.id,uri:a.map.url,config:function(){return m(j.config,a.map.id)||{}},exports:a.exports||(a.exports={})}}};Z=function(a){this.events=m($,a.id)||{};this.map=a;this.shim=m(j.shim,a.id);this.depExports=[];this.depMaps=[];this.depMatched=[];this.pluginMaps={};this.depCount=0};Z.prototype={init:function(a,b,c,f){f=f||{};if(!this.inited){this.factory=b;if(c)this.on("error",c);else this.events.error&&(c=u(this,function(a){this.emit("error",a)}));this.depMaps=a&&a.slice(0);this.errback=
+c;this.inited=!0;this.ignore=f.ignore;f.enabled||this.enabled?this.enable():this.check()}},defineDep:function(a,b){this.depMatched[a]||(this.depMatched[a]=!0,this.depCount-=1,this.depExports[a]=b)},fetch:function(){if(!this.fetched){this.fetched=!0;i.startTime=(new Date).getTime();var a=this.map;if(this.shim)i.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],u(this,function(){return a.prefix?this.callPlugin():this.load()}));else return a.prefix?this.callPlugin():this.load()}},load:function(){var a=
+this.map.url;S[a]||(S[a]=!0,i.load(this.map.id,a))},check:function(){if(this.enabled&&!this.enabling){var a,b,c=this.map.id;b=this.depExports;var f=this.exports,l=this.factory;if(this.inited)if(this.error)this.emit("error",this.error);else{if(!this.defining){this.defining=!0;if(1>this.depCount&&!this.defined){if(G(l)){if(this.events.error&&this.map.isDefine||g.onError!==ca)try{f=i.execCb(c,l,b,f)}catch(d){a=d}else f=i.execCb(c,l,b,f);this.map.isDefine&&void 0===f&&((b=this.module)?f=b.exports:this.usingExports&&
+(f=this.exports));if(a)return a.requireMap=this.map,a.requireModules=this.map.isDefine?[this.map.id]:null,a.requireType=this.map.isDefine?"define":"require",w(this.error=a)}else f=l;this.exports=f;if(this.map.isDefine&&!this.ignore&&(r[c]=f,g.onResourceLoad))g.onResourceLoad(i,this.map,this.depMaps);y(c);this.defined=!0}this.defining=!1;this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else this.fetch()}},callPlugin:function(){var a=
+this.map,b=a.id,d=p(a.prefix);this.depMaps.push(d);q(d,"defined",u(this,function(f){var l,d;d=m(aa,this.map.id);var e=this.map.name,P=this.map.parentMap?this.map.parentMap.name:null,n=i.makeRequire(a.parentMap,{enableBuildCallback:!0});if(this.map.unnormalized){if(f.normalize&&(e=f.normalize(e,function(a){return c(a,P,!0)})||""),f=p(a.prefix+"!"+e,this.map.parentMap),q(f,"defined",u(this,function(a){this.init([],function(){return a},null,{enabled:!0,ignore:!0})})),d=m(h,f.id)){this.depMaps.push(f);
+if(this.events.error)d.on("error",u(this,function(a){this.emit("error",a)}));d.enable()}}else d?(this.map.url=i.nameToUrl(d),this.load()):(l=u(this,function(a){this.init([],function(){return a},null,{enabled:!0})}),l.error=u(this,function(a){this.inited=!0;this.error=a;a.requireModules=[b];B(h,function(a){0===a.map.id.indexOf(b+"_unnormalized")&&y(a.map.id)});w(a)}),l.fromText=u(this,function(f,c){var d=a.name,e=p(d),P=M;c&&(f=c);P&&(M=!1);s(e);t(j.config,b)&&(j.config[d]=j.config[b]);try{g.exec(f)}catch(h){return w(C("fromtexteval",
+"fromText eval for "+b+" failed: "+h,h,[b]))}P&&(M=!0);this.depMaps.push(e);i.completeLoad(d);n([d],l)}),f.load(a.name,n,l,j))}));i.enable(d,this);this.pluginMaps[d.id]=d},enable:function(){V[this.map.id]=this;this.enabling=this.enabled=!0;v(this.depMaps,u(this,function(a,b){var c,f;if("string"===typeof a){a=p(a,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap);this.depMaps[b]=a;if(c=m(L,a.id)){this.depExports[b]=c(this);return}this.depCount+=1;q(a,"defined",u(this,function(a){this.defineDep(b,
+a);this.check()}));this.errback?q(a,"error",u(this,this.errback)):this.events.error&&q(a,"error",u(this,function(a){this.emit("error",a)}))}c=a.id;f=h[c];!t(L,c)&&(f&&!f.enabled)&&i.enable(a,this)}));B(this.pluginMaps,u(this,function(a){var b=m(h,a.id);b&&!b.enabled&&i.enable(a,this)}));this.enabling=!1;this.check()},on:function(a,b){var c=this.events[a];c||(c=this.events[a]=[]);c.push(b)},emit:function(a,b){v(this.events[a],function(a){a(b)});"error"===a&&delete this.events[a]}};i={config:j,contextName:b,
+registry:h,defined:r,urlFetched:S,defQueue:A,Module:Z,makeModuleMap:p,nextTick:g.nextTick,onError:w,configure:function(a){a.baseUrl&&"/"!==a.baseUrl.charAt(a.baseUrl.length-1)&&(a.baseUrl+="/");var b=j.shim,c={paths:!0,bundles:!0,config:!0,map:!0};B(a,function(a,b){c[b]?(j[b]||(j[b]={}),U(j[b],a,!0,!0)):j[b]=a});a.bundles&&B(a.bundles,function(a,b){v(a,function(a){a!==b&&(aa[a]=b)})});a.shim&&(B(a.shim,function(a,c){H(a)&&(a={deps:a});if((a.exports||a.init)&&!a.exportsFn)a.exportsFn=i.makeShimExports(a);
+b[c]=a}),j.shim=b);a.packages&&v(a.packages,function(a){var b,a="string"===typeof a?{name:a}:a;b=a.name;a.location&&(j.paths[b]=a.location);j.pkgs[b]=a.name+"/"+(a.main||"main").replace(ia,"").replace(Q,"")});B(h,function(a,b){!a.inited&&!a.map.unnormalized&&(a.map=p(b))});if(a.deps||a.callback)i.require(a.deps||[],a.callback)},makeShimExports:function(a){return function(){var b;a.init&&(b=a.init.apply(ba,arguments));return b||a.exports&&da(a.exports)}},makeRequire:function(a,e){function j(c,d,m){var n,
+q;e.enableBuildCallback&&(d&&G(d))&&(d.__requireJsBuild=!0);if("string"===typeof c){if(G(d))return w(C("requireargs","Invalid require call"),m);if(a&&t(L,c))return L[c](h[a.id]);if(g.get)return g.get(i,c,a,j);n=p(c,a,!1,!0);n=n.id;return!t(r,n)?w(C("notloaded",'Module name "'+n+'" has not been loaded yet for context: '+b+(a?"":". Use require([])"))):r[n]}J();i.nextTick(function(){J();q=s(p(null,a));q.skipMap=e.skipMap;q.init(c,d,m,{enabled:!0});D()});return j}e=e||{};U(j,{isBrowser:z,toUrl:function(b){var d,
+e=b.lastIndexOf("."),k=b.split("/")[0];if(-1!==e&&(!("."===k||".."===k)||1<e))d=b.substring(e,b.length),b=b.substring(0,e);return i.nameToUrl(c(b,a&&a.id,!0),d,!0)},defined:function(b){return t(r,p(b,a,!1,!0).id)},specified:function(b){b=p(b,a,!1,!0).id;return t(r,b)||t(h,b)}});a||(j.undef=function(b){x();var c=p(b,a,!0),e=m(h,b);d(b);delete r[b];delete S[c.url];delete $[b];T(A,function(a,c){a[0]===b&&A.splice(c,1)});e&&(e.events.defined&&($[b]=e.events),y(b))});return j},enable:function(a){m(h,a.id)&&
+s(a).enable()},completeLoad:function(a){var b,c,d=m(j.shim,a)||{},g=d.exports;for(x();A.length;){c=A.shift();if(null===c[0]){c[0]=a;if(b)break;b=!0}else c[0]===a&&(b=!0);E(c)}c=m(h,a);if(!b&&!t(r,a)&&c&&!c.inited){if(j.enforceDefine&&(!g||!da(g)))return e(a)?void 0:w(C("nodefine","No define call for "+a,null,[a]));E([a,d.deps||[],d.exportsFn])}D()},nameToUrl:function(a,b,c){var d,e,h;(d=m(j.pkgs,a))&&(a=d);if(d=m(aa,a))return i.nameToUrl(d,b,c);if(g.jsExtRegExp.test(a))d=a+(b||"");else{d=j.paths;
+a=a.split("/");for(e=a.length;0<e;e-=1)if(h=a.slice(0,e).join("/"),h=m(d,h)){H(h)&&(h=h[0]);a.splice(0,e,h);break}d=a.join("/");d+=b||(/^data\:|\?/.test(d)||c?"":".js");d=("/"===d.charAt(0)||d.match(/^[\w\+\.\-]+:/)?"":j.baseUrl)+d}return j.urlArgs?d+((-1===d.indexOf("?")?"?":"&")+j.urlArgs):d},load:function(a,b){g.load(i,a,b)},execCb:function(a,b,c,d){return b.apply(d,c)},onScriptLoad:function(a){if("load"===a.type||ja.test((a.currentTarget||a.srcElement).readyState))N=null,a=I(a),i.completeLoad(a.id)},
+onScriptError:function(a){var b=I(a);if(!e(b.id))return w(C("scripterror","Script error for: "+b.id,a,[b.id]))}};i.require=i.makeRequire();return i}var g,x,y,D,I,E,N,J,s,O,ka=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,la=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,Q=/\.js$/,ia=/^\.\//;x=Object.prototype;var K=x.toString,fa=x.hasOwnProperty,ha=Array.prototype.splice,z=!!("undefined"!==typeof window&&"undefined"!==typeof navigator&&window.document),ea=!z&&"undefined"!==typeof importScripts,ja=
+z&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,Y="undefined"!==typeof opera&&"[object Opera]"===opera.toString(),F={},q={},R=[],M=!1;if("undefined"===typeof define){if("undefined"!==typeof requirejs){if(G(requirejs))return;q=requirejs;requirejs=void 0}"undefined"!==typeof require&&!G(require)&&(q=require,require=void 0);g=requirejs=function(b,c,d,e){var n,p="_";!H(b)&&"string"!==typeof b&&(n=b,H(c)?(b=c,c=d,d=e):b=[]);n&&n.context&&(p=n.context);(e=m(F,p))||(e=F[p]=g.s.newContext(p));
+n&&e.configure(n);return e.require(b,c,d)};g.config=function(b){return g(b)};g.nextTick="undefined"!==typeof setTimeout?function(b){setTimeout(b,4)}:function(b){b()};require||(require=g);g.version="2.1.17";g.jsExtRegExp=/^\/|:|\?|\.js$/;g.isBrowser=z;x=g.s={contexts:F,newContext:ga};g({});v(["toUrl","undef","defined","specified"],function(b){g[b]=function(){var c=F._;return c.require[b].apply(c,arguments)}});if(z&&(y=x.head=document.getElementsByTagName("head")[0],D=document.getElementsByTagName("base")[0]))y=
+x.head=D.parentNode;g.onError=ca;g.createNode=function(b){var c=b.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");c.type=b.scriptType||"text/javascript";c.charset="utf-8";c.async=!0;return c};g.load=function(b,c,d){var e=b&&b.config||{};if(z)return e=g.createNode(e,c,d),e.setAttribute("data-requirecontext",b.contextName),e.setAttribute("data-requiremodule",c),e.attachEvent&&!(e.attachEvent.toString&&0>e.attachEvent.toString().indexOf("[native code"))&&
+!Y?(M=!0,e.attachEvent("onreadystatechange",b.onScriptLoad)):(e.addEventListener("load",b.onScriptLoad,!1),e.addEventListener("error",b.onScriptError,!1)),e.src=d,J=e,D?y.insertBefore(e,D):y.appendChild(e),J=null,e;if(ea)try{importScripts(d),b.completeLoad(c)}catch(m){b.onError(C("importscripts","importScripts failed for "+c+" at "+d,m,[c]))}};z&&!q.skipDataMain&&T(document.getElementsByTagName("script"),function(b){y||(y=b.parentNode);if(I=b.getAttribute("data-main"))return s=I,q.baseUrl||(E=s.split("/"),
+s=E.pop(),O=E.length?E.join("/")+"/":"./",q.baseUrl=O),s=s.replace(Q,""),g.jsExtRegExp.test(s)&&(s=I),q.deps=q.deps?q.deps.concat(s):[s],!0});define=function(b,c,d){var e,g;"string"!==typeof b&&(d=c,c=b,b=null);H(c)||(d=c,c=null);!c&&G(d)&&(c=[],d.length&&(d.toString().replace(ka,"").replace(la,function(b,d){c.push(d)}),c=(1===d.length?["require"]:["require","exports","module"]).concat(c)));if(M){if(!(e=J))N&&"interactive"===N.readyState||T(document.getElementsByTagName("script"),function(b){if("interactive"===
+b.readyState)return N=b}),e=N;e&&(b||(b=e.getAttribute("data-requiremodule")),g=F[e.getAttribute("data-requirecontext")])}(g?g.defQueue:R).push([b,c,d])};define.amd={jQuery:!0};g.exec=function(b){return eval(b)};g(q)}})(this);
diff --git a/public_html/data/js/vendor/underscore.js b/public_html/data/js/vendor/underscore.js
new file mode 100644
index 000000000..b29332f94
--- /dev/null
+++ b/public_html/data/js/vendor/underscore.js
@@ -0,0 +1,1548 @@
+// Underscore.js 1.8.3
+// http://underscorejs.org
+// (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+// Underscore may be freely distributed under the MIT license.
+
+(function() {
+
+ // Baseline setup
+ // --------------
+
+ // Establish the root object, `window` in the browser, or `exports` on the server.
+ var root = this;
+
+ // Save the previous value of the `_` variable.
+ var previousUnderscore = root._;
+
+ // Save bytes in the minified (but not gzipped) version:
+ var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;
+
+ // Create quick reference variables for speed access to core prototypes.
+ var
+ push = ArrayProto.push,
+ slice = ArrayProto.slice,
+ toString = ObjProto.toString,
+ hasOwnProperty = ObjProto.hasOwnProperty;
+
+ // All **ECMAScript 5** native function implementations that we hope to use
+ // are declared here.
+ var
+ nativeIsArray = Array.isArray,
+ nativeKeys = Object.keys,
+ nativeBind = FuncProto.bind,
+ nativeCreate = Object.create;
+
+ // Naked function reference for surrogate-prototype-swapping.
+ var Ctor = function(){};
+
+ // Create a safe reference to the Underscore object for use below.
+ var _ = function(obj) {
+ if (obj instanceof _) return obj;
+ if (!(this instanceof _)) return new _(obj);
+ this._wrapped = obj;
+ };
+
+ // Export the Underscore object for **Node.js**, with
+ // backwards-compatibility for the old `require()` API. If we're in
+ // the browser, add `_` as a global object.
+ if (typeof exports !== 'undefined') {
+ if (typeof module !== 'undefined' && module.exports) {
+ exports = module.exports = _;
+ }
+ exports._ = _;
+ } else {
+ root._ = _;
+ }
+
+ // Current version.
+ _.VERSION = '1.8.3';
+
+ // Internal function that returns an efficient (for current engines) version
+ // of the passed-in callback, to be repeatedly applied in other Underscore
+ // functions.
+ var optimizeCb = function(func, context, argCount) {
+ if (context === void 0) return func;
+ switch (argCount == null ? 3 : argCount) {
+ case 1: return function(value) {
+ return func.call(context, value);
+ };
+ case 2: return function(value, other) {
+ return func.call(context, value, other);
+ };
+ case 3: return function(value, index, collection) {
+ return func.call(context, value, index, collection);
+ };
+ case 4: return function(accumulator, value, index, collection) {
+ return func.call(context, accumulator, value, index, collection);
+ };
+ }
+ return function() {
+ return func.apply(context, arguments);
+ };
+ };
+
+ // A mostly-internal function to generate callbacks that can be applied
+ // to each element in a collection, returning the desired result — either
+ // identity, an arbitrary callback, a property matcher, or a property accessor.
+ var cb = function(value, context, argCount) {
+ if (value == null) return _.identity;
+ if (_.isFunction(value)) return optimizeCb(value, context, argCount);
+ if (_.isObject(value)) return _.matcher(value);
+ return _.property(value);
+ };
+ _.iteratee = function(value, context) {
+ return cb(value, context, Infinity);
+ };
+
+ // An internal function for creating assigner functions.
+ var createAssigner = function(keysFunc, undefinedOnly) {
+ return function(obj) {
+ var length = arguments.length;
+ if (length < 2 || obj == null) return obj;
+ for (var index = 1; index < length; index++) {
+ var source = arguments[index],
+ keys = keysFunc(source),
+ l = keys.length;
+ for (var i = 0; i < l; i++) {
+ var key = keys[i];
+ if (!undefinedOnly || obj[key] === void 0) obj[key] = source[key];
+ }
+ }
+ return obj;
+ };
+ };
+
+ // An internal function for creating a new object that inherits from another.
+ var baseCreate = function(prototype) {
+ if (!_.isObject(prototype)) return {};
+ if (nativeCreate) return nativeCreate(prototype);
+ Ctor.prototype = prototype;
+ var result = new Ctor;
+ Ctor.prototype = null;
+ return result;
+ };
+
+ var property = function(key) {
+ return function(obj) {
+ return obj == null ? void 0 : obj[key];
+ };
+ };
+
+ // Helper for collection methods to determine whether a collection
+ // should be iterated as an array or as an object
+ // Related: http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength
+ // Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094
+ var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1;
+ var getLength = property('length');
+ var isArrayLike = function(collection) {
+ var length = getLength(collection);
+ return typeof length == 'number' && length >= 0 && length <= MAX_ARRAY_INDEX;
+ };
+
+ // Collection Functions
+ // --------------------
+
+ // The cornerstone, an `each` implementation, aka `forEach`.
+ // Handles raw objects in addition to array-likes. Treats all
+ // sparse array-likes as if they were dense.
+ _.each = _.forEach = function(obj, iteratee, context) {
+ iteratee = optimizeCb(iteratee, context);
+ var i, length;
+ if (isArrayLike(obj)) {
+ for (i = 0, length = obj.length; i < length; i++) {
+ iteratee(obj[i], i, obj);
+ }
+ } else {
+ var keys = _.keys(obj);
+ for (i = 0, length = keys.length; i < length; i++) {
+ iteratee(obj[keys[i]], keys[i], obj);
+ }
+ }
+ return obj;
+ };
+
+ // Return the results of applying the iteratee to each element.
+ _.map = _.collect = function(obj, iteratee, context) {
+ iteratee = cb(iteratee, context);
+ var keys = !isArrayLike(obj) && _.keys(obj),
+ length = (keys || obj).length,
+ results = Array(length);
+ for (var index = 0; index < length; index++) {
+ var currentKey = keys ? keys[index] : index;
+ results[index] = iteratee(obj[currentKey], currentKey, obj);
+ }
+ return results;
+ };
+
+ // Create a reducing function iterating left or right.
+ function createReduce(dir) {
+ // Optimized iterator function as using arguments.length
+ // in the main function will deoptimize the, see #1991.
+ function iterator(obj, iteratee, memo, keys, index, length) {
+ for (; index >= 0 && index < length; index += dir) {
+ var currentKey = keys ? keys[index] : index;
+ memo = iteratee(memo, obj[currentKey], currentKey, obj);
+ }
+ return memo;
+ }
+
+ return function(obj, iteratee, memo, context) {
+ iteratee = optimizeCb(iteratee, context, 4);
+ var keys = !isArrayLike(obj) && _.keys(obj),
+ length = (keys || obj).length,
+ index = dir > 0 ? 0 : length - 1;
+ // Determine the initial value if none is provided.
+ if (arguments.length < 3) {
+ memo = obj[keys ? keys[index] : index];
+ index += dir;
+ }
+ return iterator(obj, iteratee, memo, keys, index, length);
+ };
+ }
+
+ // **Reduce** builds up a single result from a list of values, aka `inject`,
+ // or `foldl`.
+ _.reduce = _.foldl = _.inject = createReduce(1);
+
+ // The right-associative version of reduce, also known as `foldr`.
+ _.reduceRight = _.foldr = createReduce(-1);
+
+ // Return the first value which passes a truth test. Aliased as `detect`.
+ _.find = _.detect = function(obj, predicate, context) {
+ var key;
+ if (isArrayLike(obj)) {
+ key = _.findIndex(obj, predicate, context);
+ } else {
+ key = _.findKey(obj, predicate, context);
+ }
+ if (key !== void 0 && key !== -1) return obj[key];
+ };
+
+ // Return all the elements that pass a truth test.
+ // Aliased as `select`.
+ _.filter = _.select = function(obj, predicate, context) {
+ var results = [];
+ predicate = cb(predicate, context);
+ _.each(obj, function(value, index, list) {
+ if (predicate(value, index, list)) results.push(value);
+ });
+ return results;
+ };
+
+ // Return all the elements for which a truth test fails.
+ _.reject = function(obj, predicate, context) {
+ return _.filter(obj, _.negate(cb(predicate)), context);
+ };
+
+ // Determine whether all of the elements match a truth test.
+ // Aliased as `all`.
+ _.every = _.all = function(obj, predicate, context) {
+ predicate = cb(predicate, context);
+ var keys = !isArrayLike(obj) && _.keys(obj),
+ length = (keys || obj).length;
+ for (var index = 0; index < length; index++) {
+ var currentKey = keys ? keys[index] : index;
+ if (!predicate(obj[currentKey], currentKey, obj)) return false;
+ }
+ return true;
+ };
+
+ // Determine if at least one element in the object matches a truth test.
+ // Aliased as `any`.
+ _.some = _.any = function(obj, predicate, context) {
+ predicate = cb(predicate, context);
+ var keys = !isArrayLike(obj) && _.keys(obj),
+ length = (keys || obj).length;
+ for (var index = 0; index < length; index++) {
+ var currentKey = keys ? keys[index] : index;
+ if (predicate(obj[currentKey], currentKey, obj)) return true;
+ }
+ return false;
+ };
+
+ // Determine if the array or object contains a given item (using `===`).
+ // Aliased as `includes` and `include`.
+ _.contains = _.includes = _.include = function(obj, item, fromIndex, guard) {
+ if (!isArrayLike(obj)) obj = _.values(obj);
+ if (typeof fromIndex != 'number' || guard) fromIndex = 0;
+ return _.indexOf(obj, item, fromIndex) >= 0;
+ };
+
+ // Invoke a method (with arguments) on every item in a collection.
+ _.invoke = function(obj, method) {
+ var args = slice.call(arguments, 2);
+ var isFunc = _.isFunction(method);
+ return _.map(obj, function(value) {
+ var func = isFunc ? method : value[method];
+ return func == null ? func : func.apply(value, args);
+ });
+ };
+
+ // Convenience version of a common use case of `map`: fetching a property.
+ _.pluck = function(obj, key) {
+ return _.map(obj, _.property(key));
+ };
+
+ // Convenience version of a common use case of `filter`: selecting only objects
+ // containing specific `key:value` pairs.
+ _.where = function(obj, attrs) {
+ return _.filter(obj, _.matcher(attrs));
+ };
+
+ // Convenience version of a common use case of `find`: getting the first object
+ // containing specific `key:value` pairs.
+ _.findWhere = function(obj, attrs) {
+ return _.find(obj, _.matcher(attrs));
+ };
+
+ // Return the maximum element (or element-based computation).
+ _.max = function(obj, iteratee, context) {
+ var result = -Infinity, lastComputed = -Infinity,
+ value, computed;
+ if (iteratee == null && obj != null) {
+ obj = isArrayLike(obj) ? obj : _.values(obj);
+ for (var i = 0, length = obj.length; i < length; i++) {
+ value = obj[i];
+ if (value > result) {
+ result = value;
+ }
+ }
+ } else {
+ iteratee = cb(iteratee, context);
+ _.each(obj, function(value, index, list) {
+ computed = iteratee(value, index, list);
+ if (computed > lastComputed || computed === -Infinity && result === -Infinity) {
+ result = value;
+ lastComputed = computed;
+ }
+ });
+ }
+ return result;
+ };
+
+ // Return the minimum element (or element-based computation).
+ _.min = function(obj, iteratee, context) {
+ var result = Infinity, lastComputed = Infinity,
+ value, computed;
+ if (iteratee == null && obj != null) {
+ obj = isArrayLike(obj) ? obj : _.values(obj);
+ for (var i = 0, length = obj.length; i < length; i++) {
+ value = obj[i];
+ if (value < result) {
+ result = value;
+ }
+ }
+ } else {
+ iteratee = cb(iteratee, context);
+ _.each(obj, function(value, index, list) {
+ computed = iteratee(value, index, list);
+ if (computed < lastComputed || computed === Infinity && result === Infinity) {
+ result = value;
+ lastComputed = computed;
+ }
+ });
+ }
+ return result;
+ };
+
+ // Shuffle a collection, using the modern version of the
+ // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle).
+ _.shuffle = function(obj) {
+ var set = isArrayLike(obj) ? obj : _.values(obj);
+ var length = set.length;
+ var shuffled = Array(length);
+ for (var index = 0, rand; index < length; index++) {
+ rand = _.random(0, index);
+ if (rand !== index) shuffled[index] = shuffled[rand];
+ shuffled[rand] = set[index];
+ }
+ return shuffled;
+ };
+
+ // Sample **n** random values from a collection.
+ // If **n** is not specified, returns a single random element.
+ // The internal `guard` argument allows it to work with `map`.
+ _.sample = function(obj, n, guard) {
+ if (n == null || guard) {
+ if (!isArrayLike(obj)) obj = _.values(obj);
+ return obj[_.random(obj.length - 1)];
+ }
+ return _.shuffle(obj).slice(0, Math.max(0, n));
+ };
+
+ // Sort the object's values by a criterion produced by an iteratee.
+ _.sortBy = function(obj, iteratee, context) {
+ iteratee = cb(iteratee, context);
+ return _.pluck(_.map(obj, function(value, index, list) {
+ return {
+ value: value,
+ index: index,
+ criteria: iteratee(value, index, list)
+ };
+ }).sort(function(left, right) {
+ var a = left.criteria;
+ var b = right.criteria;
+ if (a !== b) {
+ if (a > b || a === void 0) return 1;
+ if (a < b || b === void 0) return -1;
+ }
+ return left.index - right.index;
+ }), 'value');
+ };
+
+ // An internal function used for aggregate "group by" operations.
+ var group = function(behavior) {
+ return function(obj, iteratee, context) {
+ var result = {};
+ iteratee = cb(iteratee, context);
+ _.each(obj, function(value, index) {
+ var key = iteratee(value, index, obj);
+ behavior(result, value, key);
+ });
+ return result;
+ };
+ };
+
+ // Groups the object's values by a criterion. Pass either a string attribute
+ // to group by, or a function that returns the criterion.
+ _.groupBy = group(function(result, value, key) {
+ if (_.has(result, key)) result[key].push(value); else result[key] = [value];
+ });
+
+ // Indexes the object's values by a criterion, similar to `groupBy`, but for
+ // when you know that your index values will be unique.
+ _.indexBy = group(function(result, value, key) {
+ result[key] = value;
+ });
+
+ // Counts instances of an object that group by a certain criterion. Pass
+ // either a string attribute to count by, or a function that returns the
+ // criterion.
+ _.countBy = group(function(result, value, key) {
+ if (_.has(result, key)) result[key]++; else result[key] = 1;
+ });
+
+ // Safely create a real, live array from anything iterable.
+ _.toArray = function(obj) {
+ if (!obj) return [];
+ if (_.isArray(obj)) return slice.call(obj);
+ if (isArrayLike(obj)) return _.map(obj, _.identity);
+ return _.values(obj);
+ };
+
+ // Return the number of elements in an object.
+ _.size = function(obj) {
+ if (obj == null) return 0;
+ return isArrayLike(obj) ? obj.length : _.keys(obj).length;
+ };
+
+ // Split a collection into two arrays: one whose elements all satisfy the given
+ // predicate, and one whose elements all do not satisfy the predicate.
+ _.partition = function(obj, predicate, context) {
+ predicate = cb(predicate, context);
+ var pass = [], fail = [];
+ _.each(obj, function(value, key, obj) {
+ (predicate(value, key, obj) ? pass : fail).push(value);
+ });
+ return [pass, fail];
+ };
+
+ // Array Functions
+ // ---------------
+
+ // Get the first element of an array. Passing **n** will return the first N
+ // values in the array. Aliased as `head` and `take`. The **guard** check
+ // allows it to work with `_.map`.
+ _.first = _.head = _.take = function(array, n, guard) {
+ if (array == null) return void 0;
+ if (n == null || guard) return array[0];
+ return _.initial(array, array.length - n);
+ };
+
+ // Returns everything but the last entry of the array. Especially useful on
+ // the arguments object. Passing **n** will return all the values in
+ // the array, excluding the last N.
+ _.initial = function(array, n, guard) {
+ return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));
+ };
+
+ // Get the last element of an array. Passing **n** will return the last N
+ // values in the array.
+ _.last = function(array, n, guard) {
+ if (array == null) return void 0;
+ if (n == null || guard) return array[array.length - 1];
+ return _.rest(array, Math.max(0, array.length - n));
+ };
+
+ // Returns everything but the first entry of the array. Aliased as `tail` and `drop`.
+ // Especially useful on the arguments object. Passing an **n** will return
+ // the rest N values in the array.
+ _.rest = _.tail = _.drop = function(array, n, guard) {
+ return slice.call(array, n == null || guard ? 1 : n);
+ };
+
+ // Trim out all falsy values from an array.
+ _.compact = function(array) {
+ return _.filter(array, _.identity);
+ };
+
+ // Internal implementation of a recursive `flatten` function.
+ var flatten = function(input, shallow, strict, startIndex) {
+ var output = [], idx = 0;
+ for (var i = startIndex || 0, length = getLength(input); i < length; i++) {
+ var value = input[i];
+ if (isArrayLike(value) && (_.isArray(value) || _.isArguments(value))) {
+ //flatten current level of array or arguments object
+ if (!shallow) value = flatten(value, shallow, strict);
+ var j = 0, len = value.length;
+ output.length += len;
+ while (j < len) {
+ output[idx++] = value[j++];
+ }
+ } else if (!strict) {
+ output[idx++] = value;
+ }
+ }
+ return output;
+ };
+
+ // Flatten out an array, either recursively (by default), or just one level.
+ _.flatten = function(array, shallow) {
+ return flatten(array, shallow, false);
+ };
+
+ // Return a version of the array that does not contain the specified value(s).
+ _.without = function(array) {
+ return _.difference(array, slice.call(arguments, 1));
+ };
+
+ // Produce a duplicate-free version of the array. If the array has already
+ // been sorted, you have the option of using a faster algorithm.
+ // Aliased as `unique`.
+ _.uniq = _.unique = function(array, isSorted, iteratee, context) {
+ if (!_.isBoolean(isSorted)) {
+ context = iteratee;
+ iteratee = isSorted;
+ isSorted = false;
+ }
+ if (iteratee != null) iteratee = cb(iteratee, context);
+ var result = [];
+ var seen = [];
+ for (var i = 0, length = getLength(array); i < length; i++) {
+ var value = array[i],
+ computed = iteratee ? iteratee(value, i, array) : value;
+ if (isSorted) {
+ if (!i || seen !== computed) result.push(value);
+ seen = computed;
+ } else if (iteratee) {
+ if (!_.contains(seen, computed)) {
+ seen.push(computed);
+ result.push(value);
+ }
+ } else if (!_.contains(result, value)) {
+ result.push(value);
+ }
+ }
+ return result;
+ };
+
+ // Produce an array that contains the union: each distinct element from all of
+ // the passed-in arrays.
+ _.union = function() {
+ return _.uniq(flatten(arguments, true, true));
+ };
+
+ // Produce an array that contains every item shared between all the
+ // passed-in arrays.
+ _.intersection = function(array) {
+ var result = [];
+ var argsLength = arguments.length;
+ for (var i = 0, length = getLength(array); i < length; i++) {
+ var item = array[i];
+ if (_.contains(result, item)) continue;
+ for (var j = 1; j < argsLength; j++) {
+ if (!_.contains(arguments[j], item)) break;
+ }
+ if (j === argsLength) result.push(item);
+ }
+ return result;
+ };
+
+ // Take the difference between one array and a number of other arrays.
+ // Only the elements present in just the first array will remain.
+ _.difference = function(array) {
+ var rest = flatten(arguments, true, true, 1);
+ return _.filter(array, function(value){
+ return !_.contains(rest, value);
+ });
+ };
+
+ // Zip together multiple lists into a single array -- elements that share
+ // an index go together.
+ _.zip = function() {
+ return _.unzip(arguments);
+ };
+
+ // Complement of _.zip. Unzip accepts an array of arrays and groups
+ // each array's elements on shared indices
+ _.unzip = function(array) {
+ var length = array && _.max(array, getLength).length || 0;
+ var result = Array(length);
+
+ for (var index = 0; index < length; index++) {
+ result[index] = _.pluck(array, index);
+ }
+ return result;
+ };
+
+ // Converts lists into objects. Pass either a single array of `[key, value]`
+ // pairs, or two parallel arrays of the same length -- one of keys, and one of
+ // the corresponding values.
+ _.object = function(list, values) {
+ var result = {};
+ for (var i = 0, length = getLength(list); i < length; i++) {
+ if (values) {
+ result[list[i]] = values[i];
+ } else {
+ result[list[i][0]] = list[i][1];
+ }
+ }
+ return result;
+ };
+
+ // Generator function to create the findIndex and findLastIndex functions
+ function createPredicateIndexFinder(dir) {
+ return function(array, predicate, context) {
+ predicate = cb(predicate, context);
+ var length = getLength(array);
+ var index = dir > 0 ? 0 : length - 1;
+ for (; index >= 0 && index < length; index += dir) {
+ if (predicate(array[index], index, array)) return index;
+ }
+ return -1;
+ };
+ }
+
+ // Returns the first index on an array-like that passes a predicate test
+ _.findIndex = createPredicateIndexFinder(1);
+ _.findLastIndex = createPredicateIndexFinder(-1);
+
+ // Use a comparator function to figure out the smallest index at which
+ // an object should be inserted so as to maintain order. Uses binary search.
+ _.sortedIndex = function(array, obj, iteratee, context) {
+ iteratee = cb(iteratee, context, 1);
+ var value = iteratee(obj);
+ var low = 0, high = getLength(array);
+ while (low < high) {
+ var mid = Math.floor((low + high) / 2);
+ if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;
+ }
+ return low;
+ };
+
+ // Generator function to create the indexOf and lastIndexOf functions
+ function createIndexFinder(dir, predicateFind, sortedIndex) {
+ return function(array, item, idx) {
+ var i = 0, length = getLength(array);
+ if (typeof idx == 'number') {
+ if (dir > 0) {
+ i = idx >= 0 ? idx : Math.max(idx + length, i);
+ } else {
+ length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;
+ }
+ } else if (sortedIndex && idx && length) {
+ idx = sortedIndex(array, item);
+ return array[idx] === item ? idx : -1;
+ }
+ if (item !== item) {
+ idx = predicateFind(slice.call(array, i, length), _.isNaN);
+ return idx >= 0 ? idx + i : -1;
+ }
+ for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {
+ if (array[idx] === item) return idx;
+ }
+ return -1;
+ };
+ }
+
+ // Return the position of the first occurrence of an item in an array,
+ // or -1 if the item is not included in the array.
+ // If the array is large and already in sort order, pass `true`
+ // for **isSorted** to use binary search.
+ _.indexOf = createIndexFinder(1, _.findIndex, _.sortedIndex);
+ _.lastIndexOf = createIndexFinder(-1, _.findLastIndex);
+
+ // Generate an integer Array containing an arithmetic progression. A port of
+ // the native Python `range()` function. See
+ // [the Python documentation](http://docs.python.org/library/functions.html#range).
+ _.range = function(start, stop, step) {
+ if (stop == null) {
+ stop = start || 0;
+ start = 0;
+ }
+ step = step || 1;
+
+ var length = Math.max(Math.ceil((stop - start) / step), 0);
+ var range = Array(length);
+
+ for (var idx = 0; idx < length; idx++, start += step) {
+ range[idx] = start;
+ }
+
+ return range;
+ };
+
+ // Function (ahem) Functions
+ // ------------------
+
+ // Determines whether to execute a function as a constructor
+ // or a normal function with the provided arguments
+ var executeBound = function(sourceFunc, boundFunc, context, callingContext, args) {
+ if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);
+ var self = baseCreate(sourceFunc.prototype);
+ var result = sourceFunc.apply(self, args);
+ if (_.isObject(result)) return result;
+ return self;
+ };
+
+ // Create a function bound to a given object (assigning `this`, and arguments,
+ // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if
+ // available.
+ _.bind = function(func, context) {
+ if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
+ if (!_.isFunction(func)) throw new TypeError('Bind must be called on a function');
+ var args = slice.call(arguments, 2);
+ var bound = function() {
+ return executeBound(func, bound, context, this, args.concat(slice.call(arguments)));
+ };
+ return bound;
+ };
+
+ // Partially apply a function by creating a version that has had some of its
+ // arguments pre-filled, without changing its dynamic `this` context. _ acts
+ // as a placeholder, allowing any combination of arguments to be pre-filled.
+ _.partial = function(func) {
+ var boundArgs = slice.call(arguments, 1);
+ var bound = function() {
+ var position = 0, length = boundArgs.length;
+ var args = Array(length);
+ for (var i = 0; i < length; i++) {
+ args[i] = boundArgs[i] === _ ? arguments[position++] : boundArgs[i];
+ }
+ while (position < arguments.length) args.push(arguments[position++]);
+ return executeBound(func, bound, this, this, args);
+ };
+ return bound;
+ };
+
+ // Bind a number of an object's methods to that object. Remaining arguments
+ // are the method names to be bound. Useful for ensuring that all callbacks
+ // defined on an object belong to it.
+ _.bindAll = function(obj) {
+ var i, length = arguments.length, key;
+ if (length <= 1) throw new Error('bindAll must be passed function names');
+ for (i = 1; i < length; i++) {
+ key = arguments[i];
+ obj[key] = _.bind(obj[key], obj);
+ }
+ return obj;
+ };
+
+ // Memoize an expensive function by storing its results.
+ _.memoize = function(func, hasher) {
+ var memoize = function(key) {
+ var cache = memoize.cache;
+ var address = '' + (hasher ? hasher.apply(this, arguments) : key);
+ if (!_.has(cache, address)) cache[address] = func.apply(this, arguments);
+ return cache[address];
+ };
+ memoize.cache = {};
+ return memoize;
+ };
+
+ // Delays a function for the given number of milliseconds, and then calls
+ // it with the arguments supplied.
+ _.delay = function(func, wait) {
+ var args = slice.call(arguments, 2);
+ return setTimeout(function(){
+ return func.apply(null, args);
+ }, wait);
+ };
+
+ // Defers a function, scheduling it to run after the current call stack has
+ // cleared.
+ _.defer = _.partial(_.delay, _, 1);
+
+ // Returns a function, that, when invoked, will only be triggered at most once
+ // during a given window of time. Normally, the throttled function will run
+ // as much as it can, without ever going more than once per `wait` duration;
+ // but if you'd like to disable the execution on the leading edge, pass
+ // `{leading: false}`. To disable execution on the trailing edge, ditto.
+ _.throttle = function(func, wait, options) {
+ var context, args, result;
+ var timeout = null;
+ var previous = 0;
+ if (!options) options = {};
+ var later = function() {
+ previous = options.leading === false ? 0 : _.now();
+ timeout = null;
+ result = func.apply(context, args);
+ if (!timeout) context = args = null;
+ };
+ return function() {
+ var now = _.now();
+ if (!previous && options.leading === false) previous = now;
+ var remaining = wait - (now - previous);
+ context = this;
+ args = arguments;
+ if (remaining <= 0 || remaining > wait) {
+ if (timeout) {
+ clearTimeout(timeout);
+ timeout = null;
+ }
+ previous = now;
+ result = func.apply(context, args);
+ if (!timeout) context = args = null;
+ } else if (!timeout && options.trailing !== false) {
+ timeout = setTimeout(later, remaining);
+ }
+ return result;
+ };
+ };
+
+ // Returns a function, that, as long as it continues to be invoked, will not
+ // be triggered. The function will be called after it stops being called for
+ // N milliseconds. If `immediate` is passed, trigger the function on the
+ // leading edge, instead of the trailing.
+ _.debounce = function(func, wait, immediate) {
+ var timeout, args, context, timestamp, result;
+
+ var later = function() {
+ var last = _.now() - timestamp;
+
+ if (last < wait && last >= 0) {
+ timeout = setTimeout(later, wait - last);
+ } else {
+ timeout = null;
+ if (!immediate) {
+ result = func.apply(context, args);
+ if (!timeout) context = args = null;
+ }
+ }
+ };
+
+ return function() {
+ context = this;
+ args = arguments;
+ timestamp = _.now();
+ var callNow = immediate && !timeout;
+ if (!timeout) timeout = setTimeout(later, wait);
+ if (callNow) {
+ result = func.apply(context, args);
+ context = args = null;
+ }
+
+ return result;
+ };
+ };
+
+ // Returns the first function passed as an argument to the second,
+ // allowing you to adjust arguments, run code before and after, and
+ // conditionally execute the original function.
+ _.wrap = function(func, wrapper) {
+ return _.partial(wrapper, func);
+ };
+
+ // Returns a negated version of the passed-in predicate.
+ _.negate = function(predicate) {
+ return function() {
+ return !predicate.apply(this, arguments);
+ };
+ };
+
+ // Returns a function that is the composition of a list of functions, each
+ // consuming the return value of the function that follows.
+ _.compose = function() {
+ var args = arguments;
+ var start = args.length - 1;
+ return function() {
+ var i = start;
+ var result = args[start].apply(this, arguments);
+ while (i--) result = args[i].call(this, result);
+ return result;
+ };
+ };
+
+ // Returns a function that will only be executed on and after the Nth call.
+ _.after = function(times, func) {
+ return function() {
+ if (--times < 1) {
+ return func.apply(this, arguments);
+ }
+ };
+ };
+
+ // Returns a function that will only be executed up to (but not including) the Nth call.
+ _.before = function(times, func) {
+ var memo;
+ return function() {
+ if (--times > 0) {
+ memo = func.apply(this, arguments);
+ }
+ if (times <= 1) func = null;
+ return memo;
+ };
+ };
+
+ // Returns a function that will be executed at most one time, no matter how
+ // often you call it. Useful for lazy initialization.
+ _.once = _.partial(_.before, 2);
+
+ // Object Functions
+ // ----------------
+
+ // Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed.
+ var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString');
+ var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString',
+ 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];
+
+ function collectNonEnumProps(obj, keys) {
+ var nonEnumIdx = nonEnumerableProps.length;
+ var constructor = obj.constructor;
+ var proto = (_.isFunction(constructor) && constructor.prototype) || ObjProto;
+
+ // Constructor is a special case.
+ var prop = 'constructor';
+ if (_.has(obj, prop) && !_.contains(keys, prop)) keys.push(prop);
+
+ while (nonEnumIdx--) {
+ prop = nonEnumerableProps[nonEnumIdx];
+ if (prop in obj && obj[prop] !== proto[prop] && !_.contains(keys, prop)) {
+ keys.push(prop);
+ }
+ }
+ }
+
+ // Retrieve the names of an object's own properties.
+ // Delegates to **ECMAScript 5**'s native `Object.keys`
+ _.keys = function(obj) {
+ if (!_.isObject(obj)) return [];
+ if (nativeKeys) return nativeKeys(obj);
+ var keys = [];
+ for (var key in obj) if (_.has(obj, key)) keys.push(key);
+ // Ahem, IE < 9.
+ if (hasEnumBug) collectNonEnumProps(obj, keys);
+ return keys;
+ };
+
+ // Retrieve all the property names of an object.
+ _.allKeys = function(obj) {
+ if (!_.isObject(obj)) return [];
+ var keys = [];
+ for (var key in obj) keys.push(key);
+ // Ahem, IE < 9.
+ if (hasEnumBug) collectNonEnumProps(obj, keys);
+ return keys;
+ };
+
+ // Retrieve the values of an object's properties.
+ _.values = function(obj) {
+ var keys = _.keys(obj);
+ var length = keys.length;
+ var values = Array(length);
+ for (var i = 0; i < length; i++) {
+ values[i] = obj[keys[i]];
+ }
+ return values;
+ };
+
+ // Returns the results of applying the iteratee to each element of the object
+ // In contrast to _.map it returns an object
+ _.mapObject = function(obj, iteratee, context) {
+ iteratee = cb(iteratee, context);
+ var keys = _.keys(obj),
+ length = keys.length,
+ results = {},
+ currentKey;
+ for (var index = 0; index < length; index++) {
+ currentKey = keys[index];
+ results[currentKey] = iteratee(obj[currentKey], currentKey, obj);
+ }
+ return results;
+ };
+
+ // Convert an object into a list of `[key, value]` pairs.
+ _.pairs = function(obj) {
+ var keys = _.keys(obj);
+ var length = keys.length;
+ var pairs = Array(length);
+ for (var i = 0; i < length; i++) {
+ pairs[i] = [keys[i], obj[keys[i]]];
+ }
+ return pairs;
+ };
+
+ // Invert the keys and values of an object. The values must be serializable.
+ _.invert = function(obj) {
+ var result = {};
+ var keys = _.keys(obj);
+ for (var i = 0, length = keys.length; i < length; i++) {
+ result[obj[keys[i]]] = keys[i];
+ }
+ return result;
+ };
+
+ // Return a sorted list of the function names available on the object.
+ // Aliased as `methods`
+ _.functions = _.methods = function(obj) {
+ var names = [];
+ for (var key in obj) {
+ if (_.isFunction(obj[key])) names.push(key);
+ }
+ return names.sort();
+ };
+
+ // Extend a given object with all the properties in passed-in object(s).
+ _.extend = createAssigner(_.allKeys);
+
+ // Assigns a given object with all the own properties in the passed-in object(s)
+ // (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)
+ _.extendOwn = _.assign = createAssigner(_.keys);
+
+ // Returns the first key on an object that passes a predicate test
+ _.findKey = function(obj, predicate, context) {
+ predicate = cb(predicate, context);
+ var keys = _.keys(obj), key;
+ for (var i = 0, length = keys.length; i < length; i++) {
+ key = keys[i];
+ if (predicate(obj[key], key, obj)) return key;
+ }
+ };
+
+ // Return a copy of the object only containing the whitelisted properties.
+ _.pick = function(object, oiteratee, context) {
+ var result = {}, obj = object, iteratee, keys;
+ if (obj == null) return result;
+ if (_.isFunction(oiteratee)) {
+ keys = _.allKeys(obj);
+ iteratee = optimizeCb(oiteratee, context);
+ } else {
+ keys = flatten(arguments, false, false, 1);
+ iteratee = function(value, key, obj) { return key in obj; };
+ obj = Object(obj);
+ }
+ for (var i = 0, length = keys.length; i < length; i++) {
+ var key = keys[i];
+ var value = obj[key];
+ if (iteratee(value, key, obj)) result[key] = value;
+ }
+ return result;
+ };
+
+ // Return a copy of the object without the blacklisted properties.
+ _.omit = function(obj, iteratee, context) {
+ if (_.isFunction(iteratee)) {
+ iteratee = _.negate(iteratee);
+ } else {
+ var keys = _.map(flatten(arguments, false, false, 1), String);
+ iteratee = function(value, key) {
+ return !_.contains(keys, key);
+ };
+ }
+ return _.pick(obj, iteratee, context);
+ };
+
+ // Fill in a given object with default properties.
+ _.defaults = createAssigner(_.allKeys, true);
+
+ // Creates an object that inherits from the given prototype object.
+ // If additional properties are provided then they will be added to the
+ // created object.
+ _.create = function(prototype, props) {
+ var result = baseCreate(prototype);
+ if (props) _.extendOwn(result, props);
+ return result;
+ };
+
+ // Create a (shallow-cloned) duplicate of an object.
+ _.clone = function(obj) {
+ if (!_.isObject(obj)) return obj;
+ return _.isArray(obj) ? obj.slice() : _.extend({}, obj);
+ };
+
+ // Invokes interceptor with the obj, and then returns obj.
+ // The primary purpose of this method is to "tap into" a method chain, in
+ // order to perform operations on intermediate results within the chain.
+ _.tap = function(obj, interceptor) {
+ interceptor(obj);
+ return obj;
+ };
+
+ // Returns whether an object has a given set of `key:value` pairs.
+ _.isMatch = function(object, attrs) {
+ var keys = _.keys(attrs), length = keys.length;
+ if (object == null) return !length;
+ var obj = Object(object);
+ for (var i = 0; i < length; i++) {
+ var key = keys[i];
+ if (attrs[key] !== obj[key] || !(key in obj)) return false;
+ }
+ return true;
+ };
+
+
+ // Internal recursive comparison function for `isEqual`.
+ var eq = function(a, b, aStack, bStack) {
+ // Identical objects are equal. `0 === -0`, but they aren't identical.
+ // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).
+ if (a === b) return a !== 0 || 1 / a === 1 / b;
+ // A strict comparison is necessary because `null == undefined`.
+ if (a == null || b == null) return a === b;
+ // Unwrap any wrapped objects.
+ if (a instanceof _) a = a._wrapped;
+ if (b instanceof _) b = b._wrapped;
+ // Compare `[[Class]]` names.
+ var className = toString.call(a);
+ if (className !== toString.call(b)) return false;
+ switch (className) {
+ // Strings, numbers, regular expressions, dates, and booleans are compared by value.
+ case '[object RegExp]':
+ // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')
+ case '[object String]':
+ // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
+ // equivalent to `new String("5")`.
+ return '' + a === '' + b;
+ case '[object Number]':
+ // `NaN`s are equivalent, but non-reflexive.
+ // Object(NaN) is equivalent to NaN
+ if (+a !== +a) return +b !== +b;
+ // An `egal` comparison is performed for other numeric values.
+ return +a === 0 ? 1 / +a === 1 / b : +a === +b;
+ case '[object Date]':
+ case '[object Boolean]':
+ // Coerce dates and booleans to numeric primitive values. Dates are compared by their
+ // millisecond representations. Note that invalid dates with millisecond representations
+ // of `NaN` are not equivalent.
+ return +a === +b;
+ }
+
+ var areArrays = className === '[object Array]';
+ if (!areArrays) {
+ if (typeof a != 'object' || typeof b != 'object') return false;
+
+ // Objects with different constructors are not equivalent, but `Object`s or `Array`s
+ // from different frames are.
+ var aCtor = a.constructor, bCtor = b.constructor;
+ if (aCtor !== bCtor && !(_.isFunction(aCtor) && aCtor instanceof aCtor &&
+ _.isFunction(bCtor) && bCtor instanceof bCtor)
+ && ('constructor' in a && 'constructor' in b)) {
+ return false;
+ }
+ }
+ // Assume equality for cyclic structures. The algorithm for detecting cyclic
+ // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
+
+ // Initializing stack of traversed objects.
+ // It's done here since we only need them for objects and arrays comparison.
+ aStack = aStack || [];
+ bStack = bStack || [];
+ var length = aStack.length;
+ while (length--) {
+ // Linear search. Performance is inversely proportional to the number of
+ // unique nested structures.
+ if (aStack[length] === a) return bStack[length] === b;
+ }
+
+ // Add the first object to the stack of traversed objects.
+ aStack.push(a);
+ bStack.push(b);
+
+ // Recursively compare objects and arrays.
+ if (areArrays) {
+ // Compare array lengths to determine if a deep comparison is necessary.
+ length = a.length;
+ if (length !== b.length) return false;
+ // Deep compare the contents, ignoring non-numeric properties.
+ while (length--) {
+ if (!eq(a[length], b[length], aStack, bStack)) return false;
+ }
+ } else {
+ // Deep compare objects.
+ var keys = _.keys(a), key;
+ length = keys.length;
+ // Ensure that both objects contain the same number of properties before comparing deep equality.
+ if (_.keys(b).length !== length) return false;
+ while (length--) {
+ // Deep compare each member
+ key = keys[length];
+ if (!(_.has(b, key) && eq(a[key], b[key], aStack, bStack))) return false;
+ }
+ }
+ // Remove the first object from the stack of traversed objects.
+ aStack.pop();
+ bStack.pop();
+ return true;
+ };
+
+ // Perform a deep comparison to check if two objects are equal.
+ _.isEqual = function(a, b) {
+ return eq(a, b);
+ };
+
+ // Is a given array, string, or object empty?
+ // An "empty" object has no enumerable own-properties.
+ _.isEmpty = function(obj) {
+ if (obj == null) return true;
+ if (isArrayLike(obj) && (_.isArray(obj) || _.isString(obj) || _.isArguments(obj))) return obj.length === 0;
+ return _.keys(obj).length === 0;
+ };
+
+ // Is a given value a DOM element?
+ _.isElement = function(obj) {
+ return !!(obj && obj.nodeType === 1);
+ };
+
+ // Is a given value an array?
+ // Delegates to ECMA5's native Array.isArray
+ _.isArray = nativeIsArray || function(obj) {
+ return toString.call(obj) === '[object Array]';
+ };
+
+ // Is a given variable an object?
+ _.isObject = function(obj) {
+ var type = typeof obj;
+ return type === 'function' || type === 'object' && !!obj;
+ };
+
+ // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp, isError.
+ _.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp', 'Error'], function(name) {
+ _['is' + name] = function(obj) {
+ return toString.call(obj) === '[object ' + name + ']';
+ };
+ });
+
+ // Define a fallback version of the method in browsers (ahem, IE < 9), where
+ // there isn't any inspectable "Arguments" type.
+ if (!_.isArguments(arguments)) {
+ _.isArguments = function(obj) {
+ return _.has(obj, 'callee');
+ };
+ }
+
+ // Optimize `isFunction` if appropriate. Work around some typeof bugs in old v8,
+ // IE 11 (#1621), and in Safari 8 (#1929).
+ if (typeof /./ != 'function' && typeof Int8Array != 'object') {
+ _.isFunction = function(obj) {
+ return typeof obj == 'function' || false;
+ };
+ }
+
+ // Is a given object a finite number?
+ _.isFinite = function(obj) {
+ return isFinite(obj) && !isNaN(parseFloat(obj));
+ };
+
+ // Is the given value `NaN`? (NaN is the only number which does not equal itself).
+ _.isNaN = function(obj) {
+ return _.isNumber(obj) && obj !== +obj;
+ };
+
+ // Is a given value a boolean?
+ _.isBoolean = function(obj) {
+ return obj === true || obj === false || toString.call(obj) === '[object Boolean]';
+ };
+
+ // Is a given value equal to null?
+ _.isNull = function(obj) {
+ return obj === null;
+ };
+
+ // Is a given variable undefined?
+ _.isUndefined = function(obj) {
+ return obj === void 0;
+ };
+
+ // Shortcut function for checking if an object has a given property directly
+ // on itself (in other words, not on a prototype).
+ _.has = function(obj, key) {
+ return obj != null && hasOwnProperty.call(obj, key);
+ };
+
+ // Utility Functions
+ // -----------------
+
+ // Run Underscore.js in *noConflict* mode, returning the `_` variable to its
+ // previous owner. Returns a reference to the Underscore object.
+ _.noConflict = function() {
+ root._ = previousUnderscore;
+ return this;
+ };
+
+ // Keep the identity function around for default iteratees.
+ _.identity = function(value) {
+ return value;
+ };
+
+ // Predicate-generating functions. Often useful outside of Underscore.
+ _.constant = function(value) {
+ return function() {
+ return value;
+ };
+ };
+
+ _.noop = function(){};
+
+ _.property = property;
+
+ // Generates a function for a given object that returns a given property.
+ _.propertyOf = function(obj) {
+ return obj == null ? function(){} : function(key) {
+ return obj[key];
+ };
+ };
+
+ // Returns a predicate for checking whether an object has a given set of
+ // `key:value` pairs.
+ _.matcher = _.matches = function(attrs) {
+ attrs = _.extendOwn({}, attrs);
+ return function(obj) {
+ return _.isMatch(obj, attrs);
+ };
+ };
+
+ // Run a function **n** times.
+ _.times = function(n, iteratee, context) {
+ var accum = Array(Math.max(0, n));
+ iteratee = optimizeCb(iteratee, context, 1);
+ for (var i = 0; i < n; i++) accum[i] = iteratee(i);
+ return accum;
+ };
+
+ // Return a random integer between min and max (inclusive).
+ _.random = function(min, max) {
+ if (max == null) {
+ max = min;
+ min = 0;
+ }
+ return min + Math.floor(Math.random() * (max - min + 1));
+ };
+
+ // A (possibly faster) way to get the current timestamp as an integer.
+ _.now = Date.now || function() {
+ return new Date().getTime();
+ };
+
+ // List of HTML entities for escaping.
+ var escapeMap = {
+ '&': '&amp;',
+ '<': '&lt;',
+ '>': '&gt;',
+ '"': '&quot;',
+ "'": '&#x27;',
+ '`': '&#x60;'
+ };
+ var unescapeMap = _.invert(escapeMap);
+
+ // Functions for escaping and unescaping strings to/from HTML interpolation.
+ var createEscaper = function(map) {
+ var escaper = function(match) {
+ return map[match];
+ };
+ // Regexes for identifying a key that needs to be escaped
+ var source = '(?:' + _.keys(map).join('|') + ')';
+ var testRegexp = RegExp(source);
+ var replaceRegexp = RegExp(source, 'g');
+ return function(string) {
+ string = string == null ? '' : '' + string;
+ return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;
+ };
+ };
+ _.escape = createEscaper(escapeMap);
+ _.unescape = createEscaper(unescapeMap);
+
+ // If the value of the named `property` is a function then invoke it with the
+ // `object` as context; otherwise, return it.
+ _.result = function(object, property, fallback) {
+ var value = object == null ? void 0 : object[property];
+ if (value === void 0) {
+ value = fallback;
+ }
+ return _.isFunction(value) ? value.call(object) : value;
+ };
+
+ // Generate a unique integer id (unique within the entire client session).
+ // Useful for temporary DOM ids.
+ var idCounter = 0;
+ _.uniqueId = function(prefix) {
+ var id = ++idCounter + '';
+ return prefix ? prefix + id : id;
+ };
+
+ // By default, Underscore uses ERB-style template delimiters, change the
+ // following template settings to use alternative delimiters.
+ _.templateSettings = {
+ evaluate : /<%([\s\S]+?)%>/g,
+ interpolate : /<%=([\s\S]+?)%>/g,
+ escape : /<%-([\s\S]+?)%>/g
+ };
+
+ // When customizing `templateSettings`, if you don't want to define an
+ // interpolation, evaluation or escaping regex, we need one that is
+ // guaranteed not to match.
+ var noMatch = /(.)^/;
+
+ // Certain characters need to be escaped so that they can be put into a
+ // string literal.
+ var escapes = {
+ "'": "'",
+ '\\': '\\',
+ '\r': 'r',
+ '\n': 'n',
+ '\u2028': 'u2028',
+ '\u2029': 'u2029'
+ };
+
+ var escaper = /\\|'|\r|\n|\u2028|\u2029/g;
+
+ var escapeChar = function(match) {
+ return '\\' + escapes[match];
+ };
+
+ // JavaScript micro-templating, similar to John Resig's implementation.
+ // Underscore templating handles arbitrary delimiters, preserves whitespace,
+ // and correctly escapes quotes within interpolated code.
+ // NB: `oldSettings` only exists for backwards compatibility.
+ _.template = function(text, settings, oldSettings) {
+ if (!settings && oldSettings) settings = oldSettings;
+ settings = _.defaults({}, settings, _.templateSettings);
+
+ // Combine delimiters into one regular expression via alternation.
+ var matcher = RegExp([
+ (settings.escape || noMatch).source,
+ (settings.interpolate || noMatch).source,
+ (settings.evaluate || noMatch).source
+ ].join('|') + '|$', 'g');
+
+ // Compile the template source, escaping string literals appropriately.
+ var index = 0;
+ var source = "__p+='";
+ text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
+ source += text.slice(index, offset).replace(escaper, escapeChar);
+ index = offset + match.length;
+
+ if (escape) {
+ source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'";
+ } else if (interpolate) {
+ source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'";
+ } else if (evaluate) {
+ source += "';\n" + evaluate + "\n__p+='";
+ }
+
+ // Adobe VMs need the match returned to produce the correct offest.
+ return match;
+ });
+ source += "';\n";
+
+ // If a variable is not specified, place data values in local scope.
+ if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n';
+
+ source = "var __t,__p='',__j=Array.prototype.join," +
+ "print=function(){__p+=__j.call(arguments,'');};\n" +
+ source + 'return __p;\n';
+
+ try {
+ var render = new Function(settings.variable || 'obj', '_', source);
+ } catch (e) {
+ e.source = source;
+ throw e;
+ }
+
+ var template = function(data) {
+ return render.call(this, data, _);
+ };
+
+ // Provide the compiled source as a convenience for precompilation.
+ var argument = settings.variable || 'obj';
+ template.source = 'function(' + argument + '){\n' + source + '}';
+
+ return template;
+ };
+
+ // Add a "chain" function. Start chaining a wrapped Underscore object.
+ _.chain = function(obj) {
+ var instance = _(obj);
+ instance._chain = true;
+ return instance;
+ };
+
+ // OOP
+ // ---------------
+ // If Underscore is called as a function, it returns a wrapped object that
+ // can be used OO-style. This wrapper holds altered versions of all the
+ // underscore functions. Wrapped objects may be chained.
+
+ // Helper function to continue chaining intermediate results.
+ var result = function(instance, obj) {
+ return instance._chain ? _(obj).chain() : obj;
+ };
+
+ // Add your own custom functions to the Underscore object.
+ _.mixin = function(obj) {
+ _.each(_.functions(obj), function(name) {
+ var func = _[name] = obj[name];
+ _.prototype[name] = function() {
+ var args = [this._wrapped];
+ push.apply(args, arguments);
+ return result(this, func.apply(_, args));
+ };
+ });
+ };
+
+ // Add all of the Underscore functions to the wrapper object.
+ _.mixin(_);
+
+ // Add all mutator Array functions to the wrapper.
+ _.each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
+ var method = ArrayProto[name];
+ _.prototype[name] = function() {
+ var obj = this._wrapped;
+ method.apply(obj, arguments);
+ if ((name === 'shift' || name === 'splice') && obj.length === 0) delete obj[0];
+ return result(this, obj);
+ };
+ });
+
+ // Add all accessor Array functions to the wrapper.
+ _.each(['concat', 'join', 'slice'], function(name) {
+ var method = ArrayProto[name];
+ _.prototype[name] = function() {
+ return result(this, method.apply(this._wrapped, arguments));
+ };
+ });
+
+ // Extracts the result from a wrapped and chained object.
+ _.prototype.value = function() {
+ return this._wrapped;
+ };
+
+ // Provide unwrapping proxy for some methods used in engine operations
+ // such as arithmetic and JSON stringification.
+ _.prototype.valueOf = _.prototype.toJSON = _.prototype.value;
+
+ _.prototype.toString = function() {
+ return '' + this._wrapped;
+ };
+
+ // AMD registration happens at the end for compatibility with AMD loaders
+ // that may not enforce next-turn semantics on modules. Even though general
+ // practice for AMD registration is to be anonymous, underscore registers
+ // as a named module because, like jQuery, it is a base library that is
+ // popular enough to be bundled in a third party lib, but not be part of
+ // an AMD load request. Those cases could generate an error when an
+ // anonymous define() is called outside of a loader request.
+ if (typeof define === 'function' && define.amd) {
+ define('underscore', [], function() {
+ return _;
+ });
+ }
+}.call(this));
diff --git a/public_html/data/local b/public_html/data/local
new file mode 120000
index 000000000..82a3614eb
--- /dev/null
+++ b/public_html/data/local
@@ -0,0 +1 @@
+../../data/local \ No newline at end of file
diff --git a/public_html/index.php b/public_html/index.php
new file mode 100644
index 000000000..930737eb1
--- /dev/null
+++ b/public_html/index.php
@@ -0,0 +1,392 @@
+<?php
+/**
+ * CodeIgniter
+ *
+ * An open source application development framework for PHP
+ *
+ * This content is released under the MIT License (MIT)
+ *
+ * Copyright (c) 2014 - 2019, British Columbia Institute of Technology
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ * @package CodeIgniter
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
+ * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
+ * @license https://opensource.org/licenses/MIT MIT License
+ * @link https://codeigniter.com
+ * @since Version 1.0.0
+ * @filesource
+ */
+
+/*
+ *---------------------------------------------------------------
+ * APPLICATION ENVIRONMENT
+ *---------------------------------------------------------------
+ *
+ * You can load different configurations depending on your
+ * current environment. Setting the environment also influences
+ * things like logging and error reporting.
+ *
+ * This can be set to anything, but default usage is:
+ *
+ * development
+ * testing
+ * production
+ *
+ * NOTE: If you change these, also change the error_reporting() code below
+ */
+ define('ENVIRONMENT', 'development');
+/*
+ *---------------------------------------------------------------
+ * ERROR REPORTING
+ *---------------------------------------------------------------
+ *
+ * Different environments will require different levels of error reporting.
+ * By default development will show errors but testing and live will hide them.
+ */
+if (false) {
+switch (ENVIRONMENT)
+{
+ case 'development':
+ error_reporting(-1);
+ ini_set('display_errors', 1);
+ break;
+
+ case 'testing':
+ case 'production':
+ ini_set('display_errors', 0);
+ if (version_compare(PHP_VERSION, '5.3', '>='))
+ {
+ error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED);
+ }
+ else
+ {
+ error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_USER_NOTICE);
+ }
+ break;
+
+ default:
+ header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
+ echo 'The application environment is not set correctly.';
+ exit(1); // EXIT_ERROR
+}
+}
+
+/*
+ *---------------------------------------------------------------
+ * SYSTEM DIRECTORY NAME
+ *---------------------------------------------------------------
+ *
+ * This variable must contain the name of your "system" directory.
+ * Set the path if it is not in the same directory as this file.
+ */
+ $system_path = dirname(__FILE__).'/../system';
+
+/*
+ *---------------------------------------------------------------
+ * APPLICATION DIRECTORY NAME
+ *---------------------------------------------------------------
+ *
+ * If you want this front controller to use a different "application"
+ * directory than the default one you can set its name here. The directory
+ * can also be renamed or relocated anywhere on your server. If you do,
+ * use an absolute (full) server path.
+ * For more info please see the user guide:
+ *
+ * https://codeigniter.com/user_guide/general/managing_apps.html
+ *
+ * NO TRAILING SLASH!
+ */
+ $application_folder = dirname(__FILE__).'/../application';
+
+/*
+ *---------------------------------------------------------------
+ * VIEW DIRECTORY NAME
+ *---------------------------------------------------------------
+ *
+ * If you want to move the view directory out of the application
+ * directory, set the path to it here. The directory can be renamed
+ * and relocated anywhere on your server. If blank, it will default
+ * to the standard location inside your application directory.
+ * If you do move this, use an absolute (full) server path.
+ *
+ * NO TRAILING SLASH!
+ */
+ $view_folder = '';
+
+
+/*
+ * --------------------------------------------------------------------
+ * DEFAULT CONTROLLER
+ * --------------------------------------------------------------------
+ *
+ * Normally you will set your default controller in the routes.php file.
+ * You can, however, force a custom routing by hard-coding a
+ * specific controller class/function here. For most applications, you
+ * WILL NOT set your routing here, but it's an option for those
+ * special instances where you might want to override the standard
+ * routing in a specific front controller that shares a common CI installation.
+ *
+ * IMPORTANT: If you set the routing here, NO OTHER controller will be
+ * callable. In essence, this preference limits your application to ONE
+ * specific controller. Leave the function name blank if you need
+ * to call functions dynamically via the URI.
+ *
+ * Un-comment the $routing array below to use this feature
+ */
+ // The directory name, relative to the "controllers" directory. Leave blank
+ // if your controller is not in a sub-directory within the "controllers" one
+ // $routing['directory'] = '';
+
+ // The controller class file name. Example: Mycontroller
+ // $routing['controller'] = '';
+
+ // The controller function you wish to be called.
+ // $routing['function'] = '';
+
+
+/*
+ * -------------------------------------------------------------------
+ * CUSTOM CONFIG VALUES
+ * -------------------------------------------------------------------
+ *
+ * The $assign_to_config array below will be passed dynamically to the
+ * config class when initialized. This allows you to set custom config
+ * items or override any default config values found in the config.php file.
+ * This can be handy as it permits you to share one application between
+ * multiple front controller files, with each file containing different
+ * config values.
+ *
+ * Un-comment the $assign_to_config array below to use this feature
+ */
+ // $assign_to_config['name_of_config_item'] = 'value of config item';
+
+
+
+// --------------------------------------------------------------------
+// END OF USER CONFIGURABLE SETTINGS. DO NOT EDIT BELOW THIS LINE
+// --------------------------------------------------------------------
+
+/*
+ * ---------------------------------------------------------------
+ * Resolve the system path for increased reliability
+ * ---------------------------------------------------------------
+ */
+
+ // Set the current directory correctly for CLI requests
+ if (defined('STDIN'))
+ {
+ chdir(dirname(__FILE__).'/..');
+ }
+
+ if (($_temp = realpath($system_path)) !== FALSE)
+ {
+ $system_path = $_temp.DIRECTORY_SEPARATOR;
+ }
+ else
+ {
+ // Ensure there's a trailing slash
+ $system_path = strtr(
+ rtrim($system_path, '/\\'),
+ '/\\',
+ DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR
+ ).DIRECTORY_SEPARATOR;
+ }
+
+ // Is the system path correct?
+ if ( ! is_dir($system_path))
+ {
+ header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
+ echo 'Your system folder path does not appear to be set correctly. Please open the following file and correct this: '.pathinfo(__FILE__, PATHINFO_BASENAME);
+ exit(3); // EXIT_CONFIG
+ }
+
+/*
+ * -------------------------------------------------------------------
+ * Now that we know the path, set the main path constants
+ * -------------------------------------------------------------------
+ */
+ // The name of THIS file
+ define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
+
+ // Path to the system directory
+ define('BASEPATH', $system_path);
+
+ // Path to the front controller (this file) directory
+ define('FCPATH', dirname(__FILE__).DIRECTORY_SEPARATOR."..".DIRECTORY_SEPARATOR);
+
+ // Name of the "system" directory
+ define('SYSDIR', basename(BASEPATH));
+
+ // The path to the "application" directory
+ if (is_dir($application_folder))
+ {
+ if (($_temp = realpath($application_folder)) !== FALSE)
+ {
+ $application_folder = $_temp;
+ }
+ else
+ {
+ $application_folder = strtr(
+ rtrim($application_folder, '/\\'),
+ '/\\',
+ DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR
+ );
+ }
+ }
+ elseif (is_dir(BASEPATH.$application_folder.DIRECTORY_SEPARATOR))
+ {
+ $application_folder = BASEPATH.strtr(
+ trim($application_folder, '/\\'),
+ '/\\',
+ DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR
+ );
+ }
+ else
+ {
+ header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
+ echo 'Your application folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF;
+ exit(3); // EXIT_CONFIG
+ }
+
+ define('APPPATH', $application_folder.DIRECTORY_SEPARATOR);
+
+ // The path to the "views" directory
+ if ( ! isset($view_folder[0]) && is_dir(APPPATH.'views'.DIRECTORY_SEPARATOR))
+ {
+ $view_folder = APPPATH.'views';
+ }
+ elseif (is_dir($view_folder))
+ {
+ if (($_temp = realpath($view_folder)) !== FALSE)
+ {
+ $view_folder = $_temp;
+ }
+ else
+ {
+ $view_folder = strtr(
+ rtrim($view_folder, '/\\'),
+ '/\\',
+ DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR
+ );
+ }
+ }
+ elseif (is_dir(APPPATH.$view_folder.DIRECTORY_SEPARATOR))
+ {
+ $view_folder = APPPATH.strtr(
+ trim($view_folder, '/\\'),
+ '/\\',
+ DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR
+ );
+ }
+ else
+ {
+ header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
+ echo 'Your view folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF;
+ exit(3); // EXIT_CONFIG
+ }
+
+ define('VIEWPATH', $view_folder.DIRECTORY_SEPARATOR);
+
+ if (getenv("HOME") == "") {
+ putenv('HOME='.FCPATH);
+ }
+
+/*
+ * Custom error handling
+ */
+
+require APPPATH.'libraries/ExceptionHandler.php';
+\libraries\ExceptionHandler::setup();
+
+// wrapper for CI so that it calls our handlers rather than it's own
+function _error_handler($severity, $message, $filepath, $line) {
+ return \libraries\ExceptionHandler::error_handler($severity, $message, $filepath, $line);
+}
+
+function _exception_handler($ex) {
+ return \libraries\ExceptionHandler::exception_handler($ex);
+}
+
+// Source: http://stackoverflow.com/a/15875555
+function guidv4()
+{
+ $data = openssl_random_pseudo_bytes(16);
+ assert(strlen($data) == 16);
+
+ $data[6] = chr(ord($data[6]) & 0x0f | 0x40); // set version to 0100
+ $data[8] = chr(ord($data[8]) & 0x3f | 0x80); // set bits 6-7 to 10
+
+ return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4));
+}
+
+/*
+ * --------------------------------------------------------------------
+ * LOAD THE BOOTSTRAP FILE
+ * --------------------------------------------------------------------
+ *
+ * And away we go...
+ */
+
+$testname = null;
+
+if (getenv("ENVIRONMENT") === "testsuite" && getenv("COLLECT_COVERAGE") == 1) {
+ if (function_exists("phpdbg_get_executable")) {
+ $testname = implode(' ', $argv);
+ } elseif (isset($_SERVER["HTTP_X_TESTSUITE_TESTNAME"])) {
+ $testname = $_SERVER["HTTP_X_TESTSUITE_TESTNAME"];
+ }
+}
+
+if ($testname) {
+ include APPPATH."../vendor/autoload.php";
+ $filter = new \SebastianBergmann\CodeCoverage\Filter();
+ $filter->includeDirectory(APPPATH);
+ $filter->excludeDirectory(APPPATH."/third_party/");
+ // Force phpdbg for speed
+ //$driver = new \SebastianBergmann\CodeCoverage\Driver\PHPDBG();
+ $driver = (new \SebastianBergmann\CodeCoverage\Driver\Selector)->forLineCoverage($filter);
+ $coverage = new \SebastianBergmann\CodeCoverage\CodeCoverage($driver, $filter);
+ $coverage->start($testname);
+}
+
+try {
+ require_once BASEPATH.'core/CodeIgniter.php';
+} catch (\exceptions\NotAuthenticatedException $e) {
+ $CI =& get_instance();
+ $redirect_uri = $CI->uri->uri_string();
+ if (isset($CI->data["redirect_uri"])) {
+ $redirect_uri = $CI->data["redirect_uri"];
+ }
+ redirect("user/login?redirect_uri=".$redirect_uri);
+} catch (\exceptions\PublicApiException $e) {
+ if ($e->get_http_error_code() == 500) {
+ \libraries\ExceptionHandler::log_exception($e);
+ }
+ show_error(nl2br(htmlspecialchars($e->__toString())), $e->get_http_error_code());
+} finally {
+ if ($testname) {
+ $coverage->stop();
+ $outputfile = FCPATH."/test-coverage-data/".guidv4();
+ file_put_contents($outputfile, serialize($coverage));
+ }
+}
+
diff --git a/public_html/robots.txt b/public_html/robots.txt
new file mode 100644
index 000000000..c6742d8a8
--- /dev/null
+++ b/public_html/robots.txt
@@ -0,0 +1,2 @@
+User-Agent: *
+Disallow: /
diff --git a/readme.rst b/readme.rst
deleted file mode 100644
index 63a55c3f4..000000000
--- a/readme.rst
+++ /dev/null
@@ -1,71 +0,0 @@
-###################
-What is CodeIgniter
-###################
-
-CodeIgniter is an Application Development Framework - a toolkit - for people
-who build web sites using PHP. Its goal is to enable you to develop projects
-much faster than you could if you were writing code from scratch, by providing
-a rich set of libraries for commonly needed tasks, as well as a simple
-interface and logical structure to access these libraries. CodeIgniter lets
-you creatively focus on your project by minimizing the amount of code needed
-for a given task.
-
-*******************
-Release Information
-*******************
-
-This repo contains in-development code for future releases. To download the
-latest stable release please visit the `CodeIgniter Downloads
-<https://codeigniter.com/download>`_ page.
-
-**************************
-Changelog and New Features
-**************************
-
-You can find a list of all changes for each release in the `user
-guide change log <https://github.com/bcit-ci/CodeIgniter/blob/develop/user_guide_src/source/changelog.rst>`_.
-
-*******************
-Server Requirements
-*******************
-
-PHP version 5.6 or newer is recommended.
-
-It should work on 5.3.7 as well, but we strongly advise you NOT to run
-such old versions of PHP, because of potential security and performance
-issues, as well as missing features.
-
-************
-Installation
-************
-
-Please see the `installation section <https://codeigniter.com/userguide3/installation/index.html>`_
-of the CodeIgniter User Guide.
-
-*******
-License
-*******
-
-Please see the `license
-agreement <https://github.com/bcit-ci/CodeIgniter/blob/develop/user_guide_src/source/license.rst>`_.
-
-*********
-Resources
-*********
-
-- `User Guide <https://codeigniter.com/docs>`_
-- `Contributing Guide <https://github.com/bcit-ci/CodeIgniter/blob/develop/contributing.md>`_
-- `Language File Translations <https://github.com/bcit-ci/codeigniter3-translations>`_
-- `Community Forums <http://forum.codeigniter.com/>`_
-- `Community Wiki <https://github.com/bcit-ci/CodeIgniter/wiki>`_
-- `Community Slack Channel <https://codeigniterchat.slack.com>`_
-
-Report security issues to our `Security Panel <mailto:security@codeigniter.com>`_
-or via our `page on HackerOne <https://hackerone.com/codeigniter>`_, thank you.
-
-***************
-Acknowledgement
-***************
-
-The CodeIgniter team would like to thank EllisLab, all the
-contributors to the CodeIgniter project and you, the CodeIgniter user.
diff --git a/robots.txt b/robots.txt
new file mode 120000
index 000000000..425a706a8
--- /dev/null
+++ b/robots.txt
@@ -0,0 +1 @@
+public_html/robots.txt \ No newline at end of file
diff --git a/run-tests.sh b/run-tests.sh
new file mode 100755
index 000000000..166aacd3f
--- /dev/null
+++ b/run-tests.sh
@@ -0,0 +1,59 @@
+#!/bin/bash
+#
+# This runs the testsuite. Arguments are passed to prove.
+#
+
+export ENVIRONMENT="testsuite"
+export COLLECT_COVERAGE=1
+
+if [[ $COLLECT_COVERAGE = 1 ]]; then
+ export XDEBUG_MODE=coverage
+fi
+
+startdir="$(dirname "$0")"
+datadir="testsuite-tmp"
+
+die() {
+ echo "$@" >&2
+ echo "Aborting..." >&2
+ exit 1
+}
+
+
+cd "$startdir"
+
+# some sanity checks
+test -d system || die 'Required dir not found.'
+test -d application || die 'Required dir not found.'
+test -f run-tests.sh || die 'Required file not found.'
+grep -qF 'getenv("ENVIRONMENT")' application/config/database.php || die "database config doesn't honor ENVIRONMENT."
+
+# prepare
+trap cleanup EXIT INT
+cleanup() {
+ pkill -P $$
+ php index.php tools drop_all_tables
+ rm -rf "$datadir"
+}
+
+rm -rf "$datadir"
+
+mkdir -p test-coverage-data
+mkdir -p "$datadir"
+
+php=(php)
+if ((COLLECT_COVERAGE)); then
+ php=(phpdbg -qrr)
+fi
+
+# run tests
+"${php[@]}" index.php tools drop_all_tables || exit 1
+"${php[@]}" index.php tools update_database || exit 1
+
+prove --ext .php --state=failed,save --timer --comments --exec "${php[*]} index.php tools test" --recurse "${@:-application/test/tests/}" || exit 1
+
+if (($COLLECT_COVERAGE)); then
+ php index.php tools generate_coverage_report
+ rm -rf test-coverage-data
+fi
+
diff --git a/scripts/get_lexer_list.py b/scripts/get_lexer_list.py
new file mode 100755
index 000000000..e7636b46d
--- /dev/null
+++ b/scripts/get_lexer_list.py
@@ -0,0 +1,18 @@
+#!/usr/bin/env python3
+
+import pygments.lexers
+import json
+
+ret = []
+
+def dictify(list):
+ return {k:True for k in list}
+
+for fullname, names, exts, mimetypes in pygments.lexers.get_all_lexers():
+ ret.append({
+ 'fullname': fullname,
+ 'names': names,
+ 'extentions': dictify(exts),
+ 'mimetypes': dictify(mimetypes),
+ })
+print(json.dumps(ret))
diff --git a/scripts/hooks-wrapper.sh b/scripts/hooks-wrapper.sh
new file mode 100755
index 000000000..2730d3394
--- /dev/null
+++ b/scripts/hooks-wrapper.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+if [ -x $0.local ]; then
+ $0.local "$@" || exit $?
+fi
+
+basename=$(basename "$0")
+hooks_dir="$GIT_DIR/../git-hooks"
+hook="$hooks_dir/$basename"
+
+if [ -x "$hook" ]; then
+ "$hook" "$@" || exit $?
+fi
diff --git a/scripts/install-git-hooks.sh b/scripts/install-git-hooks.sh
new file mode 100755
index 000000000..1a4113f8d
--- /dev/null
+++ b/scripts/install-git-hooks.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+set -e
+
+SCRIPTS_DIR=$(realpath $(dirname "$0"))
+HOOK_DIR=$(realpath "$SCRIPTS_DIR/../.git/hooks")
+HOOK_NAMES="applypatch-msg pre-applypatch post-applypatch pre-commit prepare-commit-msg commit-msg post-commit pre-rebase post-checkout post-merge pre-receive update post-receive post-update pre-auto-gc"
+
+for hook in $HOOK_NAMES; do
+ # If the hook already exists, is executable, and is not a symlink
+ if [ ! -h $HOOK_DIR/$hook -a -x $HOOK_DIR/$hook ]; then
+ mv $HOOK_DIR/$hook $HOOK_DIR/$hook.local
+ fi
+ # create the symlink, overwriting the file if it exists
+ # probably the only way this would happen is if you're using an old version of git
+ # -- back when the sample hooks were not executable, instead of being named ____.sample
+ ln -s -f ../../scripts/hooks-wrapper.sh $HOOK_DIR/$hook
+done
diff --git a/scripts/optimize_js.sh b/scripts/optimize_js.sh
new file mode 100755
index 000000000..f1bc1126e
--- /dev/null
+++ b/scripts/optimize_js.sh
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+script_dir=$(dirname "$0")
+js_dir="$script_dir/../data/js"
+outfile="$js_dir/main.min.js"
+node "$script_dir/r.js" -o mainConfigFile="$js_dir/main.js" name=main out=$outfile
diff --git a/scripts/r.js b/scripts/r.js
new file mode 100644
index 000000000..4cfd96d97
--- /dev/null
+++ b/scripts/r.js
@@ -0,0 +1,29002 @@
+/**
+ * @license r.js 2.1.17 Copyright (c) 2010-2015, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+
+/*
+ * This is a bootstrap script to allow running RequireJS in the command line
+ * in either a Java/Rhino or Node environment. It is modified by the top-level
+ * dist.js file to inject other files to completely enable this file. It is
+ * the shell of the r.js file.
+ */
+
+/*jslint evil: true, nomen: true, sloppy: true */
+/*global readFile: true, process: false, Packages: false, print: false,
+console: false, java: false, module: false, requirejsVars, navigator,
+document, importScripts, self, location, Components, FileUtils */
+
+var requirejs, require, define, xpcUtil;
+(function (console, args, readFileFunc) {
+ var fileName, env, fs, vm, path, exec, rhinoContext, dir, nodeRequire,
+ nodeDefine, exists, reqMain, loadedOptimizedLib, existsForNode, Cc, Ci,
+ version = '2.1.17',
+ jsSuffixRegExp = /\.js$/,
+ commandOption = '',
+ useLibLoaded = {},
+ //Used by jslib/rhino/args.js
+ rhinoArgs = args,
+ //Used by jslib/xpconnect/args.js
+ xpconnectArgs = args,
+ readFile = typeof readFileFunc !== 'undefined' ? readFileFunc : null;
+
+ function showHelp() {
+ console.log('See https://github.com/jrburke/r.js for usage.');
+ }
+
+ if ((typeof navigator !== 'undefined' && typeof document !== 'undefined') ||
+ (typeof importScripts !== 'undefined' && typeof self !== 'undefined')) {
+ env = 'browser';
+
+ readFile = function (path) {
+ return fs.readFileSync(path, 'utf8');
+ };
+
+ exec = function (string) {
+ return eval(string);
+ };
+
+ exists = function () {
+ console.log('x.js exists not applicable in browser env');
+ return false;
+ };
+
+ } else if (typeof process !== 'undefined' && process.versions && !!process.versions.node) {
+ env = 'node';
+
+ //Get the fs module via Node's require before it
+ //gets replaced. Used in require/node.js
+ fs = require('fs');
+ vm = require('vm');
+ path = require('path');
+ //In Node 0.7+ existsSync is on fs.
+ existsForNode = fs.existsSync || path.existsSync;
+
+ nodeRequire = require;
+ nodeDefine = define;
+ reqMain = require.main;
+
+ //Temporarily hide require and define to allow require.js to define
+ //them.
+ require = undefined;
+ define = undefined;
+
+ readFile = function (path) {
+ return fs.readFileSync(path, 'utf8');
+ };
+
+ exec = function (string, name) {
+ return vm.runInThisContext(this.requirejsVars.require.makeNodeWrapper(string),
+ name ? fs.realpathSync(name) : '');
+ };
+
+ exists = function (fileName) {
+ return existsForNode(fileName);
+ };
+
+
+ fileName = process.argv[2];
+
+ if (fileName && fileName.indexOf('-') === 0) {
+ commandOption = fileName.substring(1);
+ fileName = process.argv[3];
+ }
+ } else if (typeof Packages !== 'undefined') {
+ env = 'rhino';
+
+ fileName = args[0];
+
+ if (fileName && fileName.indexOf('-') === 0) {
+ commandOption = fileName.substring(1);
+ fileName = args[1];
+ }
+
+ //Exec/readFile differs between Rhino and Nashorn. Rhino has an
+ //importPackage where Nashorn does not, so branch on that. This is a
+ //coarser check -- detecting readFile existence might also be enough for
+ //this spot. However, sticking with importPackage to keep it the same
+ //as other Rhino/Nashorn detection branches.
+ if (typeof importPackage !== 'undefined') {
+ rhinoContext = Packages.org.mozilla.javascript.ContextFactory.getGlobal().enterContext();
+
+ exec = function (string, name) {
+ return rhinoContext.evaluateString(this, string, name, 0, null);
+ };
+ } else {
+ exec = function (string, name) {
+ load({ script: string, name: name});
+ };
+ readFile = readFully;
+ }
+
+ exists = function (fileName) {
+ return (new java.io.File(fileName)).exists();
+ };
+
+ //Define a console.log for easier logging. Don't
+ //get fancy though.
+ if (typeof console === 'undefined') {
+ console = {
+ log: function () {
+ print.apply(undefined, arguments);
+ }
+ };
+ }
+ } else if (typeof Components !== 'undefined' && Components.classes && Components.interfaces) {
+ env = 'xpconnect';
+
+ Components.utils['import']('resource://gre/modules/FileUtils.jsm');
+ Cc = Components.classes;
+ Ci = Components.interfaces;
+
+ fileName = args[0];
+
+ if (fileName && fileName.indexOf('-') === 0) {
+ commandOption = fileName.substring(1);
+ fileName = args[1];
+ }
+
+ xpcUtil = {
+ isWindows: ('@mozilla.org/windows-registry-key;1' in Cc),
+ cwd: function () {
+ return FileUtils.getFile("CurWorkD", []).path;
+ },
+
+ //Remove . and .. from paths, normalize on front slashes
+ normalize: function (path) {
+ //There has to be an easier way to do this.
+ var i, part, ary,
+ firstChar = path.charAt(0);
+
+ if (firstChar !== '/' &&
+ firstChar !== '\\' &&
+ path.indexOf(':') === -1) {
+ //A relative path. Use the current working directory.
+ path = xpcUtil.cwd() + '/' + path;
+ }
+
+ ary = path.replace(/\\/g, '/').split('/');
+
+ for (i = 0; i < ary.length; i += 1) {
+ part = ary[i];
+ if (part === '.') {
+ ary.splice(i, 1);
+ i -= 1;
+ } else if (part === '..') {
+ ary.splice(i - 1, 2);
+ i -= 2;
+ }
+ }
+ return ary.join('/');
+ },
+
+ xpfile: function (path) {
+ var fullPath;
+ try {
+ fullPath = xpcUtil.normalize(path);
+ if (xpcUtil.isWindows) {
+ fullPath = fullPath.replace(/\//g, '\\');
+ }
+ return new FileUtils.File(fullPath);
+ } catch (e) {
+ throw new Error((fullPath || path) + ' failed: ' + e);
+ }
+ },
+
+ readFile: function (/*String*/path, /*String?*/encoding) {
+ //A file read function that can deal with BOMs
+ encoding = encoding || "utf-8";
+
+ var inStream, convertStream,
+ readData = {},
+ fileObj = xpcUtil.xpfile(path);
+
+ //XPCOM, you so crazy
+ try {
+ inStream = Cc['@mozilla.org/network/file-input-stream;1']
+ .createInstance(Ci.nsIFileInputStream);
+ inStream.init(fileObj, 1, 0, false);
+
+ convertStream = Cc['@mozilla.org/intl/converter-input-stream;1']
+ .createInstance(Ci.nsIConverterInputStream);
+ convertStream.init(inStream, encoding, inStream.available(),
+ Ci.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER);
+
+ convertStream.readString(inStream.available(), readData);
+ return readData.value;
+ } catch (e) {
+ throw new Error((fileObj && fileObj.path || '') + ': ' + e);
+ } finally {
+ if (convertStream) {
+ convertStream.close();
+ }
+ if (inStream) {
+ inStream.close();
+ }
+ }
+ }
+ };
+
+ readFile = xpcUtil.readFile;
+
+ exec = function (string) {
+ return eval(string);
+ };
+
+ exists = function (fileName) {
+ return xpcUtil.xpfile(fileName).exists();
+ };
+
+ //Define a console.log for easier logging. Don't
+ //get fancy though.
+ if (typeof console === 'undefined') {
+ console = {
+ log: function () {
+ print.apply(undefined, arguments);
+ }
+ };
+ }
+ }
+
+ /** vim: et:ts=4:sw=4:sts=4
+ * @license RequireJS 2.1.17 Copyright (c) 2010-2015, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+//Not using strict: uneven strict support in browsers, #392, and causes
+//problems with requirejs.exec()/transpiler plugins that may not be strict.
+/*jslint regexp: true, nomen: true, sloppy: true */
+/*global window, navigator, document, importScripts, setTimeout, opera */
+
+
+(function (global) {
+ var req, s, head, baseElement, dataMain, src,
+ interactiveScript, currentlyAddingScript, mainScript, subPath,
+ version = '2.1.17',
+ commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,
+ cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,
+ jsSuffixRegExp = /\.js$/,
+ currDirRegExp = /^\.\//,
+ op = Object.prototype,
+ ostring = op.toString,
+ hasOwn = op.hasOwnProperty,
+ ap = Array.prototype,
+ apsp = ap.splice,
+ isBrowser = !!(typeof window !== 'undefined' && typeof navigator !== 'undefined' && window.document),
+ isWebWorker = !isBrowser && typeof importScripts !== 'undefined',
+ //PS3 indicates loaded and complete, but need to wait for complete
+ //specifically. Sequence is 'loading', 'loaded', execution,
+ // then 'complete'. The UA check is unfortunate, but not sure how
+ //to feature test w/o causing perf issues.
+ readyRegExp = isBrowser && navigator.platform === 'PLAYSTATION 3' ?
+ /^complete$/ : /^(complete|loaded)$/,
+ defContextName = '_',
+ //Oh the tragedy, detecting opera. See the usage of isOpera for reason.
+ isOpera = typeof opera !== 'undefined' && opera.toString() === '[object Opera]',
+ contexts = {},
+ cfg = {},
+ globalDefQueue = [],
+ useInteractive = false;
+
+ function isFunction(it) {
+ return ostring.call(it) === '[object Function]';
+ }
+
+ function isArray(it) {
+ return ostring.call(it) === '[object Array]';
+ }
+
+ /**
+ * Helper function for iterating over an array. If the func returns
+ * a true value, it will break out of the loop.
+ */
+ function each(ary, func) {
+ if (ary) {
+ var i;
+ for (i = 0; i < ary.length; i += 1) {
+ if (ary[i] && func(ary[i], i, ary)) {
+ break;
+ }
+ }
+ }
+ }
+
+ /**
+ * Helper function for iterating over an array backwards. If the func
+ * returns a true value, it will break out of the loop.
+ */
+ function eachReverse(ary, func) {
+ if (ary) {
+ var i;
+ for (i = ary.length - 1; i > -1; i -= 1) {
+ if (ary[i] && func(ary[i], i, ary)) {
+ break;
+ }
+ }
+ }
+ }
+
+ function hasProp(obj, prop) {
+ return hasOwn.call(obj, prop);
+ }
+
+ function getOwn(obj, prop) {
+ return hasProp(obj, prop) && obj[prop];
+ }
+
+ /**
+ * Cycles over properties in an object and calls a function for each
+ * property value. If the function returns a truthy value, then the
+ * iteration is stopped.
+ */
+ function eachProp(obj, func) {
+ var prop;
+ for (prop in obj) {
+ if (hasProp(obj, prop)) {
+ if (func(obj[prop], prop)) {
+ break;
+ }
+ }
+ }
+ }
+
+ /**
+ * Simple function to mix in properties from source into target,
+ * but only if target does not already have a property of the same name.
+ */
+ function mixin(target, source, force, deepStringMixin) {
+ if (source) {
+ eachProp(source, function (value, prop) {
+ if (force || !hasProp(target, prop)) {
+ if (deepStringMixin && typeof value === 'object' && value &&
+ !isArray(value) && !isFunction(value) &&
+ !(value instanceof RegExp)) {
+
+ if (!target[prop]) {
+ target[prop] = {};
+ }
+ mixin(target[prop], value, force, deepStringMixin);
+ } else {
+ target[prop] = value;
+ }
+ }
+ });
+ }
+ return target;
+ }
+
+ //Similar to Function.prototype.bind, but the 'this' object is specified
+ //first, since it is easier to read/figure out what 'this' will be.
+ function bind(obj, fn) {
+ return function () {
+ return fn.apply(obj, arguments);
+ };
+ }
+
+ function scripts() {
+ return document.getElementsByTagName('script');
+ }
+
+ function defaultOnError(err) {
+ throw err;
+ }
+
+ //Allow getting a global that is expressed in
+ //dot notation, like 'a.b.c'.
+ function getGlobal(value) {
+ if (!value) {
+ return value;
+ }
+ var g = global;
+ each(value.split('.'), function (part) {
+ g = g[part];
+ });
+ return g;
+ }
+
+ /**
+ * Constructs an error with a pointer to an URL with more information.
+ * @param {String} id the error ID that maps to an ID on a web page.
+ * @param {String} message human readable error.
+ * @param {Error} [err] the original error, if there is one.
+ *
+ * @returns {Error}
+ */
+ function makeError(id, msg, err, requireModules) {
+ var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id);
+ e.requireType = id;
+ e.requireModules = requireModules;
+ if (err) {
+ e.originalError = err;
+ }
+ return e;
+ }
+
+ if (typeof define !== 'undefined') {
+ //If a define is already in play via another AMD loader,
+ //do not overwrite.
+ return;
+ }
+
+ if (typeof requirejs !== 'undefined') {
+ if (isFunction(requirejs)) {
+ //Do not overwrite an existing requirejs instance.
+ return;
+ }
+ cfg = requirejs;
+ requirejs = undefined;
+ }
+
+ //Allow for a require config object
+ if (typeof require !== 'undefined' && !isFunction(require)) {
+ //assume it is a config object.
+ cfg = require;
+ require = undefined;
+ }
+
+ function newContext(contextName) {
+ var inCheckLoaded, Module, context, handlers,
+ checkLoadedTimeoutId,
+ config = {
+ //Defaults. Do not set a default for map
+ //config to speed up normalize(), which
+ //will run faster if there is no default.
+ waitSeconds: 7,
+ baseUrl: './',
+ paths: {},
+ bundles: {},
+ pkgs: {},
+ shim: {},
+ config: {}
+ },
+ registry = {},
+ //registry of just enabled modules, to speed
+ //cycle breaking code when lots of modules
+ //are registered, but not activated.
+ enabledRegistry = {},
+ undefEvents = {},
+ defQueue = [],
+ defined = {},
+ urlFetched = {},
+ bundlesMap = {},
+ requireCounter = 1,
+ unnormalizedCounter = 1;
+
+ /**
+ * Trims the . and .. from an array of path segments.
+ * It will keep a leading path segment if a .. will become
+ * the first path segment, to help with module name lookups,
+ * which act like paths, but can be remapped. But the end result,
+ * all paths that use this function should look normalized.
+ * NOTE: this method MODIFIES the input array.
+ * @param {Array} ary the array of path segments.
+ */
+ function trimDots(ary) {
+ var i, part;
+ for (i = 0; i < ary.length; i++) {
+ part = ary[i];
+ if (part === '.') {
+ ary.splice(i, 1);
+ i -= 1;
+ } else if (part === '..') {
+ // If at the start, or previous value is still ..,
+ // keep them so that when converted to a path it may
+ // still work when converted to a path, even though
+ // as an ID it is less than ideal. In larger point
+ // releases, may be better to just kick out an error.
+ if (i === 0 || (i === 1 && ary[2] === '..') || ary[i - 1] === '..') {
+ continue;
+ } else if (i > 0) {
+ ary.splice(i - 1, 2);
+ i -= 2;
+ }
+ }
+ }
+ }
+
+ /**
+ * Given a relative module name, like ./something, normalize it to
+ * a real name that can be mapped to a path.
+ * @param {String} name the relative name
+ * @param {String} baseName a real name that the name arg is relative
+ * to.
+ * @param {Boolean} applyMap apply the map config to the value. Should
+ * only be done if this normalization is for a dependency ID.
+ * @returns {String} normalized name
+ */
+ function normalize(name, baseName, applyMap) {
+ var pkgMain, mapValue, nameParts, i, j, nameSegment, lastIndex,
+ foundMap, foundI, foundStarMap, starI, normalizedBaseParts,
+ baseParts = (baseName && baseName.split('/')),
+ map = config.map,
+ starMap = map && map['*'];
+
+ //Adjust any relative paths.
+ if (name) {
+ name = name.split('/');
+ lastIndex = name.length - 1;
+
+ // If wanting node ID compatibility, strip .js from end
+ // of IDs. Have to do this here, and not in nameToUrl
+ // because node allows either .js or non .js to map
+ // to same file.
+ if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) {
+ name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, '');
+ }
+
+ // Starts with a '.' so need the baseName
+ if (name[0].charAt(0) === '.' && baseParts) {
+ //Convert baseName to array, and lop off the last part,
+ //so that . matches that 'directory' and not name of the baseName's
+ //module. For instance, baseName of 'one/two/three', maps to
+ //'one/two/three.js', but we want the directory, 'one/two' for
+ //this normalization.
+ normalizedBaseParts = baseParts.slice(0, baseParts.length - 1);
+ name = normalizedBaseParts.concat(name);
+ }
+
+ trimDots(name);
+ name = name.join('/');
+ }
+
+ //Apply map config if available.
+ if (applyMap && map && (baseParts || starMap)) {
+ nameParts = name.split('/');
+
+ outerLoop: for (i = nameParts.length; i > 0; i -= 1) {
+ nameSegment = nameParts.slice(0, i).join('/');
+
+ if (baseParts) {
+ //Find the longest baseName segment match in the config.
+ //So, do joins on the biggest to smallest lengths of baseParts.
+ for (j = baseParts.length; j > 0; j -= 1) {
+ mapValue = getOwn(map, baseParts.slice(0, j).join('/'));
+
+ //baseName segment has config, find if it has one for
+ //this name.
+ if (mapValue) {
+ mapValue = getOwn(mapValue, nameSegment);
+ if (mapValue) {
+ //Match, update name to the new value.
+ foundMap = mapValue;
+ foundI = i;
+ break outerLoop;
+ }
+ }
+ }
+ }
+
+ //Check for a star map match, but just hold on to it,
+ //if there is a shorter segment match later in a matching
+ //config, then favor over this star map.
+ if (!foundStarMap && starMap && getOwn(starMap, nameSegment)) {
+ foundStarMap = getOwn(starMap, nameSegment);
+ starI = i;
+ }
+ }
+
+ if (!foundMap && foundStarMap) {
+ foundMap = foundStarMap;
+ foundI = starI;
+ }
+
+ if (foundMap) {
+ nameParts.splice(0, foundI, foundMap);
+ name = nameParts.join('/');
+ }
+ }
+
+ // If the name points to a package's name, use
+ // the package main instead.
+ pkgMain = getOwn(config.pkgs, name);
+
+ return pkgMain ? pkgMain : name;
+ }
+
+ function removeScript(name) {
+ if (isBrowser) {
+ each(scripts(), function (scriptNode) {
+ if (scriptNode.getAttribute('data-requiremodule') === name &&
+ scriptNode.getAttribute('data-requirecontext') === context.contextName) {
+ scriptNode.parentNode.removeChild(scriptNode);
+ return true;
+ }
+ });
+ }
+ }
+
+ function hasPathFallback(id) {
+ var pathConfig = getOwn(config.paths, id);
+ if (pathConfig && isArray(pathConfig) && pathConfig.length > 1) {
+ //Pop off the first array value, since it failed, and
+ //retry
+ pathConfig.shift();
+ context.require.undef(id);
+
+ //Custom require that does not do map translation, since
+ //ID is "absolute", already mapped/resolved.
+ context.makeRequire(null, {
+ skipMap: true
+ })([id]);
+
+ return true;
+ }
+ }
+
+ //Turns a plugin!resource to [plugin, resource]
+ //with the plugin being undefined if the name
+ //did not have a plugin prefix.
+ function splitPrefix(name) {
+ var prefix,
+ index = name ? name.indexOf('!') : -1;
+ if (index > -1) {
+ prefix = name.substring(0, index);
+ name = name.substring(index + 1, name.length);
+ }
+ return [prefix, name];
+ }
+
+ /**
+ * Creates a module mapping that includes plugin prefix, module
+ * name, and path. If parentModuleMap is provided it will
+ * also normalize the name via require.normalize()
+ *
+ * @param {String} name the module name
+ * @param {String} [parentModuleMap] parent module map
+ * for the module name, used to resolve relative names.
+ * @param {Boolean} isNormalized: is the ID already normalized.
+ * This is true if this call is done for a define() module ID.
+ * @param {Boolean} applyMap: apply the map config to the ID.
+ * Should only be true if this map is for a dependency.
+ *
+ * @returns {Object}
+ */
+ function makeModuleMap(name, parentModuleMap, isNormalized, applyMap) {
+ var url, pluginModule, suffix, nameParts,
+ prefix = null,
+ parentName = parentModuleMap ? parentModuleMap.name : null,
+ originalName = name,
+ isDefine = true,
+ normalizedName = '';
+
+ //If no name, then it means it is a require call, generate an
+ //internal name.
+ if (!name) {
+ isDefine = false;
+ name = '_@r' + (requireCounter += 1);
+ }
+
+ nameParts = splitPrefix(name);
+ prefix = nameParts[0];
+ name = nameParts[1];
+
+ if (prefix) {
+ prefix = normalize(prefix, parentName, applyMap);
+ pluginModule = getOwn(defined, prefix);
+ }
+
+ //Account for relative paths if there is a base name.
+ if (name) {
+ if (prefix) {
+ if (pluginModule && pluginModule.normalize) {
+ //Plugin is loaded, use its normalize method.
+ normalizedName = pluginModule.normalize(name, function (name) {
+ return normalize(name, parentName, applyMap);
+ });
+ } else {
+ // If nested plugin references, then do not try to
+ // normalize, as it will not normalize correctly. This
+ // places a restriction on resourceIds, and the longer
+ // term solution is not to normalize until plugins are
+ // loaded and all normalizations to allow for async
+ // loading of a loader plugin. But for now, fixes the
+ // common uses. Details in #1131
+ normalizedName = name.indexOf('!') === -1 ?
+ normalize(name, parentName, applyMap) :
+ name;
+ }
+ } else {
+ //A regular module.
+ normalizedName = normalize(name, parentName, applyMap);
+
+ //Normalized name may be a plugin ID due to map config
+ //application in normalize. The map config values must
+ //already be normalized, so do not need to redo that part.
+ nameParts = splitPrefix(normalizedName);
+ prefix = nameParts[0];
+ normalizedName = nameParts[1];
+ isNormalized = true;
+
+ url = context.nameToUrl(normalizedName);
+ }
+ }
+
+ //If the id is a plugin id that cannot be determined if it needs
+ //normalization, stamp it with a unique ID so two matching relative
+ //ids that may conflict can be separate.
+ suffix = prefix && !pluginModule && !isNormalized ?
+ '_unnormalized' + (unnormalizedCounter += 1) :
+ '';
+
+ return {
+ prefix: prefix,
+ name: normalizedName,
+ parentMap: parentModuleMap,
+ unnormalized: !!suffix,
+ url: url,
+ originalName: originalName,
+ isDefine: isDefine,
+ id: (prefix ?
+ prefix + '!' + normalizedName :
+ normalizedName) + suffix
+ };
+ }
+
+ function getModule(depMap) {
+ var id = depMap.id,
+ mod = getOwn(registry, id);
+
+ if (!mod) {
+ mod = registry[id] = new context.Module(depMap);
+ }
+
+ return mod;
+ }
+
+ function on(depMap, name, fn) {
+ var id = depMap.id,
+ mod = getOwn(registry, id);
+
+ if (hasProp(defined, id) &&
+ (!mod || mod.defineEmitComplete)) {
+ if (name === 'defined') {
+ fn(defined[id]);
+ }
+ } else {
+ mod = getModule(depMap);
+ if (mod.error && name === 'error') {
+ fn(mod.error);
+ } else {
+ mod.on(name, fn);
+ }
+ }
+ }
+
+ function onError(err, errback) {
+ var ids = err.requireModules,
+ notified = false;
+
+ if (errback) {
+ errback(err);
+ } else {
+ each(ids, function (id) {
+ var mod = getOwn(registry, id);
+ if (mod) {
+ //Set error on module, so it skips timeout checks.
+ mod.error = err;
+ if (mod.events.error) {
+ notified = true;
+ mod.emit('error', err);
+ }
+ }
+ });
+
+ if (!notified) {
+ req.onError(err);
+ }
+ }
+ }
+
+ /**
+ * Internal method to transfer globalQueue items to this context's
+ * defQueue.
+ */
+ function takeGlobalQueue() {
+ //Push all the globalDefQueue items into the context's defQueue
+ if (globalDefQueue.length) {
+ //Array splice in the values since the context code has a
+ //local var ref to defQueue, so cannot just reassign the one
+ //on context.
+ apsp.apply(defQueue,
+ [defQueue.length, 0].concat(globalDefQueue));
+ globalDefQueue = [];
+ }
+ }
+
+ handlers = {
+ 'require': function (mod) {
+ if (mod.require) {
+ return mod.require;
+ } else {
+ return (mod.require = context.makeRequire(mod.map));
+ }
+ },
+ 'exports': function (mod) {
+ mod.usingExports = true;
+ if (mod.map.isDefine) {
+ if (mod.exports) {
+ return (defined[mod.map.id] = mod.exports);
+ } else {
+ return (mod.exports = defined[mod.map.id] = {});
+ }
+ }
+ },
+ 'module': function (mod) {
+ if (mod.module) {
+ return mod.module;
+ } else {
+ return (mod.module = {
+ id: mod.map.id,
+ uri: mod.map.url,
+ config: function () {
+ return getOwn(config.config, mod.map.id) || {};
+ },
+ exports: mod.exports || (mod.exports = {})
+ });
+ }
+ }
+ };
+
+ function cleanRegistry(id) {
+ //Clean up machinery used for waiting modules.
+ delete registry[id];
+ delete enabledRegistry[id];
+ }
+
+ function breakCycle(mod, traced, processed) {
+ var id = mod.map.id;
+
+ if (mod.error) {
+ mod.emit('error', mod.error);
+ } else {
+ traced[id] = true;
+ each(mod.depMaps, function (depMap, i) {
+ var depId = depMap.id,
+ dep = getOwn(registry, depId);
+
+ //Only force things that have not completed
+ //being defined, so still in the registry,
+ //and only if it has not been matched up
+ //in the module already.
+ if (dep && !mod.depMatched[i] && !processed[depId]) {
+ if (getOwn(traced, depId)) {
+ mod.defineDep(i, defined[depId]);
+ mod.check(); //pass false?
+ } else {
+ breakCycle(dep, traced, processed);
+ }
+ }
+ });
+ processed[id] = true;
+ }
+ }
+
+ function checkLoaded() {
+ var err, usingPathFallback,
+ waitInterval = config.waitSeconds * 1000,
+ //It is possible to disable the wait interval by using waitSeconds of 0.
+ expired = waitInterval && (context.startTime + waitInterval) < new Date().getTime(),
+ noLoads = [],
+ reqCalls = [],
+ stillLoading = false,
+ needCycleCheck = true;
+
+ //Do not bother if this call was a result of a cycle break.
+ if (inCheckLoaded) {
+ return;
+ }
+
+ inCheckLoaded = true;
+
+ //Figure out the state of all the modules.
+ eachProp(enabledRegistry, function (mod) {
+ var map = mod.map,
+ modId = map.id;
+
+ //Skip things that are not enabled or in error state.
+ if (!mod.enabled) {
+ return;
+ }
+
+ if (!map.isDefine) {
+ reqCalls.push(mod);
+ }
+
+ if (!mod.error) {
+ //If the module should be executed, and it has not
+ //been inited and time is up, remember it.
+ if (!mod.inited && expired) {
+ if (hasPathFallback(modId)) {
+ usingPathFallback = true;
+ stillLoading = true;
+ } else {
+ noLoads.push(modId);
+ removeScript(modId);
+ }
+ } else if (!mod.inited && mod.fetched && map.isDefine) {
+ stillLoading = true;
+ if (!map.prefix) {
+ //No reason to keep looking for unfinished
+ //loading. If the only stillLoading is a
+ //plugin resource though, keep going,
+ //because it may be that a plugin resource
+ //is waiting on a non-plugin cycle.
+ return (needCycleCheck = false);
+ }
+ }
+ }
+ });
+
+ if (expired && noLoads.length) {
+ //If wait time expired, throw error of unloaded modules.
+ err = makeError('timeout', 'Load timeout for modules: ' + noLoads, null, noLoads);
+ err.contextName = context.contextName;
+ return onError(err);
+ }
+
+ //Not expired, check for a cycle.
+ if (needCycleCheck) {
+ each(reqCalls, function (mod) {
+ breakCycle(mod, {}, {});
+ });
+ }
+
+ //If still waiting on loads, and the waiting load is something
+ //other than a plugin resource, or there are still outstanding
+ //scripts, then just try back later.
+ if ((!expired || usingPathFallback) && stillLoading) {
+ //Something is still waiting to load. Wait for it, but only
+ //if a timeout is not already in effect.
+ if ((isBrowser || isWebWorker) && !checkLoadedTimeoutId) {
+ checkLoadedTimeoutId = setTimeout(function () {
+ checkLoadedTimeoutId = 0;
+ checkLoaded();
+ }, 50);
+ }
+ }
+
+ inCheckLoaded = false;
+ }
+
+ Module = function (map) {
+ this.events = getOwn(undefEvents, map.id) || {};
+ this.map = map;
+ this.shim = getOwn(config.shim, map.id);
+ this.depExports = [];
+ this.depMaps = [];
+ this.depMatched = [];
+ this.pluginMaps = {};
+ this.depCount = 0;
+
+ /* this.exports this.factory
+ this.depMaps = [],
+ this.enabled, this.fetched
+ */
+ };
+
+ Module.prototype = {
+ init: function (depMaps, factory, errback, options) {
+ options = options || {};
+
+ //Do not do more inits if already done. Can happen if there
+ //are multiple define calls for the same module. That is not
+ //a normal, common case, but it is also not unexpected.
+ if (this.inited) {
+ return;
+ }
+
+ this.factory = factory;
+
+ if (errback) {
+ //Register for errors on this module.
+ this.on('error', errback);
+ } else if (this.events.error) {
+ //If no errback already, but there are error listeners
+ //on this module, set up an errback to pass to the deps.
+ errback = bind(this, function (err) {
+ this.emit('error', err);
+ });
+ }
+
+ //Do a copy of the dependency array, so that
+ //source inputs are not modified. For example
+ //"shim" deps are passed in here directly, and
+ //doing a direct modification of the depMaps array
+ //would affect that config.
+ this.depMaps = depMaps && depMaps.slice(0);
+
+ this.errback = errback;
+
+ //Indicate this module has be initialized
+ this.inited = true;
+
+ this.ignore = options.ignore;
+
+ //Could have option to init this module in enabled mode,
+ //or could have been previously marked as enabled. However,
+ //the dependencies are not known until init is called. So
+ //if enabled previously, now trigger dependencies as enabled.
+ if (options.enabled || this.enabled) {
+ //Enable this module and dependencies.
+ //Will call this.check()
+ this.enable();
+ } else {
+ this.check();
+ }
+ },
+
+ defineDep: function (i, depExports) {
+ //Because of cycles, defined callback for a given
+ //export can be called more than once.
+ if (!this.depMatched[i]) {
+ this.depMatched[i] = true;
+ this.depCount -= 1;
+ this.depExports[i] = depExports;
+ }
+ },
+
+ fetch: function () {
+ if (this.fetched) {
+ return;
+ }
+ this.fetched = true;
+
+ context.startTime = (new Date()).getTime();
+
+ var map = this.map;
+
+ //If the manager is for a plugin managed resource,
+ //ask the plugin to load it now.
+ if (this.shim) {
+ context.makeRequire(this.map, {
+ enableBuildCallback: true
+ })(this.shim.deps || [], bind(this, function () {
+ return map.prefix ? this.callPlugin() : this.load();
+ }));
+ } else {
+ //Regular dependency.
+ return map.prefix ? this.callPlugin() : this.load();
+ }
+ },
+
+ load: function () {
+ var url = this.map.url;
+
+ //Regular dependency.
+ if (!urlFetched[url]) {
+ urlFetched[url] = true;
+ context.load(this.map.id, url);
+ }
+ },
+
+ /**
+ * Checks if the module is ready to define itself, and if so,
+ * define it.
+ */
+ check: function () {
+ if (!this.enabled || this.enabling) {
+ return;
+ }
+
+ var err, cjsModule,
+ id = this.map.id,
+ depExports = this.depExports,
+ exports = this.exports,
+ factory = this.factory;
+
+ if (!this.inited) {
+ this.fetch();
+ } else if (this.error) {
+ this.emit('error', this.error);
+ } else if (!this.defining) {
+ //The factory could trigger another require call
+ //that would result in checking this module to
+ //define itself again. If already in the process
+ //of doing that, skip this work.
+ this.defining = true;
+
+ if (this.depCount < 1 && !this.defined) {
+ if (isFunction(factory)) {
+ //If there is an error listener, favor passing
+ //to that instead of throwing an error. However,
+ //only do it for define()'d modules. require
+ //errbacks should not be called for failures in
+ //their callbacks (#699). However if a global
+ //onError is set, use that.
+ if ((this.events.error && this.map.isDefine) ||
+ req.onError !== defaultOnError) {
+ try {
+ exports = context.execCb(id, factory, depExports, exports);
+ } catch (e) {
+ err = e;
+ }
+ } else {
+ exports = context.execCb(id, factory, depExports, exports);
+ }
+
+ // Favor return value over exports. If node/cjs in play,
+ // then will not have a return value anyway. Favor
+ // module.exports assignment over exports object.
+ if (this.map.isDefine && exports === undefined) {
+ cjsModule = this.module;
+ if (cjsModule) {
+ exports = cjsModule.exports;
+ } else if (this.usingExports) {
+ //exports already set the defined value.
+ exports = this.exports;
+ }
+ }
+
+ if (err) {
+ err.requireMap = this.map;
+ err.requireModules = this.map.isDefine ? [this.map.id] : null;
+ err.requireType = this.map.isDefine ? 'define' : 'require';
+ return onError((this.error = err));
+ }
+
+ } else {
+ //Just a literal value
+ exports = factory;
+ }
+
+ this.exports = exports;
+
+ if (this.map.isDefine && !this.ignore) {
+ defined[id] = exports;
+
+ if (req.onResourceLoad) {
+ req.onResourceLoad(context, this.map, this.depMaps);
+ }
+ }
+
+ //Clean up
+ cleanRegistry(id);
+
+ this.defined = true;
+ }
+
+ //Finished the define stage. Allow calling check again
+ //to allow define notifications below in the case of a
+ //cycle.
+ this.defining = false;
+
+ if (this.defined && !this.defineEmitted) {
+ this.defineEmitted = true;
+ this.emit('defined', this.exports);
+ this.defineEmitComplete = true;
+ }
+
+ }
+ },
+
+ callPlugin: function () {
+ var map = this.map,
+ id = map.id,
+ //Map already normalized the prefix.
+ pluginMap = makeModuleMap(map.prefix);
+
+ //Mark this as a dependency for this plugin, so it
+ //can be traced for cycles.
+ this.depMaps.push(pluginMap);
+
+ on(pluginMap, 'defined', bind(this, function (plugin) {
+ var load, normalizedMap, normalizedMod,
+ bundleId = getOwn(bundlesMap, this.map.id),
+ name = this.map.name,
+ parentName = this.map.parentMap ? this.map.parentMap.name : null,
+ localRequire = context.makeRequire(map.parentMap, {
+ enableBuildCallback: true
+ });
+
+ //If current map is not normalized, wait for that
+ //normalized name to load instead of continuing.
+ if (this.map.unnormalized) {
+ //Normalize the ID if the plugin allows it.
+ if (plugin.normalize) {
+ name = plugin.normalize(name, function (name) {
+ return normalize(name, parentName, true);
+ }) || '';
+ }
+
+ //prefix and name should already be normalized, no need
+ //for applying map config again either.
+ normalizedMap = makeModuleMap(map.prefix + '!' + name,
+ this.map.parentMap);
+ on(normalizedMap,
+ 'defined', bind(this, function (value) {
+ this.init([], function () { return value; }, null, {
+ enabled: true,
+ ignore: true
+ });
+ }));
+
+ normalizedMod = getOwn(registry, normalizedMap.id);
+ if (normalizedMod) {
+ //Mark this as a dependency for this plugin, so it
+ //can be traced for cycles.
+ this.depMaps.push(normalizedMap);
+
+ if (this.events.error) {
+ normalizedMod.on('error', bind(this, function (err) {
+ this.emit('error', err);
+ }));
+ }
+ normalizedMod.enable();
+ }
+
+ return;
+ }
+
+ //If a paths config, then just load that file instead to
+ //resolve the plugin, as it is built into that paths layer.
+ if (bundleId) {
+ this.map.url = context.nameToUrl(bundleId);
+ this.load();
+ return;
+ }
+
+ load = bind(this, function (value) {
+ this.init([], function () { return value; }, null, {
+ enabled: true
+ });
+ });
+
+ load.error = bind(this, function (err) {
+ this.inited = true;
+ this.error = err;
+ err.requireModules = [id];
+
+ //Remove temp unnormalized modules for this module,
+ //since they will never be resolved otherwise now.
+ eachProp(registry, function (mod) {
+ if (mod.map.id.indexOf(id + '_unnormalized') === 0) {
+ cleanRegistry(mod.map.id);
+ }
+ });
+
+ onError(err);
+ });
+
+ //Allow plugins to load other code without having to know the
+ //context or how to 'complete' the load.
+ load.fromText = bind(this, function (text, textAlt) {
+ /*jslint evil: true */
+ var moduleName = map.name,
+ moduleMap = makeModuleMap(moduleName),
+ hasInteractive = useInteractive;
+
+ //As of 2.1.0, support just passing the text, to reinforce
+ //fromText only being called once per resource. Still
+ //support old style of passing moduleName but discard
+ //that moduleName in favor of the internal ref.
+ if (textAlt) {
+ text = textAlt;
+ }
+
+ //Turn off interactive script matching for IE for any define
+ //calls in the text, then turn it back on at the end.
+ if (hasInteractive) {
+ useInteractive = false;
+ }
+
+ //Prime the system by creating a module instance for
+ //it.
+ getModule(moduleMap);
+
+ //Transfer any config to this other module.
+ if (hasProp(config.config, id)) {
+ config.config[moduleName] = config.config[id];
+ }
+
+ try {
+ req.exec(text);
+ } catch (e) {
+ return onError(makeError('fromtexteval',
+ 'fromText eval for ' + id +
+ ' failed: ' + e,
+ e,
+ [id]));
+ }
+
+ if (hasInteractive) {
+ useInteractive = true;
+ }
+
+ //Mark this as a dependency for the plugin
+ //resource
+ this.depMaps.push(moduleMap);
+
+ //Support anonymous modules.
+ context.completeLoad(moduleName);
+
+ //Bind the value of that module to the value for this
+ //resource ID.
+ localRequire([moduleName], load);
+ });
+
+ //Use parentName here since the plugin's name is not reliable,
+ //could be some weird string with no path that actually wants to
+ //reference the parentName's path.
+ plugin.load(map.name, localRequire, load, config);
+ }));
+
+ context.enable(pluginMap, this);
+ this.pluginMaps[pluginMap.id] = pluginMap;
+ },
+
+ enable: function () {
+ enabledRegistry[this.map.id] = this;
+ this.enabled = true;
+
+ //Set flag mentioning that the module is enabling,
+ //so that immediate calls to the defined callbacks
+ //for dependencies do not trigger inadvertent load
+ //with the depCount still being zero.
+ this.enabling = true;
+
+ //Enable each dependency
+ each(this.depMaps, bind(this, function (depMap, i) {
+ var id, mod, handler;
+
+ if (typeof depMap === 'string') {
+ //Dependency needs to be converted to a depMap
+ //and wired up to this module.
+ depMap = makeModuleMap(depMap,
+ (this.map.isDefine ? this.map : this.map.parentMap),
+ false,
+ !this.skipMap);
+ this.depMaps[i] = depMap;
+
+ handler = getOwn(handlers, depMap.id);
+
+ if (handler) {
+ this.depExports[i] = handler(this);
+ return;
+ }
+
+ this.depCount += 1;
+
+ on(depMap, 'defined', bind(this, function (depExports) {
+ this.defineDep(i, depExports);
+ this.check();
+ }));
+
+ if (this.errback) {
+ on(depMap, 'error', bind(this, this.errback));
+ } else if (this.events.error) {
+ // No direct errback on this module, but something
+ // else is listening for errors, so be sure to
+ // propagate the error correctly.
+ on(depMap, 'error', bind(this, function(err) {
+ this.emit('error', err);
+ }));
+ }
+ }
+
+ id = depMap.id;
+ mod = registry[id];
+
+ //Skip special modules like 'require', 'exports', 'module'
+ //Also, don't call enable if it is already enabled,
+ //important in circular dependency cases.
+ if (!hasProp(handlers, id) && mod && !mod.enabled) {
+ context.enable(depMap, this);
+ }
+ }));
+
+ //Enable each plugin that is used in
+ //a dependency
+ eachProp(this.pluginMaps, bind(this, function (pluginMap) {
+ var mod = getOwn(registry, pluginMap.id);
+ if (mod && !mod.enabled) {
+ context.enable(pluginMap, this);
+ }
+ }));
+
+ this.enabling = false;
+
+ this.check();
+ },
+
+ on: function (name, cb) {
+ var cbs = this.events[name];
+ if (!cbs) {
+ cbs = this.events[name] = [];
+ }
+ cbs.push(cb);
+ },
+
+ emit: function (name, evt) {
+ each(this.events[name], function (cb) {
+ cb(evt);
+ });
+ if (name === 'error') {
+ //Now that the error handler was triggered, remove
+ //the listeners, since this broken Module instance
+ //can stay around for a while in the registry.
+ delete this.events[name];
+ }
+ }
+ };
+
+ function callGetModule(args) {
+ //Skip modules already defined.
+ if (!hasProp(defined, args[0])) {
+ getModule(makeModuleMap(args[0], null, true)).init(args[1], args[2]);
+ }
+ }
+
+ function removeListener(node, func, name, ieName) {
+ //Favor detachEvent because of IE9
+ //issue, see attachEvent/addEventListener comment elsewhere
+ //in this file.
+ if (node.detachEvent && !isOpera) {
+ //Probably IE. If not it will throw an error, which will be
+ //useful to know.
+ if (ieName) {
+ node.detachEvent(ieName, func);
+ }
+ } else {
+ node.removeEventListener(name, func, false);
+ }
+ }
+
+ /**
+ * Given an event from a script node, get the requirejs info from it,
+ * and then removes the event listeners on the node.
+ * @param {Event} evt
+ * @returns {Object}
+ */
+ function getScriptData(evt) {
+ //Using currentTarget instead of target for Firefox 2.0's sake. Not
+ //all old browsers will be supported, but this one was easy enough
+ //to support and still makes sense.
+ var node = evt.currentTarget || evt.srcElement;
+
+ //Remove the listeners once here.
+ removeListener(node, context.onScriptLoad, 'load', 'onreadystatechange');
+ removeListener(node, context.onScriptError, 'error');
+
+ return {
+ node: node,
+ id: node && node.getAttribute('data-requiremodule')
+ };
+ }
+
+ function intakeDefines() {
+ var args;
+
+ //Any defined modules in the global queue, intake them now.
+ takeGlobalQueue();
+
+ //Make sure any remaining defQueue items get properly processed.
+ while (defQueue.length) {
+ args = defQueue.shift();
+ if (args[0] === null) {
+ return onError(makeError('mismatch', 'Mismatched anonymous define() module: ' + args[args.length - 1]));
+ } else {
+ //args are id, deps, factory. Should be normalized by the
+ //define() function.
+ callGetModule(args);
+ }
+ }
+ }
+
+ context = {
+ config: config,
+ contextName: contextName,
+ registry: registry,
+ defined: defined,
+ urlFetched: urlFetched,
+ defQueue: defQueue,
+ Module: Module,
+ makeModuleMap: makeModuleMap,
+ nextTick: req.nextTick,
+ onError: onError,
+
+ /**
+ * Set a configuration for the context.
+ * @param {Object} cfg config object to integrate.
+ */
+ configure: function (cfg) {
+ //Make sure the baseUrl ends in a slash.
+ if (cfg.baseUrl) {
+ if (cfg.baseUrl.charAt(cfg.baseUrl.length - 1) !== '/') {
+ cfg.baseUrl += '/';
+ }
+ }
+
+ //Save off the paths since they require special processing,
+ //they are additive.
+ var shim = config.shim,
+ objs = {
+ paths: true,
+ bundles: true,
+ config: true,
+ map: true
+ };
+
+ eachProp(cfg, function (value, prop) {
+ if (objs[prop]) {
+ if (!config[prop]) {
+ config[prop] = {};
+ }
+ mixin(config[prop], value, true, true);
+ } else {
+ config[prop] = value;
+ }
+ });
+
+ //Reverse map the bundles
+ if (cfg.bundles) {
+ eachProp(cfg.bundles, function (value, prop) {
+ each(value, function (v) {
+ if (v !== prop) {
+ bundlesMap[v] = prop;
+ }
+ });
+ });
+ }
+
+ //Merge shim
+ if (cfg.shim) {
+ eachProp(cfg.shim, function (value, id) {
+ //Normalize the structure
+ if (isArray(value)) {
+ value = {
+ deps: value
+ };
+ }
+ if ((value.exports || value.init) && !value.exportsFn) {
+ value.exportsFn = context.makeShimExports(value);
+ }
+ shim[id] = value;
+ });
+ config.shim = shim;
+ }
+
+ //Adjust packages if necessary.
+ if (cfg.packages) {
+ each(cfg.packages, function (pkgObj) {
+ var location, name;
+
+ pkgObj = typeof pkgObj === 'string' ? { name: pkgObj } : pkgObj;
+
+ name = pkgObj.name;
+ location = pkgObj.location;
+ if (location) {
+ config.paths[name] = pkgObj.location;
+ }
+
+ //Save pointer to main module ID for pkg name.
+ //Remove leading dot in main, so main paths are normalized,
+ //and remove any trailing .js, since different package
+ //envs have different conventions: some use a module name,
+ //some use a file name.
+ config.pkgs[name] = pkgObj.name + '/' + (pkgObj.main || 'main')
+ .replace(currDirRegExp, '')
+ .replace(jsSuffixRegExp, '');
+ });
+ }
+
+ //If there are any "waiting to execute" modules in the registry,
+ //update the maps for them, since their info, like URLs to load,
+ //may have changed.
+ eachProp(registry, function (mod, id) {
+ //If module already has init called, since it is too
+ //late to modify them, and ignore unnormalized ones
+ //since they are transient.
+ if (!mod.inited && !mod.map.unnormalized) {
+ mod.map = makeModuleMap(id);
+ }
+ });
+
+ //If a deps array or a config callback is specified, then call
+ //require with those args. This is useful when require is defined as a
+ //config object before require.js is loaded.
+ if (cfg.deps || cfg.callback) {
+ context.require(cfg.deps || [], cfg.callback);
+ }
+ },
+
+ makeShimExports: function (value) {
+ function fn() {
+ var ret;
+ if (value.init) {
+ ret = value.init.apply(global, arguments);
+ }
+ return ret || (value.exports && getGlobal(value.exports));
+ }
+ return fn;
+ },
+
+ makeRequire: function (relMap, options) {
+ options = options || {};
+
+ function localRequire(deps, callback, errback) {
+ var id, map, requireMod;
+
+ if (options.enableBuildCallback && callback && isFunction(callback)) {
+ callback.__requireJsBuild = true;
+ }
+
+ if (typeof deps === 'string') {
+ if (isFunction(callback)) {
+ //Invalid call
+ return onError(makeError('requireargs', 'Invalid require call'), errback);
+ }
+
+ //If require|exports|module are requested, get the
+ //value for them from the special handlers. Caveat:
+ //this only works while module is being defined.
+ if (relMap && hasProp(handlers, deps)) {
+ return handlers[deps](registry[relMap.id]);
+ }
+
+ //Synchronous access to one module. If require.get is
+ //available (as in the Node adapter), prefer that.
+ if (req.get) {
+ return req.get(context, deps, relMap, localRequire);
+ }
+
+ //Normalize module name, if it contains . or ..
+ map = makeModuleMap(deps, relMap, false, true);
+ id = map.id;
+
+ if (!hasProp(defined, id)) {
+ return onError(makeError('notloaded', 'Module name "' +
+ id +
+ '" has not been loaded yet for context: ' +
+ contextName +
+ (relMap ? '' : '. Use require([])')));
+ }
+ return defined[id];
+ }
+
+ //Grab defines waiting in the global queue.
+ intakeDefines();
+
+ //Mark all the dependencies as needing to be loaded.
+ context.nextTick(function () {
+ //Some defines could have been added since the
+ //require call, collect them.
+ intakeDefines();
+
+ requireMod = getModule(makeModuleMap(null, relMap));
+
+ //Store if map config should be applied to this require
+ //call for dependencies.
+ requireMod.skipMap = options.skipMap;
+
+ requireMod.init(deps, callback, errback, {
+ enabled: true
+ });
+
+ checkLoaded();
+ });
+
+ return localRequire;
+ }
+
+ mixin(localRequire, {
+ isBrowser: isBrowser,
+
+ /**
+ * Converts a module name + .extension into an URL path.
+ * *Requires* the use of a module name. It does not support using
+ * plain URLs like nameToUrl.
+ */
+ toUrl: function (moduleNamePlusExt) {
+ var ext,
+ index = moduleNamePlusExt.lastIndexOf('.'),
+ segment = moduleNamePlusExt.split('/')[0],
+ isRelative = segment === '.' || segment === '..';
+
+ //Have a file extension alias, and it is not the
+ //dots from a relative path.
+ if (index !== -1 && (!isRelative || index > 1)) {
+ ext = moduleNamePlusExt.substring(index, moduleNamePlusExt.length);
+ moduleNamePlusExt = moduleNamePlusExt.substring(0, index);
+ }
+
+ return context.nameToUrl(normalize(moduleNamePlusExt,
+ relMap && relMap.id, true), ext, true);
+ },
+
+ defined: function (id) {
+ return hasProp(defined, makeModuleMap(id, relMap, false, true).id);
+ },
+
+ specified: function (id) {
+ id = makeModuleMap(id, relMap, false, true).id;
+ return hasProp(defined, id) || hasProp(registry, id);
+ }
+ });
+
+ //Only allow undef on top level require calls
+ if (!relMap) {
+ localRequire.undef = function (id) {
+ //Bind any waiting define() calls to this context,
+ //fix for #408
+ takeGlobalQueue();
+
+ var map = makeModuleMap(id, relMap, true),
+ mod = getOwn(registry, id);
+
+ removeScript(id);
+
+ delete defined[id];
+ delete urlFetched[map.url];
+ delete undefEvents[id];
+
+ //Clean queued defines too. Go backwards
+ //in array so that the splices do not
+ //mess up the iteration.
+ eachReverse(defQueue, function(args, i) {
+ if(args[0] === id) {
+ defQueue.splice(i, 1);
+ }
+ });
+
+ if (mod) {
+ //Hold on to listeners in case the
+ //module will be attempted to be reloaded
+ //using a different config.
+ if (mod.events.defined) {
+ undefEvents[id] = mod.events;
+ }
+
+ cleanRegistry(id);
+ }
+ };
+ }
+
+ return localRequire;
+ },
+
+ /**
+ * Called to enable a module if it is still in the registry
+ * awaiting enablement. A second arg, parent, the parent module,
+ * is passed in for context, when this method is overridden by
+ * the optimizer. Not shown here to keep code compact.
+ */
+ enable: function (depMap) {
+ var mod = getOwn(registry, depMap.id);
+ if (mod) {
+ getModule(depMap).enable();
+ }
+ },
+
+ /**
+ * Internal method used by environment adapters to complete a load event.
+ * A load event could be a script load or just a load pass from a synchronous
+ * load call.
+ * @param {String} moduleName the name of the module to potentially complete.
+ */
+ completeLoad: function (moduleName) {
+ var found, args, mod,
+ shim = getOwn(config.shim, moduleName) || {},
+ shExports = shim.exports;
+
+ takeGlobalQueue();
+
+ while (defQueue.length) {
+ args = defQueue.shift();
+ if (args[0] === null) {
+ args[0] = moduleName;
+ //If already found an anonymous module and bound it
+ //to this name, then this is some other anon module
+ //waiting for its completeLoad to fire.
+ if (found) {
+ break;
+ }
+ found = true;
+ } else if (args[0] === moduleName) {
+ //Found matching define call for this script!
+ found = true;
+ }
+
+ callGetModule(args);
+ }
+
+ //Do this after the cycle of callGetModule in case the result
+ //of those calls/init calls changes the registry.
+ mod = getOwn(registry, moduleName);
+
+ if (!found && !hasProp(defined, moduleName) && mod && !mod.inited) {
+ if (config.enforceDefine && (!shExports || !getGlobal(shExports))) {
+ if (hasPathFallback(moduleName)) {
+ return;
+ } else {
+ return onError(makeError('nodefine',
+ 'No define call for ' + moduleName,
+ null,
+ [moduleName]));
+ }
+ } else {
+ //A script that does not call define(), so just simulate
+ //the call for it.
+ callGetModule([moduleName, (shim.deps || []), shim.exportsFn]);
+ }
+ }
+
+ checkLoaded();
+ },
+
+ /**
+ * Converts a module name to a file path. Supports cases where
+ * moduleName may actually be just an URL.
+ * Note that it **does not** call normalize on the moduleName,
+ * it is assumed to have already been normalized. This is an
+ * internal API, not a public one. Use toUrl for the public API.
+ */
+ nameToUrl: function (moduleName, ext, skipExt) {
+ var paths, syms, i, parentModule, url,
+ parentPath, bundleId,
+ pkgMain = getOwn(config.pkgs, moduleName);
+
+ if (pkgMain) {
+ moduleName = pkgMain;
+ }
+
+ bundleId = getOwn(bundlesMap, moduleName);
+
+ if (bundleId) {
+ return context.nameToUrl(bundleId, ext, skipExt);
+ }
+
+ //If a colon is in the URL, it indicates a protocol is used and it is just
+ //an URL to a file, or if it starts with a slash, contains a query arg (i.e. ?)
+ //or ends with .js, then assume the user meant to use an url and not a module id.
+ //The slash is important for protocol-less URLs as well as full paths.
+ if (req.jsExtRegExp.test(moduleName)) {
+ //Just a plain path, not module name lookup, so just return it.
+ //Add extension if it is included. This is a bit wonky, only non-.js things pass
+ //an extension, this method probably needs to be reworked.
+ url = moduleName + (ext || '');
+ } else {
+ //A module that needs to be converted to a path.
+ paths = config.paths;
+
+ syms = moduleName.split('/');
+ //For each module name segment, see if there is a path
+ //registered for it. Start with most specific name
+ //and work up from it.
+ for (i = syms.length; i > 0; i -= 1) {
+ parentModule = syms.slice(0, i).join('/');
+
+ parentPath = getOwn(paths, parentModule);
+ if (parentPath) {
+ //If an array, it means there are a few choices,
+ //Choose the one that is desired
+ if (isArray(parentPath)) {
+ parentPath = parentPath[0];
+ }
+ syms.splice(0, i, parentPath);
+ break;
+ }
+ }
+
+ //Join the path parts together, then figure out if baseUrl is needed.
+ url = syms.join('/');
+ url += (ext || (/^data\:|\?/.test(url) || skipExt ? '' : '.js'));
+ url = (url.charAt(0) === '/' || url.match(/^[\w\+\.\-]+:/) ? '' : config.baseUrl) + url;
+ }
+
+ return config.urlArgs ? url +
+ ((url.indexOf('?') === -1 ? '?' : '&') +
+ config.urlArgs) : url;
+ },
+
+ //Delegates to req.load. Broken out as a separate function to
+ //allow overriding in the optimizer.
+ load: function (id, url) {
+ req.load(context, id, url);
+ },
+
+ /**
+ * Executes a module callback function. Broken out as a separate function
+ * solely to allow the build system to sequence the files in the built
+ * layer in the right sequence.
+ *
+ * @private
+ */
+ execCb: function (name, callback, args, exports) {
+ return callback.apply(exports, args);
+ },
+
+ /**
+ * callback for script loads, used to check status of loading.
+ *
+ * @param {Event} evt the event from the browser for the script
+ * that was loaded.
+ */
+ onScriptLoad: function (evt) {
+ //Using currentTarget instead of target for Firefox 2.0's sake. Not
+ //all old browsers will be supported, but this one was easy enough
+ //to support and still makes sense.
+ if (evt.type === 'load' ||
+ (readyRegExp.test((evt.currentTarget || evt.srcElement).readyState))) {
+ //Reset interactive script so a script node is not held onto for
+ //to long.
+ interactiveScript = null;
+
+ //Pull out the name of the module and the context.
+ var data = getScriptData(evt);
+ context.completeLoad(data.id);
+ }
+ },
+
+ /**
+ * Callback for script errors.
+ */
+ onScriptError: function (evt) {
+ var data = getScriptData(evt);
+ if (!hasPathFallback(data.id)) {
+ return onError(makeError('scripterror', 'Script error for: ' + data.id, evt, [data.id]));
+ }
+ }
+ };
+
+ context.require = context.makeRequire();
+ return context;
+ }
+
+ /**
+ * Main entry point.
+ *
+ * If the only argument to require is a string, then the module that
+ * is represented by that string is fetched for the appropriate context.
+ *
+ * If the first argument is an array, then it will be treated as an array
+ * of dependency string names to fetch. An optional function callback can
+ * be specified to execute when all of those dependencies are available.
+ *
+ * Make a local req variable to help Caja compliance (it assumes things
+ * on a require that are not standardized), and to give a short
+ * name for minification/local scope use.
+ */
+ req = requirejs = function (deps, callback, errback, optional) {
+
+ //Find the right context, use default
+ var context, config,
+ contextName = defContextName;
+
+ // Determine if have config object in the call.
+ if (!isArray(deps) && typeof deps !== 'string') {
+ // deps is a config object
+ config = deps;
+ if (isArray(callback)) {
+ // Adjust args if there are dependencies
+ deps = callback;
+ callback = errback;
+ errback = optional;
+ } else {
+ deps = [];
+ }
+ }
+
+ if (config && config.context) {
+ contextName = config.context;
+ }
+
+ context = getOwn(contexts, contextName);
+ if (!context) {
+ context = contexts[contextName] = req.s.newContext(contextName);
+ }
+
+ if (config) {
+ context.configure(config);
+ }
+
+ return context.require(deps, callback, errback);
+ };
+
+ /**
+ * Support require.config() to make it easier to cooperate with other
+ * AMD loaders on globally agreed names.
+ */
+ req.config = function (config) {
+ return req(config);
+ };
+
+ /**
+ * Execute something after the current tick
+ * of the event loop. Override for other envs
+ * that have a better solution than setTimeout.
+ * @param {Function} fn function to execute later.
+ */
+ req.nextTick = typeof setTimeout !== 'undefined' ? function (fn) {
+ setTimeout(fn, 4);
+ } : function (fn) { fn(); };
+
+ /**
+ * Export require as a global, but only if it does not already exist.
+ */
+ if (!require) {
+ require = req;
+ }
+
+ req.version = version;
+
+ //Used to filter out dependencies that are already paths.
+ req.jsExtRegExp = /^\/|:|\?|\.js$/;
+ req.isBrowser = isBrowser;
+ s = req.s = {
+ contexts: contexts,
+ newContext: newContext
+ };
+
+ //Create default context.
+ req({});
+
+ //Exports some context-sensitive methods on global require.
+ each([
+ 'toUrl',
+ 'undef',
+ 'defined',
+ 'specified'
+ ], function (prop) {
+ //Reference from contexts instead of early binding to default context,
+ //so that during builds, the latest instance of the default context
+ //with its config gets used.
+ req[prop] = function () {
+ var ctx = contexts[defContextName];
+ return ctx.require[prop].apply(ctx, arguments);
+ };
+ });
+
+ if (isBrowser) {
+ head = s.head = document.getElementsByTagName('head')[0];
+ //If BASE tag is in play, using appendChild is a problem for IE6.
+ //When that browser dies, this can be removed. Details in this jQuery bug:
+ //http://dev.jquery.com/ticket/2709
+ baseElement = document.getElementsByTagName('base')[0];
+ if (baseElement) {
+ head = s.head = baseElement.parentNode;
+ }
+ }
+
+ /**
+ * Any errors that require explicitly generates will be passed to this
+ * function. Intercept/override it if you want custom error handling.
+ * @param {Error} err the error object.
+ */
+ req.onError = defaultOnError;
+
+ /**
+ * Creates the node for the load command. Only used in browser envs.
+ */
+ req.createNode = function (config, moduleName, url) {
+ var node = config.xhtml ?
+ document.createElementNS('http://www.w3.org/1999/xhtml', 'html:script') :
+ document.createElement('script');
+ node.type = config.scriptType || 'text/javascript';
+ node.charset = 'utf-8';
+ node.async = true;
+ return node;
+ };
+
+ /**
+ * Does the request to load a module for the browser case.
+ * Make this a separate function to allow other environments
+ * to override it.
+ *
+ * @param {Object} context the require context to find state.
+ * @param {String} moduleName the name of the module.
+ * @param {Object} url the URL to the module.
+ */
+ req.load = function (context, moduleName, url) {
+ var config = (context && context.config) || {},
+ node;
+ if (isBrowser) {
+ //In the browser so use a script tag
+ node = req.createNode(config, moduleName, url);
+
+ node.setAttribute('data-requirecontext', context.contextName);
+ node.setAttribute('data-requiremodule', moduleName);
+
+ //Set up load listener. Test attachEvent first because IE9 has
+ //a subtle issue in its addEventListener and script onload firings
+ //that do not match the behavior of all other browsers with
+ //addEventListener support, which fire the onload event for a
+ //script right after the script execution. See:
+ //https://connect.microsoft.com/IE/feedback/details/648057/script-onload-event-is-not-fired-immediately-after-script-execution
+ //UNFORTUNATELY Opera implements attachEvent but does not follow the script
+ //script execution mode.
+ if (node.attachEvent &&
+ //Check if node.attachEvent is artificially added by custom script or
+ //natively supported by browser
+ //read https://github.com/jrburke/requirejs/issues/187
+ //if we can NOT find [native code] then it must NOT natively supported.
+ //in IE8, node.attachEvent does not have toString()
+ //Note the test for "[native code" with no closing brace, see:
+ //https://github.com/jrburke/requirejs/issues/273
+ !(node.attachEvent.toString && node.attachEvent.toString().indexOf('[native code') < 0) &&
+ !isOpera) {
+ //Probably IE. IE (at least 6-8) do not fire
+ //script onload right after executing the script, so
+ //we cannot tie the anonymous define call to a name.
+ //However, IE reports the script as being in 'interactive'
+ //readyState at the time of the define call.
+ useInteractive = true;
+
+ node.attachEvent('onreadystatechange', context.onScriptLoad);
+ //It would be great to add an error handler here to catch
+ //404s in IE9+. However, onreadystatechange will fire before
+ //the error handler, so that does not help. If addEventListener
+ //is used, then IE will fire error before load, but we cannot
+ //use that pathway given the connect.microsoft.com issue
+ //mentioned above about not doing the 'script execute,
+ //then fire the script load event listener before execute
+ //next script' that other browsers do.
+ //Best hope: IE10 fixes the issues,
+ //and then destroys all installs of IE 6-9.
+ //node.attachEvent('onerror', context.onScriptError);
+ } else {
+ node.addEventListener('load', context.onScriptLoad, false);
+ node.addEventListener('error', context.onScriptError, false);
+ }
+ node.src = url;
+
+ //For some cache cases in IE 6-8, the script executes before the end
+ //of the appendChild execution, so to tie an anonymous define
+ //call to the module name (which is stored on the node), hold on
+ //to a reference to this node, but clear after the DOM insertion.
+ currentlyAddingScript = node;
+ if (baseElement) {
+ head.insertBefore(node, baseElement);
+ } else {
+ head.appendChild(node);
+ }
+ currentlyAddingScript = null;
+
+ return node;
+ } else if (isWebWorker) {
+ try {
+ //In a web worker, use importScripts. This is not a very
+ //efficient use of importScripts, importScripts will block until
+ //its script is downloaded and evaluated. However, if web workers
+ //are in play, the expectation that a build has been done so that
+ //only one script needs to be loaded anyway. This may need to be
+ //reevaluated if other use cases become common.
+ importScripts(url);
+
+ //Account for anonymous modules
+ context.completeLoad(moduleName);
+ } catch (e) {
+ context.onError(makeError('importscripts',
+ 'importScripts failed for ' +
+ moduleName + ' at ' + url,
+ e,
+ [moduleName]));
+ }
+ }
+ };
+
+ function getInteractiveScript() {
+ if (interactiveScript && interactiveScript.readyState === 'interactive') {
+ return interactiveScript;
+ }
+
+ eachReverse(scripts(), function (script) {
+ if (script.readyState === 'interactive') {
+ return (interactiveScript = script);
+ }
+ });
+ return interactiveScript;
+ }
+
+ //Look for a data-main script attribute, which could also adjust the baseUrl.
+ if (isBrowser && !cfg.skipDataMain) {
+ //Figure out baseUrl. Get it from the script tag with require.js in it.
+ eachReverse(scripts(), function (script) {
+ //Set the 'head' where we can append children by
+ //using the script's parent.
+ if (!head) {
+ head = script.parentNode;
+ }
+
+ //Look for a data-main attribute to set main script for the page
+ //to load. If it is there, the path to data main becomes the
+ //baseUrl, if it is not already set.
+ dataMain = script.getAttribute('data-main');
+ if (dataMain) {
+ //Preserve dataMain in case it is a path (i.e. contains '?')
+ mainScript = dataMain;
+
+ //Set final baseUrl if there is not already an explicit one.
+ if (!cfg.baseUrl) {
+ //Pull off the directory of data-main for use as the
+ //baseUrl.
+ src = mainScript.split('/');
+ mainScript = src.pop();
+ subPath = src.length ? src.join('/') + '/' : './';
+
+ cfg.baseUrl = subPath;
+ }
+
+ //Strip off any trailing .js since mainScript is now
+ //like a module name.
+ mainScript = mainScript.replace(jsSuffixRegExp, '');
+
+ //If mainScript is still a path, fall back to dataMain
+ if (req.jsExtRegExp.test(mainScript)) {
+ mainScript = dataMain;
+ }
+
+ //Put the data-main script in the files to load.
+ cfg.deps = cfg.deps ? cfg.deps.concat(mainScript) : [mainScript];
+
+ return true;
+ }
+ });
+ }
+
+ /**
+ * The function that handles definitions of modules. Differs from
+ * require() in that a string for the module should be the first argument,
+ * and the function to execute after dependencies are loaded should
+ * return a value to define the module corresponding to the first argument's
+ * name.
+ */
+ define = function (name, deps, callback) {
+ var node, context;
+
+ //Allow for anonymous modules
+ if (typeof name !== 'string') {
+ //Adjust args appropriately
+ callback = deps;
+ deps = name;
+ name = null;
+ }
+
+ //This module may not have dependencies
+ if (!isArray(deps)) {
+ callback = deps;
+ deps = null;
+ }
+
+ //If no name, and callback is a function, then figure out if it a
+ //CommonJS thing with dependencies.
+ if (!deps && isFunction(callback)) {
+ deps = [];
+ //Remove comments from the callback string,
+ //look for require calls, and pull them into the dependencies,
+ //but only if there are function args.
+ if (callback.length) {
+ callback
+ .toString()
+ .replace(commentRegExp, '')
+ .replace(cjsRequireRegExp, function (match, dep) {
+ deps.push(dep);
+ });
+
+ //May be a CommonJS thing even without require calls, but still
+ //could use exports, and module. Avoid doing exports and module
+ //work though if it just needs require.
+ //REQUIRES the function to expect the CommonJS variables in the
+ //order listed below.
+ deps = (callback.length === 1 ? ['require'] : ['require', 'exports', 'module']).concat(deps);
+ }
+ }
+
+ //If in IE 6-8 and hit an anonymous define() call, do the interactive
+ //work.
+ if (useInteractive) {
+ node = currentlyAddingScript || getInteractiveScript();
+ if (node) {
+ if (!name) {
+ name = node.getAttribute('data-requiremodule');
+ }
+ context = contexts[node.getAttribute('data-requirecontext')];
+ }
+ }
+
+ //Always save off evaluating the def call until the script onload handler.
+ //This allows multiple modules to be in a file without prematurely
+ //tracing dependencies, and allows for anonymous module support,
+ //where the module name is not known until the script onload event
+ //occurs. If no context, use the global queue, and get it processed
+ //in the onscript load callback.
+ (context ? context.defQueue : globalDefQueue).push([name, deps, callback]);
+ };
+
+ define.amd = {
+ jQuery: true
+ };
+
+
+ /**
+ * Executes the text. Normally just uses eval, but can be modified
+ * to use a better, environment-specific call. Only used for transpiling
+ * loader plugins, not for plain JS modules.
+ * @param {String} text the text to execute/evaluate.
+ */
+ req.exec = function (text) {
+ /*jslint evil: true */
+ return eval(text);
+ };
+
+ //Set up with config info.
+ req(cfg);
+}(this));
+
+
+
+ this.requirejsVars = {
+ require: require,
+ requirejs: require,
+ define: define
+ };
+
+ if (env === 'browser') {
+ /**
+ * @license RequireJS rhino Copyright (c) 2012-2014, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+
+//sloppy since eval enclosed with use strict causes problems if the source
+//text is not strict-compliant.
+/*jslint sloppy: true, evil: true */
+/*global require, XMLHttpRequest */
+
+(function () {
+ // Separate function to avoid eval pollution, same with arguments use.
+ function exec() {
+ eval(arguments[0]);
+ }
+
+ require.load = function (context, moduleName, url) {
+ var xhr = new XMLHttpRequest();
+
+ xhr.open('GET', url, true);
+ xhr.send();
+
+ xhr.onreadystatechange = function () {
+ if (xhr.readyState === 4) {
+ exec(xhr.responseText);
+
+ //Support anonymous modules.
+ context.completeLoad(moduleName);
+ }
+ };
+ };
+}());
+ } else if (env === 'rhino') {
+ /**
+ * @license RequireJS rhino Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+
+/*jslint */
+/*global require: false, java: false, load: false */
+
+(function () {
+ 'use strict';
+ require.load = function (context, moduleName, url) {
+
+ load(url);
+
+ //Support anonymous modules.
+ context.completeLoad(moduleName);
+ };
+
+}());
+ } else if (env === 'node') {
+ this.requirejsVars.nodeRequire = nodeRequire;
+ require.nodeRequire = nodeRequire;
+
+ /**
+ * @license RequireJS node Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+
+//Explicity not strict since this file contains an eval call, and do not want
+//to enforce strict on code evaluated that way. See
+//https://github.com/jrburke/r.js/issues/774
+/*jslint regexp: false, sloppy: true*/
+/*global require: false, define: false, requirejsVars: false, process: false */
+
+/**
+ * This adapter assumes that x.js has loaded it and set up
+ * some variables. This adapter just allows limited RequireJS
+ * usage from within the requirejs directory. The general
+ * node adapater is r.js.
+ */
+
+(function () {
+ var nodeReq = requirejsVars.nodeRequire,
+ req = requirejsVars.require,
+ def = requirejsVars.define,
+ fs = nodeReq('fs'),
+ path = nodeReq('path'),
+ vm = nodeReq('vm'),
+ //In Node 0.7+ existsSync is on fs.
+ exists = fs.existsSync || path.existsSync,
+ hasOwn = Object.prototype.hasOwnProperty;
+
+ function hasProp(obj, prop) {
+ return hasOwn.call(obj, prop);
+ }
+
+ function syncTick(fn) {
+ fn();
+ }
+
+ function makeError(message, moduleName) {
+ var err = new Error(message);
+ err.requireModules = [moduleName];
+ return err;
+ }
+
+ //Supply an implementation that allows synchronous get of a module.
+ req.get = function (context, moduleName, relModuleMap, localRequire) {
+ if (moduleName === "require" || moduleName === "exports" || moduleName === "module") {
+ context.onError(makeError("Explicit require of " + moduleName + " is not allowed.", moduleName));
+ }
+
+ var ret, oldTick,
+ moduleMap = context.makeModuleMap(moduleName, relModuleMap, false, true);
+
+ //Normalize module name, if it contains . or ..
+ moduleName = moduleMap.id;
+
+ if (hasProp(context.defined, moduleName)) {
+ ret = context.defined[moduleName];
+ } else {
+ if (ret === undefined) {
+ //Make sure nextTick for this type of call is sync-based.
+ oldTick = context.nextTick;
+ context.nextTick = syncTick;
+ try {
+ if (moduleMap.prefix) {
+ //A plugin, call requirejs to handle it. Now that
+ //nextTick is syncTick, the require will complete
+ //synchronously.
+ localRequire([moduleMap.originalName]);
+
+ //Now that plugin is loaded, can regenerate the moduleMap
+ //to get the final, normalized ID.
+ moduleMap = context.makeModuleMap(moduleMap.originalName, relModuleMap, false, true);
+ moduleName = moduleMap.id;
+ } else {
+ //Try to dynamically fetch it.
+ req.load(context, moduleName, moduleMap.url);
+
+ //Enable the module
+ context.enable(moduleMap, relModuleMap);
+ }
+
+ //Break any cycles by requiring it normally, but this will
+ //finish synchronously
+ context.require([moduleName]);
+
+ //The above calls are sync, so can do the next thing safely.
+ ret = context.defined[moduleName];
+ } finally {
+ context.nextTick = oldTick;
+ }
+ }
+ }
+
+ return ret;
+ };
+
+ req.nextTick = function (fn) {
+ process.nextTick(fn);
+ };
+
+ //Add wrapper around the code so that it gets the requirejs
+ //API instead of the Node API, and it is done lexically so
+ //that it survives later execution.
+ req.makeNodeWrapper = function (contents) {
+ return '(function (require, requirejs, define) { ' +
+ contents +
+ '\n}(requirejsVars.require, requirejsVars.requirejs, requirejsVars.define));';
+ };
+
+ req.load = function (context, moduleName, url) {
+ var contents, err,
+ config = context.config;
+
+ if (config.shim[moduleName] && (!config.suppress || !config.suppress.nodeShim)) {
+ console.warn('Shim config not supported in Node, may or may not work. Detected ' +
+ 'for module: ' + moduleName);
+ }
+
+ if (exists(url)) {
+ contents = fs.readFileSync(url, 'utf8');
+
+ contents = req.makeNodeWrapper(contents);
+ try {
+ vm.runInThisContext(contents, fs.realpathSync(url));
+ } catch (e) {
+ err = new Error('Evaluating ' + url + ' as module "' +
+ moduleName + '" failed with error: ' + e);
+ err.originalError = e;
+ err.moduleName = moduleName;
+ err.requireModules = [moduleName];
+ err.fileName = url;
+ return context.onError(err);
+ }
+ } else {
+ def(moduleName, function () {
+ //Get the original name, since relative requires may be
+ //resolved differently in node (issue #202). Also, if relative,
+ //make it relative to the URL of the item requesting it
+ //(issue #393)
+ var dirName,
+ map = hasProp(context.registry, moduleName) &&
+ context.registry[moduleName].map,
+ parentMap = map && map.parentMap,
+ originalName = map && map.originalName;
+
+ if (originalName.charAt(0) === '.' && parentMap) {
+ dirName = parentMap.url.split('/');
+ dirName.pop();
+ originalName = dirName.join('/') + '/' + originalName;
+ }
+
+ try {
+ return (context.config.nodeRequire || req.nodeRequire)(originalName);
+ } catch (e) {
+ err = new Error('Tried loading "' + moduleName + '" at ' +
+ url + ' then tried node\'s require("' +
+ originalName + '") and it failed ' +
+ 'with error: ' + e);
+ err.originalError = e;
+ err.moduleName = originalName;
+ err.requireModules = [moduleName];
+ throw err;
+ }
+ });
+ }
+
+ //Support anonymous modules.
+ context.completeLoad(moduleName);
+ };
+
+ //Override to provide the function wrapper for define/require.
+ req.exec = function (text) {
+ /*jslint evil: true */
+ text = req.makeNodeWrapper(text);
+ return eval(text);
+ };
+}());
+
+ } else if (env === 'xpconnect') {
+ /**
+ * @license RequireJS xpconnect Copyright (c) 2013-2014, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+
+/*jslint */
+/*global require, load */
+
+(function () {
+ 'use strict';
+ require.load = function (context, moduleName, url) {
+
+ load(url);
+
+ //Support anonymous modules.
+ context.completeLoad(moduleName);
+ };
+
+}());
+
+ }
+
+ //Support a default file name to execute. Useful for hosted envs
+ //like Joyent where it defaults to a server.js as the only executed
+ //script. But only do it if this is not an optimization run.
+ if (commandOption !== 'o' && (!fileName || !jsSuffixRegExp.test(fileName))) {
+ fileName = 'main.js';
+ }
+
+ /**
+ * Loads the library files that can be used for the optimizer, or for other
+ * tasks.
+ */
+ function loadLib() {
+ /**
+ * @license Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+
+/*jslint strict: false */
+/*global Packages: false, process: false, window: false, navigator: false,
+ document: false, define: false */
+
+/**
+ * A plugin that modifies any /env/ path to be the right path based on
+ * the host environment. Right now only works for Node, Rhino and browser.
+ */
+(function () {
+ var pathRegExp = /(\/|^)env\/|\{env\}/,
+ env = 'unknown';
+
+ if (typeof process !== 'undefined' && process.versions && !!process.versions.node) {
+ env = 'node';
+ } else if (typeof Packages !== 'undefined') {
+ env = 'rhino';
+ } else if ((typeof navigator !== 'undefined' && typeof document !== 'undefined') ||
+ (typeof importScripts !== 'undefined' && typeof self !== 'undefined')) {
+ env = 'browser';
+ } else if (typeof Components !== 'undefined' && Components.classes && Components.interfaces) {
+ env = 'xpconnect';
+ }
+
+ define('env', {
+ get: function () {
+ return env;
+ },
+
+ load: function (name, req, load, config) {
+ //Allow override in the config.
+ if (config.env) {
+ env = config.env;
+ }
+
+ name = name.replace(pathRegExp, function (match, prefix) {
+ if (match.indexOf('{') === -1) {
+ return prefix + env + '/';
+ } else {
+ return env;
+ }
+ });
+
+ req([name], function (mod) {
+ load(mod);
+ });
+ }
+ });
+}());
+/**
+ * @license Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+
+/*jslint plusplus: true */
+/*global define, java */
+
+define('lang', function () {
+ 'use strict';
+
+ var lang, isJavaObj,
+ hasOwn = Object.prototype.hasOwnProperty;
+
+ function hasProp(obj, prop) {
+ return hasOwn.call(obj, prop);
+ }
+
+ isJavaObj = function () {
+ return false;
+ };
+
+ //Rhino, but not Nashorn (detected by importPackage not existing)
+ //Can have some strange foreign objects.
+ if (typeof java !== 'undefined' && java.lang && java.lang.Object && typeof importPackage !== 'undefined') {
+ isJavaObj = function (obj) {
+ return obj instanceof java.lang.Object;
+ };
+ }
+
+ lang = {
+ backSlashRegExp: /\\/g,
+ ostring: Object.prototype.toString,
+
+ isArray: Array.isArray || function (it) {
+ return lang.ostring.call(it) === "[object Array]";
+ },
+
+ isFunction: function(it) {
+ return lang.ostring.call(it) === "[object Function]";
+ },
+
+ isRegExp: function(it) {
+ return it && it instanceof RegExp;
+ },
+
+ hasProp: hasProp,
+
+ //returns true if the object does not have an own property prop,
+ //or if it does, it is a falsy value.
+ falseProp: function (obj, prop) {
+ return !hasProp(obj, prop) || !obj[prop];
+ },
+
+ //gets own property value for given prop on object
+ getOwn: function (obj, prop) {
+ return hasProp(obj, prop) && obj[prop];
+ },
+
+ _mixin: function(dest, source, override){
+ var name;
+ for (name in source) {
+ if(source.hasOwnProperty(name) &&
+ (override || !dest.hasOwnProperty(name))) {
+ dest[name] = source[name];
+ }
+ }
+
+ return dest; // Object
+ },
+
+ /**
+ * mixin({}, obj1, obj2) is allowed. If the last argument is a boolean,
+ * then the source objects properties are force copied over to dest.
+ */
+ mixin: function(dest){
+ var parameters = Array.prototype.slice.call(arguments),
+ override, i, l;
+
+ if (!dest) { dest = {}; }
+
+ if (parameters.length > 2 && typeof arguments[parameters.length-1] === 'boolean') {
+ override = parameters.pop();
+ }
+
+ for (i = 1, l = parameters.length; i < l; i++) {
+ lang._mixin(dest, parameters[i], override);
+ }
+ return dest; // Object
+ },
+
+ /**
+ * Does a deep mix of source into dest, where source values override
+ * dest values if a winner is needed.
+ * @param {Object} dest destination object that receives the mixed
+ * values.
+ * @param {Object} source source object contributing properties to mix
+ * in.
+ * @return {[Object]} returns dest object with the modification.
+ */
+ deepMix: function(dest, source) {
+ lang.eachProp(source, function (value, prop) {
+ if (typeof value === 'object' && value &&
+ !lang.isArray(value) && !lang.isFunction(value) &&
+ !(value instanceof RegExp)) {
+
+ if (!dest[prop]) {
+ dest[prop] = {};
+ }
+ lang.deepMix(dest[prop], value);
+ } else {
+ dest[prop] = value;
+ }
+ });
+ return dest;
+ },
+
+ /**
+ * Does a type of deep copy. Do not give it anything fancy, best
+ * for basic object copies of objects that also work well as
+ * JSON-serialized things, or has properties pointing to functions.
+ * For non-array/object values, just returns the same object.
+ * @param {Object} obj copy properties from this object
+ * @param {Object} [result] optional result object to use
+ * @return {Object}
+ */
+ deeplikeCopy: function (obj) {
+ var type, result;
+
+ if (lang.isArray(obj)) {
+ result = [];
+ obj.forEach(function(value) {
+ result.push(lang.deeplikeCopy(value));
+ });
+ return result;
+ }
+
+ type = typeof obj;
+ if (obj === null || obj === undefined || type === 'boolean' ||
+ type === 'string' || type === 'number' || lang.isFunction(obj) ||
+ lang.isRegExp(obj)|| isJavaObj(obj)) {
+ return obj;
+ }
+
+ //Anything else is an object, hopefully.
+ result = {};
+ lang.eachProp(obj, function(value, key) {
+ result[key] = lang.deeplikeCopy(value);
+ });
+ return result;
+ },
+
+ delegate: (function () {
+ // boodman/crockford delegation w/ cornford optimization
+ function TMP() {}
+ return function (obj, props) {
+ TMP.prototype = obj;
+ var tmp = new TMP();
+ TMP.prototype = null;
+ if (props) {
+ lang.mixin(tmp, props);
+ }
+ return tmp; // Object
+ };
+ }()),
+
+ /**
+ * Helper function for iterating over an array. If the func returns
+ * a true value, it will break out of the loop.
+ */
+ each: function each(ary, func) {
+ if (ary) {
+ var i;
+ for (i = 0; i < ary.length; i += 1) {
+ if (func(ary[i], i, ary)) {
+ break;
+ }
+ }
+ }
+ },
+
+ /**
+ * Cycles over properties in an object and calls a function for each
+ * property value. If the function returns a truthy value, then the
+ * iteration is stopped.
+ */
+ eachProp: function eachProp(obj, func) {
+ var prop;
+ for (prop in obj) {
+ if (hasProp(obj, prop)) {
+ if (func(obj[prop], prop)) {
+ break;
+ }
+ }
+ }
+ },
+
+ //Similar to Function.prototype.bind, but the "this" object is specified
+ //first, since it is easier to read/figure out what "this" will be.
+ bind: function bind(obj, fn) {
+ return function () {
+ return fn.apply(obj, arguments);
+ };
+ },
+
+ //Escapes a content string to be be a string that has characters escaped
+ //for inclusion as part of a JS string.
+ jsEscape: function (content) {
+ return content.replace(/(["'\\])/g, '\\$1')
+ .replace(/[\f]/g, "\\f")
+ .replace(/[\b]/g, "\\b")
+ .replace(/[\n]/g, "\\n")
+ .replace(/[\t]/g, "\\t")
+ .replace(/[\r]/g, "\\r");
+ }
+ };
+ return lang;
+});
+/**
+ * prim 0.0.1 Copyright (c) 2012-2014, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/requirejs/prim for details
+ */
+
+/*global setImmediate, process, setTimeout, define, module */
+
+//Set prime.hideResolutionConflict = true to allow "resolution-races"
+//in promise-tests to pass.
+//Since the goal of prim is to be a small impl for trusted code, it is
+//more important to normally throw in this case so that we can find
+//logic errors quicker.
+
+var prim;
+(function () {
+ 'use strict';
+ var op = Object.prototype,
+ hasOwn = op.hasOwnProperty;
+
+ function hasProp(obj, prop) {
+ return hasOwn.call(obj, prop);
+ }
+
+ /**
+ * Helper function for iterating over an array. If the func returns
+ * a true value, it will break out of the loop.
+ */
+ function each(ary, func) {
+ if (ary) {
+ var i;
+ for (i = 0; i < ary.length; i += 1) {
+ if (ary[i]) {
+ func(ary[i], i, ary);
+ }
+ }
+ }
+ }
+
+ function check(p) {
+ if (hasProp(p, 'e') || hasProp(p, 'v')) {
+ if (!prim.hideResolutionConflict) {
+ throw new Error('nope');
+ }
+ return false;
+ }
+ return true;
+ }
+
+ function notify(ary, value) {
+ prim.nextTick(function () {
+ each(ary, function (item) {
+ item(value);
+ });
+ });
+ }
+
+ prim = function prim() {
+ var p,
+ ok = [],
+ fail = [];
+
+ return (p = {
+ callback: function (yes, no) {
+ if (no) {
+ p.errback(no);
+ }
+
+ if (hasProp(p, 'v')) {
+ prim.nextTick(function () {
+ yes(p.v);
+ });
+ } else {
+ ok.push(yes);
+ }
+ },
+
+ errback: function (no) {
+ if (hasProp(p, 'e')) {
+ prim.nextTick(function () {
+ no(p.e);
+ });
+ } else {
+ fail.push(no);
+ }
+ },
+
+ finished: function () {
+ return hasProp(p, 'e') || hasProp(p, 'v');
+ },
+
+ rejected: function () {
+ return hasProp(p, 'e');
+ },
+
+ resolve: function (v) {
+ if (check(p)) {
+ p.v = v;
+ notify(ok, v);
+ }
+ return p;
+ },
+ reject: function (e) {
+ if (check(p)) {
+ p.e = e;
+ notify(fail, e);
+ }
+ return p;
+ },
+
+ start: function (fn) {
+ p.resolve();
+ return p.promise.then(fn);
+ },
+
+ promise: {
+ then: function (yes, no) {
+ var next = prim();
+
+ p.callback(function (v) {
+ try {
+ if (yes && typeof yes === 'function') {
+ v = yes(v);
+ }
+
+ if (v && v.then) {
+ v.then(next.resolve, next.reject);
+ } else {
+ next.resolve(v);
+ }
+ } catch (e) {
+ next.reject(e);
+ }
+ }, function (e) {
+ var err;
+
+ try {
+ if (!no || typeof no !== 'function') {
+ next.reject(e);
+ } else {
+ err = no(e);
+
+ if (err && err.then) {
+ err.then(next.resolve, next.reject);
+ } else {
+ next.resolve(err);
+ }
+ }
+ } catch (e2) {
+ next.reject(e2);
+ }
+ });
+
+ return next.promise;
+ },
+
+ fail: function (no) {
+ return p.promise.then(null, no);
+ },
+
+ end: function () {
+ p.errback(function (e) {
+ throw e;
+ });
+ }
+ }
+ });
+ };
+
+ prim.serial = function (ary) {
+ var result = prim().resolve().promise;
+ each(ary, function (item) {
+ result = result.then(function () {
+ return item();
+ });
+ });
+ return result;
+ };
+
+ prim.nextTick = typeof setImmediate === 'function' ? setImmediate :
+ (typeof process !== 'undefined' && process.nextTick ?
+ process.nextTick : (typeof setTimeout !== 'undefined' ?
+ function (fn) {
+ setTimeout(fn, 0);
+ } : function (fn) {
+ fn();
+ }));
+
+ if (typeof define === 'function' && define.amd) {
+ define('prim', function () { return prim; });
+ } else if (typeof module !== 'undefined' && module.exports) {
+ module.exports = prim;
+ }
+}());
+if(env === 'browser') {
+/**
+ * @license RequireJS Copyright (c) 2012-2014, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+
+/*jslint strict: false */
+/*global define: false, load: false */
+
+//Just a stub for use with uglify's consolidator.js
+define('browser/assert', function () {
+ return {};
+});
+
+}
+
+if(env === 'node') {
+/**
+ * @license RequireJS Copyright (c) 2012-2014, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+
+/*jslint strict: false */
+/*global define: false, load: false */
+
+//Needed so that rhino/assert can return a stub for uglify's consolidator.js
+define('node/assert', ['assert'], function (assert) {
+ return assert;
+});
+
+}
+
+if(env === 'rhino') {
+/**
+ * @license RequireJS Copyright (c) 2013-2014, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+
+/*jslint strict: false */
+/*global define: false, load: false */
+
+//Just a stub for use with uglify's consolidator.js
+define('rhino/assert', function () {
+ return {};
+});
+
+}
+
+if(env === 'xpconnect') {
+/**
+ * @license RequireJS Copyright (c) 2013-2014, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+
+/*jslint strict: false */
+/*global define: false, load: false */
+
+//Just a stub for use with uglify's consolidator.js
+define('xpconnect/assert', function () {
+ return {};
+});
+
+}
+
+if(env === 'browser') {
+/**
+ * @license Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+
+/*jslint strict: false */
+/*global define: false, process: false */
+
+define('browser/args', function () {
+ //Always expect config via an API call
+ return [];
+});
+
+}
+
+if(env === 'node') {
+/**
+ * @license Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+
+/*jslint strict: false */
+/*global define: false, process: false */
+
+define('node/args', function () {
+ //Do not return the "node" or "r.js" arguments
+ var args = process.argv.slice(2);
+
+ //Ignore any command option used for main x.js branching
+ if (args[0] && args[0].indexOf('-') === 0) {
+ args = args.slice(1);
+ }
+
+ return args;
+});
+
+}
+
+if(env === 'rhino') {
+/**
+ * @license Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+
+/*jslint strict: false */
+/*global define: false, process: false */
+
+var jsLibRhinoArgs = (typeof rhinoArgs !== 'undefined' && rhinoArgs) || [].concat(Array.prototype.slice.call(arguments, 0));
+
+define('rhino/args', function () {
+ var args = jsLibRhinoArgs;
+
+ //Ignore any command option used for main x.js branching
+ if (args[0] && args[0].indexOf('-') === 0) {
+ args = args.slice(1);
+ }
+
+ return args;
+});
+
+}
+
+if(env === 'xpconnect') {
+/**
+ * @license Copyright (c) 2013-2014, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+
+/*jslint strict: false */
+/*global define, xpconnectArgs */
+
+var jsLibXpConnectArgs = (typeof xpconnectArgs !== 'undefined' && xpconnectArgs) || [].concat(Array.prototype.slice.call(arguments, 0));
+
+define('xpconnect/args', function () {
+ var args = jsLibXpConnectArgs;
+
+ //Ignore any command option used for main x.js branching
+ if (args[0] && args[0].indexOf('-') === 0) {
+ args = args.slice(1);
+ }
+
+ return args;
+});
+
+}
+
+if(env === 'browser') {
+/**
+ * @license RequireJS Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+
+/*jslint strict: false */
+/*global define: false, console: false */
+
+define('browser/load', ['./file'], function (file) {
+ function load(fileName) {
+ eval(file.readFile(fileName));
+ }
+
+ return load;
+});
+
+}
+
+if(env === 'node') {
+/**
+ * @license RequireJS Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+
+/*jslint strict: false */
+/*global define: false, console: false */
+
+define('node/load', ['fs'], function (fs) {
+ function load(fileName) {
+ var contents = fs.readFileSync(fileName, 'utf8');
+ process.compile(contents, fileName);
+ }
+
+ return load;
+});
+
+}
+
+if(env === 'rhino') {
+/**
+ * @license RequireJS Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+
+/*jslint strict: false */
+/*global define: false, load: false */
+
+define('rhino/load', function () {
+ return load;
+});
+
+}
+
+if(env === 'xpconnect') {
+/**
+ * @license RequireJS Copyright (c) 2013-2014, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+
+/*jslint strict: false */
+/*global define: false, load: false */
+
+define('xpconnect/load', function () {
+ return load;
+});
+
+}
+
+if(env === 'browser') {
+/**
+ * @license Copyright (c) 2012-2014, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+
+/*jslint sloppy: true, nomen: true */
+/*global require, define, console, XMLHttpRequest, requirejs, location */
+
+define('browser/file', ['prim'], function (prim) {
+
+ var file,
+ currDirRegExp = /^\.(\/|$)/;
+
+ function frontSlash(path) {
+ return path.replace(/\\/g, '/');
+ }
+
+ function exists(path) {
+ var status, xhr = new XMLHttpRequest();
+
+ //Oh yeah, that is right SYNC IO. Behold its glory
+ //and horrible blocking behavior.
+ xhr.open('HEAD', path, false);
+ xhr.send();
+ status = xhr.status;
+
+ return status === 200 || status === 304;
+ }
+
+ function mkDir(dir) {
+ console.log('mkDir is no-op in browser');
+ }
+
+ function mkFullDir(dir) {
+ console.log('mkFullDir is no-op in browser');
+ }
+
+ file = {
+ backSlashRegExp: /\\/g,
+ exclusionRegExp: /^\./,
+ getLineSeparator: function () {
+ return '/';
+ },
+
+ exists: function (fileName) {
+ return exists(fileName);
+ },
+
+ parent: function (fileName) {
+ var parts = fileName.split('/');
+ parts.pop();
+ return parts.join('/');
+ },
+
+ /**
+ * Gets the absolute file path as a string, normalized
+ * to using front slashes for path separators.
+ * @param {String} fileName
+ */
+ absPath: function (fileName) {
+ var dir;
+ if (currDirRegExp.test(fileName)) {
+ dir = frontSlash(location.href);
+ if (dir.indexOf('/') !== -1) {
+ dir = dir.split('/');
+
+ //Pull off protocol and host, just want
+ //to allow paths (other build parts, like
+ //require._isSupportedBuildUrl do not support
+ //full URLs), but a full path from
+ //the root.
+ dir.splice(0, 3);
+
+ dir.pop();
+ dir = '/' + dir.join('/');
+ }
+
+ fileName = dir + fileName.substring(1);
+ }
+
+ return fileName;
+ },
+
+ normalize: function (fileName) {
+ return fileName;
+ },
+
+ isFile: function (path) {
+ return true;
+ },
+
+ isDirectory: function (path) {
+ return false;
+ },
+
+ getFilteredFileList: function (startDir, regExpFilters, makeUnixPaths) {
+ console.log('file.getFilteredFileList is no-op in browser');
+ },
+
+ copyDir: function (srcDir, destDir, regExpFilter, onlyCopyNew) {
+ console.log('file.copyDir is no-op in browser');
+
+ },
+
+ copyFile: function (srcFileName, destFileName, onlyCopyNew) {
+ console.log('file.copyFile is no-op in browser');
+ },
+
+ /**
+ * Renames a file. May fail if "to" already exists or is on another drive.
+ */
+ renameFile: function (from, to) {
+ console.log('file.renameFile is no-op in browser');
+ },
+
+ /**
+ * Reads a *text* file.
+ */
+ readFile: function (path, encoding) {
+ var xhr = new XMLHttpRequest();
+
+ //Oh yeah, that is right SYNC IO. Behold its glory
+ //and horrible blocking behavior.
+ xhr.open('GET', path, false);
+ xhr.send();
+
+ return xhr.responseText;
+ },
+
+ readFileAsync: function (path, encoding) {
+ var xhr = new XMLHttpRequest(),
+ d = prim();
+
+ xhr.open('GET', path, true);
+ xhr.send();
+
+ xhr.onreadystatechange = function () {
+ if (xhr.readyState === 4) {
+ if (xhr.status > 400) {
+ d.reject(new Error('Status: ' + xhr.status + ': ' + xhr.statusText));
+ } else {
+ d.resolve(xhr.responseText);
+ }
+ }
+ };
+
+ return d.promise;
+ },
+
+ saveUtf8File: function (fileName, fileContents) {
+ //summary: saves a *text* file using UTF-8 encoding.
+ file.saveFile(fileName, fileContents, "utf8");
+ },
+
+ saveFile: function (fileName, fileContents, encoding) {
+ requirejs.browser.saveFile(fileName, fileContents, encoding);
+ },
+
+ deleteFile: function (fileName) {
+ console.log('file.deleteFile is no-op in browser');
+ },
+
+ /**
+ * Deletes any empty directories under the given directory.
+ */
+ deleteEmptyDirs: function (startDir) {
+ console.log('file.deleteEmptyDirs is no-op in browser');
+ }
+ };
+
+ return file;
+
+});
+
+}
+
+if(env === 'node') {
+/**
+ * @license Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+
+/*jslint plusplus: false, octal:false, strict: false */
+/*global define: false, process: false */
+
+define('node/file', ['fs', 'path', 'prim'], function (fs, path, prim) {
+
+ var isWindows = process.platform === 'win32',
+ windowsDriveRegExp = /^[a-zA-Z]\:\/$/,
+ file;
+
+ function frontSlash(path) {
+ return path.replace(/\\/g, '/');
+ }
+
+ function exists(path) {
+ if (isWindows && path.charAt(path.length - 1) === '/' &&
+ path.charAt(path.length - 2) !== ':') {
+ path = path.substring(0, path.length - 1);
+ }
+
+ try {
+ fs.statSync(path);
+ return true;
+ } catch (e) {
+ return false;
+ }
+ }
+
+ function mkDir(dir) {
+ if (!exists(dir) && (!isWindows || !windowsDriveRegExp.test(dir))) {
+ fs.mkdirSync(dir, 511);
+ }
+ }
+
+ function mkFullDir(dir) {
+ var parts = dir.split('/'),
+ currDir = '',
+ first = true;
+
+ parts.forEach(function (part) {
+ //First part may be empty string if path starts with a slash.
+ currDir += part + '/';
+ first = false;
+
+ if (part) {
+ mkDir(currDir);
+ }
+ });
+ }
+
+ file = {
+ backSlashRegExp: /\\/g,
+ exclusionRegExp: /^\./,
+ getLineSeparator: function () {
+ return '/';
+ },
+
+ exists: function (fileName) {
+ return exists(fileName);
+ },
+
+ parent: function (fileName) {
+ var parts = fileName.split('/');
+ parts.pop();
+ return parts.join('/');
+ },
+
+ /**
+ * Gets the absolute file path as a string, normalized
+ * to using front slashes for path separators.
+ * @param {String} fileName
+ */
+ absPath: function (fileName) {
+ return frontSlash(path.normalize(frontSlash(fs.realpathSync(fileName))));
+ },
+
+ normalize: function (fileName) {
+ return frontSlash(path.normalize(fileName));
+ },
+
+ isFile: function (path) {
+ return fs.statSync(path).isFile();
+ },
+
+ isDirectory: function (path) {
+ return fs.statSync(path).isDirectory();
+ },
+
+ getFilteredFileList: function (/*String*/startDir, /*RegExp*/regExpFilters, /*boolean?*/makeUnixPaths) {
+ //summary: Recurses startDir and finds matches to the files that match regExpFilters.include
+ //and do not match regExpFilters.exclude. Or just one regexp can be passed in for regExpFilters,
+ //and it will be treated as the "include" case.
+ //Ignores files/directories that start with a period (.) unless exclusionRegExp
+ //is set to another value.
+ var files = [], topDir, regExpInclude, regExpExclude, dirFileArray,
+ i, stat, filePath, ok, dirFiles, fileName;
+
+ topDir = startDir;
+
+ regExpInclude = regExpFilters.include || regExpFilters;
+ regExpExclude = regExpFilters.exclude || null;
+
+ if (file.exists(topDir)) {
+ dirFileArray = fs.readdirSync(topDir);
+ for (i = 0; i < dirFileArray.length; i++) {
+ fileName = dirFileArray[i];
+ filePath = path.join(topDir, fileName);
+ stat = fs.statSync(filePath);
+ if (stat.isFile()) {
+ if (makeUnixPaths) {
+ //Make sure we have a JS string.
+ if (filePath.indexOf("/") === -1) {
+ filePath = frontSlash(filePath);
+ }
+ }
+
+ ok = true;
+ if (regExpInclude) {
+ ok = filePath.match(regExpInclude);
+ }
+ if (ok && regExpExclude) {
+ ok = !filePath.match(regExpExclude);
+ }
+
+ if (ok && (!file.exclusionRegExp ||
+ !file.exclusionRegExp.test(fileName))) {
+ files.push(filePath);
+ }
+ } else if (stat.isDirectory() &&
+ (!file.exclusionRegExp || !file.exclusionRegExp.test(fileName))) {
+ dirFiles = this.getFilteredFileList(filePath, regExpFilters, makeUnixPaths);
+ files.push.apply(files, dirFiles);
+ }
+ }
+ }
+
+ return files; //Array
+ },
+
+ copyDir: function (/*String*/srcDir, /*String*/destDir, /*RegExp?*/regExpFilter, /*boolean?*/onlyCopyNew) {
+ //summary: copies files from srcDir to destDir using the regExpFilter to determine if the
+ //file should be copied. Returns a list file name strings of the destinations that were copied.
+ regExpFilter = regExpFilter || /\w/;
+
+ //Normalize th directory names, but keep front slashes.
+ //path module on windows now returns backslashed paths.
+ srcDir = frontSlash(path.normalize(srcDir));
+ destDir = frontSlash(path.normalize(destDir));
+
+ var fileNames = file.getFilteredFileList(srcDir, regExpFilter, true),
+ copiedFiles = [], i, srcFileName, destFileName;
+
+ for (i = 0; i < fileNames.length; i++) {
+ srcFileName = fileNames[i];
+ destFileName = srcFileName.replace(srcDir, destDir);
+
+ if (file.copyFile(srcFileName, destFileName, onlyCopyNew)) {
+ copiedFiles.push(destFileName);
+ }
+ }
+
+ return copiedFiles.length ? copiedFiles : null; //Array or null
+ },
+
+ copyFile: function (/*String*/srcFileName, /*String*/destFileName, /*boolean?*/onlyCopyNew) {
+ //summary: copies srcFileName to destFileName. If onlyCopyNew is set, it only copies the file if
+ //srcFileName is newer than destFileName. Returns a boolean indicating if the copy occurred.
+ var parentDir;
+
+ //logger.trace("Src filename: " + srcFileName);
+ //logger.trace("Dest filename: " + destFileName);
+
+ //If onlyCopyNew is true, then compare dates and only copy if the src is newer
+ //than dest.
+ if (onlyCopyNew) {
+ if (file.exists(destFileName) && fs.statSync(destFileName).mtime.getTime() >= fs.statSync(srcFileName).mtime.getTime()) {
+ return false; //Boolean
+ }
+ }
+
+ //Make sure destination dir exists.
+ parentDir = path.dirname(destFileName);
+ if (!file.exists(parentDir)) {
+ mkFullDir(parentDir);
+ }
+
+ fs.writeFileSync(destFileName, fs.readFileSync(srcFileName, 'binary'), 'binary');
+
+ return true; //Boolean
+ },
+
+ /**
+ * Renames a file. May fail if "to" already exists or is on another drive.
+ */
+ renameFile: function (from, to) {
+ return fs.renameSync(from, to);
+ },
+
+ /**
+ * Reads a *text* file.
+ */
+ readFile: function (/*String*/path, /*String?*/encoding) {
+ if (encoding === 'utf-8') {
+ encoding = 'utf8';
+ }
+ if (!encoding) {
+ encoding = 'utf8';
+ }
+
+ var text = fs.readFileSync(path, encoding);
+
+ //Hmm, would not expect to get A BOM, but it seems to happen,
+ //remove it just in case.
+ if (text.indexOf('\uFEFF') === 0) {
+ text = text.substring(1, text.length);
+ }
+
+ return text;
+ },
+
+ readFileAsync: function (path, encoding) {
+ var d = prim();
+ try {
+ d.resolve(file.readFile(path, encoding));
+ } catch (e) {
+ d.reject(e);
+ }
+ return d.promise;
+ },
+
+ saveUtf8File: function (/*String*/fileName, /*String*/fileContents) {
+ //summary: saves a *text* file using UTF-8 encoding.
+ file.saveFile(fileName, fileContents, "utf8");
+ },
+
+ saveFile: function (/*String*/fileName, /*String*/fileContents, /*String?*/encoding) {
+ //summary: saves a *text* file.
+ var parentDir;
+
+ if (encoding === 'utf-8') {
+ encoding = 'utf8';
+ }
+ if (!encoding) {
+ encoding = 'utf8';
+ }
+
+ //Make sure destination directories exist.
+ parentDir = path.dirname(fileName);
+ if (!file.exists(parentDir)) {
+ mkFullDir(parentDir);
+ }
+
+ fs.writeFileSync(fileName, fileContents, encoding);
+ },
+
+ deleteFile: function (/*String*/fileName) {
+ //summary: deletes a file or directory if it exists.
+ var files, i, stat;
+ if (file.exists(fileName)) {
+ stat = fs.lstatSync(fileName);
+ if (stat.isDirectory()) {
+ files = fs.readdirSync(fileName);
+ for (i = 0; i < files.length; i++) {
+ this.deleteFile(path.join(fileName, files[i]));
+ }
+ fs.rmdirSync(fileName);
+ } else {
+ fs.unlinkSync(fileName);
+ }
+ }
+ },
+
+
+ /**
+ * Deletes any empty directories under the given directory.
+ */
+ deleteEmptyDirs: function (startDir) {
+ var dirFileArray, i, fileName, filePath, stat;
+
+ if (file.exists(startDir)) {
+ dirFileArray = fs.readdirSync(startDir);
+ for (i = 0; i < dirFileArray.length; i++) {
+ fileName = dirFileArray[i];
+ filePath = path.join(startDir, fileName);
+ stat = fs.lstatSync(filePath);
+ if (stat.isDirectory()) {
+ file.deleteEmptyDirs(filePath);
+ }
+ }
+
+ //If directory is now empty, remove it.
+ if (fs.readdirSync(startDir).length === 0) {
+ file.deleteFile(startDir);
+ }
+ }
+ }
+ };
+
+ return file;
+
+});
+
+}
+
+if(env === 'rhino') {
+/**
+ * @license RequireJS Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+//Helper functions to deal with file I/O.
+
+/*jslint plusplus: false */
+/*global java: false, define: false */
+
+define('rhino/file', ['prim'], function (prim) {
+ var file = {
+ backSlashRegExp: /\\/g,
+
+ exclusionRegExp: /^\./,
+
+ getLineSeparator: function () {
+ return file.lineSeparator;
+ },
+
+ lineSeparator: java.lang.System.getProperty("line.separator"), //Java String
+
+ exists: function (fileName) {
+ return (new java.io.File(fileName)).exists();
+ },
+
+ parent: function (fileName) {
+ return file.absPath((new java.io.File(fileName)).getParentFile());
+ },
+
+ normalize: function (fileName) {
+ return file.absPath(fileName);
+ },
+
+ isFile: function (path) {
+ return (new java.io.File(path)).isFile();
+ },
+
+ isDirectory: function (path) {
+ return (new java.io.File(path)).isDirectory();
+ },
+
+ /**
+ * Gets the absolute file path as a string, normalized
+ * to using front slashes for path separators.
+ * @param {java.io.File||String} file
+ */
+ absPath: function (fileObj) {
+ if (typeof fileObj === "string") {
+ fileObj = new java.io.File(fileObj);
+ }
+ return (fileObj.getCanonicalPath() + "").replace(file.backSlashRegExp, "/");
+ },
+
+ getFilteredFileList: function (/*String*/startDir, /*RegExp*/regExpFilters, /*boolean?*/makeUnixPaths, /*boolean?*/startDirIsJavaObject) {
+ //summary: Recurses startDir and finds matches to the files that match regExpFilters.include
+ //and do not match regExpFilters.exclude. Or just one regexp can be passed in for regExpFilters,
+ //and it will be treated as the "include" case.
+ //Ignores files/directories that start with a period (.) unless exclusionRegExp
+ //is set to another value.
+ var files = [], topDir, regExpInclude, regExpExclude, dirFileArray,
+ i, fileObj, filePath, ok, dirFiles;
+
+ topDir = startDir;
+ if (!startDirIsJavaObject) {
+ topDir = new java.io.File(startDir);
+ }
+
+ regExpInclude = regExpFilters.include || regExpFilters;
+ regExpExclude = regExpFilters.exclude || null;
+
+ if (topDir.exists()) {
+ dirFileArray = topDir.listFiles();
+ for (i = 0; i < dirFileArray.length; i++) {
+ fileObj = dirFileArray[i];
+ if (fileObj.isFile()) {
+ filePath = fileObj.getPath();
+ if (makeUnixPaths) {
+ //Make sure we have a JS string.
+ filePath = String(filePath);
+ if (filePath.indexOf("/") === -1) {
+ filePath = filePath.replace(/\\/g, "/");
+ }
+ }
+
+ ok = true;
+ if (regExpInclude) {
+ ok = filePath.match(regExpInclude);
+ }
+ if (ok && regExpExclude) {
+ ok = !filePath.match(regExpExclude);
+ }
+
+ if (ok && (!file.exclusionRegExp ||
+ !file.exclusionRegExp.test(fileObj.getName()))) {
+ files.push(filePath);
+ }
+ } else if (fileObj.isDirectory() &&
+ (!file.exclusionRegExp || !file.exclusionRegExp.test(fileObj.getName()))) {
+ dirFiles = this.getFilteredFileList(fileObj, regExpFilters, makeUnixPaths, true);
+ files.push.apply(files, dirFiles);
+ }
+ }
+ }
+
+ return files; //Array
+ },
+
+ copyDir: function (/*String*/srcDir, /*String*/destDir, /*RegExp?*/regExpFilter, /*boolean?*/onlyCopyNew) {
+ //summary: copies files from srcDir to destDir using the regExpFilter to determine if the
+ //file should be copied. Returns a list file name strings of the destinations that were copied.
+ regExpFilter = regExpFilter || /\w/;
+
+ var fileNames = file.getFilteredFileList(srcDir, regExpFilter, true),
+ copiedFiles = [], i, srcFileName, destFileName;
+
+ for (i = 0; i < fileNames.length; i++) {
+ srcFileName = fileNames[i];
+ destFileName = srcFileName.replace(srcDir, destDir);
+
+ if (file.copyFile(srcFileName, destFileName, onlyCopyNew)) {
+ copiedFiles.push(destFileName);
+ }
+ }
+
+ return copiedFiles.length ? copiedFiles : null; //Array or null
+ },
+
+ copyFile: function (/*String*/srcFileName, /*String*/destFileName, /*boolean?*/onlyCopyNew) {
+ //summary: copies srcFileName to destFileName. If onlyCopyNew is set, it only copies the file if
+ //srcFileName is newer than destFileName. Returns a boolean indicating if the copy occurred.
+ var destFile = new java.io.File(destFileName), srcFile, parentDir,
+ srcChannel, destChannel;
+
+ //logger.trace("Src filename: " + srcFileName);
+ //logger.trace("Dest filename: " + destFileName);
+
+ //If onlyCopyNew is true, then compare dates and only copy if the src is newer
+ //than dest.
+ if (onlyCopyNew) {
+ srcFile = new java.io.File(srcFileName);
+ if (destFile.exists() && destFile.lastModified() >= srcFile.lastModified()) {
+ return false; //Boolean
+ }
+ }
+
+ //Make sure destination dir exists.
+ parentDir = destFile.getParentFile();
+ if (!parentDir.exists()) {
+ if (!parentDir.mkdirs()) {
+ throw "Could not create directory: " + parentDir.getCanonicalPath();
+ }
+ }
+
+ //Java's version of copy file.
+ srcChannel = new java.io.FileInputStream(srcFileName).getChannel();
+ destChannel = new java.io.FileOutputStream(destFileName).getChannel();
+ destChannel.transferFrom(srcChannel, 0, srcChannel.size());
+ srcChannel.close();
+ destChannel.close();
+
+ return true; //Boolean
+ },
+
+ /**
+ * Renames a file. May fail if "to" already exists or is on another drive.
+ */
+ renameFile: function (from, to) {
+ return (new java.io.File(from)).renameTo((new java.io.File(to)));
+ },
+
+ readFile: function (/*String*/path, /*String?*/encoding) {
+ //A file read function that can deal with BOMs
+ encoding = encoding || "utf-8";
+ var fileObj = new java.io.File(path),
+ input = new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(fileObj), encoding)),
+ stringBuffer, line;
+ try {
+ stringBuffer = new java.lang.StringBuffer();
+ line = input.readLine();
+
+ // Byte Order Mark (BOM) - The Unicode Standard, version 3.0, page 324
+ // http://www.unicode.org/faq/utf_bom.html
+
+ // Note that when we use utf-8, the BOM should appear as "EF BB BF", but it doesn't due to this bug in the JDK:
+ // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4508058
+ if (line && line.length() && line.charAt(0) === 0xfeff) {
+ // Eat the BOM, since we've already found the encoding on this file,
+ // and we plan to concatenating this buffer with others; the BOM should
+ // only appear at the top of a file.
+ line = line.substring(1);
+ }
+ while (line !== null) {
+ stringBuffer.append(line);
+ stringBuffer.append(file.lineSeparator);
+ line = input.readLine();
+ }
+ //Make sure we return a JavaScript string and not a Java string.
+ return String(stringBuffer.toString()); //String
+ } finally {
+ input.close();
+ }
+ },
+
+ readFileAsync: function (path, encoding) {
+ var d = prim();
+ try {
+ d.resolve(file.readFile(path, encoding));
+ } catch (e) {
+ d.reject(e);
+ }
+ return d.promise;
+ },
+
+ saveUtf8File: function (/*String*/fileName, /*String*/fileContents) {
+ //summary: saves a file using UTF-8 encoding.
+ file.saveFile(fileName, fileContents, "utf-8");
+ },
+
+ saveFile: function (/*String*/fileName, /*String*/fileContents, /*String?*/encoding) {
+ //summary: saves a file.
+ var outFile = new java.io.File(fileName), outWriter, parentDir, os;
+
+ parentDir = outFile.getAbsoluteFile().getParentFile();
+ if (!parentDir.exists()) {
+ if (!parentDir.mkdirs()) {
+ throw "Could not create directory: " + parentDir.getAbsolutePath();
+ }
+ }
+
+ if (encoding) {
+ outWriter = new java.io.OutputStreamWriter(new java.io.FileOutputStream(outFile), encoding);
+ } else {
+ outWriter = new java.io.OutputStreamWriter(new java.io.FileOutputStream(outFile));
+ }
+
+ os = new java.io.BufferedWriter(outWriter);
+ try {
+ //If in Nashorn, need to coerce the JS string to a Java string so that
+ //writer.write method dispatch correctly detects the type.
+ if (typeof importPackage !== 'undefined') {
+ os.write(fileContents);
+ } else {
+ os.write(new java.lang.String(fileContents));
+ }
+ } finally {
+ os.close();
+ }
+ },
+
+ deleteFile: function (/*String*/fileName) {
+ //summary: deletes a file or directory if it exists.
+ var fileObj = new java.io.File(fileName), files, i;
+ if (fileObj.exists()) {
+ if (fileObj.isDirectory()) {
+ files = fileObj.listFiles();
+ for (i = 0; i < files.length; i++) {
+ this.deleteFile(files[i]);
+ }
+ }
+ fileObj["delete"]();
+ }
+ },
+
+ /**
+ * Deletes any empty directories under the given directory.
+ * The startDirIsJavaObject is private to this implementation's
+ * recursion needs.
+ */
+ deleteEmptyDirs: function (startDir, startDirIsJavaObject) {
+ var topDir = startDir,
+ dirFileArray, i, fileObj;
+
+ if (!startDirIsJavaObject) {
+ topDir = new java.io.File(startDir);
+ }
+
+ if (topDir.exists()) {
+ dirFileArray = topDir.listFiles();
+ for (i = 0; i < dirFileArray.length; i++) {
+ fileObj = dirFileArray[i];
+ if (fileObj.isDirectory()) {
+ file.deleteEmptyDirs(fileObj, true);
+ }
+ }
+
+ //If the directory is empty now, delete it.
+ if (topDir.listFiles().length === 0) {
+ file.deleteFile(String(topDir.getPath()));
+ }
+ }
+ }
+ };
+
+ return file;
+});
+
+}
+
+if(env === 'xpconnect') {
+/**
+ * @license RequireJS Copyright (c) 2013-2014, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+//Helper functions to deal with file I/O.
+
+/*jslint plusplus: false */
+/*global define, Components, xpcUtil */
+
+define('xpconnect/file', ['prim'], function (prim) {
+ var file,
+ Cc = Components.classes,
+ Ci = Components.interfaces,
+ //Depends on xpcUtil which is set up in x.js
+ xpfile = xpcUtil.xpfile;
+
+ function mkFullDir(dirObj) {
+ //1 is DIRECTORY_TYPE, 511 is 0777 permissions
+ if (!dirObj.exists()) {
+ dirObj.create(1, 511);
+ }
+ }
+
+ file = {
+ backSlashRegExp: /\\/g,
+
+ exclusionRegExp: /^\./,
+
+ getLineSeparator: function () {
+ return file.lineSeparator;
+ },
+
+ lineSeparator: ('@mozilla.org/windows-registry-key;1' in Cc) ?
+ '\r\n' : '\n',
+
+ exists: function (fileName) {
+ return xpfile(fileName).exists();
+ },
+
+ parent: function (fileName) {
+ return xpfile(fileName).parent;
+ },
+
+ normalize: function (fileName) {
+ return file.absPath(fileName);
+ },
+
+ isFile: function (path) {
+ return xpfile(path).isFile();
+ },
+
+ isDirectory: function (path) {
+ return xpfile(path).isDirectory();
+ },
+
+ /**
+ * Gets the absolute file path as a string, normalized
+ * to using front slashes for path separators.
+ * @param {java.io.File||String} file
+ */
+ absPath: function (fileObj) {
+ if (typeof fileObj === "string") {
+ fileObj = xpfile(fileObj);
+ }
+ return fileObj.path;
+ },
+
+ getFilteredFileList: function (/*String*/startDir, /*RegExp*/regExpFilters, /*boolean?*/makeUnixPaths, /*boolean?*/startDirIsObject) {
+ //summary: Recurses startDir and finds matches to the files that match regExpFilters.include
+ //and do not match regExpFilters.exclude. Or just one regexp can be passed in for regExpFilters,
+ //and it will be treated as the "include" case.
+ //Ignores files/directories that start with a period (.) unless exclusionRegExp
+ //is set to another value.
+ var files = [], topDir, regExpInclude, regExpExclude, dirFileArray,
+ fileObj, filePath, ok, dirFiles;
+
+ topDir = startDir;
+ if (!startDirIsObject) {
+ topDir = xpfile(startDir);
+ }
+
+ regExpInclude = regExpFilters.include || regExpFilters;
+ regExpExclude = regExpFilters.exclude || null;
+
+ if (topDir.exists()) {
+ dirFileArray = topDir.directoryEntries;
+ while (dirFileArray.hasMoreElements()) {
+ fileObj = dirFileArray.getNext().QueryInterface(Ci.nsILocalFile);
+ if (fileObj.isFile()) {
+ filePath = fileObj.path;
+ if (makeUnixPaths) {
+ if (filePath.indexOf("/") === -1) {
+ filePath = filePath.replace(/\\/g, "/");
+ }
+ }
+
+ ok = true;
+ if (regExpInclude) {
+ ok = filePath.match(regExpInclude);
+ }
+ if (ok && regExpExclude) {
+ ok = !filePath.match(regExpExclude);
+ }
+
+ if (ok && (!file.exclusionRegExp ||
+ !file.exclusionRegExp.test(fileObj.leafName))) {
+ files.push(filePath);
+ }
+ } else if (fileObj.isDirectory() &&
+ (!file.exclusionRegExp || !file.exclusionRegExp.test(fileObj.leafName))) {
+ dirFiles = this.getFilteredFileList(fileObj, regExpFilters, makeUnixPaths, true);
+ files.push.apply(files, dirFiles);
+ }
+ }
+ }
+
+ return files; //Array
+ },
+
+ copyDir: function (/*String*/srcDir, /*String*/destDir, /*RegExp?*/regExpFilter, /*boolean?*/onlyCopyNew) {
+ //summary: copies files from srcDir to destDir using the regExpFilter to determine if the
+ //file should be copied. Returns a list file name strings of the destinations that were copied.
+ regExpFilter = regExpFilter || /\w/;
+
+ var fileNames = file.getFilteredFileList(srcDir, regExpFilter, true),
+ copiedFiles = [], i, srcFileName, destFileName;
+
+ for (i = 0; i < fileNames.length; i += 1) {
+ srcFileName = fileNames[i];
+ destFileName = srcFileName.replace(srcDir, destDir);
+
+ if (file.copyFile(srcFileName, destFileName, onlyCopyNew)) {
+ copiedFiles.push(destFileName);
+ }
+ }
+
+ return copiedFiles.length ? copiedFiles : null; //Array or null
+ },
+
+ copyFile: function (/*String*/srcFileName, /*String*/destFileName, /*boolean?*/onlyCopyNew) {
+ //summary: copies srcFileName to destFileName. If onlyCopyNew is set, it only copies the file if
+ //srcFileName is newer than destFileName. Returns a boolean indicating if the copy occurred.
+ var destFile = xpfile(destFileName),
+ srcFile = xpfile(srcFileName);
+
+ //logger.trace("Src filename: " + srcFileName);
+ //logger.trace("Dest filename: " + destFileName);
+
+ //If onlyCopyNew is true, then compare dates and only copy if the src is newer
+ //than dest.
+ if (onlyCopyNew) {
+ if (destFile.exists() && destFile.lastModifiedTime >= srcFile.lastModifiedTime) {
+ return false; //Boolean
+ }
+ }
+
+ srcFile.copyTo(destFile.parent, destFile.leafName);
+
+ return true; //Boolean
+ },
+
+ /**
+ * Renames a file. May fail if "to" already exists or is on another drive.
+ */
+ renameFile: function (from, to) {
+ var toFile = xpfile(to);
+ return xpfile(from).moveTo(toFile.parent, toFile.leafName);
+ },
+
+ readFile: xpcUtil.readFile,
+
+ readFileAsync: function (path, encoding) {
+ var d = prim();
+ try {
+ d.resolve(file.readFile(path, encoding));
+ } catch (e) {
+ d.reject(e);
+ }
+ return d.promise;
+ },
+
+ saveUtf8File: function (/*String*/fileName, /*String*/fileContents) {
+ //summary: saves a file using UTF-8 encoding.
+ file.saveFile(fileName, fileContents, "utf-8");
+ },
+
+ saveFile: function (/*String*/fileName, /*String*/fileContents, /*String?*/encoding) {
+ var outStream, convertStream,
+ fileObj = xpfile(fileName);
+
+ mkFullDir(fileObj.parent);
+
+ try {
+ outStream = Cc['@mozilla.org/network/file-output-stream;1']
+ .createInstance(Ci.nsIFileOutputStream);
+ //438 is decimal for 0777
+ outStream.init(fileObj, 0x02 | 0x08 | 0x20, 511, 0);
+
+ convertStream = Cc['@mozilla.org/intl/converter-output-stream;1']
+ .createInstance(Ci.nsIConverterOutputStream);
+
+ convertStream.init(outStream, encoding, 0, 0);
+ convertStream.writeString(fileContents);
+ } catch (e) {
+ throw new Error((fileObj && fileObj.path || '') + ': ' + e);
+ } finally {
+ if (convertStream) {
+ convertStream.close();
+ }
+ if (outStream) {
+ outStream.close();
+ }
+ }
+ },
+
+ deleteFile: function (/*String*/fileName) {
+ //summary: deletes a file or directory if it exists.
+ var fileObj = xpfile(fileName);
+ if (fileObj.exists()) {
+ fileObj.remove(true);
+ }
+ },
+
+ /**
+ * Deletes any empty directories under the given directory.
+ * The startDirIsJavaObject is private to this implementation's
+ * recursion needs.
+ */
+ deleteEmptyDirs: function (startDir, startDirIsObject) {
+ var topDir = startDir,
+ dirFileArray, fileObj;
+
+ if (!startDirIsObject) {
+ topDir = xpfile(startDir);
+ }
+
+ if (topDir.exists()) {
+ dirFileArray = topDir.directoryEntries;
+ while (dirFileArray.hasMoreElements()) {
+ fileObj = dirFileArray.getNext().QueryInterface(Ci.nsILocalFile);
+
+ if (fileObj.isDirectory()) {
+ file.deleteEmptyDirs(fileObj, true);
+ }
+ }
+
+ //If the directory is empty now, delete it.
+ dirFileArray = topDir.directoryEntries;
+ if (!dirFileArray.hasMoreElements()) {
+ file.deleteFile(topDir.path);
+ }
+ }
+ }
+ };
+
+ return file;
+});
+
+}
+
+if(env === 'browser') {
+/*global process */
+define('browser/quit', function () {
+ 'use strict';
+ return function (code) {
+ };
+});
+}
+
+if(env === 'node') {
+/*global process */
+define('node/quit', function () {
+ 'use strict';
+ return function (code) {
+ var draining = 0;
+ var exit = function () {
+ if (draining === 0) {
+ process.exit(code);
+ } else {
+ draining -= 1;
+ }
+ };
+ if (process.stdout.bufferSize) {
+ draining += 1;
+ process.stdout.once('drain', exit);
+ }
+ if (process.stderr.bufferSize) {
+ draining += 1;
+ process.stderr.once('drain', exit);
+ }
+ exit();
+ };
+});
+
+}
+
+if(env === 'rhino') {
+/*global quit */
+define('rhino/quit', function () {
+ 'use strict';
+ return function (code) {
+ return quit(code);
+ };
+});
+
+}
+
+if(env === 'xpconnect') {
+/*global quit */
+define('xpconnect/quit', function () {
+ 'use strict';
+ return function (code) {
+ return quit(code);
+ };
+});
+
+}
+
+if(env === 'browser') {
+/**
+ * @license RequireJS Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+
+/*jslint strict: false */
+/*global define: false, console: false */
+
+define('browser/print', function () {
+ function print(msg) {
+ console.log(msg);
+ }
+
+ return print;
+});
+
+}
+
+if(env === 'node') {
+/**
+ * @license RequireJS Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+
+/*jslint strict: false */
+/*global define: false, console: false */
+
+define('node/print', function () {
+ function print(msg) {
+ console.log(msg);
+ }
+
+ return print;
+});
+
+}
+
+if(env === 'rhino') {
+/**
+ * @license RequireJS Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+
+/*jslint strict: false */
+/*global define: false, print: false */
+
+define('rhino/print', function () {
+ return print;
+});
+
+}
+
+if(env === 'xpconnect') {
+/**
+ * @license RequireJS Copyright (c) 2013-2014, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+
+/*jslint strict: false */
+/*global define: false, print: false */
+
+define('xpconnect/print', function () {
+ return print;
+});
+
+}
+/**
+ * @license RequireJS Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+
+/*jslint nomen: false, strict: false */
+/*global define: false */
+
+define('logger', ['env!env/print'], function (print) {
+ var logger = {
+ TRACE: 0,
+ INFO: 1,
+ WARN: 2,
+ ERROR: 3,
+ SILENT: 4,
+ level: 0,
+ logPrefix: "",
+
+ logLevel: function( level ) {
+ this.level = level;
+ },
+
+ trace: function (message) {
+ if (this.level <= this.TRACE) {
+ this._print(message);
+ }
+ },
+
+ info: function (message) {
+ if (this.level <= this.INFO) {
+ this._print(message);
+ }
+ },
+
+ warn: function (message) {
+ if (this.level <= this.WARN) {
+ this._print(message);
+ }
+ },
+
+ error: function (message) {
+ if (this.level <= this.ERROR) {
+ this._print(message);
+ }
+ },
+
+ _print: function (message) {
+ this._sysPrint((this.logPrefix ? (this.logPrefix + " ") : "") + message);
+ },
+
+ _sysPrint: function (message) {
+ print(message);
+ }
+ };
+
+ return logger;
+});
+//Just a blank file to use when building the optimizer with the optimizer,
+//so that the build does not attempt to inline some env modules,
+//like Node's fs and path.
+
+/*
+ Copyright (C) 2013 Ariya Hidayat <ariya.hidayat@gmail.com>
+ Copyright (C) 2013 Thaddee Tyl <thaddee.tyl@gmail.com>
+ Copyright (C) 2013 Mathias Bynens <mathias@qiwi.be>
+ Copyright (C) 2012 Ariya Hidayat <ariya.hidayat@gmail.com>
+ Copyright (C) 2012 Mathias Bynens <mathias@qiwi.be>
+ Copyright (C) 2012 Joost-Wim Boekesteijn <joost-wim@boekesteijn.nl>
+ Copyright (C) 2012 Kris Kowal <kris.kowal@cixar.com>
+ Copyright (C) 2012 Yusuke Suzuki <utatane.tea@gmail.com>
+ Copyright (C) 2012 Arpad Borsos <arpad.borsos@googlemail.com>
+ Copyright (C) 2011 Ariya Hidayat <ariya.hidayat@gmail.com>
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+(function (root, factory) {
+ 'use strict';
+
+ // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js,
+ // Rhino, and plain browser loading.
+
+ /* istanbul ignore next */
+ if (typeof define === 'function' && define.amd) {
+ define('esprima', ['exports'], factory);
+ } else if (typeof exports !== 'undefined') {
+ factory(exports);
+ } else {
+ factory((root.esprima = {}));
+ }
+}(this, function (exports) {
+ 'use strict';
+
+ var Token,
+ TokenName,
+ FnExprTokens,
+ Syntax,
+ PlaceHolders,
+ Messages,
+ Regex,
+ source,
+ strict,
+ index,
+ lineNumber,
+ lineStart,
+ hasLineTerminator,
+ lastIndex,
+ lastLineNumber,
+ lastLineStart,
+ startIndex,
+ startLineNumber,
+ startLineStart,
+ scanning,
+ length,
+ lookahead,
+ state,
+ extra;
+
+ Token = {
+ BooleanLiteral: 1,
+ EOF: 2,
+ Identifier: 3,
+ Keyword: 4,
+ NullLiteral: 5,
+ NumericLiteral: 6,
+ Punctuator: 7,
+ StringLiteral: 8,
+ RegularExpression: 9
+ };
+
+ TokenName = {};
+ TokenName[Token.BooleanLiteral] = 'Boolean';
+ TokenName[Token.EOF] = '<end>';
+ TokenName[Token.Identifier] = 'Identifier';
+ TokenName[Token.Keyword] = 'Keyword';
+ TokenName[Token.NullLiteral] = 'Null';
+ TokenName[Token.NumericLiteral] = 'Numeric';
+ TokenName[Token.Punctuator] = 'Punctuator';
+ TokenName[Token.StringLiteral] = 'String';
+ TokenName[Token.RegularExpression] = 'RegularExpression';
+
+ // A function following one of those tokens is an expression.
+ FnExprTokens = ['(', '{', '[', 'in', 'typeof', 'instanceof', 'new',
+ 'return', 'case', 'delete', 'throw', 'void',
+ // assignment operators
+ '=', '+=', '-=', '*=', '/=', '%=', '<<=', '>>=', '>>>=',
+ '&=', '|=', '^=', ',',
+ // binary/unary operators
+ '+', '-', '*', '/', '%', '++', '--', '<<', '>>', '>>>', '&',
+ '|', '^', '!', '~', '&&', '||', '?', ':', '===', '==', '>=',
+ '<=', '<', '>', '!=', '!=='];
+
+ Syntax = {
+ AssignmentExpression: 'AssignmentExpression',
+ ArrayExpression: 'ArrayExpression',
+ ArrowFunctionExpression: 'ArrowFunctionExpression',
+ BlockStatement: 'BlockStatement',
+ BinaryExpression: 'BinaryExpression',
+ BreakStatement: 'BreakStatement',
+ CallExpression: 'CallExpression',
+ CatchClause: 'CatchClause',
+ ClassBody: 'ClassBody',
+ ClassDeclaration: 'ClassDeclaration',
+ ClassExpression: 'ClassExpression',
+ ConditionalExpression: 'ConditionalExpression',
+ ContinueStatement: 'ContinueStatement',
+ DoWhileStatement: 'DoWhileStatement',
+ DebuggerStatement: 'DebuggerStatement',
+ EmptyStatement: 'EmptyStatement',
+ ExpressionStatement: 'ExpressionStatement',
+ ForStatement: 'ForStatement',
+ ForInStatement: 'ForInStatement',
+ FunctionDeclaration: 'FunctionDeclaration',
+ FunctionExpression: 'FunctionExpression',
+ Identifier: 'Identifier',
+ IfStatement: 'IfStatement',
+ Literal: 'Literal',
+ LabeledStatement: 'LabeledStatement',
+ LogicalExpression: 'LogicalExpression',
+ MemberExpression: 'MemberExpression',
+ MethodDefinition: 'MethodDefinition',
+ NewExpression: 'NewExpression',
+ ObjectExpression: 'ObjectExpression',
+ Program: 'Program',
+ Property: 'Property',
+ RestElement: 'RestElement',
+ ReturnStatement: 'ReturnStatement',
+ SequenceExpression: 'SequenceExpression',
+ SwitchStatement: 'SwitchStatement',
+ SwitchCase: 'SwitchCase',
+ ThisExpression: 'ThisExpression',
+ ThrowStatement: 'ThrowStatement',
+ TryStatement: 'TryStatement',
+ UnaryExpression: 'UnaryExpression',
+ UpdateExpression: 'UpdateExpression',
+ VariableDeclaration: 'VariableDeclaration',
+ VariableDeclarator: 'VariableDeclarator',
+ WhileStatement: 'WhileStatement',
+ WithStatement: 'WithStatement'
+ };
+
+ PlaceHolders = {
+ ArrowParameterPlaceHolder: 'ArrowParameterPlaceHolder'
+ };
+
+ // Error messages should be identical to V8.
+ Messages = {
+ UnexpectedToken: 'Unexpected token %0',
+ UnexpectedNumber: 'Unexpected number',
+ UnexpectedString: 'Unexpected string',
+ UnexpectedIdentifier: 'Unexpected identifier',
+ UnexpectedReserved: 'Unexpected reserved word',
+ UnexpectedEOS: 'Unexpected end of input',
+ NewlineAfterThrow: 'Illegal newline after throw',
+ InvalidRegExp: 'Invalid regular expression',
+ UnterminatedRegExp: 'Invalid regular expression: missing /',
+ InvalidLHSInAssignment: 'Invalid left-hand side in assignment',
+ InvalidLHSInForIn: 'Invalid left-hand side in for-in',
+ MultipleDefaultsInSwitch: 'More than one default clause in switch statement',
+ NoCatchOrFinally: 'Missing catch or finally after try',
+ UnknownLabel: 'Undefined label \'%0\'',
+ Redeclaration: '%0 \'%1\' has already been declared',
+ IllegalContinue: 'Illegal continue statement',
+ IllegalBreak: 'Illegal break statement',
+ IllegalReturn: 'Illegal return statement',
+ StrictModeWith: 'Strict mode code may not include a with statement',
+ StrictCatchVariable: 'Catch variable may not be eval or arguments in strict mode',
+ StrictVarName: 'Variable name may not be eval or arguments in strict mode',
+ StrictParamName: 'Parameter name eval or arguments is not allowed in strict mode',
+ StrictParamDupe: 'Strict mode function may not have duplicate parameter names',
+ StrictFunctionName: 'Function name may not be eval or arguments in strict mode',
+ StrictOctalLiteral: 'Octal literals are not allowed in strict mode.',
+ StrictDelete: 'Delete of an unqualified identifier in strict mode.',
+ StrictLHSAssignment: 'Assignment to eval or arguments is not allowed in strict mode',
+ StrictLHSPostfix: 'Postfix increment/decrement may not have eval or arguments operand in strict mode',
+ StrictLHSPrefix: 'Prefix increment/decrement may not have eval or arguments operand in strict mode',
+ StrictReservedWord: 'Use of future reserved word in strict mode',
+ ParameterAfterRestParameter: 'Rest parameter must be last formal parameter',
+ DefaultRestParameter: 'Unexpected token =',
+ ObjectPatternAsRestParameter: 'Unexpected token {',
+ DuplicateProtoProperty: 'Duplicate __proto__ fields are not allowed in object literals',
+ ConstructorSpecialMethod: 'Class constructor may not be an accessor',
+ DuplicateConstructor: 'A class may only have one constructor',
+ StaticPrototype: 'Classes may not have static property named prototype'
+ };
+
+ // See also tools/generate-unicode-regex.py.
+ Regex = {
+ NonAsciiIdentifierStart: new RegExp('[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B2\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]'),
+ NonAsciiIdentifierPart: new RegExp('[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2D\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]')
+ };
+
+ // Ensure the condition is true, otherwise throw an error.
+ // This is only to have a better contract semantic, i.e. another safety net
+ // to catch a logic error. The condition shall be fulfilled in normal case.
+ // Do NOT use this to enforce a certain condition on any user input.
+
+ function assert(condition, message) {
+ /* istanbul ignore if */
+ if (!condition) {
+ throw new Error('ASSERT: ' + message);
+ }
+ }
+
+ function isDecimalDigit(ch) {
+ return (ch >= 0x30 && ch <= 0x39); // 0..9
+ }
+
+ function isHexDigit(ch) {
+ return '0123456789abcdefABCDEF'.indexOf(ch) >= 0;
+ }
+
+ function isOctalDigit(ch) {
+ return '01234567'.indexOf(ch) >= 0;
+ }
+
+
+ // 7.2 White Space
+
+ function isWhiteSpace(ch) {
+ return (ch === 0x20) || (ch === 0x09) || (ch === 0x0B) || (ch === 0x0C) || (ch === 0xA0) ||
+ (ch >= 0x1680 && [0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(ch) >= 0);
+ }
+
+ // 7.3 Line Terminators
+
+ function isLineTerminator(ch) {
+ return (ch === 0x0A) || (ch === 0x0D) || (ch === 0x2028) || (ch === 0x2029);
+ }
+
+ // 7.6 Identifier Names and Identifiers
+
+ function isIdentifierStart(ch) {
+ return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)
+ (ch >= 0x41 && ch <= 0x5A) || // A..Z
+ (ch >= 0x61 && ch <= 0x7A) || // a..z
+ (ch === 0x5C) || // \ (backslash)
+ ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch)));
+ }
+
+ function isIdentifierPart(ch) {
+ return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)
+ (ch >= 0x41 && ch <= 0x5A) || // A..Z
+ (ch >= 0x61 && ch <= 0x7A) || // a..z
+ (ch >= 0x30 && ch <= 0x39) || // 0..9
+ (ch === 0x5C) || // \ (backslash)
+ ((ch >= 0x80) && Regex.NonAsciiIdentifierPart.test(String.fromCharCode(ch)));
+ }
+
+ // 7.6.1.2 Future Reserved Words
+
+ function isFutureReservedWord(id) {
+ switch (id) {
+ case 'enum':
+ case 'export':
+ case 'import':
+ case 'super':
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ // 11.6.2.2 Future Reserved Words
+
+ function isStrictModeReservedWord(id) {
+ switch (id) {
+ case 'implements':
+ case 'interface':
+ case 'package':
+ case 'private':
+ case 'protected':
+ case 'public':
+ case 'static':
+ case 'yield':
+ case 'let':
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ function isRestrictedWord(id) {
+ return id === 'eval' || id === 'arguments';
+ }
+
+ // 7.6.1.1 Keywords
+
+ function isKeyword(id) {
+ if (strict && isStrictModeReservedWord(id)) {
+ return true;
+ }
+
+ // 'const' is specialized as Keyword in V8.
+ // 'yield' and 'let' are for compatibility with SpiderMonkey and ES.next.
+ // Some others are from future reserved words.
+
+ switch (id.length) {
+ case 2:
+ return (id === 'if') || (id === 'in') || (id === 'do');
+ case 3:
+ return (id === 'var') || (id === 'for') || (id === 'new') ||
+ (id === 'try') || (id === 'let');
+ case 4:
+ return (id === 'this') || (id === 'else') || (id === 'case') ||
+ (id === 'void') || (id === 'with') || (id === 'enum');
+ case 5:
+ return (id === 'while') || (id === 'break') || (id === 'catch') ||
+ (id === 'throw') || (id === 'const') || (id === 'yield') ||
+ (id === 'class') || (id === 'super');
+ case 6:
+ return (id === 'return') || (id === 'typeof') || (id === 'delete') ||
+ (id === 'switch') || (id === 'export') || (id === 'import');
+ case 7:
+ return (id === 'default') || (id === 'finally') || (id === 'extends');
+ case 8:
+ return (id === 'function') || (id === 'continue') || (id === 'debugger');
+ case 10:
+ return (id === 'instanceof');
+ default:
+ return false;
+ }
+ }
+
+ // 7.4 Comments
+
+ function addComment(type, value, start, end, loc) {
+ var comment;
+
+ assert(typeof start === 'number', 'Comment must have valid position');
+
+ state.lastCommentStart = start;
+
+ comment = {
+ type: type,
+ value: value
+ };
+ if (extra.range) {
+ comment.range = [start, end];
+ }
+ if (extra.loc) {
+ comment.loc = loc;
+ }
+ extra.comments.push(comment);
+ if (extra.attachComment) {
+ extra.leadingComments.push(comment);
+ extra.trailingComments.push(comment);
+ }
+ }
+
+ function skipSingleLineComment(offset) {
+ var start, loc, ch, comment;
+
+ start = index - offset;
+ loc = {
+ start: {
+ line: lineNumber,
+ column: index - lineStart - offset
+ }
+ };
+
+ while (index < length) {
+ ch = source.charCodeAt(index);
+ ++index;
+ if (isLineTerminator(ch)) {
+ hasLineTerminator = true;
+ if (extra.comments) {
+ comment = source.slice(start + offset, index - 1);
+ loc.end = {
+ line: lineNumber,
+ column: index - lineStart - 1
+ };
+ addComment('Line', comment, start, index - 1, loc);
+ }
+ if (ch === 13 && source.charCodeAt(index) === 10) {
+ ++index;
+ }
+ ++lineNumber;
+ lineStart = index;
+ return;
+ }
+ }
+
+ if (extra.comments) {
+ comment = source.slice(start + offset, index);
+ loc.end = {
+ line: lineNumber,
+ column: index - lineStart
+ };
+ addComment('Line', comment, start, index, loc);
+ }
+ }
+
+ function skipMultiLineComment() {
+ var start, loc, ch, comment;
+
+ if (extra.comments) {
+ start = index - 2;
+ loc = {
+ start: {
+ line: lineNumber,
+ column: index - lineStart - 2
+ }
+ };
+ }
+
+ while (index < length) {
+ ch = source.charCodeAt(index);
+ if (isLineTerminator(ch)) {
+ if (ch === 0x0D && source.charCodeAt(index + 1) === 0x0A) {
+ ++index;
+ }
+ hasLineTerminator = true;
+ ++lineNumber;
+ ++index;
+ lineStart = index;
+ } else if (ch === 0x2A) {
+ // Block comment ends with '*/'.
+ if (source.charCodeAt(index + 1) === 0x2F) {
+ ++index;
+ ++index;
+ if (extra.comments) {
+ comment = source.slice(start + 2, index - 2);
+ loc.end = {
+ line: lineNumber,
+ column: index - lineStart
+ };
+ addComment('Block', comment, start, index, loc);
+ }
+ return;
+ }
+ ++index;
+ } else {
+ ++index;
+ }
+ }
+
+ if (extra.errors && index >= length) {
+ //ran off the end of the file - the whole thing is a comment
+ if (extra.comments) {
+ loc.end = {
+ line: lineNumber,
+ column: index - lineStart
+ };
+ comment = source.slice(start + 2, index);
+ addComment('Block', comment, start, index, loc);
+ }
+ tolerateUnexpectedToken();
+ } else {
+ throwUnexpectedToken();
+ }
+ }
+
+ function skipComment() {
+ var ch, start;
+ hasLineTerminator = false;
+
+ start = (index === 0);
+ while (index < length) {
+ ch = source.charCodeAt(index);
+
+ if (isWhiteSpace(ch)) {
+ ++index;
+ } else if (isLineTerminator(ch)) {
+ hasLineTerminator = true;
+ ++index;
+ if (ch === 0x0D && source.charCodeAt(index) === 0x0A) {
+ ++index;
+ }
+ ++lineNumber;
+ lineStart = index;
+ start = true;
+ } else if (ch === 0x2F) { // U+002F is '/'
+ ch = source.charCodeAt(index + 1);
+ if (ch === 0x2F) {
+ ++index;
+ ++index;
+ skipSingleLineComment(2);
+ start = true;
+ } else if (ch === 0x2A) { // U+002A is '*'
+ ++index;
+ ++index;
+ skipMultiLineComment();
+ } else {
+ break;
+ }
+ } else if (start && ch === 0x2D) { // U+002D is '-'
+ // U+003E is '>'
+ if ((source.charCodeAt(index + 1) === 0x2D) && (source.charCodeAt(index + 2) === 0x3E)) {
+ // '-->' is a single-line comment
+ index += 3;
+ skipSingleLineComment(3);
+ } else {
+ break;
+ }
+ } else if (ch === 0x3C) { // U+003C is '<'
+ if (source.slice(index + 1, index + 4) === '!--') {
+ ++index; // `<`
+ ++index; // `!`
+ ++index; // `-`
+ ++index; // `-`
+ skipSingleLineComment(4);
+ } else {
+ break;
+ }
+ } else {
+ break;
+ }
+ }
+ }
+
+ function scanHexEscape(prefix) {
+ var i, len, ch, code = 0;
+
+ len = (prefix === 'u') ? 4 : 2;
+ for (i = 0; i < len; ++i) {
+ if (index < length && isHexDigit(source[index])) {
+ ch = source[index++];
+ code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase());
+ } else {
+ return '';
+ }
+ }
+ return String.fromCharCode(code);
+ }
+
+ function scanUnicodeCodePointEscape() {
+ var ch, code, cu1, cu2;
+
+ ch = source[index];
+ code = 0;
+
+ // At least, one hex digit is required.
+ if (ch === '}') {
+ throwUnexpectedToken();
+ }
+
+ while (index < length) {
+ ch = source[index++];
+ if (!isHexDigit(ch)) {
+ break;
+ }
+ code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase());
+ }
+
+ if (code > 0x10FFFF || ch !== '}') {
+ throwUnexpectedToken();
+ }
+
+ // UTF-16 Encoding
+ if (code <= 0xFFFF) {
+ return String.fromCharCode(code);
+ }
+ cu1 = ((code - 0x10000) >> 10) + 0xD800;
+ cu2 = ((code - 0x10000) & 1023) + 0xDC00;
+ return String.fromCharCode(cu1, cu2);
+ }
+
+ function getEscapedIdentifier() {
+ var ch, id;
+
+ ch = source.charCodeAt(index++);
+ id = String.fromCharCode(ch);
+
+ // '\u' (U+005C, U+0075) denotes an escaped character.
+ if (ch === 0x5C) {
+ if (source.charCodeAt(index) !== 0x75) {
+ throwUnexpectedToken();
+ }
+ ++index;
+ ch = scanHexEscape('u');
+ if (!ch || ch === '\\' || !isIdentifierStart(ch.charCodeAt(0))) {
+ throwUnexpectedToken();
+ }
+ id = ch;
+ }
+
+ while (index < length) {
+ ch = source.charCodeAt(index);
+ if (!isIdentifierPart(ch)) {
+ break;
+ }
+ ++index;
+ id += String.fromCharCode(ch);
+
+ // '\u' (U+005C, U+0075) denotes an escaped character.
+ if (ch === 0x5C) {
+ id = id.substr(0, id.length - 1);
+ if (source.charCodeAt(index) !== 0x75) {
+ throwUnexpectedToken();
+ }
+ ++index;
+ ch = scanHexEscape('u');
+ if (!ch || ch === '\\' || !isIdentifierPart(ch.charCodeAt(0))) {
+ throwUnexpectedToken();
+ }
+ id += ch;
+ }
+ }
+
+ return id;
+ }
+
+ function getIdentifier() {
+ var start, ch;
+
+ start = index++;
+ while (index < length) {
+ ch = source.charCodeAt(index);
+ if (ch === 0x5C) {
+ // Blackslash (U+005C) marks Unicode escape sequence.
+ index = start;
+ return getEscapedIdentifier();
+ }
+ if (isIdentifierPart(ch)) {
+ ++index;
+ } else {
+ break;
+ }
+ }
+
+ return source.slice(start, index);
+ }
+
+ function scanIdentifier() {
+ var start, id, type;
+
+ start = index;
+
+ // Backslash (U+005C) starts an escaped character.
+ id = (source.charCodeAt(index) === 0x5C) ? getEscapedIdentifier() : getIdentifier();
+
+ // There is no keyword or literal with only one character.
+ // Thus, it must be an identifier.
+ if (id.length === 1) {
+ type = Token.Identifier;
+ } else if (isKeyword(id)) {
+ type = Token.Keyword;
+ } else if (id === 'null') {
+ type = Token.NullLiteral;
+ } else if (id === 'true' || id === 'false') {
+ type = Token.BooleanLiteral;
+ } else {
+ type = Token.Identifier;
+ }
+
+ return {
+ type: type,
+ value: id,
+ lineNumber: lineNumber,
+ lineStart: lineStart,
+ start: start,
+ end: index
+ };
+ }
+
+
+ // 7.7 Punctuators
+
+ function scanPunctuator() {
+ var token, str;
+
+ token = {
+ type: Token.Punctuator,
+ value: '',
+ lineNumber: lineNumber,
+ lineStart: lineStart,
+ start: index,
+ end: index
+ };
+
+ // Check for most common single-character punctuators.
+ str = source[index];
+ switch (str) {
+
+ case '(':
+ if (extra.tokenize) {
+ extra.openParenToken = extra.tokens.length;
+ }
+ ++index;
+ break;
+
+ case '{':
+ if (extra.tokenize) {
+ extra.openCurlyToken = extra.tokens.length;
+ }
+ ++index;
+ break;
+
+ case '.':
+ ++index;
+ if (source[index] === '.' && source[index + 1] === '.') {
+ // Spread operator: ...
+ index += 2;
+ str = '...';
+ }
+ break;
+
+ case ')':
+ case ';':
+ case ',':
+ case '}':
+ case '[':
+ case ']':
+ case ':':
+ case '?':
+ case '~':
+ ++index;
+ break;
+
+ default:
+ // 4-character punctuator.
+ str = source.substr(index, 4);
+ if (str === '>>>=') {
+ index += 4;
+ } else {
+
+ // 3-character punctuators.
+ str = str.substr(0, 3);
+ if (str === '===' || str === '!==' || str === '>>>' ||
+ str === '<<=' || str === '>>=') {
+ index += 3;
+ } else {
+
+ // 2-character punctuators.
+ str = str.substr(0, 2);
+ if (str === '&&' || str === '||' || str === '==' || str === '!=' ||
+ str === '+=' || str === '-=' || str === '*=' || str === '/=' ||
+ str === '++' || str === '--' || str === '<<' || str === '>>' ||
+ str === '&=' || str === '|=' || str === '^=' || str === '%=' ||
+ str === '<=' || str === '>=' || str === '=>') {
+ index += 2;
+ } else {
+
+ // 1-character punctuators.
+ str = source[index];
+ if ('<>=!+-*%&|^/'.indexOf(str) >= 0) {
+ ++index;
+ }
+ }
+ }
+ }
+ }
+
+ if (index === token.start) {
+ throwUnexpectedToken();
+ }
+
+ token.end = index;
+ token.value = str;
+ return token;
+ }
+
+ // 7.8.3 Numeric Literals
+
+ function scanHexLiteral(start) {
+ var number = '';
+
+ while (index < length) {
+ if (!isHexDigit(source[index])) {
+ break;
+ }
+ number += source[index++];
+ }
+
+ if (number.length === 0) {
+ throwUnexpectedToken();
+ }
+
+ if (isIdentifierStart(source.charCodeAt(index))) {
+ throwUnexpectedToken();
+ }
+
+ return {
+ type: Token.NumericLiteral,
+ value: parseInt('0x' + number, 16),
+ lineNumber: lineNumber,
+ lineStart: lineStart,
+ start: start,
+ end: index
+ };
+ }
+
+ function scanBinaryLiteral(start) {
+ var ch, number;
+
+ number = '';
+
+ while (index < length) {
+ ch = source[index];
+ if (ch !== '0' && ch !== '1') {
+ break;
+ }
+ number += source[index++];
+ }
+
+ if (number.length === 0) {
+ // only 0b or 0B
+ throwUnexpectedToken();
+ }
+
+ if (index < length) {
+ ch = source.charCodeAt(index);
+ /* istanbul ignore else */
+ if (isIdentifierStart(ch) || isDecimalDigit(ch)) {
+ throwUnexpectedToken();
+ }
+ }
+
+ return {
+ type: Token.NumericLiteral,
+ value: parseInt(number, 2),
+ lineNumber: lineNumber,
+ lineStart: lineStart,
+ start: start,
+ end: index
+ };
+ }
+
+ function scanOctalLiteral(prefix, start) {
+ var number, octal;
+
+ if (isOctalDigit(prefix)) {
+ octal = true;
+ number = '0' + source[index++];
+ } else {
+ octal = false;
+ ++index;
+ number = '';
+ }
+
+ while (index < length) {
+ if (!isOctalDigit(source[index])) {
+ break;
+ }
+ number += source[index++];
+ }
+
+ if (!octal && number.length === 0) {
+ // only 0o or 0O
+ throwUnexpectedToken();
+ }
+
+ if (isIdentifierStart(source.charCodeAt(index)) || isDecimalDigit(source.charCodeAt(index))) {
+ throwUnexpectedToken();
+ }
+
+ return {
+ type: Token.NumericLiteral,
+ value: parseInt(number, 8),
+ octal: octal,
+ lineNumber: lineNumber,
+ lineStart: lineStart,
+ start: start,
+ end: index
+ };
+ }
+
+ function isImplicitOctalLiteral() {
+ var i, ch;
+
+ // Implicit octal, unless there is a non-octal digit.
+ // (Annex B.1.1 on Numeric Literals)
+ for (i = index + 1; i < length; ++i) {
+ ch = source[i];
+ if (ch === '8' || ch === '9') {
+ return false;
+ }
+ if (!isOctalDigit(ch)) {
+ return true;
+ }
+ }
+
+ return true;
+ }
+
+ function scanNumericLiteral() {
+ var number, start, ch;
+
+ ch = source[index];
+ assert(isDecimalDigit(ch.charCodeAt(0)) || (ch === '.'),
+ 'Numeric literal must start with a decimal digit or a decimal point');
+
+ start = index;
+ number = '';
+ if (ch !== '.') {
+ number = source[index++];
+ ch = source[index];
+
+ // Hex number starts with '0x'.
+ // Octal number starts with '0'.
+ // Octal number in ES6 starts with '0o'.
+ // Binary number in ES6 starts with '0b'.
+ if (number === '0') {
+ if (ch === 'x' || ch === 'X') {
+ ++index;
+ return scanHexLiteral(start);
+ }
+ if (ch === 'b' || ch === 'B') {
+ ++index;
+ return scanBinaryLiteral(start);
+ }
+ if (ch === 'o' || ch === 'O') {
+ return scanOctalLiteral(ch, start);
+ }
+
+ if (isOctalDigit(ch)) {
+ if (isImplicitOctalLiteral()) {
+ return scanOctalLiteral(ch, start);
+ }
+ }
+ }
+
+ while (isDecimalDigit(source.charCodeAt(index))) {
+ number += source[index++];
+ }
+ ch = source[index];
+ }
+
+ if (ch === '.') {
+ number += source[index++];
+ while (isDecimalDigit(source.charCodeAt(index))) {
+ number += source[index++];
+ }
+ ch = source[index];
+ }
+
+ if (ch === 'e' || ch === 'E') {
+ number += source[index++];
+
+ ch = source[index];
+ if (ch === '+' || ch === '-') {
+ number += source[index++];
+ }
+ if (isDecimalDigit(source.charCodeAt(index))) {
+ while (isDecimalDigit(source.charCodeAt(index))) {
+ number += source[index++];
+ }
+ } else {
+ throwUnexpectedToken();
+ }
+ }
+
+ if (isIdentifierStart(source.charCodeAt(index))) {
+ throwUnexpectedToken();
+ }
+
+ return {
+ type: Token.NumericLiteral,
+ value: parseFloat(number),
+ lineNumber: lineNumber,
+ lineStart: lineStart,
+ start: start,
+ end: index
+ };
+ }
+
+ // 7.8.4 String Literals
+
+ function scanStringLiteral() {
+ var str = '', quote, start, ch, code, unescaped, restore, octal = false;
+
+ quote = source[index];
+ assert((quote === '\'' || quote === '"'),
+ 'String literal must starts with a quote');
+
+ start = index;
+ ++index;
+
+ while (index < length) {
+ ch = source[index++];
+
+ if (ch === quote) {
+ quote = '';
+ break;
+ } else if (ch === '\\') {
+ ch = source[index++];
+ if (!ch || !isLineTerminator(ch.charCodeAt(0))) {
+ switch (ch) {
+ case 'u':
+ case 'x':
+ if (source[index] === '{') {
+ ++index;
+ str += scanUnicodeCodePointEscape();
+ } else {
+ restore = index;
+ unescaped = scanHexEscape(ch);
+ if (unescaped) {
+ str += unescaped;
+ } else {
+ index = restore;
+ str += ch;
+ }
+ }
+ break;
+ case 'n':
+ str += '\n';
+ break;
+ case 'r':
+ str += '\r';
+ break;
+ case 't':
+ str += '\t';
+ break;
+ case 'b':
+ str += '\b';
+ break;
+ case 'f':
+ str += '\f';
+ break;
+ case 'v':
+ str += '\x0B';
+ break;
+
+ default:
+ if (isOctalDigit(ch)) {
+ code = '01234567'.indexOf(ch);
+
+ // \0 is not octal escape sequence
+ if (code !== 0) {
+ octal = true;
+ }
+
+ if (index < length && isOctalDigit(source[index])) {
+ octal = true;
+ code = code * 8 + '01234567'.indexOf(source[index++]);
+
+ // 3 digits are only allowed when string starts
+ // with 0, 1, 2, 3
+ if ('0123'.indexOf(ch) >= 0 &&
+ index < length &&
+ isOctalDigit(source[index])) {
+ code = code * 8 + '01234567'.indexOf(source[index++]);
+ }
+ }
+ str += String.fromCharCode(code);
+ } else {
+ str += ch;
+ }
+ break;
+ }
+ } else {
+ ++lineNumber;
+ if (ch === '\r' && source[index] === '\n') {
+ ++index;
+ }
+ lineStart = index;
+ }
+ } else if (isLineTerminator(ch.charCodeAt(0))) {
+ break;
+ } else {
+ str += ch;
+ }
+ }
+
+ if (quote !== '') {
+ throwUnexpectedToken();
+ }
+
+ return {
+ type: Token.StringLiteral,
+ value: str,
+ octal: octal,
+ lineNumber: startLineNumber,
+ lineStart: startLineStart,
+ start: start,
+ end: index
+ };
+ }
+
+ function testRegExp(pattern, flags) {
+ var tmp = pattern;
+
+ if (flags.indexOf('u') >= 0) {
+ // Replace each astral symbol and every Unicode code point
+ // escape sequence with a single ASCII symbol to avoid throwing on
+ // regular expressions that are only valid in combination with the
+ // `/u` flag.
+ // Note: replacing with the ASCII symbol `x` might cause false
+ // negatives in unlikely scenarios. For example, `[\u{61}-b]` is a
+ // perfectly valid pattern that is equivalent to `[a-b]`, but it
+ // would be replaced by `[x-b]` which throws an error.
+ tmp = tmp
+ .replace(/\\u\{([0-9a-fA-F]+)\}/g, function ($0, $1) {
+ if (parseInt($1, 16) <= 0x10FFFF) {
+ return 'x';
+ }
+ throwUnexpectedToken(null, Messages.InvalidRegExp);
+ })
+ .replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, 'x');
+ }
+
+ // First, detect invalid regular expressions.
+ try {
+ RegExp(tmp);
+ } catch (e) {
+ throwUnexpectedToken(null, Messages.InvalidRegExp);
+ }
+
+ // Return a regular expression object for this pattern-flag pair, or
+ // `null` in case the current environment doesn't support the flags it
+ // uses.
+ try {
+ return new RegExp(pattern, flags);
+ } catch (exception) {
+ return null;
+ }
+ }
+
+ function scanRegExpBody() {
+ var ch, str, classMarker, terminated, body;
+
+ ch = source[index];
+ assert(ch === '/', 'Regular expression literal must start with a slash');
+ str = source[index++];
+
+ classMarker = false;
+ terminated = false;
+ while (index < length) {
+ ch = source[index++];
+ str += ch;
+ if (ch === '\\') {
+ ch = source[index++];
+ // ECMA-262 7.8.5
+ if (isLineTerminator(ch.charCodeAt(0))) {
+ throwUnexpectedToken(null, Messages.UnterminatedRegExp);
+ }
+ str += ch;
+ } else if (isLineTerminator(ch.charCodeAt(0))) {
+ throwUnexpectedToken(null, Messages.UnterminatedRegExp);
+ } else if (classMarker) {
+ if (ch === ']') {
+ classMarker = false;
+ }
+ } else {
+ if (ch === '/') {
+ terminated = true;
+ break;
+ } else if (ch === '[') {
+ classMarker = true;
+ }
+ }
+ }
+
+ if (!terminated) {
+ throwUnexpectedToken(null, Messages.UnterminatedRegExp);
+ }
+
+ // Exclude leading and trailing slash.
+ body = str.substr(1, str.length - 2);
+ return {
+ value: body,
+ literal: str
+ };
+ }
+
+ function scanRegExpFlags() {
+ var ch, str, flags, restore;
+
+ str = '';
+ flags = '';
+ while (index < length) {
+ ch = source[index];
+ if (!isIdentifierPart(ch.charCodeAt(0))) {
+ break;
+ }
+
+ ++index;
+ if (ch === '\\' && index < length) {
+ ch = source[index];
+ if (ch === 'u') {
+ ++index;
+ restore = index;
+ ch = scanHexEscape('u');
+ if (ch) {
+ flags += ch;
+ for (str += '\\u'; restore < index; ++restore) {
+ str += source[restore];
+ }
+ } else {
+ index = restore;
+ flags += 'u';
+ str += '\\u';
+ }
+ tolerateUnexpectedToken();
+ } else {
+ str += '\\';
+ tolerateUnexpectedToken();
+ }
+ } else {
+ flags += ch;
+ str += ch;
+ }
+ }
+
+ return {
+ value: flags,
+ literal: str
+ };
+ }
+
+ function scanRegExp() {
+ scanning = true;
+ var start, body, flags, value;
+
+ lookahead = null;
+ skipComment();
+ start = index;
+
+ body = scanRegExpBody();
+ flags = scanRegExpFlags();
+ value = testRegExp(body.value, flags.value);
+ scanning = false;
+ if (extra.tokenize) {
+ return {
+ type: Token.RegularExpression,
+ value: value,
+ regex: {
+ pattern: body.value,
+ flags: flags.value
+ },
+ lineNumber: lineNumber,
+ lineStart: lineStart,
+ start: start,
+ end: index
+ };
+ }
+
+ return {
+ literal: body.literal + flags.literal,
+ value: value,
+ regex: {
+ pattern: body.value,
+ flags: flags.value
+ },
+ start: start,
+ end: index
+ };
+ }
+
+ function collectRegex() {
+ var pos, loc, regex, token;
+
+ skipComment();
+
+ pos = index;
+ loc = {
+ start: {
+ line: lineNumber,
+ column: index - lineStart
+ }
+ };
+
+ regex = scanRegExp();
+
+ loc.end = {
+ line: lineNumber,
+ column: index - lineStart
+ };
+
+ /* istanbul ignore next */
+ if (!extra.tokenize) {
+ // Pop the previous token, which is likely '/' or '/='
+ if (extra.tokens.length > 0) {
+ token = extra.tokens[extra.tokens.length - 1];
+ if (token.range[0] === pos && token.type === 'Punctuator') {
+ if (token.value === '/' || token.value === '/=') {
+ extra.tokens.pop();
+ }
+ }
+ }
+
+ extra.tokens.push({
+ type: 'RegularExpression',
+ value: regex.literal,
+ regex: regex.regex,
+ range: [pos, index],
+ loc: loc
+ });
+ }
+
+ return regex;
+ }
+
+ function isIdentifierName(token) {
+ return token.type === Token.Identifier ||
+ token.type === Token.Keyword ||
+ token.type === Token.BooleanLiteral ||
+ token.type === Token.NullLiteral;
+ }
+
+ function advanceSlash() {
+ var prevToken,
+ checkToken;
+ // Using the following algorithm:
+ // https://github.com/mozilla/sweet.js/wiki/design
+ prevToken = extra.tokens[extra.tokens.length - 1];
+ if (!prevToken) {
+ // Nothing before that: it cannot be a division.
+ return collectRegex();
+ }
+ if (prevToken.type === 'Punctuator') {
+ if (prevToken.value === ']') {
+ return scanPunctuator();
+ }
+ if (prevToken.value === ')') {
+ checkToken = extra.tokens[extra.openParenToken - 1];
+ if (checkToken &&
+ checkToken.type === 'Keyword' &&
+ (checkToken.value === 'if' ||
+ checkToken.value === 'while' ||
+ checkToken.value === 'for' ||
+ checkToken.value === 'with')) {
+ return collectRegex();
+ }
+ return scanPunctuator();
+ }
+ if (prevToken.value === '}') {
+ // Dividing a function by anything makes little sense,
+ // but we have to check for that.
+ if (extra.tokens[extra.openCurlyToken - 3] &&
+ extra.tokens[extra.openCurlyToken - 3].type === 'Keyword') {
+ // Anonymous function.
+ checkToken = extra.tokens[extra.openCurlyToken - 4];
+ if (!checkToken) {
+ return scanPunctuator();
+ }
+ } else if (extra.tokens[extra.openCurlyToken - 4] &&
+ extra.tokens[extra.openCurlyToken - 4].type === 'Keyword') {
+ // Named function.
+ checkToken = extra.tokens[extra.openCurlyToken - 5];
+ if (!checkToken) {
+ return collectRegex();
+ }
+ } else {
+ return scanPunctuator();
+ }
+ // checkToken determines whether the function is
+ // a declaration or an expression.
+ if (FnExprTokens.indexOf(checkToken.value) >= 0) {
+ // It is an expression.
+ return scanPunctuator();
+ }
+ // It is a declaration.
+ return collectRegex();
+ }
+ return collectRegex();
+ }
+ if (prevToken.type === 'Keyword' && prevToken.value !== 'this') {
+ return collectRegex();
+ }
+ return scanPunctuator();
+ }
+
+ function advance() {
+ var ch;
+
+ if (index >= length) {
+ return {
+ type: Token.EOF,
+ lineNumber: lineNumber,
+ lineStart: lineStart,
+ start: index,
+ end: index
+ };
+ }
+
+ ch = source.charCodeAt(index);
+
+ if (isIdentifierStart(ch)) {
+ return scanIdentifier();
+ }
+
+ // Very common: ( and ) and ;
+ if (ch === 0x28 || ch === 0x29 || ch === 0x3B) {
+ return scanPunctuator();
+ }
+
+ // String literal starts with single quote (U+0027) or double quote (U+0022).
+ if (ch === 0x27 || ch === 0x22) {
+ return scanStringLiteral();
+ }
+
+
+ // Dot (.) U+002E can also start a floating-point number, hence the need
+ // to check the next character.
+ if (ch === 0x2E) {
+ if (isDecimalDigit(source.charCodeAt(index + 1))) {
+ return scanNumericLiteral();
+ }
+ return scanPunctuator();
+ }
+
+ if (isDecimalDigit(ch)) {
+ return scanNumericLiteral();
+ }
+
+ // Slash (/) U+002F can also start a regex.
+ if (extra.tokenize && ch === 0x2F) {
+ return advanceSlash();
+ }
+
+ return scanPunctuator();
+ }
+
+ function collectToken() {
+ var loc, token, value, entry;
+
+ loc = {
+ start: {
+ line: lineNumber,
+ column: index - lineStart
+ }
+ };
+
+ token = advance();
+ loc.end = {
+ line: lineNumber,
+ column: index - lineStart
+ };
+
+ if (token.type !== Token.EOF) {
+ value = source.slice(token.start, token.end);
+ entry = {
+ type: TokenName[token.type],
+ value: value,
+ range: [token.start, token.end],
+ loc: loc
+ };
+ if (token.regex) {
+ entry.regex = {
+ pattern: token.regex.pattern,
+ flags: token.regex.flags
+ };
+ }
+ extra.tokens.push(entry);
+ }
+
+ return token;
+ }
+
+ function lex() {
+ var token;
+ scanning = true;
+
+ lastIndex = index;
+ lastLineNumber = lineNumber;
+ lastLineStart = lineStart;
+
+ skipComment();
+
+ token = lookahead;
+
+ startIndex = index;
+ startLineNumber = lineNumber;
+ startLineStart = lineStart;
+
+ lookahead = (typeof extra.tokens !== 'undefined') ? collectToken() : advance();
+ scanning = false;
+ return token;
+ }
+
+ function peek() {
+ scanning = true;
+
+ skipComment();
+
+ lastIndex = index;
+ lastLineNumber = lineNumber;
+ lastLineStart = lineStart;
+
+ startIndex = index;
+ startLineNumber = lineNumber;
+ startLineStart = lineStart;
+
+ lookahead = (typeof extra.tokens !== 'undefined') ? collectToken() : advance();
+ scanning = false;
+ }
+
+ function Position() {
+ this.line = startLineNumber;
+ this.column = startIndex - startLineStart;
+ }
+
+ function SourceLocation() {
+ this.start = new Position();
+ this.end = null;
+ }
+
+ function WrappingSourceLocation(startToken) {
+ this.start = {
+ line: startToken.lineNumber,
+ column: startToken.start - startToken.lineStart
+ };
+ this.end = null;
+ }
+
+ function Node() {
+ if (extra.range) {
+ this.range = [startIndex, 0];
+ }
+ if (extra.loc) {
+ this.loc = new SourceLocation();
+ }
+ }
+
+ function WrappingNode(startToken) {
+ if (extra.range) {
+ this.range = [startToken.start, 0];
+ }
+ if (extra.loc) {
+ this.loc = new WrappingSourceLocation(startToken);
+ }
+ }
+
+ WrappingNode.prototype = Node.prototype = {
+
+ processComment: function () {
+ var lastChild,
+ leadingComments,
+ trailingComments,
+ bottomRight = extra.bottomRightStack,
+ i,
+ comment,
+ last = bottomRight[bottomRight.length - 1];
+
+ if (this.type === Syntax.Program) {
+ if (this.body.length > 0) {
+ return;
+ }
+ }
+
+ if (extra.trailingComments.length > 0) {
+ trailingComments = [];
+ for (i = extra.trailingComments.length - 1; i >= 0; --i) {
+ comment = extra.trailingComments[i];
+ if (comment.range[0] >= this.range[1]) {
+ trailingComments.unshift(comment);
+ extra.trailingComments.splice(i, 1);
+ }
+ }
+ extra.trailingComments = [];
+ } else {
+ if (last && last.trailingComments && last.trailingComments[0].range[0] >= this.range[1]) {
+ trailingComments = last.trailingComments;
+ delete last.trailingComments;
+ }
+ }
+
+ // Eating the stack.
+ if (last) {
+ while (last && last.range[0] >= this.range[0]) {
+ lastChild = last;
+ last = bottomRight.pop();
+ }
+ }
+
+ if (lastChild) {
+ if (lastChild.leadingComments && lastChild.leadingComments[lastChild.leadingComments.length - 1].range[1] <= this.range[0]) {
+ this.leadingComments = lastChild.leadingComments;
+ lastChild.leadingComments = undefined;
+ }
+ } else if (extra.leadingComments.length > 0) {
+ leadingComments = [];
+ for (i = extra.leadingComments.length - 1; i >= 0; --i) {
+ comment = extra.leadingComments[i];
+ if (comment.range[1] <= this.range[0]) {
+ leadingComments.unshift(comment);
+ extra.leadingComments.splice(i, 1);
+ }
+ }
+ }
+
+
+ if (leadingComments && leadingComments.length > 0) {
+ this.leadingComments = leadingComments;
+ }
+ if (trailingComments && trailingComments.length > 0) {
+ this.trailingComments = trailingComments;
+ }
+
+ bottomRight.push(this);
+ },
+
+ finish: function () {
+ if (extra.range) {
+ this.range[1] = lastIndex;
+ }
+ if (extra.loc) {
+ this.loc.end = {
+ line: lastLineNumber,
+ column: lastIndex - lastLineStart
+ };
+ if (extra.source) {
+ this.loc.source = extra.source;
+ }
+ }
+
+ if (extra.attachComment) {
+ this.processComment();
+ }
+ },
+
+ finishArrayExpression: function (elements) {
+ this.type = Syntax.ArrayExpression;
+ this.elements = elements;
+ this.finish();
+ return this;
+ },
+
+ finishArrowFunctionExpression: function (params, defaults, body, expression) {
+ this.type = Syntax.ArrowFunctionExpression;
+ this.id = null;
+ this.params = params;
+ this.defaults = defaults;
+ this.body = body;
+ this.generator = false;
+ this.expression = expression;
+ this.finish();
+ return this;
+ },
+
+ finishAssignmentExpression: function (operator, left, right) {
+ this.type = Syntax.AssignmentExpression;
+ this.operator = operator;
+ this.left = left;
+ this.right = right;
+ this.finish();
+ return this;
+ },
+
+ finishBinaryExpression: function (operator, left, right) {
+ this.type = (operator === '||' || operator === '&&') ? Syntax.LogicalExpression : Syntax.BinaryExpression;
+ this.operator = operator;
+ this.left = left;
+ this.right = right;
+ this.finish();
+ return this;
+ },
+
+ finishBlockStatement: function (body) {
+ this.type = Syntax.BlockStatement;
+ this.body = body;
+ this.finish();
+ return this;
+ },
+
+ finishBreakStatement: function (label) {
+ this.type = Syntax.BreakStatement;
+ this.label = label;
+ this.finish();
+ return this;
+ },
+
+ finishCallExpression: function (callee, args) {
+ this.type = Syntax.CallExpression;
+ this.callee = callee;
+ this.arguments = args;
+ this.finish();
+ return this;
+ },
+
+ finishCatchClause: function (param, body) {
+ this.type = Syntax.CatchClause;
+ this.param = param;
+ this.body = body;
+ this.finish();
+ return this;
+ },
+
+ finishClassBody: function (body) {
+ this.type = Syntax.ClassBody;
+ this.body = body;
+ this.finish();
+ return this;
+ },
+
+ finishClassDeclaration: function (id, superClass, body) {
+ this.type = Syntax.ClassDeclaration;
+ this.id = id;
+ this.superClass = superClass;
+ this.body = body;
+ this.finish();
+ return this;
+ },
+
+ finishClassExpression: function (id, superClass, body) {
+ this.type = Syntax.ClassExpression;
+ this.id = id;
+ this.superClass = superClass;
+ this.body = body;
+ this.finish();
+ return this;
+ },
+
+ finishConditionalExpression: function (test, consequent, alternate) {
+ this.type = Syntax.ConditionalExpression;
+ this.test = test;
+ this.consequent = consequent;
+ this.alternate = alternate;
+ this.finish();
+ return this;
+ },
+
+ finishContinueStatement: function (label) {
+ this.type = Syntax.ContinueStatement;
+ this.label = label;
+ this.finish();
+ return this;
+ },
+
+ finishDebuggerStatement: function () {
+ this.type = Syntax.DebuggerStatement;
+ this.finish();
+ return this;
+ },
+
+ finishDoWhileStatement: function (body, test) {
+ this.type = Syntax.DoWhileStatement;
+ this.body = body;
+ this.test = test;
+ this.finish();
+ return this;
+ },
+
+ finishEmptyStatement: function () {
+ this.type = Syntax.EmptyStatement;
+ this.finish();
+ return this;
+ },
+
+ finishExpressionStatement: function (expression) {
+ this.type = Syntax.ExpressionStatement;
+ this.expression = expression;
+ this.finish();
+ return this;
+ },
+
+ finishForStatement: function (init, test, update, body) {
+ this.type = Syntax.ForStatement;
+ this.init = init;
+ this.test = test;
+ this.update = update;
+ this.body = body;
+ this.finish();
+ return this;
+ },
+
+ finishForInStatement: function (left, right, body) {
+ this.type = Syntax.ForInStatement;
+ this.left = left;
+ this.right = right;
+ this.body = body;
+ this.each = false;
+ this.finish();
+ return this;
+ },
+
+ finishFunctionDeclaration: function (id, params, defaults, body) {
+ this.type = Syntax.FunctionDeclaration;
+ this.id = id;
+ this.params = params;
+ this.defaults = defaults;
+ this.body = body;
+ this.generator = false;
+ this.expression = false;
+ this.finish();
+ return this;
+ },
+
+ finishFunctionExpression: function (id, params, defaults, body) {
+ this.type = Syntax.FunctionExpression;
+ this.id = id;
+ this.params = params;
+ this.defaults = defaults;
+ this.body = body;
+ this.generator = false;
+ this.expression = false;
+ this.finish();
+ return this;
+ },
+
+ finishIdentifier: function (name) {
+ this.type = Syntax.Identifier;
+ this.name = name;
+ this.finish();
+ return this;
+ },
+
+ finishIfStatement: function (test, consequent, alternate) {
+ this.type = Syntax.IfStatement;
+ this.test = test;
+ this.consequent = consequent;
+ this.alternate = alternate;
+ this.finish();
+ return this;
+ },
+
+ finishLabeledStatement: function (label, body) {
+ this.type = Syntax.LabeledStatement;
+ this.label = label;
+ this.body = body;
+ this.finish();
+ return this;
+ },
+
+ finishLiteral: function (token) {
+ this.type = Syntax.Literal;
+ this.value = token.value;
+ this.raw = source.slice(token.start, token.end);
+ if (token.regex) {
+ this.regex = token.regex;
+ }
+ this.finish();
+ return this;
+ },
+
+ finishMemberExpression: function (accessor, object, property) {
+ this.type = Syntax.MemberExpression;
+ this.computed = accessor === '[';
+ this.object = object;
+ this.property = property;
+ this.finish();
+ return this;
+ },
+
+ finishNewExpression: function (callee, args) {
+ this.type = Syntax.NewExpression;
+ this.callee = callee;
+ this.arguments = args;
+ this.finish();
+ return this;
+ },
+
+ finishObjectExpression: function (properties) {
+ this.type = Syntax.ObjectExpression;
+ this.properties = properties;
+ this.finish();
+ return this;
+ },
+
+ finishPostfixExpression: function (operator, argument) {
+ this.type = Syntax.UpdateExpression;
+ this.operator = operator;
+ this.argument = argument;
+ this.prefix = false;
+ this.finish();
+ return this;
+ },
+
+ finishProgram: function (body) {
+ this.type = Syntax.Program;
+ this.body = body;
+ this.finish();
+ return this;
+ },
+
+ finishProperty: function (kind, key, computed, value, method, shorthand) {
+ this.type = Syntax.Property;
+ this.key = key;
+ this.computed = computed;
+ this.value = value;
+ this.kind = kind;
+ this.method = method;
+ this.shorthand = shorthand;
+ this.finish();
+ return this;
+ },
+
+ finishRestElement: function (argument) {
+ this.type = Syntax.RestElement;
+ this.argument = argument;
+ this.finish();
+ return this;
+ },
+
+ finishReturnStatement: function (argument) {
+ this.type = Syntax.ReturnStatement;
+ this.argument = argument;
+ this.finish();
+ return this;
+ },
+
+ finishSequenceExpression: function (expressions) {
+ this.type = Syntax.SequenceExpression;
+ this.expressions = expressions;
+ this.finish();
+ return this;
+ },
+
+ finishSwitchCase: function (test, consequent) {
+ this.type = Syntax.SwitchCase;
+ this.test = test;
+ this.consequent = consequent;
+ this.finish();
+ return this;
+ },
+
+ finishSwitchStatement: function (discriminant, cases) {
+ this.type = Syntax.SwitchStatement;
+ this.discriminant = discriminant;
+ this.cases = cases;
+ this.finish();
+ return this;
+ },
+
+ finishThisExpression: function () {
+ this.type = Syntax.ThisExpression;
+ this.finish();
+ return this;
+ },
+
+ finishThrowStatement: function (argument) {
+ this.type = Syntax.ThrowStatement;
+ this.argument = argument;
+ this.finish();
+ return this;
+ },
+
+ finishTryStatement: function (block, handler, finalizer) {
+ this.type = Syntax.TryStatement;
+ this.block = block;
+ this.guardedHandlers = [];
+ this.handlers = handler ? [ handler ] : [];
+ this.handler = handler;
+ this.finalizer = finalizer;
+ this.finish();
+ return this;
+ },
+
+ finishUnaryExpression: function (operator, argument) {
+ this.type = (operator === '++' || operator === '--') ? Syntax.UpdateExpression : Syntax.UnaryExpression;
+ this.operator = operator;
+ this.argument = argument;
+ this.prefix = true;
+ this.finish();
+ return this;
+ },
+
+ finishVariableDeclaration: function (declarations) {
+ this.type = Syntax.VariableDeclaration;
+ this.declarations = declarations;
+ this.kind = 'var';
+ this.finish();
+ return this;
+ },
+
+ finishLexicalDeclaration: function (declarations, kind) {
+ this.type = Syntax.VariableDeclaration;
+ this.declarations = declarations;
+ this.kind = kind;
+ this.finish();
+ return this;
+ },
+
+ finishVariableDeclarator: function (id, init) {
+ this.type = Syntax.VariableDeclarator;
+ this.id = id;
+ this.init = init;
+ this.finish();
+ return this;
+ },
+
+ finishWhileStatement: function (test, body) {
+ this.type = Syntax.WhileStatement;
+ this.test = test;
+ this.body = body;
+ this.finish();
+ return this;
+ },
+
+ finishWithStatement: function (object, body) {
+ this.type = Syntax.WithStatement;
+ this.object = object;
+ this.body = body;
+ this.finish();
+ return this;
+ }
+ };
+
+
+ function recordError(error) {
+ var e, existing;
+
+ for (e = 0; e < extra.errors.length; e++) {
+ existing = extra.errors[e];
+ // Prevent duplicated error.
+ /* istanbul ignore next */
+ if (existing.index === error.index && existing.message === error.message) {
+ return;
+ }
+ }
+
+ extra.errors.push(error);
+ }
+
+ function createError(line, pos, description) {
+ var error = new Error('Line ' + line + ': ' + description);
+ error.index = pos;
+ error.lineNumber = line;
+ error.column = pos - (scanning ? lineStart : lastLineStart) + 1;
+ error.description = description;
+ return error;
+ }
+
+ // Throw an exception
+
+ function throwError(messageFormat) {
+ var args, msg;
+
+ args = Array.prototype.slice.call(arguments, 1);
+ msg = messageFormat.replace(/%(\d)/g,
+ function (whole, idx) {
+ assert(idx < args.length, 'Message reference must be in range');
+ return args[idx];
+ }
+ );
+
+ throw createError(lastLineNumber, lastIndex, msg);
+ }
+
+ function tolerateError(messageFormat) {
+ var args, msg, error;
+
+ args = Array.prototype.slice.call(arguments, 1);
+ /* istanbul ignore next */
+ msg = messageFormat.replace(/%(\d)/g,
+ function (whole, idx) {
+ assert(idx < args.length, 'Message reference must be in range');
+ return args[idx];
+ }
+ );
+
+ error = createError(lineNumber, lastIndex, msg);
+ if (extra.errors) {
+ recordError(error);
+ } else {
+ throw error;
+ }
+ }
+
+ // Throw an exception because of the token.
+
+ function unexpectedTokenError(token, message) {
+ var msg = message || Messages.UnexpectedToken;
+
+ if (token && !message) {
+ msg = (token.type === Token.EOF) ? Messages.UnexpectedEOS :
+ (token.type === Token.Identifier) ? Messages.UnexpectedIdentifier :
+ (token.type === Token.NumericLiteral) ? Messages.UnexpectedNumber :
+ (token.type === Token.StringLiteral) ? Messages.UnexpectedString :
+ Messages.UnexpectedToken;
+
+ if (token.type === Token.Keyword) {
+ if (isFutureReservedWord(token.value)) {
+ msg = Messages.UnexpectedReserved;
+ } else if (strict && isStrictModeReservedWord(token.value)) {
+ msg = Messages.StrictReservedWord;
+ }
+ }
+ }
+
+ msg = msg.replace('%0', token ? token.value : 'ILLEGAL');
+
+ return (token && typeof token.lineNumber === 'number') ?
+ createError(token.lineNumber, token.start, msg) :
+ createError(scanning ? lineNumber : lastLineNumber, scanning ? index : lastIndex, msg);
+ }
+
+ function throwUnexpectedToken(token, message) {
+ throw unexpectedTokenError(token, message);
+ }
+
+ function tolerateUnexpectedToken(token, message) {
+ var error = unexpectedTokenError(token, message);
+ if (extra.errors) {
+ recordError(error);
+ } else {
+ throw error;
+ }
+ }
+
+ // Expect the next token to match the specified punctuator.
+ // If not, an exception will be thrown.
+
+ function expect(value) {
+ var token = lex();
+ if (token.type !== Token.Punctuator || token.value !== value) {
+ throwUnexpectedToken(token);
+ }
+ }
+
+ /**
+ * @name expectCommaSeparator
+ * @description Quietly expect a comma when in tolerant mode, otherwise delegates
+ * to <code>expect(value)</code>
+ * @since 2.0
+ */
+ function expectCommaSeparator() {
+ var token;
+
+ if (extra.errors) {
+ token = lookahead;
+ if (token.type === Token.Punctuator && token.value === ',') {
+ lex();
+ } else if (token.type === Token.Punctuator && token.value === ';') {
+ lex();
+ tolerateUnexpectedToken(token);
+ } else {
+ tolerateUnexpectedToken(token, Messages.UnexpectedToken);
+ }
+ } else {
+ expect(',');
+ }
+ }
+
+ // Expect the next token to match the specified keyword.
+ // If not, an exception will be thrown.
+
+ function expectKeyword(keyword) {
+ var token = lex();
+ if (token.type !== Token.Keyword || token.value !== keyword) {
+ throwUnexpectedToken(token);
+ }
+ }
+
+ // Return true if the next token matches the specified punctuator.
+
+ function match(value) {
+ return lookahead.type === Token.Punctuator && lookahead.value === value;
+ }
+
+ // Return true if the next token matches the specified keyword
+
+ function matchKeyword(keyword) {
+ return lookahead.type === Token.Keyword && lookahead.value === keyword;
+ }
+
+ // Return true if the next token is an assignment operator
+
+ function matchAssign() {
+ var op;
+
+ if (lookahead.type !== Token.Punctuator) {
+ return false;
+ }
+ op = lookahead.value;
+ return op === '=' ||
+ op === '*=' ||
+ op === '/=' ||
+ op === '%=' ||
+ op === '+=' ||
+ op === '-=' ||
+ op === '<<=' ||
+ op === '>>=' ||
+ op === '>>>=' ||
+ op === '&=' ||
+ op === '^=' ||
+ op === '|=';
+ }
+
+ function consumeSemicolon() {
+ // Catch the very common case first: immediately a semicolon (U+003B).
+ if (source.charCodeAt(startIndex) === 0x3B || match(';')) {
+ lex();
+ return;
+ }
+
+ if (hasLineTerminator) {
+ return;
+ }
+
+ // FIXME(ikarienator): this is seemingly an issue in the previous location info convention.
+ lastIndex = startIndex;
+ lastLineNumber = startLineNumber;
+ lastLineStart = startLineStart;
+
+ if (lookahead.type !== Token.EOF && !match('}')) {
+ throwUnexpectedToken(lookahead);
+ }
+ }
+
+ // Return true if provided expression is LeftHandSideExpression
+
+ function isLeftHandSide(expr) {
+ return expr.type === Syntax.Identifier || expr.type === Syntax.MemberExpression;
+ }
+
+ // 11.1.4 Array Initialiser
+
+ function parseArrayInitialiser() {
+ var elements = [], node = new Node();
+
+ expect('[');
+
+ while (!match(']')) {
+ if (match(',')) {
+ lex();
+ elements.push(null);
+ } else {
+ elements.push(parseAssignmentExpression());
+
+ if (!match(']')) {
+ expect(',');
+ }
+ }
+ }
+
+ lex();
+
+ return node.finishArrayExpression(elements);
+ }
+
+ // 11.1.5 Object Initialiser
+
+ function parsePropertyFunction(node, paramInfo) {
+ var previousStrict, body;
+
+ previousStrict = strict;
+ body = parseFunctionSourceElements();
+
+ if (strict && paramInfo.firstRestricted) {
+ tolerateUnexpectedToken(paramInfo.firstRestricted, paramInfo.message);
+ }
+ if (strict && paramInfo.stricted) {
+ tolerateUnexpectedToken(paramInfo.stricted, paramInfo.message);
+ }
+
+ strict = previousStrict;
+ return node.finishFunctionExpression(null, paramInfo.params, paramInfo.defaults, body);
+ }
+
+ function parsePropertyMethodFunction() {
+ var params, method, node = new Node();
+
+ params = parseParams();
+ method = parsePropertyFunction(node, params);
+
+ return method;
+ }
+
+ // This function returns a tuple `[PropertyName, boolean]` where the PropertyName is the key being consumed and the second
+ // element indicate whether its a computed PropertyName or a static PropertyName.
+ function parseObjectPropertyKey() {
+ var token, node = new Node(), expr;
+
+ token = lex();
+
+ // Note: This function is called only from parseObjectProperty(), where
+ // EOF and Punctuator tokens are already filtered out.
+
+ switch (token.type) {
+ case Token.StringLiteral:
+ case Token.NumericLiteral:
+ if (strict && token.octal) {
+ tolerateUnexpectedToken(token, Messages.StrictOctalLiteral);
+ }
+ return node.finishLiteral(token);
+ case Token.Identifier:
+ case Token.BooleanLiteral:
+ case Token.NullLiteral:
+ case Token.Keyword:
+ return node.finishIdentifier(token.value);
+ case Token.Punctuator:
+ if (token.value === '[') {
+ expr = parseAssignmentExpression();
+ expect(']');
+ return expr;
+ }
+ break;
+ }
+ throwUnexpectedToken(token);
+ }
+
+ function lookaheadPropertyName() {
+ switch (lookahead.type) {
+ case Token.Identifier:
+ case Token.StringLiteral:
+ case Token.BooleanLiteral:
+ case Token.NullLiteral:
+ case Token.NumericLiteral:
+ case Token.Keyword:
+ return true;
+ case Token.Punctuator:
+ return lookahead.value === '[';
+ }
+ return false;
+ }
+
+ // This function is to try to parse a MethodDefinition as defined in 14.3. But in the case of object literals,
+ // it might be called at a position where there is in fact a short hand identifier pattern or a data property.
+ // This can only be determined after we consumed up to the left parentheses.
+ //
+ // In order to avoid back tracking, it returns `null` if the position is not a MethodDefinition and the caller
+ // is responsible to visit other options.
+ function tryParseMethodDefinition(token, key, computed, node) {
+ var value, options, methodNode;
+
+ if (token.type === Token.Identifier) {
+ // check for `get` and `set`;
+
+ if (token.value === 'get' && lookaheadPropertyName()) {
+ computed = match('[');
+ key = parseObjectPropertyKey();
+ methodNode = new Node();
+ expect('(');
+ expect(')');
+ value = parsePropertyFunction(methodNode, {
+ params: [],
+ defaults: [],
+ stricted: null,
+ firstRestricted: null,
+ message: null
+ });
+ return node.finishProperty('get', key, computed, value, false, false);
+ } else if (token.value === 'set' && lookaheadPropertyName()) {
+ computed = match('[');
+ key = parseObjectPropertyKey();
+ methodNode = new Node();
+ expect('(');
+
+ options = {
+ params: [],
+ defaultCount: 0,
+ defaults: [],
+ firstRestricted: null,
+ paramSet: {}
+ };
+ if (match(')')) {
+ tolerateUnexpectedToken(lookahead);
+ } else {
+ parseParam(options);
+ if (options.defaultCount === 0) {
+ options.defaults = [];
+ }
+ }
+ expect(')');
+
+ value = parsePropertyFunction(methodNode, options);
+ return node.finishProperty('set', key, computed, value, false, false);
+ }
+ }
+
+ if (match('(')) {
+ value = parsePropertyMethodFunction();
+ return node.finishProperty('init', key, computed, value, true, false);
+ }
+
+ // Not a MethodDefinition.
+ return null;
+ }
+
+ function checkProto(key, computed, hasProto) {
+ if (computed === false && (key.type === Syntax.Identifier && key.name === '__proto__' ||
+ key.type === Syntax.Literal && key.value === '__proto__')) {
+ if (hasProto.value) {
+ tolerateError(Messages.DuplicateProtoProperty);
+ } else {
+ hasProto.value = true;
+ }
+ }
+ }
+
+ function parseObjectProperty(hasProto) {
+ var token = lookahead, node = new Node(), computed, key, maybeMethod, value;
+
+ computed = match('[');
+ key = parseObjectPropertyKey();
+ maybeMethod = tryParseMethodDefinition(token, key, computed, node);
+
+ if (maybeMethod) {
+ checkProto(maybeMethod.key, maybeMethod.computed, hasProto);
+ // finished
+ return maybeMethod;
+ }
+
+ // init property or short hand property.
+ checkProto(key, computed, hasProto);
+
+ if (match(':')) {
+ lex();
+ value = parseAssignmentExpression();
+ return node.finishProperty('init', key, computed, value, false, false);
+ }
+
+ if (token.type === Token.Identifier) {
+ return node.finishProperty('init', key, computed, key, false, true);
+ }
+
+ throwUnexpectedToken(lookahead);
+ }
+
+ function parseObjectInitialiser() {
+ var properties = [], hasProto = {value: false}, node = new Node();
+
+ expect('{');
+
+ while (!match('}')) {
+ properties.push(parseObjectProperty(hasProto));
+
+ if (!match('}')) {
+ expectCommaSeparator();
+ }
+ }
+
+ expect('}');
+
+ return node.finishObjectExpression(properties);
+ }
+
+ // 11.1.6 The Grouping Operator
+
+ function parseGroupExpression() {
+ var expr, expressions, startToken, isValidArrowParameter = true;
+
+ expect('(');
+
+ if (match(')')) {
+ lex();
+ if (!match('=>')) {
+ expect('=>');
+ }
+ return {
+ type: PlaceHolders.ArrowParameterPlaceHolder,
+ params: []
+ };
+ }
+
+ startToken = lookahead;
+ if (match('...')) {
+ expr = parseRestElement();
+ expect(')');
+ if (!match('=>')) {
+ expect('=>');
+ }
+ return {
+ type: PlaceHolders.ArrowParameterPlaceHolder,
+ params: [expr]
+ };
+ }
+
+ if (match('(')) {
+ isValidArrowParameter = false;
+ }
+
+ expr = parseAssignmentExpression();
+
+ if (match(',')) {
+ expressions = [expr];
+
+ while (startIndex < length) {
+ if (!match(',')) {
+ break;
+ }
+ lex();
+
+ if (match('...')) {
+ if (!isValidArrowParameter) {
+ throwUnexpectedToken(lookahead);
+ }
+ expressions.push(parseRestElement());
+ expect(')');
+ if (!match('=>')) {
+ expect('=>');
+ }
+ return {
+ type: PlaceHolders.ArrowParameterPlaceHolder,
+ params: expressions
+ };
+ } else if (match('(')) {
+ isValidArrowParameter = false;
+ }
+
+ expressions.push(parseAssignmentExpression());
+ }
+
+ expr = new WrappingNode(startToken).finishSequenceExpression(expressions);
+ }
+
+
+ expect(')');
+
+ if (match('=>') && !isValidArrowParameter) {
+ throwUnexpectedToken(lookahead);
+ }
+
+ return expr;
+ }
+
+
+ // 11.1 Primary Expressions
+
+ function parsePrimaryExpression() {
+ var type, token, expr, node;
+
+ if (match('(')) {
+ return parseGroupExpression();
+ }
+
+ if (match('[')) {
+ return parseArrayInitialiser();
+ }
+
+ if (match('{')) {
+ return parseObjectInitialiser();
+ }
+
+ type = lookahead.type;
+ node = new Node();
+
+ if (type === Token.Identifier) {
+ expr = node.finishIdentifier(lex().value);
+ } else if (type === Token.StringLiteral || type === Token.NumericLiteral) {
+ if (strict && lookahead.octal) {
+ tolerateUnexpectedToken(lookahead, Messages.StrictOctalLiteral);
+ }
+ expr = node.finishLiteral(lex());
+ } else if (type === Token.Keyword) {
+ if (matchKeyword('function')) {
+ return parseFunctionExpression();
+ }
+ if (matchKeyword('this')) {
+ lex();
+ return node.finishThisExpression();
+ }
+ if (matchKeyword('class')) {
+ return parseClassExpression();
+ }
+ throwUnexpectedToken(lex());
+ } else if (type === Token.BooleanLiteral) {
+ token = lex();
+ token.value = (token.value === 'true');
+ expr = node.finishLiteral(token);
+ } else if (type === Token.NullLiteral) {
+ token = lex();
+ token.value = null;
+ expr = node.finishLiteral(token);
+ } else if (match('/') || match('/=')) {
+ index = startIndex;
+
+ if (typeof extra.tokens !== 'undefined') {
+ token = collectRegex();
+ } else {
+ token = scanRegExp();
+ }
+ lex();
+ expr = node.finishLiteral(token);
+ } else {
+ throwUnexpectedToken(lex());
+ }
+
+ return expr;
+ }
+
+ // 11.2 Left-Hand-Side Expressions
+
+ function parseArguments() {
+ var args = [];
+
+ expect('(');
+
+ if (!match(')')) {
+ while (startIndex < length) {
+ args.push(parseAssignmentExpression());
+ if (match(')')) {
+ break;
+ }
+ expectCommaSeparator();
+ }
+ }
+
+ expect(')');
+
+ return args;
+ }
+
+ function parseNonComputedProperty() {
+ var token, node = new Node();
+
+ token = lex();
+
+ if (!isIdentifierName(token)) {
+ throwUnexpectedToken(token);
+ }
+
+ return node.finishIdentifier(token.value);
+ }
+
+ function parseNonComputedMember() {
+ expect('.');
+
+ return parseNonComputedProperty();
+ }
+
+ function parseComputedMember() {
+ var expr;
+
+ expect('[');
+
+ expr = parseExpression();
+
+ expect(']');
+
+ return expr;
+ }
+
+ function parseNewExpression() {
+ var callee, args, node = new Node();
+
+ expectKeyword('new');
+ callee = parseLeftHandSideExpression();
+ args = match('(') ? parseArguments() : [];
+
+ return node.finishNewExpression(callee, args);
+ }
+
+ function parseLeftHandSideExpressionAllowCall() {
+ var expr, args, property, startToken, previousAllowIn = state.allowIn;
+
+ startToken = lookahead;
+ state.allowIn = true;
+ expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression();
+
+ for (;;) {
+ if (match('.')) {
+ property = parseNonComputedMember();
+ expr = new WrappingNode(startToken).finishMemberExpression('.', expr, property);
+ } else if (match('(')) {
+ args = parseArguments();
+ expr = new WrappingNode(startToken).finishCallExpression(expr, args);
+ } else if (match('[')) {
+ property = parseComputedMember();
+ expr = new WrappingNode(startToken).finishMemberExpression('[', expr, property);
+ } else {
+ break;
+ }
+ }
+ state.allowIn = previousAllowIn;
+
+ return expr;
+ }
+
+ function parseLeftHandSideExpression() {
+ var expr, property, startToken;
+ assert(state.allowIn, 'callee of new expression always allow in keyword.');
+
+ startToken = lookahead;
+
+ expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression();
+
+ for (;;) {
+ if (match('[')) {
+ property = parseComputedMember();
+ expr = new WrappingNode(startToken).finishMemberExpression('[', expr, property);
+ } else if (match('.')) {
+ property = parseNonComputedMember();
+ expr = new WrappingNode(startToken).finishMemberExpression('.', expr, property);
+ } else {
+ break;
+ }
+ }
+ return expr;
+ }
+
+ // 11.3 Postfix Expressions
+
+ function parsePostfixExpression() {
+ var expr, token, startToken = lookahead;
+
+ expr = parseLeftHandSideExpressionAllowCall();
+
+ if (!hasLineTerminator && lookahead.type === Token.Punctuator) {
+ if (match('++') || match('--')) {
+ // 11.3.1, 11.3.2
+ if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) {
+ tolerateError(Messages.StrictLHSPostfix);
+ }
+
+ if (!isLeftHandSide(expr)) {
+ tolerateError(Messages.InvalidLHSInAssignment);
+ }
+
+ token = lex();
+ expr = new WrappingNode(startToken).finishPostfixExpression(token.value, expr);
+ }
+ }
+
+ return expr;
+ }
+
+ // 11.4 Unary Operators
+
+ function parseUnaryExpression() {
+ var token, expr, startToken;
+
+ if (lookahead.type !== Token.Punctuator && lookahead.type !== Token.Keyword) {
+ expr = parsePostfixExpression();
+ } else if (match('++') || match('--')) {
+ startToken = lookahead;
+ token = lex();
+ expr = parseUnaryExpression();
+ // 11.4.4, 11.4.5
+ if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) {
+ tolerateError(Messages.StrictLHSPrefix);
+ }
+
+ if (!isLeftHandSide(expr)) {
+ tolerateError(Messages.InvalidLHSInAssignment);
+ }
+
+ expr = new WrappingNode(startToken).finishUnaryExpression(token.value, expr);
+ } else if (match('+') || match('-') || match('~') || match('!')) {
+ startToken = lookahead;
+ token = lex();
+ expr = parseUnaryExpression();
+ expr = new WrappingNode(startToken).finishUnaryExpression(token.value, expr);
+ } else if (matchKeyword('delete') || matchKeyword('void') || matchKeyword('typeof')) {
+ startToken = lookahead;
+ token = lex();
+ expr = parseUnaryExpression();
+ expr = new WrappingNode(startToken).finishUnaryExpression(token.value, expr);
+ if (strict && expr.operator === 'delete' && expr.argument.type === Syntax.Identifier) {
+ tolerateError(Messages.StrictDelete);
+ }
+ } else {
+ expr = parsePostfixExpression();
+ }
+
+ return expr;
+ }
+
+ function binaryPrecedence(token, allowIn) {
+ var prec = 0;
+
+ if (token.type !== Token.Punctuator && token.type !== Token.Keyword) {
+ return 0;
+ }
+
+ switch (token.value) {
+ case '||':
+ prec = 1;
+ break;
+
+ case '&&':
+ prec = 2;
+ break;
+
+ case '|':
+ prec = 3;
+ break;
+
+ case '^':
+ prec = 4;
+ break;
+
+ case '&':
+ prec = 5;
+ break;
+
+ case '==':
+ case '!=':
+ case '===':
+ case '!==':
+ prec = 6;
+ break;
+
+ case '<':
+ case '>':
+ case '<=':
+ case '>=':
+ case 'instanceof':
+ prec = 7;
+ break;
+
+ case 'in':
+ prec = allowIn ? 7 : 0;
+ break;
+
+ case '<<':
+ case '>>':
+ case '>>>':
+ prec = 8;
+ break;
+
+ case '+':
+ case '-':
+ prec = 9;
+ break;
+
+ case '*':
+ case '/':
+ case '%':
+ prec = 11;
+ break;
+
+ default:
+ break;
+ }
+
+ return prec;
+ }
+
+ // 11.5 Multiplicative Operators
+ // 11.6 Additive Operators
+ // 11.7 Bitwise Shift Operators
+ // 11.8 Relational Operators
+ // 11.9 Equality Operators
+ // 11.10 Binary Bitwise Operators
+ // 11.11 Binary Logical Operators
+
+ function parseBinaryExpression() {
+ var marker, markers, expr, token, prec, stack, right, operator, left, i;
+
+ marker = lookahead;
+ left = parseUnaryExpression();
+
+ token = lookahead;
+ prec = binaryPrecedence(token, state.allowIn);
+ if (prec === 0) {
+ return left;
+ }
+ token.prec = prec;
+ lex();
+
+ markers = [marker, lookahead];
+ right = parseUnaryExpression();
+
+ stack = [left, token, right];
+
+ while ((prec = binaryPrecedence(lookahead, state.allowIn)) > 0) {
+
+ // Reduce: make a binary expression from the three topmost entries.
+ while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {
+ right = stack.pop();
+ operator = stack.pop().value;
+ left = stack.pop();
+ markers.pop();
+ expr = new WrappingNode(markers[markers.length - 1]).finishBinaryExpression(operator, left, right);
+ stack.push(expr);
+ }
+
+ // Shift.
+ token = lex();
+ token.prec = prec;
+ stack.push(token);
+ markers.push(lookahead);
+ expr = parseUnaryExpression();
+ stack.push(expr);
+ }
+
+ // Final reduce to clean-up the stack.
+ i = stack.length - 1;
+ expr = stack[i];
+ markers.pop();
+ while (i > 1) {
+ expr = new WrappingNode(markers.pop()).finishBinaryExpression(stack[i - 1].value, stack[i - 2], expr);
+ i -= 2;
+ }
+
+ return expr;
+ }
+
+
+ // 11.12 Conditional Operator
+
+ function parseConditionalExpression() {
+ var expr, previousAllowIn, consequent, alternate, startToken;
+
+ startToken = lookahead;
+
+ expr = parseBinaryExpression();
+ if (match('?')) {
+ lex();
+ previousAllowIn = state.allowIn;
+ state.allowIn = true;
+ consequent = parseAssignmentExpression();
+ state.allowIn = previousAllowIn;
+ expect(':');
+ alternate = parseAssignmentExpression();
+
+ expr = new WrappingNode(startToken).finishConditionalExpression(expr, consequent, alternate);
+ }
+
+ return expr;
+ }
+
+ // [ES6] 14.2 Arrow Function
+
+ function parseConciseBody() {
+ if (match('{')) {
+ return parseFunctionSourceElements();
+ }
+ return parseAssignmentExpression();
+ }
+
+ function reinterpretAsCoverFormalsList(expr) {
+ var i, len, param, params, defaults, defaultCount, options, token;
+
+ defaults = [];
+ defaultCount = 0;
+ params = [expr];
+
+ switch (expr.type) {
+ case Syntax.Identifier:
+ case Syntax.AssignmentExpression:
+ break;
+ case Syntax.SequenceExpression:
+ params = expr.expressions;
+ break;
+ case PlaceHolders.ArrowParameterPlaceHolder:
+ params = expr.params;
+ break;
+ default:
+ return null;
+ }
+
+ options = {
+ paramSet: {}
+ };
+
+ for (i = 0, len = params.length; i < len; i += 1) {
+ param = params[i];
+ if (param.type === Syntax.Identifier) {
+ params[i] = param;
+ defaults.push(null);
+ validateParam(options, param, param.name);
+ } else if (param.type === Syntax.RestElement) {
+ params[i] = param;
+ defaults.push(null);
+ validateParam(options, param.argument, param.argument.name);
+ } else if (param.type === Syntax.AssignmentExpression) {
+ params[i] = param.left;
+ defaults.push(param.right);
+ ++defaultCount;
+ validateParam(options, param.left, param.left.name);
+ } else {
+ return null;
+ }
+ }
+
+ if (options.message === Messages.StrictParamDupe) {
+ token = strict ? options.stricted : options.firstRestricted;
+ throwUnexpectedToken(token, options.message);
+ }
+
+ if (defaultCount === 0) {
+ defaults = [];
+ }
+
+ return {
+ params: params,
+ defaults: defaults,
+ stricted: options.stricted,
+ firstRestricted: options.firstRestricted,
+ message: options.message
+ };
+ }
+
+ function parseArrowFunctionExpression(options, node) {
+ var previousStrict, body;
+
+ expect('=>');
+ previousStrict = strict;
+
+ body = parseConciseBody();
+
+ if (strict && options.firstRestricted) {
+ throwUnexpectedToken(options.firstRestricted, options.message);
+ }
+ if (strict && options.stricted) {
+ tolerateUnexpectedToken(options.stricted, options.message);
+ }
+
+ strict = previousStrict;
+
+ return node.finishArrowFunctionExpression(options.params, options.defaults, body, body.type !== Syntax.BlockStatement);
+ }
+
+ // 11.13 Assignment Operators
+
+ function parseAssignmentExpression() {
+ var token, expr, right, list, startToken;
+
+ startToken = lookahead;
+ token = lookahead;
+
+ expr = parseConditionalExpression();
+
+ if (expr.type === PlaceHolders.ArrowParameterPlaceHolder || match('=>')) {
+ list = reinterpretAsCoverFormalsList(expr);
+
+ if (list) {
+ return parseArrowFunctionExpression(list, new WrappingNode(startToken));
+ }
+ }
+
+ if (matchAssign()) {
+ // LeftHandSideExpression
+ if (!isLeftHandSide(expr)) {
+ tolerateError(Messages.InvalidLHSInAssignment);
+ }
+
+ // 11.13.1
+ if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) {
+ tolerateUnexpectedToken(token, Messages.StrictLHSAssignment);
+ }
+
+ token = lex();
+ right = parseAssignmentExpression();
+ expr = new WrappingNode(startToken).finishAssignmentExpression(token.value, expr, right);
+ }
+
+ return expr;
+ }
+
+ // 11.14 Comma Operator
+
+ function parseExpression() {
+ var expr, startToken = lookahead, expressions;
+
+ expr = parseAssignmentExpression();
+
+ if (match(',')) {
+ expressions = [expr];
+
+ while (startIndex < length) {
+ if (!match(',')) {
+ break;
+ }
+ lex();
+ expressions.push(parseAssignmentExpression());
+ }
+
+ expr = new WrappingNode(startToken).finishSequenceExpression(expressions);
+ }
+
+ return expr;
+ }
+
+ // 12.1 Block
+
+ function parseStatementListItem() {
+ if (lookahead.type === Token.Keyword) {
+ switch (lookahead.value) {
+ case 'const':
+ case 'let':
+ return parseLexicalDeclaration();
+ case 'function':
+ return parseFunctionDeclaration(new Node());
+ case 'class':
+ return parseClassDeclaration();
+ }
+ }
+
+ return parseStatement();
+ }
+
+ function parseStatementList() {
+ var list = [];
+ while (startIndex < length) {
+ if (match('}')) {
+ break;
+ }
+ list.push(parseStatementListItem());
+ }
+
+ return list;
+ }
+
+ function parseBlock() {
+ var block, node = new Node();
+
+ expect('{');
+
+ block = parseStatementList();
+
+ expect('}');
+
+ return node.finishBlockStatement(block);
+ }
+
+ // 12.2 Variable Statement
+
+ function parseVariableIdentifier() {
+ var token, node = new Node();
+
+ token = lex();
+
+ if (token.type !== Token.Identifier) {
+ if (strict && token.type === Token.Keyword && isStrictModeReservedWord(token.value)) {
+ tolerateUnexpectedToken(token, Messages.StrictReservedWord);
+ } else {
+ throwUnexpectedToken(token);
+ }
+ }
+
+ return node.finishIdentifier(token.value);
+ }
+
+ function parseVariableDeclaration() {
+ var init = null, id, node = new Node();
+
+ id = parseVariableIdentifier();
+
+ // 12.2.1
+ if (strict && isRestrictedWord(id.name)) {
+ tolerateError(Messages.StrictVarName);
+ }
+
+ if (match('=')) {
+ lex();
+ init = parseAssignmentExpression();
+ }
+
+ return node.finishVariableDeclarator(id, init);
+ }
+
+ function parseVariableDeclarationList() {
+ var list = [];
+
+ do {
+ list.push(parseVariableDeclaration());
+ if (!match(',')) {
+ break;
+ }
+ lex();
+ } while (startIndex < length);
+
+ return list;
+ }
+
+ function parseVariableStatement(node) {
+ var declarations;
+
+ expectKeyword('var');
+
+ declarations = parseVariableDeclarationList();
+
+ consumeSemicolon();
+
+ return node.finishVariableDeclaration(declarations);
+ }
+
+ function parseLexicalBinding(kind) {
+ var init = null, id, node = new Node();
+
+ id = parseVariableIdentifier();
+
+ // 12.2.1
+ if (strict && isRestrictedWord(id.name)) {
+ tolerateError(Messages.StrictVarName);
+ }
+
+ if (kind === 'const') {
+ if (!matchKeyword('in')) {
+ expect('=');
+ init = parseAssignmentExpression();
+ }
+ } else if (match('=')) {
+ lex();
+ init = parseAssignmentExpression();
+ }
+
+ return node.finishVariableDeclarator(id, init);
+ }
+
+ function parseBindingList(kind) {
+ var list = [];
+
+ do {
+ list.push(parseLexicalBinding(kind));
+ if (!match(',')) {
+ break;
+ }
+ lex();
+ } while (startIndex < length);
+
+ return list;
+ }
+
+ function parseLexicalDeclaration() {
+ var kind, declarations, node = new Node();
+
+ kind = lex().value;
+ assert(kind === 'let' || kind === 'const', 'Lexical declaration must be either let or const');
+
+ declarations = parseBindingList(kind);
+
+ consumeSemicolon();
+
+ return node.finishLexicalDeclaration(declarations, kind);
+ }
+
+ function parseRestElement() {
+ var param, node = new Node();
+
+ lex();
+
+ if (match('{')) {
+ throwError(Messages.ObjectPatternAsRestParameter);
+ }
+
+ param = parseVariableIdentifier();
+
+ if (match('=')) {
+ throwError(Messages.DefaultRestParameter);
+ }
+
+ if (!match(')')) {
+ throwError(Messages.ParameterAfterRestParameter);
+ }
+
+ return node.finishRestElement(param);
+ }
+
+ // 12.3 Empty Statement
+
+ function parseEmptyStatement(node) {
+ expect(';');
+ return node.finishEmptyStatement();
+ }
+
+ // 12.4 Expression Statement
+
+ function parseExpressionStatement(node) {
+ var expr = parseExpression();
+ consumeSemicolon();
+ return node.finishExpressionStatement(expr);
+ }
+
+ // 12.5 If statement
+
+ function parseIfStatement(node) {
+ var test, consequent, alternate;
+
+ expectKeyword('if');
+
+ expect('(');
+
+ test = parseExpression();
+
+ expect(')');
+
+ consequent = parseStatement();
+
+ if (matchKeyword('else')) {
+ lex();
+ alternate = parseStatement();
+ } else {
+ alternate = null;
+ }
+
+ return node.finishIfStatement(test, consequent, alternate);
+ }
+
+ // 12.6 Iteration Statements
+
+ function parseDoWhileStatement(node) {
+ var body, test, oldInIteration;
+
+ expectKeyword('do');
+
+ oldInIteration = state.inIteration;
+ state.inIteration = true;
+
+ body = parseStatement();
+
+ state.inIteration = oldInIteration;
+
+ expectKeyword('while');
+
+ expect('(');
+
+ test = parseExpression();
+
+ expect(')');
+
+ if (match(';')) {
+ lex();
+ }
+
+ return node.finishDoWhileStatement(body, test);
+ }
+
+ function parseWhileStatement(node) {
+ var test, body, oldInIteration;
+
+ expectKeyword('while');
+
+ expect('(');
+
+ test = parseExpression();
+
+ expect(')');
+
+ oldInIteration = state.inIteration;
+ state.inIteration = true;
+
+ body = parseStatement();
+
+ state.inIteration = oldInIteration;
+
+ return node.finishWhileStatement(test, body);
+ }
+
+ function parseForStatement(node) {
+ var init, test, update, left, right, kind, declarations,
+ body, oldInIteration, previousAllowIn = state.allowIn;
+
+ init = test = update = null;
+
+ expectKeyword('for');
+
+ expect('(');
+
+ if (match(';')) {
+ lex();
+ } else {
+ if (matchKeyword('var')) {
+ init = new Node();
+ lex();
+
+ state.allowIn = false;
+ init = init.finishVariableDeclaration(parseVariableDeclarationList());
+ state.allowIn = previousAllowIn;
+
+ if (init.declarations.length === 1 && matchKeyword('in')) {
+ lex();
+ left = init;
+ right = parseExpression();
+ init = null;
+ } else {
+ expect(';');
+ }
+ } else if (matchKeyword('const') || matchKeyword('let')) {
+ init = new Node();
+ kind = lex().value;
+
+ state.allowIn = false;
+ declarations = parseBindingList(kind);
+ state.allowIn = previousAllowIn;
+
+ if (declarations.length === 1 && declarations[0].init === null && matchKeyword('in')) {
+ init = init.finishLexicalDeclaration(declarations, kind);
+ lex();
+ left = init;
+ right = parseExpression();
+ init = null;
+ } else {
+ consumeSemicolon();
+ init = init.finishLexicalDeclaration(declarations, kind);
+ }
+ } else {
+ state.allowIn = false;
+ init = parseExpression();
+ state.allowIn = previousAllowIn;
+
+ if (matchKeyword('in')) {
+ // LeftHandSideExpression
+ if (!isLeftHandSide(init)) {
+ tolerateError(Messages.InvalidLHSInForIn);
+ }
+
+ lex();
+ left = init;
+ right = parseExpression();
+ init = null;
+ } else {
+ expect(';');
+ }
+ }
+ }
+
+ if (typeof left === 'undefined') {
+
+ if (!match(';')) {
+ test = parseExpression();
+ }
+ expect(';');
+
+ if (!match(')')) {
+ update = parseExpression();
+ }
+ }
+
+ expect(')');
+
+ oldInIteration = state.inIteration;
+ state.inIteration = true;
+
+ body = parseStatement();
+
+ state.inIteration = oldInIteration;
+
+ return (typeof left === 'undefined') ?
+ node.finishForStatement(init, test, update, body) :
+ node.finishForInStatement(left, right, body);
+ }
+
+ // 12.7 The continue statement
+
+ function parseContinueStatement(node) {
+ var label = null, key;
+
+ expectKeyword('continue');
+
+ // Optimize the most common form: 'continue;'.
+ if (source.charCodeAt(startIndex) === 0x3B) {
+ lex();
+
+ if (!state.inIteration) {
+ throwError(Messages.IllegalContinue);
+ }
+
+ return node.finishContinueStatement(null);
+ }
+
+ if (hasLineTerminator) {
+ if (!state.inIteration) {
+ throwError(Messages.IllegalContinue);
+ }
+
+ return node.finishContinueStatement(null);
+ }
+
+ if (lookahead.type === Token.Identifier) {
+ label = parseVariableIdentifier();
+
+ key = '$' + label.name;
+ if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) {
+ throwError(Messages.UnknownLabel, label.name);
+ }
+ }
+
+ consumeSemicolon();
+
+ if (label === null && !state.inIteration) {
+ throwError(Messages.IllegalContinue);
+ }
+
+ return node.finishContinueStatement(label);
+ }
+
+ // 12.8 The break statement
+
+ function parseBreakStatement(node) {
+ var label = null, key;
+
+ expectKeyword('break');
+
+ // Catch the very common case first: immediately a semicolon (U+003B).
+ if (source.charCodeAt(lastIndex) === 0x3B) {
+ lex();
+
+ if (!(state.inIteration || state.inSwitch)) {
+ throwError(Messages.IllegalBreak);
+ }
+
+ return node.finishBreakStatement(null);
+ }
+
+ if (hasLineTerminator) {
+ if (!(state.inIteration || state.inSwitch)) {
+ throwError(Messages.IllegalBreak);
+ }
+
+ return node.finishBreakStatement(null);
+ }
+
+ if (lookahead.type === Token.Identifier) {
+ label = parseVariableIdentifier();
+
+ key = '$' + label.name;
+ if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) {
+ throwError(Messages.UnknownLabel, label.name);
+ }
+ }
+
+ consumeSemicolon();
+
+ if (label === null && !(state.inIteration || state.inSwitch)) {
+ throwError(Messages.IllegalBreak);
+ }
+
+ return node.finishBreakStatement(label);
+ }
+
+ // 12.9 The return statement
+
+ function parseReturnStatement(node) {
+ var argument = null;
+
+ expectKeyword('return');
+
+ if (!state.inFunctionBody) {
+ tolerateError(Messages.IllegalReturn);
+ }
+
+ // 'return' followed by a space and an identifier is very common.
+ if (source.charCodeAt(lastIndex) === 0x20) {
+ if (isIdentifierStart(source.charCodeAt(lastIndex + 1))) {
+ argument = parseExpression();
+ consumeSemicolon();
+ return node.finishReturnStatement(argument);
+ }
+ }
+
+ if (hasLineTerminator) {
+ // HACK
+ return node.finishReturnStatement(null);
+ }
+
+ if (!match(';')) {
+ if (!match('}') && lookahead.type !== Token.EOF) {
+ argument = parseExpression();
+ }
+ }
+
+ consumeSemicolon();
+
+ return node.finishReturnStatement(argument);
+ }
+
+ // 12.10 The with statement
+
+ function parseWithStatement(node) {
+ var object, body;
+
+ if (strict) {
+ tolerateError(Messages.StrictModeWith);
+ }
+
+ expectKeyword('with');
+
+ expect('(');
+
+ object = parseExpression();
+
+ expect(')');
+
+ body = parseStatement();
+
+ return node.finishWithStatement(object, body);
+ }
+
+ // 12.10 The swith statement
+
+ function parseSwitchCase() {
+ var test, consequent = [], statement, node = new Node();
+
+ if (matchKeyword('default')) {
+ lex();
+ test = null;
+ } else {
+ expectKeyword('case');
+ test = parseExpression();
+ }
+ expect(':');
+
+ while (startIndex < length) {
+ if (match('}') || matchKeyword('default') || matchKeyword('case')) {
+ break;
+ }
+ statement = parseStatementListItem();
+ consequent.push(statement);
+ }
+
+ return node.finishSwitchCase(test, consequent);
+ }
+
+ function parseSwitchStatement(node) {
+ var discriminant, cases, clause, oldInSwitch, defaultFound;
+
+ expectKeyword('switch');
+
+ expect('(');
+
+ discriminant = parseExpression();
+
+ expect(')');
+
+ expect('{');
+
+ cases = [];
+
+ if (match('}')) {
+ lex();
+ return node.finishSwitchStatement(discriminant, cases);
+ }
+
+ oldInSwitch = state.inSwitch;
+ state.inSwitch = true;
+ defaultFound = false;
+
+ while (startIndex < length) {
+ if (match('}')) {
+ break;
+ }
+ clause = parseSwitchCase();
+ if (clause.test === null) {
+ if (defaultFound) {
+ throwError(Messages.MultipleDefaultsInSwitch);
+ }
+ defaultFound = true;
+ }
+ cases.push(clause);
+ }
+
+ state.inSwitch = oldInSwitch;
+
+ expect('}');
+
+ return node.finishSwitchStatement(discriminant, cases);
+ }
+
+ // 12.13 The throw statement
+
+ function parseThrowStatement(node) {
+ var argument;
+
+ expectKeyword('throw');
+
+ if (hasLineTerminator) {
+ throwError(Messages.NewlineAfterThrow);
+ }
+
+ argument = parseExpression();
+
+ consumeSemicolon();
+
+ return node.finishThrowStatement(argument);
+ }
+
+ // 12.14 The try statement
+
+ function parseCatchClause() {
+ var param, body, node = new Node();
+
+ expectKeyword('catch');
+
+ expect('(');
+ if (match(')')) {
+ throwUnexpectedToken(lookahead);
+ }
+
+ param = parseVariableIdentifier();
+ // 12.14.1
+ if (strict && isRestrictedWord(param.name)) {
+ tolerateError(Messages.StrictCatchVariable);
+ }
+
+ expect(')');
+ body = parseBlock();
+ return node.finishCatchClause(param, body);
+ }
+
+ function parseTryStatement(node) {
+ var block, handler = null, finalizer = null;
+
+ expectKeyword('try');
+
+ block = parseBlock();
+
+ if (matchKeyword('catch')) {
+ handler = parseCatchClause();
+ }
+
+ if (matchKeyword('finally')) {
+ lex();
+ finalizer = parseBlock();
+ }
+
+ if (!handler && !finalizer) {
+ throwError(Messages.NoCatchOrFinally);
+ }
+
+ return node.finishTryStatement(block, handler, finalizer);
+ }
+
+ // 12.15 The debugger statement
+
+ function parseDebuggerStatement(node) {
+ expectKeyword('debugger');
+
+ consumeSemicolon();
+
+ return node.finishDebuggerStatement();
+ }
+
+ // 12 Statements
+
+ function parseStatement() {
+ var type = lookahead.type,
+ expr,
+ labeledBody,
+ key,
+ node;
+
+ if (type === Token.EOF) {
+ throwUnexpectedToken(lookahead);
+ }
+
+ if (type === Token.Punctuator && lookahead.value === '{') {
+ return parseBlock();
+ }
+
+ node = new Node();
+
+ if (type === Token.Punctuator) {
+ switch (lookahead.value) {
+ case ';':
+ return parseEmptyStatement(node);
+ case '(':
+ return parseExpressionStatement(node);
+ default:
+ break;
+ }
+ } else if (type === Token.Keyword) {
+ switch (lookahead.value) {
+ case 'break':
+ return parseBreakStatement(node);
+ case 'continue':
+ return parseContinueStatement(node);
+ case 'debugger':
+ return parseDebuggerStatement(node);
+ case 'do':
+ return parseDoWhileStatement(node);
+ case 'for':
+ return parseForStatement(node);
+ case 'function':
+ return parseFunctionDeclaration(node);
+ case 'if':
+ return parseIfStatement(node);
+ case 'return':
+ return parseReturnStatement(node);
+ case 'switch':
+ return parseSwitchStatement(node);
+ case 'throw':
+ return parseThrowStatement(node);
+ case 'try':
+ return parseTryStatement(node);
+ case 'var':
+ return parseVariableStatement(node);
+ case 'while':
+ return parseWhileStatement(node);
+ case 'with':
+ return parseWithStatement(node);
+ default:
+ break;
+ }
+ }
+
+ expr = parseExpression();
+
+ // 12.12 Labelled Statements
+ if ((expr.type === Syntax.Identifier) && match(':')) {
+ lex();
+
+ key = '$' + expr.name;
+ if (Object.prototype.hasOwnProperty.call(state.labelSet, key)) {
+ throwError(Messages.Redeclaration, 'Label', expr.name);
+ }
+
+ state.labelSet[key] = true;
+ labeledBody = parseStatement();
+ delete state.labelSet[key];
+ return node.finishLabeledStatement(expr, labeledBody);
+ }
+
+ consumeSemicolon();
+
+ return node.finishExpressionStatement(expr);
+ }
+
+ // 13 Function Definition
+
+ function parseFunctionSourceElements() {
+ var statement, body = [], token, directive, firstRestricted,
+ oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody, oldParenthesisCount,
+ node = new Node();
+
+ expect('{');
+
+ while (startIndex < length) {
+ if (lookahead.type !== Token.StringLiteral) {
+ break;
+ }
+ token = lookahead;
+
+ statement = parseStatementListItem();
+ body.push(statement);
+ if (statement.expression.type !== Syntax.Literal) {
+ // this is not directive
+ break;
+ }
+ directive = source.slice(token.start + 1, token.end - 1);
+ if (directive === 'use strict') {
+ strict = true;
+ if (firstRestricted) {
+ tolerateUnexpectedToken(firstRestricted, Messages.StrictOctalLiteral);
+ }
+ } else {
+ if (!firstRestricted && token.octal) {
+ firstRestricted = token;
+ }
+ }
+ }
+
+ oldLabelSet = state.labelSet;
+ oldInIteration = state.inIteration;
+ oldInSwitch = state.inSwitch;
+ oldInFunctionBody = state.inFunctionBody;
+ oldParenthesisCount = state.parenthesizedCount;
+
+ state.labelSet = {};
+ state.inIteration = false;
+ state.inSwitch = false;
+ state.inFunctionBody = true;
+ state.parenthesizedCount = 0;
+
+ while (startIndex < length) {
+ if (match('}')) {
+ break;
+ }
+ body.push(parseStatementListItem());
+ }
+
+ expect('}');
+
+ state.labelSet = oldLabelSet;
+ state.inIteration = oldInIteration;
+ state.inSwitch = oldInSwitch;
+ state.inFunctionBody = oldInFunctionBody;
+ state.parenthesizedCount = oldParenthesisCount;
+
+ return node.finishBlockStatement(body);
+ }
+
+ function validateParam(options, param, name) {
+ var key = '$' + name;
+ if (strict) {
+ if (isRestrictedWord(name)) {
+ options.stricted = param;
+ options.message = Messages.StrictParamName;
+ }
+ if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) {
+ options.stricted = param;
+ options.message = Messages.StrictParamDupe;
+ }
+ } else if (!options.firstRestricted) {
+ if (isRestrictedWord(name)) {
+ options.firstRestricted = param;
+ options.message = Messages.StrictParamName;
+ } else if (isStrictModeReservedWord(name)) {
+ options.firstRestricted = param;
+ options.message = Messages.StrictReservedWord;
+ } else if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) {
+ options.firstRestricted = param;
+ options.message = Messages.StrictParamDupe;
+ }
+ }
+ options.paramSet[key] = true;
+ }
+
+ function parseParam(options) {
+ var token, param, def;
+
+ token = lookahead;
+ if (token.value === '...') {
+ param = parseRestElement();
+ validateParam(options, param.argument, param.argument.name);
+ options.params.push(param);
+ options.defaults.push(null);
+ return false;
+ }
+
+ param = parseVariableIdentifier();
+ validateParam(options, token, token.value);
+
+ if (match('=')) {
+ lex();
+ def = parseAssignmentExpression();
+ ++options.defaultCount;
+ }
+
+ options.params.push(param);
+ options.defaults.push(def);
+
+ return !match(')');
+ }
+
+ function parseParams(firstRestricted) {
+ var options;
+
+ options = {
+ params: [],
+ defaultCount: 0,
+ defaults: [],
+ firstRestricted: firstRestricted
+ };
+
+ expect('(');
+
+ if (!match(')')) {
+ options.paramSet = {};
+ while (startIndex < length) {
+ if (!parseParam(options)) {
+ break;
+ }
+ expect(',');
+ }
+ }
+
+ expect(')');
+
+ if (options.defaultCount === 0) {
+ options.defaults = [];
+ }
+
+ return {
+ params: options.params,
+ defaults: options.defaults,
+ stricted: options.stricted,
+ firstRestricted: options.firstRestricted,
+ message: options.message
+ };
+ }
+
+ function parseFunctionDeclaration(node) {
+ var id, params = [], defaults = [], body, token, stricted, tmp, firstRestricted, message, previousStrict;
+
+ expectKeyword('function');
+ token = lookahead;
+ id = parseVariableIdentifier();
+ if (strict) {
+ if (isRestrictedWord(token.value)) {
+ tolerateUnexpectedToken(token, Messages.StrictFunctionName);
+ }
+ } else {
+ if (isRestrictedWord(token.value)) {
+ firstRestricted = token;
+ message = Messages.StrictFunctionName;
+ } else if (isStrictModeReservedWord(token.value)) {
+ firstRestricted = token;
+ message = Messages.StrictReservedWord;
+ }
+ }
+
+ tmp = parseParams(firstRestricted);
+ params = tmp.params;
+ defaults = tmp.defaults;
+ stricted = tmp.stricted;
+ firstRestricted = tmp.firstRestricted;
+ if (tmp.message) {
+ message = tmp.message;
+ }
+
+ previousStrict = strict;
+ body = parseFunctionSourceElements();
+ if (strict && firstRestricted) {
+ throwUnexpectedToken(firstRestricted, message);
+ }
+ if (strict && stricted) {
+ tolerateUnexpectedToken(stricted, message);
+ }
+ strict = previousStrict;
+
+ return node.finishFunctionDeclaration(id, params, defaults, body);
+ }
+
+ function parseFunctionExpression() {
+ var token, id = null, stricted, firstRestricted, message, tmp,
+ params = [], defaults = [], body, previousStrict, node = new Node();
+
+ expectKeyword('function');
+
+ if (!match('(')) {
+ token = lookahead;
+ id = parseVariableIdentifier();
+ if (strict) {
+ if (isRestrictedWord(token.value)) {
+ tolerateUnexpectedToken(token, Messages.StrictFunctionName);
+ }
+ } else {
+ if (isRestrictedWord(token.value)) {
+ firstRestricted = token;
+ message = Messages.StrictFunctionName;
+ } else if (isStrictModeReservedWord(token.value)) {
+ firstRestricted = token;
+ message = Messages.StrictReservedWord;
+ }
+ }
+ }
+
+ tmp = parseParams(firstRestricted);
+ params = tmp.params;
+ defaults = tmp.defaults;
+ stricted = tmp.stricted;
+ firstRestricted = tmp.firstRestricted;
+ if (tmp.message) {
+ message = tmp.message;
+ }
+
+ previousStrict = strict;
+ body = parseFunctionSourceElements();
+ if (strict && firstRestricted) {
+ throwUnexpectedToken(firstRestricted, message);
+ }
+ if (strict && stricted) {
+ tolerateUnexpectedToken(stricted, message);
+ }
+ strict = previousStrict;
+
+ return node.finishFunctionExpression(id, params, defaults, body);
+ }
+
+
+ function parseClassBody() {
+ var classBody, token, isStatic, hasConstructor = false, body, method, computed, key;
+
+ classBody = new Node();
+
+ expect('{');
+ body = [];
+ while (!match('}')) {
+ if (match(';')) {
+ lex();
+ } else {
+ method = new Node();
+ token = lookahead;
+ isStatic = false;
+ computed = match('[');
+ key = parseObjectPropertyKey();
+ if (key.name === 'static' && lookaheadPropertyName()) {
+ token = lookahead;
+ isStatic = true;
+ computed = match('[');
+ key = parseObjectPropertyKey();
+ }
+ method = tryParseMethodDefinition(token, key, computed, method);
+ if (method) {
+ method.static = isStatic;
+ if (method.kind === 'init') {
+ method.kind = 'method';
+ }
+ if (!isStatic) {
+ if (!method.computed && (method.key.name || method.key.value.toString()) === 'constructor') {
+ if (method.kind !== 'method' || !method.method || method.value.generator) {
+ throwUnexpectedToken(token, Messages.ConstructorSpecialMethod);
+ }
+ if (hasConstructor) {
+ throwUnexpectedToken(token, Messages.DuplicateConstructor);
+ } else {
+ hasConstructor = true;
+ }
+ method.kind = 'constructor';
+ }
+ } else {
+ if (!method.computed && (method.key.name || method.key.value.toString()) === 'prototype') {
+ throwUnexpectedToken(token, Messages.StaticPrototype);
+ }
+ }
+ method.type = Syntax.MethodDefinition;
+ delete method.method;
+ delete method.shorthand;
+ body.push(method);
+ } else {
+ throwUnexpectedToken(lookahead);
+ }
+ }
+ }
+ lex();
+ return classBody.finishClassBody(body);
+ }
+
+ function parseClassDeclaration() {
+ var id = null, superClass = null, classNode = new Node(), classBody, previousStrict = strict;
+ strict = true;
+
+ expectKeyword('class');
+
+ id = parseVariableIdentifier();
+
+ if (matchKeyword('extends')) {
+ lex();
+ superClass = parseLeftHandSideExpressionAllowCall();
+ }
+ classBody = parseClassBody();
+ strict = previousStrict;
+
+ return classNode.finishClassDeclaration(id, superClass, classBody);
+ }
+
+ function parseClassExpression() {
+ var id = null, superClass = null, classNode = new Node(), classBody, previousStrict = strict;
+ strict = true;
+
+ expectKeyword('class');
+
+ if (lookahead.type === Token.Identifier) {
+ id = parseVariableIdentifier();
+ }
+
+ if (matchKeyword('extends')) {
+ lex();
+ superClass = parseLeftHandSideExpressionAllowCall();
+ }
+ classBody = parseClassBody();
+ strict = previousStrict;
+
+ return classNode.finishClassExpression(id, superClass, classBody);
+ }
+
+ // 14 Program
+
+ function parseScriptBody() {
+ var statement, body = [], token, directive, firstRestricted;
+
+ while (startIndex < length) {
+ token = lookahead;
+ if (token.type !== Token.StringLiteral) {
+ break;
+ }
+
+ statement = parseStatementListItem();
+ body.push(statement);
+ if (statement.expression.type !== Syntax.Literal) {
+ // this is not directive
+ break;
+ }
+ directive = source.slice(token.start + 1, token.end - 1);
+ if (directive === 'use strict') {
+ strict = true;
+ if (firstRestricted) {
+ tolerateUnexpectedToken(firstRestricted, Messages.StrictOctalLiteral);
+ }
+ } else {
+ if (!firstRestricted && token.octal) {
+ firstRestricted = token;
+ }
+ }
+ }
+
+ while (startIndex < length) {
+ statement = parseStatementListItem();
+ /* istanbul ignore if */
+ if (typeof statement === 'undefined') {
+ break;
+ }
+ body.push(statement);
+ }
+ return body;
+ }
+
+ function parseProgram() {
+ var body, node;
+
+ peek();
+ node = new Node();
+ strict = false;
+
+ body = parseScriptBody();
+ return node.finishProgram(body);
+ }
+
+ function filterTokenLocation() {
+ var i, entry, token, tokens = [];
+
+ for (i = 0; i < extra.tokens.length; ++i) {
+ entry = extra.tokens[i];
+ token = {
+ type: entry.type,
+ value: entry.value
+ };
+ if (entry.regex) {
+ token.regex = {
+ pattern: entry.regex.pattern,
+ flags: entry.regex.flags
+ };
+ }
+ if (extra.range) {
+ token.range = entry.range;
+ }
+ if (extra.loc) {
+ token.loc = entry.loc;
+ }
+ tokens.push(token);
+ }
+
+ extra.tokens = tokens;
+ }
+
+ function tokenize(code, options) {
+ var toString,
+ tokens;
+
+ toString = String;
+ if (typeof code !== 'string' && !(code instanceof String)) {
+ code = toString(code);
+ }
+
+ source = code;
+ index = 0;
+ lineNumber = (source.length > 0) ? 1 : 0;
+ lineStart = 0;
+ startIndex = index;
+ startLineNumber = lineNumber;
+ startLineStart = lineStart;
+ length = source.length;
+ lookahead = null;
+ state = {
+ allowIn: true,
+ labelSet: {},
+ inFunctionBody: false,
+ inIteration: false,
+ inSwitch: false,
+ lastCommentStart: -1
+ };
+
+ extra = {};
+
+ // Options matching.
+ options = options || {};
+
+ // Of course we collect tokens here.
+ options.tokens = true;
+ extra.tokens = [];
+ extra.tokenize = true;
+ // The following two fields are necessary to compute the Regex tokens.
+ extra.openParenToken = -1;
+ extra.openCurlyToken = -1;
+
+ extra.range = (typeof options.range === 'boolean') && options.range;
+ extra.loc = (typeof options.loc === 'boolean') && options.loc;
+
+ if (typeof options.comment === 'boolean' && options.comment) {
+ extra.comments = [];
+ }
+ if (typeof options.tolerant === 'boolean' && options.tolerant) {
+ extra.errors = [];
+ }
+
+ try {
+ peek();
+ if (lookahead.type === Token.EOF) {
+ return extra.tokens;
+ }
+
+ lex();
+ while (lookahead.type !== Token.EOF) {
+ try {
+ lex();
+ } catch (lexError) {
+ if (extra.errors) {
+ recordError(lexError);
+ // We have to break on the first error
+ // to avoid infinite loops.
+ break;
+ } else {
+ throw lexError;
+ }
+ }
+ }
+
+ filterTokenLocation();
+ tokens = extra.tokens;
+ if (typeof extra.comments !== 'undefined') {
+ tokens.comments = extra.comments;
+ }
+ if (typeof extra.errors !== 'undefined') {
+ tokens.errors = extra.errors;
+ }
+ } catch (e) {
+ throw e;
+ } finally {
+ extra = {};
+ }
+ return tokens;
+ }
+
+ function parse(code, options) {
+ var program, toString;
+
+ toString = String;
+ if (typeof code !== 'string' && !(code instanceof String)) {
+ code = toString(code);
+ }
+
+ source = code;
+ index = 0;
+ lineNumber = (source.length > 0) ? 1 : 0;
+ lineStart = 0;
+ startIndex = index;
+ startLineNumber = lineNumber;
+ startLineStart = lineStart;
+ length = source.length;
+ lookahead = null;
+ state = {
+ allowIn: true,
+ labelSet: {},
+ inFunctionBody: false,
+ inIteration: false,
+ inSwitch: false,
+ lastCommentStart: -1
+ };
+
+ extra = {};
+ if (typeof options !== 'undefined') {
+ extra.range = (typeof options.range === 'boolean') && options.range;
+ extra.loc = (typeof options.loc === 'boolean') && options.loc;
+ extra.attachComment = (typeof options.attachComment === 'boolean') && options.attachComment;
+
+ if (extra.loc && options.source !== null && options.source !== undefined) {
+ extra.source = toString(options.source);
+ }
+
+ if (typeof options.tokens === 'boolean' && options.tokens) {
+ extra.tokens = [];
+ }
+ if (typeof options.comment === 'boolean' && options.comment) {
+ extra.comments = [];
+ }
+ if (typeof options.tolerant === 'boolean' && options.tolerant) {
+ extra.errors = [];
+ }
+ if (extra.attachComment) {
+ extra.range = true;
+ extra.comments = [];
+ extra.bottomRightStack = [];
+ extra.trailingComments = [];
+ extra.leadingComments = [];
+ }
+ }
+
+ try {
+ program = parseProgram();
+ if (typeof extra.comments !== 'undefined') {
+ program.comments = extra.comments;
+ }
+ if (typeof extra.tokens !== 'undefined') {
+ filterTokenLocation();
+ program.tokens = extra.tokens;
+ }
+ if (typeof extra.errors !== 'undefined') {
+ program.errors = extra.errors;
+ }
+ } catch (e) {
+ throw e;
+ } finally {
+ extra = {};
+ }
+
+ return program;
+ }
+
+ // Sync with *.json manifests.
+ exports.version = '2.1.0';
+
+ exports.tokenize = tokenize;
+
+ exports.parse = parse;
+
+ // Deep copy.
+ /* istanbul ignore next */
+ exports.Syntax = (function () {
+ var name, types = {};
+
+ if (typeof Object.create === 'function') {
+ types = Object.create(null);
+ }
+
+ for (name in Syntax) {
+ if (Syntax.hasOwnProperty(name)) {
+ types[name] = Syntax[name];
+ }
+ }
+
+ if (typeof Object.freeze === 'function') {
+ Object.freeze(types);
+ }
+
+ return types;
+ }());
+
+}));
+/* vim: set sw=4 ts=4 et tw=80 : */
+/**
+ * @license Copyright (c) 2012-2014, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+
+/*global define, Reflect */
+
+/*
+ * xpcshell has a smaller stack on linux and windows (1MB vs 9MB on mac),
+ * and the recursive nature of esprima can cause it to overflow pretty
+ * quickly. So favor it built in Reflect parser:
+ * https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API
+ */
+define('esprimaAdapter', ['./esprima', 'env'], function (esprima, env) {
+ if (env.get() === 'xpconnect' && typeof Reflect !== 'undefined') {
+ return Reflect;
+ } else {
+ return esprima;
+ }
+});
+define('uglifyjs/consolidator', ["require", "exports", "module", "./parse-js", "./process"], function(require, exports, module) {
+/**
+ * @preserve Copyright 2012 Robert Gust-Bardon <http://robert.gust-bardon.org/>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+ * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/**
+ * @fileoverview Enhances <a href="https://github.com/mishoo/UglifyJS/"
+ * >UglifyJS</a> with consolidation of null, Boolean, and String values.
+ * <p>Also known as aliasing, this feature has been deprecated in <a href=
+ * "http://closure-compiler.googlecode.com/">the Closure Compiler</a> since its
+ * initial release, where it is unavailable from the <abbr title=
+ * "command line interface">CLI</a>. The Closure Compiler allows one to log and
+ * influence this process. In contrast, this implementation does not introduce
+ * any variable declarations in global code and derives String values from
+ * identifier names used as property accessors.</p>
+ * <p>Consolidating literals may worsen the data compression ratio when an <a
+ * href="http://tools.ietf.org/html/rfc2616#section-3.5">encoding
+ * transformation</a> is applied. For instance, <a href=
+ * "http://code.jquery.com/jquery-1.7.1.js">jQuery 1.7.1</a> takes 248235 bytes.
+ * Building it with <a href="https://github.com/mishoo/UglifyJS/tarball/v1.2.5">
+ * UglifyJS v1.2.5</a> results in 93647 bytes (37.73% of the original) which are
+ * then compressed to 33154 bytes (13.36% of the original) using <a href=
+ * "http://linux.die.net/man/1/gzip">gzip(1)</a>. Building it with the same
+ * version of UglifyJS 1.2.5 patched with the implementation of consolidation
+ * results in 80784 bytes (a decrease of 12863 bytes, i.e. 13.74%, in comparison
+ * to the aforementioned 93647 bytes) which are then compressed to 34013 bytes
+ * (an increase of 859 bytes, i.e. 2.59%, in comparison to the aforementioned
+ * 33154 bytes).</p>
+ * <p>Written in <a href="http://es5.github.com/#x4.2.2">the strict variant</a>
+ * of <a href="http://es5.github.com/">ECMA-262 5.1 Edition</a>. Encoded in <a
+ * href="http://tools.ietf.org/html/rfc3629">UTF-8</a>. Follows <a href=
+ * "http://google-styleguide.googlecode.com/svn-history/r76/trunk/javascriptguide.xml"
+ * >Revision 2.28 of the Google JavaScript Style Guide</a> (except for the
+ * discouraged use of the {@code function} tag and the {@code namespace} tag).
+ * 100% typed for the <a href=
+ * "http://closure-compiler.googlecode.com/files/compiler-20120123.tar.gz"
+ * >Closure Compiler Version 1741</a>.</p>
+ * <p>Should you find this software useful, please consider <a href=
+ * "https://paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=JZLW72X8FD4WG"
+ * >a donation</a>.</p>
+ * @author follow.me@RGustBardon (Robert Gust-Bardon)
+ * @supported Tested with:
+ * <ul>
+ * <li><a href="http://nodejs.org/dist/v0.6.10/">Node v0.6.10</a>,</li>
+ * <li><a href="https://github.com/mishoo/UglifyJS/tarball/v1.2.5">UglifyJS
+ * v1.2.5</a>.</li>
+ * </ul>
+ */
+
+/*global console:false, exports:true, module:false, require:false */
+/*jshint sub:true */
+/**
+ * Consolidates null, Boolean, and String values found inside an <abbr title=
+ * "abstract syntax tree">AST</abbr>.
+ * @param {!TSyntacticCodeUnit} oAbstractSyntaxTree An array-like object
+ * representing an <abbr title="abstract syntax tree">AST</abbr>.
+ * @return {!TSyntacticCodeUnit} An array-like object representing an <abbr
+ * title="abstract syntax tree">AST</abbr> with its null, Boolean, and
+ * String values consolidated.
+ */
+// TODO(user) Consolidation of mathematical values found in numeric literals.
+// TODO(user) Unconsolidation.
+// TODO(user) Consolidation of ECMA-262 6th Edition programs.
+// TODO(user) Rewrite in ECMA-262 6th Edition.
+exports['ast_consolidate'] = function(oAbstractSyntaxTree) {
+ 'use strict';
+ /*jshint bitwise:true, curly:true, eqeqeq:true, forin:true, immed:true,
+ latedef:true, newcap:true, noarge:true, noempty:true, nonew:true,
+ onevar:true, plusplus:true, regexp:true, undef:true, strict:true,
+ sub:false, trailing:true */
+
+ var _,
+ /**
+ * A record consisting of data about one or more source elements.
+ * @constructor
+ * @nosideeffects
+ */
+ TSourceElementsData = function() {
+ /**
+ * The category of the elements.
+ * @type {number}
+ * @see ESourceElementCategories
+ */
+ this.nCategory = ESourceElementCategories.N_OTHER;
+ /**
+ * The number of occurrences (within the elements) of each primitive
+ * value that could be consolidated.
+ * @type {!Array.<!Object.<string, number>>}
+ */
+ this.aCount = [];
+ this.aCount[EPrimaryExpressionCategories.N_IDENTIFIER_NAMES] = {};
+ this.aCount[EPrimaryExpressionCategories.N_STRING_LITERALS] = {};
+ this.aCount[EPrimaryExpressionCategories.N_NULL_AND_BOOLEAN_LITERALS] =
+ {};
+ /**
+ * Identifier names found within the elements.
+ * @type {!Array.<string>}
+ */
+ this.aIdentifiers = [];
+ /**
+ * Prefixed representation Strings of each primitive value that could be
+ * consolidated within the elements.
+ * @type {!Array.<string>}
+ */
+ this.aPrimitiveValues = [];
+ },
+ /**
+ * A record consisting of data about a primitive value that could be
+ * consolidated.
+ * @constructor
+ * @nosideeffects
+ */
+ TPrimitiveValue = function() {
+ /**
+ * The difference in the number of terminal symbols between the original
+ * source text and the one with the primitive value consolidated. If the
+ * difference is positive, the primitive value is considered worthwhile.
+ * @type {number}
+ */
+ this.nSaving = 0;
+ /**
+ * An identifier name of the variable that will be declared and assigned
+ * the primitive value if the primitive value is consolidated.
+ * @type {string}
+ */
+ this.sName = '';
+ },
+ /**
+ * A record consisting of data on what to consolidate within the range of
+ * source elements that is currently being considered.
+ * @constructor
+ * @nosideeffects
+ */
+ TSolution = function() {
+ /**
+ * An object whose keys are prefixed representation Strings of each
+ * primitive value that could be consolidated within the elements and
+ * whose values are corresponding data about those primitive values.
+ * @type {!Object.<string, {nSaving: number, sName: string}>}
+ * @see TPrimitiveValue
+ */
+ this.oPrimitiveValues = {};
+ /**
+ * The difference in the number of terminal symbols between the original
+ * source text and the one with all the worthwhile primitive values
+ * consolidated.
+ * @type {number}
+ * @see TPrimitiveValue#nSaving
+ */
+ this.nSavings = 0;
+ },
+ /**
+ * The processor of <abbr title="abstract syntax tree">AST</abbr>s found
+ * in UglifyJS.
+ * @namespace
+ * @type {!TProcessor}
+ */
+ oProcessor = (/** @type {!TProcessor} */ require('./process')),
+ /**
+ * A record consisting of a number of constants that represent the
+ * difference in the number of terminal symbols between a source text with
+ * a modified syntactic code unit and the original one.
+ * @namespace
+ * @type {!Object.<string, number>}
+ */
+ oWeights = {
+ /**
+ * The difference in the number of punctuators required by the bracket
+ * notation and the dot notation.
+ * <p><code>'[]'.length - '.'.length</code></p>
+ * @const
+ * @type {number}
+ */
+ N_PROPERTY_ACCESSOR: 1,
+ /**
+ * The number of punctuators required by a variable declaration with an
+ * initialiser.
+ * <p><code>':'.length + ';'.length</code></p>
+ * @const
+ * @type {number}
+ */
+ N_VARIABLE_DECLARATION: 2,
+ /**
+ * The number of terminal symbols required to introduce a variable
+ * statement (excluding its variable declaration list).
+ * <p><code>'var '.length</code></p>
+ * @const
+ * @type {number}
+ */
+ N_VARIABLE_STATEMENT_AFFIXATION: 4,
+ /**
+ * The number of terminal symbols needed to enclose source elements
+ * within a function call with no argument values to a function with an
+ * empty parameter list.
+ * <p><code>'(function(){}());'.length</code></p>
+ * @const
+ * @type {number}
+ */
+ N_CLOSURE: 17
+ },
+ /**
+ * Categories of primary expressions from which primitive values that
+ * could be consolidated are derivable.
+ * @namespace
+ * @enum {number}
+ */
+ EPrimaryExpressionCategories = {
+ /**
+ * Identifier names used as property accessors.
+ * @type {number}
+ */
+ N_IDENTIFIER_NAMES: 0,
+ /**
+ * String literals.
+ * @type {number}
+ */
+ N_STRING_LITERALS: 1,
+ /**
+ * Null and Boolean literals.
+ * @type {number}
+ */
+ N_NULL_AND_BOOLEAN_LITERALS: 2
+ },
+ /**
+ * Prefixes of primitive values that could be consolidated.
+ * The String values of the prefixes must have same number of characters.
+ * The prefixes must not be used in any properties defined in any version
+ * of <a href=
+ * "http://www.ecma-international.org/publications/standards/Ecma-262.htm"
+ * >ECMA-262</a>.
+ * @namespace
+ * @enum {string}
+ */
+ EValuePrefixes = {
+ /**
+ * Identifies String values.
+ * @type {string}
+ */
+ S_STRING: '#S',
+ /**
+ * Identifies null and Boolean values.
+ * @type {string}
+ */
+ S_SYMBOLIC: '#O'
+ },
+ /**
+ * Categories of source elements in terms of their appropriateness of
+ * having their primitive values consolidated.
+ * @namespace
+ * @enum {number}
+ */
+ ESourceElementCategories = {
+ /**
+ * Identifies a source element that includes the <a href=
+ * "http://es5.github.com/#x12.10">{@code with}</a> statement.
+ * @type {number}
+ */
+ N_WITH: 0,
+ /**
+ * Identifies a source element that includes the <a href=
+ * "http://es5.github.com/#x15.1.2.1">{@code eval}</a> identifier name.
+ * @type {number}
+ */
+ N_EVAL: 1,
+ /**
+ * Identifies a source element that must be excluded from the process
+ * unless its whole scope is examined.
+ * @type {number}
+ */
+ N_EXCLUDABLE: 2,
+ /**
+ * Identifies source elements not posing any problems.
+ * @type {number}
+ */
+ N_OTHER: 3
+ },
+ /**
+ * The list of literals (other than the String ones) whose primitive
+ * values can be consolidated.
+ * @const
+ * @type {!Array.<string>}
+ */
+ A_OTHER_SUBSTITUTABLE_LITERALS = [
+ 'null', // The null literal.
+ 'false', // The Boolean literal {@code false}.
+ 'true' // The Boolean literal {@code true}.
+ ];
+
+ (/**
+ * Consolidates all worthwhile primitive values in a syntactic code unit.
+ * @param {!TSyntacticCodeUnit} oSyntacticCodeUnit An array-like object
+ * representing the branch of the abstract syntax tree representing the
+ * syntactic code unit along with its scope.
+ * @see TPrimitiveValue#nSaving
+ */
+ function fExamineSyntacticCodeUnit(oSyntacticCodeUnit) {
+ var _,
+ /**
+ * Indicates whether the syntactic code unit represents global code.
+ * @type {boolean}
+ */
+ bIsGlobal = 'toplevel' === oSyntacticCodeUnit[0],
+ /**
+ * Indicates whether the whole scope is being examined.
+ * @type {boolean}
+ */
+ bIsWhollyExaminable = !bIsGlobal,
+ /**
+ * An array-like object representing source elements that constitute a
+ * syntactic code unit.
+ * @type {!TSyntacticCodeUnit}
+ */
+ oSourceElements,
+ /**
+ * A record consisting of data about the source element that is
+ * currently being examined.
+ * @type {!TSourceElementsData}
+ */
+ oSourceElementData,
+ /**
+ * The scope of the syntactic code unit.
+ * @type {!TScope}
+ */
+ oScope,
+ /**
+ * An instance of an object that allows the traversal of an <abbr
+ * title="abstract syntax tree">AST</abbr>.
+ * @type {!TWalker}
+ */
+ oWalker,
+ /**
+ * An object encompassing collections of functions used during the
+ * traversal of an <abbr title="abstract syntax tree">AST</abbr>.
+ * @namespace
+ * @type {!Object.<string, !Object.<string, function(...[*])>>}
+ */
+ oWalkers = {
+ /**
+ * A collection of functions used during the surveyance of source
+ * elements.
+ * @namespace
+ * @type {!Object.<string, function(...[*])>}
+ */
+ oSurveySourceElement: {
+ /**#nocode+*/ // JsDoc Toolkit 2.4.0 hides some of the keys.
+ /**
+ * Classifies the source element as excludable if it does not
+ * contain a {@code with} statement or the {@code eval} identifier
+ * name. Adds the identifier of the function and its formal
+ * parameters to the list of identifier names found.
+ * @param {string} sIdentifier The identifier of the function.
+ * @param {!Array.<string>} aFormalParameterList Formal parameters.
+ * @param {!TSyntacticCodeUnit} oFunctionBody Function code.
+ */
+ 'defun': function(
+ sIdentifier,
+ aFormalParameterList,
+ oFunctionBody) {
+ fClassifyAsExcludable();
+ fAddIdentifier(sIdentifier);
+ aFormalParameterList.forEach(fAddIdentifier);
+ },
+ /**
+ * Increments the count of the number of occurrences of the String
+ * value that is equivalent to the sequence of terminal symbols
+ * that constitute the encountered identifier name.
+ * @param {!TSyntacticCodeUnit} oExpression The nonterminal
+ * MemberExpression.
+ * @param {string} sIdentifierName The identifier name used as the
+ * property accessor.
+ * @return {!Array} The encountered branch of an <abbr title=
+ * "abstract syntax tree">AST</abbr> with its nonterminal
+ * MemberExpression traversed.
+ */
+ 'dot': function(oExpression, sIdentifierName) {
+ fCountPrimaryExpression(
+ EPrimaryExpressionCategories.N_IDENTIFIER_NAMES,
+ EValuePrefixes.S_STRING + sIdentifierName);
+ return ['dot', oWalker.walk(oExpression), sIdentifierName];
+ },
+ /**
+ * Adds the optional identifier of the function and its formal
+ * parameters to the list of identifier names found.
+ * @param {?string} sIdentifier The optional identifier of the
+ * function.
+ * @param {!Array.<string>} aFormalParameterList Formal parameters.
+ * @param {!TSyntacticCodeUnit} oFunctionBody Function code.
+ */
+ 'function': function(
+ sIdentifier,
+ aFormalParameterList,
+ oFunctionBody) {
+ if ('string' === typeof sIdentifier) {
+ fAddIdentifier(sIdentifier);
+ }
+ aFormalParameterList.forEach(fAddIdentifier);
+ },
+ /**
+ * Either increments the count of the number of occurrences of the
+ * encountered null or Boolean value or classifies a source element
+ * as containing the {@code eval} identifier name.
+ * @param {string} sIdentifier The identifier encountered.
+ */
+ 'name': function(sIdentifier) {
+ if (-1 !== A_OTHER_SUBSTITUTABLE_LITERALS.indexOf(sIdentifier)) {
+ fCountPrimaryExpression(
+ EPrimaryExpressionCategories.N_NULL_AND_BOOLEAN_LITERALS,
+ EValuePrefixes.S_SYMBOLIC + sIdentifier);
+ } else {
+ if ('eval' === sIdentifier) {
+ oSourceElementData.nCategory =
+ ESourceElementCategories.N_EVAL;
+ }
+ fAddIdentifier(sIdentifier);
+ }
+ },
+ /**
+ * Classifies the source element as excludable if it does not
+ * contain a {@code with} statement or the {@code eval} identifier
+ * name.
+ * @param {TSyntacticCodeUnit} oExpression The expression whose
+ * value is to be returned.
+ */
+ 'return': function(oExpression) {
+ fClassifyAsExcludable();
+ },
+ /**
+ * Increments the count of the number of occurrences of the
+ * encountered String value.
+ * @param {string} sStringValue The String value of the string
+ * literal encountered.
+ */
+ 'string': function(sStringValue) {
+ if (sStringValue.length > 0) {
+ fCountPrimaryExpression(
+ EPrimaryExpressionCategories.N_STRING_LITERALS,
+ EValuePrefixes.S_STRING + sStringValue);
+ }
+ },
+ /**
+ * Adds the identifier reserved for an exception to the list of
+ * identifier names found.
+ * @param {!TSyntacticCodeUnit} oTry A block of code in which an
+ * exception can occur.
+ * @param {Array} aCatch The identifier reserved for an exception
+ * and a block of code to handle the exception.
+ * @param {TSyntacticCodeUnit} oFinally An optional block of code
+ * to be evaluated regardless of whether an exception occurs.
+ */
+ 'try': function(oTry, aCatch, oFinally) {
+ if (Array.isArray(aCatch)) {
+ fAddIdentifier(aCatch[0]);
+ }
+ },
+ /**
+ * Classifies the source element as excludable if it does not
+ * contain a {@code with} statement or the {@code eval} identifier
+ * name. Adds the identifier of each declared variable to the list
+ * of identifier names found.
+ * @param {!Array.<!Array>} aVariableDeclarationList Variable
+ * declarations.
+ */
+ 'var': function(aVariableDeclarationList) {
+ fClassifyAsExcludable();
+ aVariableDeclarationList.forEach(fAddVariable);
+ },
+ /**
+ * Classifies a source element as containing the {@code with}
+ * statement.
+ * @param {!TSyntacticCodeUnit} oExpression An expression whose
+ * value is to be converted to a value of type Object and
+ * become the binding object of a new object environment
+ * record of a new lexical environment in which the statement
+ * is to be executed.
+ * @param {!TSyntacticCodeUnit} oStatement The statement to be
+ * executed in the augmented lexical environment.
+ * @return {!Array} An empty array to stop the traversal.
+ */
+ 'with': function(oExpression, oStatement) {
+ oSourceElementData.nCategory = ESourceElementCategories.N_WITH;
+ return [];
+ }
+ /**#nocode-*/ // JsDoc Toolkit 2.4.0 hides some of the keys.
+ },
+ /**
+ * A collection of functions used while looking for nested functions.
+ * @namespace
+ * @type {!Object.<string, function(...[*])>}
+ */
+ oExamineFunctions: {
+ /**#nocode+*/ // JsDoc Toolkit 2.4.0 hides some of the keys.
+ /**
+ * Orders an examination of a nested function declaration.
+ * @this {!TSyntacticCodeUnit} An array-like object representing
+ * the branch of an <abbr title="abstract syntax tree"
+ * >AST</abbr> representing the syntactic code unit along with
+ * its scope.
+ * @return {!Array} An empty array to stop the traversal.
+ */
+ 'defun': function() {
+ fExamineSyntacticCodeUnit(this);
+ return [];
+ },
+ /**
+ * Orders an examination of a nested function expression.
+ * @this {!TSyntacticCodeUnit} An array-like object representing
+ * the branch of an <abbr title="abstract syntax tree"
+ * >AST</abbr> representing the syntactic code unit along with
+ * its scope.
+ * @return {!Array} An empty array to stop the traversal.
+ */
+ 'function': function() {
+ fExamineSyntacticCodeUnit(this);
+ return [];
+ }
+ /**#nocode-*/ // JsDoc Toolkit 2.4.0 hides some of the keys.
+ }
+ },
+ /**
+ * Records containing data about source elements.
+ * @type {Array.<TSourceElementsData>}
+ */
+ aSourceElementsData = [],
+ /**
+ * The index (in the source text order) of the source element
+ * immediately following a <a href="http://es5.github.com/#x14.1"
+ * >Directive Prologue</a>.
+ * @type {number}
+ */
+ nAfterDirectivePrologue = 0,
+ /**
+ * The index (in the source text order) of the source element that is
+ * currently being considered.
+ * @type {number}
+ */
+ nPosition,
+ /**
+ * The index (in the source text order) of the source element that is
+ * the last element of the range of source elements that is currently
+ * being considered.
+ * @type {(undefined|number)}
+ */
+ nTo,
+ /**
+ * Initiates the traversal of a source element.
+ * @param {!TWalker} oWalker An instance of an object that allows the
+ * traversal of an abstract syntax tree.
+ * @param {!TSyntacticCodeUnit} oSourceElement A source element from
+ * which the traversal should commence.
+ * @return {function(): !TSyntacticCodeUnit} A function that is able to
+ * initiate the traversal from a given source element.
+ */
+ cContext = function(oWalker, oSourceElement) {
+ /**
+ * @return {!TSyntacticCodeUnit} A function that is able to
+ * initiate the traversal from a given source element.
+ */
+ var fLambda = function() {
+ return oWalker.walk(oSourceElement);
+ };
+
+ return fLambda;
+ },
+ /**
+ * Classifies the source element as excludable if it does not
+ * contain a {@code with} statement or the {@code eval} identifier
+ * name.
+ */
+ fClassifyAsExcludable = function() {
+ if (oSourceElementData.nCategory ===
+ ESourceElementCategories.N_OTHER) {
+ oSourceElementData.nCategory =
+ ESourceElementCategories.N_EXCLUDABLE;
+ }
+ },
+ /**
+ * Adds an identifier to the list of identifier names found.
+ * @param {string} sIdentifier The identifier to be added.
+ */
+ fAddIdentifier = function(sIdentifier) {
+ if (-1 === oSourceElementData.aIdentifiers.indexOf(sIdentifier)) {
+ oSourceElementData.aIdentifiers.push(sIdentifier);
+ }
+ },
+ /**
+ * Adds the identifier of a variable to the list of identifier names
+ * found.
+ * @param {!Array} aVariableDeclaration A variable declaration.
+ */
+ fAddVariable = function(aVariableDeclaration) {
+ fAddIdentifier(/** @type {string} */ aVariableDeclaration[0]);
+ },
+ /**
+ * Increments the count of the number of occurrences of the prefixed
+ * String representation attributed to the primary expression.
+ * @param {number} nCategory The category of the primary expression.
+ * @param {string} sName The prefixed String representation attributed
+ * to the primary expression.
+ */
+ fCountPrimaryExpression = function(nCategory, sName) {
+ if (!oSourceElementData.aCount[nCategory].hasOwnProperty(sName)) {
+ oSourceElementData.aCount[nCategory][sName] = 0;
+ if (-1 === oSourceElementData.aPrimitiveValues.indexOf(sName)) {
+ oSourceElementData.aPrimitiveValues.push(sName);
+ }
+ }
+ oSourceElementData.aCount[nCategory][sName] += 1;
+ },
+ /**
+ * Consolidates all worthwhile primitive values in a range of source
+ * elements.
+ * @param {number} nFrom The index (in the source text order) of the
+ * source element that is the first element of the range.
+ * @param {number} nTo The index (in the source text order) of the
+ * source element that is the last element of the range.
+ * @param {boolean} bEnclose Indicates whether the range should be
+ * enclosed within a function call with no argument values to a
+ * function with an empty parameter list if any primitive values
+ * are consolidated.
+ * @see TPrimitiveValue#nSaving
+ */
+ fExamineSourceElements = function(nFrom, nTo, bEnclose) {
+ var _,
+ /**
+ * The index of the last mangled name.
+ * @type {number}
+ */
+ nIndex = oScope.cname,
+ /**
+ * The index of the source element that is currently being
+ * considered.
+ * @type {number}
+ */
+ nPosition,
+ /**
+ * A collection of functions used during the consolidation of
+ * primitive values and identifier names used as property
+ * accessors.
+ * @namespace
+ * @type {!Object.<string, function(...[*])>}
+ */
+ oWalkersTransformers = {
+ /**
+ * If the String value that is equivalent to the sequence of
+ * terminal symbols that constitute the encountered identifier
+ * name is worthwhile, a syntactic conversion from the dot
+ * notation to the bracket notation ensues with that sequence
+ * being substituted by an identifier name to which the value
+ * is assigned.
+ * Applies to property accessors that use the dot notation.
+ * @param {!TSyntacticCodeUnit} oExpression The nonterminal
+ * MemberExpression.
+ * @param {string} sIdentifierName The identifier name used as
+ * the property accessor.
+ * @return {!Array} A syntactic code unit that is equivalent to
+ * the one encountered.
+ * @see TPrimitiveValue#nSaving
+ */
+ 'dot': function(oExpression, sIdentifierName) {
+ /**
+ * The prefixed String value that is equivalent to the
+ * sequence of terminal symbols that constitute the
+ * encountered identifier name.
+ * @type {string}
+ */
+ var sPrefixed = EValuePrefixes.S_STRING + sIdentifierName;
+
+ return oSolutionBest.oPrimitiveValues.hasOwnProperty(
+ sPrefixed) &&
+ oSolutionBest.oPrimitiveValues[sPrefixed].nSaving > 0 ?
+ ['sub',
+ oWalker.walk(oExpression),
+ ['name',
+ oSolutionBest.oPrimitiveValues[sPrefixed].sName]] :
+ ['dot', oWalker.walk(oExpression), sIdentifierName];
+ },
+ /**
+ * If the encountered identifier is a null or Boolean literal
+ * and its value is worthwhile, the identifier is substituted
+ * by an identifier name to which that value is assigned.
+ * Applies to identifier names.
+ * @param {string} sIdentifier The identifier encountered.
+ * @return {!Array} A syntactic code unit that is equivalent to
+ * the one encountered.
+ * @see TPrimitiveValue#nSaving
+ */
+ 'name': function(sIdentifier) {
+ /**
+ * The prefixed representation String of the identifier.
+ * @type {string}
+ */
+ var sPrefixed = EValuePrefixes.S_SYMBOLIC + sIdentifier;
+
+ return [
+ 'name',
+ oSolutionBest.oPrimitiveValues.hasOwnProperty(sPrefixed) &&
+ oSolutionBest.oPrimitiveValues[sPrefixed].nSaving > 0 ?
+ oSolutionBest.oPrimitiveValues[sPrefixed].sName :
+ sIdentifier
+ ];
+ },
+ /**
+ * If the encountered String value is worthwhile, it is
+ * substituted by an identifier name to which that value is
+ * assigned.
+ * Applies to String values.
+ * @param {string} sStringValue The String value of the string
+ * literal encountered.
+ * @return {!Array} A syntactic code unit that is equivalent to
+ * the one encountered.
+ * @see TPrimitiveValue#nSaving
+ */
+ 'string': function(sStringValue) {
+ /**
+ * The prefixed representation String of the primitive value
+ * of the literal.
+ * @type {string}
+ */
+ var sPrefixed =
+ EValuePrefixes.S_STRING + sStringValue;
+
+ return oSolutionBest.oPrimitiveValues.hasOwnProperty(
+ sPrefixed) &&
+ oSolutionBest.oPrimitiveValues[sPrefixed].nSaving > 0 ?
+ ['name',
+ oSolutionBest.oPrimitiveValues[sPrefixed].sName] :
+ ['string', sStringValue];
+ }
+ },
+ /**
+ * Such data on what to consolidate within the range of source
+ * elements that is currently being considered that lead to the
+ * greatest known reduction of the number of the terminal symbols
+ * in comparison to the original source text.
+ * @type {!TSolution}
+ */
+ oSolutionBest = new TSolution(),
+ /**
+ * Data representing an ongoing attempt to find a better
+ * reduction of the number of the terminal symbols in comparison
+ * to the original source text than the best one that is
+ * currently known.
+ * @type {!TSolution}
+ * @see oSolutionBest
+ */
+ oSolutionCandidate = new TSolution(),
+ /**
+ * A record consisting of data about the range of source elements
+ * that is currently being examined.
+ * @type {!TSourceElementsData}
+ */
+ oSourceElementsData = new TSourceElementsData(),
+ /**
+ * Variable declarations for each primitive value that is to be
+ * consolidated within the elements.
+ * @type {!Array.<!Array>}
+ */
+ aVariableDeclarations = [],
+ /**
+ * Augments a list with a prefixed representation String.
+ * @param {!Array.<string>} aList A list that is to be augmented.
+ * @return {function(string)} A function that augments a list
+ * with a prefixed representation String.
+ */
+ cAugmentList = function(aList) {
+ /**
+ * @param {string} sPrefixed Prefixed representation String of
+ * a primitive value that could be consolidated within the
+ * elements.
+ */
+ var fLambda = function(sPrefixed) {
+ if (-1 === aList.indexOf(sPrefixed)) {
+ aList.push(sPrefixed);
+ }
+ };
+
+ return fLambda;
+ },
+ /**
+ * Adds the number of occurrences of a primitive value of a given
+ * category that could be consolidated in the source element with
+ * a given index to the count of occurrences of that primitive
+ * value within the range of source elements that is currently
+ * being considered.
+ * @param {number} nPosition The index (in the source text order)
+ * of a source element.
+ * @param {number} nCategory The category of the primary
+ * expression from which the primitive value is derived.
+ * @return {function(string)} A function that performs the
+ * addition.
+ * @see cAddOccurrencesInCategory
+ */
+ cAddOccurrences = function(nPosition, nCategory) {
+ /**
+ * @param {string} sPrefixed The prefixed representation String
+ * of a primitive value.
+ */
+ var fLambda = function(sPrefixed) {
+ if (!oSourceElementsData.aCount[nCategory].hasOwnProperty(
+ sPrefixed)) {
+ oSourceElementsData.aCount[nCategory][sPrefixed] = 0;
+ }
+ oSourceElementsData.aCount[nCategory][sPrefixed] +=
+ aSourceElementsData[nPosition].aCount[nCategory][
+ sPrefixed];
+ };
+
+ return fLambda;
+ },
+ /**
+ * Adds the number of occurrences of each primitive value of a
+ * given category that could be consolidated in the source
+ * element with a given index to the count of occurrences of that
+ * primitive values within the range of source elements that is
+ * currently being considered.
+ * @param {number} nPosition The index (in the source text order)
+ * of a source element.
+ * @return {function(number)} A function that performs the
+ * addition.
+ * @see fAddOccurrences
+ */
+ cAddOccurrencesInCategory = function(nPosition) {
+ /**
+ * @param {number} nCategory The category of the primary
+ * expression from which the primitive value is derived.
+ */
+ var fLambda = function(nCategory) {
+ Object.keys(
+ aSourceElementsData[nPosition].aCount[nCategory]
+ ).forEach(cAddOccurrences(nPosition, nCategory));
+ };
+
+ return fLambda;
+ },
+ /**
+ * Adds the number of occurrences of each primitive value that
+ * could be consolidated in the source element with a given index
+ * to the count of occurrences of that primitive values within
+ * the range of source elements that is currently being
+ * considered.
+ * @param {number} nPosition The index (in the source text order)
+ * of a source element.
+ */
+ fAddOccurrences = function(nPosition) {
+ Object.keys(aSourceElementsData[nPosition].aCount).forEach(
+ cAddOccurrencesInCategory(nPosition));
+ },
+ /**
+ * Creates a variable declaration for a primitive value if that
+ * primitive value is to be consolidated within the elements.
+ * @param {string} sPrefixed Prefixed representation String of a
+ * primitive value that could be consolidated within the
+ * elements.
+ * @see aVariableDeclarations
+ */
+ cAugmentVariableDeclarations = function(sPrefixed) {
+ if (oSolutionBest.oPrimitiveValues[sPrefixed].nSaving > 0) {
+ aVariableDeclarations.push([
+ oSolutionBest.oPrimitiveValues[sPrefixed].sName,
+ [0 === sPrefixed.indexOf(EValuePrefixes.S_SYMBOLIC) ?
+ 'name' : 'string',
+ sPrefixed.substring(EValuePrefixes.S_SYMBOLIC.length)]
+ ]);
+ }
+ },
+ /**
+ * Sorts primitive values with regard to the difference in the
+ * number of terminal symbols between the original source text
+ * and the one with those primitive values consolidated.
+ * @param {string} sPrefixed0 The prefixed representation String
+ * of the first of the two primitive values that are being
+ * compared.
+ * @param {string} sPrefixed1 The prefixed representation String
+ * of the second of the two primitive values that are being
+ * compared.
+ * @return {number}
+ * <dl>
+ * <dt>-1</dt>
+ * <dd>if the first primitive value must be placed before
+ * the other one,</dd>
+ * <dt>0</dt>
+ * <dd>if the first primitive value may be placed before
+ * the other one,</dd>
+ * <dt>1</dt>
+ * <dd>if the first primitive value must not be placed
+ * before the other one.</dd>
+ * </dl>
+ * @see TSolution.oPrimitiveValues
+ */
+ cSortPrimitiveValues = function(sPrefixed0, sPrefixed1) {
+ /**
+ * The difference between:
+ * <ol>
+ * <li>the difference in the number of terminal symbols
+ * between the original source text and the one with the
+ * first primitive value consolidated, and</li>
+ * <li>the difference in the number of terminal symbols
+ * between the original source text and the one with the
+ * second primitive value consolidated.</li>
+ * </ol>
+ * @type {number}
+ */
+ var nDifference =
+ oSolutionCandidate.oPrimitiveValues[sPrefixed0].nSaving -
+ oSolutionCandidate.oPrimitiveValues[sPrefixed1].nSaving;
+
+ return nDifference > 0 ? -1 : nDifference < 0 ? 1 : 0;
+ },
+ /**
+ * Assigns an identifier name to a primitive value and calculates
+ * whether instances of that primitive value are worth
+ * consolidating.
+ * @param {string} sPrefixed The prefixed representation String
+ * of a primitive value that is being evaluated.
+ */
+ fEvaluatePrimitiveValue = function(sPrefixed) {
+ var _,
+ /**
+ * The index of the last mangled name.
+ * @type {number}
+ */
+ nIndex,
+ /**
+ * The representation String of the primitive value that is
+ * being evaluated.
+ * @type {string}
+ */
+ sName =
+ sPrefixed.substring(EValuePrefixes.S_SYMBOLIC.length),
+ /**
+ * The number of source characters taken up by the
+ * representation String of the primitive value that is
+ * being evaluated.
+ * @type {number}
+ */
+ nLengthOriginal = sName.length,
+ /**
+ * The number of source characters taken up by the
+ * identifier name that could substitute the primitive
+ * value that is being evaluated.
+ * substituted.
+ * @type {number}
+ */
+ nLengthSubstitution,
+ /**
+ * The number of source characters taken up by by the
+ * representation String of the primitive value that is
+ * being evaluated when it is represented by a string
+ * literal.
+ * @type {number}
+ */
+ nLengthString = oProcessor.make_string(sName).length;
+
+ oSolutionCandidate.oPrimitiveValues[sPrefixed] =
+ new TPrimitiveValue();
+ do { // Find an identifier unused in this or any nested scope.
+ nIndex = oScope.cname;
+ oSolutionCandidate.oPrimitiveValues[sPrefixed].sName =
+ oScope.next_mangled();
+ } while (-1 !== oSourceElementsData.aIdentifiers.indexOf(
+ oSolutionCandidate.oPrimitiveValues[sPrefixed].sName));
+ nLengthSubstitution = oSolutionCandidate.oPrimitiveValues[
+ sPrefixed].sName.length;
+ if (0 === sPrefixed.indexOf(EValuePrefixes.S_SYMBOLIC)) {
+ // foo:null, or foo:null;
+ oSolutionCandidate.oPrimitiveValues[sPrefixed].nSaving -=
+ nLengthSubstitution + nLengthOriginal +
+ oWeights.N_VARIABLE_DECLARATION;
+ // null vs foo
+ oSolutionCandidate.oPrimitiveValues[sPrefixed].nSaving +=
+ oSourceElementsData.aCount[
+ EPrimaryExpressionCategories.
+ N_NULL_AND_BOOLEAN_LITERALS][sPrefixed] *
+ (nLengthOriginal - nLengthSubstitution);
+ } else {
+ // foo:'fromCharCode';
+ oSolutionCandidate.oPrimitiveValues[sPrefixed].nSaving -=
+ nLengthSubstitution + nLengthString +
+ oWeights.N_VARIABLE_DECLARATION;
+ // .fromCharCode vs [foo]
+ if (oSourceElementsData.aCount[
+ EPrimaryExpressionCategories.N_IDENTIFIER_NAMES
+ ].hasOwnProperty(sPrefixed)) {
+ oSolutionCandidate.oPrimitiveValues[sPrefixed].nSaving +=
+ oSourceElementsData.aCount[
+ EPrimaryExpressionCategories.N_IDENTIFIER_NAMES
+ ][sPrefixed] *
+ (nLengthOriginal - nLengthSubstitution -
+ oWeights.N_PROPERTY_ACCESSOR);
+ }
+ // 'fromCharCode' vs foo
+ if (oSourceElementsData.aCount[
+ EPrimaryExpressionCategories.N_STRING_LITERALS
+ ].hasOwnProperty(sPrefixed)) {
+ oSolutionCandidate.oPrimitiveValues[sPrefixed].nSaving +=
+ oSourceElementsData.aCount[
+ EPrimaryExpressionCategories.N_STRING_LITERALS
+ ][sPrefixed] *
+ (nLengthString - nLengthSubstitution);
+ }
+ }
+ if (oSolutionCandidate.oPrimitiveValues[sPrefixed].nSaving >
+ 0) {
+ oSolutionCandidate.nSavings +=
+ oSolutionCandidate.oPrimitiveValues[sPrefixed].nSaving;
+ } else {
+ oScope.cname = nIndex; // Free the identifier name.
+ }
+ },
+ /**
+ * Adds a variable declaration to an existing variable statement.
+ * @param {!Array} aVariableDeclaration A variable declaration
+ * with an initialiser.
+ */
+ cAddVariableDeclaration = function(aVariableDeclaration) {
+ (/** @type {!Array} */ oSourceElements[nFrom][1]).unshift(
+ aVariableDeclaration);
+ };
+
+ if (nFrom > nTo) {
+ return;
+ }
+ // If the range is a closure, reuse the closure.
+ if (nFrom === nTo &&
+ 'stat' === oSourceElements[nFrom][0] &&
+ 'call' === oSourceElements[nFrom][1][0] &&
+ 'function' === oSourceElements[nFrom][1][1][0]) {
+ fExamineSyntacticCodeUnit(oSourceElements[nFrom][1][1]);
+ return;
+ }
+ // Create a list of all derived primitive values within the range.
+ for (nPosition = nFrom; nPosition <= nTo; nPosition += 1) {
+ aSourceElementsData[nPosition].aPrimitiveValues.forEach(
+ cAugmentList(oSourceElementsData.aPrimitiveValues));
+ }
+ if (0 === oSourceElementsData.aPrimitiveValues.length) {
+ return;
+ }
+ for (nPosition = nFrom; nPosition <= nTo; nPosition += 1) {
+ // Add the number of occurrences to the total count.
+ fAddOccurrences(nPosition);
+ // Add identifiers of this or any nested scope to the list.
+ aSourceElementsData[nPosition].aIdentifiers.forEach(
+ cAugmentList(oSourceElementsData.aIdentifiers));
+ }
+ // Distribute identifier names among derived primitive values.
+ do { // If there was any progress, find a better distribution.
+ oSolutionBest = oSolutionCandidate;
+ if (Object.keys(oSolutionCandidate.oPrimitiveValues).length > 0) {
+ // Sort primitive values descending by their worthwhileness.
+ oSourceElementsData.aPrimitiveValues.sort(cSortPrimitiveValues);
+ }
+ oSolutionCandidate = new TSolution();
+ oSourceElementsData.aPrimitiveValues.forEach(
+ fEvaluatePrimitiveValue);
+ oScope.cname = nIndex;
+ } while (oSolutionCandidate.nSavings > oSolutionBest.nSavings);
+ // Take the necessity of adding a variable statement into account.
+ if ('var' !== oSourceElements[nFrom][0]) {
+ oSolutionBest.nSavings -= oWeights.N_VARIABLE_STATEMENT_AFFIXATION;
+ }
+ if (bEnclose) {
+ // Take the necessity of forming a closure into account.
+ oSolutionBest.nSavings -= oWeights.N_CLOSURE;
+ }
+ if (oSolutionBest.nSavings > 0) {
+ // Create variable declarations suitable for UglifyJS.
+ Object.keys(oSolutionBest.oPrimitiveValues).forEach(
+ cAugmentVariableDeclarations);
+ // Rewrite expressions that contain worthwhile primitive values.
+ for (nPosition = nFrom; nPosition <= nTo; nPosition += 1) {
+ oWalker = oProcessor.ast_walker();
+ oSourceElements[nPosition] =
+ oWalker.with_walkers(
+ oWalkersTransformers,
+ cContext(oWalker, oSourceElements[nPosition]));
+ }
+ if ('var' === oSourceElements[nFrom][0]) { // Reuse the statement.
+ (/** @type {!Array.<!Array>} */ aVariableDeclarations.reverse(
+ )).forEach(cAddVariableDeclaration);
+ } else { // Add a variable statement.
+ Array.prototype.splice.call(
+ oSourceElements,
+ nFrom,
+ 0,
+ ['var', aVariableDeclarations]);
+ nTo += 1;
+ }
+ if (bEnclose) {
+ // Add a closure.
+ Array.prototype.splice.call(
+ oSourceElements,
+ nFrom,
+ 0,
+ ['stat', ['call', ['function', null, [], []], []]]);
+ // Copy source elements into the closure.
+ for (nPosition = nTo + 1; nPosition > nFrom; nPosition -= 1) {
+ Array.prototype.unshift.call(
+ oSourceElements[nFrom][1][1][3],
+ oSourceElements[nPosition]);
+ }
+ // Remove source elements outside the closure.
+ Array.prototype.splice.call(
+ oSourceElements,
+ nFrom + 1,
+ nTo - nFrom + 1);
+ }
+ }
+ if (bEnclose) {
+ // Restore the availability of identifier names.
+ oScope.cname = nIndex;
+ }
+ };
+
+ oSourceElements = (/** @type {!TSyntacticCodeUnit} */
+ oSyntacticCodeUnit[bIsGlobal ? 1 : 3]);
+ if (0 === oSourceElements.length) {
+ return;
+ }
+ oScope = bIsGlobal ? oSyntacticCodeUnit.scope : oSourceElements.scope;
+ // Skip a Directive Prologue.
+ while (nAfterDirectivePrologue < oSourceElements.length &&
+ 'directive' === oSourceElements[nAfterDirectivePrologue][0]) {
+ nAfterDirectivePrologue += 1;
+ aSourceElementsData.push(null);
+ }
+ if (oSourceElements.length === nAfterDirectivePrologue) {
+ return;
+ }
+ for (nPosition = nAfterDirectivePrologue;
+ nPosition < oSourceElements.length;
+ nPosition += 1) {
+ oSourceElementData = new TSourceElementsData();
+ oWalker = oProcessor.ast_walker();
+ // Classify a source element.
+ // Find its derived primitive values and count their occurrences.
+ // Find all identifiers used (including nested scopes).
+ oWalker.with_walkers(
+ oWalkers.oSurveySourceElement,
+ cContext(oWalker, oSourceElements[nPosition]));
+ // Establish whether the scope is still wholly examinable.
+ bIsWhollyExaminable = bIsWhollyExaminable &&
+ ESourceElementCategories.N_WITH !== oSourceElementData.nCategory &&
+ ESourceElementCategories.N_EVAL !== oSourceElementData.nCategory;
+ aSourceElementsData.push(oSourceElementData);
+ }
+ if (bIsWhollyExaminable) { // Examine the whole scope.
+ fExamineSourceElements(
+ nAfterDirectivePrologue,
+ oSourceElements.length - 1,
+ false);
+ } else { // Examine unexcluded ranges of source elements.
+ for (nPosition = oSourceElements.length - 1;
+ nPosition >= nAfterDirectivePrologue;
+ nPosition -= 1) {
+ oSourceElementData = (/** @type {!TSourceElementsData} */
+ aSourceElementsData[nPosition]);
+ if (ESourceElementCategories.N_OTHER ===
+ oSourceElementData.nCategory) {
+ if ('undefined' === typeof nTo) {
+ nTo = nPosition; // Indicate the end of a range.
+ }
+ // Examine the range if it immediately follows a Directive Prologue.
+ if (nPosition === nAfterDirectivePrologue) {
+ fExamineSourceElements(nPosition, nTo, true);
+ }
+ } else {
+ if ('undefined' !== typeof nTo) {
+ // Examine the range that immediately follows this source element.
+ fExamineSourceElements(nPosition + 1, nTo, true);
+ nTo = void 0; // Obliterate the range.
+ }
+ // Examine nested functions.
+ oWalker = oProcessor.ast_walker();
+ oWalker.with_walkers(
+ oWalkers.oExamineFunctions,
+ cContext(oWalker, oSourceElements[nPosition]));
+ }
+ }
+ }
+ }(oAbstractSyntaxTree = oProcessor.ast_add_scope(oAbstractSyntaxTree)));
+ return oAbstractSyntaxTree;
+};
+/*jshint sub:false */
+
+/* Local Variables: */
+/* mode: js */
+/* coding: utf-8 */
+/* indent-tabs-mode: nil */
+/* tab-width: 2 */
+/* End: */
+/* vim: set ft=javascript fenc=utf-8 et ts=2 sts=2 sw=2: */
+/* :mode=javascript:noTabs=true:tabSize=2:indentSize=2:deepIndent=true: */
+});
+define('uglifyjs/parse-js', ["exports"], function(exports) {
+/***********************************************************************
+
+ A JavaScript tokenizer / parser / beautifier / compressor.
+
+ This version is suitable for Node.js. With minimal changes (the
+ exports stuff) it should work on any JS platform.
+
+ This file contains the tokenizer/parser. It is a port to JavaScript
+ of parse-js [1], a JavaScript parser library written in Common Lisp
+ by Marijn Haverbeke. Thank you Marijn!
+
+ [1] http://marijn.haverbeke.nl/parse-js/
+
+ Exported functions:
+
+ - tokenizer(code) -- returns a function. Call the returned
+ function to fetch the next token.
+
+ - parse(code) -- returns an AST of the given JavaScript code.
+
+ -------------------------------- (C) ---------------------------------
+
+ Author: Mihai Bazon
+ <mihai.bazon@gmail.com>
+ http://mihai.bazon.net/blog
+
+ Distributed under the BSD license:
+
+ Copyright 2010 (c) Mihai Bazon <mihai.bazon@gmail.com>
+ Based on parse-js (http://marijn.haverbeke.nl/parse-js/).
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ * Redistributions of source code must retain the above
+ copyright notice, this list of conditions and the following
+ disclaimer.
+
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials
+ provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+ THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+
+ ***********************************************************************/
+
+/* -----[ Tokenizer (constants) ]----- */
+
+var KEYWORDS = array_to_hash([
+ "break",
+ "case",
+ "catch",
+ "const",
+ "continue",
+ "debugger",
+ "default",
+ "delete",
+ "do",
+ "else",
+ "finally",
+ "for",
+ "function",
+ "if",
+ "in",
+ "instanceof",
+ "new",
+ "return",
+ "switch",
+ "throw",
+ "try",
+ "typeof",
+ "var",
+ "void",
+ "while",
+ "with"
+]);
+
+var RESERVED_WORDS = array_to_hash([
+ "abstract",
+ "boolean",
+ "byte",
+ "char",
+ "class",
+ "double",
+ "enum",
+ "export",
+ "extends",
+ "final",
+ "float",
+ "goto",
+ "implements",
+ "import",
+ "int",
+ "interface",
+ "long",
+ "native",
+ "package",
+ "private",
+ "protected",
+ "public",
+ "short",
+ "static",
+ "super",
+ "synchronized",
+ "throws",
+ "transient",
+ "volatile"
+]);
+
+var KEYWORDS_BEFORE_EXPRESSION = array_to_hash([
+ "return",
+ "new",
+ "delete",
+ "throw",
+ "else",
+ "case"
+]);
+
+var KEYWORDS_ATOM = array_to_hash([
+ "false",
+ "null",
+ "true",
+ "undefined"
+]);
+
+var OPERATOR_CHARS = array_to_hash(characters("+-*&%=<>!?|~^"));
+
+var RE_HEX_NUMBER = /^0x[0-9a-f]+$/i;
+var RE_OCT_NUMBER = /^0[0-7]+$/;
+var RE_DEC_NUMBER = /^\d*\.?\d*(?:e[+-]?\d*(?:\d\.?|\.?\d)\d*)?$/i;
+
+var OPERATORS = array_to_hash([
+ "in",
+ "instanceof",
+ "typeof",
+ "new",
+ "void",
+ "delete",
+ "++",
+ "--",
+ "+",
+ "-",
+ "!",
+ "~",
+ "&",
+ "|",
+ "^",
+ "*",
+ "/",
+ "%",
+ ">>",
+ "<<",
+ ">>>",
+ "<",
+ ">",
+ "<=",
+ ">=",
+ "==",
+ "===",
+ "!=",
+ "!==",
+ "?",
+ "=",
+ "+=",
+ "-=",
+ "/=",
+ "*=",
+ "%=",
+ ">>=",
+ "<<=",
+ ">>>=",
+ "|=",
+ "^=",
+ "&=",
+ "&&",
+ "||"
+]);
+
+var WHITESPACE_CHARS = array_to_hash(characters(" \u00a0\n\r\t\f\u000b\u200b\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\uFEFF"));
+
+var PUNC_BEFORE_EXPRESSION = array_to_hash(characters("[{(,.;:"));
+
+var PUNC_CHARS = array_to_hash(characters("[]{}(),;:"));
+
+var REGEXP_MODIFIERS = array_to_hash(characters("gmsiy"));
+
+/* -----[ Tokenizer ]----- */
+
+var UNICODE = { // Unicode 6.1
+ letter: new RegExp("[\\u0041-\\u005A\\u0061-\\u007A\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0\\u08A2-\\u08AC\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F0\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191C\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA697\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA793\\uA7A0-\\uA7AA\\uA7F8-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA80-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),
+ combining_mark: new RegExp("[\\u0300-\\u036F\\u0483-\\u0487\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u065F\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u08E4-\\u08FE\\u0900-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B62\\u0B63\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0C01-\\u0C03\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C82\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0D02\\u0D03\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4D\\u0D57\\u0D62\\u0D63\\u0D82\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102B-\\u103E\\u1056-\\u1059\\u105E-\\u1060\\u1062-\\u1064\\u1067-\\u106D\\u1071-\\u1074\\u1082-\\u108D\\u108F\\u109A-\\u109D\\u135D-\\u135F\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u180B-\\u180D\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u19B0-\\u19C0\\u19C8\\u19C9\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60-\\u1A7C\\u1A7F\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF2-\\u1CF4\\u1DC0-\\u1DE6\\u1DFC-\\u1DFF\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA66F\\uA674-\\uA67D\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA880\\uA881\\uA8B4-\\uA8C4\\uA8E0-\\uA8F1\\uA926-\\uA92D\\uA947-\\uA953\\uA980-\\uA983\\uA9B3-\\uA9C0\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA7B\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE26]"),
+ connector_punctuation: new RegExp("[\\u005F\\u203F\\u2040\\u2054\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFF3F]"),
+ digit: new RegExp("[\\u0030-\\u0039\\u0660-\\u0669\\u06F0-\\u06F9\\u07C0-\\u07C9\\u0966-\\u096F\\u09E6-\\u09EF\\u0A66-\\u0A6F\\u0AE6-\\u0AEF\\u0B66-\\u0B6F\\u0BE6-\\u0BEF\\u0C66-\\u0C6F\\u0CE6-\\u0CEF\\u0D66-\\u0D6F\\u0E50-\\u0E59\\u0ED0-\\u0ED9\\u0F20-\\u0F29\\u1040-\\u1049\\u1090-\\u1099\\u17E0-\\u17E9\\u1810-\\u1819\\u1946-\\u194F\\u19D0-\\u19D9\\u1A80-\\u1A89\\u1A90-\\u1A99\\u1B50-\\u1B59\\u1BB0-\\u1BB9\\u1C40-\\u1C49\\u1C50-\\u1C59\\uA620-\\uA629\\uA8D0-\\uA8D9\\uA900-\\uA909\\uA9D0-\\uA9D9\\uAA50-\\uAA59\\uABF0-\\uABF9\\uFF10-\\uFF19]")
+};
+
+function is_letter(ch) {
+ return UNICODE.letter.test(ch);
+};
+
+function is_digit(ch) {
+ ch = ch.charCodeAt(0);
+ return ch >= 48 && ch <= 57;
+};
+
+function is_unicode_digit(ch) {
+ return UNICODE.digit.test(ch);
+}
+
+function is_alphanumeric_char(ch) {
+ return is_digit(ch) || is_letter(ch);
+};
+
+function is_unicode_combining_mark(ch) {
+ return UNICODE.combining_mark.test(ch);
+};
+
+function is_unicode_connector_punctuation(ch) {
+ return UNICODE.connector_punctuation.test(ch);
+};
+
+function is_identifier_start(ch) {
+ return ch == "$" || ch == "_" || is_letter(ch);
+};
+
+function is_identifier_char(ch) {
+ return is_identifier_start(ch)
+ || is_unicode_combining_mark(ch)
+ || is_unicode_digit(ch)
+ || is_unicode_connector_punctuation(ch)
+ || ch == "\u200c" // zero-width non-joiner <ZWNJ>
+ || ch == "\u200d" // zero-width joiner <ZWJ> (in my ECMA-262 PDF, this is also 200c)
+ ;
+};
+
+function parse_js_number(num) {
+ if (RE_HEX_NUMBER.test(num)) {
+ return parseInt(num.substr(2), 16);
+ } else if (RE_OCT_NUMBER.test(num)) {
+ return parseInt(num.substr(1), 8);
+ } else if (RE_DEC_NUMBER.test(num)) {
+ return parseFloat(num);
+ }
+};
+
+function JS_Parse_Error(message, line, col, pos) {
+ this.message = message;
+ this.line = line + 1;
+ this.col = col + 1;
+ this.pos = pos + 1;
+ this.stack = new Error().stack;
+};
+
+JS_Parse_Error.prototype.toString = function() {
+ return this.message + " (line: " + this.line + ", col: " + this.col + ", pos: " + this.pos + ")" + "\n\n" + this.stack;
+};
+
+function js_error(message, line, col, pos) {
+ throw new JS_Parse_Error(message, line, col, pos);
+};
+
+function is_token(token, type, val) {
+ return token.type == type && (val == null || token.value == val);
+};
+
+var EX_EOF = {};
+
+function tokenizer($TEXT) {
+
+ var S = {
+ text : $TEXT.replace(/\r\n?|[\n\u2028\u2029]/g, "\n").replace(/^\uFEFF/, ''),
+ pos : 0,
+ tokpos : 0,
+ line : 0,
+ tokline : 0,
+ col : 0,
+ tokcol : 0,
+ newline_before : false,
+ regex_allowed : false,
+ comments_before : []
+ };
+
+ function peek() { return S.text.charAt(S.pos); };
+
+ function next(signal_eof, in_string) {
+ var ch = S.text.charAt(S.pos++);
+ if (signal_eof && !ch)
+ throw EX_EOF;
+ if (ch == "\n") {
+ S.newline_before = S.newline_before || !in_string;
+ ++S.line;
+ S.col = 0;
+ } else {
+ ++S.col;
+ }
+ return ch;
+ };
+
+ function eof() {
+ return !S.peek();
+ };
+
+ function find(what, signal_eof) {
+ var pos = S.text.indexOf(what, S.pos);
+ if (signal_eof && pos == -1) throw EX_EOF;
+ return pos;
+ };
+
+ function start_token() {
+ S.tokline = S.line;
+ S.tokcol = S.col;
+ S.tokpos = S.pos;
+ };
+
+ function token(type, value, is_comment) {
+ S.regex_allowed = ((type == "operator" && !HOP(UNARY_POSTFIX, value)) ||
+ (type == "keyword" && HOP(KEYWORDS_BEFORE_EXPRESSION, value)) ||
+ (type == "punc" && HOP(PUNC_BEFORE_EXPRESSION, value)));
+ var ret = {
+ type : type,
+ value : value,
+ line : S.tokline,
+ col : S.tokcol,
+ pos : S.tokpos,
+ endpos : S.pos,
+ nlb : S.newline_before
+ };
+ if (!is_comment) {
+ ret.comments_before = S.comments_before;
+ S.comments_before = [];
+ // make note of any newlines in the comments that came before
+ for (var i = 0, len = ret.comments_before.length; i < len; i++) {
+ ret.nlb = ret.nlb || ret.comments_before[i].nlb;
+ }
+ }
+ S.newline_before = false;
+ return ret;
+ };
+
+ function skip_whitespace() {
+ while (HOP(WHITESPACE_CHARS, peek()))
+ next();
+ };
+
+ function read_while(pred) {
+ var ret = "", ch = peek(), i = 0;
+ while (ch && pred(ch, i++)) {
+ ret += next();
+ ch = peek();
+ }
+ return ret;
+ };
+
+ function parse_error(err) {
+ js_error(err, S.tokline, S.tokcol, S.tokpos);
+ };
+
+ function read_num(prefix) {
+ var has_e = false, after_e = false, has_x = false, has_dot = prefix == ".";
+ var num = read_while(function(ch, i){
+ if (ch == "x" || ch == "X") {
+ if (has_x) return false;
+ return has_x = true;
+ }
+ if (!has_x && (ch == "E" || ch == "e")) {
+ if (has_e) return false;
+ return has_e = after_e = true;
+ }
+ if (ch == "-") {
+ if (after_e || (i == 0 && !prefix)) return true;
+ return false;
+ }
+ if (ch == "+") return after_e;
+ after_e = false;
+ if (ch == ".") {
+ if (!has_dot && !has_x && !has_e)
+ return has_dot = true;
+ return false;
+ }
+ return is_alphanumeric_char(ch);
+ });
+ if (prefix)
+ num = prefix + num;
+ var valid = parse_js_number(num);
+ if (!isNaN(valid)) {
+ return token("num", valid);
+ } else {
+ parse_error("Invalid syntax: " + num);
+ }
+ };
+
+ function read_escaped_char(in_string) {
+ var ch = next(true, in_string);
+ switch (ch) {
+ case "n" : return "\n";
+ case "r" : return "\r";
+ case "t" : return "\t";
+ case "b" : return "\b";
+ case "v" : return "\u000b";
+ case "f" : return "\f";
+ case "0" : return "\0";
+ case "x" : return String.fromCharCode(hex_bytes(2));
+ case "u" : return String.fromCharCode(hex_bytes(4));
+ case "\n": return "";
+ default : return ch;
+ }
+ };
+
+ function hex_bytes(n) {
+ var num = 0;
+ for (; n > 0; --n) {
+ var digit = parseInt(next(true), 16);
+ if (isNaN(digit))
+ parse_error("Invalid hex-character pattern in string");
+ num = (num << 4) | digit;
+ }
+ return num;
+ };
+
+ function read_string() {
+ return with_eof_error("Unterminated string constant", function(){
+ var quote = next(), ret = "";
+ for (;;) {
+ var ch = next(true);
+ if (ch == "\\") {
+ // read OctalEscapeSequence (XXX: deprecated if "strict mode")
+ // https://github.com/mishoo/UglifyJS/issues/178
+ var octal_len = 0, first = null;
+ ch = read_while(function(ch){
+ if (ch >= "0" && ch <= "7") {
+ if (!first) {
+ first = ch;
+ return ++octal_len;
+ }
+ else if (first <= "3" && octal_len <= 2) return ++octal_len;
+ else if (first >= "4" && octal_len <= 1) return ++octal_len;
+ }
+ return false;
+ });
+ if (octal_len > 0) ch = String.fromCharCode(parseInt(ch, 8));
+ else ch = read_escaped_char(true);
+ }
+ else if (ch == quote) break;
+ else if (ch == "\n") throw EX_EOF;
+ ret += ch;
+ }
+ return token("string", ret);
+ });
+ };
+
+ function read_line_comment() {
+ next();
+ var i = find("\n"), ret;
+ if (i == -1) {
+ ret = S.text.substr(S.pos);
+ S.pos = S.text.length;
+ } else {
+ ret = S.text.substring(S.pos, i);
+ S.pos = i;
+ }
+ return token("comment1", ret, true);
+ };
+
+ function read_multiline_comment() {
+ next();
+ return with_eof_error("Unterminated multiline comment", function(){
+ var i = find("*/", true),
+ text = S.text.substring(S.pos, i);
+ S.pos = i + 2;
+ S.line += text.split("\n").length - 1;
+ S.newline_before = S.newline_before || text.indexOf("\n") >= 0;
+
+ // https://github.com/mishoo/UglifyJS/issues/#issue/100
+ if (/^@cc_on/i.test(text)) {
+ warn("WARNING: at line " + S.line);
+ warn("*** Found \"conditional comment\": " + text);
+ warn("*** UglifyJS DISCARDS ALL COMMENTS. This means your code might no longer work properly in Internet Explorer.");
+ }
+
+ return token("comment2", text, true);
+ });
+ };
+
+ function read_name() {
+ var backslash = false, name = "", ch, escaped = false, hex;
+ while ((ch = peek()) != null) {
+ if (!backslash) {
+ if (ch == "\\") escaped = backslash = true, next();
+ else if (is_identifier_char(ch)) name += next();
+ else break;
+ }
+ else {
+ if (ch != "u") parse_error("Expecting UnicodeEscapeSequence -- uXXXX");
+ ch = read_escaped_char();
+ if (!is_identifier_char(ch)) parse_error("Unicode char: " + ch.charCodeAt(0) + " is not valid in identifier");
+ name += ch;
+ backslash = false;
+ }
+ }
+ if (HOP(KEYWORDS, name) && escaped) {
+ hex = name.charCodeAt(0).toString(16).toUpperCase();
+ name = "\\u" + "0000".substr(hex.length) + hex + name.slice(1);
+ }
+ return name;
+ };
+
+ function read_regexp(regexp) {
+ return with_eof_error("Unterminated regular expression", function(){
+ var prev_backslash = false, ch, in_class = false;
+ while ((ch = next(true))) if (prev_backslash) {
+ regexp += "\\" + ch;
+ prev_backslash = false;
+ } else if (ch == "[") {
+ in_class = true;
+ regexp += ch;
+ } else if (ch == "]" && in_class) {
+ in_class = false;
+ regexp += ch;
+ } else if (ch == "/" && !in_class) {
+ break;
+ } else if (ch == "\\") {
+ prev_backslash = true;
+ } else {
+ regexp += ch;
+ }
+ var mods = read_name();
+ return token("regexp", [ regexp, mods ]);
+ });
+ };
+
+ function read_operator(prefix) {
+ function grow(op) {
+ if (!peek()) return op;
+ var bigger = op + peek();
+ if (HOP(OPERATORS, bigger)) {
+ next();
+ return grow(bigger);
+ } else {
+ return op;
+ }
+ };
+ return token("operator", grow(prefix || next()));
+ };
+
+ function handle_slash() {
+ next();
+ var regex_allowed = S.regex_allowed;
+ switch (peek()) {
+ case "/":
+ S.comments_before.push(read_line_comment());
+ S.regex_allowed = regex_allowed;
+ return next_token();
+ case "*":
+ S.comments_before.push(read_multiline_comment());
+ S.regex_allowed = regex_allowed;
+ return next_token();
+ }
+ return S.regex_allowed ? read_regexp("") : read_operator("/");
+ };
+
+ function handle_dot() {
+ next();
+ return is_digit(peek())
+ ? read_num(".")
+ : token("punc", ".");
+ };
+
+ function read_word() {
+ var word = read_name();
+ return !HOP(KEYWORDS, word)
+ ? token("name", word)
+ : HOP(OPERATORS, word)
+ ? token("operator", word)
+ : HOP(KEYWORDS_ATOM, word)
+ ? token("atom", word)
+ : token("keyword", word);
+ };
+
+ function with_eof_error(eof_error, cont) {
+ try {
+ return cont();
+ } catch(ex) {
+ if (ex === EX_EOF) parse_error(eof_error);
+ else throw ex;
+ }
+ };
+
+ function next_token(force_regexp) {
+ if (force_regexp != null)
+ return read_regexp(force_regexp);
+ skip_whitespace();
+ start_token();
+ var ch = peek();
+ if (!ch) return token("eof");
+ if (is_digit(ch)) return read_num();
+ if (ch == '"' || ch == "'") return read_string();
+ if (HOP(PUNC_CHARS, ch)) return token("punc", next());
+ if (ch == ".") return handle_dot();
+ if (ch == "/") return handle_slash();
+ if (HOP(OPERATOR_CHARS, ch)) return read_operator();
+ if (ch == "\\" || is_identifier_start(ch)) return read_word();
+ parse_error("Unexpected character '" + ch + "'");
+ };
+
+ next_token.context = function(nc) {
+ if (nc) S = nc;
+ return S;
+ };
+
+ return next_token;
+
+};
+
+/* -----[ Parser (constants) ]----- */
+
+var UNARY_PREFIX = array_to_hash([
+ "typeof",
+ "void",
+ "delete",
+ "--",
+ "++",
+ "!",
+ "~",
+ "-",
+ "+"
+]);
+
+var UNARY_POSTFIX = array_to_hash([ "--", "++" ]);
+
+var ASSIGNMENT = (function(a, ret, i){
+ while (i < a.length) {
+ ret[a[i]] = a[i].substr(0, a[i].length - 1);
+ i++;
+ }
+ return ret;
+})(
+ ["+=", "-=", "/=", "*=", "%=", ">>=", "<<=", ">>>=", "|=", "^=", "&="],
+ { "=": true },
+ 0
+);
+
+var PRECEDENCE = (function(a, ret){
+ for (var i = 0, n = 1; i < a.length; ++i, ++n) {
+ var b = a[i];
+ for (var j = 0; j < b.length; ++j) {
+ ret[b[j]] = n;
+ }
+ }
+ return ret;
+})(
+ [
+ ["||"],
+ ["&&"],
+ ["|"],
+ ["^"],
+ ["&"],
+ ["==", "===", "!=", "!=="],
+ ["<", ">", "<=", ">=", "in", "instanceof"],
+ [">>", "<<", ">>>"],
+ ["+", "-"],
+ ["*", "/", "%"]
+ ],
+ {}
+);
+
+var STATEMENTS_WITH_LABELS = array_to_hash([ "for", "do", "while", "switch" ]);
+
+var ATOMIC_START_TOKEN = array_to_hash([ "atom", "num", "string", "regexp", "name" ]);
+
+/* -----[ Parser ]----- */
+
+function NodeWithToken(str, start, end) {
+ this.name = str;
+ this.start = start;
+ this.end = end;
+};
+
+NodeWithToken.prototype.toString = function() { return this.name; };
+
+function parse($TEXT, exigent_mode, embed_tokens) {
+
+ var S = {
+ input : typeof $TEXT == "string" ? tokenizer($TEXT, true) : $TEXT,
+ token : null,
+ prev : null,
+ peeked : null,
+ in_function : 0,
+ in_directives : true,
+ in_loop : 0,
+ labels : []
+ };
+
+ S.token = next();
+
+ function is(type, value) {
+ return is_token(S.token, type, value);
+ };
+
+ function peek() { return S.peeked || (S.peeked = S.input()); };
+
+ function next() {
+ S.prev = S.token;
+ if (S.peeked) {
+ S.token = S.peeked;
+ S.peeked = null;
+ } else {
+ S.token = S.input();
+ }
+ S.in_directives = S.in_directives && (
+ S.token.type == "string" || is("punc", ";")
+ );
+ return S.token;
+ };
+
+ function prev() {
+ return S.prev;
+ };
+
+ function croak(msg, line, col, pos) {
+ var ctx = S.input.context();
+ js_error(msg,
+ line != null ? line : ctx.tokline,
+ col != null ? col : ctx.tokcol,
+ pos != null ? pos : ctx.tokpos);
+ };
+
+ function token_error(token, msg) {
+ croak(msg, token.line, token.col);
+ };
+
+ function unexpected(token) {
+ if (token == null)
+ token = S.token;
+ token_error(token, "Unexpected token: " + token.type + " (" + token.value + ")");
+ };
+
+ function expect_token(type, val) {
+ if (is(type, val)) {
+ return next();
+ }
+ token_error(S.token, "Unexpected token " + S.token.type + ", expected " + type);
+ };
+
+ function expect(punc) { return expect_token("punc", punc); };
+
+ function can_insert_semicolon() {
+ return !exigent_mode && (
+ S.token.nlb || is("eof") || is("punc", "}")
+ );
+ };
+
+ function semicolon() {
+ if (is("punc", ";")) next();
+ else if (!can_insert_semicolon()) unexpected();
+ };
+
+ function as() {
+ return slice(arguments);
+ };
+
+ function parenthesised() {
+ expect("(");
+ var ex = expression();
+ expect(")");
+ return ex;
+ };
+
+ function add_tokens(str, start, end) {
+ return str instanceof NodeWithToken ? str : new NodeWithToken(str, start, end);
+ };
+
+ function maybe_embed_tokens(parser) {
+ if (embed_tokens) return function() {
+ var start = S.token;
+ var ast = parser.apply(this, arguments);
+ ast[0] = add_tokens(ast[0], start, prev());
+ return ast;
+ };
+ else return parser;
+ };
+
+ var statement = maybe_embed_tokens(function() {
+ if (is("operator", "/") || is("operator", "/=")) {
+ S.peeked = null;
+ S.token = S.input(S.token.value.substr(1)); // force regexp
+ }
+ switch (S.token.type) {
+ case "string":
+ var dir = S.in_directives, stat = simple_statement();
+ if (dir && stat[1][0] == "string" && !is("punc", ","))
+ return as("directive", stat[1][1]);
+ return stat;
+ case "num":
+ case "regexp":
+ case "operator":
+ case "atom":
+ return simple_statement();
+
+ case "name":
+ return is_token(peek(), "punc", ":")
+ ? labeled_statement(prog1(S.token.value, next, next))
+ : simple_statement();
+
+ case "punc":
+ switch (S.token.value) {
+ case "{":
+ return as("block", block_());
+ case "[":
+ case "(":
+ return simple_statement();
+ case ";":
+ next();
+ return as("block");
+ default:
+ unexpected();
+ }
+
+ case "keyword":
+ switch (prog1(S.token.value, next)) {
+ case "break":
+ return break_cont("break");
+
+ case "continue":
+ return break_cont("continue");
+
+ case "debugger":
+ semicolon();
+ return as("debugger");
+
+ case "do":
+ return (function(body){
+ expect_token("keyword", "while");
+ return as("do", prog1(parenthesised, semicolon), body);
+ })(in_loop(statement));
+
+ case "for":
+ return for_();
+
+ case "function":
+ return function_(true);
+
+ case "if":
+ return if_();
+
+ case "return":
+ if (S.in_function == 0)
+ croak("'return' outside of function");
+ return as("return",
+ is("punc", ";")
+ ? (next(), null)
+ : can_insert_semicolon()
+ ? null
+ : prog1(expression, semicolon));
+
+ case "switch":
+ return as("switch", parenthesised(), switch_block_());
+
+ case "throw":
+ if (S.token.nlb)
+ croak("Illegal newline after 'throw'");
+ return as("throw", prog1(expression, semicolon));
+
+ case "try":
+ return try_();
+
+ case "var":
+ return prog1(var_, semicolon);
+
+ case "const":
+ return prog1(const_, semicolon);
+
+ case "while":
+ return as("while", parenthesised(), in_loop(statement));
+
+ case "with":
+ return as("with", parenthesised(), statement());
+
+ default:
+ unexpected();
+ }
+ }
+ });
+
+ function labeled_statement(label) {
+ S.labels.push(label);
+ var start = S.token, stat = statement();
+ if (exigent_mode && !HOP(STATEMENTS_WITH_LABELS, stat[0]))
+ unexpected(start);
+ S.labels.pop();
+ return as("label", label, stat);
+ };
+
+ function simple_statement() {
+ return as("stat", prog1(expression, semicolon));
+ };
+
+ function break_cont(type) {
+ var name;
+ if (!can_insert_semicolon()) {
+ name = is("name") ? S.token.value : null;
+ }
+ if (name != null) {
+ next();
+ if (!member(name, S.labels))
+ croak("Label " + name + " without matching loop or statement");
+ }
+ else if (S.in_loop == 0)
+ croak(type + " not inside a loop or switch");
+ semicolon();
+ return as(type, name);
+ };
+
+ function for_() {
+ expect("(");
+ var init = null;
+ if (!is("punc", ";")) {
+ init = is("keyword", "var")
+ ? (next(), var_(true))
+ : expression(true, true);
+ if (is("operator", "in")) {
+ if (init[0] == "var" && init[1].length > 1)
+ croak("Only one variable declaration allowed in for..in loop");
+ return for_in(init);
+ }
+ }
+ return regular_for(init);
+ };
+
+ function regular_for(init) {
+ expect(";");
+ var test = is("punc", ";") ? null : expression();
+ expect(";");
+ var step = is("punc", ")") ? null : expression();
+ expect(")");
+ return as("for", init, test, step, in_loop(statement));
+ };
+
+ function for_in(init) {
+ var lhs = init[0] == "var" ? as("name", init[1][0]) : init;
+ next();
+ var obj = expression();
+ expect(")");
+ return as("for-in", init, lhs, obj, in_loop(statement));
+ };
+
+ var function_ = function(in_statement) {
+ var name = is("name") ? prog1(S.token.value, next) : null;
+ if (in_statement && !name)
+ unexpected();
+ expect("(");
+ return as(in_statement ? "defun" : "function",
+ name,
+ // arguments
+ (function(first, a){
+ while (!is("punc", ")")) {
+ if (first) first = false; else expect(",");
+ if (!is("name")) unexpected();
+ a.push(S.token.value);
+ next();
+ }
+ next();
+ return a;
+ })(true, []),
+ // body
+ (function(){
+ ++S.in_function;
+ var loop = S.in_loop;
+ S.in_directives = true;
+ S.in_loop = 0;
+ var a = block_();
+ --S.in_function;
+ S.in_loop = loop;
+ return a;
+ })());
+ };
+
+ function if_() {
+ var cond = parenthesised(), body = statement(), belse;
+ if (is("keyword", "else")) {
+ next();
+ belse = statement();
+ }
+ return as("if", cond, body, belse);
+ };
+
+ function block_() {
+ expect("{");
+ var a = [];
+ while (!is("punc", "}")) {
+ if (is("eof")) unexpected();
+ a.push(statement());
+ }
+ next();
+ return a;
+ };
+
+ var switch_block_ = curry(in_loop, function(){
+ expect("{");
+ var a = [], cur = null;
+ while (!is("punc", "}")) {
+ if (is("eof")) unexpected();
+ if (is("keyword", "case")) {
+ next();
+ cur = [];
+ a.push([ expression(), cur ]);
+ expect(":");
+ }
+ else if (is("keyword", "default")) {
+ next();
+ expect(":");
+ cur = [];
+ a.push([ null, cur ]);
+ }
+ else {
+ if (!cur) unexpected();
+ cur.push(statement());
+ }
+ }
+ next();
+ return a;
+ });
+
+ function try_() {
+ var body = block_(), bcatch, bfinally;
+ if (is("keyword", "catch")) {
+ next();
+ expect("(");
+ if (!is("name"))
+ croak("Name expected");
+ var name = S.token.value;
+ next();
+ expect(")");
+ bcatch = [ name, block_() ];
+ }
+ if (is("keyword", "finally")) {
+ next();
+ bfinally = block_();
+ }
+ if (!bcatch && !bfinally)
+ croak("Missing catch/finally blocks");
+ return as("try", body, bcatch, bfinally);
+ };
+
+ function vardefs(no_in) {
+ var a = [];
+ for (;;) {
+ if (!is("name"))
+ unexpected();
+ var name = S.token.value;
+ next();
+ if (is("operator", "=")) {
+ next();
+ a.push([ name, expression(false, no_in) ]);
+ } else {
+ a.push([ name ]);
+ }
+ if (!is("punc", ","))
+ break;
+ next();
+ }
+ return a;
+ };
+
+ function var_(no_in) {
+ return as("var", vardefs(no_in));
+ };
+
+ function const_() {
+ return as("const", vardefs());
+ };
+
+ function new_() {
+ var newexp = expr_atom(false), args;
+ if (is("punc", "(")) {
+ next();
+ args = expr_list(")");
+ } else {
+ args = [];
+ }
+ return subscripts(as("new", newexp, args), true);
+ };
+
+ var expr_atom = maybe_embed_tokens(function(allow_calls) {
+ if (is("operator", "new")) {
+ next();
+ return new_();
+ }
+ if (is("punc")) {
+ switch (S.token.value) {
+ case "(":
+ next();
+ return subscripts(prog1(expression, curry(expect, ")")), allow_calls);
+ case "[":
+ next();
+ return subscripts(array_(), allow_calls);
+ case "{":
+ next();
+ return subscripts(object_(), allow_calls);
+ }
+ unexpected();
+ }
+ if (is("keyword", "function")) {
+ next();
+ return subscripts(function_(false), allow_calls);
+ }
+ if (HOP(ATOMIC_START_TOKEN, S.token.type)) {
+ var atom = S.token.type == "regexp"
+ ? as("regexp", S.token.value[0], S.token.value[1])
+ : as(S.token.type, S.token.value);
+ return subscripts(prog1(atom, next), allow_calls);
+ }
+ unexpected();
+ });
+
+ function expr_list(closing, allow_trailing_comma, allow_empty) {
+ var first = true, a = [];
+ while (!is("punc", closing)) {
+ if (first) first = false; else expect(",");
+ if (allow_trailing_comma && is("punc", closing)) break;
+ if (is("punc", ",") && allow_empty) {
+ a.push([ "atom", "undefined" ]);
+ } else {
+ a.push(expression(false));
+ }
+ }
+ next();
+ return a;
+ };
+
+ function array_() {
+ return as("array", expr_list("]", !exigent_mode, true));
+ };
+
+ function object_() {
+ var first = true, a = [];
+ while (!is("punc", "}")) {
+ if (first) first = false; else expect(",");
+ if (!exigent_mode && is("punc", "}"))
+ // allow trailing comma
+ break;
+ var type = S.token.type;
+ var name = as_property_name();
+ if (type == "name" && (name == "get" || name == "set") && !is("punc", ":")) {
+ a.push([ as_name(), function_(false), name ]);
+ } else {
+ expect(":");
+ a.push([ name, expression(false) ]);
+ }
+ }
+ next();
+ return as("object", a);
+ };
+
+ function as_property_name() {
+ switch (S.token.type) {
+ case "num":
+ case "string":
+ return prog1(S.token.value, next);
+ }
+ return as_name();
+ };
+
+ function as_name() {
+ switch (S.token.type) {
+ case "name":
+ case "operator":
+ case "keyword":
+ case "atom":
+ return prog1(S.token.value, next);
+ default:
+ unexpected();
+ }
+ };
+
+ function subscripts(expr, allow_calls) {
+ if (is("punc", ".")) {
+ next();
+ return subscripts(as("dot", expr, as_name()), allow_calls);
+ }
+ if (is("punc", "[")) {
+ next();
+ return subscripts(as("sub", expr, prog1(expression, curry(expect, "]"))), allow_calls);
+ }
+ if (allow_calls && is("punc", "(")) {
+ next();
+ return subscripts(as("call", expr, expr_list(")")), true);
+ }
+ return expr;
+ };
+
+ function maybe_unary(allow_calls) {
+ if (is("operator") && HOP(UNARY_PREFIX, S.token.value)) {
+ return make_unary("unary-prefix",
+ prog1(S.token.value, next),
+ maybe_unary(allow_calls));
+ }
+ var val = expr_atom(allow_calls);
+ while (is("operator") && HOP(UNARY_POSTFIX, S.token.value) && !S.token.nlb) {
+ val = make_unary("unary-postfix", S.token.value, val);
+ next();
+ }
+ return val;
+ };
+
+ function make_unary(tag, op, expr) {
+ if ((op == "++" || op == "--") && !is_assignable(expr))
+ croak("Invalid use of " + op + " operator");
+ return as(tag, op, expr);
+ };
+
+ function expr_op(left, min_prec, no_in) {
+ var op = is("operator") ? S.token.value : null;
+ if (op && op == "in" && no_in) op = null;
+ var prec = op != null ? PRECEDENCE[op] : null;
+ if (prec != null && prec > min_prec) {
+ next();
+ var right = expr_op(maybe_unary(true), prec, no_in);
+ return expr_op(as("binary", op, left, right), min_prec, no_in);
+ }
+ return left;
+ };
+
+ function expr_ops(no_in) {
+ return expr_op(maybe_unary(true), 0, no_in);
+ };
+
+ function maybe_conditional(no_in) {
+ var expr = expr_ops(no_in);
+ if (is("operator", "?")) {
+ next();
+ var yes = expression(false);
+ expect(":");
+ return as("conditional", expr, yes, expression(false, no_in));
+ }
+ return expr;
+ };
+
+ function is_assignable(expr) {
+ if (!exigent_mode) return true;
+ switch (expr[0]+"") {
+ case "dot":
+ case "sub":
+ case "new":
+ case "call":
+ return true;
+ case "name":
+ return expr[1] != "this";
+ }
+ };
+
+ function maybe_assign(no_in) {
+ var left = maybe_conditional(no_in), val = S.token.value;
+ if (is("operator") && HOP(ASSIGNMENT, val)) {
+ if (is_assignable(left)) {
+ next();
+ return as("assign", ASSIGNMENT[val], left, maybe_assign(no_in));
+ }
+ croak("Invalid assignment");
+ }
+ return left;
+ };
+
+ var expression = maybe_embed_tokens(function(commas, no_in) {
+ if (arguments.length == 0)
+ commas = true;
+ var expr = maybe_assign(no_in);
+ if (commas && is("punc", ",")) {
+ next();
+ return as("seq", expr, expression(true, no_in));
+ }
+ return expr;
+ });
+
+ function in_loop(cont) {
+ try {
+ ++S.in_loop;
+ return cont();
+ } finally {
+ --S.in_loop;
+ }
+ };
+
+ return as("toplevel", (function(a){
+ while (!is("eof"))
+ a.push(statement());
+ return a;
+ })([]));
+
+};
+
+/* -----[ Utilities ]----- */
+
+function curry(f) {
+ var args = slice(arguments, 1);
+ return function() { return f.apply(this, args.concat(slice(arguments))); };
+};
+
+function prog1(ret) {
+ if (ret instanceof Function)
+ ret = ret();
+ for (var i = 1, n = arguments.length; --n > 0; ++i)
+ arguments[i]();
+ return ret;
+};
+
+function array_to_hash(a) {
+ var ret = {};
+ for (var i = 0; i < a.length; ++i)
+ ret[a[i]] = true;
+ return ret;
+};
+
+function slice(a, start) {
+ return Array.prototype.slice.call(a, start || 0);
+};
+
+function characters(str) {
+ return str.split("");
+};
+
+function member(name, array) {
+ for (var i = array.length; --i >= 0;)
+ if (array[i] == name)
+ return true;
+ return false;
+};
+
+function HOP(obj, prop) {
+ return Object.prototype.hasOwnProperty.call(obj, prop);
+};
+
+var warn = function() {};
+
+/* -----[ Exports ]----- */
+
+exports.tokenizer = tokenizer;
+exports.parse = parse;
+exports.slice = slice;
+exports.curry = curry;
+exports.member = member;
+exports.array_to_hash = array_to_hash;
+exports.PRECEDENCE = PRECEDENCE;
+exports.KEYWORDS_ATOM = KEYWORDS_ATOM;
+exports.RESERVED_WORDS = RESERVED_WORDS;
+exports.KEYWORDS = KEYWORDS;
+exports.ATOMIC_START_TOKEN = ATOMIC_START_TOKEN;
+exports.OPERATORS = OPERATORS;
+exports.is_alphanumeric_char = is_alphanumeric_char;
+exports.is_identifier_start = is_identifier_start;
+exports.is_identifier_char = is_identifier_char;
+exports.set_logger = function(logger) {
+ warn = logger;
+};
+
+// Local variables:
+// js-indent-level: 4
+// End:
+});define('uglifyjs/squeeze-more', ["require", "exports", "module", "./parse-js", "./squeeze-more"], function(require, exports, module) {
+var jsp = require("./parse-js"),
+ pro = require("./process"),
+ slice = jsp.slice,
+ member = jsp.member,
+ curry = jsp.curry,
+ MAP = pro.MAP,
+ PRECEDENCE = jsp.PRECEDENCE,
+ OPERATORS = jsp.OPERATORS;
+
+function ast_squeeze_more(ast) {
+ var w = pro.ast_walker(), walk = w.walk, scope;
+ function with_scope(s, cont) {
+ var save = scope, ret;
+ scope = s;
+ ret = cont();
+ scope = save;
+ return ret;
+ };
+ function _lambda(name, args, body) {
+ return [ this[0], name, args, with_scope(body.scope, curry(MAP, body, walk)) ];
+ };
+ return w.with_walkers({
+ "toplevel": function(body) {
+ return [ this[0], with_scope(this.scope, curry(MAP, body, walk)) ];
+ },
+ "function": _lambda,
+ "defun": _lambda,
+ "new": function(ctor, args) {
+ if (ctor[0] == "name") {
+ if (ctor[1] == "Array" && !scope.has("Array")) {
+ if (args.length != 1) {
+ return [ "array", args ];
+ } else {
+ return walk([ "call", [ "name", "Array" ], args ]);
+ }
+ } else if (ctor[1] == "Object" && !scope.has("Object")) {
+ if (!args.length) {
+ return [ "object", [] ];
+ } else {
+ return walk([ "call", [ "name", "Object" ], args ]);
+ }
+ } else if ((ctor[1] == "RegExp" || ctor[1] == "Function" || ctor[1] == "Error") && !scope.has(ctor[1])) {
+ return walk([ "call", [ "name", ctor[1] ], args]);
+ }
+ }
+ },
+ "call": function(expr, args) {
+ if (expr[0] == "dot" && expr[1][0] == "string" && args.length == 1
+ && (args[0][1] > 0 && expr[2] == "substring" || expr[2] == "substr")) {
+ return [ "call", [ "dot", expr[1], "slice"], args];
+ }
+ if (expr[0] == "dot" && expr[2] == "toString" && args.length == 0) {
+ // foo.toString() ==> foo+""
+ if (expr[1][0] == "string") return expr[1];
+ return [ "binary", "+", expr[1], [ "string", "" ]];
+ }
+ if (expr[0] == "name") {
+ if (expr[1] == "Array" && args.length != 1 && !scope.has("Array")) {
+ return [ "array", args ];
+ }
+ if (expr[1] == "Object" && !args.length && !scope.has("Object")) {
+ return [ "object", [] ];
+ }
+ if (expr[1] == "String" && !scope.has("String")) {
+ return [ "binary", "+", args[0], [ "string", "" ]];
+ }
+ }
+ }
+ }, function() {
+ return walk(pro.ast_add_scope(ast));
+ });
+};
+
+exports.ast_squeeze_more = ast_squeeze_more;
+
+// Local variables:
+// js-indent-level: 4
+// End:
+});
+define('uglifyjs/process', ["require", "exports", "module", "./parse-js", "./squeeze-more"], function(require, exports, module) {
+/***********************************************************************
+
+ A JavaScript tokenizer / parser / beautifier / compressor.
+
+ This version is suitable for Node.js. With minimal changes (the
+ exports stuff) it should work on any JS platform.
+
+ This file implements some AST processors. They work on data built
+ by parse-js.
+
+ Exported functions:
+
+ - ast_mangle(ast, options) -- mangles the variable/function names
+ in the AST. Returns an AST.
+
+ - ast_squeeze(ast) -- employs various optimizations to make the
+ final generated code even smaller. Returns an AST.
+
+ - gen_code(ast, options) -- generates JS code from the AST. Pass
+ true (or an object, see the code for some options) as second
+ argument to get "pretty" (indented) code.
+
+ -------------------------------- (C) ---------------------------------
+
+ Author: Mihai Bazon
+ <mihai.bazon@gmail.com>
+ http://mihai.bazon.net/blog
+
+ Distributed under the BSD license:
+
+ Copyright 2010 (c) Mihai Bazon <mihai.bazon@gmail.com>
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ * Redistributions of source code must retain the above
+ copyright notice, this list of conditions and the following
+ disclaimer.
+
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials
+ provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+ THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+
+ ***********************************************************************/
+
+var jsp = require("./parse-js"),
+ curry = jsp.curry,
+ slice = jsp.slice,
+ member = jsp.member,
+ is_identifier_char = jsp.is_identifier_char,
+ PRECEDENCE = jsp.PRECEDENCE,
+ OPERATORS = jsp.OPERATORS;
+
+/* -----[ helper for AST traversal ]----- */
+
+function ast_walker() {
+ function _vardefs(defs) {
+ return [ this[0], MAP(defs, function(def){
+ var a = [ def[0] ];
+ if (def.length > 1)
+ a[1] = walk(def[1]);
+ return a;
+ }) ];
+ };
+ function _block(statements) {
+ var out = [ this[0] ];
+ if (statements != null)
+ out.push(MAP(statements, walk));
+ return out;
+ };
+ var walkers = {
+ "string": function(str) {
+ return [ this[0], str ];
+ },
+ "num": function(num) {
+ return [ this[0], num ];
+ },
+ "name": function(name) {
+ return [ this[0], name ];
+ },
+ "toplevel": function(statements) {
+ return [ this[0], MAP(statements, walk) ];
+ },
+ "block": _block,
+ "splice": _block,
+ "var": _vardefs,
+ "const": _vardefs,
+ "try": function(t, c, f) {
+ return [
+ this[0],
+ MAP(t, walk),
+ c != null ? [ c[0], MAP(c[1], walk) ] : null,
+ f != null ? MAP(f, walk) : null
+ ];
+ },
+ "throw": function(expr) {
+ return [ this[0], walk(expr) ];
+ },
+ "new": function(ctor, args) {
+ return [ this[0], walk(ctor), MAP(args, walk) ];
+ },
+ "switch": function(expr, body) {
+ return [ this[0], walk(expr), MAP(body, function(branch){
+ return [ branch[0] ? walk(branch[0]) : null,
+ MAP(branch[1], walk) ];
+ }) ];
+ },
+ "break": function(label) {
+ return [ this[0], label ];
+ },
+ "continue": function(label) {
+ return [ this[0], label ];
+ },
+ "conditional": function(cond, t, e) {
+ return [ this[0], walk(cond), walk(t), walk(e) ];
+ },
+ "assign": function(op, lvalue, rvalue) {
+ return [ this[0], op, walk(lvalue), walk(rvalue) ];
+ },
+ "dot": function(expr) {
+ return [ this[0], walk(expr) ].concat(slice(arguments, 1));
+ },
+ "call": function(expr, args) {
+ return [ this[0], walk(expr), MAP(args, walk) ];
+ },
+ "function": function(name, args, body) {
+ return [ this[0], name, args.slice(), MAP(body, walk) ];
+ },
+ "debugger": function() {
+ return [ this[0] ];
+ },
+ "defun": function(name, args, body) {
+ return [ this[0], name, args.slice(), MAP(body, walk) ];
+ },
+ "if": function(conditional, t, e) {
+ return [ this[0], walk(conditional), walk(t), walk(e) ];
+ },
+ "for": function(init, cond, step, block) {
+ return [ this[0], walk(init), walk(cond), walk(step), walk(block) ];
+ },
+ "for-in": function(vvar, key, hash, block) {
+ return [ this[0], walk(vvar), walk(key), walk(hash), walk(block) ];
+ },
+ "while": function(cond, block) {
+ return [ this[0], walk(cond), walk(block) ];
+ },
+ "do": function(cond, block) {
+ return [ this[0], walk(cond), walk(block) ];
+ },
+ "return": function(expr) {
+ return [ this[0], walk(expr) ];
+ },
+ "binary": function(op, left, right) {
+ return [ this[0], op, walk(left), walk(right) ];
+ },
+ "unary-prefix": function(op, expr) {
+ return [ this[0], op, walk(expr) ];
+ },
+ "unary-postfix": function(op, expr) {
+ return [ this[0], op, walk(expr) ];
+ },
+ "sub": function(expr, subscript) {
+ return [ this[0], walk(expr), walk(subscript) ];
+ },
+ "object": function(props) {
+ return [ this[0], MAP(props, function(p){
+ return p.length == 2
+ ? [ p[0], walk(p[1]) ]
+ : [ p[0], walk(p[1]), p[2] ]; // get/set-ter
+ }) ];
+ },
+ "regexp": function(rx, mods) {
+ return [ this[0], rx, mods ];
+ },
+ "array": function(elements) {
+ return [ this[0], MAP(elements, walk) ];
+ },
+ "stat": function(stat) {
+ return [ this[0], walk(stat) ];
+ },
+ "seq": function() {
+ return [ this[0] ].concat(MAP(slice(arguments), walk));
+ },
+ "label": function(name, block) {
+ return [ this[0], name, walk(block) ];
+ },
+ "with": function(expr, block) {
+ return [ this[0], walk(expr), walk(block) ];
+ },
+ "atom": function(name) {
+ return [ this[0], name ];
+ },
+ "directive": function(dir) {
+ return [ this[0], dir ];
+ }
+ };
+
+ var user = {};
+ var stack = [];
+ function walk(ast) {
+ if (ast == null)
+ return null;
+ try {
+ stack.push(ast);
+ var type = ast[0];
+ var gen = user[type];
+ if (gen) {
+ var ret = gen.apply(ast, ast.slice(1));
+ if (ret != null)
+ return ret;
+ }
+ gen = walkers[type];
+ return gen.apply(ast, ast.slice(1));
+ } finally {
+ stack.pop();
+ }
+ };
+
+ function dive(ast) {
+ if (ast == null)
+ return null;
+ try {
+ stack.push(ast);
+ return walkers[ast[0]].apply(ast, ast.slice(1));
+ } finally {
+ stack.pop();
+ }
+ };
+
+ function with_walkers(walkers, cont){
+ var save = {}, i;
+ for (i in walkers) if (HOP(walkers, i)) {
+ save[i] = user[i];
+ user[i] = walkers[i];
+ }
+ var ret = cont();
+ for (i in save) if (HOP(save, i)) {
+ if (!save[i]) delete user[i];
+ else user[i] = save[i];
+ }
+ return ret;
+ };
+
+ return {
+ walk: walk,
+ dive: dive,
+ with_walkers: with_walkers,
+ parent: function() {
+ return stack[stack.length - 2]; // last one is current node
+ },
+ stack: function() {
+ return stack;
+ }
+ };
+};
+
+/* -----[ Scope and mangling ]----- */
+
+function Scope(parent) {
+ this.names = {}; // names defined in this scope
+ this.mangled = {}; // mangled names (orig.name => mangled)
+ this.rev_mangled = {}; // reverse lookup (mangled => orig.name)
+ this.cname = -1; // current mangled name
+ this.refs = {}; // names referenced from this scope
+ this.uses_with = false; // will become TRUE if with() is detected in this or any subscopes
+ this.uses_eval = false; // will become TRUE if eval() is detected in this or any subscopes
+ this.directives = []; // directives activated from this scope
+ this.parent = parent; // parent scope
+ this.children = []; // sub-scopes
+ if (parent) {
+ this.level = parent.level + 1;
+ parent.children.push(this);
+ } else {
+ this.level = 0;
+ }
+};
+
+function base54_digits() {
+ if (typeof DIGITS_OVERRIDE_FOR_TESTING != "undefined")
+ return DIGITS_OVERRIDE_FOR_TESTING;
+ else
+ return "etnrisouaflchpdvmgybwESxTNCkLAOM_DPHBjFIqRUzWXV$JKQGYZ0516372984";
+}
+
+var base54 = (function(){
+ var DIGITS = base54_digits();
+ return function(num) {
+ var ret = "", base = 54;
+ do {
+ ret += DIGITS.charAt(num % base);
+ num = Math.floor(num / base);
+ base = 64;
+ } while (num > 0);
+ return ret;
+ };
+})();
+
+Scope.prototype = {
+ has: function(name) {
+ for (var s = this; s; s = s.parent)
+ if (HOP(s.names, name))
+ return s;
+ },
+ has_mangled: function(mname) {
+ for (var s = this; s; s = s.parent)
+ if (HOP(s.rev_mangled, mname))
+ return s;
+ },
+ toJSON: function() {
+ return {
+ names: this.names,
+ uses_eval: this.uses_eval,
+ uses_with: this.uses_with
+ };
+ },
+
+ next_mangled: function() {
+ // we must be careful that the new mangled name:
+ //
+ // 1. doesn't shadow a mangled name from a parent
+ // scope, unless we don't reference the original
+ // name from this scope OR from any sub-scopes!
+ // This will get slow.
+ //
+ // 2. doesn't shadow an original name from a parent
+ // scope, in the event that the name is not mangled
+ // in the parent scope and we reference that name
+ // here OR IN ANY SUBSCOPES!
+ //
+ // 3. doesn't shadow a name that is referenced but not
+ // defined (possibly global defined elsewhere).
+ for (;;) {
+ var m = base54(++this.cname), prior;
+
+ // case 1.
+ prior = this.has_mangled(m);
+ if (prior && this.refs[prior.rev_mangled[m]] === prior)
+ continue;
+
+ // case 2.
+ prior = this.has(m);
+ if (prior && prior !== this && this.refs[m] === prior && !prior.has_mangled(m))
+ continue;
+
+ // case 3.
+ if (HOP(this.refs, m) && this.refs[m] == null)
+ continue;
+
+ // I got "do" once. :-/
+ if (!is_identifier(m))
+ continue;
+
+ return m;
+ }
+ },
+ set_mangle: function(name, m) {
+ this.rev_mangled[m] = name;
+ return this.mangled[name] = m;
+ },
+ get_mangled: function(name, newMangle) {
+ if (this.uses_eval || this.uses_with) return name; // no mangle if eval or with is in use
+ var s = this.has(name);
+ if (!s) return name; // not in visible scope, no mangle
+ if (HOP(s.mangled, name)) return s.mangled[name]; // already mangled in this scope
+ if (!newMangle) return name; // not found and no mangling requested
+ return s.set_mangle(name, s.next_mangled());
+ },
+ references: function(name) {
+ return name && !this.parent || this.uses_with || this.uses_eval || this.refs[name];
+ },
+ define: function(name, type) {
+ if (name != null) {
+ if (type == "var" || !HOP(this.names, name))
+ this.names[name] = type || "var";
+ return name;
+ }
+ },
+ active_directive: function(dir) {
+ return member(dir, this.directives) || this.parent && this.parent.active_directive(dir);
+ }
+};
+
+function ast_add_scope(ast) {
+
+ var current_scope = null;
+ var w = ast_walker(), walk = w.walk;
+ var having_eval = [];
+
+ function with_new_scope(cont) {
+ current_scope = new Scope(current_scope);
+ current_scope.labels = new Scope();
+ var ret = current_scope.body = cont();
+ ret.scope = current_scope;
+ current_scope = current_scope.parent;
+ return ret;
+ };
+
+ function define(name, type) {
+ return current_scope.define(name, type);
+ };
+
+ function reference(name) {
+ current_scope.refs[name] = true;
+ };
+
+ function _lambda(name, args, body) {
+ var is_defun = this[0] == "defun";
+ return [ this[0], is_defun ? define(name, "defun") : name, args, with_new_scope(function(){
+ if (!is_defun) define(name, "lambda");
+ MAP(args, function(name){ define(name, "arg") });
+ return MAP(body, walk);
+ })];
+ };
+
+ function _vardefs(type) {
+ return function(defs) {
+ MAP(defs, function(d){
+ define(d[0], type);
+ if (d[1]) reference(d[0]);
+ });
+ };
+ };
+
+ function _breacont(label) {
+ if (label)
+ current_scope.labels.refs[label] = true;
+ };
+
+ return with_new_scope(function(){
+ // process AST
+ var ret = w.with_walkers({
+ "function": _lambda,
+ "defun": _lambda,
+ "label": function(name, stat) { current_scope.labels.define(name) },
+ "break": _breacont,
+ "continue": _breacont,
+ "with": function(expr, block) {
+ for (var s = current_scope; s; s = s.parent)
+ s.uses_with = true;
+ },
+ "var": _vardefs("var"),
+ "const": _vardefs("const"),
+ "try": function(t, c, f) {
+ if (c != null) return [
+ this[0],
+ MAP(t, walk),
+ [ define(c[0], "catch"), MAP(c[1], walk) ],
+ f != null ? MAP(f, walk) : null
+ ];
+ },
+ "name": function(name) {
+ if (name == "eval")
+ having_eval.push(current_scope);
+ reference(name);
+ }
+ }, function(){
+ return walk(ast);
+ });
+
+ // the reason why we need an additional pass here is
+ // that names can be used prior to their definition.
+
+ // scopes where eval was detected and their parents
+ // are marked with uses_eval, unless they define the
+ // "eval" name.
+ MAP(having_eval, function(scope){
+ if (!scope.has("eval")) while (scope) {
+ scope.uses_eval = true;
+ scope = scope.parent;
+ }
+ });
+
+ // for referenced names it might be useful to know
+ // their origin scope. current_scope here is the
+ // toplevel one.
+ function fixrefs(scope, i) {
+ // do children first; order shouldn't matter
+ for (i = scope.children.length; --i >= 0;)
+ fixrefs(scope.children[i]);
+ for (i in scope.refs) if (HOP(scope.refs, i)) {
+ // find origin scope and propagate the reference to origin
+ for (var origin = scope.has(i), s = scope; s; s = s.parent) {
+ s.refs[i] = origin;
+ if (s === origin) break;
+ }
+ }
+ };
+ fixrefs(current_scope);
+
+ return ret;
+ });
+
+};
+
+/* -----[ mangle names ]----- */
+
+function ast_mangle(ast, options) {
+ var w = ast_walker(), walk = w.walk, scope;
+ options = defaults(options, {
+ mangle : true,
+ toplevel : false,
+ defines : null,
+ except : null,
+ no_functions : false
+ });
+
+ function get_mangled(name, newMangle) {
+ if (!options.mangle) return name;
+ if (!options.toplevel && !scope.parent) return name; // don't mangle toplevel
+ if (options.except && member(name, options.except))
+ return name;
+ if (options.no_functions && HOP(scope.names, name) &&
+ (scope.names[name] == 'defun' || scope.names[name] == 'lambda'))
+ return name;
+ return scope.get_mangled(name, newMangle);
+ };
+
+ function get_define(name) {
+ if (options.defines) {
+ // we always lookup a defined symbol for the current scope FIRST, so declared
+ // vars trump a DEFINE symbol, but if no such var is found, then match a DEFINE value
+ if (!scope.has(name)) {
+ if (HOP(options.defines, name)) {
+ return options.defines[name];
+ }
+ }
+ return null;
+ }
+ };
+
+ function _lambda(name, args, body) {
+ if (!options.no_functions && options.mangle) {
+ var is_defun = this[0] == "defun", extra;
+ if (name) {
+ if (is_defun) name = get_mangled(name);
+ else if (body.scope.references(name)) {
+ extra = {};
+ if (!(scope.uses_eval || scope.uses_with))
+ name = extra[name] = scope.next_mangled();
+ else
+ extra[name] = name;
+ }
+ else name = null;
+ }
+ }
+ body = with_scope(body.scope, function(){
+ args = MAP(args, function(name){ return get_mangled(name) });
+ return MAP(body, walk);
+ }, extra);
+ return [ this[0], name, args, body ];
+ };
+
+ function with_scope(s, cont, extra) {
+ var _scope = scope;
+ scope = s;
+ if (extra) for (var i in extra) if (HOP(extra, i)) {
+ s.set_mangle(i, extra[i]);
+ }
+ for (var i in s.names) if (HOP(s.names, i)) {
+ get_mangled(i, true);
+ }
+ var ret = cont();
+ ret.scope = s;
+ scope = _scope;
+ return ret;
+ };
+
+ function _vardefs(defs) {
+ return [ this[0], MAP(defs, function(d){
+ return [ get_mangled(d[0]), walk(d[1]) ];
+ }) ];
+ };
+
+ function _breacont(label) {
+ if (label) return [ this[0], scope.labels.get_mangled(label) ];
+ };
+
+ return w.with_walkers({
+ "function": _lambda,
+ "defun": function() {
+ // move function declarations to the top when
+ // they are not in some block.
+ var ast = _lambda.apply(this, arguments);
+ switch (w.parent()[0]) {
+ case "toplevel":
+ case "function":
+ case "defun":
+ return MAP.at_top(ast);
+ }
+ return ast;
+ },
+ "label": function(label, stat) {
+ if (scope.labels.refs[label]) return [
+ this[0],
+ scope.labels.get_mangled(label, true),
+ walk(stat)
+ ];
+ return walk(stat);
+ },
+ "break": _breacont,
+ "continue": _breacont,
+ "var": _vardefs,
+ "const": _vardefs,
+ "name": function(name) {
+ return get_define(name) || [ this[0], get_mangled(name) ];
+ },
+ "try": function(t, c, f) {
+ return [ this[0],
+ MAP(t, walk),
+ c != null ? [ get_mangled(c[0]), MAP(c[1], walk) ] : null,
+ f != null ? MAP(f, walk) : null ];
+ },
+ "toplevel": function(body) {
+ var self = this;
+ return with_scope(self.scope, function(){
+ return [ self[0], MAP(body, walk) ];
+ });
+ },
+ "directive": function() {
+ return MAP.at_top(this);
+ }
+ }, function() {
+ return walk(ast_add_scope(ast));
+ });
+};
+
+/* -----[
+ - compress foo["bar"] into foo.bar,
+ - remove block brackets {} where possible
+ - join consecutive var declarations
+ - various optimizations for IFs:
+ - if (cond) foo(); else bar(); ==> cond?foo():bar();
+ - if (cond) foo(); ==> cond&&foo();
+ - if (foo) return bar(); else return baz(); ==> return foo?bar():baz(); // also for throw
+ - if (foo) return bar(); else something(); ==> {if(foo)return bar();something()}
+ ]----- */
+
+var warn = function(){};
+
+function best_of(ast1, ast2) {
+ return gen_code(ast1).length > gen_code(ast2[0] == "stat" ? ast2[1] : ast2).length ? ast2 : ast1;
+};
+
+function last_stat(b) {
+ if (b[0] == "block" && b[1] && b[1].length > 0)
+ return b[1][b[1].length - 1];
+ return b;
+}
+
+function aborts(t) {
+ if (t) switch (last_stat(t)[0]) {
+ case "return":
+ case "break":
+ case "continue":
+ case "throw":
+ return true;
+ }
+};
+
+function boolean_expr(expr) {
+ return ( (expr[0] == "unary-prefix"
+ && member(expr[1], [ "!", "delete" ])) ||
+
+ (expr[0] == "binary"
+ && member(expr[1], [ "in", "instanceof", "==", "!=", "===", "!==", "<", "<=", ">=", ">" ])) ||
+
+ (expr[0] == "binary"
+ && member(expr[1], [ "&&", "||" ])
+ && boolean_expr(expr[2])
+ && boolean_expr(expr[3])) ||
+
+ (expr[0] == "conditional"
+ && boolean_expr(expr[2])
+ && boolean_expr(expr[3])) ||
+
+ (expr[0] == "assign"
+ && expr[1] === true
+ && boolean_expr(expr[3])) ||
+
+ (expr[0] == "seq"
+ && boolean_expr(expr[expr.length - 1]))
+ );
+};
+
+function empty(b) {
+ return !b || (b[0] == "block" && (!b[1] || b[1].length == 0));
+};
+
+function is_string(node) {
+ return (node[0] == "string" ||
+ node[0] == "unary-prefix" && node[1] == "typeof" ||
+ node[0] == "binary" && node[1] == "+" &&
+ (is_string(node[2]) || is_string(node[3])));
+};
+
+var when_constant = (function(){
+
+ var $NOT_CONSTANT = {};
+
+ // this can only evaluate constant expressions. If it finds anything
+ // not constant, it throws $NOT_CONSTANT.
+ function evaluate(expr) {
+ switch (expr[0]) {
+ case "string":
+ case "num":
+ return expr[1];
+ case "name":
+ case "atom":
+ switch (expr[1]) {
+ case "true": return true;
+ case "false": return false;
+ case "null": return null;
+ }
+ break;
+ case "unary-prefix":
+ switch (expr[1]) {
+ case "!": return !evaluate(expr[2]);
+ case "typeof": return typeof evaluate(expr[2]);
+ case "~": return ~evaluate(expr[2]);
+ case "-": return -evaluate(expr[2]);
+ case "+": return +evaluate(expr[2]);
+ }
+ break;
+ case "binary":
+ var left = expr[2], right = expr[3];
+ switch (expr[1]) {
+ case "&&" : return evaluate(left) && evaluate(right);
+ case "||" : return evaluate(left) || evaluate(right);
+ case "|" : return evaluate(left) | evaluate(right);
+ case "&" : return evaluate(left) & evaluate(right);
+ case "^" : return evaluate(left) ^ evaluate(right);
+ case "+" : return evaluate(left) + evaluate(right);
+ case "*" : return evaluate(left) * evaluate(right);
+ case "/" : return evaluate(left) / evaluate(right);
+ case "%" : return evaluate(left) % evaluate(right);
+ case "-" : return evaluate(left) - evaluate(right);
+ case "<<" : return evaluate(left) << evaluate(right);
+ case ">>" : return evaluate(left) >> evaluate(right);
+ case ">>>" : return evaluate(left) >>> evaluate(right);
+ case "==" : return evaluate(left) == evaluate(right);
+ case "===" : return evaluate(left) === evaluate(right);
+ case "!=" : return evaluate(left) != evaluate(right);
+ case "!==" : return evaluate(left) !== evaluate(right);
+ case "<" : return evaluate(left) < evaluate(right);
+ case "<=" : return evaluate(left) <= evaluate(right);
+ case ">" : return evaluate(left) > evaluate(right);
+ case ">=" : return evaluate(left) >= evaluate(right);
+ case "in" : return evaluate(left) in evaluate(right);
+ case "instanceof" : return evaluate(left) instanceof evaluate(right);
+ }
+ }
+ throw $NOT_CONSTANT;
+ };
+
+ return function(expr, yes, no) {
+ try {
+ var val = evaluate(expr), ast;
+ switch (typeof val) {
+ case "string": ast = [ "string", val ]; break;
+ case "number": ast = [ "num", val ]; break;
+ case "boolean": ast = [ "name", String(val) ]; break;
+ default:
+ if (val === null) { ast = [ "atom", "null" ]; break; }
+ throw new Error("Can't handle constant of type: " + (typeof val));
+ }
+ return yes.call(expr, ast, val);
+ } catch(ex) {
+ if (ex === $NOT_CONSTANT) {
+ if (expr[0] == "binary"
+ && (expr[1] == "===" || expr[1] == "!==")
+ && ((is_string(expr[2]) && is_string(expr[3]))
+ || (boolean_expr(expr[2]) && boolean_expr(expr[3])))) {
+ expr[1] = expr[1].substr(0, 2);
+ }
+ else if (no && expr[0] == "binary"
+ && (expr[1] == "||" || expr[1] == "&&")) {
+ // the whole expression is not constant but the lval may be...
+ try {
+ var lval = evaluate(expr[2]);
+ expr = ((expr[1] == "&&" && (lval ? expr[3] : lval)) ||
+ (expr[1] == "||" && (lval ? lval : expr[3])) ||
+ expr);
+ } catch(ex2) {
+ // IGNORE... lval is not constant
+ }
+ }
+ return no ? no.call(expr, expr) : null;
+ }
+ else throw ex;
+ }
+ };
+
+})();
+
+function warn_unreachable(ast) {
+ if (!empty(ast))
+ warn("Dropping unreachable code: " + gen_code(ast, true));
+};
+
+function prepare_ifs(ast) {
+ var w = ast_walker(), walk = w.walk;
+ // In this first pass, we rewrite ifs which abort with no else with an
+ // if-else. For example:
+ //
+ // if (x) {
+ // blah();
+ // return y;
+ // }
+ // foobar();
+ //
+ // is rewritten into:
+ //
+ // if (x) {
+ // blah();
+ // return y;
+ // } else {
+ // foobar();
+ // }
+ function redo_if(statements) {
+ statements = MAP(statements, walk);
+
+ for (var i = 0; i < statements.length; ++i) {
+ var fi = statements[i];
+ if (fi[0] != "if") continue;
+
+ if (fi[3]) continue;
+
+ var t = fi[2];
+ if (!aborts(t)) continue;
+
+ var conditional = walk(fi[1]);
+
+ var e_body = redo_if(statements.slice(i + 1));
+ var e = e_body.length == 1 ? e_body[0] : [ "block", e_body ];
+
+ return statements.slice(0, i).concat([ [
+ fi[0], // "if"
+ conditional, // conditional
+ t, // then
+ e // else
+ ] ]);
+ }
+
+ return statements;
+ };
+
+ function redo_if_lambda(name, args, body) {
+ body = redo_if(body);
+ return [ this[0], name, args, body ];
+ };
+
+ function redo_if_block(statements) {
+ return [ this[0], statements != null ? redo_if(statements) : null ];
+ };
+
+ return w.with_walkers({
+ "defun": redo_if_lambda,
+ "function": redo_if_lambda,
+ "block": redo_if_block,
+ "splice": redo_if_block,
+ "toplevel": function(statements) {
+ return [ this[0], redo_if(statements) ];
+ },
+ "try": function(t, c, f) {
+ return [
+ this[0],
+ redo_if(t),
+ c != null ? [ c[0], redo_if(c[1]) ] : null,
+ f != null ? redo_if(f) : null
+ ];
+ }
+ }, function() {
+ return walk(ast);
+ });
+};
+
+function for_side_effects(ast, handler) {
+ var w = ast_walker(), walk = w.walk;
+ var $stop = {}, $restart = {};
+ function stop() { throw $stop };
+ function restart() { throw $restart };
+ function found(){ return handler.call(this, this, w, stop, restart) };
+ function unary(op) {
+ if (op == "++" || op == "--")
+ return found.apply(this, arguments);
+ };
+ function binary(op) {
+ if (op == "&&" || op == "||")
+ return found.apply(this, arguments);
+ };
+ return w.with_walkers({
+ "try": found,
+ "throw": found,
+ "return": found,
+ "new": found,
+ "switch": found,
+ "break": found,
+ "continue": found,
+ "assign": found,
+ "call": found,
+ "if": found,
+ "for": found,
+ "for-in": found,
+ "while": found,
+ "do": found,
+ "return": found,
+ "unary-prefix": unary,
+ "unary-postfix": unary,
+ "conditional": found,
+ "binary": binary,
+ "defun": found
+ }, function(){
+ while (true) try {
+ walk(ast);
+ break;
+ } catch(ex) {
+ if (ex === $stop) break;
+ if (ex === $restart) continue;
+ throw ex;
+ }
+ });
+};
+
+function ast_lift_variables(ast) {
+ var w = ast_walker(), walk = w.walk, scope;
+ function do_body(body, env) {
+ var _scope = scope;
+ scope = env;
+ body = MAP(body, walk);
+ var hash = {}, names = MAP(env.names, function(type, name){
+ if (type != "var") return MAP.skip;
+ if (!env.references(name)) return MAP.skip;
+ hash[name] = true;
+ return [ name ];
+ });
+ if (names.length > 0) {
+ // looking for assignments to any of these variables.
+ // we can save considerable space by moving the definitions
+ // in the var declaration.
+ for_side_effects([ "block", body ], function(ast, walker, stop, restart) {
+ if (ast[0] == "assign"
+ && ast[1] === true
+ && ast[2][0] == "name"
+ && HOP(hash, ast[2][1])) {
+ // insert the definition into the var declaration
+ for (var i = names.length; --i >= 0;) {
+ if (names[i][0] == ast[2][1]) {
+ if (names[i][1]) // this name already defined, we must stop
+ stop();
+ names[i][1] = ast[3]; // definition
+ names.push(names.splice(i, 1)[0]);
+ break;
+ }
+ }
+ // remove this assignment from the AST.
+ var p = walker.parent();
+ if (p[0] == "seq") {
+ var a = p[2];
+ a.unshift(0, p.length);
+ p.splice.apply(p, a);
+ }
+ else if (p[0] == "stat") {
+ p.splice(0, p.length, "block"); // empty statement
+ }
+ else {
+ stop();
+ }
+ restart();
+ }
+ stop();
+ });
+ body.unshift([ "var", names ]);
+ }
+ scope = _scope;
+ return body;
+ };
+ function _vardefs(defs) {
+ var ret = null;
+ for (var i = defs.length; --i >= 0;) {
+ var d = defs[i];
+ if (!d[1]) continue;
+ d = [ "assign", true, [ "name", d[0] ], d[1] ];
+ if (ret == null) ret = d;
+ else ret = [ "seq", d, ret ];
+ }
+ if (ret == null && w.parent()[0] != "for") {
+ if (w.parent()[0] == "for-in")
+ return [ "name", defs[0][0] ];
+ return MAP.skip;
+ }
+ return [ "stat", ret ];
+ };
+ function _toplevel(body) {
+ return [ this[0], do_body(body, this.scope) ];
+ };
+ return w.with_walkers({
+ "function": function(name, args, body){
+ for (var i = args.length; --i >= 0 && !body.scope.references(args[i]);)
+ args.pop();
+ if (!body.scope.references(name)) name = null;
+ return [ this[0], name, args, do_body(body, body.scope) ];
+ },
+ "defun": function(name, args, body){
+ if (!scope.references(name)) return MAP.skip;
+ for (var i = args.length; --i >= 0 && !body.scope.references(args[i]);)
+ args.pop();
+ return [ this[0], name, args, do_body(body, body.scope) ];
+ },
+ "var": _vardefs,
+ "toplevel": _toplevel
+ }, function(){
+ return walk(ast_add_scope(ast));
+ });
+};
+
+function ast_squeeze(ast, options) {
+ ast = squeeze_1(ast, options);
+ ast = squeeze_2(ast, options);
+ return ast;
+};
+
+function squeeze_1(ast, options) {
+ options = defaults(options, {
+ make_seqs : true,
+ dead_code : true,
+ no_warnings : false,
+ keep_comps : true,
+ unsafe : false
+ });
+
+ var w = ast_walker(), walk = w.walk, scope;
+
+ function negate(c) {
+ var not_c = [ "unary-prefix", "!", c ];
+ switch (c[0]) {
+ case "unary-prefix":
+ return c[1] == "!" && boolean_expr(c[2]) ? c[2] : not_c;
+ case "seq":
+ c = slice(c);
+ c[c.length - 1] = negate(c[c.length - 1]);
+ return c;
+ case "conditional":
+ return best_of(not_c, [ "conditional", c[1], negate(c[2]), negate(c[3]) ]);
+ case "binary":
+ var op = c[1], left = c[2], right = c[3];
+ if (!options.keep_comps) switch (op) {
+ case "<=" : return [ "binary", ">", left, right ];
+ case "<" : return [ "binary", ">=", left, right ];
+ case ">=" : return [ "binary", "<", left, right ];
+ case ">" : return [ "binary", "<=", left, right ];
+ }
+ switch (op) {
+ case "==" : return [ "binary", "!=", left, right ];
+ case "!=" : return [ "binary", "==", left, right ];
+ case "===" : return [ "binary", "!==", left, right ];
+ case "!==" : return [ "binary", "===", left, right ];
+ case "&&" : return best_of(not_c, [ "binary", "||", negate(left), negate(right) ]);
+ case "||" : return best_of(not_c, [ "binary", "&&", negate(left), negate(right) ]);
+ }
+ break;
+ }
+ return not_c;
+ };
+
+ function make_conditional(c, t, e) {
+ var make_real_conditional = function() {
+ if (c[0] == "unary-prefix" && c[1] == "!") {
+ return e ? [ "conditional", c[2], e, t ] : [ "binary", "||", c[2], t ];
+ } else {
+ return e ? best_of(
+ [ "conditional", c, t, e ],
+ [ "conditional", negate(c), e, t ]
+ ) : [ "binary", "&&", c, t ];
+ }
+ };
+ // shortcut the conditional if the expression has a constant value
+ return when_constant(c, function(ast, val){
+ warn_unreachable(val ? e : t);
+ return (val ? t : e);
+ }, make_real_conditional);
+ };
+
+ function rmblock(block) {
+ if (block != null && block[0] == "block" && block[1]) {
+ if (block[1].length == 1)
+ block = block[1][0];
+ else if (block[1].length == 0)
+ block = [ "block" ];
+ }
+ return block;
+ };
+
+ function _lambda(name, args, body) {
+ return [ this[0], name, args, tighten(body, "lambda") ];
+ };
+
+ // this function does a few things:
+ // 1. discard useless blocks
+ // 2. join consecutive var declarations
+ // 3. remove obviously dead code
+ // 4. transform consecutive statements using the comma operator
+ // 5. if block_type == "lambda" and it detects constructs like if(foo) return ... - rewrite like if (!foo) { ... }
+ function tighten(statements, block_type) {
+ statements = MAP(statements, walk);
+
+ statements = statements.reduce(function(a, stat){
+ if (stat[0] == "block") {
+ if (stat[1]) {
+ a.push.apply(a, stat[1]);
+ }
+ } else {
+ a.push(stat);
+ }
+ return a;
+ }, []);
+
+ statements = (function(a, prev){
+ statements.forEach(function(cur){
+ if (prev && ((cur[0] == "var" && prev[0] == "var") ||
+ (cur[0] == "const" && prev[0] == "const"))) {
+ prev[1] = prev[1].concat(cur[1]);
+ } else {
+ a.push(cur);
+ prev = cur;
+ }
+ });
+ return a;
+ })([]);
+
+ if (options.dead_code) statements = (function(a, has_quit){
+ statements.forEach(function(st){
+ if (has_quit) {
+ if (st[0] == "function" || st[0] == "defun") {
+ a.push(st);
+ }
+ else if (st[0] == "var" || st[0] == "const") {
+ if (!options.no_warnings)
+ warn("Variables declared in unreachable code");
+ st[1] = MAP(st[1], function(def){
+ if (def[1] && !options.no_warnings)
+ warn_unreachable([ "assign", true, [ "name", def[0] ], def[1] ]);
+ return [ def[0] ];
+ });
+ a.push(st);
+ }
+ else if (!options.no_warnings)
+ warn_unreachable(st);
+ }
+ else {
+ a.push(st);
+ if (member(st[0], [ "return", "throw", "break", "continue" ]))
+ has_quit = true;
+ }
+ });
+ return a;
+ })([]);
+
+ if (options.make_seqs) statements = (function(a, prev) {
+ statements.forEach(function(cur){
+ if (prev && prev[0] == "stat" && cur[0] == "stat") {
+ prev[1] = [ "seq", prev[1], cur[1] ];
+ } else {
+ a.push(cur);
+ prev = cur;
+ }
+ });
+ if (a.length >= 2
+ && a[a.length-2][0] == "stat"
+ && (a[a.length-1][0] == "return" || a[a.length-1][0] == "throw")
+ && a[a.length-1][1])
+ {
+ a.splice(a.length - 2, 2,
+ [ a[a.length-1][0],
+ [ "seq", a[a.length-2][1], a[a.length-1][1] ]]);
+ }
+ return a;
+ })([]);
+
+ // this increases jQuery by 1K. Probably not such a good idea after all..
+ // part of this is done in prepare_ifs anyway.
+ // if (block_type == "lambda") statements = (function(i, a, stat){
+ // while (i < statements.length) {
+ // stat = statements[i++];
+ // if (stat[0] == "if" && !stat[3]) {
+ // if (stat[2][0] == "return" && stat[2][1] == null) {
+ // a.push(make_if(negate(stat[1]), [ "block", statements.slice(i) ]));
+ // break;
+ // }
+ // var last = last_stat(stat[2]);
+ // if (last[0] == "return" && last[1] == null) {
+ // a.push(make_if(stat[1], [ "block", stat[2][1].slice(0, -1) ], [ "block", statements.slice(i) ]));
+ // break;
+ // }
+ // }
+ // a.push(stat);
+ // }
+ // return a;
+ // })(0, []);
+
+ return statements;
+ };
+
+ function make_if(c, t, e) {
+ return when_constant(c, function(ast, val){
+ if (val) {
+ t = walk(t);
+ warn_unreachable(e);
+ return t || [ "block" ];
+ } else {
+ e = walk(e);
+ warn_unreachable(t);
+ return e || [ "block" ];
+ }
+ }, function() {
+ return make_real_if(c, t, e);
+ });
+ };
+
+ function abort_else(c, t, e) {
+ var ret = [ [ "if", negate(c), e ] ];
+ if (t[0] == "block") {
+ if (t[1]) ret = ret.concat(t[1]);
+ } else {
+ ret.push(t);
+ }
+ return walk([ "block", ret ]);
+ };
+
+ function make_real_if(c, t, e) {
+ c = walk(c);
+ t = walk(t);
+ e = walk(e);
+
+ if (empty(e) && empty(t))
+ return [ "stat", c ];
+
+ if (empty(t)) {
+ c = negate(c);
+ t = e;
+ e = null;
+ } else if (empty(e)) {
+ e = null;
+ } else {
+ // if we have both else and then, maybe it makes sense to switch them?
+ (function(){
+ var a = gen_code(c);
+ var n = negate(c);
+ var b = gen_code(n);
+ if (b.length < a.length) {
+ var tmp = t;
+ t = e;
+ e = tmp;
+ c = n;
+ }
+ })();
+ }
+ var ret = [ "if", c, t, e ];
+ if (t[0] == "if" && empty(t[3]) && empty(e)) {
+ ret = best_of(ret, walk([ "if", [ "binary", "&&", c, t[1] ], t[2] ]));
+ }
+ else if (t[0] == "stat") {
+ if (e) {
+ if (e[0] == "stat")
+ ret = best_of(ret, [ "stat", make_conditional(c, t[1], e[1]) ]);
+ else if (aborts(e))
+ ret = abort_else(c, t, e);
+ }
+ else {
+ ret = best_of(ret, [ "stat", make_conditional(c, t[1]) ]);
+ }
+ }
+ else if (e && t[0] == e[0] && (t[0] == "return" || t[0] == "throw") && t[1] && e[1]) {
+ ret = best_of(ret, [ t[0], make_conditional(c, t[1], e[1] ) ]);
+ }
+ else if (e && aborts(t)) {
+ ret = [ [ "if", c, t ] ];
+ if (e[0] == "block") {
+ if (e[1]) ret = ret.concat(e[1]);
+ }
+ else {
+ ret.push(e);
+ }
+ ret = walk([ "block", ret ]);
+ }
+ else if (t && aborts(e)) {
+ ret = abort_else(c, t, e);
+ }
+ return ret;
+ };
+
+ function _do_while(cond, body) {
+ return when_constant(cond, function(cond, val){
+ if (!val) {
+ warn_unreachable(body);
+ return [ "block" ];
+ } else {
+ return [ "for", null, null, null, walk(body) ];
+ }
+ });
+ };
+
+ return w.with_walkers({
+ "sub": function(expr, subscript) {
+ if (subscript[0] == "string") {
+ var name = subscript[1];
+ if (is_identifier(name))
+ return [ "dot", walk(expr), name ];
+ else if (/^[1-9][0-9]*$/.test(name) || name === "0")
+ return [ "sub", walk(expr), [ "num", parseInt(name, 10) ] ];
+ }
+ },
+ "if": make_if,
+ "toplevel": function(body) {
+ return [ "toplevel", tighten(body) ];
+ },
+ "switch": function(expr, body) {
+ var last = body.length - 1;
+ return [ "switch", walk(expr), MAP(body, function(branch, i){
+ var block = tighten(branch[1]);
+ if (i == last && block.length > 0) {
+ var node = block[block.length - 1];
+ if (node[0] == "break" && !node[1])
+ block.pop();
+ }
+ return [ branch[0] ? walk(branch[0]) : null, block ];
+ }) ];
+ },
+ "function": _lambda,
+ "defun": _lambda,
+ "block": function(body) {
+ if (body) return rmblock([ "block", tighten(body) ]);
+ },
+ "binary": function(op, left, right) {
+ return when_constant([ "binary", op, walk(left), walk(right) ], function yes(c){
+ return best_of(walk(c), this);
+ }, function no() {
+ return function(){
+ if(op != "==" && op != "!=") return;
+ var l = walk(left), r = walk(right);
+ if(l && l[0] == "unary-prefix" && l[1] == "!" && l[2][0] == "num")
+ left = ['num', +!l[2][1]];
+ else if (r && r[0] == "unary-prefix" && r[1] == "!" && r[2][0] == "num")
+ right = ['num', +!r[2][1]];
+ return ["binary", op, left, right];
+ }() || this;
+ });
+ },
+ "conditional": function(c, t, e) {
+ return make_conditional(walk(c), walk(t), walk(e));
+ },
+ "try": function(t, c, f) {
+ return [
+ "try",
+ tighten(t),
+ c != null ? [ c[0], tighten(c[1]) ] : null,
+ f != null ? tighten(f) : null
+ ];
+ },
+ "unary-prefix": function(op, expr) {
+ expr = walk(expr);
+ var ret = [ "unary-prefix", op, expr ];
+ if (op == "!")
+ ret = best_of(ret, negate(expr));
+ return when_constant(ret, function(ast, val){
+ return walk(ast); // it's either true or false, so minifies to !0 or !1
+ }, function() { return ret });
+ },
+ "name": function(name) {
+ switch (name) {
+ case "true": return [ "unary-prefix", "!", [ "num", 0 ]];
+ case "false": return [ "unary-prefix", "!", [ "num", 1 ]];
+ }
+ },
+ "while": _do_while,
+ "assign": function(op, lvalue, rvalue) {
+ lvalue = walk(lvalue);
+ rvalue = walk(rvalue);
+ var okOps = [ '+', '-', '/', '*', '%', '>>', '<<', '>>>', '|', '^', '&' ];
+ if (op === true && lvalue[0] === "name" && rvalue[0] === "binary" &&
+ ~okOps.indexOf(rvalue[1]) && rvalue[2][0] === "name" &&
+ rvalue[2][1] === lvalue[1]) {
+ return [ this[0], rvalue[1], lvalue, rvalue[3] ]
+ }
+ return [ this[0], op, lvalue, rvalue ];
+ },
+ "call": function(expr, args) {
+ expr = walk(expr);
+ if (options.unsafe && expr[0] == "dot" && expr[1][0] == "string" && expr[2] == "toString") {
+ return expr[1];
+ }
+ return [ this[0], expr, MAP(args, walk) ];
+ },
+ "num": function (num) {
+ if (!isFinite(num))
+ return [ "binary", "/", num === 1 / 0
+ ? [ "num", 1 ] : num === -1 / 0
+ ? [ "unary-prefix", "-", [ "num", 1 ] ]
+ : [ "num", 0 ], [ "num", 0 ] ];
+
+ return [ this[0], num ];
+ }
+ }, function() {
+ return walk(prepare_ifs(walk(prepare_ifs(ast))));
+ });
+};
+
+function squeeze_2(ast, options) {
+ var w = ast_walker(), walk = w.walk, scope;
+ function with_scope(s, cont) {
+ var save = scope, ret;
+ scope = s;
+ ret = cont();
+ scope = save;
+ return ret;
+ };
+ function lambda(name, args, body) {
+ return [ this[0], name, args, with_scope(body.scope, curry(MAP, body, walk)) ];
+ };
+ return w.with_walkers({
+ "directive": function(dir) {
+ if (scope.active_directive(dir))
+ return [ "block" ];
+ scope.directives.push(dir);
+ },
+ "toplevel": function(body) {
+ return [ this[0], with_scope(this.scope, curry(MAP, body, walk)) ];
+ },
+ "function": lambda,
+ "defun": lambda
+ }, function(){
+ return walk(ast_add_scope(ast));
+ });
+};
+
+/* -----[ re-generate code from the AST ]----- */
+
+var DOT_CALL_NO_PARENS = jsp.array_to_hash([
+ "name",
+ "array",
+ "object",
+ "string",
+ "dot",
+ "sub",
+ "call",
+ "regexp",
+ "defun"
+]);
+
+function make_string(str, ascii_only) {
+ var dq = 0, sq = 0;
+ str = str.replace(/[\\\b\f\n\r\t\x22\x27\u2028\u2029\0]/g, function(s){
+ switch (s) {
+ case "\\": return "\\\\";
+ case "\b": return "\\b";
+ case "\f": return "\\f";
+ case "\n": return "\\n";
+ case "\r": return "\\r";
+ case "\u2028": return "\\u2028";
+ case "\u2029": return "\\u2029";
+ case '"': ++dq; return '"';
+ case "'": ++sq; return "'";
+ case "\0": return "\\0";
+ }
+ return s;
+ });
+ if (ascii_only) str = to_ascii(str);
+ if (dq > sq) return "'" + str.replace(/\x27/g, "\\'") + "'";
+ else return '"' + str.replace(/\x22/g, '\\"') + '"';
+};
+
+function to_ascii(str) {
+ return str.replace(/[\u0080-\uffff]/g, function(ch) {
+ var code = ch.charCodeAt(0).toString(16);
+ while (code.length < 4) code = "0" + code;
+ return "\\u" + code;
+ });
+};
+
+var SPLICE_NEEDS_BRACKETS = jsp.array_to_hash([ "if", "while", "do", "for", "for-in", "with" ]);
+
+function gen_code(ast, options) {
+ options = defaults(options, {
+ indent_start : 0,
+ indent_level : 4,
+ quote_keys : false,
+ space_colon : false,
+ beautify : false,
+ ascii_only : false,
+ inline_script: false
+ });
+ var beautify = !!options.beautify;
+ var indentation = 0,
+ newline = beautify ? "\n" : "",
+ space = beautify ? " " : "";
+
+ function encode_string(str) {
+ var ret = make_string(str, options.ascii_only);
+ if (options.inline_script)
+ ret = ret.replace(/<\x2fscript([>\/\t\n\f\r ])/gi, "<\\/script$1");
+ return ret;
+ };
+
+ function make_name(name) {
+ name = name.toString();
+ if (options.ascii_only)
+ name = to_ascii(name);
+ return name;
+ };
+
+ function indent(line) {
+ if (line == null)
+ line = "";
+ if (beautify)
+ line = repeat_string(" ", options.indent_start + indentation * options.indent_level) + line;
+ return line;
+ };
+
+ function with_indent(cont, incr) {
+ if (incr == null) incr = 1;
+ indentation += incr;
+ try { return cont.apply(null, slice(arguments, 1)); }
+ finally { indentation -= incr; }
+ };
+
+ function last_char(str) {
+ str = str.toString();
+ return str.charAt(str.length - 1);
+ };
+
+ function first_char(str) {
+ return str.toString().charAt(0);
+ };
+
+ function add_spaces(a) {
+ if (beautify)
+ return a.join(" ");
+ var b = [];
+ for (var i = 0; i < a.length; ++i) {
+ var next = a[i + 1];
+ b.push(a[i]);
+ if (next &&
+ ((is_identifier_char(last_char(a[i])) && (is_identifier_char(first_char(next))
+ || first_char(next) == "\\")) ||
+ (/[\+\-]$/.test(a[i].toString()) && /^[\+\-]/.test(next.toString()) ||
+ last_char(a[i]) == "/" && first_char(next) == "/"))) {
+ b.push(" ");
+ }
+ }
+ return b.join("");
+ };
+
+ function add_commas(a) {
+ return a.join("," + space);
+ };
+
+ function parenthesize(expr) {
+ var gen = make(expr);
+ for (var i = 1; i < arguments.length; ++i) {
+ var el = arguments[i];
+ if ((el instanceof Function && el(expr)) || expr[0] == el)
+ return "(" + gen + ")";
+ }
+ return gen;
+ };
+
+ function best_of(a) {
+ if (a.length == 1) {
+ return a[0];
+ }
+ if (a.length == 2) {
+ var b = a[1];
+ a = a[0];
+ return a.length <= b.length ? a : b;
+ }
+ return best_of([ a[0], best_of(a.slice(1)) ]);
+ };
+
+ function needs_parens(expr) {
+ if (expr[0] == "function" || expr[0] == "object") {
+ // dot/call on a literal function requires the
+ // function literal itself to be parenthesized
+ // only if it's the first "thing" in a
+ // statement. This means that the parent is
+ // "stat", but it could also be a "seq" and
+ // we're the first in this "seq" and the
+ // parent is "stat", and so on. Messy stuff,
+ // but it worths the trouble.
+ var a = slice(w.stack()), self = a.pop(), p = a.pop();
+ while (p) {
+ if (p[0] == "stat") return true;
+ if (((p[0] == "seq" || p[0] == "call" || p[0] == "dot" || p[0] == "sub" || p[0] == "conditional") && p[1] === self) ||
+ ((p[0] == "binary" || p[0] == "assign" || p[0] == "unary-postfix") && p[2] === self)) {
+ self = p;
+ p = a.pop();
+ } else {
+ return false;
+ }
+ }
+ }
+ return !HOP(DOT_CALL_NO_PARENS, expr[0]);
+ };
+
+ function make_num(num) {
+ var str = num.toString(10), a = [ str.replace(/^0\./, ".").replace('e+', 'e') ], m;
+ if (Math.floor(num) === num) {
+ if (num >= 0) {
+ a.push("0x" + num.toString(16).toLowerCase(), // probably pointless
+ "0" + num.toString(8)); // same.
+ } else {
+ a.push("-0x" + (-num).toString(16).toLowerCase(), // probably pointless
+ "-0" + (-num).toString(8)); // same.
+ }
+ if ((m = /^(.*?)(0+)$/.exec(num))) {
+ a.push(m[1] + "e" + m[2].length);
+ }
+ } else if ((m = /^0?\.(0+)(.*)$/.exec(num))) {
+ a.push(m[2] + "e-" + (m[1].length + m[2].length),
+ str.substr(str.indexOf(".")));
+ }
+ return best_of(a);
+ };
+
+ var w = ast_walker();
+ var make = w.walk;
+ return w.with_walkers({
+ "string": encode_string,
+ "num": make_num,
+ "name": make_name,
+ "debugger": function(){ return "debugger;" },
+ "toplevel": function(statements) {
+ return make_block_statements(statements)
+ .join(newline + newline);
+ },
+ "splice": function(statements) {
+ var parent = w.parent();
+ if (HOP(SPLICE_NEEDS_BRACKETS, parent)) {
+ // we need block brackets in this case
+ return make_block.apply(this, arguments);
+ } else {
+ return MAP(make_block_statements(statements, true),
+ function(line, i) {
+ // the first line is already indented
+ return i > 0 ? indent(line) : line;
+ }).join(newline);
+ }
+ },
+ "block": make_block,
+ "var": function(defs) {
+ return "var " + add_commas(MAP(defs, make_1vardef)) + ";";
+ },
+ "const": function(defs) {
+ return "const " + add_commas(MAP(defs, make_1vardef)) + ";";
+ },
+ "try": function(tr, ca, fi) {
+ var out = [ "try", make_block(tr) ];
+ if (ca) out.push("catch", "(" + ca[0] + ")", make_block(ca[1]));
+ if (fi) out.push("finally", make_block(fi));
+ return add_spaces(out);
+ },
+ "throw": function(expr) {
+ return add_spaces([ "throw", make(expr) ]) + ";";
+ },
+ "new": function(ctor, args) {
+ args = args.length > 0 ? "(" + add_commas(MAP(args, function(expr){
+ return parenthesize(expr, "seq");
+ })) + ")" : "";
+ return add_spaces([ "new", parenthesize(ctor, "seq", "binary", "conditional", "assign", function(expr){
+ var w = ast_walker(), has_call = {};
+ try {
+ w.with_walkers({
+ "call": function() { throw has_call },
+ "function": function() { return this }
+ }, function(){
+ w.walk(expr);
+ });
+ } catch(ex) {
+ if (ex === has_call)
+ return true;
+ throw ex;
+ }
+ }) + args ]);
+ },
+ "switch": function(expr, body) {
+ return add_spaces([ "switch", "(" + make(expr) + ")", make_switch_block(body) ]);
+ },
+ "break": function(label) {
+ var out = "break";
+ if (label != null)
+ out += " " + make_name(label);
+ return out + ";";
+ },
+ "continue": function(label) {
+ var out = "continue";
+ if (label != null)
+ out += " " + make_name(label);
+ return out + ";";
+ },
+ "conditional": function(co, th, el) {
+ return add_spaces([ parenthesize(co, "assign", "seq", "conditional"), "?",
+ parenthesize(th, "seq"), ":",
+ parenthesize(el, "seq") ]);
+ },
+ "assign": function(op, lvalue, rvalue) {
+ if (op && op !== true) op += "=";
+ else op = "=";
+ return add_spaces([ make(lvalue), op, parenthesize(rvalue, "seq") ]);
+ },
+ "dot": function(expr) {
+ var out = make(expr), i = 1;
+ if (expr[0] == "num") {
+ if (!/[a-f.]/i.test(out))
+ out += ".";
+ } else if (expr[0] != "function" && needs_parens(expr))
+ out = "(" + out + ")";
+ while (i < arguments.length)
+ out += "." + make_name(arguments[i++]);
+ return out;
+ },
+ "call": function(func, args) {
+ var f = make(func);
+ if (f.charAt(0) != "(" && needs_parens(func))
+ f = "(" + f + ")";
+ return f + "(" + add_commas(MAP(args, function(expr){
+ return parenthesize(expr, "seq");
+ })) + ")";
+ },
+ "function": make_function,
+ "defun": make_function,
+ "if": function(co, th, el) {
+ var out = [ "if", "(" + make(co) + ")", el ? make_then(th) : make(th) ];
+ if (el) {
+ out.push("else", make(el));
+ }
+ return add_spaces(out);
+ },
+ "for": function(init, cond, step, block) {
+ var out = [ "for" ];
+ init = (init != null ? make(init) : "").replace(/;*\s*$/, ";" + space);
+ cond = (cond != null ? make(cond) : "").replace(/;*\s*$/, ";" + space);
+ step = (step != null ? make(step) : "").replace(/;*\s*$/, "");
+ var args = init + cond + step;
+ if (args == "; ; ") args = ";;";
+ out.push("(" + args + ")", make(block));
+ return add_spaces(out);
+ },
+ "for-in": function(vvar, key, hash, block) {
+ return add_spaces([ "for", "(" +
+ (vvar ? make(vvar).replace(/;+$/, "") : make(key)),
+ "in",
+ make(hash) + ")", make(block) ]);
+ },
+ "while": function(condition, block) {
+ return add_spaces([ "while", "(" + make(condition) + ")", make(block) ]);
+ },
+ "do": function(condition, block) {
+ return add_spaces([ "do", make(block), "while", "(" + make(condition) + ")" ]) + ";";
+ },
+ "return": function(expr) {
+ var out = [ "return" ];
+ if (expr != null) out.push(make(expr));
+ return add_spaces(out) + ";";
+ },
+ "binary": function(operator, lvalue, rvalue) {
+ var left = make(lvalue), right = make(rvalue);
+ // XXX: I'm pretty sure other cases will bite here.
+ // we need to be smarter.
+ // adding parens all the time is the safest bet.
+ if (member(lvalue[0], [ "assign", "conditional", "seq" ]) ||
+ lvalue[0] == "binary" && PRECEDENCE[operator] > PRECEDENCE[lvalue[1]] ||
+ lvalue[0] == "function" && needs_parens(this)) {
+ left = "(" + left + ")";
+ }
+ if (member(rvalue[0], [ "assign", "conditional", "seq" ]) ||
+ rvalue[0] == "binary" && PRECEDENCE[operator] >= PRECEDENCE[rvalue[1]] &&
+ !(rvalue[1] == operator && member(operator, [ "&&", "||", "*" ]))) {
+ right = "(" + right + ")";
+ }
+ else if (!beautify && options.inline_script && (operator == "<" || operator == "<<")
+ && rvalue[0] == "regexp" && /^script/i.test(rvalue[1])) {
+ right = " " + right;
+ }
+ return add_spaces([ left, operator, right ]);
+ },
+ "unary-prefix": function(operator, expr) {
+ var val = make(expr);
+ if (!(expr[0] == "num" || (expr[0] == "unary-prefix" && !HOP(OPERATORS, operator + expr[1])) || !needs_parens(expr)))
+ val = "(" + val + ")";
+ return operator + (jsp.is_alphanumeric_char(operator.charAt(0)) ? " " : "") + val;
+ },
+ "unary-postfix": function(operator, expr) {
+ var val = make(expr);
+ if (!(expr[0] == "num" || (expr[0] == "unary-postfix" && !HOP(OPERATORS, operator + expr[1])) || !needs_parens(expr)))
+ val = "(" + val + ")";
+ return val + operator;
+ },
+ "sub": function(expr, subscript) {
+ var hash = make(expr);
+ if (needs_parens(expr))
+ hash = "(" + hash + ")";
+ return hash + "[" + make(subscript) + "]";
+ },
+ "object": function(props) {
+ var obj_needs_parens = needs_parens(this);
+ if (props.length == 0)
+ return obj_needs_parens ? "({})" : "{}";
+ var out = "{" + newline + with_indent(function(){
+ return MAP(props, function(p){
+ if (p.length == 3) {
+ // getter/setter. The name is in p[0], the arg.list in p[1][2], the
+ // body in p[1][3] and type ("get" / "set") in p[2].
+ return indent(make_function(p[0], p[1][2], p[1][3], p[2], true));
+ }
+ var key = p[0], val = parenthesize(p[1], "seq");
+ if (options.quote_keys) {
+ key = encode_string(key);
+ } else if ((typeof key == "number" || !beautify && +key + "" == key)
+ && parseFloat(key) >= 0) {
+ key = make_num(+key);
+ } else if (!is_identifier(key)) {
+ key = encode_string(key);
+ }
+ return indent(add_spaces(beautify && options.space_colon
+ ? [ key, ":", val ]
+ : [ key + ":", val ]));
+ }).join("," + newline);
+ }) + newline + indent("}");
+ return obj_needs_parens ? "(" + out + ")" : out;
+ },
+ "regexp": function(rx, mods) {
+ if (options.ascii_only) rx = to_ascii(rx);
+ return "/" + rx + "/" + mods;
+ },
+ "array": function(elements) {
+ if (elements.length == 0) return "[]";
+ return add_spaces([ "[", add_commas(MAP(elements, function(el, i){
+ if (!beautify && el[0] == "atom" && el[1] == "undefined") return i === elements.length - 1 ? "," : "";
+ return parenthesize(el, "seq");
+ })), "]" ]);
+ },
+ "stat": function(stmt) {
+ return stmt != null
+ ? make(stmt).replace(/;*\s*$/, ";")
+ : ";";
+ },
+ "seq": function() {
+ return add_commas(MAP(slice(arguments), make));
+ },
+ "label": function(name, block) {
+ return add_spaces([ make_name(name), ":", make(block) ]);
+ },
+ "with": function(expr, block) {
+ return add_spaces([ "with", "(" + make(expr) + ")", make(block) ]);
+ },
+ "atom": function(name) {
+ return make_name(name);
+ },
+ "directive": function(dir) {
+ return make_string(dir) + ";";
+ }
+ }, function(){ return make(ast) });
+
+ // The squeezer replaces "block"-s that contain only a single
+ // statement with the statement itself; technically, the AST
+ // is correct, but this can create problems when we output an
+ // IF having an ELSE clause where the THEN clause ends in an
+ // IF *without* an ELSE block (then the outer ELSE would refer
+ // to the inner IF). This function checks for this case and
+ // adds the block brackets if needed.
+ function make_then(th) {
+ if (th == null) return ";";
+ if (th[0] == "do") {
+ // https://github.com/mishoo/UglifyJS/issues/#issue/57
+ // IE croaks with "syntax error" on code like this:
+ // if (foo) do ... while(cond); else ...
+ // we need block brackets around do/while
+ return make_block([ th ]);
+ }
+ var b = th;
+ while (true) {
+ var type = b[0];
+ if (type == "if") {
+ if (!b[3])
+ // no else, we must add the block
+ return make([ "block", [ th ]]);
+ b = b[3];
+ }
+ else if (type == "while" || type == "do") b = b[2];
+ else if (type == "for" || type == "for-in") b = b[4];
+ else break;
+ }
+ return make(th);
+ };
+
+ function make_function(name, args, body, keyword, no_parens) {
+ var out = keyword || "function";
+ if (name) {
+ out += " " + make_name(name);
+ }
+ out += "(" + add_commas(MAP(args, make_name)) + ")";
+ out = add_spaces([ out, make_block(body) ]);
+ return (!no_parens && needs_parens(this)) ? "(" + out + ")" : out;
+ };
+
+ function must_has_semicolon(node) {
+ switch (node[0]) {
+ case "with":
+ case "while":
+ return empty(node[2]) || must_has_semicolon(node[2]);
+ case "for":
+ case "for-in":
+ return empty(node[4]) || must_has_semicolon(node[4]);
+ case "if":
+ if (empty(node[2]) && !node[3]) return true; // `if' with empty `then' and no `else'
+ if (node[3]) {
+ if (empty(node[3])) return true; // `else' present but empty
+ return must_has_semicolon(node[3]); // dive into the `else' branch
+ }
+ return must_has_semicolon(node[2]); // dive into the `then' branch
+ case "directive":
+ return true;
+ }
+ };
+
+ function make_block_statements(statements, noindent) {
+ for (var a = [], last = statements.length - 1, i = 0; i <= last; ++i) {
+ var stat = statements[i];
+ var code = make(stat);
+ if (code != ";") {
+ if (!beautify && i == last && !must_has_semicolon(stat)) {
+ code = code.replace(/;+\s*$/, "");
+ }
+ a.push(code);
+ }
+ }
+ return noindent ? a : MAP(a, indent);
+ };
+
+ function make_switch_block(body) {
+ var n = body.length;
+ if (n == 0) return "{}";
+ return "{" + newline + MAP(body, function(branch, i){
+ var has_body = branch[1].length > 0, code = with_indent(function(){
+ return indent(branch[0]
+ ? add_spaces([ "case", make(branch[0]) + ":" ])
+ : "default:");
+ }, 0.5) + (has_body ? newline + with_indent(function(){
+ return make_block_statements(branch[1]).join(newline);
+ }) : "");
+ if (!beautify && has_body && i < n - 1)
+ code += ";";
+ return code;
+ }).join(newline) + newline + indent("}");
+ };
+
+ function make_block(statements) {
+ if (!statements) return ";";
+ if (statements.length == 0) return "{}";
+ return "{" + newline + with_indent(function(){
+ return make_block_statements(statements).join(newline);
+ }) + newline + indent("}");
+ };
+
+ function make_1vardef(def) {
+ var name = def[0], val = def[1];
+ if (val != null)
+ name = add_spaces([ make_name(name), "=", parenthesize(val, "seq") ]);
+ return name;
+ };
+
+};
+
+function split_lines(code, max_line_length) {
+ var splits = [ 0 ];
+ jsp.parse(function(){
+ var next_token = jsp.tokenizer(code);
+ var last_split = 0;
+ var prev_token;
+ function current_length(tok) {
+ return tok.pos - last_split;
+ };
+ function split_here(tok) {
+ last_split = tok.pos;
+ splits.push(last_split);
+ };
+ function custom(){
+ var tok = next_token.apply(this, arguments);
+ out: {
+ if (prev_token) {
+ if (prev_token.type == "keyword") break out;
+ }
+ if (current_length(tok) > max_line_length) {
+ switch (tok.type) {
+ case "keyword":
+ case "atom":
+ case "name":
+ case "punc":
+ split_here(tok);
+ break out;
+ }
+ }
+ }
+ prev_token = tok;
+ return tok;
+ };
+ custom.context = function() {
+ return next_token.context.apply(this, arguments);
+ };
+ return custom;
+ }());
+ return splits.map(function(pos, i){
+ return code.substring(pos, splits[i + 1] || code.length);
+ }).join("\n");
+};
+
+/* -----[ Utilities ]----- */
+
+function repeat_string(str, i) {
+ if (i <= 0) return "";
+ if (i == 1) return str;
+ var d = repeat_string(str, i >> 1);
+ d += d;
+ if (i & 1) d += str;
+ return d;
+};
+
+function defaults(args, defs) {
+ var ret = {};
+ if (args === true)
+ args = {};
+ for (var i in defs) if (HOP(defs, i)) {
+ ret[i] = (args && HOP(args, i)) ? args[i] : defs[i];
+ }
+ return ret;
+};
+
+function is_identifier(name) {
+ return /^[a-z_$][a-z0-9_$]*$/i.test(name)
+ && name != "this"
+ && !HOP(jsp.KEYWORDS_ATOM, name)
+ && !HOP(jsp.RESERVED_WORDS, name)
+ && !HOP(jsp.KEYWORDS, name);
+};
+
+function HOP(obj, prop) {
+ return Object.prototype.hasOwnProperty.call(obj, prop);
+};
+
+// some utilities
+
+var MAP;
+
+(function(){
+ MAP = function(a, f, o) {
+ var ret = [], top = [], i;
+ function doit() {
+ var val = f.call(o, a[i], i);
+ if (val instanceof AtTop) {
+ val = val.v;
+ if (val instanceof Splice) {
+ top.push.apply(top, val.v);
+ } else {
+ top.push(val);
+ }
+ }
+ else if (val != skip) {
+ if (val instanceof Splice) {
+ ret.push.apply(ret, val.v);
+ } else {
+ ret.push(val);
+ }
+ }
+ };
+ if (a instanceof Array) for (i = 0; i < a.length; ++i) doit();
+ else for (i in a) if (HOP(a, i)) doit();
+ return top.concat(ret);
+ };
+ MAP.at_top = function(val) { return new AtTop(val) };
+ MAP.splice = function(val) { return new Splice(val) };
+ var skip = MAP.skip = {};
+ function AtTop(val) { this.v = val };
+ function Splice(val) { this.v = val };
+})();
+
+/* -----[ Exports ]----- */
+
+exports.ast_walker = ast_walker;
+exports.ast_mangle = ast_mangle;
+exports.ast_squeeze = ast_squeeze;
+exports.ast_lift_variables = ast_lift_variables;
+exports.gen_code = gen_code;
+exports.ast_add_scope = ast_add_scope;
+exports.set_logger = function(logger) { warn = logger };
+exports.make_string = make_string;
+exports.split_lines = split_lines;
+exports.MAP = MAP;
+
+// keep this last!
+exports.ast_squeeze_more = require("./squeeze-more").ast_squeeze_more;
+
+// Local variables:
+// js-indent-level: 4
+// End:
+});
+define('uglifyjs/index', ["require", "exports", "module", "./parse-js", "./process", "./consolidator"], function(require, exports, module) {
+//convienence function(src, [options]);
+function uglify(orig_code, options){
+ options || (options = {});
+ var jsp = uglify.parser;
+ var pro = uglify.uglify;
+
+ var ast = jsp.parse(orig_code, options.strict_semicolons); // parse code and get the initial AST
+ ast = pro.ast_mangle(ast, options.mangle_options); // get a new AST with mangled names
+ ast = pro.ast_squeeze(ast, options.squeeze_options); // get an AST with compression optimizations
+ var final_code = pro.gen_code(ast, options.gen_options); // compressed code here
+ return final_code;
+};
+
+uglify.parser = require("./parse-js");
+uglify.uglify = require("./process");
+uglify.consolidator = require("./consolidator");
+
+module.exports = uglify
+});/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+define('source-map/array-set', function (require, exports, module) {
+
+ var util = require('./util');
+
+ /**
+ * A data structure which is a combination of an array and a set. Adding a new
+ * member is O(1), testing for membership is O(1), and finding the index of an
+ * element is O(1). Removing elements from the set is not supported. Only
+ * strings are supported for membership.
+ */
+ function ArraySet() {
+ this._array = [];
+ this._set = {};
+ }
+
+ /**
+ * Static method for creating ArraySet instances from an existing array.
+ */
+ ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
+ var set = new ArraySet();
+ for (var i = 0, len = aArray.length; i < len; i++) {
+ set.add(aArray[i], aAllowDuplicates);
+ }
+ return set;
+ };
+
+ /**
+ * Add the given string to this set.
+ *
+ * @param String aStr
+ */
+ ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
+ var isDuplicate = this.has(aStr);
+ var idx = this._array.length;
+ if (!isDuplicate || aAllowDuplicates) {
+ this._array.push(aStr);
+ }
+ if (!isDuplicate) {
+ this._set[util.toSetString(aStr)] = idx;
+ }
+ };
+
+ /**
+ * Is the given string a member of this set?
+ *
+ * @param String aStr
+ */
+ ArraySet.prototype.has = function ArraySet_has(aStr) {
+ return Object.prototype.hasOwnProperty.call(this._set,
+ util.toSetString(aStr));
+ };
+
+ /**
+ * What is the index of the given string in the array?
+ *
+ * @param String aStr
+ */
+ ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
+ if (this.has(aStr)) {
+ return this._set[util.toSetString(aStr)];
+ }
+ throw new Error('"' + aStr + '" is not in the set.');
+ };
+
+ /**
+ * What is the element at the given index?
+ *
+ * @param Number aIdx
+ */
+ ArraySet.prototype.at = function ArraySet_at(aIdx) {
+ if (aIdx >= 0 && aIdx < this._array.length) {
+ return this._array[aIdx];
+ }
+ throw new Error('No element indexed by ' + aIdx);
+ };
+
+ /**
+ * Returns the array representation of this set (which has the proper indices
+ * indicated by indexOf). Note that this is a copy of the internal array used
+ * for storing the members so that no one can mess with internal state.
+ */
+ ArraySet.prototype.toArray = function ArraySet_toArray() {
+ return this._array.slice();
+ };
+
+ exports.ArraySet = ArraySet;
+
+});
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ *
+ * Based on the Base 64 VLQ implementation in Closure Compiler:
+ * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java
+ *
+ * Copyright 2011 The Closure Compiler Authors. All rights reserved.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+define('source-map/base64-vlq', function (require, exports, module) {
+
+ var base64 = require('./base64');
+
+ // A single base 64 digit can contain 6 bits of data. For the base 64 variable
+ // length quantities we use in the source map spec, the first bit is the sign,
+ // the next four bits are the actual value, and the 6th bit is the
+ // continuation bit. The continuation bit tells us whether there are more
+ // digits in this value following this digit.
+ //
+ // Continuation
+ // | Sign
+ // | |
+ // V V
+ // 101011
+
+ var VLQ_BASE_SHIFT = 5;
+
+ // binary: 100000
+ var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
+
+ // binary: 011111
+ var VLQ_BASE_MASK = VLQ_BASE - 1;
+
+ // binary: 100000
+ var VLQ_CONTINUATION_BIT = VLQ_BASE;
+
+ /**
+ * Converts from a two-complement value to a value where the sign bit is
+ * is placed in the least significant bit. For example, as decimals:
+ * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
+ * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
+ */
+ function toVLQSigned(aValue) {
+ return aValue < 0
+ ? ((-aValue) << 1) + 1
+ : (aValue << 1) + 0;
+ }
+
+ /**
+ * Converts to a two-complement value from a value where the sign bit is
+ * is placed in the least significant bit. For example, as decimals:
+ * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1
+ * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2
+ */
+ function fromVLQSigned(aValue) {
+ var isNegative = (aValue & 1) === 1;
+ var shifted = aValue >> 1;
+ return isNegative
+ ? -shifted
+ : shifted;
+ }
+
+ /**
+ * Returns the base 64 VLQ encoded value.
+ */
+ exports.encode = function base64VLQ_encode(aValue) {
+ var encoded = "";
+ var digit;
+
+ var vlq = toVLQSigned(aValue);
+
+ do {
+ digit = vlq & VLQ_BASE_MASK;
+ vlq >>>= VLQ_BASE_SHIFT;
+ if (vlq > 0) {
+ // There are still more digits in this value, so we must make sure the
+ // continuation bit is marked.
+ digit |= VLQ_CONTINUATION_BIT;
+ }
+ encoded += base64.encode(digit);
+ } while (vlq > 0);
+
+ return encoded;
+ };
+
+ /**
+ * Decodes the next base 64 VLQ value from the given string and returns the
+ * value and the rest of the string.
+ */
+ exports.decode = function base64VLQ_decode(aStr) {
+ var i = 0;
+ var strLen = aStr.length;
+ var result = 0;
+ var shift = 0;
+ var continuation, digit;
+
+ do {
+ if (i >= strLen) {
+ throw new Error("Expected more digits in base 64 VLQ value.");
+ }
+ digit = base64.decode(aStr.charAt(i++));
+ continuation = !!(digit & VLQ_CONTINUATION_BIT);
+ digit &= VLQ_BASE_MASK;
+ result = result + (digit << shift);
+ shift += VLQ_BASE_SHIFT;
+ } while (continuation);
+
+ return {
+ value: fromVLQSigned(result),
+ rest: aStr.slice(i)
+ };
+ };
+
+});
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+define('source-map/base64', function (require, exports, module) {
+
+ var charToIntMap = {};
+ var intToCharMap = {};
+
+ 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
+ .split('')
+ .forEach(function (ch, index) {
+ charToIntMap[ch] = index;
+ intToCharMap[index] = ch;
+ });
+
+ /**
+ * Encode an integer in the range of 0 to 63 to a single base 64 digit.
+ */
+ exports.encode = function base64_encode(aNumber) {
+ if (aNumber in intToCharMap) {
+ return intToCharMap[aNumber];
+ }
+ throw new TypeError("Must be between 0 and 63: " + aNumber);
+ };
+
+ /**
+ * Decode a single base 64 digit to an integer.
+ */
+ exports.decode = function base64_decode(aChar) {
+ if (aChar in charToIntMap) {
+ return charToIntMap[aChar];
+ }
+ throw new TypeError("Not a valid base 64 digit: " + aChar);
+ };
+
+});
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+define('source-map/binary-search', function (require, exports, module) {
+
+ /**
+ * Recursive implementation of binary search.
+ *
+ * @param aLow Indices here and lower do not contain the needle.
+ * @param aHigh Indices here and higher do not contain the needle.
+ * @param aNeedle The element being searched for.
+ * @param aHaystack The non-empty array being searched.
+ * @param aCompare Function which takes two elements and returns -1, 0, or 1.
+ */
+ function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare) {
+ // This function terminates when one of the following is true:
+ //
+ // 1. We find the exact element we are looking for.
+ //
+ // 2. We did not find the exact element, but we can return the next
+ // closest element that is less than that element.
+ //
+ // 3. We did not find the exact element, and there is no next-closest
+ // element which is less than the one we are searching for, so we
+ // return null.
+ var mid = Math.floor((aHigh - aLow) / 2) + aLow;
+ var cmp = aCompare(aNeedle, aHaystack[mid], true);
+ if (cmp === 0) {
+ // Found the element we are looking for.
+ return aHaystack[mid];
+ }
+ else if (cmp > 0) {
+ // aHaystack[mid] is greater than our needle.
+ if (aHigh - mid > 1) {
+ // The element is in the upper half.
+ return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare);
+ }
+ // We did not find an exact match, return the next closest one
+ // (termination case 2).
+ return aHaystack[mid];
+ }
+ else {
+ // aHaystack[mid] is less than our needle.
+ if (mid - aLow > 1) {
+ // The element is in the lower half.
+ return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare);
+ }
+ // The exact needle element was not found in this haystack. Determine if
+ // we are in termination case (2) or (3) and return the appropriate thing.
+ return aLow < 0
+ ? null
+ : aHaystack[aLow];
+ }
+ }
+
+ /**
+ * This is an implementation of binary search which will always try and return
+ * the next lowest value checked if there is no exact hit. This is because
+ * mappings between original and generated line/col pairs are single points,
+ * and there is an implicit region between each of them, so a miss just means
+ * that you aren't on the very start of a region.
+ *
+ * @param aNeedle The element you are looking for.
+ * @param aHaystack The array that is being searched.
+ * @param aCompare A function which takes the needle and an element in the
+ * array and returns -1, 0, or 1 depending on whether the needle is less
+ * than, equal to, or greater than the element, respectively.
+ */
+ exports.search = function search(aNeedle, aHaystack, aCompare) {
+ return aHaystack.length > 0
+ ? recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare)
+ : null;
+ };
+
+});
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+define('source-map/source-map-consumer', function (require, exports, module) {
+
+ var util = require('./util');
+ var binarySearch = require('./binary-search');
+ var ArraySet = require('./array-set').ArraySet;
+ var base64VLQ = require('./base64-vlq');
+
+ /**
+ * A SourceMapConsumer instance represents a parsed source map which we can
+ * query for information about the original file positions by giving it a file
+ * position in the generated source.
+ *
+ * The only parameter is the raw source map (either as a JSON string, or
+ * already parsed to an object). According to the spec, source maps have the
+ * following attributes:
+ *
+ * - version: Which version of the source map spec this map is following.
+ * - sources: An array of URLs to the original source files.
+ * - names: An array of identifiers which can be referrenced by individual mappings.
+ * - sourceRoot: Optional. The URL root from which all sources are relative.
+ * - sourcesContent: Optional. An array of contents of the original source files.
+ * - mappings: A string of base64 VLQs which contain the actual mappings.
+ * - file: Optional. The generated file this source map is associated with.
+ *
+ * Here is an example source map, taken from the source map spec[0]:
+ *
+ * {
+ * version : 3,
+ * file: "out.js",
+ * sourceRoot : "",
+ * sources: ["foo.js", "bar.js"],
+ * names: ["src", "maps", "are", "fun"],
+ * mappings: "AA,AB;;ABCDE;"
+ * }
+ *
+ * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#
+ */
+ function SourceMapConsumer(aSourceMap) {
+ var sourceMap = aSourceMap;
+ if (typeof aSourceMap === 'string') {
+ sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ''));
+ }
+
+ var version = util.getArg(sourceMap, 'version');
+ var sources = util.getArg(sourceMap, 'sources');
+ // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which
+ // requires the array) to play nice here.
+ var names = util.getArg(sourceMap, 'names', []);
+ var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);
+ var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);
+ var mappings = util.getArg(sourceMap, 'mappings');
+ var file = util.getArg(sourceMap, 'file', null);
+
+ // Once again, Sass deviates from the spec and supplies the version as a
+ // string rather than a number, so we use loose equality checking here.
+ if (version != this._version) {
+ throw new Error('Unsupported version: ' + version);
+ }
+
+ // Pass `true` below to allow duplicate names and sources. While source maps
+ // are intended to be compressed and deduplicated, the TypeScript compiler
+ // sometimes generates source maps with duplicates in them. See Github issue
+ // #72 and bugzil.la/889492.
+ this._names = ArraySet.fromArray(names, true);
+ this._sources = ArraySet.fromArray(sources, true);
+
+ this.sourceRoot = sourceRoot;
+ this.sourcesContent = sourcesContent;
+ this._mappings = mappings;
+ this.file = file;
+ }
+
+ /**
+ * Create a SourceMapConsumer from a SourceMapGenerator.
+ *
+ * @param SourceMapGenerator aSourceMap
+ * The source map that will be consumed.
+ * @returns SourceMapConsumer
+ */
+ SourceMapConsumer.fromSourceMap =
+ function SourceMapConsumer_fromSourceMap(aSourceMap) {
+ var smc = Object.create(SourceMapConsumer.prototype);
+
+ smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
+ smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
+ smc.sourceRoot = aSourceMap._sourceRoot;
+ smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),
+ smc.sourceRoot);
+ smc.file = aSourceMap._file;
+
+ smc.__generatedMappings = aSourceMap._mappings.slice()
+ .sort(util.compareByGeneratedPositions);
+ smc.__originalMappings = aSourceMap._mappings.slice()
+ .sort(util.compareByOriginalPositions);
+
+ return smc;
+ };
+
+ /**
+ * The version of the source mapping spec that we are consuming.
+ */
+ SourceMapConsumer.prototype._version = 3;
+
+ /**
+ * The list of original sources.
+ */
+ Object.defineProperty(SourceMapConsumer.prototype, 'sources', {
+ get: function () {
+ return this._sources.toArray().map(function (s) {
+ return this.sourceRoot ? util.join(this.sourceRoot, s) : s;
+ }, this);
+ }
+ });
+
+ // `__generatedMappings` and `__originalMappings` are arrays that hold the
+ // parsed mapping coordinates from the source map's "mappings" attribute. They
+ // are lazily instantiated, accessed via the `_generatedMappings` and
+ // `_originalMappings` getters respectively, and we only parse the mappings
+ // and create these arrays once queried for a source location. We jump through
+ // these hoops because there can be many thousands of mappings, and parsing
+ // them is expensive, so we only want to do it if we must.
+ //
+ // Each object in the arrays is of the form:
+ //
+ // {
+ // generatedLine: The line number in the generated code,
+ // generatedColumn: The column number in the generated code,
+ // source: The path to the original source file that generated this
+ // chunk of code,
+ // originalLine: The line number in the original source that
+ // corresponds to this chunk of generated code,
+ // originalColumn: The column number in the original source that
+ // corresponds to this chunk of generated code,
+ // name: The name of the original symbol which generated this chunk of
+ // code.
+ // }
+ //
+ // All properties except for `generatedLine` and `generatedColumn` can be
+ // `null`.
+ //
+ // `_generatedMappings` is ordered by the generated positions.
+ //
+ // `_originalMappings` is ordered by the original positions.
+
+ SourceMapConsumer.prototype.__generatedMappings = null;
+ Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {
+ get: function () {
+ if (!this.__generatedMappings) {
+ this.__generatedMappings = [];
+ this.__originalMappings = [];
+ this._parseMappings(this._mappings, this.sourceRoot);
+ }
+
+ return this.__generatedMappings;
+ }
+ });
+
+ SourceMapConsumer.prototype.__originalMappings = null;
+ Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {
+ get: function () {
+ if (!this.__originalMappings) {
+ this.__generatedMappings = [];
+ this.__originalMappings = [];
+ this._parseMappings(this._mappings, this.sourceRoot);
+ }
+
+ return this.__originalMappings;
+ }
+ });
+
+ /**
+ * Parse the mappings in a string in to a data structure which we can easily
+ * query (the ordered arrays in the `this.__generatedMappings` and
+ * `this.__originalMappings` properties).
+ */
+ SourceMapConsumer.prototype._parseMappings =
+ function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
+ var generatedLine = 1;
+ var previousGeneratedColumn = 0;
+ var previousOriginalLine = 0;
+ var previousOriginalColumn = 0;
+ var previousSource = 0;
+ var previousName = 0;
+ var mappingSeparator = /^[,;]/;
+ var str = aStr;
+ var mapping;
+ var temp;
+
+ while (str.length > 0) {
+ if (str.charAt(0) === ';') {
+ generatedLine++;
+ str = str.slice(1);
+ previousGeneratedColumn = 0;
+ }
+ else if (str.charAt(0) === ',') {
+ str = str.slice(1);
+ }
+ else {
+ mapping = {};
+ mapping.generatedLine = generatedLine;
+
+ // Generated column.
+ temp = base64VLQ.decode(str);
+ mapping.generatedColumn = previousGeneratedColumn + temp.value;
+ previousGeneratedColumn = mapping.generatedColumn;
+ str = temp.rest;
+
+ if (str.length > 0 && !mappingSeparator.test(str.charAt(0))) {
+ // Original source.
+ temp = base64VLQ.decode(str);
+ mapping.source = this._sources.at(previousSource + temp.value);
+ previousSource += temp.value;
+ str = temp.rest;
+ if (str.length === 0 || mappingSeparator.test(str.charAt(0))) {
+ throw new Error('Found a source, but no line and column');
+ }
+
+ // Original line.
+ temp = base64VLQ.decode(str);
+ mapping.originalLine = previousOriginalLine + temp.value;
+ previousOriginalLine = mapping.originalLine;
+ // Lines are stored 0-based
+ mapping.originalLine += 1;
+ str = temp.rest;
+ if (str.length === 0 || mappingSeparator.test(str.charAt(0))) {
+ throw new Error('Found a source and line, but no column');
+ }
+
+ // Original column.
+ temp = base64VLQ.decode(str);
+ mapping.originalColumn = previousOriginalColumn + temp.value;
+ previousOriginalColumn = mapping.originalColumn;
+ str = temp.rest;
+
+ if (str.length > 0 && !mappingSeparator.test(str.charAt(0))) {
+ // Original name.
+ temp = base64VLQ.decode(str);
+ mapping.name = this._names.at(previousName + temp.value);
+ previousName += temp.value;
+ str = temp.rest;
+ }
+ }
+
+ this.__generatedMappings.push(mapping);
+ if (typeof mapping.originalLine === 'number') {
+ this.__originalMappings.push(mapping);
+ }
+ }
+ }
+
+ this.__generatedMappings.sort(util.compareByGeneratedPositions);
+ this.__originalMappings.sort(util.compareByOriginalPositions);
+ };
+
+ /**
+ * Find the mapping that best matches the hypothetical "needle" mapping that
+ * we are searching for in the given "haystack" of mappings.
+ */
+ SourceMapConsumer.prototype._findMapping =
+ function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,
+ aColumnName, aComparator) {
+ // To return the position we are searching for, we must first find the
+ // mapping for the given position and then return the opposite position it
+ // points to. Because the mappings are sorted, we can use binary search to
+ // find the best mapping.
+
+ if (aNeedle[aLineName] <= 0) {
+ throw new TypeError('Line must be greater than or equal to 1, got '
+ + aNeedle[aLineName]);
+ }
+ if (aNeedle[aColumnName] < 0) {
+ throw new TypeError('Column must be greater than or equal to 0, got '
+ + aNeedle[aColumnName]);
+ }
+
+ return binarySearch.search(aNeedle, aMappings, aComparator);
+ };
+
+ /**
+ * Returns the original source, line, and column information for the generated
+ * source's line and column positions provided. The only argument is an object
+ * with the following properties:
+ *
+ * - line: The line number in the generated source.
+ * - column: The column number in the generated source.
+ *
+ * and an object is returned with the following properties:
+ *
+ * - source: The original source file, or null.
+ * - line: The line number in the original source, or null.
+ * - column: The column number in the original source, or null.
+ * - name: The original identifier, or null.
+ */
+ SourceMapConsumer.prototype.originalPositionFor =
+ function SourceMapConsumer_originalPositionFor(aArgs) {
+ var needle = {
+ generatedLine: util.getArg(aArgs, 'line'),
+ generatedColumn: util.getArg(aArgs, 'column')
+ };
+
+ var mapping = this._findMapping(needle,
+ this._generatedMappings,
+ "generatedLine",
+ "generatedColumn",
+ util.compareByGeneratedPositions);
+
+ if (mapping && mapping.generatedLine === needle.generatedLine) {
+ var source = util.getArg(mapping, 'source', null);
+ if (source && this.sourceRoot) {
+ source = util.join(this.sourceRoot, source);
+ }
+ return {
+ source: source,
+ line: util.getArg(mapping, 'originalLine', null),
+ column: util.getArg(mapping, 'originalColumn', null),
+ name: util.getArg(mapping, 'name', null)
+ };
+ }
+
+ return {
+ source: null,
+ line: null,
+ column: null,
+ name: null
+ };
+ };
+
+ /**
+ * Returns the original source content. The only argument is the url of the
+ * original source file. Returns null if no original source content is
+ * availible.
+ */
+ SourceMapConsumer.prototype.sourceContentFor =
+ function SourceMapConsumer_sourceContentFor(aSource) {
+ if (!this.sourcesContent) {
+ return null;
+ }
+
+ if (this.sourceRoot) {
+ aSource = util.relative(this.sourceRoot, aSource);
+ }
+
+ if (this._sources.has(aSource)) {
+ return this.sourcesContent[this._sources.indexOf(aSource)];
+ }
+
+ var url;
+ if (this.sourceRoot
+ && (url = util.urlParse(this.sourceRoot))) {
+ // XXX: file:// URIs and absolute paths lead to unexpected behavior for
+ // many users. We can help them out when they expect file:// URIs to
+ // behave like it would if they were running a local HTTP server. See
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.
+ var fileUriAbsPath = aSource.replace(/^file:\/\//, "");
+ if (url.scheme == "file"
+ && this._sources.has(fileUriAbsPath)) {
+ return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]
+ }
+
+ if ((!url.path || url.path == "/")
+ && this._sources.has("/" + aSource)) {
+ return this.sourcesContent[this._sources.indexOf("/" + aSource)];
+ }
+ }
+
+ throw new Error('"' + aSource + '" is not in the SourceMap.');
+ };
+
+ /**
+ * Returns the generated line and column information for the original source,
+ * line, and column positions provided. The only argument is an object with
+ * the following properties:
+ *
+ * - source: The filename of the original source.
+ * - line: The line number in the original source.
+ * - column: The column number in the original source.
+ *
+ * and an object is returned with the following properties:
+ *
+ * - line: The line number in the generated source, or null.
+ * - column: The column number in the generated source, or null.
+ */
+ SourceMapConsumer.prototype.generatedPositionFor =
+ function SourceMapConsumer_generatedPositionFor(aArgs) {
+ var needle = {
+ source: util.getArg(aArgs, 'source'),
+ originalLine: util.getArg(aArgs, 'line'),
+ originalColumn: util.getArg(aArgs, 'column')
+ };
+
+ if (this.sourceRoot) {
+ needle.source = util.relative(this.sourceRoot, needle.source);
+ }
+
+ var mapping = this._findMapping(needle,
+ this._originalMappings,
+ "originalLine",
+ "originalColumn",
+ util.compareByOriginalPositions);
+
+ if (mapping) {
+ return {
+ line: util.getArg(mapping, 'generatedLine', null),
+ column: util.getArg(mapping, 'generatedColumn', null)
+ };
+ }
+
+ return {
+ line: null,
+ column: null
+ };
+ };
+
+ SourceMapConsumer.GENERATED_ORDER = 1;
+ SourceMapConsumer.ORIGINAL_ORDER = 2;
+
+ /**
+ * Iterate over each mapping between an original source/line/column and a
+ * generated line/column in this source map.
+ *
+ * @param Function aCallback
+ * The function that is called with each mapping.
+ * @param Object aContext
+ * Optional. If specified, this object will be the value of `this` every
+ * time that `aCallback` is called.
+ * @param aOrder
+ * Either `SourceMapConsumer.GENERATED_ORDER` or
+ * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to
+ * iterate over the mappings sorted by the generated file's line/column
+ * order or the original's source/line/column order, respectively. Defaults to
+ * `SourceMapConsumer.GENERATED_ORDER`.
+ */
+ SourceMapConsumer.prototype.eachMapping =
+ function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
+ var context = aContext || null;
+ var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
+
+ var mappings;
+ switch (order) {
+ case SourceMapConsumer.GENERATED_ORDER:
+ mappings = this._generatedMappings;
+ break;
+ case SourceMapConsumer.ORIGINAL_ORDER:
+ mappings = this._originalMappings;
+ break;
+ default:
+ throw new Error("Unknown order of iteration.");
+ }
+
+ var sourceRoot = this.sourceRoot;
+ mappings.map(function (mapping) {
+ var source = mapping.source;
+ if (source && sourceRoot) {
+ source = util.join(sourceRoot, source);
+ }
+ return {
+ source: source,
+ generatedLine: mapping.generatedLine,
+ generatedColumn: mapping.generatedColumn,
+ originalLine: mapping.originalLine,
+ originalColumn: mapping.originalColumn,
+ name: mapping.name
+ };
+ }).forEach(aCallback, context);
+ };
+
+ exports.SourceMapConsumer = SourceMapConsumer;
+
+});
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+define('source-map/source-map-generator', function (require, exports, module) {
+
+ var base64VLQ = require('./base64-vlq');
+ var util = require('./util');
+ var ArraySet = require('./array-set').ArraySet;
+
+ /**
+ * An instance of the SourceMapGenerator represents a source map which is
+ * being built incrementally. You may pass an object with the following
+ * properties:
+ *
+ * - file: The filename of the generated source.
+ * - sourceRoot: A root for all relative URLs in this source map.
+ */
+ function SourceMapGenerator(aArgs) {
+ if (!aArgs) {
+ aArgs = {};
+ }
+ this._file = util.getArg(aArgs, 'file', null);
+ this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);
+ this._sources = new ArraySet();
+ this._names = new ArraySet();
+ this._mappings = [];
+ this._sourcesContents = null;
+ }
+
+ SourceMapGenerator.prototype._version = 3;
+
+ /**
+ * Creates a new SourceMapGenerator based on a SourceMapConsumer
+ *
+ * @param aSourceMapConsumer The SourceMap.
+ */
+ SourceMapGenerator.fromSourceMap =
+ function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
+ var sourceRoot = aSourceMapConsumer.sourceRoot;
+ var generator = new SourceMapGenerator({
+ file: aSourceMapConsumer.file,
+ sourceRoot: sourceRoot
+ });
+ aSourceMapConsumer.eachMapping(function (mapping) {
+ var newMapping = {
+ generated: {
+ line: mapping.generatedLine,
+ column: mapping.generatedColumn
+ }
+ };
+
+ if (mapping.source) {
+ newMapping.source = mapping.source;
+ if (sourceRoot) {
+ newMapping.source = util.relative(sourceRoot, newMapping.source);
+ }
+
+ newMapping.original = {
+ line: mapping.originalLine,
+ column: mapping.originalColumn
+ };
+
+ if (mapping.name) {
+ newMapping.name = mapping.name;
+ }
+ }
+
+ generator.addMapping(newMapping);
+ });
+ aSourceMapConsumer.sources.forEach(function (sourceFile) {
+ var content = aSourceMapConsumer.sourceContentFor(sourceFile);
+ if (content) {
+ generator.setSourceContent(sourceFile, content);
+ }
+ });
+ return generator;
+ };
+
+ /**
+ * Add a single mapping from original source line and column to the generated
+ * source's line and column for this source map being created. The mapping
+ * object should have the following properties:
+ *
+ * - generated: An object with the generated line and column positions.
+ * - original: An object with the original line and column positions.
+ * - source: The original source file (relative to the sourceRoot).
+ * - name: An optional original token name for this mapping.
+ */
+ SourceMapGenerator.prototype.addMapping =
+ function SourceMapGenerator_addMapping(aArgs) {
+ var generated = util.getArg(aArgs, 'generated');
+ var original = util.getArg(aArgs, 'original', null);
+ var source = util.getArg(aArgs, 'source', null);
+ var name = util.getArg(aArgs, 'name', null);
+
+ this._validateMapping(generated, original, source, name);
+
+ if (source && !this._sources.has(source)) {
+ this._sources.add(source);
+ }
+
+ if (name && !this._names.has(name)) {
+ this._names.add(name);
+ }
+
+ this._mappings.push({
+ generatedLine: generated.line,
+ generatedColumn: generated.column,
+ originalLine: original != null && original.line,
+ originalColumn: original != null && original.column,
+ source: source,
+ name: name
+ });
+ };
+
+ /**
+ * Set the source content for a source file.
+ */
+ SourceMapGenerator.prototype.setSourceContent =
+ function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
+ var source = aSourceFile;
+ if (this._sourceRoot) {
+ source = util.relative(this._sourceRoot, source);
+ }
+
+ if (aSourceContent !== null) {
+ // Add the source content to the _sourcesContents map.
+ // Create a new _sourcesContents map if the property is null.
+ if (!this._sourcesContents) {
+ this._sourcesContents = {};
+ }
+ this._sourcesContents[util.toSetString(source)] = aSourceContent;
+ } else {
+ // Remove the source file from the _sourcesContents map.
+ // If the _sourcesContents map is empty, set the property to null.
+ delete this._sourcesContents[util.toSetString(source)];
+ if (Object.keys(this._sourcesContents).length === 0) {
+ this._sourcesContents = null;
+ }
+ }
+ };
+
+ /**
+ * Applies the mappings of a sub-source-map for a specific source file to the
+ * source map being generated. Each mapping to the supplied source file is
+ * rewritten using the supplied source map. Note: The resolution for the
+ * resulting mappings is the minimium of this map and the supplied map.
+ *
+ * @param aSourceMapConsumer The source map to be applied.
+ * @param aSourceFile Optional. The filename of the source file.
+ * If omitted, SourceMapConsumer's file property will be used.
+ * @param aSourceMapPath Optional. The dirname of the path to the source map
+ * to be applied. If relative, it is relative to the SourceMapConsumer.
+ * This parameter is needed when the two source maps aren't in the same
+ * directory, and the source map to be applied contains relative source
+ * paths. If so, those relative source paths need to be rewritten
+ * relative to the SourceMapGenerator.
+ */
+ SourceMapGenerator.prototype.applySourceMap =
+ function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
+ // If aSourceFile is omitted, we will use the file property of the SourceMap
+ if (!aSourceFile) {
+ if (!aSourceMapConsumer.file) {
+ throw new Error(
+ 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +
+ 'or the source map\'s "file" property. Both were omitted.'
+ );
+ }
+ aSourceFile = aSourceMapConsumer.file;
+ }
+ var sourceRoot = this._sourceRoot;
+ // Make "aSourceFile" relative if an absolute Url is passed.
+ if (sourceRoot) {
+ aSourceFile = util.relative(sourceRoot, aSourceFile);
+ }
+ // Applying the SourceMap can add and remove items from the sources and
+ // the names array.
+ var newSources = new ArraySet();
+ var newNames = new ArraySet();
+
+ // Find mappings for the "aSourceFile"
+ this._mappings.forEach(function (mapping) {
+ if (mapping.source === aSourceFile && mapping.originalLine) {
+ // Check if it can be mapped by the source map, then update the mapping.
+ var original = aSourceMapConsumer.originalPositionFor({
+ line: mapping.originalLine,
+ column: mapping.originalColumn
+ });
+ if (original.source !== null) {
+ // Copy mapping
+ mapping.source = original.source;
+ if (aSourceMapPath) {
+ mapping.source = util.join(aSourceMapPath, mapping.source)
+ }
+ if (sourceRoot) {
+ mapping.source = util.relative(sourceRoot, mapping.source);
+ }
+ mapping.originalLine = original.line;
+ mapping.originalColumn = original.column;
+ if (original.name !== null && mapping.name !== null) {
+ // Only use the identifier name if it's an identifier
+ // in both SourceMaps
+ mapping.name = original.name;
+ }
+ }
+ }
+
+ var source = mapping.source;
+ if (source && !newSources.has(source)) {
+ newSources.add(source);
+ }
+
+ var name = mapping.name;
+ if (name && !newNames.has(name)) {
+ newNames.add(name);
+ }
+
+ }, this);
+ this._sources = newSources;
+ this._names = newNames;
+
+ // Copy sourcesContents of applied map.
+ aSourceMapConsumer.sources.forEach(function (sourceFile) {
+ var content = aSourceMapConsumer.sourceContentFor(sourceFile);
+ if (content) {
+ if (aSourceMapPath) {
+ sourceFile = util.join(aSourceMapPath, sourceFile);
+ }
+ if (sourceRoot) {
+ sourceFile = util.relative(sourceRoot, sourceFile);
+ }
+ this.setSourceContent(sourceFile, content);
+ }
+ }, this);
+ };
+
+ /**
+ * A mapping can have one of the three levels of data:
+ *
+ * 1. Just the generated position.
+ * 2. The Generated position, original position, and original source.
+ * 3. Generated and original position, original source, as well as a name
+ * token.
+ *
+ * To maintain consistency, we validate that any new mapping being added falls
+ * in to one of these categories.
+ */
+ SourceMapGenerator.prototype._validateMapping =
+ function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,
+ aName) {
+ if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
+ && aGenerated.line > 0 && aGenerated.column >= 0
+ && !aOriginal && !aSource && !aName) {
+ // Case 1.
+ return;
+ }
+ else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
+ && aOriginal && 'line' in aOriginal && 'column' in aOriginal
+ && aGenerated.line > 0 && aGenerated.column >= 0
+ && aOriginal.line > 0 && aOriginal.column >= 0
+ && aSource) {
+ // Cases 2 and 3.
+ return;
+ }
+ else {
+ throw new Error('Invalid mapping: ' + JSON.stringify({
+ generated: aGenerated,
+ source: aSource,
+ original: aOriginal,
+ name: aName
+ }));
+ }
+ };
+
+ /**
+ * Serialize the accumulated mappings in to the stream of base 64 VLQs
+ * specified by the source map format.
+ */
+ SourceMapGenerator.prototype._serializeMappings =
+ function SourceMapGenerator_serializeMappings() {
+ var previousGeneratedColumn = 0;
+ var previousGeneratedLine = 1;
+ var previousOriginalColumn = 0;
+ var previousOriginalLine = 0;
+ var previousName = 0;
+ var previousSource = 0;
+ var result = '';
+ var mapping;
+
+ // The mappings must be guaranteed to be in sorted order before we start
+ // serializing them or else the generated line numbers (which are defined
+ // via the ';' separators) will be all messed up. Note: it might be more
+ // performant to maintain the sorting as we insert them, rather than as we
+ // serialize them, but the big O is the same either way.
+ this._mappings.sort(util.compareByGeneratedPositions);
+
+ for (var i = 0, len = this._mappings.length; i < len; i++) {
+ mapping = this._mappings[i];
+
+ if (mapping.generatedLine !== previousGeneratedLine) {
+ previousGeneratedColumn = 0;
+ while (mapping.generatedLine !== previousGeneratedLine) {
+ result += ';';
+ previousGeneratedLine++;
+ }
+ }
+ else {
+ if (i > 0) {
+ if (!util.compareByGeneratedPositions(mapping, this._mappings[i - 1])) {
+ continue;
+ }
+ result += ',';
+ }
+ }
+
+ result += base64VLQ.encode(mapping.generatedColumn
+ - previousGeneratedColumn);
+ previousGeneratedColumn = mapping.generatedColumn;
+
+ if (mapping.source) {
+ result += base64VLQ.encode(this._sources.indexOf(mapping.source)
+ - previousSource);
+ previousSource = this._sources.indexOf(mapping.source);
+
+ // lines are stored 0-based in SourceMap spec version 3
+ result += base64VLQ.encode(mapping.originalLine - 1
+ - previousOriginalLine);
+ previousOriginalLine = mapping.originalLine - 1;
+
+ result += base64VLQ.encode(mapping.originalColumn
+ - previousOriginalColumn);
+ previousOriginalColumn = mapping.originalColumn;
+
+ if (mapping.name) {
+ result += base64VLQ.encode(this._names.indexOf(mapping.name)
+ - previousName);
+ previousName = this._names.indexOf(mapping.name);
+ }
+ }
+ }
+
+ return result;
+ };
+
+ SourceMapGenerator.prototype._generateSourcesContent =
+ function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
+ return aSources.map(function (source) {
+ if (!this._sourcesContents) {
+ return null;
+ }
+ if (aSourceRoot) {
+ source = util.relative(aSourceRoot, source);
+ }
+ var key = util.toSetString(source);
+ return Object.prototype.hasOwnProperty.call(this._sourcesContents,
+ key)
+ ? this._sourcesContents[key]
+ : null;
+ }, this);
+ };
+
+ /**
+ * Externalize the source map.
+ */
+ SourceMapGenerator.prototype.toJSON =
+ function SourceMapGenerator_toJSON() {
+ var map = {
+ version: this._version,
+ file: this._file,
+ sources: this._sources.toArray(),
+ names: this._names.toArray(),
+ mappings: this._serializeMappings()
+ };
+ if (this._sourceRoot) {
+ map.sourceRoot = this._sourceRoot;
+ }
+ if (this._sourcesContents) {
+ map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
+ }
+
+ return map;
+ };
+
+ /**
+ * Render the source map being generated to a string.
+ */
+ SourceMapGenerator.prototype.toString =
+ function SourceMapGenerator_toString() {
+ return JSON.stringify(this);
+ };
+
+ exports.SourceMapGenerator = SourceMapGenerator;
+
+});
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+define('source-map/source-node', function (require, exports, module) {
+
+ var SourceMapGenerator = require('./source-map-generator').SourceMapGenerator;
+ var util = require('./util');
+
+ // Matches a Windows-style `\r\n` newline or a `\n` newline used by all other
+ // operating systems these days (capturing the result).
+ var REGEX_NEWLINE = /(\r?\n)/g;
+
+ // Matches a Windows-style newline, or any character.
+ var REGEX_CHARACTER = /\r\n|[\s\S]/g;
+
+ /**
+ * SourceNodes provide a way to abstract over interpolating/concatenating
+ * snippets of generated JavaScript source code while maintaining the line and
+ * column information associated with the original source code.
+ *
+ * @param aLine The original line number.
+ * @param aColumn The original column number.
+ * @param aSource The original source's filename.
+ * @param aChunks Optional. An array of strings which are snippets of
+ * generated JS, or other SourceNodes.
+ * @param aName The original identifier.
+ */
+ function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
+ this.children = [];
+ this.sourceContents = {};
+ this.line = aLine === undefined ? null : aLine;
+ this.column = aColumn === undefined ? null : aColumn;
+ this.source = aSource === undefined ? null : aSource;
+ this.name = aName === undefined ? null : aName;
+ if (aChunks != null) this.add(aChunks);
+ }
+
+ /**
+ * Creates a SourceNode from generated code and a SourceMapConsumer.
+ *
+ * @param aGeneratedCode The generated code
+ * @param aSourceMapConsumer The SourceMap for the generated code
+ */
+ SourceNode.fromStringWithSourceMap =
+ function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer) {
+ // The SourceNode we want to fill with the generated code
+ // and the SourceMap
+ var node = new SourceNode();
+
+ // All even indices of this array are one line of the generated code,
+ // while all odd indices are the newlines between two adjacent lines
+ // (since `REGEX_NEWLINE` captures its match).
+ // Processed fragments are removed from this array, by calling `shiftNextLine`.
+ var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
+ var shiftNextLine = function() {
+ var lineContents = remainingLines.shift();
+ // The last line of a file might not have a newline.
+ var newLine = remainingLines.shift() || "";
+ return lineContents + newLine;
+ };
+
+ // We need to remember the position of "remainingLines"
+ var lastGeneratedLine = 1, lastGeneratedColumn = 0;
+
+ // The generate SourceNodes we need a code range.
+ // To extract it current and last mapping is used.
+ // Here we store the last mapping.
+ var lastMapping = null;
+
+ aSourceMapConsumer.eachMapping(function (mapping) {
+ if (lastMapping !== null) {
+ // We add the code from "lastMapping" to "mapping":
+ // First check if there is a new line in between.
+ if (lastGeneratedLine < mapping.generatedLine) {
+ var code = "";
+ // Associate first line with "lastMapping"
+ addMappingWithCode(lastMapping, shiftNextLine());
+ lastGeneratedLine++;
+ lastGeneratedColumn = 0;
+ // The remaining code is added without mapping
+ } else {
+ // There is no new line in between.
+ // Associate the code between "lastGeneratedColumn" and
+ // "mapping.generatedColumn" with "lastMapping"
+ var nextLine = remainingLines[0];
+ var code = nextLine.substr(0, mapping.generatedColumn -
+ lastGeneratedColumn);
+ remainingLines[0] = nextLine.substr(mapping.generatedColumn -
+ lastGeneratedColumn);
+ lastGeneratedColumn = mapping.generatedColumn;
+ addMappingWithCode(lastMapping, code);
+ // No more remaining code, continue
+ lastMapping = mapping;
+ return;
+ }
+ }
+ // We add the generated code until the first mapping
+ // to the SourceNode without any mapping.
+ // Each line is added as separate string.
+ while (lastGeneratedLine < mapping.generatedLine) {
+ node.add(shiftNextLine());
+ lastGeneratedLine++;
+ }
+ if (lastGeneratedColumn < mapping.generatedColumn) {
+ var nextLine = remainingLines[0];
+ node.add(nextLine.substr(0, mapping.generatedColumn));
+ remainingLines[0] = nextLine.substr(mapping.generatedColumn);
+ lastGeneratedColumn = mapping.generatedColumn;
+ }
+ lastMapping = mapping;
+ }, this);
+ // We have processed all mappings.
+ if (remainingLines.length > 0) {
+ if (lastMapping) {
+ // Associate the remaining code in the current line with "lastMapping"
+ addMappingWithCode(lastMapping, shiftNextLine());
+ }
+ // and add the remaining lines without any mapping
+ node.add(remainingLines.join(""));
+ }
+
+ // Copy sourcesContent into SourceNode
+ aSourceMapConsumer.sources.forEach(function (sourceFile) {
+ var content = aSourceMapConsumer.sourceContentFor(sourceFile);
+ if (content) {
+ node.setSourceContent(sourceFile, content);
+ }
+ });
+
+ return node;
+
+ function addMappingWithCode(mapping, code) {
+ if (mapping === null || mapping.source === undefined) {
+ node.add(code);
+ } else {
+ node.add(new SourceNode(mapping.originalLine,
+ mapping.originalColumn,
+ mapping.source,
+ code,
+ mapping.name));
+ }
+ }
+ };
+
+ /**
+ * Add a chunk of generated JS to this source node.
+ *
+ * @param aChunk A string snippet of generated JS code, another instance of
+ * SourceNode, or an array where each member is one of those things.
+ */
+ SourceNode.prototype.add = function SourceNode_add(aChunk) {
+ if (Array.isArray(aChunk)) {
+ aChunk.forEach(function (chunk) {
+ this.add(chunk);
+ }, this);
+ }
+ else if (aChunk instanceof SourceNode || typeof aChunk === "string") {
+ if (aChunk) {
+ this.children.push(aChunk);
+ }
+ }
+ else {
+ throw new TypeError(
+ "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
+ );
+ }
+ return this;
+ };
+
+ /**
+ * Add a chunk of generated JS to the beginning of this source node.
+ *
+ * @param aChunk A string snippet of generated JS code, another instance of
+ * SourceNode, or an array where each member is one of those things.
+ */
+ SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
+ if (Array.isArray(aChunk)) {
+ for (var i = aChunk.length-1; i >= 0; i--) {
+ this.prepend(aChunk[i]);
+ }
+ }
+ else if (aChunk instanceof SourceNode || typeof aChunk === "string") {
+ this.children.unshift(aChunk);
+ }
+ else {
+ throw new TypeError(
+ "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
+ );
+ }
+ return this;
+ };
+
+ /**
+ * Walk over the tree of JS snippets in this node and its children. The
+ * walking function is called once for each snippet of JS and is passed that
+ * snippet and the its original associated source's line/column location.
+ *
+ * @param aFn The traversal function.
+ */
+ SourceNode.prototype.walk = function SourceNode_walk(aFn) {
+ var chunk;
+ for (var i = 0, len = this.children.length; i < len; i++) {
+ chunk = this.children[i];
+ if (chunk instanceof SourceNode) {
+ chunk.walk(aFn);
+ }
+ else {
+ if (chunk !== '') {
+ aFn(chunk, { source: this.source,
+ line: this.line,
+ column: this.column,
+ name: this.name });
+ }
+ }
+ }
+ };
+
+ /**
+ * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between
+ * each of `this.children`.
+ *
+ * @param aSep The separator.
+ */
+ SourceNode.prototype.join = function SourceNode_join(aSep) {
+ var newChildren;
+ var i;
+ var len = this.children.length;
+ if (len > 0) {
+ newChildren = [];
+ for (i = 0; i < len-1; i++) {
+ newChildren.push(this.children[i]);
+ newChildren.push(aSep);
+ }
+ newChildren.push(this.children[i]);
+ this.children = newChildren;
+ }
+ return this;
+ };
+
+ /**
+ * Call String.prototype.replace on the very right-most source snippet. Useful
+ * for trimming whitespace from the end of a source node, etc.
+ *
+ * @param aPattern The pattern to replace.
+ * @param aReplacement The thing to replace the pattern with.
+ */
+ SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
+ var lastChild = this.children[this.children.length - 1];
+ if (lastChild instanceof SourceNode) {
+ lastChild.replaceRight(aPattern, aReplacement);
+ }
+ else if (typeof lastChild === 'string') {
+ this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
+ }
+ else {
+ this.children.push(''.replace(aPattern, aReplacement));
+ }
+ return this;
+ };
+
+ /**
+ * Set the source content for a source file. This will be added to the SourceMapGenerator
+ * in the sourcesContent field.
+ *
+ * @param aSourceFile The filename of the source file
+ * @param aSourceContent The content of the source file
+ */
+ SourceNode.prototype.setSourceContent =
+ function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
+ this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
+ };
+
+ /**
+ * Walk over the tree of SourceNodes. The walking function is called for each
+ * source file content and is passed the filename and source content.
+ *
+ * @param aFn The traversal function.
+ */
+ SourceNode.prototype.walkSourceContents =
+ function SourceNode_walkSourceContents(aFn) {
+ for (var i = 0, len = this.children.length; i < len; i++) {
+ if (this.children[i] instanceof SourceNode) {
+ this.children[i].walkSourceContents(aFn);
+ }
+ }
+
+ var sources = Object.keys(this.sourceContents);
+ for (var i = 0, len = sources.length; i < len; i++) {
+ aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
+ }
+ };
+
+ /**
+ * Return the string representation of this source node. Walks over the tree
+ * and concatenates all the various snippets together to one string.
+ */
+ SourceNode.prototype.toString = function SourceNode_toString() {
+ var str = "";
+ this.walk(function (chunk) {
+ str += chunk;
+ });
+ return str;
+ };
+
+ /**
+ * Returns the string representation of this source node along with a source
+ * map.
+ */
+ SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
+ var generated = {
+ code: "",
+ line: 1,
+ column: 0
+ };
+ var map = new SourceMapGenerator(aArgs);
+ var sourceMappingActive = false;
+ var lastOriginalSource = null;
+ var lastOriginalLine = null;
+ var lastOriginalColumn = null;
+ var lastOriginalName = null;
+ this.walk(function (chunk, original) {
+ generated.code += chunk;
+ if (original.source !== null
+ && original.line !== null
+ && original.column !== null) {
+ if(lastOriginalSource !== original.source
+ || lastOriginalLine !== original.line
+ || lastOriginalColumn !== original.column
+ || lastOriginalName !== original.name) {
+ map.addMapping({
+ source: original.source,
+ original: {
+ line: original.line,
+ column: original.column
+ },
+ generated: {
+ line: generated.line,
+ column: generated.column
+ },
+ name: original.name
+ });
+ }
+ lastOriginalSource = original.source;
+ lastOriginalLine = original.line;
+ lastOriginalColumn = original.column;
+ lastOriginalName = original.name;
+ sourceMappingActive = true;
+ } else if (sourceMappingActive) {
+ map.addMapping({
+ generated: {
+ line: generated.line,
+ column: generated.column
+ }
+ });
+ lastOriginalSource = null;
+ sourceMappingActive = false;
+ }
+ chunk.match(REGEX_CHARACTER).forEach(function (ch, idx, array) {
+ if (REGEX_NEWLINE.test(ch)) {
+ generated.line++;
+ generated.column = 0;
+ // Mappings end at eol
+ if (idx + 1 === array.length) {
+ lastOriginalSource = null;
+ sourceMappingActive = false;
+ } else if (sourceMappingActive) {
+ map.addMapping({
+ source: original.source,
+ original: {
+ line: original.line,
+ column: original.column
+ },
+ generated: {
+ line: generated.line,
+ column: generated.column
+ },
+ name: original.name
+ });
+ }
+ } else {
+ generated.column += ch.length;
+ }
+ });
+ });
+ this.walkSourceContents(function (sourceFile, sourceContent) {
+ map.setSourceContent(sourceFile, sourceContent);
+ });
+
+ return { code: generated.code, map: map };
+ };
+
+ exports.SourceNode = SourceNode;
+
+});
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+define('source-map/util', function (require, exports, module) {
+
+ /**
+ * This is a helper function for getting values from parameter/options
+ * objects.
+ *
+ * @param args The object we are extracting values from
+ * @param name The name of the property we are getting.
+ * @param defaultValue An optional value to return if the property is missing
+ * from the object. If this is not specified and the property is missing, an
+ * error will be thrown.
+ */
+ function getArg(aArgs, aName, aDefaultValue) {
+ if (aName in aArgs) {
+ return aArgs[aName];
+ } else if (arguments.length === 3) {
+ return aDefaultValue;
+ } else {
+ throw new Error('"' + aName + '" is a required argument.');
+ }
+ }
+ exports.getArg = getArg;
+
+ var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/;
+ var dataUrlRegexp = /^data:.+\,.+$/;
+
+ function urlParse(aUrl) {
+ var match = aUrl.match(urlRegexp);
+ if (!match) {
+ return null;
+ }
+ return {
+ scheme: match[1],
+ auth: match[2],
+ host: match[3],
+ port: match[4],
+ path: match[5]
+ };
+ }
+ exports.urlParse = urlParse;
+
+ function urlGenerate(aParsedUrl) {
+ var url = '';
+ if (aParsedUrl.scheme) {
+ url += aParsedUrl.scheme + ':';
+ }
+ url += '//';
+ if (aParsedUrl.auth) {
+ url += aParsedUrl.auth + '@';
+ }
+ if (aParsedUrl.host) {
+ url += aParsedUrl.host;
+ }
+ if (aParsedUrl.port) {
+ url += ":" + aParsedUrl.port
+ }
+ if (aParsedUrl.path) {
+ url += aParsedUrl.path;
+ }
+ return url;
+ }
+ exports.urlGenerate = urlGenerate;
+
+ /**
+ * Normalizes a path, or the path portion of a URL:
+ *
+ * - Replaces consequtive slashes with one slash.
+ * - Removes unnecessary '.' parts.
+ * - Removes unnecessary '<dir>/..' parts.
+ *
+ * Based on code in the Node.js 'path' core module.
+ *
+ * @param aPath The path or url to normalize.
+ */
+ function normalize(aPath) {
+ var path = aPath;
+ var url = urlParse(aPath);
+ if (url) {
+ if (!url.path) {
+ return aPath;
+ }
+ path = url.path;
+ }
+ var isAbsolute = (path.charAt(0) === '/');
+
+ var parts = path.split(/\/+/);
+ for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
+ part = parts[i];
+ if (part === '.') {
+ parts.splice(i, 1);
+ } else if (part === '..') {
+ up++;
+ } else if (up > 0) {
+ if (part === '') {
+ // The first part is blank if the path is absolute. Trying to go
+ // above the root is a no-op. Therefore we can remove all '..' parts
+ // directly after the root.
+ parts.splice(i + 1, up);
+ up = 0;
+ } else {
+ parts.splice(i, 2);
+ up--;
+ }
+ }
+ }
+ path = parts.join('/');
+
+ if (path === '') {
+ path = isAbsolute ? '/' : '.';
+ }
+
+ if (url) {
+ url.path = path;
+ return urlGenerate(url);
+ }
+ return path;
+ }
+ exports.normalize = normalize;
+
+ /**
+ * Joins two paths/URLs.
+ *
+ * @param aRoot The root path or URL.
+ * @param aPath The path or URL to be joined with the root.
+ *
+ * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a
+ * scheme-relative URL: Then the scheme of aRoot, if any, is prepended
+ * first.
+ * - Otherwise aPath is a path. If aRoot is a URL, then its path portion
+ * is updated with the result and aRoot is returned. Otherwise the result
+ * is returned.
+ * - If aPath is absolute, the result is aPath.
+ * - Otherwise the two paths are joined with a slash.
+ * - Joining for example 'http://' and 'www.example.com' is also supported.
+ */
+ function join(aRoot, aPath) {
+ var aPathUrl = urlParse(aPath);
+ var aRootUrl = urlParse(aRoot);
+ if (aRootUrl) {
+ aRoot = aRootUrl.path || '/';
+ }
+
+ // `join(foo, '//www.example.org')`
+ if (aPathUrl && !aPathUrl.scheme) {
+ if (aRootUrl) {
+ aPathUrl.scheme = aRootUrl.scheme;
+ }
+ return urlGenerate(aPathUrl);
+ }
+
+ if (aPathUrl || aPath.match(dataUrlRegexp)) {
+ return aPath;
+ }
+
+ // `join('http://', 'www.example.com')`
+ if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
+ aRootUrl.host = aPath;
+ return urlGenerate(aRootUrl);
+ }
+
+ var joined = aPath.charAt(0) === '/'
+ ? aPath
+ : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath);
+
+ if (aRootUrl) {
+ aRootUrl.path = joined;
+ return urlGenerate(aRootUrl);
+ }
+ return joined;
+ }
+ exports.join = join;
+
+ /**
+ * Because behavior goes wacky when you set `__proto__` on objects, we
+ * have to prefix all the strings in our set with an arbitrary character.
+ *
+ * See https://github.com/mozilla/source-map/pull/31 and
+ * https://github.com/mozilla/source-map/issues/30
+ *
+ * @param String aStr
+ */
+ function toSetString(aStr) {
+ return '$' + aStr;
+ }
+ exports.toSetString = toSetString;
+
+ function fromSetString(aStr) {
+ return aStr.substr(1);
+ }
+ exports.fromSetString = fromSetString;
+
+ function relative(aRoot, aPath) {
+ aRoot = aRoot.replace(/\/$/, '');
+
+ var url = urlParse(aRoot);
+ if (aPath.charAt(0) == "/" && url && url.path == "/") {
+ return aPath.slice(1);
+ }
+
+ return aPath.indexOf(aRoot + '/') === 0
+ ? aPath.substr(aRoot.length + 1)
+ : aPath;
+ }
+ exports.relative = relative;
+
+ function strcmp(aStr1, aStr2) {
+ var s1 = aStr1 || "";
+ var s2 = aStr2 || "";
+ return (s1 > s2) - (s1 < s2);
+ }
+
+ /**
+ * Comparator between two mappings where the original positions are compared.
+ *
+ * Optionally pass in `true` as `onlyCompareGenerated` to consider two
+ * mappings with the same original source/line/column, but different generated
+ * line and column the same. Useful when searching for a mapping with a
+ * stubbed out mapping.
+ */
+ function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
+ var cmp;
+
+ cmp = strcmp(mappingA.source, mappingB.source);
+ if (cmp) {
+ return cmp;
+ }
+
+ cmp = mappingA.originalLine - mappingB.originalLine;
+ if (cmp) {
+ return cmp;
+ }
+
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
+ if (cmp || onlyCompareOriginal) {
+ return cmp;
+ }
+
+ cmp = strcmp(mappingA.name, mappingB.name);
+ if (cmp) {
+ return cmp;
+ }
+
+ cmp = mappingA.generatedLine - mappingB.generatedLine;
+ if (cmp) {
+ return cmp;
+ }
+
+ return mappingA.generatedColumn - mappingB.generatedColumn;
+ };
+ exports.compareByOriginalPositions = compareByOriginalPositions;
+
+ /**
+ * Comparator between two mappings where the generated positions are
+ * compared.
+ *
+ * Optionally pass in `true` as `onlyCompareGenerated` to consider two
+ * mappings with the same generated line and column, but different
+ * source/name/original line and column the same. Useful when searching for a
+ * mapping with a stubbed out mapping.
+ */
+ function compareByGeneratedPositions(mappingA, mappingB, onlyCompareGenerated) {
+ var cmp;
+
+ cmp = mappingA.generatedLine - mappingB.generatedLine;
+ if (cmp) {
+ return cmp;
+ }
+
+ cmp = mappingA.generatedColumn - mappingB.generatedColumn;
+ if (cmp || onlyCompareGenerated) {
+ return cmp;
+ }
+
+ cmp = strcmp(mappingA.source, mappingB.source);
+ if (cmp) {
+ return cmp;
+ }
+
+ cmp = mappingA.originalLine - mappingB.originalLine;
+ if (cmp) {
+ return cmp;
+ }
+
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
+ if (cmp) {
+ return cmp;
+ }
+
+ return strcmp(mappingA.name, mappingB.name);
+ };
+ exports.compareByGeneratedPositions = compareByGeneratedPositions;
+
+});
+define('source-map', function (require, exports, module) {
+
+/*
+ * Copyright 2009-2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE.txt or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+exports.SourceMapGenerator = require('./source-map/source-map-generator').SourceMapGenerator;
+exports.SourceMapConsumer = require('./source-map/source-map-consumer').SourceMapConsumer;
+exports.SourceNode = require('./source-map/source-node').SourceNode;
+
+});
+
+//Distributed under the BSD license:
+//Copyright 2012 (c) Mihai Bazon <mihai.bazon@gmail.com>
+define('uglifyjs2', ['exports', 'source-map', 'logger', 'env!env/file'], function (exports, MOZ_SourceMap, logger, rjsFile) {
+
+/***********************************************************************
+
+ A JavaScript tokenizer / parser / beautifier / compressor.
+ https://github.com/mishoo/UglifyJS2
+
+ -------------------------------- (C) ---------------------------------
+
+ Author: Mihai Bazon
+ <mihai.bazon@gmail.com>
+ http://mihai.bazon.net/blog
+
+ Distributed under the BSD license:
+
+ Copyright 2012 (c) Mihai Bazon <mihai.bazon@gmail.com>
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ * Redistributions of source code must retain the above
+ copyright notice, this list of conditions and the following
+ disclaimer.
+
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials
+ provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+ THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+
+ ***********************************************************************/
+
+"use strict";
+
+function array_to_hash(a) {
+ var ret = Object.create(null);
+ for (var i = 0; i < a.length; ++i)
+ ret[a[i]] = true;
+ return ret;
+};
+
+function slice(a, start) {
+ return Array.prototype.slice.call(a, start || 0);
+};
+
+function characters(str) {
+ return str.split("");
+};
+
+function member(name, array) {
+ for (var i = array.length; --i >= 0;)
+ if (array[i] == name)
+ return true;
+ return false;
+};
+
+function find_if(func, array) {
+ for (var i = 0, n = array.length; i < n; ++i) {
+ if (func(array[i]))
+ return array[i];
+ }
+};
+
+function repeat_string(str, i) {
+ if (i <= 0) return "";
+ if (i == 1) return str;
+ var d = repeat_string(str, i >> 1);
+ d += d;
+ if (i & 1) d += str;
+ return d;
+};
+
+function DefaultsError(msg, defs) {
+ Error.call(this, msg);
+ this.msg = msg;
+ this.defs = defs;
+};
+DefaultsError.prototype = Object.create(Error.prototype);
+DefaultsError.prototype.constructor = DefaultsError;
+
+DefaultsError.croak = function(msg, defs) {
+ throw new DefaultsError(msg, defs);
+};
+
+function defaults(args, defs, croak) {
+ if (args === true)
+ args = {};
+ var ret = args || {};
+ if (croak) for (var i in ret) if (ret.hasOwnProperty(i) && !defs.hasOwnProperty(i))
+ DefaultsError.croak("`" + i + "` is not a supported option", defs);
+ for (var i in defs) if (defs.hasOwnProperty(i)) {
+ ret[i] = (args && args.hasOwnProperty(i)) ? args[i] : defs[i];
+ }
+ return ret;
+};
+
+function merge(obj, ext) {
+ for (var i in ext) if (ext.hasOwnProperty(i)) {
+ obj[i] = ext[i];
+ }
+ return obj;
+};
+
+function noop() {};
+
+var MAP = (function(){
+ function MAP(a, f, backwards) {
+ var ret = [], top = [], i;
+ function doit() {
+ var val = f(a[i], i);
+ var is_last = val instanceof Last;
+ if (is_last) val = val.v;
+ if (val instanceof AtTop) {
+ val = val.v;
+ if (val instanceof Splice) {
+ top.push.apply(top, backwards ? val.v.slice().reverse() : val.v);
+ } else {
+ top.push(val);
+ }
+ }
+ else if (val !== skip) {
+ if (val instanceof Splice) {
+ ret.push.apply(ret, backwards ? val.v.slice().reverse() : val.v);
+ } else {
+ ret.push(val);
+ }
+ }
+ return is_last;
+ };
+ if (a instanceof Array) {
+ if (backwards) {
+ for (i = a.length; --i >= 0;) if (doit()) break;
+ ret.reverse();
+ top.reverse();
+ } else {
+ for (i = 0; i < a.length; ++i) if (doit()) break;
+ }
+ }
+ else {
+ for (i in a) if (a.hasOwnProperty(i)) if (doit()) break;
+ }
+ return top.concat(ret);
+ };
+ MAP.at_top = function(val) { return new AtTop(val) };
+ MAP.splice = function(val) { return new Splice(val) };
+ MAP.last = function(val) { return new Last(val) };
+ var skip = MAP.skip = {};
+ function AtTop(val) { this.v = val };
+ function Splice(val) { this.v = val };
+ function Last(val) { this.v = val };
+ return MAP;
+})();
+
+function push_uniq(array, el) {
+ if (array.indexOf(el) < 0)
+ array.push(el);
+};
+
+function string_template(text, props) {
+ return text.replace(/\{(.+?)\}/g, function(str, p){
+ return props[p];
+ });
+};
+
+function remove(array, el) {
+ for (var i = array.length; --i >= 0;) {
+ if (array[i] === el) array.splice(i, 1);
+ }
+};
+
+function mergeSort(array, cmp) {
+ if (array.length < 2) return array.slice();
+ function merge(a, b) {
+ var r = [], ai = 0, bi = 0, i = 0;
+ while (ai < a.length && bi < b.length) {
+ cmp(a[ai], b[bi]) <= 0
+ ? r[i++] = a[ai++]
+ : r[i++] = b[bi++];
+ }
+ if (ai < a.length) r.push.apply(r, a.slice(ai));
+ if (bi < b.length) r.push.apply(r, b.slice(bi));
+ return r;
+ };
+ function _ms(a) {
+ if (a.length <= 1)
+ return a;
+ var m = Math.floor(a.length / 2), left = a.slice(0, m), right = a.slice(m);
+ left = _ms(left);
+ right = _ms(right);
+ return merge(left, right);
+ };
+ return _ms(array);
+};
+
+function set_difference(a, b) {
+ return a.filter(function(el){
+ return b.indexOf(el) < 0;
+ });
+};
+
+function set_intersection(a, b) {
+ return a.filter(function(el){
+ return b.indexOf(el) >= 0;
+ });
+};
+
+// this function is taken from Acorn [1], written by Marijn Haverbeke
+// [1] https://github.com/marijnh/acorn
+function makePredicate(words) {
+ if (!(words instanceof Array)) words = words.split(" ");
+ var f = "", cats = [];
+ out: for (var i = 0; i < words.length; ++i) {
+ for (var j = 0; j < cats.length; ++j)
+ if (cats[j][0].length == words[i].length) {
+ cats[j].push(words[i]);
+ continue out;
+ }
+ cats.push([words[i]]);
+ }
+ function compareTo(arr) {
+ if (arr.length == 1) return f += "return str === " + JSON.stringify(arr[0]) + ";";
+ f += "switch(str){";
+ for (var i = 0; i < arr.length; ++i) f += "case " + JSON.stringify(arr[i]) + ":";
+ f += "return true}return false;";
+ }
+ // When there are more than three length categories, an outer
+ // switch first dispatches on the lengths, to save on comparisons.
+ if (cats.length > 3) {
+ cats.sort(function(a, b) {return b.length - a.length;});
+ f += "switch(str.length){";
+ for (var i = 0; i < cats.length; ++i) {
+ var cat = cats[i];
+ f += "case " + cat[0].length + ":";
+ compareTo(cat);
+ }
+ f += "}";
+ // Otherwise, simply generate a flat `switch` statement.
+ } else {
+ compareTo(words);
+ }
+ return new Function("str", f);
+};
+
+function all(array, predicate) {
+ for (var i = array.length; --i >= 0;)
+ if (!predicate(array[i]))
+ return false;
+ return true;
+};
+
+function Dictionary() {
+ this._values = Object.create(null);
+ this._size = 0;
+};
+Dictionary.prototype = {
+ set: function(key, val) {
+ if (!this.has(key)) ++this._size;
+ this._values["$" + key] = val;
+ return this;
+ },
+ add: function(key, val) {
+ if (this.has(key)) {
+ this.get(key).push(val);
+ } else {
+ this.set(key, [ val ]);
+ }
+ return this;
+ },
+ get: function(key) { return this._values["$" + key] },
+ del: function(key) {
+ if (this.has(key)) {
+ --this._size;
+ delete this._values["$" + key];
+ }
+ return this;
+ },
+ has: function(key) { return ("$" + key) in this._values },
+ each: function(f) {
+ for (var i in this._values)
+ f(this._values[i], i.substr(1));
+ },
+ size: function() {
+ return this._size;
+ },
+ map: function(f) {
+ var ret = [];
+ for (var i in this._values)
+ ret.push(f(this._values[i], i.substr(1)));
+ return ret;
+ }
+};
+
+/***********************************************************************
+
+ A JavaScript tokenizer / parser / beautifier / compressor.
+ https://github.com/mishoo/UglifyJS2
+
+ -------------------------------- (C) ---------------------------------
+
+ Author: Mihai Bazon
+ <mihai.bazon@gmail.com>
+ http://mihai.bazon.net/blog
+
+ Distributed under the BSD license:
+
+ Copyright 2012 (c) Mihai Bazon <mihai.bazon@gmail.com>
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ * Redistributions of source code must retain the above
+ copyright notice, this list of conditions and the following
+ disclaimer.
+
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials
+ provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+ THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+
+ ***********************************************************************/
+
+"use strict";
+
+function DEFNODE(type, props, methods, base) {
+ if (arguments.length < 4) base = AST_Node;
+ if (!props) props = [];
+ else props = props.split(/\s+/);
+ var self_props = props;
+ if (base && base.PROPS)
+ props = props.concat(base.PROPS);
+ var code = "return function AST_" + type + "(props){ if (props) { ";
+ for (var i = props.length; --i >= 0;) {
+ code += "this." + props[i] + " = props." + props[i] + ";";
+ }
+ var proto = base && new base;
+ if (proto && proto.initialize || (methods && methods.initialize))
+ code += "this.initialize();";
+ code += "}}";
+ var ctor = new Function(code)();
+ if (proto) {
+ ctor.prototype = proto;
+ ctor.BASE = base;
+ }
+ if (base) base.SUBCLASSES.push(ctor);
+ ctor.prototype.CTOR = ctor;
+ ctor.PROPS = props || null;
+ ctor.SELF_PROPS = self_props;
+ ctor.SUBCLASSES = [];
+ if (type) {
+ ctor.prototype.TYPE = ctor.TYPE = type;
+ }
+ if (methods) for (i in methods) if (methods.hasOwnProperty(i)) {
+ if (/^\$/.test(i)) {
+ ctor[i.substr(1)] = methods[i];
+ } else {
+ ctor.prototype[i] = methods[i];
+ }
+ }
+ ctor.DEFMETHOD = function(name, method) {
+ this.prototype[name] = method;
+ };
+ return ctor;
+};
+
+var AST_Token = DEFNODE("Token", "type value line col pos endpos nlb comments_before file", {
+}, null);
+
+var AST_Node = DEFNODE("Node", "start end", {
+ clone: function() {
+ return new this.CTOR(this);
+ },
+ $documentation: "Base class of all AST nodes",
+ $propdoc: {
+ start: "[AST_Token] The first token of this node",
+ end: "[AST_Token] The last token of this node"
+ },
+ _walk: function(visitor) {
+ return visitor._visit(this);
+ },
+ walk: function(visitor) {
+ return this._walk(visitor); // not sure the indirection will be any help
+ }
+}, null);
+
+AST_Node.warn_function = null;
+AST_Node.warn = function(txt, props) {
+ if (AST_Node.warn_function)
+ AST_Node.warn_function(string_template(txt, props));
+};
+
+/* -----[ statements ]----- */
+
+var AST_Statement = DEFNODE("Statement", null, {
+ $documentation: "Base class of all statements",
+});
+
+var AST_Debugger = DEFNODE("Debugger", null, {
+ $documentation: "Represents a debugger statement",
+}, AST_Statement);
+
+var AST_Directive = DEFNODE("Directive", "value scope", {
+ $documentation: "Represents a directive, like \"use strict\";",
+ $propdoc: {
+ value: "[string] The value of this directive as a plain string (it's not an AST_String!)",
+ scope: "[AST_Scope/S] The scope that this directive affects"
+ },
+}, AST_Statement);
+
+var AST_SimpleStatement = DEFNODE("SimpleStatement", "body", {
+ $documentation: "A statement consisting of an expression, i.e. a = 1 + 2",
+ $propdoc: {
+ body: "[AST_Node] an expression node (should not be instanceof AST_Statement)"
+ },
+ _walk: function(visitor) {
+ return visitor._visit(this, function(){
+ this.body._walk(visitor);
+ });
+ }
+}, AST_Statement);
+
+function walk_body(node, visitor) {
+ if (node.body instanceof AST_Statement) {
+ node.body._walk(visitor);
+ }
+ else node.body.forEach(function(stat){
+ stat._walk(visitor);
+ });
+};
+
+var AST_Block = DEFNODE("Block", "body", {
+ $documentation: "A body of statements (usually bracketed)",
+ $propdoc: {
+ body: "[AST_Statement*] an array of statements"
+ },
+ _walk: function(visitor) {
+ return visitor._visit(this, function(){
+ walk_body(this, visitor);
+ });
+ }
+}, AST_Statement);
+
+var AST_BlockStatement = DEFNODE("BlockStatement", null, {
+ $documentation: "A block statement",
+}, AST_Block);
+
+var AST_EmptyStatement = DEFNODE("EmptyStatement", null, {
+ $documentation: "The empty statement (empty block or simply a semicolon)",
+ _walk: function(visitor) {
+ return visitor._visit(this);
+ }
+}, AST_Statement);
+
+var AST_StatementWithBody = DEFNODE("StatementWithBody", "body", {
+ $documentation: "Base class for all statements that contain one nested body: `For`, `ForIn`, `Do`, `While`, `With`",
+ $propdoc: {
+ body: "[AST_Statement] the body; this should always be present, even if it's an AST_EmptyStatement"
+ },
+ _walk: function(visitor) {
+ return visitor._visit(this, function(){
+ this.body._walk(visitor);
+ });
+ }
+}, AST_Statement);
+
+var AST_LabeledStatement = DEFNODE("LabeledStatement", "label", {
+ $documentation: "Statement with a label",
+ $propdoc: {
+ label: "[AST_Label] a label definition"
+ },
+ _walk: function(visitor) {
+ return visitor._visit(this, function(){
+ this.label._walk(visitor);
+ this.body._walk(visitor);
+ });
+ }
+}, AST_StatementWithBody);
+
+var AST_IterationStatement = DEFNODE("IterationStatement", null, {
+ $documentation: "Internal class. All loops inherit from it."
+}, AST_StatementWithBody);
+
+var AST_DWLoop = DEFNODE("DWLoop", "condition", {
+ $documentation: "Base class for do/while statements",
+ $propdoc: {
+ condition: "[AST_Node] the loop condition. Should not be instanceof AST_Statement"
+ },
+ _walk: function(visitor) {
+ return visitor._visit(this, function(){
+ this.condition._walk(visitor);
+ this.body._walk(visitor);
+ });
+ }
+}, AST_IterationStatement);
+
+var AST_Do = DEFNODE("Do", null, {
+ $documentation: "A `do` statement",
+}, AST_DWLoop);
+
+var AST_While = DEFNODE("While", null, {
+ $documentation: "A `while` statement",
+}, AST_DWLoop);
+
+var AST_For = DEFNODE("For", "init condition step", {
+ $documentation: "A `for` statement",
+ $propdoc: {
+ init: "[AST_Node?] the `for` initialization code, or null if empty",
+ condition: "[AST_Node?] the `for` termination clause, or null if empty",
+ step: "[AST_Node?] the `for` update clause, or null if empty"
+ },
+ _walk: function(visitor) {
+ return visitor._visit(this, function(){
+ if (this.init) this.init._walk(visitor);
+ if (this.condition) this.condition._walk(visitor);
+ if (this.step) this.step._walk(visitor);
+ this.body._walk(visitor);
+ });
+ }
+}, AST_IterationStatement);
+
+var AST_ForIn = DEFNODE("ForIn", "init name object", {
+ $documentation: "A `for ... in` statement",
+ $propdoc: {
+ init: "[AST_Node] the `for/in` initialization code",
+ name: "[AST_SymbolRef?] the loop variable, only if `init` is AST_Var",
+ object: "[AST_Node] the object that we're looping through"
+ },
+ _walk: function(visitor) {
+ return visitor._visit(this, function(){
+ this.init._walk(visitor);
+ this.object._walk(visitor);
+ this.body._walk(visitor);
+ });
+ }
+}, AST_IterationStatement);
+
+var AST_With = DEFNODE("With", "expression", {
+ $documentation: "A `with` statement",
+ $propdoc: {
+ expression: "[AST_Node] the `with` expression"
+ },
+ _walk: function(visitor) {
+ return visitor._visit(this, function(){
+ this.expression._walk(visitor);
+ this.body._walk(visitor);
+ });
+ }
+}, AST_StatementWithBody);
+
+/* -----[ scope and functions ]----- */
+
+var AST_Scope = DEFNODE("Scope", "directives variables functions uses_with uses_eval parent_scope enclosed cname", {
+ $documentation: "Base class for all statements introducing a lexical scope",
+ $propdoc: {
+ directives: "[string*/S] an array of directives declared in this scope",
+ variables: "[Object/S] a map of name -> SymbolDef for all variables/functions defined in this scope",
+ functions: "[Object/S] like `variables`, but only lists function declarations",
+ uses_with: "[boolean/S] tells whether this scope uses the `with` statement",
+ uses_eval: "[boolean/S] tells whether this scope contains a direct call to the global `eval`",
+ parent_scope: "[AST_Scope?/S] link to the parent scope",
+ enclosed: "[SymbolDef*/S] a list of all symbol definitions that are accessed from this scope or any subscopes",
+ cname: "[integer/S] current index for mangling variables (used internally by the mangler)",
+ },
+}, AST_Block);
+
+var AST_Toplevel = DEFNODE("Toplevel", "globals", {
+ $documentation: "The toplevel scope",
+ $propdoc: {
+ globals: "[Object/S] a map of name -> SymbolDef for all undeclared names",
+ },
+ wrap_enclose: function(arg_parameter_pairs) {
+ var self = this;
+ var args = [];
+ var parameters = [];
+
+ arg_parameter_pairs.forEach(function(pair) {
+ var splitAt = pair.lastIndexOf(":");
+
+ args.push(pair.substr(0, splitAt));
+ parameters.push(pair.substr(splitAt + 1));
+ });
+
+ var wrapped_tl = "(function(" + parameters.join(",") + "){ '$ORIG'; })(" + args.join(",") + ")";
+ wrapped_tl = parse(wrapped_tl);
+ wrapped_tl = wrapped_tl.transform(new TreeTransformer(function before(node){
+ if (node instanceof AST_Directive && node.value == "$ORIG") {
+ return MAP.splice(self.body);
+ }
+ }));
+ return wrapped_tl;
+ },
+ wrap_commonjs: function(name, export_all) {
+ var self = this;
+ var to_export = [];
+ if (export_all) {
+ self.figure_out_scope();
+ self.walk(new TreeWalker(function(node){
+ if (node instanceof AST_SymbolDeclaration && node.definition().global) {
+ if (!find_if(function(n){ return n.name == node.name }, to_export))
+ to_export.push(node);
+ }
+ }));
+ }
+ var wrapped_tl = "(function(exports, global){ global['" + name + "'] = exports; '$ORIG'; '$EXPORTS'; }({}, (function(){return this}())))";
+ wrapped_tl = parse(wrapped_tl);
+ wrapped_tl = wrapped_tl.transform(new TreeTransformer(function before(node){
+ if (node instanceof AST_SimpleStatement) {
+ node = node.body;
+ if (node instanceof AST_String) switch (node.getValue()) {
+ case "$ORIG":
+ return MAP.splice(self.body);
+ case "$EXPORTS":
+ var body = [];
+ to_export.forEach(function(sym){
+ body.push(new AST_SimpleStatement({
+ body: new AST_Assign({
+ left: new AST_Sub({
+ expression: new AST_SymbolRef({ name: "exports" }),
+ property: new AST_String({ value: sym.name }),
+ }),
+ operator: "=",
+ right: new AST_SymbolRef(sym),
+ }),
+ }));
+ });
+ return MAP.splice(body);
+ }
+ }
+ }));
+ return wrapped_tl;
+ }
+}, AST_Scope);
+
+var AST_Lambda = DEFNODE("Lambda", "name argnames uses_arguments", {
+ $documentation: "Base class for functions",
+ $propdoc: {
+ name: "[AST_SymbolDeclaration?] the name of this function",
+ argnames: "[AST_SymbolFunarg*] array of function arguments",
+ uses_arguments: "[boolean/S] tells whether this function accesses the arguments array"
+ },
+ _walk: function(visitor) {
+ return visitor._visit(this, function(){
+ if (this.name) this.name._walk(visitor);
+ this.argnames.forEach(function(arg){
+ arg._walk(visitor);
+ });
+ walk_body(this, visitor);
+ });
+ }
+}, AST_Scope);
+
+var AST_Accessor = DEFNODE("Accessor", null, {
+ $documentation: "A setter/getter function. The `name` property is always null."
+}, AST_Lambda);
+
+var AST_Function = DEFNODE("Function", null, {
+ $documentation: "A function expression"
+}, AST_Lambda);
+
+var AST_Defun = DEFNODE("Defun", null, {
+ $documentation: "A function definition"
+}, AST_Lambda);
+
+/* -----[ JUMPS ]----- */
+
+var AST_Jump = DEFNODE("Jump", null, {
+ $documentation: "Base class for “jumps” (for now that's `return`, `throw`, `break` and `continue`)"
+}, AST_Statement);
+
+var AST_Exit = DEFNODE("Exit", "value", {
+ $documentation: "Base class for “exits” (`return` and `throw`)",
+ $propdoc: {
+ value: "[AST_Node?] the value returned or thrown by this statement; could be null for AST_Return"
+ },
+ _walk: function(visitor) {
+ return visitor._visit(this, this.value && function(){
+ this.value._walk(visitor);
+ });
+ }
+}, AST_Jump);
+
+var AST_Return = DEFNODE("Return", null, {
+ $documentation: "A `return` statement"
+}, AST_Exit);
+
+var AST_Throw = DEFNODE("Throw", null, {
+ $documentation: "A `throw` statement"
+}, AST_Exit);
+
+var AST_LoopControl = DEFNODE("LoopControl", "label", {
+ $documentation: "Base class for loop control statements (`break` and `continue`)",
+ $propdoc: {
+ label: "[AST_LabelRef?] the label, or null if none",
+ },
+ _walk: function(visitor) {
+ return visitor._visit(this, this.label && function(){
+ this.label._walk(visitor);
+ });
+ }
+}, AST_Jump);
+
+var AST_Break = DEFNODE("Break", null, {
+ $documentation: "A `break` statement"
+}, AST_LoopControl);
+
+var AST_Continue = DEFNODE("Continue", null, {
+ $documentation: "A `continue` statement"
+}, AST_LoopControl);
+
+/* -----[ IF ]----- */
+
+var AST_If = DEFNODE("If", "condition alternative", {
+ $documentation: "A `if` statement",
+ $propdoc: {
+ condition: "[AST_Node] the `if` condition",
+ alternative: "[AST_Statement?] the `else` part, or null if not present"
+ },
+ _walk: function(visitor) {
+ return visitor._visit(this, function(){
+ this.condition._walk(visitor);
+ this.body._walk(visitor);
+ if (this.alternative) this.alternative._walk(visitor);
+ });
+ }
+}, AST_StatementWithBody);
+
+/* -----[ SWITCH ]----- */
+
+var AST_Switch = DEFNODE("Switch", "expression", {
+ $documentation: "A `switch` statement",
+ $propdoc: {
+ expression: "[AST_Node] the `switch` “discriminant”"
+ },
+ _walk: function(visitor) {
+ return visitor._visit(this, function(){
+ this.expression._walk(visitor);
+ walk_body(this, visitor);
+ });
+ }
+}, AST_Block);
+
+var AST_SwitchBranch = DEFNODE("SwitchBranch", null, {
+ $documentation: "Base class for `switch` branches",
+}, AST_Block);
+
+var AST_Default = DEFNODE("Default", null, {
+ $documentation: "A `default` switch branch",
+}, AST_SwitchBranch);
+
+var AST_Case = DEFNODE("Case", "expression", {
+ $documentation: "A `case` switch branch",
+ $propdoc: {
+ expression: "[AST_Node] the `case` expression"
+ },
+ _walk: function(visitor) {
+ return visitor._visit(this, function(){
+ this.expression._walk(visitor);
+ walk_body(this, visitor);
+ });
+ }
+}, AST_SwitchBranch);
+
+/* -----[ EXCEPTIONS ]----- */
+
+var AST_Try = DEFNODE("Try", "bcatch bfinally", {
+ $documentation: "A `try` statement",
+ $propdoc: {
+ bcatch: "[AST_Catch?] the catch block, or null if not present",
+ bfinally: "[AST_Finally?] the finally block, or null if not present"
+ },
+ _walk: function(visitor) {
+ return visitor._visit(this, function(){
+ walk_body(this, visitor);
+ if (this.bcatch) this.bcatch._walk(visitor);
+ if (this.bfinally) this.bfinally._walk(visitor);
+ });
+ }
+}, AST_Block);
+
+var AST_Catch = DEFNODE("Catch", "argname", {
+ $documentation: "A `catch` node; only makes sense as part of a `try` statement",
+ $propdoc: {
+ argname: "[AST_SymbolCatch] symbol for the exception"
+ },
+ _walk: function(visitor) {
+ return visitor._visit(this, function(){
+ this.argname._walk(visitor);
+ walk_body(this, visitor);
+ });
+ }
+}, AST_Block);
+
+var AST_Finally = DEFNODE("Finally", null, {
+ $documentation: "A `finally` node; only makes sense as part of a `try` statement"
+}, AST_Block);
+
+/* -----[ VAR/CONST ]----- */
+
+var AST_Definitions = DEFNODE("Definitions", "definitions", {
+ $documentation: "Base class for `var` or `const` nodes (variable declarations/initializations)",
+ $propdoc: {
+ definitions: "[AST_VarDef*] array of variable definitions"
+ },
+ _walk: function(visitor) {
+ return visitor._visit(this, function(){
+ this.definitions.forEach(function(def){
+ def._walk(visitor);
+ });
+ });
+ }
+}, AST_Statement);
+
+var AST_Var = DEFNODE("Var", null, {
+ $documentation: "A `var` statement"
+}, AST_Definitions);
+
+var AST_Const = DEFNODE("Const", null, {
+ $documentation: "A `const` statement"
+}, AST_Definitions);
+
+var AST_VarDef = DEFNODE("VarDef", "name value", {
+ $documentation: "A variable declaration; only appears in a AST_Definitions node",
+ $propdoc: {
+ name: "[AST_SymbolVar|AST_SymbolConst] name of the variable",
+ value: "[AST_Node?] initializer, or null of there's no initializer"
+ },
+ _walk: function(visitor) {
+ return visitor._visit(this, function(){
+ this.name._walk(visitor);
+ if (this.value) this.value._walk(visitor);
+ });
+ }
+});
+
+/* -----[ OTHER ]----- */
+
+var AST_Call = DEFNODE("Call", "expression args", {
+ $documentation: "A function call expression",
+ $propdoc: {
+ expression: "[AST_Node] expression to invoke as function",
+ args: "[AST_Node*] array of arguments"
+ },
+ _walk: function(visitor) {
+ return visitor._visit(this, function(){
+ this.expression._walk(visitor);
+ this.args.forEach(function(arg){
+ arg._walk(visitor);
+ });
+ });
+ }
+});
+
+var AST_New = DEFNODE("New", null, {
+ $documentation: "An object instantiation. Derives from a function call since it has exactly the same properties"
+}, AST_Call);
+
+var AST_Seq = DEFNODE("Seq", "car cdr", {
+ $documentation: "A sequence expression (two comma-separated expressions)",
+ $propdoc: {
+ car: "[AST_Node] first element in sequence",
+ cdr: "[AST_Node] second element in sequence"
+ },
+ $cons: function(x, y) {
+ var seq = new AST_Seq(x);
+ seq.car = x;
+ seq.cdr = y;
+ return seq;
+ },
+ $from_array: function(array) {
+ if (array.length == 0) return null;
+ if (array.length == 1) return array[0].clone();
+ var list = null;
+ for (var i = array.length; --i >= 0;) {
+ list = AST_Seq.cons(array[i], list);
+ }
+ var p = list;
+ while (p) {
+ if (p.cdr && !p.cdr.cdr) {
+ p.cdr = p.cdr.car;
+ break;
+ }
+ p = p.cdr;
+ }
+ return list;
+ },
+ to_array: function() {
+ var p = this, a = [];
+ while (p) {
+ a.push(p.car);
+ if (p.cdr && !(p.cdr instanceof AST_Seq)) {
+ a.push(p.cdr);
+ break;
+ }
+ p = p.cdr;
+ }
+ return a;
+ },
+ add: function(node) {
+ var p = this;
+ while (p) {
+ if (!(p.cdr instanceof AST_Seq)) {
+ var cell = AST_Seq.cons(p.cdr, node);
+ return p.cdr = cell;
+ }
+ p = p.cdr;
+ }
+ },
+ _walk: function(visitor) {
+ return visitor._visit(this, function(){
+ this.car._walk(visitor);
+ if (this.cdr) this.cdr._walk(visitor);
+ });
+ }
+});
+
+var AST_PropAccess = DEFNODE("PropAccess", "expression property", {
+ $documentation: "Base class for property access expressions, i.e. `a.foo` or `a[\"foo\"]`",
+ $propdoc: {
+ expression: "[AST_Node] the “container” expression",
+ property: "[AST_Node|string] the property to access. For AST_Dot this is always a plain string, while for AST_Sub it's an arbitrary AST_Node"
+ }
+});
+
+var AST_Dot = DEFNODE("Dot", null, {
+ $documentation: "A dotted property access expression",
+ _walk: function(visitor) {
+ return visitor._visit(this, function(){
+ this.expression._walk(visitor);
+ });
+ }
+}, AST_PropAccess);
+
+var AST_Sub = DEFNODE("Sub", null, {
+ $documentation: "Index-style property access, i.e. `a[\"foo\"]`",
+ _walk: function(visitor) {
+ return visitor._visit(this, function(){
+ this.expression._walk(visitor);
+ this.property._walk(visitor);
+ });
+ }
+}, AST_PropAccess);
+
+var AST_Unary = DEFNODE("Unary", "operator expression", {
+ $documentation: "Base class for unary expressions",
+ $propdoc: {
+ operator: "[string] the operator",
+ expression: "[AST_Node] expression that this unary operator applies to"
+ },
+ _walk: function(visitor) {
+ return visitor._visit(this, function(){
+ this.expression._walk(visitor);
+ });
+ }
+});
+
+var AST_UnaryPrefix = DEFNODE("UnaryPrefix", null, {
+ $documentation: "Unary prefix expression, i.e. `typeof i` or `++i`"
+}, AST_Unary);
+
+var AST_UnaryPostfix = DEFNODE("UnaryPostfix", null, {
+ $documentation: "Unary postfix expression, i.e. `i++`"
+}, AST_Unary);
+
+var AST_Binary = DEFNODE("Binary", "left operator right", {
+ $documentation: "Binary expression, i.e. `a + b`",
+ $propdoc: {
+ left: "[AST_Node] left-hand side expression",
+ operator: "[string] the operator",
+ right: "[AST_Node] right-hand side expression"
+ },
+ _walk: function(visitor) {
+ return visitor._visit(this, function(){
+ this.left._walk(visitor);
+ this.right._walk(visitor);
+ });
+ }
+});
+
+var AST_Conditional = DEFNODE("Conditional", "condition consequent alternative", {
+ $documentation: "Conditional expression using the ternary operator, i.e. `a ? b : c`",
+ $propdoc: {
+ condition: "[AST_Node]",
+ consequent: "[AST_Node]",
+ alternative: "[AST_Node]"
+ },
+ _walk: function(visitor) {
+ return visitor._visit(this, function(){
+ this.condition._walk(visitor);
+ this.consequent._walk(visitor);
+ this.alternative._walk(visitor);
+ });
+ }
+});
+
+var AST_Assign = DEFNODE("Assign", null, {
+ $documentation: "An assignment expression — `a = b + 5`",
+}, AST_Binary);
+
+/* -----[ LITERALS ]----- */
+
+var AST_Array = DEFNODE("Array", "elements", {
+ $documentation: "An array literal",
+ $propdoc: {
+ elements: "[AST_Node*] array of elements"
+ },
+ _walk: function(visitor) {
+ return visitor._visit(this, function(){
+ this.elements.forEach(function(el){
+ el._walk(visitor);
+ });
+ });
+ }
+});
+
+var AST_Object = DEFNODE("Object", "properties", {
+ $documentation: "An object literal",
+ $propdoc: {
+ properties: "[AST_ObjectProperty*] array of properties"
+ },
+ _walk: function(visitor) {
+ return visitor._visit(this, function(){
+ this.properties.forEach(function(prop){
+ prop._walk(visitor);
+ });
+ });
+ }
+});
+
+var AST_ObjectProperty = DEFNODE("ObjectProperty", "key value", {
+ $documentation: "Base class for literal object properties",
+ $propdoc: {
+ key: "[string] the property name converted to a string for ObjectKeyVal. For setters and getters this is an arbitrary AST_Node.",
+ value: "[AST_Node] property value. For setters and getters this is an AST_Function."
+ },
+ _walk: function(visitor) {
+ return visitor._visit(this, function(){
+ this.value._walk(visitor);
+ });
+ }
+});
+
+var AST_ObjectKeyVal = DEFNODE("ObjectKeyVal", null, {
+ $documentation: "A key: value object property",
+}, AST_ObjectProperty);
+
+var AST_ObjectSetter = DEFNODE("ObjectSetter", null, {
+ $documentation: "An object setter property",
+}, AST_ObjectProperty);
+
+var AST_ObjectGetter = DEFNODE("ObjectGetter", null, {
+ $documentation: "An object getter property",
+}, AST_ObjectProperty);
+
+var AST_Symbol = DEFNODE("Symbol", "scope name thedef", {
+ $propdoc: {
+ name: "[string] name of this symbol",
+ scope: "[AST_Scope/S] the current scope (not necessarily the definition scope)",
+ thedef: "[SymbolDef/S] the definition of this symbol"
+ },
+ $documentation: "Base class for all symbols",
+});
+
+var AST_SymbolAccessor = DEFNODE("SymbolAccessor", null, {
+ $documentation: "The name of a property accessor (setter/getter function)"
+}, AST_Symbol);
+
+var AST_SymbolDeclaration = DEFNODE("SymbolDeclaration", "init", {
+ $documentation: "A declaration symbol (symbol in var/const, function name or argument, symbol in catch)",
+ $propdoc: {
+ init: "[AST_Node*/S] array of initializers for this declaration."
+ }
+}, AST_Symbol);
+
+var AST_SymbolVar = DEFNODE("SymbolVar", null, {
+ $documentation: "Symbol defining a variable",
+}, AST_SymbolDeclaration);
+
+var AST_SymbolConst = DEFNODE("SymbolConst", null, {
+ $documentation: "A constant declaration"
+}, AST_SymbolDeclaration);
+
+var AST_SymbolFunarg = DEFNODE("SymbolFunarg", null, {
+ $documentation: "Symbol naming a function argument",
+}, AST_SymbolVar);
+
+var AST_SymbolDefun = DEFNODE("SymbolDefun", null, {
+ $documentation: "Symbol defining a function",
+}, AST_SymbolDeclaration);
+
+var AST_SymbolLambda = DEFNODE("SymbolLambda", null, {
+ $documentation: "Symbol naming a function expression",
+}, AST_SymbolDeclaration);
+
+var AST_SymbolCatch = DEFNODE("SymbolCatch", null, {
+ $documentation: "Symbol naming the exception in catch",
+}, AST_SymbolDeclaration);
+
+var AST_Label = DEFNODE("Label", "references", {
+ $documentation: "Symbol naming a label (declaration)",
+ $propdoc: {
+ references: "[AST_LoopControl*] a list of nodes referring to this label"
+ },
+ initialize: function() {
+ this.references = [];
+ this.thedef = this;
+ }
+}, AST_Symbol);
+
+var AST_SymbolRef = DEFNODE("SymbolRef", null, {
+ $documentation: "Reference to some symbol (not definition/declaration)",
+}, AST_Symbol);
+
+var AST_LabelRef = DEFNODE("LabelRef", null, {
+ $documentation: "Reference to a label symbol",
+}, AST_Symbol);
+
+var AST_This = DEFNODE("This", null, {
+ $documentation: "The `this` symbol",
+}, AST_Symbol);
+
+var AST_Constant = DEFNODE("Constant", null, {
+ $documentation: "Base class for all constants",
+ getValue: function() {
+ return this.value;
+ }
+});
+
+var AST_String = DEFNODE("String", "value", {
+ $documentation: "A string literal",
+ $propdoc: {
+ value: "[string] the contents of this string"
+ }
+}, AST_Constant);
+
+var AST_Number = DEFNODE("Number", "value", {
+ $documentation: "A number literal",
+ $propdoc: {
+ value: "[number] the numeric value"
+ }
+}, AST_Constant);
+
+var AST_RegExp = DEFNODE("RegExp", "value", {
+ $documentation: "A regexp literal",
+ $propdoc: {
+ value: "[RegExp] the actual regexp"
+ }
+}, AST_Constant);
+
+var AST_Atom = DEFNODE("Atom", null, {
+ $documentation: "Base class for atoms",
+}, AST_Constant);
+
+var AST_Null = DEFNODE("Null", null, {
+ $documentation: "The `null` atom",
+ value: null
+}, AST_Atom);
+
+var AST_NaN = DEFNODE("NaN", null, {
+ $documentation: "The impossible value",
+ value: 0/0
+}, AST_Atom);
+
+var AST_Undefined = DEFNODE("Undefined", null, {
+ $documentation: "The `undefined` value",
+ value: (function(){}())
+}, AST_Atom);
+
+var AST_Hole = DEFNODE("Hole", null, {
+ $documentation: "A hole in an array",
+ value: (function(){}())
+}, AST_Atom);
+
+var AST_Infinity = DEFNODE("Infinity", null, {
+ $documentation: "The `Infinity` value",
+ value: 1/0
+}, AST_Atom);
+
+var AST_Boolean = DEFNODE("Boolean", null, {
+ $documentation: "Base class for booleans",
+}, AST_Atom);
+
+var AST_False = DEFNODE("False", null, {
+ $documentation: "The `false` atom",
+ value: false
+}, AST_Boolean);
+
+var AST_True = DEFNODE("True", null, {
+ $documentation: "The `true` atom",
+ value: true
+}, AST_Boolean);
+
+/* -----[ TreeWalker ]----- */
+
+function TreeWalker(callback) {
+ this.visit = callback;
+ this.stack = [];
+};
+TreeWalker.prototype = {
+ _visit: function(node, descend) {
+ this.stack.push(node);
+ var ret = this.visit(node, descend ? function(){
+ descend.call(node);
+ } : noop);
+ if (!ret && descend) {
+ descend.call(node);
+ }
+ this.stack.pop();
+ return ret;
+ },
+ parent: function(n) {
+ return this.stack[this.stack.length - 2 - (n || 0)];
+ },
+ push: function (node) {
+ this.stack.push(node);
+ },
+ pop: function() {
+ return this.stack.pop();
+ },
+ self: function() {
+ return this.stack[this.stack.length - 1];
+ },
+ find_parent: function(type) {
+ var stack = this.stack;
+ for (var i = stack.length; --i >= 0;) {
+ var x = stack[i];
+ if (x instanceof type) return x;
+ }
+ },
+ has_directive: function(type) {
+ return this.find_parent(AST_Scope).has_directive(type);
+ },
+ in_boolean_context: function() {
+ var stack = this.stack;
+ var i = stack.length, self = stack[--i];
+ while (i > 0) {
+ var p = stack[--i];
+ if ((p instanceof AST_If && p.condition === self) ||
+ (p instanceof AST_Conditional && p.condition === self) ||
+ (p instanceof AST_DWLoop && p.condition === self) ||
+ (p instanceof AST_For && p.condition === self) ||
+ (p instanceof AST_UnaryPrefix && p.operator == "!" && p.expression === self))
+ {
+ return true;
+ }
+ if (!(p instanceof AST_Binary && (p.operator == "&&" || p.operator == "||")))
+ return false;
+ self = p;
+ }
+ },
+ loopcontrol_target: function(label) {
+ var stack = this.stack;
+ if (label) for (var i = stack.length; --i >= 0;) {
+ var x = stack[i];
+ if (x instanceof AST_LabeledStatement && x.label.name == label.name) {
+ return x.body;
+ }
+ } else for (var i = stack.length; --i >= 0;) {
+ var x = stack[i];
+ if (x instanceof AST_Switch || x instanceof AST_IterationStatement)
+ return x;
+ }
+ }
+};
+
+/***********************************************************************
+
+ A JavaScript tokenizer / parser / beautifier / compressor.
+ https://github.com/mishoo/UglifyJS2
+
+ -------------------------------- (C) ---------------------------------
+
+ Author: Mihai Bazon
+ <mihai.bazon@gmail.com>
+ http://mihai.bazon.net/blog
+
+ Distributed under the BSD license:
+
+ Copyright 2012 (c) Mihai Bazon <mihai.bazon@gmail.com>
+ Parser based on parse-js (http://marijn.haverbeke.nl/parse-js/).
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ * Redistributions of source code must retain the above
+ copyright notice, this list of conditions and the following
+ disclaimer.
+
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials
+ provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+ THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+
+ ***********************************************************************/
+
+"use strict";
+
+var KEYWORDS = 'break case catch const continue debugger default delete do else finally for function if in instanceof new return switch throw try typeof var void while with';
+var KEYWORDS_ATOM = 'false null true';
+var RESERVED_WORDS = 'abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized this throws transient volatile yield'
+ + " " + KEYWORDS_ATOM + " " + KEYWORDS;
+var KEYWORDS_BEFORE_EXPRESSION = 'return new delete throw else case';
+
+KEYWORDS = makePredicate(KEYWORDS);
+RESERVED_WORDS = makePredicate(RESERVED_WORDS);
+KEYWORDS_BEFORE_EXPRESSION = makePredicate(KEYWORDS_BEFORE_EXPRESSION);
+KEYWORDS_ATOM = makePredicate(KEYWORDS_ATOM);
+
+var OPERATOR_CHARS = makePredicate(characters("+-*&%=<>!?|~^"));
+
+var RE_HEX_NUMBER = /^0x[0-9a-f]+$/i;
+var RE_OCT_NUMBER = /^0[0-7]+$/;
+var RE_DEC_NUMBER = /^\d*\.?\d*(?:e[+-]?\d*(?:\d\.?|\.?\d)\d*)?$/i;
+
+var OPERATORS = makePredicate([
+ "in",
+ "instanceof",
+ "typeof",
+ "new",
+ "void",
+ "delete",
+ "++",
+ "--",
+ "+",
+ "-",
+ "!",
+ "~",
+ "&",
+ "|",
+ "^",
+ "*",
+ "/",
+ "%",
+ ">>",
+ "<<",
+ ">>>",
+ "<",
+ ">",
+ "<=",
+ ">=",
+ "==",
+ "===",
+ "!=",
+ "!==",
+ "?",
+ "=",
+ "+=",
+ "-=",
+ "/=",
+ "*=",
+ "%=",
+ ">>=",
+ "<<=",
+ ">>>=",
+ "|=",
+ "^=",
+ "&=",
+ "&&",
+ "||"
+]);
+
+var WHITESPACE_CHARS = makePredicate(characters(" \u00a0\n\r\t\f\u000b\u200b\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000"));
+
+var PUNC_BEFORE_EXPRESSION = makePredicate(characters("[{(,.;:"));
+
+var PUNC_CHARS = makePredicate(characters("[]{}(),;:"));
+
+var REGEXP_MODIFIERS = makePredicate(characters("gmsiy"));
+
+/* -----[ Tokenizer ]----- */
+
+// regexps adapted from http://xregexp.com/plugins/#unicode
+var UNICODE = {
+ letter: new RegExp("[\\u0041-\\u005A\\u0061-\\u007A\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0523\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0621-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971\\u0972\\u097B-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D28\\u0D2A-\\u0D39\\u0D3D\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC\\u0EDD\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8B\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10D0-\\u10FA\\u10FC\\u1100-\\u1159\\u115F-\\u11A2\\u11A8-\\u11F9\\u1200-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u1676\\u1681-\\u169A\\u16A0-\\u16EA\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u1900-\\u191C\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19A9\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u2094\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2C6F\\u2C71-\\u2C7D\\u2C80-\\u2CE4\\u2D00-\\u2D25\\u2D30-\\u2D65\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31B7\\u31F0-\\u31FF\\u3400\\u4DB5\\u4E00\\u9FC3\\uA000-\\uA48C\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA65F\\uA662-\\uA66E\\uA67F-\\uA697\\uA717-\\uA71F\\uA722-\\uA788\\uA78B\\uA78C\\uA7FB-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA90A-\\uA925\\uA930-\\uA946\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAC00\\uD7A3\\uF900-\\uFA2D\\uFA30-\\uFA6A\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),
+ non_spacing_mark: new RegExp("[\\u0300-\\u036F\\u0483-\\u0487\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u065E\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0900-\\u0902\\u093C\\u0941-\\u0948\\u094D\\u0951-\\u0955\\u0962\\u0963\\u0981\\u09BC\\u09C1-\\u09C4\\u09CD\\u09E2\\u09E3\\u0A01\\u0A02\\u0A3C\\u0A41\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81\\u0A82\\u0ABC\\u0AC1-\\u0AC5\\u0AC7\\u0AC8\\u0ACD\\u0AE2\\u0AE3\\u0B01\\u0B3C\\u0B3F\\u0B41-\\u0B44\\u0B4D\\u0B56\\u0B62\\u0B63\\u0B82\\u0BC0\\u0BCD\\u0C3E-\\u0C40\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0CBC\\u0CBF\\u0CC6\\u0CCC\\u0CCD\\u0CE2\\u0CE3\\u0D41-\\u0D44\\u0D4D\\u0D62\\u0D63\\u0DCA\\u0DD2-\\u0DD4\\u0DD6\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F71-\\u0F7E\\u0F80-\\u0F84\\u0F86\\u0F87\\u0F90-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102D-\\u1030\\u1032-\\u1037\\u1039\\u103A\\u103D\\u103E\\u1058\\u1059\\u105E-\\u1060\\u1071-\\u1074\\u1082\\u1085\\u1086\\u108D\\u109D\\u135F\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B7-\\u17BD\\u17C6\\u17C9-\\u17D3\\u17DD\\u180B-\\u180D\\u18A9\\u1920-\\u1922\\u1927\\u1928\\u1932\\u1939-\\u193B\\u1A17\\u1A18\\u1A56\\u1A58-\\u1A5E\\u1A60\\u1A62\\u1A65-\\u1A6C\\u1A73-\\u1A7C\\u1A7F\\u1B00-\\u1B03\\u1B34\\u1B36-\\u1B3A\\u1B3C\\u1B42\\u1B6B-\\u1B73\\u1B80\\u1B81\\u1BA2-\\u1BA5\\u1BA8\\u1BA9\\u1C2C-\\u1C33\\u1C36\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE0\\u1CE2-\\u1CE8\\u1CED\\u1DC0-\\u1DE6\\u1DFD-\\u1DFF\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2CEF-\\u2CF1\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA66F\\uA67C\\uA67D\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA825\\uA826\\uA8C4\\uA8E0-\\uA8F1\\uA926-\\uA92D\\uA947-\\uA951\\uA980-\\uA982\\uA9B3\\uA9B6-\\uA9B9\\uA9BC\\uAA29-\\uAA2E\\uAA31\\uAA32\\uAA35\\uAA36\\uAA43\\uAA4C\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uABE5\\uABE8\\uABED\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE26]"),
+ space_combining_mark: new RegExp("[\\u0903\\u093E-\\u0940\\u0949-\\u094C\\u094E\\u0982\\u0983\\u09BE-\\u09C0\\u09C7\\u09C8\\u09CB\\u09CC\\u09D7\\u0A03\\u0A3E-\\u0A40\\u0A83\\u0ABE-\\u0AC0\\u0AC9\\u0ACB\\u0ACC\\u0B02\\u0B03\\u0B3E\\u0B40\\u0B47\\u0B48\\u0B4B\\u0B4C\\u0B57\\u0BBE\\u0BBF\\u0BC1\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCC\\u0BD7\\u0C01-\\u0C03\\u0C41-\\u0C44\\u0C82\\u0C83\\u0CBE\\u0CC0-\\u0CC4\\u0CC7\\u0CC8\\u0CCA\\u0CCB\\u0CD5\\u0CD6\\u0D02\\u0D03\\u0D3E-\\u0D40\\u0D46-\\u0D48\\u0D4A-\\u0D4C\\u0D57\\u0D82\\u0D83\\u0DCF-\\u0DD1\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0F3E\\u0F3F\\u0F7F\\u102B\\u102C\\u1031\\u1038\\u103B\\u103C\\u1056\\u1057\\u1062-\\u1064\\u1067-\\u106D\\u1083\\u1084\\u1087-\\u108C\\u108F\\u109A-\\u109C\\u17B6\\u17BE-\\u17C5\\u17C7\\u17C8\\u1923-\\u1926\\u1929-\\u192B\\u1930\\u1931\\u1933-\\u1938\\u19B0-\\u19C0\\u19C8\\u19C9\\u1A19-\\u1A1B\\u1A55\\u1A57\\u1A61\\u1A63\\u1A64\\u1A6D-\\u1A72\\u1B04\\u1B35\\u1B3B\\u1B3D-\\u1B41\\u1B43\\u1B44\\u1B82\\u1BA1\\u1BA6\\u1BA7\\u1BAA\\u1C24-\\u1C2B\\u1C34\\u1C35\\u1CE1\\u1CF2\\uA823\\uA824\\uA827\\uA880\\uA881\\uA8B4-\\uA8C3\\uA952\\uA953\\uA983\\uA9B4\\uA9B5\\uA9BA\\uA9BB\\uA9BD-\\uA9C0\\uAA2F\\uAA30\\uAA33\\uAA34\\uAA4D\\uAA7B\\uABE3\\uABE4\\uABE6\\uABE7\\uABE9\\uABEA\\uABEC]"),
+ connector_punctuation: new RegExp("[\\u005F\\u203F\\u2040\\u2054\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFF3F]")
+};
+
+function is_letter(code) {
+ return (code >= 97 && code <= 122)
+ || (code >= 65 && code <= 90)
+ || (code >= 0xaa && UNICODE.letter.test(String.fromCharCode(code)));
+};
+
+function is_digit(code) {
+ return code >= 48 && code <= 57; //XXX: find out if "UnicodeDigit" means something else than 0..9
+};
+
+function is_alphanumeric_char(code) {
+ return is_digit(code) || is_letter(code);
+};
+
+function is_unicode_combining_mark(ch) {
+ return UNICODE.non_spacing_mark.test(ch) || UNICODE.space_combining_mark.test(ch);
+};
+
+function is_unicode_connector_punctuation(ch) {
+ return UNICODE.connector_punctuation.test(ch);
+};
+
+function is_identifier(name) {
+ return !RESERVED_WORDS(name) && /^[a-z_$][a-z0-9_$]*$/i.test(name);
+};
+
+function is_identifier_start(code) {
+ return code == 36 || code == 95 || is_letter(code);
+};
+
+function is_identifier_char(ch) {
+ var code = ch.charCodeAt(0);
+ return is_identifier_start(code)
+ || is_digit(code)
+ || code == 8204 // \u200c: zero-width non-joiner <ZWNJ>
+ || code == 8205 // \u200d: zero-width joiner <ZWJ> (in my ECMA-262 PDF, this is also 200c)
+ || is_unicode_combining_mark(ch)
+ || is_unicode_connector_punctuation(ch)
+ ;
+};
+
+function is_identifier_string(str){
+ return /^[a-z_$][a-z0-9_$]*$/i.test(str);
+};
+
+function parse_js_number(num) {
+ if (RE_HEX_NUMBER.test(num)) {
+ return parseInt(num.substr(2), 16);
+ } else if (RE_OCT_NUMBER.test(num)) {
+ return parseInt(num.substr(1), 8);
+ } else if (RE_DEC_NUMBER.test(num)) {
+ return parseFloat(num);
+ }
+};
+
+function JS_Parse_Error(message, line, col, pos) {
+ this.message = message;
+ this.line = line;
+ this.col = col;
+ this.pos = pos;
+ this.stack = new Error().stack;
+};
+
+JS_Parse_Error.prototype.toString = function() {
+ return this.message + " (line: " + this.line + ", col: " + this.col + ", pos: " + this.pos + ")" + "\n\n" + this.stack;
+};
+
+function js_error(message, filename, line, col, pos) {
+ throw new JS_Parse_Error(message, line, col, pos);
+};
+
+function is_token(token, type, val) {
+ return token.type == type && (val == null || token.value == val);
+};
+
+var EX_EOF = {};
+
+function tokenizer($TEXT, filename, html5_comments) {
+
+ var S = {
+ text : $TEXT.replace(/\r\n?|[\n\u2028\u2029]/g, "\n").replace(/\uFEFF/g, ''),
+ filename : filename,
+ pos : 0,
+ tokpos : 0,
+ line : 1,
+ tokline : 0,
+ col : 0,
+ tokcol : 0,
+ newline_before : false,
+ regex_allowed : false,
+ comments_before : []
+ };
+
+ function peek() { return S.text.charAt(S.pos); };
+
+ function next(signal_eof, in_string) {
+ var ch = S.text.charAt(S.pos++);
+ if (signal_eof && !ch)
+ throw EX_EOF;
+ if (ch == "\n") {
+ S.newline_before = S.newline_before || !in_string;
+ ++S.line;
+ S.col = 0;
+ } else {
+ ++S.col;
+ }
+ return ch;
+ };
+
+ function forward(i) {
+ while (i-- > 0) next();
+ };
+
+ function looking_at(str) {
+ return S.text.substr(S.pos, str.length) == str;
+ };
+
+ function find(what, signal_eof) {
+ var pos = S.text.indexOf(what, S.pos);
+ if (signal_eof && pos == -1) throw EX_EOF;
+ return pos;
+ };
+
+ function start_token() {
+ S.tokline = S.line;
+ S.tokcol = S.col;
+ S.tokpos = S.pos;
+ };
+
+ var prev_was_dot = false;
+ function token(type, value, is_comment) {
+ S.regex_allowed = ((type == "operator" && !UNARY_POSTFIX(value)) ||
+ (type == "keyword" && KEYWORDS_BEFORE_EXPRESSION(value)) ||
+ (type == "punc" && PUNC_BEFORE_EXPRESSION(value)));
+ prev_was_dot = (type == "punc" && value == ".");
+ var ret = {
+ type : type,
+ value : value,
+ line : S.tokline,
+ col : S.tokcol,
+ pos : S.tokpos,
+ endpos : S.pos,
+ nlb : S.newline_before,
+ file : filename
+ };
+ if (!is_comment) {
+ ret.comments_before = S.comments_before;
+ S.comments_before = [];
+ // make note of any newlines in the comments that came before
+ for (var i = 0, len = ret.comments_before.length; i < len; i++) {
+ ret.nlb = ret.nlb || ret.comments_before[i].nlb;
+ }
+ }
+ S.newline_before = false;
+ return new AST_Token(ret);
+ };
+
+ function skip_whitespace() {
+ while (WHITESPACE_CHARS(peek()))
+ next();
+ };
+
+ function read_while(pred) {
+ var ret = "", ch, i = 0;
+ while ((ch = peek()) && pred(ch, i++))
+ ret += next();
+ return ret;
+ };
+
+ function parse_error(err) {
+ js_error(err, filename, S.tokline, S.tokcol, S.tokpos);
+ };
+
+ function read_num(prefix) {
+ var has_e = false, after_e = false, has_x = false, has_dot = prefix == ".";
+ var num = read_while(function(ch, i){
+ var code = ch.charCodeAt(0);
+ switch (code) {
+ case 120: case 88: // xX
+ return has_x ? false : (has_x = true);
+ case 101: case 69: // eE
+ return has_x ? true : has_e ? false : (has_e = after_e = true);
+ case 45: // -
+ return after_e || (i == 0 && !prefix);
+ case 43: // +
+ return after_e;
+ case (after_e = false, 46): // .
+ return (!has_dot && !has_x && !has_e) ? (has_dot = true) : false;
+ }
+ return is_alphanumeric_char(code);
+ });
+ if (prefix) num = prefix + num;
+ var valid = parse_js_number(num);
+ if (!isNaN(valid)) {
+ return token("num", valid);
+ } else {
+ parse_error("Invalid syntax: " + num);
+ }
+ };
+
+ function read_escaped_char(in_string) {
+ var ch = next(true, in_string);
+ switch (ch.charCodeAt(0)) {
+ case 110 : return "\n";
+ case 114 : return "\r";
+ case 116 : return "\t";
+ case 98 : return "\b";
+ case 118 : return "\u000b"; // \v
+ case 102 : return "\f";
+ case 48 : return "\0";
+ case 120 : return String.fromCharCode(hex_bytes(2)); // \x
+ case 117 : return String.fromCharCode(hex_bytes(4)); // \u
+ case 10 : return ""; // newline
+ default : return ch;
+ }
+ };
+
+ function hex_bytes(n) {
+ var num = 0;
+ for (; n > 0; --n) {
+ var digit = parseInt(next(true), 16);
+ if (isNaN(digit))
+ parse_error("Invalid hex-character pattern in string");
+ num = (num << 4) | digit;
+ }
+ return num;
+ };
+
+ var read_string = with_eof_error("Unterminated string constant", function(){
+ var quote = next(), ret = "";
+ for (;;) {
+ var ch = next(true);
+ if (ch == "\\") {
+ // read OctalEscapeSequence (XXX: deprecated if "strict mode")
+ // https://github.com/mishoo/UglifyJS/issues/178
+ var octal_len = 0, first = null;
+ ch = read_while(function(ch){
+ if (ch >= "0" && ch <= "7") {
+ if (!first) {
+ first = ch;
+ return ++octal_len;
+ }
+ else if (first <= "3" && octal_len <= 2) return ++octal_len;
+ else if (first >= "4" && octal_len <= 1) return ++octal_len;
+ }
+ return false;
+ });
+ if (octal_len > 0) ch = String.fromCharCode(parseInt(ch, 8));
+ else ch = read_escaped_char(true);
+ }
+ else if (ch == quote) break;
+ ret += ch;
+ }
+ return token("string", ret);
+ });
+
+ function skip_line_comment(type) {
+ var regex_allowed = S.regex_allowed;
+ var i = find("\n"), ret;
+ if (i == -1) {
+ ret = S.text.substr(S.pos);
+ S.pos = S.text.length;
+ } else {
+ ret = S.text.substring(S.pos, i);
+ S.pos = i;
+ }
+ S.comments_before.push(token(type, ret, true));
+ S.regex_allowed = regex_allowed;
+ return next_token();
+ };
+
+ var skip_multiline_comment = with_eof_error("Unterminated multiline comment", function(){
+ var regex_allowed = S.regex_allowed;
+ var i = find("*/", true);
+ var text = S.text.substring(S.pos, i);
+ var a = text.split("\n"), n = a.length;
+ // update stream position
+ S.pos = i + 2;
+ S.line += n - 1;
+ if (n > 1) S.col = a[n - 1].length;
+ else S.col += a[n - 1].length;
+ S.col += 2;
+ var nlb = S.newline_before = S.newline_before || text.indexOf("\n") >= 0;
+ S.comments_before.push(token("comment2", text, true));
+ S.regex_allowed = regex_allowed;
+ S.newline_before = nlb;
+ return next_token();
+ });
+
+ function read_name() {
+ var backslash = false, name = "", ch, escaped = false, hex;
+ while ((ch = peek()) != null) {
+ if (!backslash) {
+ if (ch == "\\") escaped = backslash = true, next();
+ else if (is_identifier_char(ch)) name += next();
+ else break;
+ }
+ else {
+ if (ch != "u") parse_error("Expecting UnicodeEscapeSequence -- uXXXX");
+ ch = read_escaped_char();
+ if (!is_identifier_char(ch)) parse_error("Unicode char: " + ch.charCodeAt(0) + " is not valid in identifier");
+ name += ch;
+ backslash = false;
+ }
+ }
+ if (KEYWORDS(name) && escaped) {
+ hex = name.charCodeAt(0).toString(16).toUpperCase();
+ name = "\\u" + "0000".substr(hex.length) + hex + name.slice(1);
+ }
+ return name;
+ };
+
+ var read_regexp = with_eof_error("Unterminated regular expression", function(regexp){
+ var prev_backslash = false, ch, in_class = false;
+ while ((ch = next(true))) if (prev_backslash) {
+ regexp += "\\" + ch;
+ prev_backslash = false;
+ } else if (ch == "[") {
+ in_class = true;
+ regexp += ch;
+ } else if (ch == "]" && in_class) {
+ in_class = false;
+ regexp += ch;
+ } else if (ch == "/" && !in_class) {
+ break;
+ } else if (ch == "\\") {
+ prev_backslash = true;
+ } else {
+ regexp += ch;
+ }
+ var mods = read_name();
+ return token("regexp", new RegExp(regexp, mods));
+ });
+
+ function read_operator(prefix) {
+ function grow(op) {
+ if (!peek()) return op;
+ var bigger = op + peek();
+ if (OPERATORS(bigger)) {
+ next();
+ return grow(bigger);
+ } else {
+ return op;
+ }
+ };
+ return token("operator", grow(prefix || next()));
+ };
+
+ function handle_slash() {
+ next();
+ switch (peek()) {
+ case "/":
+ next();
+ return skip_line_comment("comment1");
+ case "*":
+ next();
+ return skip_multiline_comment();
+ }
+ return S.regex_allowed ? read_regexp("") : read_operator("/");
+ };
+
+ function handle_dot() {
+ next();
+ return is_digit(peek().charCodeAt(0))
+ ? read_num(".")
+ : token("punc", ".");
+ };
+
+ function read_word() {
+ var word = read_name();
+ if (prev_was_dot) return token("name", word);
+ return KEYWORDS_ATOM(word) ? token("atom", word)
+ : !KEYWORDS(word) ? token("name", word)
+ : OPERATORS(word) ? token("operator", word)
+ : token("keyword", word);
+ };
+
+ function with_eof_error(eof_error, cont) {
+ return function(x) {
+ try {
+ return cont(x);
+ } catch(ex) {
+ if (ex === EX_EOF) parse_error(eof_error);
+ else throw ex;
+ }
+ };
+ };
+
+ function next_token(force_regexp) {
+ if (force_regexp != null)
+ return read_regexp(force_regexp);
+ skip_whitespace();
+ start_token();
+ if (html5_comments) {
+ if (looking_at("<!--")) {
+ forward(4);
+ return skip_line_comment("comment3");
+ }
+ if (looking_at("-->") && S.newline_before) {
+ forward(3);
+ return skip_line_comment("comment4");
+ }
+ }
+ var ch = peek();
+ if (!ch) return token("eof");
+ var code = ch.charCodeAt(0);
+ switch (code) {
+ case 34: case 39: return read_string();
+ case 46: return handle_dot();
+ case 47: return handle_slash();
+ }
+ if (is_digit(code)) return read_num();
+ if (PUNC_CHARS(ch)) return token("punc", next());
+ if (OPERATOR_CHARS(ch)) return read_operator();
+ if (code == 92 || is_identifier_start(code)) return read_word();
+ parse_error("Unexpected character '" + ch + "'");
+ };
+
+ next_token.context = function(nc) {
+ if (nc) S = nc;
+ return S;
+ };
+
+ return next_token;
+
+};
+
+/* -----[ Parser (constants) ]----- */
+
+var UNARY_PREFIX = makePredicate([
+ "typeof",
+ "void",
+ "delete",
+ "--",
+ "++",
+ "!",
+ "~",
+ "-",
+ "+"
+]);
+
+var UNARY_POSTFIX = makePredicate([ "--", "++" ]);
+
+var ASSIGNMENT = makePredicate([ "=", "+=", "-=", "/=", "*=", "%=", ">>=", "<<=", ">>>=", "|=", "^=", "&=" ]);
+
+var PRECEDENCE = (function(a, ret){
+ for (var i = 0; i < a.length; ++i) {
+ var b = a[i];
+ for (var j = 0; j < b.length; ++j) {
+ ret[b[j]] = i + 1;
+ }
+ }
+ return ret;
+})(
+ [
+ ["||"],
+ ["&&"],
+ ["|"],
+ ["^"],
+ ["&"],
+ ["==", "===", "!=", "!=="],
+ ["<", ">", "<=", ">=", "in", "instanceof"],
+ [">>", "<<", ">>>"],
+ ["+", "-"],
+ ["*", "/", "%"]
+ ],
+ {}
+);
+
+var STATEMENTS_WITH_LABELS = array_to_hash([ "for", "do", "while", "switch" ]);
+
+var ATOMIC_START_TOKEN = array_to_hash([ "atom", "num", "string", "regexp", "name" ]);
+
+/* -----[ Parser ]----- */
+
+function parse($TEXT, options) {
+
+ options = defaults(options, {
+ strict : false,
+ filename : null,
+ toplevel : null,
+ expression : false,
+ html5_comments : true,
+ bare_returns : false,
+ });
+
+ var S = {
+ input : (typeof $TEXT == "string"
+ ? tokenizer($TEXT, options.filename,
+ options.html5_comments)
+ : $TEXT),
+ token : null,
+ prev : null,
+ peeked : null,
+ in_function : 0,
+ in_directives : true,
+ in_loop : 0,
+ labels : []
+ };
+
+ S.token = next();
+
+ function is(type, value) {
+ return is_token(S.token, type, value);
+ };
+
+ function peek() { return S.peeked || (S.peeked = S.input()); };
+
+ function next() {
+ S.prev = S.token;
+ if (S.peeked) {
+ S.token = S.peeked;
+ S.peeked = null;
+ } else {
+ S.token = S.input();
+ }
+ S.in_directives = S.in_directives && (
+ S.token.type == "string" || is("punc", ";")
+ );
+ return S.token;
+ };
+
+ function prev() {
+ return S.prev;
+ };
+
+ function croak(msg, line, col, pos) {
+ var ctx = S.input.context();
+ js_error(msg,
+ ctx.filename,
+ line != null ? line : ctx.tokline,
+ col != null ? col : ctx.tokcol,
+ pos != null ? pos : ctx.tokpos);
+ };
+
+ function token_error(token, msg) {
+ croak(msg, token.line, token.col);
+ };
+
+ function unexpected(token) {
+ if (token == null)
+ token = S.token;
+ token_error(token, "Unexpected token: " + token.type + " (" + token.value + ")");
+ };
+
+ function expect_token(type, val) {
+ if (is(type, val)) {
+ return next();
+ }
+ token_error(S.token, "Unexpected token " + S.token.type + " «" + S.token.value + "»" + ", expected " + type + " «" + val + "»");
+ };
+
+ function expect(punc) { return expect_token("punc", punc); };
+
+ function can_insert_semicolon() {
+ return !options.strict && (
+ S.token.nlb || is("eof") || is("punc", "}")
+ );
+ };
+
+ function semicolon() {
+ if (is("punc", ";")) next();
+ else if (!can_insert_semicolon()) unexpected();
+ };
+
+ function parenthesised() {
+ expect("(");
+ var exp = expression(true);
+ expect(")");
+ return exp;
+ };
+
+ function embed_tokens(parser) {
+ return function() {
+ var start = S.token;
+ var expr = parser();
+ var end = prev();
+ expr.start = start;
+ expr.end = end;
+ return expr;
+ };
+ };
+
+ function handle_regexp() {
+ if (is("operator", "/") || is("operator", "/=")) {
+ S.peeked = null;
+ S.token = S.input(S.token.value.substr(1)); // force regexp
+ }
+ };
+
+ var statement = embed_tokens(function() {
+ var tmp;
+ handle_regexp();
+ switch (S.token.type) {
+ case "string":
+ var dir = S.in_directives, stat = simple_statement();
+ // XXXv2: decide how to fix directives
+ if (dir && stat.body instanceof AST_String && !is("punc", ","))
+ return new AST_Directive({ value: stat.body.value });
+ return stat;
+ case "num":
+ case "regexp":
+ case "operator":
+ case "atom":
+ return simple_statement();
+
+ case "name":
+ return is_token(peek(), "punc", ":")
+ ? labeled_statement()
+ : simple_statement();
+
+ case "punc":
+ switch (S.token.value) {
+ case "{":
+ return new AST_BlockStatement({
+ start : S.token,
+ body : block_(),
+ end : prev()
+ });
+ case "[":
+ case "(":
+ return simple_statement();
+ case ";":
+ next();
+ return new AST_EmptyStatement();
+ default:
+ unexpected();
+ }
+
+ case "keyword":
+ switch (tmp = S.token.value, next(), tmp) {
+ case "break":
+ return break_cont(AST_Break);
+
+ case "continue":
+ return break_cont(AST_Continue);
+
+ case "debugger":
+ semicolon();
+ return new AST_Debugger();
+
+ case "do":
+ return new AST_Do({
+ body : in_loop(statement),
+ condition : (expect_token("keyword", "while"), tmp = parenthesised(), semicolon(), tmp)
+ });
+
+ case "while":
+ return new AST_While({
+ condition : parenthesised(),
+ body : in_loop(statement)
+ });
+
+ case "for":
+ return for_();
+
+ case "function":
+ return function_(AST_Defun);
+
+ case "if":
+ return if_();
+
+ case "return":
+ if (S.in_function == 0 && !options.bare_returns)
+ croak("'return' outside of function");
+ return new AST_Return({
+ value: ( is("punc", ";")
+ ? (next(), null)
+ : can_insert_semicolon()
+ ? null
+ : (tmp = expression(true), semicolon(), tmp) )
+ });
+
+ case "switch":
+ return new AST_Switch({
+ expression : parenthesised(),
+ body : in_loop(switch_body_)
+ });
+
+ case "throw":
+ if (S.token.nlb)
+ croak("Illegal newline after 'throw'");
+ return new AST_Throw({
+ value: (tmp = expression(true), semicolon(), tmp)
+ });
+
+ case "try":
+ return try_();
+
+ case "var":
+ return tmp = var_(), semicolon(), tmp;
+
+ case "const":
+ return tmp = const_(), semicolon(), tmp;
+
+ case "with":
+ return new AST_With({
+ expression : parenthesised(),
+ body : statement()
+ });
+
+ default:
+ unexpected();
+ }
+ }
+ });
+
+ function labeled_statement() {
+ var label = as_symbol(AST_Label);
+ if (find_if(function(l){ return l.name == label.name }, S.labels)) {
+ // ECMA-262, 12.12: An ECMAScript program is considered
+ // syntactically incorrect if it contains a
+ // LabelledStatement that is enclosed by a
+ // LabelledStatement with the same Identifier as label.
+ croak("Label " + label.name + " defined twice");
+ }
+ expect(":");
+ S.labels.push(label);
+ var stat = statement();
+ S.labels.pop();
+ if (!(stat instanceof AST_IterationStatement)) {
+ // check for `continue` that refers to this label.
+ // those should be reported as syntax errors.
+ // https://github.com/mishoo/UglifyJS2/issues/287
+ label.references.forEach(function(ref){
+ if (ref instanceof AST_Continue) {
+ ref = ref.label.start;
+ croak("Continue label `" + label.name + "` refers to non-IterationStatement.",
+ ref.line, ref.col, ref.pos);
+ }
+ });
+ }
+ return new AST_LabeledStatement({ body: stat, label: label });
+ };
+
+ function simple_statement(tmp) {
+ return new AST_SimpleStatement({ body: (tmp = expression(true), semicolon(), tmp) });
+ };
+
+ function break_cont(type) {
+ var label = null, ldef;
+ if (!can_insert_semicolon()) {
+ label = as_symbol(AST_LabelRef, true);
+ }
+ if (label != null) {
+ ldef = find_if(function(l){ return l.name == label.name }, S.labels);
+ if (!ldef)
+ croak("Undefined label " + label.name);
+ label.thedef = ldef;
+ }
+ else if (S.in_loop == 0)
+ croak(type.TYPE + " not inside a loop or switch");
+ semicolon();
+ var stat = new type({ label: label });
+ if (ldef) ldef.references.push(stat);
+ return stat;
+ };
+
+ function for_() {
+ expect("(");
+ var init = null;
+ if (!is("punc", ";")) {
+ init = is("keyword", "var")
+ ? (next(), var_(true))
+ : expression(true, true);
+ if (is("operator", "in")) {
+ if (init instanceof AST_Var && init.definitions.length > 1)
+ croak("Only one variable declaration allowed in for..in loop");
+ next();
+ return for_in(init);
+ }
+ }
+ return regular_for(init);
+ };
+
+ function regular_for(init) {
+ expect(";");
+ var test = is("punc", ";") ? null : expression(true);
+ expect(";");
+ var step = is("punc", ")") ? null : expression(true);
+ expect(")");
+ return new AST_For({
+ init : init,
+ condition : test,
+ step : step,
+ body : in_loop(statement)
+ });
+ };
+
+ function for_in(init) {
+ var lhs = init instanceof AST_Var ? init.definitions[0].name : null;
+ var obj = expression(true);
+ expect(")");
+ return new AST_ForIn({
+ init : init,
+ name : lhs,
+ object : obj,
+ body : in_loop(statement)
+ });
+ };
+
+ var function_ = function(ctor) {
+ var in_statement = ctor === AST_Defun;
+ var name = is("name") ? as_symbol(in_statement ? AST_SymbolDefun : AST_SymbolLambda) : null;
+ if (in_statement && !name)
+ unexpected();
+ expect("(");
+ return new ctor({
+ name: name,
+ argnames: (function(first, a){
+ while (!is("punc", ")")) {
+ if (first) first = false; else expect(",");
+ a.push(as_symbol(AST_SymbolFunarg));
+ }
+ next();
+ return a;
+ })(true, []),
+ body: (function(loop, labels){
+ ++S.in_function;
+ S.in_directives = true;
+ S.in_loop = 0;
+ S.labels = [];
+ var a = block_();
+ --S.in_function;
+ S.in_loop = loop;
+ S.labels = labels;
+ return a;
+ })(S.in_loop, S.labels)
+ });
+ };
+
+ function if_() {
+ var cond = parenthesised(), body = statement(), belse = null;
+ if (is("keyword", "else")) {
+ next();
+ belse = statement();
+ }
+ return new AST_If({
+ condition : cond,
+ body : body,
+ alternative : belse
+ });
+ };
+
+ function block_() {
+ expect("{");
+ var a = [];
+ while (!is("punc", "}")) {
+ if (is("eof")) unexpected();
+ a.push(statement());
+ }
+ next();
+ return a;
+ };
+
+ function switch_body_() {
+ expect("{");
+ var a = [], cur = null, branch = null, tmp;
+ while (!is("punc", "}")) {
+ if (is("eof")) unexpected();
+ if (is("keyword", "case")) {
+ if (branch) branch.end = prev();
+ cur = [];
+ branch = new AST_Case({
+ start : (tmp = S.token, next(), tmp),
+ expression : expression(true),
+ body : cur
+ });
+ a.push(branch);
+ expect(":");
+ }
+ else if (is("keyword", "default")) {
+ if (branch) branch.end = prev();
+ cur = [];
+ branch = new AST_Default({
+ start : (tmp = S.token, next(), expect(":"), tmp),
+ body : cur
+ });
+ a.push(branch);
+ }
+ else {
+ if (!cur) unexpected();
+ cur.push(statement());
+ }
+ }
+ if (branch) branch.end = prev();
+ next();
+ return a;
+ };
+
+ function try_() {
+ var body = block_(), bcatch = null, bfinally = null;
+ if (is("keyword", "catch")) {
+ var start = S.token;
+ next();
+ expect("(");
+ var name = as_symbol(AST_SymbolCatch);
+ expect(")");
+ bcatch = new AST_Catch({
+ start : start,
+ argname : name,
+ body : block_(),
+ end : prev()
+ });
+ }
+ if (is("keyword", "finally")) {
+ var start = S.token;
+ next();
+ bfinally = new AST_Finally({
+ start : start,
+ body : block_(),
+ end : prev()
+ });
+ }
+ if (!bcatch && !bfinally)
+ croak("Missing catch/finally blocks");
+ return new AST_Try({
+ body : body,
+ bcatch : bcatch,
+ bfinally : bfinally
+ });
+ };
+
+ function vardefs(no_in, in_const) {
+ var a = [];
+ for (;;) {
+ a.push(new AST_VarDef({
+ start : S.token,
+ name : as_symbol(in_const ? AST_SymbolConst : AST_SymbolVar),
+ value : is("operator", "=") ? (next(), expression(false, no_in)) : null,
+ end : prev()
+ }));
+ if (!is("punc", ","))
+ break;
+ next();
+ }
+ return a;
+ };
+
+ var var_ = function(no_in) {
+ return new AST_Var({
+ start : prev(),
+ definitions : vardefs(no_in, false),
+ end : prev()
+ });
+ };
+
+ var const_ = function() {
+ return new AST_Const({
+ start : prev(),
+ definitions : vardefs(false, true),
+ end : prev()
+ });
+ };
+
+ var new_ = function() {
+ var start = S.token;
+ expect_token("operator", "new");
+ var newexp = expr_atom(false), args;
+ if (is("punc", "(")) {
+ next();
+ args = expr_list(")");
+ } else {
+ args = [];
+ }
+ return subscripts(new AST_New({
+ start : start,
+ expression : newexp,
+ args : args,
+ end : prev()
+ }), true);
+ };
+
+ function as_atom_node() {
+ var tok = S.token, ret;
+ switch (tok.type) {
+ case "name":
+ case "keyword":
+ ret = _make_symbol(AST_SymbolRef);
+ break;
+ case "num":
+ ret = new AST_Number({ start: tok, end: tok, value: tok.value });
+ break;
+ case "string":
+ ret = new AST_String({ start: tok, end: tok, value: tok.value });
+ break;
+ case "regexp":
+ ret = new AST_RegExp({ start: tok, end: tok, value: tok.value });
+ break;
+ case "atom":
+ switch (tok.value) {
+ case "false":
+ ret = new AST_False({ start: tok, end: tok });
+ break;
+ case "true":
+ ret = new AST_True({ start: tok, end: tok });
+ break;
+ case "null":
+ ret = new AST_Null({ start: tok, end: tok });
+ break;
+ }
+ break;
+ }
+ next();
+ return ret;
+ };
+
+ var expr_atom = function(allow_calls) {
+ if (is("operator", "new")) {
+ return new_();
+ }
+ var start = S.token;
+ if (is("punc")) {
+ switch (start.value) {
+ case "(":
+ next();
+ var ex = expression(true);
+ ex.start = start;
+ ex.end = S.token;
+ expect(")");
+ return subscripts(ex, allow_calls);
+ case "[":
+ return subscripts(array_(), allow_calls);
+ case "{":
+ return subscripts(object_(), allow_calls);
+ }
+ unexpected();
+ }
+ if (is("keyword", "function")) {
+ next();
+ var func = function_(AST_Function);
+ func.start = start;
+ func.end = prev();
+ return subscripts(func, allow_calls);
+ }
+ if (ATOMIC_START_TOKEN[S.token.type]) {
+ return subscripts(as_atom_node(), allow_calls);
+ }
+ unexpected();
+ };
+
+ function expr_list(closing, allow_trailing_comma, allow_empty) {
+ var first = true, a = [];
+ while (!is("punc", closing)) {
+ if (first) first = false; else expect(",");
+ if (allow_trailing_comma && is("punc", closing)) break;
+ if (is("punc", ",") && allow_empty) {
+ a.push(new AST_Hole({ start: S.token, end: S.token }));
+ } else {
+ a.push(expression(false));
+ }
+ }
+ next();
+ return a;
+ };
+
+ var array_ = embed_tokens(function() {
+ expect("[");
+ return new AST_Array({
+ elements: expr_list("]", !options.strict, true)
+ });
+ });
+
+ var object_ = embed_tokens(function() {
+ expect("{");
+ var first = true, a = [];
+ while (!is("punc", "}")) {
+ if (first) first = false; else expect(",");
+ if (!options.strict && is("punc", "}"))
+ // allow trailing comma
+ break;
+ var start = S.token;
+ var type = start.type;
+ var name = as_property_name();
+ if (type == "name" && !is("punc", ":")) {
+ if (name == "get") {
+ a.push(new AST_ObjectGetter({
+ start : start,
+ key : as_atom_node(),
+ value : function_(AST_Accessor),
+ end : prev()
+ }));
+ continue;
+ }
+ if (name == "set") {
+ a.push(new AST_ObjectSetter({
+ start : start,
+ key : as_atom_node(),
+ value : function_(AST_Accessor),
+ end : prev()
+ }));
+ continue;
+ }
+ }
+ expect(":");
+ a.push(new AST_ObjectKeyVal({
+ start : start,
+ key : name,
+ value : expression(false),
+ end : prev()
+ }));
+ }
+ next();
+ return new AST_Object({ properties: a });
+ });
+
+ function as_property_name() {
+ var tmp = S.token;
+ next();
+ switch (tmp.type) {
+ case "num":
+ case "string":
+ case "name":
+ case "operator":
+ case "keyword":
+ case "atom":
+ return tmp.value;
+ default:
+ unexpected();
+ }
+ };
+
+ function as_name() {
+ var tmp = S.token;
+ next();
+ switch (tmp.type) {
+ case "name":
+ case "operator":
+ case "keyword":
+ case "atom":
+ return tmp.value;
+ default:
+ unexpected();
+ }
+ };
+
+ function _make_symbol(type) {
+ var name = S.token.value;
+ return new (name == "this" ? AST_This : type)({
+ name : String(name),
+ start : S.token,
+ end : S.token
+ });
+ };
+
+ function as_symbol(type, noerror) {
+ if (!is("name")) {
+ if (!noerror) croak("Name expected");
+ return null;
+ }
+ var sym = _make_symbol(type);
+ next();
+ return sym;
+ };
+
+ var subscripts = function(expr, allow_calls) {
+ var start = expr.start;
+ if (is("punc", ".")) {
+ next();
+ return subscripts(new AST_Dot({
+ start : start,
+ expression : expr,
+ property : as_name(),
+ end : prev()
+ }), allow_calls);
+ }
+ if (is("punc", "[")) {
+ next();
+ var prop = expression(true);
+ expect("]");
+ return subscripts(new AST_Sub({
+ start : start,
+ expression : expr,
+ property : prop,
+ end : prev()
+ }), allow_calls);
+ }
+ if (allow_calls && is("punc", "(")) {
+ next();
+ return subscripts(new AST_Call({
+ start : start,
+ expression : expr,
+ args : expr_list(")"),
+ end : prev()
+ }), true);
+ }
+ return expr;
+ };
+
+ var maybe_unary = function(allow_calls) {
+ var start = S.token;
+ if (is("operator") && UNARY_PREFIX(start.value)) {
+ next();
+ handle_regexp();
+ var ex = make_unary(AST_UnaryPrefix, start.value, maybe_unary(allow_calls));
+ ex.start = start;
+ ex.end = prev();
+ return ex;
+ }
+ var val = expr_atom(allow_calls);
+ while (is("operator") && UNARY_POSTFIX(S.token.value) && !S.token.nlb) {
+ val = make_unary(AST_UnaryPostfix, S.token.value, val);
+ val.start = start;
+ val.end = S.token;
+ next();
+ }
+ return val;
+ };
+
+ function make_unary(ctor, op, expr) {
+ if ((op == "++" || op == "--") && !is_assignable(expr))
+ croak("Invalid use of " + op + " operator");
+ return new ctor({ operator: op, expression: expr });
+ };
+
+ var expr_op = function(left, min_prec, no_in) {
+ var op = is("operator") ? S.token.value : null;
+ if (op == "in" && no_in) op = null;
+ var prec = op != null ? PRECEDENCE[op] : null;
+ if (prec != null && prec > min_prec) {
+ next();
+ var right = expr_op(maybe_unary(true), prec, no_in);
+ return expr_op(new AST_Binary({
+ start : left.start,
+ left : left,
+ operator : op,
+ right : right,
+ end : right.end
+ }), min_prec, no_in);
+ }
+ return left;
+ };
+
+ function expr_ops(no_in) {
+ return expr_op(maybe_unary(true), 0, no_in);
+ };
+
+ var maybe_conditional = function(no_in) {
+ var start = S.token;
+ var expr = expr_ops(no_in);
+ if (is("operator", "?")) {
+ next();
+ var yes = expression(false);
+ expect(":");
+ return new AST_Conditional({
+ start : start,
+ condition : expr,
+ consequent : yes,
+ alternative : expression(false, no_in),
+ end : prev()
+ });
+ }
+ return expr;
+ };
+
+ function is_assignable(expr) {
+ if (!options.strict) return true;
+ if (expr instanceof AST_This) return false;
+ return (expr instanceof AST_PropAccess || expr instanceof AST_Symbol);
+ };
+
+ var maybe_assign = function(no_in) {
+ var start = S.token;
+ var left = maybe_conditional(no_in), val = S.token.value;
+ if (is("operator") && ASSIGNMENT(val)) {
+ if (is_assignable(left)) {
+ next();
+ return new AST_Assign({
+ start : start,
+ left : left,
+ operator : val,
+ right : maybe_assign(no_in),
+ end : prev()
+ });
+ }
+ croak("Invalid assignment");
+ }
+ return left;
+ };
+
+ var expression = function(commas, no_in) {
+ var start = S.token;
+ var expr = maybe_assign(no_in);
+ if (commas && is("punc", ",")) {
+ next();
+ return new AST_Seq({
+ start : start,
+ car : expr,
+ cdr : expression(true, no_in),
+ end : peek()
+ });
+ }
+ return expr;
+ };
+
+ function in_loop(cont) {
+ ++S.in_loop;
+ var ret = cont();
+ --S.in_loop;
+ return ret;
+ };
+
+ if (options.expression) {
+ return expression(true);
+ }
+
+ return (function(){
+ var start = S.token;
+ var body = [];
+ while (!is("eof"))
+ body.push(statement());
+ var end = prev();
+ var toplevel = options.toplevel;
+ if (toplevel) {
+ toplevel.body = toplevel.body.concat(body);
+ toplevel.end = end;
+ } else {
+ toplevel = new AST_Toplevel({ start: start, body: body, end: end });
+ }
+ return toplevel;
+ })();
+
+};
+
+/***********************************************************************
+
+ A JavaScript tokenizer / parser / beautifier / compressor.
+ https://github.com/mishoo/UglifyJS2
+
+ -------------------------------- (C) ---------------------------------
+
+ Author: Mihai Bazon
+ <mihai.bazon@gmail.com>
+ http://mihai.bazon.net/blog
+
+ Distributed under the BSD license:
+
+ Copyright 2012 (c) Mihai Bazon <mihai.bazon@gmail.com>
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ * Redistributions of source code must retain the above
+ copyright notice, this list of conditions and the following
+ disclaimer.
+
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials
+ provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+ THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+
+ ***********************************************************************/
+
+"use strict";
+
+// Tree transformer helpers.
+
+function TreeTransformer(before, after) {
+ TreeWalker.call(this);
+ this.before = before;
+ this.after = after;
+}
+TreeTransformer.prototype = new TreeWalker;
+
+(function(undefined){
+
+ function _(node, descend) {
+ node.DEFMETHOD("transform", function(tw, in_list){
+ var x, y;
+ tw.push(this);
+ if (tw.before) x = tw.before(this, descend, in_list);
+ if (x === undefined) {
+ if (!tw.after) {
+ x = this;
+ descend(x, tw);
+ } else {
+ tw.stack[tw.stack.length - 1] = x = this.clone();
+ descend(x, tw);
+ y = tw.after(x, in_list);
+ if (y !== undefined) x = y;
+ }
+ }
+ tw.pop();
+ return x;
+ });
+ };
+
+ function do_list(list, tw) {
+ return MAP(list, function(node){
+ return node.transform(tw, true);
+ });
+ };
+
+ _(AST_Node, noop);
+
+ _(AST_LabeledStatement, function(self, tw){
+ self.label = self.label.transform(tw);
+ self.body = self.body.transform(tw);
+ });
+
+ _(AST_SimpleStatement, function(self, tw){
+ self.body = self.body.transform(tw);
+ });
+
+ _(AST_Block, function(self, tw){
+ self.body = do_list(self.body, tw);
+ });
+
+ _(AST_DWLoop, function(self, tw){
+ self.condition = self.condition.transform(tw);
+ self.body = self.body.transform(tw);
+ });
+
+ _(AST_For, function(self, tw){
+ if (self.init) self.init = self.init.transform(tw);
+ if (self.condition) self.condition = self.condition.transform(tw);
+ if (self.step) self.step = self.step.transform(tw);
+ self.body = self.body.transform(tw);
+ });
+
+ _(AST_ForIn, function(self, tw){
+ self.init = self.init.transform(tw);
+ self.object = self.object.transform(tw);
+ self.body = self.body.transform(tw);
+ });
+
+ _(AST_With, function(self, tw){
+ self.expression = self.expression.transform(tw);
+ self.body = self.body.transform(tw);
+ });
+
+ _(AST_Exit, function(self, tw){
+ if (self.value) self.value = self.value.transform(tw);
+ });
+
+ _(AST_LoopControl, function(self, tw){
+ if (self.label) self.label = self.label.transform(tw);
+ });
+
+ _(AST_If, function(self, tw){
+ self.condition = self.condition.transform(tw);
+ self.body = self.body.transform(tw);
+ if (self.alternative) self.alternative = self.alternative.transform(tw);
+ });
+
+ _(AST_Switch, function(self, tw){
+ self.expression = self.expression.transform(tw);
+ self.body = do_list(self.body, tw);
+ });
+
+ _(AST_Case, function(self, tw){
+ self.expression = self.expression.transform(tw);
+ self.body = do_list(self.body, tw);
+ });
+
+ _(AST_Try, function(self, tw){
+ self.body = do_list(self.body, tw);
+ if (self.bcatch) self.bcatch = self.bcatch.transform(tw);
+ if (self.bfinally) self.bfinally = self.bfinally.transform(tw);
+ });
+
+ _(AST_Catch, function(self, tw){
+ self.argname = self.argname.transform(tw);
+ self.body = do_list(self.body, tw);
+ });
+
+ _(AST_Definitions, function(self, tw){
+ self.definitions = do_list(self.definitions, tw);
+ });
+
+ _(AST_VarDef, function(self, tw){
+ self.name = self.name.transform(tw);
+ if (self.value) self.value = self.value.transform(tw);
+ });
+
+ _(AST_Lambda, function(self, tw){
+ if (self.name) self.name = self.name.transform(tw);
+ self.argnames = do_list(self.argnames, tw);
+ self.body = do_list(self.body, tw);
+ });
+
+ _(AST_Call, function(self, tw){
+ self.expression = self.expression.transform(tw);
+ self.args = do_list(self.args, tw);
+ });
+
+ _(AST_Seq, function(self, tw){
+ self.car = self.car.transform(tw);
+ self.cdr = self.cdr.transform(tw);
+ });
+
+ _(AST_Dot, function(self, tw){
+ self.expression = self.expression.transform(tw);
+ });
+
+ _(AST_Sub, function(self, tw){
+ self.expression = self.expression.transform(tw);
+ self.property = self.property.transform(tw);
+ });
+
+ _(AST_Unary, function(self, tw){
+ self.expression = self.expression.transform(tw);
+ });
+
+ _(AST_Binary, function(self, tw){
+ self.left = self.left.transform(tw);
+ self.right = self.right.transform(tw);
+ });
+
+ _(AST_Conditional, function(self, tw){
+ self.condition = self.condition.transform(tw);
+ self.consequent = self.consequent.transform(tw);
+ self.alternative = self.alternative.transform(tw);
+ });
+
+ _(AST_Array, function(self, tw){
+ self.elements = do_list(self.elements, tw);
+ });
+
+ _(AST_Object, function(self, tw){
+ self.properties = do_list(self.properties, tw);
+ });
+
+ _(AST_ObjectProperty, function(self, tw){
+ self.value = self.value.transform(tw);
+ });
+
+})();
+
+/***********************************************************************
+
+ A JavaScript tokenizer / parser / beautifier / compressor.
+ https://github.com/mishoo/UglifyJS2
+
+ -------------------------------- (C) ---------------------------------
+
+ Author: Mihai Bazon
+ <mihai.bazon@gmail.com>
+ http://mihai.bazon.net/blog
+
+ Distributed under the BSD license:
+
+ Copyright 2012 (c) Mihai Bazon <mihai.bazon@gmail.com>
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ * Redistributions of source code must retain the above
+ copyright notice, this list of conditions and the following
+ disclaimer.
+
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials
+ provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+ THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+
+ ***********************************************************************/
+
+"use strict";
+
+function SymbolDef(scope, index, orig) {
+ this.name = orig.name;
+ this.orig = [ orig ];
+ this.scope = scope;
+ this.references = [];
+ this.global = false;
+ this.mangled_name = null;
+ this.undeclared = false;
+ this.constant = false;
+ this.index = index;
+};
+
+SymbolDef.prototype = {
+ unmangleable: function(options) {
+ return (this.global && !(options && options.toplevel))
+ || this.undeclared
+ || (!(options && options.eval) && (this.scope.uses_eval || this.scope.uses_with));
+ },
+ mangle: function(options) {
+ if (!this.mangled_name && !this.unmangleable(options)) {
+ var s = this.scope;
+ if (!options.screw_ie8 && this.orig[0] instanceof AST_SymbolLambda)
+ s = s.parent_scope;
+ this.mangled_name = s.next_mangled(options, this);
+ }
+ }
+};
+
+AST_Toplevel.DEFMETHOD("figure_out_scope", function(options){
+ options = defaults(options, {
+ screw_ie8: false
+ });
+
+ // pass 1: setup scope chaining and handle definitions
+ var self = this;
+ var scope = self.parent_scope = null;
+ var defun = null;
+ var nesting = 0;
+ var tw = new TreeWalker(function(node, descend){
+ if (options.screw_ie8 && node instanceof AST_Catch) {
+ var save_scope = scope;
+ scope = new AST_Scope(node);
+ scope.init_scope_vars(nesting);
+ scope.parent_scope = save_scope;
+ descend();
+ scope = save_scope;
+ return true;
+ }
+ if (node instanceof AST_Scope) {
+ node.init_scope_vars(nesting);
+ var save_scope = node.parent_scope = scope;
+ var save_defun = defun;
+ defun = scope = node;
+ ++nesting; descend(); --nesting;
+ scope = save_scope;
+ defun = save_defun;
+ return true; // don't descend again in TreeWalker
+ }
+ if (node instanceof AST_Directive) {
+ node.scope = scope;
+ push_uniq(scope.directives, node.value);
+ return true;
+ }
+ if (node instanceof AST_With) {
+ for (var s = scope; s; s = s.parent_scope)
+ s.uses_with = true;
+ return;
+ }
+ if (node instanceof AST_Symbol) {
+ node.scope = scope;
+ }
+ if (node instanceof AST_SymbolLambda) {
+ defun.def_function(node);
+ }
+ else if (node instanceof AST_SymbolDefun) {
+ // Careful here, the scope where this should be defined is
+ // the parent scope. The reason is that we enter a new
+ // scope when we encounter the AST_Defun node (which is
+ // instanceof AST_Scope) but we get to the symbol a bit
+ // later.
+ (node.scope = defun.parent_scope).def_function(node);
+ }
+ else if (node instanceof AST_SymbolVar
+ || node instanceof AST_SymbolConst) {
+ var def = defun.def_variable(node);
+ def.constant = node instanceof AST_SymbolConst;
+ def.init = tw.parent().value;
+ }
+ else if (node instanceof AST_SymbolCatch) {
+ (options.screw_ie8 ? scope : defun)
+ .def_variable(node);
+ }
+ });
+ self.walk(tw);
+
+ // pass 2: find back references and eval
+ var func = null;
+ var globals = self.globals = new Dictionary();
+ var tw = new TreeWalker(function(node, descend){
+ if (node instanceof AST_Lambda) {
+ var prev_func = func;
+ func = node;
+ descend();
+ func = prev_func;
+ return true;
+ }
+ if (node instanceof AST_SymbolRef) {
+ var name = node.name;
+ var sym = node.scope.find_variable(name);
+ if (!sym) {
+ var g;
+ if (globals.has(name)) {
+ g = globals.get(name);
+ } else {
+ g = new SymbolDef(self, globals.size(), node);
+ g.undeclared = true;
+ g.global = true;
+ globals.set(name, g);
+ }
+ node.thedef = g;
+ if (name == "eval" && tw.parent() instanceof AST_Call) {
+ for (var s = node.scope; s && !s.uses_eval; s = s.parent_scope)
+ s.uses_eval = true;
+ }
+ if (func && name == "arguments") {
+ func.uses_arguments = true;
+ }
+ } else {
+ node.thedef = sym;
+ }
+ node.reference();
+ return true;
+ }
+ });
+ self.walk(tw);
+});
+
+AST_Scope.DEFMETHOD("init_scope_vars", function(nesting){
+ this.directives = []; // contains the directives defined in this scope, i.e. "use strict"
+ this.variables = new Dictionary(); // map name to AST_SymbolVar (variables defined in this scope; includes functions)
+ this.functions = new Dictionary(); // map name to AST_SymbolDefun (functions defined in this scope)
+ this.uses_with = false; // will be set to true if this or some nested scope uses the `with` statement
+ this.uses_eval = false; // will be set to true if this or nested scope uses the global `eval`
+ this.parent_scope = null; // the parent scope
+ this.enclosed = []; // a list of variables from this or outer scope(s) that are referenced from this or inner scopes
+ this.cname = -1; // the current index for mangling functions/variables
+ this.nesting = nesting; // the nesting level of this scope (0 means toplevel)
+});
+
+AST_Scope.DEFMETHOD("strict", function(){
+ return this.has_directive("use strict");
+});
+
+AST_Lambda.DEFMETHOD("init_scope_vars", function(){
+ AST_Scope.prototype.init_scope_vars.apply(this, arguments);
+ this.uses_arguments = false;
+});
+
+AST_SymbolRef.DEFMETHOD("reference", function() {
+ var def = this.definition();
+ def.references.push(this);
+ var s = this.scope;
+ while (s) {
+ push_uniq(s.enclosed, def);
+ if (s === def.scope) break;
+ s = s.parent_scope;
+ }
+ this.frame = this.scope.nesting - def.scope.nesting;
+});
+
+AST_Scope.DEFMETHOD("find_variable", function(name){
+ if (name instanceof AST_Symbol) name = name.name;
+ return this.variables.get(name)
+ || (this.parent_scope && this.parent_scope.find_variable(name));
+});
+
+AST_Scope.DEFMETHOD("has_directive", function(value){
+ return this.parent_scope && this.parent_scope.has_directive(value)
+ || (this.directives.indexOf(value) >= 0 ? this : null);
+});
+
+AST_Scope.DEFMETHOD("def_function", function(symbol){
+ this.functions.set(symbol.name, this.def_variable(symbol));
+});
+
+AST_Scope.DEFMETHOD("def_variable", function(symbol){
+ var def;
+ if (!this.variables.has(symbol.name)) {
+ def = new SymbolDef(this, this.variables.size(), symbol);
+ this.variables.set(symbol.name, def);
+ def.global = !this.parent_scope;
+ } else {
+ def = this.variables.get(symbol.name);
+ def.orig.push(symbol);
+ }
+ return symbol.thedef = def;
+});
+
+AST_Scope.DEFMETHOD("next_mangled", function(options){
+ var ext = this.enclosed;
+ out: while (true) {
+ var m = base54(++this.cname);
+ if (!is_identifier(m)) continue; // skip over "do"
+
+ // https://github.com/mishoo/UglifyJS2/issues/242 -- do not
+ // shadow a name excepted from mangling.
+ if (options.except.indexOf(m) >= 0) continue;
+
+ // we must ensure that the mangled name does not shadow a name
+ // from some parent scope that is referenced in this or in
+ // inner scopes.
+ for (var i = ext.length; --i >= 0;) {
+ var sym = ext[i];
+ var name = sym.mangled_name || (sym.unmangleable(options) && sym.name);
+ if (m == name) continue out;
+ }
+ return m;
+ }
+});
+
+AST_Function.DEFMETHOD("next_mangled", function(options, def){
+ // #179, #326
+ // in Safari strict mode, something like (function x(x){...}) is a syntax error;
+ // a function expression's argument cannot shadow the function expression's name
+
+ var tricky_def = def.orig[0] instanceof AST_SymbolFunarg && this.name && this.name.definition();
+ while (true) {
+ var name = AST_Lambda.prototype.next_mangled.call(this, options, def);
+ if (!(tricky_def && tricky_def.mangled_name == name))
+ return name;
+ }
+});
+
+AST_Scope.DEFMETHOD("references", function(sym){
+ if (sym instanceof AST_Symbol) sym = sym.definition();
+ return this.enclosed.indexOf(sym) < 0 ? null : sym;
+});
+
+AST_Symbol.DEFMETHOD("unmangleable", function(options){
+ return this.definition().unmangleable(options);
+});
+
+// property accessors are not mangleable
+AST_SymbolAccessor.DEFMETHOD("unmangleable", function(){
+ return true;
+});
+
+// labels are always mangleable
+AST_Label.DEFMETHOD("unmangleable", function(){
+ return false;
+});
+
+AST_Symbol.DEFMETHOD("unreferenced", function(){
+ return this.definition().references.length == 0
+ && !(this.scope.uses_eval || this.scope.uses_with);
+});
+
+AST_Symbol.DEFMETHOD("undeclared", function(){
+ return this.definition().undeclared;
+});
+
+AST_LabelRef.DEFMETHOD("undeclared", function(){
+ return false;
+});
+
+AST_Label.DEFMETHOD("undeclared", function(){
+ return false;
+});
+
+AST_Symbol.DEFMETHOD("definition", function(){
+ return this.thedef;
+});
+
+AST_Symbol.DEFMETHOD("global", function(){
+ return this.definition().global;
+});
+
+AST_Toplevel.DEFMETHOD("_default_mangler_options", function(options){
+ return defaults(options, {
+ except : [],
+ eval : false,
+ sort : false,
+ toplevel : false,
+ screw_ie8 : false
+ });
+});
+
+AST_Toplevel.DEFMETHOD("mangle_names", function(options){
+ options = this._default_mangler_options(options);
+ // We only need to mangle declaration nodes. Special logic wired
+ // into the code generator will display the mangled name if it's
+ // present (and for AST_SymbolRef-s it'll use the mangled name of
+ // the AST_SymbolDeclaration that it points to).
+ var lname = -1;
+ var to_mangle = [];
+ var tw = new TreeWalker(function(node, descend){
+ if (node instanceof AST_LabeledStatement) {
+ // lname is incremented when we get to the AST_Label
+ var save_nesting = lname;
+ descend();
+ lname = save_nesting;
+ return true; // don't descend again in TreeWalker
+ }
+ if (node instanceof AST_Scope) {
+ var p = tw.parent(), a = [];
+ node.variables.each(function(symbol){
+ if (options.except.indexOf(symbol.name) < 0) {
+ a.push(symbol);
+ }
+ });
+ if (options.sort) a.sort(function(a, b){
+ return b.references.length - a.references.length;
+ });
+ to_mangle.push.apply(to_mangle, a);
+ return;
+ }
+ if (node instanceof AST_Label) {
+ var name;
+ do name = base54(++lname); while (!is_identifier(name));
+ node.mangled_name = name;
+ return true;
+ }
+ if (options.screw_ie8 && node instanceof AST_SymbolCatch) {
+ to_mangle.push(node.definition());
+ return;
+ }
+ });
+ this.walk(tw);
+ to_mangle.forEach(function(def){ def.mangle(options) });
+});
+
+AST_Toplevel.DEFMETHOD("compute_char_frequency", function(options){
+ options = this._default_mangler_options(options);
+ var tw = new TreeWalker(function(node){
+ if (node instanceof AST_Constant)
+ base54.consider(node.print_to_string());
+ else if (node instanceof AST_Return)
+ base54.consider("return");
+ else if (node instanceof AST_Throw)
+ base54.consider("throw");
+ else if (node instanceof AST_Continue)
+ base54.consider("continue");
+ else if (node instanceof AST_Break)
+ base54.consider("break");
+ else if (node instanceof AST_Debugger)
+ base54.consider("debugger");
+ else if (node instanceof AST_Directive)
+ base54.consider(node.value);
+ else if (node instanceof AST_While)
+ base54.consider("while");
+ else if (node instanceof AST_Do)
+ base54.consider("do while");
+ else if (node instanceof AST_If) {
+ base54.consider("if");
+ if (node.alternative) base54.consider("else");
+ }
+ else if (node instanceof AST_Var)
+ base54.consider("var");
+ else if (node instanceof AST_Const)
+ base54.consider("const");
+ else if (node instanceof AST_Lambda)
+ base54.consider("function");
+ else if (node instanceof AST_For)
+ base54.consider("for");
+ else if (node instanceof AST_ForIn)
+ base54.consider("for in");
+ else if (node instanceof AST_Switch)
+ base54.consider("switch");
+ else if (node instanceof AST_Case)
+ base54.consider("case");
+ else if (node instanceof AST_Default)
+ base54.consider("default");
+ else if (node instanceof AST_With)
+ base54.consider("with");
+ else if (node instanceof AST_ObjectSetter)
+ base54.consider("set" + node.key);
+ else if (node instanceof AST_ObjectGetter)
+ base54.consider("get" + node.key);
+ else if (node instanceof AST_ObjectKeyVal)
+ base54.consider(node.key);
+ else if (node instanceof AST_New)
+ base54.consider("new");
+ else if (node instanceof AST_This)
+ base54.consider("this");
+ else if (node instanceof AST_Try)
+ base54.consider("try");
+ else if (node instanceof AST_Catch)
+ base54.consider("catch");
+ else if (node instanceof AST_Finally)
+ base54.consider("finally");
+ else if (node instanceof AST_Symbol && node.unmangleable(options))
+ base54.consider(node.name);
+ else if (node instanceof AST_Unary || node instanceof AST_Binary)
+ base54.consider(node.operator);
+ else if (node instanceof AST_Dot)
+ base54.consider(node.property);
+ });
+ this.walk(tw);
+ base54.sort();
+});
+
+var base54 = (function() {
+ var string = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_0123456789";
+ var chars, frequency;
+ function reset() {
+ frequency = Object.create(null);
+ chars = string.split("").map(function(ch){ return ch.charCodeAt(0) });
+ chars.forEach(function(ch){ frequency[ch] = 0 });
+ }
+ base54.consider = function(str){
+ for (var i = str.length; --i >= 0;) {
+ var code = str.charCodeAt(i);
+ if (code in frequency) ++frequency[code];
+ }
+ };
+ base54.sort = function() {
+ chars = mergeSort(chars, function(a, b){
+ if (is_digit(a) && !is_digit(b)) return 1;
+ if (is_digit(b) && !is_digit(a)) return -1;
+ return frequency[b] - frequency[a];
+ });
+ };
+ base54.reset = reset;
+ reset();
+ base54.get = function(){ return chars };
+ base54.freq = function(){ return frequency };
+ function base54(num) {
+ var ret = "", base = 54;
+ do {
+ ret += String.fromCharCode(chars[num % base]);
+ num = Math.floor(num / base);
+ base = 64;
+ } while (num > 0);
+ return ret;
+ };
+ return base54;
+})();
+
+AST_Toplevel.DEFMETHOD("scope_warnings", function(options){
+ options = defaults(options, {
+ undeclared : false, // this makes a lot of noise
+ unreferenced : true,
+ assign_to_global : true,
+ func_arguments : true,
+ nested_defuns : true,
+ eval : true
+ });
+ var tw = new TreeWalker(function(node){
+ if (options.undeclared
+ && node instanceof AST_SymbolRef
+ && node.undeclared())
+ {
+ // XXX: this also warns about JS standard names,
+ // i.e. Object, Array, parseInt etc. Should add a list of
+ // exceptions.
+ AST_Node.warn("Undeclared symbol: {name} [{file}:{line},{col}]", {
+ name: node.name,
+ file: node.start.file,
+ line: node.start.line,
+ col: node.start.col
+ });
+ }
+ if (options.assign_to_global)
+ {
+ var sym = null;
+ if (node instanceof AST_Assign && node.left instanceof AST_SymbolRef)
+ sym = node.left;
+ else if (node instanceof AST_ForIn && node.init instanceof AST_SymbolRef)
+ sym = node.init;
+ if (sym
+ && (sym.undeclared()
+ || (sym.global() && sym.scope !== sym.definition().scope))) {
+ AST_Node.warn("{msg}: {name} [{file}:{line},{col}]", {
+ msg: sym.undeclared() ? "Accidental global?" : "Assignment to global",
+ name: sym.name,
+ file: sym.start.file,
+ line: sym.start.line,
+ col: sym.start.col
+ });
+ }
+ }
+ if (options.eval
+ && node instanceof AST_SymbolRef
+ && node.undeclared()
+ && node.name == "eval") {
+ AST_Node.warn("Eval is used [{file}:{line},{col}]", node.start);
+ }
+ if (options.unreferenced
+ && (node instanceof AST_SymbolDeclaration || node instanceof AST_Label)
+ && !(node instanceof AST_SymbolCatch)
+ && node.unreferenced()) {
+ AST_Node.warn("{type} {name} is declared but not referenced [{file}:{line},{col}]", {
+ type: node instanceof AST_Label ? "Label" : "Symbol",
+ name: node.name,
+ file: node.start.file,
+ line: node.start.line,
+ col: node.start.col
+ });
+ }
+ if (options.func_arguments
+ && node instanceof AST_Lambda
+ && node.uses_arguments) {
+ AST_Node.warn("arguments used in function {name} [{file}:{line},{col}]", {
+ name: node.name ? node.name.name : "anonymous",
+ file: node.start.file,
+ line: node.start.line,
+ col: node.start.col
+ });
+ }
+ if (options.nested_defuns
+ && node instanceof AST_Defun
+ && !(tw.parent() instanceof AST_Scope)) {
+ AST_Node.warn("Function {name} declared in nested statement \"{type}\" [{file}:{line},{col}]", {
+ name: node.name.name,
+ type: tw.parent().TYPE,
+ file: node.start.file,
+ line: node.start.line,
+ col: node.start.col
+ });
+ }
+ });
+ this.walk(tw);
+});
+
+/***********************************************************************
+
+ A JavaScript tokenizer / parser / beautifier / compressor.
+ https://github.com/mishoo/UglifyJS2
+
+ -------------------------------- (C) ---------------------------------
+
+ Author: Mihai Bazon
+ <mihai.bazon@gmail.com>
+ http://mihai.bazon.net/blog
+
+ Distributed under the BSD license:
+
+ Copyright 2012 (c) Mihai Bazon <mihai.bazon@gmail.com>
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ * Redistributions of source code must retain the above
+ copyright notice, this list of conditions and the following
+ disclaimer.
+
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials
+ provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+ THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+
+ ***********************************************************************/
+
+"use strict";
+
+function OutputStream(options) {
+
+ options = defaults(options, {
+ indent_start : 0,
+ indent_level : 4,
+ quote_keys : false,
+ space_colon : true,
+ ascii_only : false,
+ unescape_regexps : false,
+ inline_script : false,
+ width : 80,
+ max_line_len : 32000,
+ beautify : false,
+ source_map : null,
+ bracketize : false,
+ semicolons : true,
+ comments : false,
+ preserve_line : false,
+ screw_ie8 : false,
+ preamble : null,
+ }, true);
+
+ var indentation = 0;
+ var current_col = 0;
+ var current_line = 1;
+ var current_pos = 0;
+ var OUTPUT = "";
+
+ function to_ascii(str, identifier) {
+ return str.replace(/[\u0080-\uffff]/g, function(ch) {
+ var code = ch.charCodeAt(0).toString(16);
+ if (code.length <= 2 && !identifier) {
+ while (code.length < 2) code = "0" + code;
+ return "\\x" + code;
+ } else {
+ while (code.length < 4) code = "0" + code;
+ return "\\u" + code;
+ }
+ });
+ };
+
+ function make_string(str) {
+ var dq = 0, sq = 0;
+ str = str.replace(/[\\\b\f\n\r\t\x22\x27\u2028\u2029\0]/g, function(s){
+ switch (s) {
+ case "\\": return "\\\\";
+ case "\b": return "\\b";
+ case "\f": return "\\f";
+ case "\n": return "\\n";
+ case "\r": return "\\r";
+ case "\u2028": return "\\u2028";
+ case "\u2029": return "\\u2029";
+ case '"': ++dq; return '"';
+ case "'": ++sq; return "'";
+ case "\0": return "\\x00";
+ }
+ return s;
+ });
+ if (options.ascii_only) str = to_ascii(str);
+ if (dq > sq) return "'" + str.replace(/\x27/g, "\\'") + "'";
+ else return '"' + str.replace(/\x22/g, '\\"') + '"';
+ };
+
+ function encode_string(str) {
+ var ret = make_string(str);
+ if (options.inline_script)
+ ret = ret.replace(/<\x2fscript([>\/\t\n\f\r ])/gi, "<\\/script$1");
+ return ret;
+ };
+
+ function make_name(name) {
+ name = name.toString();
+ if (options.ascii_only)
+ name = to_ascii(name, true);
+ return name;
+ };
+
+ function make_indent(back) {
+ return repeat_string(" ", options.indent_start + indentation - back * options.indent_level);
+ };
+
+ /* -----[ beautification/minification ]----- */
+
+ var might_need_space = false;
+ var might_need_semicolon = false;
+ var last = null;
+
+ function last_char() {
+ return last.charAt(last.length - 1);
+ };
+
+ function maybe_newline() {
+ if (options.max_line_len && current_col > options.max_line_len)
+ print("\n");
+ };
+
+ var requireSemicolonChars = makePredicate("( [ + * / - , .");
+
+ function print(str) {
+ str = String(str);
+ var ch = str.charAt(0);
+ if (might_need_semicolon) {
+ if ((!ch || ";}".indexOf(ch) < 0) && !/[;]$/.test(last)) {
+ if (options.semicolons || requireSemicolonChars(ch)) {
+ OUTPUT += ";";
+ current_col++;
+ current_pos++;
+ } else {
+ OUTPUT += "\n";
+ current_pos++;
+ current_line++;
+ current_col = 0;
+ }
+ if (!options.beautify)
+ might_need_space = false;
+ }
+ might_need_semicolon = false;
+ maybe_newline();
+ }
+
+ if (!options.beautify && options.preserve_line && stack[stack.length - 1]) {
+ var target_line = stack[stack.length - 1].start.line;
+ while (current_line < target_line) {
+ OUTPUT += "\n";
+ current_pos++;
+ current_line++;
+ current_col = 0;
+ might_need_space = false;
+ }
+ }
+
+ if (might_need_space) {
+ var prev = last_char();
+ if ((is_identifier_char(prev)
+ && (is_identifier_char(ch) || ch == "\\"))
+ || (/^[\+\-\/]$/.test(ch) && ch == prev))
+ {
+ OUTPUT += " ";
+ current_col++;
+ current_pos++;
+ }
+ might_need_space = false;
+ }
+ var a = str.split(/\r?\n/), n = a.length - 1;
+ current_line += n;
+ if (n == 0) {
+ current_col += a[n].length;
+ } else {
+ current_col = a[n].length;
+ }
+ current_pos += str.length;
+ last = str;
+ OUTPUT += str;
+ };
+
+ var space = options.beautify ? function() {
+ print(" ");
+ } : function() {
+ might_need_space = true;
+ };
+
+ var indent = options.beautify ? function(half) {
+ if (options.beautify) {
+ print(make_indent(half ? 0.5 : 0));
+ }
+ } : noop;
+
+ var with_indent = options.beautify ? function(col, cont) {
+ if (col === true) col = next_indent();
+ var save_indentation = indentation;
+ indentation = col;
+ var ret = cont();
+ indentation = save_indentation;
+ return ret;
+ } : function(col, cont) { return cont() };
+
+ var newline = options.beautify ? function() {
+ print("\n");
+ } : noop;
+
+ var semicolon = options.beautify ? function() {
+ print(";");
+ } : function() {
+ might_need_semicolon = true;
+ };
+
+ function force_semicolon() {
+ might_need_semicolon = false;
+ print(";");
+ };
+
+ function next_indent() {
+ return indentation + options.indent_level;
+ };
+
+ function with_block(cont) {
+ var ret;
+ print("{");
+ newline();
+ with_indent(next_indent(), function(){
+ ret = cont();
+ });
+ indent();
+ print("}");
+ return ret;
+ };
+
+ function with_parens(cont) {
+ print("(");
+ //XXX: still nice to have that for argument lists
+ //var ret = with_indent(current_col, cont);
+ var ret = cont();
+ print(")");
+ return ret;
+ };
+
+ function with_square(cont) {
+ print("[");
+ //var ret = with_indent(current_col, cont);
+ var ret = cont();
+ print("]");
+ return ret;
+ };
+
+ function comma() {
+ print(",");
+ space();
+ };
+
+ function colon() {
+ print(":");
+ if (options.space_colon) space();
+ };
+
+ var add_mapping = options.source_map ? function(token, name) {
+ try {
+ if (token) options.source_map.add(
+ token.file || "?",
+ current_line, current_col,
+ token.line, token.col,
+ (!name && token.type == "name") ? token.value : name
+ );
+ } catch(ex) {
+ AST_Node.warn("Couldn't figure out mapping for {file}:{line},{col} → {cline},{ccol} [{name}]", {
+ file: token.file,
+ line: token.line,
+ col: token.col,
+ cline: current_line,
+ ccol: current_col,
+ name: name || ""
+ })
+ }
+ } : noop;
+
+ function get() {
+ return OUTPUT;
+ };
+
+ if (options.preamble) {
+ print(options.preamble.replace(/\r\n?|[\n\u2028\u2029]|\s*$/g, "\n"));
+ }
+
+ var stack = [];
+ return {
+ get : get,
+ toString : get,
+ indent : indent,
+ indentation : function() { return indentation },
+ current_width : function() { return current_col - indentation },
+ should_break : function() { return options.width && this.current_width() >= options.width },
+ newline : newline,
+ print : print,
+ space : space,
+ comma : comma,
+ colon : colon,
+ last : function() { return last },
+ semicolon : semicolon,
+ force_semicolon : force_semicolon,
+ to_ascii : to_ascii,
+ print_name : function(name) { print(make_name(name)) },
+ print_string : function(str) { print(encode_string(str)) },
+ next_indent : next_indent,
+ with_indent : with_indent,
+ with_block : with_block,
+ with_parens : with_parens,
+ with_square : with_square,
+ add_mapping : add_mapping,
+ option : function(opt) { return options[opt] },
+ line : function() { return current_line },
+ col : function() { return current_col },
+ pos : function() { return current_pos },
+ push_node : function(node) { stack.push(node) },
+ pop_node : function() { return stack.pop() },
+ stack : function() { return stack },
+ parent : function(n) {
+ return stack[stack.length - 2 - (n || 0)];
+ }
+ };
+
+};
+
+/* -----[ code generators ]----- */
+
+(function(){
+
+ /* -----[ utils ]----- */
+
+ function DEFPRINT(nodetype, generator) {
+ nodetype.DEFMETHOD("_codegen", generator);
+ };
+
+ AST_Node.DEFMETHOD("print", function(stream, force_parens){
+ var self = this, generator = self._codegen;
+ function doit() {
+ self.add_comments(stream);
+ self.add_source_map(stream);
+ generator(self, stream);
+ }
+ stream.push_node(self);
+ if (force_parens || self.needs_parens(stream)) {
+ stream.with_parens(doit);
+ } else {
+ doit();
+ }
+ stream.pop_node();
+ });
+
+ AST_Node.DEFMETHOD("print_to_string", function(options){
+ var s = OutputStream(options);
+ this.print(s);
+ return s.get();
+ });
+
+ /* -----[ comments ]----- */
+
+ AST_Node.DEFMETHOD("add_comments", function(output){
+ var c = output.option("comments"), self = this;
+ if (c) {
+ var start = self.start;
+ if (start && !start._comments_dumped) {
+ start._comments_dumped = true;
+ var comments = start.comments_before || [];
+
+ // XXX: ugly fix for https://github.com/mishoo/UglifyJS2/issues/112
+ // and https://github.com/mishoo/UglifyJS2/issues/372
+ if (self instanceof AST_Exit && self.value) {
+ self.value.walk(new TreeWalker(function(node){
+ if (node.start && node.start.comments_before) {
+ comments = comments.concat(node.start.comments_before);
+ node.start.comments_before = [];
+ }
+ if (node instanceof AST_Function ||
+ node instanceof AST_Array ||
+ node instanceof AST_Object)
+ {
+ return true; // don't go inside.
+ }
+ }));
+ }
+
+ if (c.test) {
+ comments = comments.filter(function(comment){
+ return c.test(comment.value);
+ });
+ } else if (typeof c == "function") {
+ comments = comments.filter(function(comment){
+ return c(self, comment);
+ });
+ }
+ comments.forEach(function(c){
+ if (/comment[134]/.test(c.type)) {
+ output.print("//" + c.value + "\n");
+ output.indent();
+ }
+ else if (c.type == "comment2") {
+ output.print("/*" + c.value + "*/");
+ if (start.nlb) {
+ output.print("\n");
+ output.indent();
+ } else {
+ output.space();
+ }
+ }
+ });
+ }
+ }
+ });
+
+ /* -----[ PARENTHESES ]----- */
+
+ function PARENS(nodetype, func) {
+ if (Array.isArray(nodetype)) {
+ nodetype.forEach(function(nodetype){
+ PARENS(nodetype, func);
+ });
+ } else {
+ nodetype.DEFMETHOD("needs_parens", func);
+ }
+ };
+
+ PARENS(AST_Node, function(){
+ return false;
+ });
+
+ // a function expression needs parens around it when it's provably
+ // the first token to appear in a statement.
+ PARENS(AST_Function, function(output){
+ return first_in_statement(output);
+ });
+
+ // same goes for an object literal, because otherwise it would be
+ // interpreted as a block of code.
+ PARENS(AST_Object, function(output){
+ return first_in_statement(output);
+ });
+
+ PARENS([ AST_Unary, AST_Undefined ], function(output){
+ var p = output.parent();
+ return p instanceof AST_PropAccess && p.expression === this;
+ });
+
+ PARENS(AST_Seq, function(output){
+ var p = output.parent();
+ return p instanceof AST_Call // (foo, bar)() or foo(1, (2, 3), 4)
+ || p instanceof AST_Unary // !(foo, bar, baz)
+ || p instanceof AST_Binary // 1 + (2, 3) + 4 ==> 8
+ || p instanceof AST_VarDef // var a = (1, 2), b = a + a; ==> b == 4
+ || p instanceof AST_PropAccess // (1, {foo:2}).foo or (1, {foo:2})["foo"] ==> 2
+ || p instanceof AST_Array // [ 1, (2, 3), 4 ] ==> [ 1, 3, 4 ]
+ || p instanceof AST_ObjectProperty // { foo: (1, 2) }.foo ==> 2
+ || p instanceof AST_Conditional /* (false, true) ? (a = 10, b = 20) : (c = 30)
+ * ==> 20 (side effect, set a := 10 and b := 20) */
+ ;
+ });
+
+ PARENS(AST_Binary, function(output){
+ var p = output.parent();
+ // (foo && bar)()
+ if (p instanceof AST_Call && p.expression === this)
+ return true;
+ // typeof (foo && bar)
+ if (p instanceof AST_Unary)
+ return true;
+ // (foo && bar)["prop"], (foo && bar).prop
+ if (p instanceof AST_PropAccess && p.expression === this)
+ return true;
+ // this deals with precedence: 3 * (2 + 1)
+ if (p instanceof AST_Binary) {
+ var po = p.operator, pp = PRECEDENCE[po];
+ var so = this.operator, sp = PRECEDENCE[so];
+ if (pp > sp
+ || (pp == sp
+ && this === p.right)) {
+ return true;
+ }
+ }
+ });
+
+ PARENS(AST_PropAccess, function(output){
+ var p = output.parent();
+ if (p instanceof AST_New && p.expression === this) {
+ // i.e. new (foo.bar().baz)
+ //
+ // if there's one call into this subtree, then we need
+ // parens around it too, otherwise the call will be
+ // interpreted as passing the arguments to the upper New
+ // expression.
+ try {
+ this.walk(new TreeWalker(function(node){
+ if (node instanceof AST_Call) throw p;
+ }));
+ } catch(ex) {
+ if (ex !== p) throw ex;
+ return true;
+ }
+ }
+ });
+
+ PARENS(AST_Call, function(output){
+ var p = output.parent(), p1;
+ if (p instanceof AST_New && p.expression === this)
+ return true;
+
+ // workaround for Safari bug.
+ // https://bugs.webkit.org/show_bug.cgi?id=123506
+ return this.expression instanceof AST_Function
+ && p instanceof AST_PropAccess
+ && p.expression === this
+ && (p1 = output.parent(1)) instanceof AST_Assign
+ && p1.left === p;
+ });
+
+ PARENS(AST_New, function(output){
+ var p = output.parent();
+ if (no_constructor_parens(this, output)
+ && (p instanceof AST_PropAccess // (new Date).getTime(), (new Date)["getTime"]()
+ || p instanceof AST_Call && p.expression === this)) // (new foo)(bar)
+ return true;
+ });
+
+ PARENS(AST_Number, function(output){
+ var p = output.parent();
+ if (this.getValue() < 0 && p instanceof AST_PropAccess && p.expression === this)
+ return true;
+ });
+
+ PARENS(AST_NaN, function(output){
+ var p = output.parent();
+ if (p instanceof AST_PropAccess && p.expression === this)
+ return true;
+ });
+
+ PARENS([ AST_Assign, AST_Conditional ], function (output){
+ var p = output.parent();
+ // !(a = false) → true
+ if (p instanceof AST_Unary)
+ return true;
+ // 1 + (a = 2) + 3 → 6, side effect setting a = 2
+ if (p instanceof AST_Binary && !(p instanceof AST_Assign))
+ return true;
+ // (a = func)() —or— new (a = Object)()
+ if (p instanceof AST_Call && p.expression === this)
+ return true;
+ // (a = foo) ? bar : baz
+ if (p instanceof AST_Conditional && p.condition === this)
+ return true;
+ // (a = foo)["prop"] —or— (a = foo).prop
+ if (p instanceof AST_PropAccess && p.expression === this)
+ return true;
+ });
+
+ /* -----[ PRINTERS ]----- */
+
+ DEFPRINT(AST_Directive, function(self, output){
+ output.print_string(self.value);
+ output.semicolon();
+ });
+ DEFPRINT(AST_Debugger, function(self, output){
+ output.print("debugger");
+ output.semicolon();
+ });
+
+ /* -----[ statements ]----- */
+
+ function display_body(body, is_toplevel, output) {
+ var last = body.length - 1;
+ body.forEach(function(stmt, i){
+ if (!(stmt instanceof AST_EmptyStatement)) {
+ output.indent();
+ stmt.print(output);
+ if (!(i == last && is_toplevel)) {
+ output.newline();
+ if (is_toplevel) output.newline();
+ }
+ }
+ });
+ };
+
+ AST_StatementWithBody.DEFMETHOD("_do_print_body", function(output){
+ force_statement(this.body, output);
+ });
+
+ DEFPRINT(AST_Statement, function(self, output){
+ self.body.print(output);
+ output.semicolon();
+ });
+ DEFPRINT(AST_Toplevel, function(self, output){
+ display_body(self.body, true, output);
+ output.print("");
+ });
+ DEFPRINT(AST_LabeledStatement, function(self, output){
+ self.label.print(output);
+ output.colon();
+ self.body.print(output);
+ });
+ DEFPRINT(AST_SimpleStatement, function(self, output){
+ self.body.print(output);
+ output.semicolon();
+ });
+ function print_bracketed(body, output) {
+ if (body.length > 0) output.with_block(function(){
+ display_body(body, false, output);
+ });
+ else output.print("{}");
+ };
+ DEFPRINT(AST_BlockStatement, function(self, output){
+ print_bracketed(self.body, output);
+ });
+ DEFPRINT(AST_EmptyStatement, function(self, output){
+ output.semicolon();
+ });
+ DEFPRINT(AST_Do, function(self, output){
+ output.print("do");
+ output.space();
+ self._do_print_body(output);
+ output.space();
+ output.print("while");
+ output.space();
+ output.with_parens(function(){
+ self.condition.print(output);
+ });
+ output.semicolon();
+ });
+ DEFPRINT(AST_While, function(self, output){
+ output.print("while");
+ output.space();
+ output.with_parens(function(){
+ self.condition.print(output);
+ });
+ output.space();
+ self._do_print_body(output);
+ });
+ DEFPRINT(AST_For, function(self, output){
+ output.print("for");
+ output.space();
+ output.with_parens(function(){
+ if (self.init && !(self.init instanceof AST_EmptyStatement)) {
+ if (self.init instanceof AST_Definitions) {
+ self.init.print(output);
+ } else {
+ parenthesize_for_noin(self.init, output, true);
+ }
+ output.print(";");
+ output.space();
+ } else {
+ output.print(";");
+ }
+ if (self.condition) {
+ self.condition.print(output);
+ output.print(";");
+ output.space();
+ } else {
+ output.print(";");
+ }
+ if (self.step) {
+ self.step.print(output);
+ }
+ });
+ output.space();
+ self._do_print_body(output);
+ });
+ DEFPRINT(AST_ForIn, function(self, output){
+ output.print("for");
+ output.space();
+ output.with_parens(function(){
+ self.init.print(output);
+ output.space();
+ output.print("in");
+ output.space();
+ self.object.print(output);
+ });
+ output.space();
+ self._do_print_body(output);
+ });
+ DEFPRINT(AST_With, function(self, output){
+ output.print("with");
+ output.space();
+ output.with_parens(function(){
+ self.expression.print(output);
+ });
+ output.space();
+ self._do_print_body(output);
+ });
+
+ /* -----[ functions ]----- */
+ AST_Lambda.DEFMETHOD("_do_print", function(output, nokeyword){
+ var self = this;
+ if (!nokeyword) {
+ output.print("function");
+ }
+ if (self.name) {
+ output.space();
+ self.name.print(output);
+ }
+ output.with_parens(function(){
+ self.argnames.forEach(function(arg, i){
+ if (i) output.comma();
+ arg.print(output);
+ });
+ });
+ output.space();
+ print_bracketed(self.body, output);
+ });
+ DEFPRINT(AST_Lambda, function(self, output){
+ self._do_print(output);
+ });
+
+ /* -----[ exits ]----- */
+ AST_Exit.DEFMETHOD("_do_print", function(output, kind){
+ output.print(kind);
+ if (this.value) {
+ output.space();
+ this.value.print(output);
+ }
+ output.semicolon();
+ });
+ DEFPRINT(AST_Return, function(self, output){
+ self._do_print(output, "return");
+ });
+ DEFPRINT(AST_Throw, function(self, output){
+ self._do_print(output, "throw");
+ });
+
+ /* -----[ loop control ]----- */
+ AST_LoopControl.DEFMETHOD("_do_print", function(output, kind){
+ output.print(kind);
+ if (this.label) {
+ output.space();
+ this.label.print(output);
+ }
+ output.semicolon();
+ });
+ DEFPRINT(AST_Break, function(self, output){
+ self._do_print(output, "break");
+ });
+ DEFPRINT(AST_Continue, function(self, output){
+ self._do_print(output, "continue");
+ });
+
+ /* -----[ if ]----- */
+ function make_then(self, output) {
+ if (output.option("bracketize")) {
+ make_block(self.body, output);
+ return;
+ }
+ // The squeezer replaces "block"-s that contain only a single
+ // statement with the statement itself; technically, the AST
+ // is correct, but this can create problems when we output an
+ // IF having an ELSE clause where the THEN clause ends in an
+ // IF *without* an ELSE block (then the outer ELSE would refer
+ // to the inner IF). This function checks for this case and
+ // adds the block brackets if needed.
+ if (!self.body)
+ return output.force_semicolon();
+ if (self.body instanceof AST_Do
+ && !output.option("screw_ie8")) {
+ // https://github.com/mishoo/UglifyJS/issues/#issue/57 IE
+ // croaks with "syntax error" on code like this: if (foo)
+ // do ... while(cond); else ... we need block brackets
+ // around do/while
+ make_block(self.body, output);
+ return;
+ }
+ var b = self.body;
+ while (true) {
+ if (b instanceof AST_If) {
+ if (!b.alternative) {
+ make_block(self.body, output);
+ return;
+ }
+ b = b.alternative;
+ }
+ else if (b instanceof AST_StatementWithBody) {
+ b = b.body;
+ }
+ else break;
+ }
+ force_statement(self.body, output);
+ };
+ DEFPRINT(AST_If, function(self, output){
+ output.print("if");
+ output.space();
+ output.with_parens(function(){
+ self.condition.print(output);
+ });
+ output.space();
+ if (self.alternative) {
+ make_then(self, output);
+ output.space();
+ output.print("else");
+ output.space();
+ force_statement(self.alternative, output);
+ } else {
+ self._do_print_body(output);
+ }
+ });
+
+ /* -----[ switch ]----- */
+ DEFPRINT(AST_Switch, function(self, output){
+ output.print("switch");
+ output.space();
+ output.with_parens(function(){
+ self.expression.print(output);
+ });
+ output.space();
+ if (self.body.length > 0) output.with_block(function(){
+ self.body.forEach(function(stmt, i){
+ if (i) output.newline();
+ output.indent(true);
+ stmt.print(output);
+ });
+ });
+ else output.print("{}");
+ });
+ AST_SwitchBranch.DEFMETHOD("_do_print_body", function(output){
+ if (this.body.length > 0) {
+ output.newline();
+ this.body.forEach(function(stmt){
+ output.indent();
+ stmt.print(output);
+ output.newline();
+ });
+ }
+ });
+ DEFPRINT(AST_Default, function(self, output){
+ output.print("default:");
+ self._do_print_body(output);
+ });
+ DEFPRINT(AST_Case, function(self, output){
+ output.print("case");
+ output.space();
+ self.expression.print(output);
+ output.print(":");
+ self._do_print_body(output);
+ });
+
+ /* -----[ exceptions ]----- */
+ DEFPRINT(AST_Try, function(self, output){
+ output.print("try");
+ output.space();
+ print_bracketed(self.body, output);
+ if (self.bcatch) {
+ output.space();
+ self.bcatch.print(output);
+ }
+ if (self.bfinally) {
+ output.space();
+ self.bfinally.print(output);
+ }
+ });
+ DEFPRINT(AST_Catch, function(self, output){
+ output.print("catch");
+ output.space();
+ output.with_parens(function(){
+ self.argname.print(output);
+ });
+ output.space();
+ print_bracketed(self.body, output);
+ });
+ DEFPRINT(AST_Finally, function(self, output){
+ output.print("finally");
+ output.space();
+ print_bracketed(self.body, output);
+ });
+
+ /* -----[ var/const ]----- */
+ AST_Definitions.DEFMETHOD("_do_print", function(output, kind){
+ output.print(kind);
+ output.space();
+ this.definitions.forEach(function(def, i){
+ if (i) output.comma();
+ def.print(output);
+ });
+ var p = output.parent();
+ var in_for = p instanceof AST_For || p instanceof AST_ForIn;
+ var avoid_semicolon = in_for && p.init === this;
+ if (!avoid_semicolon)
+ output.semicolon();
+ });
+ DEFPRINT(AST_Var, function(self, output){
+ self._do_print(output, "var");
+ });
+ DEFPRINT(AST_Const, function(self, output){
+ self._do_print(output, "const");
+ });
+
+ function parenthesize_for_noin(node, output, noin) {
+ if (!noin) node.print(output);
+ else try {
+ // need to take some precautions here:
+ // https://github.com/mishoo/UglifyJS2/issues/60
+ node.walk(new TreeWalker(function(node){
+ if (node instanceof AST_Binary && node.operator == "in")
+ throw output;
+ }));
+ node.print(output);
+ } catch(ex) {
+ if (ex !== output) throw ex;
+ node.print(output, true);
+ }
+ };
+
+ DEFPRINT(AST_VarDef, function(self, output){
+ self.name.print(output);
+ if (self.value) {
+ output.space();
+ output.print("=");
+ output.space();
+ var p = output.parent(1);
+ var noin = p instanceof AST_For || p instanceof AST_ForIn;
+ parenthesize_for_noin(self.value, output, noin);
+ }
+ });
+
+ /* -----[ other expressions ]----- */
+ DEFPRINT(AST_Call, function(self, output){
+ self.expression.print(output);
+ if (self instanceof AST_New && no_constructor_parens(self, output))
+ return;
+ output.with_parens(function(){
+ self.args.forEach(function(expr, i){
+ if (i) output.comma();
+ expr.print(output);
+ });
+ });
+ });
+ DEFPRINT(AST_New, function(self, output){
+ output.print("new");
+ output.space();
+ AST_Call.prototype._codegen(self, output);
+ });
+
+ AST_Seq.DEFMETHOD("_do_print", function(output){
+ this.car.print(output);
+ if (this.cdr) {
+ output.comma();
+ if (output.should_break()) {
+ output.newline();
+ output.indent();
+ }
+ this.cdr.print(output);
+ }
+ });
+ DEFPRINT(AST_Seq, function(self, output){
+ self._do_print(output);
+ // var p = output.parent();
+ // if (p instanceof AST_Statement) {
+ // output.with_indent(output.next_indent(), function(){
+ // self._do_print(output);
+ // });
+ // } else {
+ // self._do_print(output);
+ // }
+ });
+ DEFPRINT(AST_Dot, function(self, output){
+ var expr = self.expression;
+ expr.print(output);
+ if (expr instanceof AST_Number && expr.getValue() >= 0) {
+ if (!/[xa-f.]/i.test(output.last())) {
+ output.print(".");
+ }
+ }
+ output.print(".");
+ // the name after dot would be mapped about here.
+ output.add_mapping(self.end);
+ output.print_name(self.property);
+ });
+ DEFPRINT(AST_Sub, function(self, output){
+ self.expression.print(output);
+ output.print("[");
+ self.property.print(output);
+ output.print("]");
+ });
+ DEFPRINT(AST_UnaryPrefix, function(self, output){
+ var op = self.operator;
+ output.print(op);
+ if (/^[a-z]/i.test(op)
+ || (/[+-]$/.test(op)
+ && self.expression instanceof AST_UnaryPrefix
+ && /^[+-]/.test(self.expression.operator))) {
+ output.space();
+ }
+ self.expression.print(output);
+ });
+ DEFPRINT(AST_UnaryPostfix, function(self, output){
+ self.expression.print(output);
+ output.print(self.operator);
+ });
+ DEFPRINT(AST_Binary, function(self, output){
+ self.left.print(output);
+ output.space();
+ output.print(self.operator);
+ if (self.operator == "<"
+ && self.right instanceof AST_UnaryPrefix
+ && self.right.operator == "!"
+ && self.right.expression instanceof AST_UnaryPrefix
+ && self.right.expression.operator == "--") {
+ // space is mandatory to avoid outputting <!--
+ // http://javascript.spec.whatwg.org/#comment-syntax
+ output.print(" ");
+ } else {
+ // the space is optional depending on "beautify"
+ output.space();
+ }
+ self.right.print(output);
+ });
+ DEFPRINT(AST_Conditional, function(self, output){
+ self.condition.print(output);
+ output.space();
+ output.print("?");
+ output.space();
+ self.consequent.print(output);
+ output.space();
+ output.colon();
+ self.alternative.print(output);
+ });
+
+ /* -----[ literals ]----- */
+ DEFPRINT(AST_Array, function(self, output){
+ output.with_square(function(){
+ var a = self.elements, len = a.length;
+ if (len > 0) output.space();
+ a.forEach(function(exp, i){
+ if (i) output.comma();
+ exp.print(output);
+ // If the final element is a hole, we need to make sure it
+ // doesn't look like a trailing comma, by inserting an actual
+ // trailing comma.
+ if (i === len - 1 && exp instanceof AST_Hole)
+ output.comma();
+ });
+ if (len > 0) output.space();
+ });
+ });
+ DEFPRINT(AST_Object, function(self, output){
+ if (self.properties.length > 0) output.with_block(function(){
+ self.properties.forEach(function(prop, i){
+ if (i) {
+ output.print(",");
+ output.newline();
+ }
+ output.indent();
+ prop.print(output);
+ });
+ output.newline();
+ });
+ else output.print("{}");
+ });
+ DEFPRINT(AST_ObjectKeyVal, function(self, output){
+ var key = self.key;
+ if (output.option("quote_keys")) {
+ output.print_string(key + "");
+ } else if ((typeof key == "number"
+ || !output.option("beautify")
+ && +key + "" == key)
+ && parseFloat(key) >= 0) {
+ output.print(make_num(key));
+ } else if (RESERVED_WORDS(key) ? output.option("screw_ie8") : is_identifier_string(key)) {
+ output.print_name(key);
+ } else {
+ output.print_string(key);
+ }
+ output.colon();
+ self.value.print(output);
+ });
+ DEFPRINT(AST_ObjectSetter, function(self, output){
+ output.print("set");
+ output.space();
+ self.key.print(output);
+ self.value._do_print(output, true);
+ });
+ DEFPRINT(AST_ObjectGetter, function(self, output){
+ output.print("get");
+ output.space();
+ self.key.print(output);
+ self.value._do_print(output, true);
+ });
+ DEFPRINT(AST_Symbol, function(self, output){
+ var def = self.definition();
+ output.print_name(def ? def.mangled_name || def.name : self.name);
+ });
+ DEFPRINT(AST_Undefined, function(self, output){
+ output.print("void 0");
+ });
+ DEFPRINT(AST_Hole, noop);
+ DEFPRINT(AST_Infinity, function(self, output){
+ output.print("1/0");
+ });
+ DEFPRINT(AST_NaN, function(self, output){
+ output.print("0/0");
+ });
+ DEFPRINT(AST_This, function(self, output){
+ output.print("this");
+ });
+ DEFPRINT(AST_Constant, function(self, output){
+ output.print(self.getValue());
+ });
+ DEFPRINT(AST_String, function(self, output){
+ output.print_string(self.getValue());
+ });
+ DEFPRINT(AST_Number, function(self, output){
+ output.print(make_num(self.getValue()));
+ });
+
+ function regexp_safe_literal(code) {
+ return [
+ 0x5c , // \
+ 0x2f , // /
+ 0x2e , // .
+ 0x2b , // +
+ 0x2a , // *
+ 0x3f , // ?
+ 0x28 , // (
+ 0x29 , // )
+ 0x5b , // [
+ 0x5d , // ]
+ 0x7b , // {
+ 0x7d , // }
+ 0x24 , // $
+ 0x5e , // ^
+ 0x3a , // :
+ 0x7c , // |
+ 0x21 , // !
+ 0x0a , // \n
+ 0x0d , // \r
+ 0x00 , // \0
+ 0xfeff , // Unicode BOM
+ 0x2028 , // unicode "line separator"
+ 0x2029 , // unicode "paragraph separator"
+ ].indexOf(code) < 0;
+ };
+
+ DEFPRINT(AST_RegExp, function(self, output){
+ var str = self.getValue().toString();
+ if (output.option("ascii_only")) {
+ str = output.to_ascii(str);
+ } else if (output.option("unescape_regexps")) {
+ str = str.split("\\\\").map(function(str){
+ return str.replace(/\\u[0-9a-fA-F]{4}|\\x[0-9a-fA-F]{2}/g, function(s){
+ var code = parseInt(s.substr(2), 16);
+ return regexp_safe_literal(code) ? String.fromCharCode(code) : s;
+ });
+ }).join("\\\\");
+ }
+ output.print(str);
+ var p = output.parent();
+ if (p instanceof AST_Binary && /^in/.test(p.operator) && p.left === self)
+ output.print(" ");
+ });
+
+ function force_statement(stat, output) {
+ if (output.option("bracketize")) {
+ if (!stat || stat instanceof AST_EmptyStatement)
+ output.print("{}");
+ else if (stat instanceof AST_BlockStatement)
+ stat.print(output);
+ else output.with_block(function(){
+ output.indent();
+ stat.print(output);
+ output.newline();
+ });
+ } else {
+ if (!stat || stat instanceof AST_EmptyStatement)
+ output.force_semicolon();
+ else
+ stat.print(output);
+ }
+ };
+
+ // return true if the node at the top of the stack (that means the
+ // innermost node in the current output) is lexically the first in
+ // a statement.
+ function first_in_statement(output) {
+ var a = output.stack(), i = a.length, node = a[--i], p = a[--i];
+ while (i > 0) {
+ if (p instanceof AST_Statement && p.body === node)
+ return true;
+ if ((p instanceof AST_Seq && p.car === node ) ||
+ (p instanceof AST_Call && p.expression === node && !(p instanceof AST_New) ) ||
+ (p instanceof AST_Dot && p.expression === node ) ||
+ (p instanceof AST_Sub && p.expression === node ) ||
+ (p instanceof AST_Conditional && p.condition === node ) ||
+ (p instanceof AST_Binary && p.left === node ) ||
+ (p instanceof AST_UnaryPostfix && p.expression === node ))
+ {
+ node = p;
+ p = a[--i];
+ } else {
+ return false;
+ }
+ }
+ };
+
+ // self should be AST_New. decide if we want to show parens or not.
+ function no_constructor_parens(self, output) {
+ return self.args.length == 0 && !output.option("beautify");
+ };
+
+ function best_of(a) {
+ var best = a[0], len = best.length;
+ for (var i = 1; i < a.length; ++i) {
+ if (a[i].length < len) {
+ best = a[i];
+ len = best.length;
+ }
+ }
+ return best;
+ };
+
+ function make_num(num) {
+ var str = num.toString(10), a = [ str.replace(/^0\./, ".").replace('e+', 'e') ], m;
+ if (Math.floor(num) === num) {
+ if (num >= 0) {
+ a.push("0x" + num.toString(16).toLowerCase(), // probably pointless
+ "0" + num.toString(8)); // same.
+ } else {
+ a.push("-0x" + (-num).toString(16).toLowerCase(), // probably pointless
+ "-0" + (-num).toString(8)); // same.
+ }
+ if ((m = /^(.*?)(0+)$/.exec(num))) {
+ a.push(m[1] + "e" + m[2].length);
+ }
+ } else if ((m = /^0?\.(0+)(.*)$/.exec(num))) {
+ a.push(m[2] + "e-" + (m[1].length + m[2].length),
+ str.substr(str.indexOf(".")));
+ }
+ return best_of(a);
+ };
+
+ function make_block(stmt, output) {
+ if (stmt instanceof AST_BlockStatement) {
+ stmt.print(output);
+ return;
+ }
+ output.with_block(function(){
+ output.indent();
+ stmt.print(output);
+ output.newline();
+ });
+ };
+
+ /* -----[ source map generators ]----- */
+
+ function DEFMAP(nodetype, generator) {
+ nodetype.DEFMETHOD("add_source_map", function(stream){
+ generator(this, stream);
+ });
+ };
+
+ // We could easily add info for ALL nodes, but it seems to me that
+ // would be quite wasteful, hence this noop in the base class.
+ DEFMAP(AST_Node, noop);
+
+ function basic_sourcemap_gen(self, output) {
+ output.add_mapping(self.start);
+ };
+
+ // XXX: I'm not exactly sure if we need it for all of these nodes,
+ // or if we should add even more.
+
+ DEFMAP(AST_Directive, basic_sourcemap_gen);
+ DEFMAP(AST_Debugger, basic_sourcemap_gen);
+ DEFMAP(AST_Symbol, basic_sourcemap_gen);
+ DEFMAP(AST_Jump, basic_sourcemap_gen);
+ DEFMAP(AST_StatementWithBody, basic_sourcemap_gen);
+ DEFMAP(AST_LabeledStatement, noop); // since the label symbol will mark it
+ DEFMAP(AST_Lambda, basic_sourcemap_gen);
+ DEFMAP(AST_Switch, basic_sourcemap_gen);
+ DEFMAP(AST_SwitchBranch, basic_sourcemap_gen);
+ DEFMAP(AST_BlockStatement, basic_sourcemap_gen);
+ DEFMAP(AST_Toplevel, noop);
+ DEFMAP(AST_New, basic_sourcemap_gen);
+ DEFMAP(AST_Try, basic_sourcemap_gen);
+ DEFMAP(AST_Catch, basic_sourcemap_gen);
+ DEFMAP(AST_Finally, basic_sourcemap_gen);
+ DEFMAP(AST_Definitions, basic_sourcemap_gen);
+ DEFMAP(AST_Constant, basic_sourcemap_gen);
+ DEFMAP(AST_ObjectProperty, function(self, output){
+ output.add_mapping(self.start, self.key);
+ });
+
+})();
+
+/***********************************************************************
+
+ A JavaScript tokenizer / parser / beautifier / compressor.
+ https://github.com/mishoo/UglifyJS2
+
+ -------------------------------- (C) ---------------------------------
+
+ Author: Mihai Bazon
+ <mihai.bazon@gmail.com>
+ http://mihai.bazon.net/blog
+
+ Distributed under the BSD license:
+
+ Copyright 2012 (c) Mihai Bazon <mihai.bazon@gmail.com>
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ * Redistributions of source code must retain the above
+ copyright notice, this list of conditions and the following
+ disclaimer.
+
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials
+ provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+ THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+
+ ***********************************************************************/
+
+"use strict";
+
+function Compressor(options, false_by_default) {
+ if (!(this instanceof Compressor))
+ return new Compressor(options, false_by_default);
+ TreeTransformer.call(this, this.before, this.after);
+ this.options = defaults(options, {
+ sequences : !false_by_default,
+ properties : !false_by_default,
+ dead_code : !false_by_default,
+ drop_debugger : !false_by_default,
+ unsafe : false,
+ unsafe_comps : false,
+ conditionals : !false_by_default,
+ comparisons : !false_by_default,
+ evaluate : !false_by_default,
+ booleans : !false_by_default,
+ loops : !false_by_default,
+ unused : !false_by_default,
+ hoist_funs : !false_by_default,
+ keep_fargs : false,
+ hoist_vars : false,
+ if_return : !false_by_default,
+ join_vars : !false_by_default,
+ cascade : !false_by_default,
+ side_effects : !false_by_default,
+ pure_getters : false,
+ pure_funcs : null,
+ negate_iife : !false_by_default,
+ screw_ie8 : false,
+ drop_console : false,
+ angular : false,
+
+ warnings : true,
+ global_defs : {}
+ }, true);
+};
+
+Compressor.prototype = new TreeTransformer;
+merge(Compressor.prototype, {
+ option: function(key) { return this.options[key] },
+ warn: function() {
+ if (this.options.warnings)
+ AST_Node.warn.apply(AST_Node, arguments);
+ },
+ before: function(node, descend, in_list) {
+ if (node._squeezed) return node;
+ var was_scope = false;
+ if (node instanceof AST_Scope) {
+ node = node.hoist_declarations(this);
+ was_scope = true;
+ }
+ descend(node, this);
+ node = node.optimize(this);
+ if (was_scope && node instanceof AST_Scope) {
+ node.drop_unused(this);
+ descend(node, this);
+ }
+ node._squeezed = true;
+ return node;
+ }
+});
+
+(function(){
+
+ function OPT(node, optimizer) {
+ node.DEFMETHOD("optimize", function(compressor){
+ var self = this;
+ if (self._optimized) return self;
+ var opt = optimizer(self, compressor);
+ opt._optimized = true;
+ if (opt === self) return opt;
+ return opt.transform(compressor);
+ });
+ };
+
+ OPT(AST_Node, function(self, compressor){
+ return self;
+ });
+
+ AST_Node.DEFMETHOD("equivalent_to", function(node){
+ // XXX: this is a rather expensive way to test two node's equivalence:
+ return this.print_to_string() == node.print_to_string();
+ });
+
+ function make_node(ctor, orig, props) {
+ if (!props) props = {};
+ if (orig) {
+ if (!props.start) props.start = orig.start;
+ if (!props.end) props.end = orig.end;
+ }
+ return new ctor(props);
+ };
+
+ function make_node_from_constant(compressor, val, orig) {
+ // XXX: WIP.
+ // if (val instanceof AST_Node) return val.transform(new TreeTransformer(null, function(node){
+ // if (node instanceof AST_SymbolRef) {
+ // var scope = compressor.find_parent(AST_Scope);
+ // var def = scope.find_variable(node);
+ // node.thedef = def;
+ // return node;
+ // }
+ // })).transform(compressor);
+
+ if (val instanceof AST_Node) return val.transform(compressor);
+ switch (typeof val) {
+ case "string":
+ return make_node(AST_String, orig, {
+ value: val
+ }).optimize(compressor);
+ case "number":
+ return make_node(isNaN(val) ? AST_NaN : AST_Number, orig, {
+ value: val
+ }).optimize(compressor);
+ case "boolean":
+ return make_node(val ? AST_True : AST_False, orig).optimize(compressor);
+ case "undefined":
+ return make_node(AST_Undefined, orig).optimize(compressor);
+ default:
+ if (val === null) {
+ return make_node(AST_Null, orig).optimize(compressor);
+ }
+ if (val instanceof RegExp) {
+ return make_node(AST_RegExp, orig).optimize(compressor);
+ }
+ throw new Error(string_template("Can't handle constant of type: {type}", {
+ type: typeof val
+ }));
+ }
+ };
+
+ function as_statement_array(thing) {
+ if (thing === null) return [];
+ if (thing instanceof AST_BlockStatement) return thing.body;
+ if (thing instanceof AST_EmptyStatement) return [];
+ if (thing instanceof AST_Statement) return [ thing ];
+ throw new Error("Can't convert thing to statement array");
+ };
+
+ function is_empty(thing) {
+ if (thing === null) return true;
+ if (thing instanceof AST_EmptyStatement) return true;
+ if (thing instanceof AST_BlockStatement) return thing.body.length == 0;
+ return false;
+ };
+
+ function loop_body(x) {
+ if (x instanceof AST_Switch) return x;
+ if (x instanceof AST_For || x instanceof AST_ForIn || x instanceof AST_DWLoop) {
+ return (x.body instanceof AST_BlockStatement ? x.body : x);
+ }
+ return x;
+ };
+
+ function tighten_body(statements, compressor) {
+ var CHANGED;
+ do {
+ CHANGED = false;
+ if (compressor.option("angular")) {
+ statements = process_for_angular(statements);
+ }
+ statements = eliminate_spurious_blocks(statements);
+ if (compressor.option("dead_code")) {
+ statements = eliminate_dead_code(statements, compressor);
+ }
+ if (compressor.option("if_return")) {
+ statements = handle_if_return(statements, compressor);
+ }
+ if (compressor.option("sequences")) {
+ statements = sequencesize(statements, compressor);
+ }
+ if (compressor.option("join_vars")) {
+ statements = join_consecutive_vars(statements, compressor);
+ }
+ } while (CHANGED);
+
+ if (compressor.option("negate_iife")) {
+ negate_iifes(statements, compressor);
+ }
+
+ return statements;
+
+ function process_for_angular(statements) {
+ function make_injector(func, name) {
+ return make_node(AST_SimpleStatement, func, {
+ body: make_node(AST_Assign, func, {
+ operator: "=",
+ left: make_node(AST_Dot, name, {
+ expression: make_node(AST_SymbolRef, name, name),
+ property: "$inject"
+ }),
+ right: make_node(AST_Array, func, {
+ elements: func.argnames.map(function(sym){
+ return make_node(AST_String, sym, { value: sym.name });
+ })
+ })
+ })
+ });
+ }
+ return statements.reduce(function(a, stat){
+ a.push(stat);
+ var token = stat.start;
+ var comments = token.comments_before;
+ if (comments && comments.length > 0) {
+ var last = comments.pop();
+ if (/@ngInject/.test(last.value)) {
+ // case 1: defun
+ if (stat instanceof AST_Defun) {
+ a.push(make_injector(stat, stat.name));
+ }
+ else if (stat instanceof AST_Definitions) {
+ stat.definitions.forEach(function(def){
+ if (def.value && def.value instanceof AST_Lambda) {
+ a.push(make_injector(def.value, def.name));
+ }
+ });
+ }
+ else {
+ compressor.warn("Unknown statement marked with @ngInject [{file}:{line},{col}]", token);
+ }
+ }
+ }
+ return a;
+ }, []);
+ }
+
+ function eliminate_spurious_blocks(statements) {
+ var seen_dirs = [];
+ return statements.reduce(function(a, stat){
+ if (stat instanceof AST_BlockStatement) {
+ CHANGED = true;
+ a.push.apply(a, eliminate_spurious_blocks(stat.body));
+ } else if (stat instanceof AST_EmptyStatement) {
+ CHANGED = true;
+ } else if (stat instanceof AST_Directive) {
+ if (seen_dirs.indexOf(stat.value) < 0) {
+ a.push(stat);
+ seen_dirs.push(stat.value);
+ } else {
+ CHANGED = true;
+ }
+ } else {
+ a.push(stat);
+ }
+ return a;
+ }, []);
+ };
+
+ function handle_if_return(statements, compressor) {
+ var self = compressor.self();
+ var in_lambda = self instanceof AST_Lambda;
+ var ret = [];
+ loop: for (var i = statements.length; --i >= 0;) {
+ var stat = statements[i];
+ switch (true) {
+ case (in_lambda && stat instanceof AST_Return && !stat.value && ret.length == 0):
+ CHANGED = true;
+ // note, ret.length is probably always zero
+ // because we drop unreachable code before this
+ // step. nevertheless, it's good to check.
+ continue loop;
+ case stat instanceof AST_If:
+ if (stat.body instanceof AST_Return) {
+ //---
+ // pretty silly case, but:
+ // if (foo()) return; return; ==> foo(); return;
+ if (((in_lambda && ret.length == 0)
+ || (ret[0] instanceof AST_Return && !ret[0].value))
+ && !stat.body.value && !stat.alternative) {
+ CHANGED = true;
+ var cond = make_node(AST_SimpleStatement, stat.condition, {
+ body: stat.condition
+ });
+ ret.unshift(cond);
+ continue loop;
+ }
+ //---
+ // if (foo()) return x; return y; ==> return foo() ? x : y;
+ if (ret[0] instanceof AST_Return && stat.body.value && ret[0].value && !stat.alternative) {
+ CHANGED = true;
+ stat = stat.clone();
+ stat.alternative = ret[0];
+ ret[0] = stat.transform(compressor);
+ continue loop;
+ }
+ //---
+ // if (foo()) return x; [ return ; ] ==> return foo() ? x : undefined;
+ if ((ret.length == 0 || ret[0] instanceof AST_Return) && stat.body.value && !stat.alternative && in_lambda) {
+ CHANGED = true;
+ stat = stat.clone();
+ stat.alternative = ret[0] || make_node(AST_Return, stat, {
+ value: make_node(AST_Undefined, stat)
+ });
+ ret[0] = stat.transform(compressor);
+ continue loop;
+ }
+ //---
+ // if (foo()) return; [ else x... ]; y... ==> if (!foo()) { x...; y... }
+ if (!stat.body.value && in_lambda) {
+ CHANGED = true;
+ stat = stat.clone();
+ stat.condition = stat.condition.negate(compressor);
+ stat.body = make_node(AST_BlockStatement, stat, {
+ body: as_statement_array(stat.alternative).concat(ret)
+ });
+ stat.alternative = null;
+ ret = [ stat.transform(compressor) ];
+ continue loop;
+ }
+ //---
+ if (ret.length == 1 && in_lambda && ret[0] instanceof AST_SimpleStatement
+ && (!stat.alternative || stat.alternative instanceof AST_SimpleStatement)) {
+ CHANGED = true;
+ ret.push(make_node(AST_Return, ret[0], {
+ value: make_node(AST_Undefined, ret[0])
+ }).transform(compressor));
+ ret = as_statement_array(stat.alternative).concat(ret);
+ ret.unshift(stat);
+ continue loop;
+ }
+ }
+
+ var ab = aborts(stat.body);
+ var lct = ab instanceof AST_LoopControl ? compressor.loopcontrol_target(ab.label) : null;
+ if (ab && ((ab instanceof AST_Return && !ab.value && in_lambda)
+ || (ab instanceof AST_Continue && self === loop_body(lct))
+ || (ab instanceof AST_Break && lct instanceof AST_BlockStatement && self === lct))) {
+ if (ab.label) {
+ remove(ab.label.thedef.references, ab);
+ }
+ CHANGED = true;
+ var body = as_statement_array(stat.body).slice(0, -1);
+ stat = stat.clone();
+ stat.condition = stat.condition.negate(compressor);
+ stat.body = make_node(AST_BlockStatement, stat, {
+ body: as_statement_array(stat.alternative).concat(ret)
+ });
+ stat.alternative = make_node(AST_BlockStatement, stat, {
+ body: body
+ });
+ ret = [ stat.transform(compressor) ];
+ continue loop;
+ }
+
+ var ab = aborts(stat.alternative);
+ var lct = ab instanceof AST_LoopControl ? compressor.loopcontrol_target(ab.label) : null;
+ if (ab && ((ab instanceof AST_Return && !ab.value && in_lambda)
+ || (ab instanceof AST_Continue && self === loop_body(lct))
+ || (ab instanceof AST_Break && lct instanceof AST_BlockStatement && self === lct))) {
+ if (ab.label) {
+ remove(ab.label.thedef.references, ab);
+ }
+ CHANGED = true;
+ stat = stat.clone();
+ stat.body = make_node(AST_BlockStatement, stat.body, {
+ body: as_statement_array(stat.body).concat(ret)
+ });
+ stat.alternative = make_node(AST_BlockStatement, stat.alternative, {
+ body: as_statement_array(stat.alternative).slice(0, -1)
+ });
+ ret = [ stat.transform(compressor) ];
+ continue loop;
+ }
+
+ ret.unshift(stat);
+ break;
+ default:
+ ret.unshift(stat);
+ break;
+ }
+ }
+ return ret;
+ };
+
+ function eliminate_dead_code(statements, compressor) {
+ var has_quit = false;
+ var orig = statements.length;
+ var self = compressor.self();
+ statements = statements.reduce(function(a, stat){
+ if (has_quit) {
+ extract_declarations_from_unreachable_code(compressor, stat, a);
+ } else {
+ if (stat instanceof AST_LoopControl) {
+ var lct = compressor.loopcontrol_target(stat.label);
+ if ((stat instanceof AST_Break
+ && lct instanceof AST_BlockStatement
+ && loop_body(lct) === self) || (stat instanceof AST_Continue
+ && loop_body(lct) === self)) {
+ if (stat.label) {
+ remove(stat.label.thedef.references, stat);
+ }
+ } else {
+ a.push(stat);
+ }
+ } else {
+ a.push(stat);
+ }
+ if (aborts(stat)) has_quit = true;
+ }
+ return a;
+ }, []);
+ CHANGED = statements.length != orig;
+ return statements;
+ };
+
+ function sequencesize(statements, compressor) {
+ if (statements.length < 2) return statements;
+ var seq = [], ret = [];
+ function push_seq() {
+ seq = AST_Seq.from_array(seq);
+ if (seq) ret.push(make_node(AST_SimpleStatement, seq, {
+ body: seq
+ }));
+ seq = [];
+ };
+ statements.forEach(function(stat){
+ if (stat instanceof AST_SimpleStatement) seq.push(stat.body);
+ else push_seq(), ret.push(stat);
+ });
+ push_seq();
+ ret = sequencesize_2(ret, compressor);
+ CHANGED = ret.length != statements.length;
+ return ret;
+ };
+
+ function sequencesize_2(statements, compressor) {
+ function cons_seq(right) {
+ ret.pop();
+ var left = prev.body;
+ if (left instanceof AST_Seq) {
+ left.add(right);
+ } else {
+ left = AST_Seq.cons(left, right);
+ }
+ return left.transform(compressor);
+ };
+ var ret = [], prev = null;
+ statements.forEach(function(stat){
+ if (prev) {
+ if (stat instanceof AST_For) {
+ var opera = {};
+ try {
+ prev.body.walk(new TreeWalker(function(node){
+ if (node instanceof AST_Binary && node.operator == "in")
+ throw opera;
+ }));
+ if (stat.init && !(stat.init instanceof AST_Definitions)) {
+ stat.init = cons_seq(stat.init);
+ }
+ else if (!stat.init) {
+ stat.init = prev.body;
+ ret.pop();
+ }
+ } catch(ex) {
+ if (ex !== opera) throw ex;
+ }
+ }
+ else if (stat instanceof AST_If) {
+ stat.condition = cons_seq(stat.condition);
+ }
+ else if (stat instanceof AST_With) {
+ stat.expression = cons_seq(stat.expression);
+ }
+ else if (stat instanceof AST_Exit && stat.value) {
+ stat.value = cons_seq(stat.value);
+ }
+ else if (stat instanceof AST_Exit) {
+ stat.value = cons_seq(make_node(AST_Undefined, stat));
+ }
+ else if (stat instanceof AST_Switch) {
+ stat.expression = cons_seq(stat.expression);
+ }
+ }
+ ret.push(stat);
+ prev = stat instanceof AST_SimpleStatement ? stat : null;
+ });
+ return ret;
+ };
+
+ function join_consecutive_vars(statements, compressor) {
+ var prev = null;
+ return statements.reduce(function(a, stat){
+ if (stat instanceof AST_Definitions && prev && prev.TYPE == stat.TYPE) {
+ prev.definitions = prev.definitions.concat(stat.definitions);
+ CHANGED = true;
+ }
+ else if (stat instanceof AST_For
+ && prev instanceof AST_Definitions
+ && (!stat.init || stat.init.TYPE == prev.TYPE)) {
+ CHANGED = true;
+ a.pop();
+ if (stat.init) {
+ stat.init.definitions = prev.definitions.concat(stat.init.definitions);
+ } else {
+ stat.init = prev;
+ }
+ a.push(stat);
+ prev = stat;
+ }
+ else {
+ prev = stat;
+ a.push(stat);
+ }
+ return a;
+ }, []);
+ };
+
+ function negate_iifes(statements, compressor) {
+ statements.forEach(function(stat){
+ if (stat instanceof AST_SimpleStatement) {
+ stat.body = (function transform(thing) {
+ return thing.transform(new TreeTransformer(function(node){
+ if (node instanceof AST_Call && node.expression instanceof AST_Function) {
+ return make_node(AST_UnaryPrefix, node, {
+ operator: "!",
+ expression: node
+ });
+ }
+ else if (node instanceof AST_Call) {
+ node.expression = transform(node.expression);
+ }
+ else if (node instanceof AST_Seq) {
+ node.car = transform(node.car);
+ }
+ else if (node instanceof AST_Conditional) {
+ var expr = transform(node.condition);
+ if (expr !== node.condition) {
+ // it has been negated, reverse
+ node.condition = expr;
+ var tmp = node.consequent;
+ node.consequent = node.alternative;
+ node.alternative = tmp;
+ }
+ }
+ return node;
+ }));
+ })(stat.body);
+ }
+ });
+ };
+
+ };
+
+ function extract_declarations_from_unreachable_code(compressor, stat, target) {
+ compressor.warn("Dropping unreachable code [{file}:{line},{col}]", stat.start);
+ stat.walk(new TreeWalker(function(node){
+ if (node instanceof AST_Definitions) {
+ compressor.warn("Declarations in unreachable code! [{file}:{line},{col}]", node.start);
+ node.remove_initializers();
+ target.push(node);
+ return true;
+ }
+ if (node instanceof AST_Defun) {
+ target.push(node);
+ return true;
+ }
+ if (node instanceof AST_Scope) {
+ return true;
+ }
+ }));
+ };
+
+ /* -----[ boolean/negation helpers ]----- */
+
+ // methods to determine whether an expression has a boolean result type
+ (function (def){
+ var unary_bool = [ "!", "delete" ];
+ var binary_bool = [ "in", "instanceof", "==", "!=", "===", "!==", "<", "<=", ">=", ">" ];
+ def(AST_Node, function(){ return false });
+ def(AST_UnaryPrefix, function(){
+ return member(this.operator, unary_bool);
+ });
+ def(AST_Binary, function(){
+ return member(this.operator, binary_bool) ||
+ ( (this.operator == "&&" || this.operator == "||") &&
+ this.left.is_boolean() && this.right.is_boolean() );
+ });
+ def(AST_Conditional, function(){
+ return this.consequent.is_boolean() && this.alternative.is_boolean();
+ });
+ def(AST_Assign, function(){
+ return this.operator == "=" && this.right.is_boolean();
+ });
+ def(AST_Seq, function(){
+ return this.cdr.is_boolean();
+ });
+ def(AST_True, function(){ return true });
+ def(AST_False, function(){ return true });
+ })(function(node, func){
+ node.DEFMETHOD("is_boolean", func);
+ });
+
+ // methods to determine if an expression has a string result type
+ (function (def){
+ def(AST_Node, function(){ return false });
+ def(AST_String, function(){ return true });
+ def(AST_UnaryPrefix, function(){
+ return this.operator == "typeof";
+ });
+ def(AST_Binary, function(compressor){
+ return this.operator == "+" &&
+ (this.left.is_string(compressor) || this.right.is_string(compressor));
+ });
+ def(AST_Assign, function(compressor){
+ return (this.operator == "=" || this.operator == "+=") && this.right.is_string(compressor);
+ });
+ def(AST_Seq, function(compressor){
+ return this.cdr.is_string(compressor);
+ });
+ def(AST_Conditional, function(compressor){
+ return this.consequent.is_string(compressor) && this.alternative.is_string(compressor);
+ });
+ def(AST_Call, function(compressor){
+ return compressor.option("unsafe")
+ && this.expression instanceof AST_SymbolRef
+ && this.expression.name == "String"
+ && this.expression.undeclared();
+ });
+ })(function(node, func){
+ node.DEFMETHOD("is_string", func);
+ });
+
+ function best_of(ast1, ast2) {
+ return ast1.print_to_string().length >
+ ast2.print_to_string().length
+ ? ast2 : ast1;
+ };
+
+ // methods to evaluate a constant expression
+ (function (def){
+ // The evaluate method returns an array with one or two
+ // elements. If the node has been successfully reduced to a
+ // constant, then the second element tells us the value;
+ // otherwise the second element is missing. The first element
+ // of the array is always an AST_Node descendant; if
+ // evaluation was successful it's a node that represents the
+ // constant; otherwise it's the original or a replacement node.
+ AST_Node.DEFMETHOD("evaluate", function(compressor){
+ if (!compressor.option("evaluate")) return [ this ];
+ try {
+ var val = this._eval(compressor);
+ return [ best_of(make_node_from_constant(compressor, val, this), this), val ];
+ } catch(ex) {
+ if (ex !== def) throw ex;
+ return [ this ];
+ }
+ });
+ def(AST_Statement, function(){
+ throw new Error(string_template("Cannot evaluate a statement [{file}:{line},{col}]", this.start));
+ });
+ def(AST_Function, function(){
+ // XXX: AST_Function inherits from AST_Scope, which itself
+ // inherits from AST_Statement; however, an AST_Function
+ // isn't really a statement. This could byte in other
+ // places too. :-( Wish JS had multiple inheritance.
+ throw def;
+ });
+ function ev(node, compressor) {
+ if (!compressor) throw new Error("Compressor must be passed");
+
+ return node._eval(compressor);
+ };
+ def(AST_Node, function(){
+ throw def; // not constant
+ });
+ def(AST_Constant, function(){
+ return this.getValue();
+ });
+ def(AST_UnaryPrefix, function(compressor){
+ var e = this.expression;
+ switch (this.operator) {
+ case "!": return !ev(e, compressor);
+ case "typeof":
+ // Function would be evaluated to an array and so typeof would
+ // incorrectly return 'object'. Hence making is a special case.
+ if (e instanceof AST_Function) return typeof function(){};
+
+ e = ev(e, compressor);
+
+ // typeof <RegExp> returns "object" or "function" on different platforms
+ // so cannot evaluate reliably
+ if (e instanceof RegExp) throw def;
+
+ return typeof e;
+ case "void": return void ev(e, compressor);
+ case "~": return ~ev(e, compressor);
+ case "-":
+ e = ev(e, compressor);
+ if (e === 0) throw def;
+ return -e;
+ case "+": return +ev(e, compressor);
+ }
+ throw def;
+ });
+ def(AST_Binary, function(c){
+ var left = this.left, right = this.right;
+ switch (this.operator) {
+ case "&&" : return ev(left, c) && ev(right, c);
+ case "||" : return ev(left, c) || ev(right, c);
+ case "|" : return ev(left, c) | ev(right, c);
+ case "&" : return ev(left, c) & ev(right, c);
+ case "^" : return ev(left, c) ^ ev(right, c);
+ case "+" : return ev(left, c) + ev(right, c);
+ case "*" : return ev(left, c) * ev(right, c);
+ case "/" : return ev(left, c) / ev(right, c);
+ case "%" : return ev(left, c) % ev(right, c);
+ case "-" : return ev(left, c) - ev(right, c);
+ case "<<" : return ev(left, c) << ev(right, c);
+ case ">>" : return ev(left, c) >> ev(right, c);
+ case ">>>" : return ev(left, c) >>> ev(right, c);
+ case "==" : return ev(left, c) == ev(right, c);
+ case "===" : return ev(left, c) === ev(right, c);
+ case "!=" : return ev(left, c) != ev(right, c);
+ case "!==" : return ev(left, c) !== ev(right, c);
+ case "<" : return ev(left, c) < ev(right, c);
+ case "<=" : return ev(left, c) <= ev(right, c);
+ case ">" : return ev(left, c) > ev(right, c);
+ case ">=" : return ev(left, c) >= ev(right, c);
+ case "in" : return ev(left, c) in ev(right, c);
+ case "instanceof" : return ev(left, c) instanceof ev(right, c);
+ }
+ throw def;
+ });
+ def(AST_Conditional, function(compressor){
+ return ev(this.condition, compressor)
+ ? ev(this.consequent, compressor)
+ : ev(this.alternative, compressor);
+ });
+ def(AST_SymbolRef, function(compressor){
+ var d = this.definition();
+ if (d && d.constant && d.init) return ev(d.init, compressor);
+ throw def;
+ });
+ def(AST_Dot, function(compressor){
+ if (compressor.option("unsafe") && this.property == "length") {
+ var str = ev(this.expression, compressor);
+ if (typeof str == "string")
+ return str.length;
+ }
+ throw def;
+ });
+ })(function(node, func){
+ node.DEFMETHOD("_eval", func);
+ });
+
+ // method to negate an expression
+ (function(def){
+ function basic_negation(exp) {
+ return make_node(AST_UnaryPrefix, exp, {
+ operator: "!",
+ expression: exp
+ });
+ };
+ def(AST_Node, function(){
+ return basic_negation(this);
+ });
+ def(AST_Statement, function(){
+ throw new Error("Cannot negate a statement");
+ });
+ def(AST_Function, function(){
+ return basic_negation(this);
+ });
+ def(AST_UnaryPrefix, function(){
+ if (this.operator == "!")
+ return this.expression;
+ return basic_negation(this);
+ });
+ def(AST_Seq, function(compressor){
+ var self = this.clone();
+ self.cdr = self.cdr.negate(compressor);
+ return self;
+ });
+ def(AST_Conditional, function(compressor){
+ var self = this.clone();
+ self.consequent = self.consequent.negate(compressor);
+ self.alternative = self.alternative.negate(compressor);
+ return best_of(basic_negation(this), self);
+ });
+ def(AST_Binary, function(compressor){
+ var self = this.clone(), op = this.operator;
+ if (compressor.option("unsafe_comps")) {
+ switch (op) {
+ case "<=" : self.operator = ">" ; return self;
+ case "<" : self.operator = ">=" ; return self;
+ case ">=" : self.operator = "<" ; return self;
+ case ">" : self.operator = "<=" ; return self;
+ }
+ }
+ switch (op) {
+ case "==" : self.operator = "!="; return self;
+ case "!=" : self.operator = "=="; return self;
+ case "===": self.operator = "!=="; return self;
+ case "!==": self.operator = "==="; return self;
+ case "&&":
+ self.operator = "||";
+ self.left = self.left.negate(compressor);
+ self.right = self.right.negate(compressor);
+ return best_of(basic_negation(this), self);
+ case "||":
+ self.operator = "&&";
+ self.left = self.left.negate(compressor);
+ self.right = self.right.negate(compressor);
+ return best_of(basic_negation(this), self);
+ }
+ return basic_negation(this);
+ });
+ })(function(node, func){
+ node.DEFMETHOD("negate", function(compressor){
+ return func.call(this, compressor);
+ });
+ });
+
+ // determine if expression has side effects
+ (function(def){
+ def(AST_Node, function(compressor){ return true });
+
+ def(AST_EmptyStatement, function(compressor){ return false });
+ def(AST_Constant, function(compressor){ return false });
+ def(AST_This, function(compressor){ return false });
+
+ def(AST_Call, function(compressor){
+ var pure = compressor.option("pure_funcs");
+ if (!pure) return true;
+ return pure.indexOf(this.expression.print_to_string()) < 0;
+ });
+
+ def(AST_Block, function(compressor){
+ for (var i = this.body.length; --i >= 0;) {
+ if (this.body[i].has_side_effects(compressor))
+ return true;
+ }
+ return false;
+ });
+
+ def(AST_SimpleStatement, function(compressor){
+ return this.body.has_side_effects(compressor);
+ });
+ def(AST_Defun, function(compressor){ return true });
+ def(AST_Function, function(compressor){ return false });
+ def(AST_Binary, function(compressor){
+ return this.left.has_side_effects(compressor)
+ || this.right.has_side_effects(compressor);
+ });
+ def(AST_Assign, function(compressor){ return true });
+ def(AST_Conditional, function(compressor){
+ return this.condition.has_side_effects(compressor)
+ || this.consequent.has_side_effects(compressor)
+ || this.alternative.has_side_effects(compressor);
+ });
+ def(AST_Unary, function(compressor){
+ return this.operator == "delete"
+ || this.operator == "++"
+ || this.operator == "--"
+ || this.expression.has_side_effects(compressor);
+ });
+ def(AST_SymbolRef, function(compressor){
+ return this.global() && this.undeclared();
+ });
+ def(AST_Object, function(compressor){
+ for (var i = this.properties.length; --i >= 0;)
+ if (this.properties[i].has_side_effects(compressor))
+ return true;
+ return false;
+ });
+ def(AST_ObjectProperty, function(compressor){
+ return this.value.has_side_effects(compressor);
+ });
+ def(AST_Array, function(compressor){
+ for (var i = this.elements.length; --i >= 0;)
+ if (this.elements[i].has_side_effects(compressor))
+ return true;
+ return false;
+ });
+ def(AST_Dot, function(compressor){
+ if (!compressor.option("pure_getters")) return true;
+ return this.expression.has_side_effects(compressor);
+ });
+ def(AST_Sub, function(compressor){
+ if (!compressor.option("pure_getters")) return true;
+ return this.expression.has_side_effects(compressor)
+ || this.property.has_side_effects(compressor);
+ });
+ def(AST_PropAccess, function(compressor){
+ return !compressor.option("pure_getters");
+ });
+ def(AST_Seq, function(compressor){
+ return this.car.has_side_effects(compressor)
+ || this.cdr.has_side_effects(compressor);
+ });
+ })(function(node, func){
+ node.DEFMETHOD("has_side_effects", func);
+ });
+
+ // tell me if a statement aborts
+ function aborts(thing) {
+ return thing && thing.aborts();
+ };
+ (function(def){
+ def(AST_Statement, function(){ return null });
+ def(AST_Jump, function(){ return this });
+ function block_aborts(){
+ var n = this.body.length;
+ return n > 0 && aborts(this.body[n - 1]);
+ };
+ def(AST_BlockStatement, block_aborts);
+ def(AST_SwitchBranch, block_aborts);
+ def(AST_If, function(){
+ return this.alternative && aborts(this.body) && aborts(this.alternative);
+ });
+ })(function(node, func){
+ node.DEFMETHOD("aborts", func);
+ });
+
+ /* -----[ optimizers ]----- */
+
+ OPT(AST_Directive, function(self, compressor){
+ if (self.scope.has_directive(self.value) !== self.scope) {
+ return make_node(AST_EmptyStatement, self);
+ }
+ return self;
+ });
+
+ OPT(AST_Debugger, function(self, compressor){
+ if (compressor.option("drop_debugger"))
+ return make_node(AST_EmptyStatement, self);
+ return self;
+ });
+
+ OPT(AST_LabeledStatement, function(self, compressor){
+ if (self.body instanceof AST_Break
+ && compressor.loopcontrol_target(self.body.label) === self.body) {
+ return make_node(AST_EmptyStatement, self);
+ }
+ return self.label.references.length == 0 ? self.body : self;
+ });
+
+ OPT(AST_Block, function(self, compressor){
+ self.body = tighten_body(self.body, compressor);
+ return self;
+ });
+
+ OPT(AST_BlockStatement, function(self, compressor){
+ self.body = tighten_body(self.body, compressor);
+ switch (self.body.length) {
+ case 1: return self.body[0];
+ case 0: return make_node(AST_EmptyStatement, self);
+ }
+ return self;
+ });
+
+ AST_Scope.DEFMETHOD("drop_unused", function(compressor){
+ var self = this;
+ if (compressor.option("unused")
+ && !(self instanceof AST_Toplevel)
+ && !self.uses_eval
+ ) {
+ var in_use = [];
+ var initializations = new Dictionary();
+ // pass 1: find out which symbols are directly used in
+ // this scope (not in nested scopes).
+ var scope = this;
+ var tw = new TreeWalker(function(node, descend){
+ if (node !== self) {
+ if (node instanceof AST_Defun) {
+ initializations.add(node.name.name, node);
+ return true; // don't go in nested scopes
+ }
+ if (node instanceof AST_Definitions && scope === self) {
+ node.definitions.forEach(function(def){
+ if (def.value) {
+ initializations.add(def.name.name, def.value);
+ if (def.value.has_side_effects(compressor)) {
+ def.value.walk(tw);
+ }
+ }
+ });
+ return true;
+ }
+ if (node instanceof AST_SymbolRef) {
+ push_uniq(in_use, node.definition());
+ return true;
+ }
+ if (node instanceof AST_Scope) {
+ var save_scope = scope;
+ scope = node;
+ descend();
+ scope = save_scope;
+ return true;
+ }
+ }
+ });
+ self.walk(tw);
+ // pass 2: for every used symbol we need to walk its
+ // initialization code to figure out if it uses other
+ // symbols (that may not be in_use).
+ for (var i = 0; i < in_use.length; ++i) {
+ in_use[i].orig.forEach(function(decl){
+ // undeclared globals will be instanceof AST_SymbolRef
+ var init = initializations.get(decl.name);
+ if (init) init.forEach(function(init){
+ var tw = new TreeWalker(function(node){
+ if (node instanceof AST_SymbolRef) {
+ push_uniq(in_use, node.definition());
+ }
+ });
+ init.walk(tw);
+ });
+ });
+ }
+ // pass 3: we should drop declarations not in_use
+ var tt = new TreeTransformer(
+ function before(node, descend, in_list) {
+ if (node instanceof AST_Lambda && !(node instanceof AST_Accessor)) {
+ if (!compressor.option("keep_fargs")) {
+ for (var a = node.argnames, i = a.length; --i >= 0;) {
+ var sym = a[i];
+ if (sym.unreferenced()) {
+ a.pop();
+ compressor.warn("Dropping unused function argument {name} [{file}:{line},{col}]", {
+ name : sym.name,
+ file : sym.start.file,
+ line : sym.start.line,
+ col : sym.start.col
+ });
+ }
+ else break;
+ }
+ }
+ }
+ if (node instanceof AST_Defun && node !== self) {
+ if (!member(node.name.definition(), in_use)) {
+ compressor.warn("Dropping unused function {name} [{file}:{line},{col}]", {
+ name : node.name.name,
+ file : node.name.start.file,
+ line : node.name.start.line,
+ col : node.name.start.col
+ });
+ return make_node(AST_EmptyStatement, node);
+ }
+ return node;
+ }
+ if (node instanceof AST_Definitions && !(tt.parent() instanceof AST_ForIn)) {
+ var def = node.definitions.filter(function(def){
+ if (member(def.name.definition(), in_use)) return true;
+ var w = {
+ name : def.name.name,
+ file : def.name.start.file,
+ line : def.name.start.line,
+ col : def.name.start.col
+ };
+ if (def.value && def.value.has_side_effects(compressor)) {
+ def._unused_side_effects = true;
+ compressor.warn("Side effects in initialization of unused variable {name} [{file}:{line},{col}]", w);
+ return true;
+ }
+ compressor.warn("Dropping unused variable {name} [{file}:{line},{col}]", w);
+ return false;
+ });
+ // place uninitialized names at the start
+ def = mergeSort(def, function(a, b){
+ if (!a.value && b.value) return -1;
+ if (!b.value && a.value) return 1;
+ return 0;
+ });
+ // for unused names whose initialization has
+ // side effects, we can cascade the init. code
+ // into the next one, or next statement.
+ var side_effects = [];
+ for (var i = 0; i < def.length;) {
+ var x = def[i];
+ if (x._unused_side_effects) {
+ side_effects.push(x.value);
+ def.splice(i, 1);
+ } else {
+ if (side_effects.length > 0) {
+ side_effects.push(x.value);
+ x.value = AST_Seq.from_array(side_effects);
+ side_effects = [];
+ }
+ ++i;
+ }
+ }
+ if (side_effects.length > 0) {
+ side_effects = make_node(AST_BlockStatement, node, {
+ body: [ make_node(AST_SimpleStatement, node, {
+ body: AST_Seq.from_array(side_effects)
+ }) ]
+ });
+ } else {
+ side_effects = null;
+ }
+ if (def.length == 0 && !side_effects) {
+ return make_node(AST_EmptyStatement, node);
+ }
+ if (def.length == 0) {
+ return side_effects;
+ }
+ node.definitions = def;
+ if (side_effects) {
+ side_effects.body.unshift(node);
+ node = side_effects;
+ }
+ return node;
+ }
+ if (node instanceof AST_For) {
+ descend(node, this);
+
+ if (node.init instanceof AST_BlockStatement) {
+ // certain combination of unused name + side effect leads to:
+ // https://github.com/mishoo/UglifyJS2/issues/44
+ // that's an invalid AST.
+ // We fix it at this stage by moving the `var` outside the `for`.
+
+ var body = node.init.body.slice(0, -1);
+ node.init = node.init.body.slice(-1)[0].body;
+ body.push(node);
+
+ return in_list ? MAP.splice(body) : make_node(AST_BlockStatement, node, {
+ body: body
+ });
+ }
+ }
+ if (node instanceof AST_Scope && node !== self)
+ return node;
+ }
+ );
+ self.transform(tt);
+ }
+ });
+
+ AST_Scope.DEFMETHOD("hoist_declarations", function(compressor){
+ var hoist_funs = compressor.option("hoist_funs");
+ var hoist_vars = compressor.option("hoist_vars");
+ var self = this;
+ if (hoist_funs || hoist_vars) {
+ var dirs = [];
+ var hoisted = [];
+ var vars = new Dictionary(), vars_found = 0, var_decl = 0;
+ // let's count var_decl first, we seem to waste a lot of
+ // space if we hoist `var` when there's only one.
+ self.walk(new TreeWalker(function(node){
+ if (node instanceof AST_Scope && node !== self)
+ return true;
+ if (node instanceof AST_Var) {
+ ++var_decl;
+ return true;
+ }
+ }));
+ hoist_vars = hoist_vars && var_decl > 1;
+ var tt = new TreeTransformer(
+ function before(node) {
+ if (node !== self) {
+ if (node instanceof AST_Directive) {
+ dirs.push(node);
+ return make_node(AST_EmptyStatement, node);
+ }
+ if (node instanceof AST_Defun && hoist_funs) {
+ hoisted.push(node);
+ return make_node(AST_EmptyStatement, node);
+ }
+ if (node instanceof AST_Var && hoist_vars) {
+ node.definitions.forEach(function(def){
+ vars.set(def.name.name, def);
+ ++vars_found;
+ });
+ var seq = node.to_assignments();
+ var p = tt.parent();
+ if (p instanceof AST_ForIn && p.init === node) {
+ if (seq == null) return node.definitions[0].name;
+ return seq;
+ }
+ if (p instanceof AST_For && p.init === node) {
+ return seq;
+ }
+ if (!seq) return make_node(AST_EmptyStatement, node);
+ return make_node(AST_SimpleStatement, node, {
+ body: seq
+ });
+ }
+ if (node instanceof AST_Scope)
+ return node; // to avoid descending in nested scopes
+ }
+ }
+ );
+ self = self.transform(tt);
+ if (vars_found > 0) {
+ // collect only vars which don't show up in self's arguments list
+ var defs = [];
+ vars.each(function(def, name){
+ if (self instanceof AST_Lambda
+ && find_if(function(x){ return x.name == def.name.name },
+ self.argnames)) {
+ vars.del(name);
+ } else {
+ def = def.clone();
+ def.value = null;
+ defs.push(def);
+ vars.set(name, def);
+ }
+ });
+ if (defs.length > 0) {
+ // try to merge in assignments
+ for (var i = 0; i < self.body.length;) {
+ if (self.body[i] instanceof AST_SimpleStatement) {
+ var expr = self.body[i].body, sym, assign;
+ if (expr instanceof AST_Assign
+ && expr.operator == "="
+ && (sym = expr.left) instanceof AST_Symbol
+ && vars.has(sym.name))
+ {
+ var def = vars.get(sym.name);
+ if (def.value) break;
+ def.value = expr.right;
+ remove(defs, def);
+ defs.push(def);
+ self.body.splice(i, 1);
+ continue;
+ }
+ if (expr instanceof AST_Seq
+ && (assign = expr.car) instanceof AST_Assign
+ && assign.operator == "="
+ && (sym = assign.left) instanceof AST_Symbol
+ && vars.has(sym.name))
+ {
+ var def = vars.get(sym.name);
+ if (def.value) break;
+ def.value = assign.right;
+ remove(defs, def);
+ defs.push(def);
+ self.body[i].body = expr.cdr;
+ continue;
+ }
+ }
+ if (self.body[i] instanceof AST_EmptyStatement) {
+ self.body.splice(i, 1);
+ continue;
+ }
+ if (self.body[i] instanceof AST_BlockStatement) {
+ var tmp = [ i, 1 ].concat(self.body[i].body);
+ self.body.splice.apply(self.body, tmp);
+ continue;
+ }
+ break;
+ }
+ defs = make_node(AST_Var, self, {
+ definitions: defs
+ });
+ hoisted.push(defs);
+ };
+ }
+ self.body = dirs.concat(hoisted, self.body);
+ }
+ return self;
+ });
+
+ OPT(AST_SimpleStatement, function(self, compressor){
+ if (compressor.option("side_effects")) {
+ if (!self.body.has_side_effects(compressor)) {
+ compressor.warn("Dropping side-effect-free statement [{file}:{line},{col}]", self.start);
+ return make_node(AST_EmptyStatement, self);
+ }
+ }
+ return self;
+ });
+
+ OPT(AST_DWLoop, function(self, compressor){
+ var cond = self.condition.evaluate(compressor);
+ self.condition = cond[0];
+ if (!compressor.option("loops")) return self;
+ if (cond.length > 1) {
+ if (cond[1]) {
+ return make_node(AST_For, self, {
+ body: self.body
+ });
+ } else if (self instanceof AST_While) {
+ if (compressor.option("dead_code")) {
+ var a = [];
+ extract_declarations_from_unreachable_code(compressor, self.body, a);
+ return make_node(AST_BlockStatement, self, { body: a });
+ }
+ }
+ }
+ return self;
+ });
+
+ function if_break_in_loop(self, compressor) {
+ function drop_it(rest) {
+ rest = as_statement_array(rest);
+ if (self.body instanceof AST_BlockStatement) {
+ self.body = self.body.clone();
+ self.body.body = rest.concat(self.body.body.slice(1));
+ self.body = self.body.transform(compressor);
+ } else {
+ self.body = make_node(AST_BlockStatement, self.body, {
+ body: rest
+ }).transform(compressor);
+ }
+ if_break_in_loop(self, compressor);
+ }
+ var first = self.body instanceof AST_BlockStatement ? self.body.body[0] : self.body;
+ if (first instanceof AST_If) {
+ if (first.body instanceof AST_Break
+ && compressor.loopcontrol_target(first.body.label) === self) {
+ if (self.condition) {
+ self.condition = make_node(AST_Binary, self.condition, {
+ left: self.condition,
+ operator: "&&",
+ right: first.condition.negate(compressor),
+ });
+ } else {
+ self.condition = first.condition.negate(compressor);
+ }
+ drop_it(first.alternative);
+ }
+ else if (first.alternative instanceof AST_Break
+ && compressor.loopcontrol_target(first.alternative.label) === self) {
+ if (self.condition) {
+ self.condition = make_node(AST_Binary, self.condition, {
+ left: self.condition,
+ operator: "&&",
+ right: first.condition,
+ });
+ } else {
+ self.condition = first.condition;
+ }
+ drop_it(first.body);
+ }
+ }
+ };
+
+ OPT(AST_While, function(self, compressor) {
+ if (!compressor.option("loops")) return self;
+ self = AST_DWLoop.prototype.optimize.call(self, compressor);
+ if (self instanceof AST_While) {
+ if_break_in_loop(self, compressor);
+ self = make_node(AST_For, self, self).transform(compressor);
+ }
+ return self;
+ });
+
+ OPT(AST_For, function(self, compressor){
+ var cond = self.condition;
+ if (cond) {
+ cond = cond.evaluate(compressor);
+ self.condition = cond[0];
+ }
+ if (!compressor.option("loops")) return self;
+ if (cond) {
+ if (cond.length > 1 && !cond[1]) {
+ if (compressor.option("dead_code")) {
+ var a = [];
+ if (self.init instanceof AST_Statement) {
+ a.push(self.init);
+ }
+ else if (self.init) {
+ a.push(make_node(AST_SimpleStatement, self.init, {
+ body: self.init
+ }));
+ }
+ extract_declarations_from_unreachable_code(compressor, self.body, a);
+ return make_node(AST_BlockStatement, self, { body: a });
+ }
+ }
+ }
+ if_break_in_loop(self, compressor);
+ return self;
+ });
+
+ OPT(AST_If, function(self, compressor){
+ if (!compressor.option("conditionals")) return self;
+ // if condition can be statically determined, warn and drop
+ // one of the blocks. note, statically determined implies
+ // “has no side effects”; also it doesn't work for cases like
+ // `x && true`, though it probably should.
+ var cond = self.condition.evaluate(compressor);
+ self.condition = cond[0];
+ if (cond.length > 1) {
+ if (cond[1]) {
+ compressor.warn("Condition always true [{file}:{line},{col}]", self.condition.start);
+ if (compressor.option("dead_code")) {
+ var a = [];
+ if (self.alternative) {
+ extract_declarations_from_unreachable_code(compressor, self.alternative, a);
+ }
+ a.push(self.body);
+ return make_node(AST_BlockStatement, self, { body: a }).transform(compressor);
+ }
+ } else {
+ compressor.warn("Condition always false [{file}:{line},{col}]", self.condition.start);
+ if (compressor.option("dead_code")) {
+ var a = [];
+ extract_declarations_from_unreachable_code(compressor, self.body, a);
+ if (self.alternative) a.push(self.alternative);
+ return make_node(AST_BlockStatement, self, { body: a }).transform(compressor);
+ }
+ }
+ }
+ if (is_empty(self.alternative)) self.alternative = null;
+ var negated = self.condition.negate(compressor);
+ var negated_is_best = best_of(self.condition, negated) === negated;
+ if (self.alternative && negated_is_best) {
+ negated_is_best = false; // because we already do the switch here.
+ self.condition = negated;
+ var tmp = self.body;
+ self.body = self.alternative || make_node(AST_EmptyStatement);
+ self.alternative = tmp;
+ }
+ if (is_empty(self.body) && is_empty(self.alternative)) {
+ return make_node(AST_SimpleStatement, self.condition, {
+ body: self.condition
+ }).transform(compressor);
+ }
+ if (self.body instanceof AST_SimpleStatement
+ && self.alternative instanceof AST_SimpleStatement) {
+ return make_node(AST_SimpleStatement, self, {
+ body: make_node(AST_Conditional, self, {
+ condition : self.condition,
+ consequent : self.body.body,
+ alternative : self.alternative.body
+ })
+ }).transform(compressor);
+ }
+ if (is_empty(self.alternative) && self.body instanceof AST_SimpleStatement) {
+ if (negated_is_best) return make_node(AST_SimpleStatement, self, {
+ body: make_node(AST_Binary, self, {
+ operator : "||",
+ left : negated,
+ right : self.body.body
+ })
+ }).transform(compressor);
+ return make_node(AST_SimpleStatement, self, {
+ body: make_node(AST_Binary, self, {
+ operator : "&&",
+ left : self.condition,
+ right : self.body.body
+ })
+ }).transform(compressor);
+ }
+ if (self.body instanceof AST_EmptyStatement
+ && self.alternative
+ && self.alternative instanceof AST_SimpleStatement) {
+ return make_node(AST_SimpleStatement, self, {
+ body: make_node(AST_Binary, self, {
+ operator : "||",
+ left : self.condition,
+ right : self.alternative.body
+ })
+ }).transform(compressor);
+ }
+ if (self.body instanceof AST_Exit
+ && self.alternative instanceof AST_Exit
+ && self.body.TYPE == self.alternative.TYPE) {
+ return make_node(self.body.CTOR, self, {
+ value: make_node(AST_Conditional, self, {
+ condition : self.condition,
+ consequent : self.body.value || make_node(AST_Undefined, self.body).optimize(compressor),
+ alternative : self.alternative.value || make_node(AST_Undefined, self.alternative).optimize(compressor)
+ })
+ }).transform(compressor);
+ }
+ if (self.body instanceof AST_If
+ && !self.body.alternative
+ && !self.alternative) {
+ self.condition = make_node(AST_Binary, self.condition, {
+ operator: "&&",
+ left: self.condition,
+ right: self.body.condition
+ }).transform(compressor);
+ self.body = self.body.body;
+ }
+ if (aborts(self.body)) {
+ if (self.alternative) {
+ var alt = self.alternative;
+ self.alternative = null;
+ return make_node(AST_BlockStatement, self, {
+ body: [ self, alt ]
+ }).transform(compressor);
+ }
+ }
+ if (aborts(self.alternative)) {
+ var body = self.body;
+ self.body = self.alternative;
+ self.condition = negated_is_best ? negated : self.condition.negate(compressor);
+ self.alternative = null;
+ return make_node(AST_BlockStatement, self, {
+ body: [ self, body ]
+ }).transform(compressor);
+ }
+ return self;
+ });
+
+ OPT(AST_Switch, function(self, compressor){
+ if (self.body.length == 0 && compressor.option("conditionals")) {
+ return make_node(AST_SimpleStatement, self, {
+ body: self.expression
+ }).transform(compressor);
+ }
+ for(;;) {
+ var last_branch = self.body[self.body.length - 1];
+ if (last_branch) {
+ var stat = last_branch.body[last_branch.body.length - 1]; // last statement
+ if (stat instanceof AST_Break && loop_body(compressor.loopcontrol_target(stat.label)) === self)
+ last_branch.body.pop();
+ if (last_branch instanceof AST_Default && last_branch.body.length == 0) {
+ self.body.pop();
+ continue;
+ }
+ }
+ break;
+ }
+ var exp = self.expression.evaluate(compressor);
+ out: if (exp.length == 2) try {
+ // constant expression
+ self.expression = exp[0];
+ if (!compressor.option("dead_code")) break out;
+ var value = exp[1];
+ var in_if = false;
+ var in_block = false;
+ var started = false;
+ var stopped = false;
+ var ruined = false;
+ var tt = new TreeTransformer(function(node, descend, in_list){
+ if (node instanceof AST_Lambda || node instanceof AST_SimpleStatement) {
+ // no need to descend these node types
+ return node;
+ }
+ else if (node instanceof AST_Switch && node === self) {
+ node = node.clone();
+ descend(node, this);
+ return ruined ? node : make_node(AST_BlockStatement, node, {
+ body: node.body.reduce(function(a, branch){
+ return a.concat(branch.body);
+ }, [])
+ }).transform(compressor);
+ }
+ else if (node instanceof AST_If || node instanceof AST_Try) {
+ var save = in_if;
+ in_if = !in_block;
+ descend(node, this);
+ in_if = save;
+ return node;
+ }
+ else if (node instanceof AST_StatementWithBody || node instanceof AST_Switch) {
+ var save = in_block;
+ in_block = true;
+ descend(node, this);
+ in_block = save;
+ return node;
+ }
+ else if (node instanceof AST_Break && this.loopcontrol_target(node.label) === self) {
+ if (in_if) {
+ ruined = true;
+ return node;
+ }
+ if (in_block) return node;
+ stopped = true;
+ return in_list ? MAP.skip : make_node(AST_EmptyStatement, node);
+ }
+ else if (node instanceof AST_SwitchBranch && this.parent() === self) {
+ if (stopped) return MAP.skip;
+ if (node instanceof AST_Case) {
+ var exp = node.expression.evaluate(compressor);
+ if (exp.length < 2) {
+ // got a case with non-constant expression, baling out
+ throw self;
+ }
+ if (exp[1] === value || started) {
+ started = true;
+ if (aborts(node)) stopped = true;
+ descend(node, this);
+ return node;
+ }
+ return MAP.skip;
+ }
+ descend(node, this);
+ return node;
+ }
+ });
+ tt.stack = compressor.stack.slice(); // so that's able to see parent nodes
+ self = self.transform(tt);
+ } catch(ex) {
+ if (ex !== self) throw ex;
+ }
+ return self;
+ });
+
+ OPT(AST_Case, function(self, compressor){
+ self.body = tighten_body(self.body, compressor);
+ return self;
+ });
+
+ OPT(AST_Try, function(self, compressor){
+ self.body = tighten_body(self.body, compressor);
+ return self;
+ });
+
+ AST_Definitions.DEFMETHOD("remove_initializers", function(){
+ this.definitions.forEach(function(def){ def.value = null });
+ });
+
+ AST_Definitions.DEFMETHOD("to_assignments", function(){
+ var assignments = this.definitions.reduce(function(a, def){
+ if (def.value) {
+ var name = make_node(AST_SymbolRef, def.name, def.name);
+ a.push(make_node(AST_Assign, def, {
+ operator : "=",
+ left : name,
+ right : def.value
+ }));
+ }
+ return a;
+ }, []);
+ if (assignments.length == 0) return null;
+ return AST_Seq.from_array(assignments);
+ });
+
+ OPT(AST_Definitions, function(self, compressor){
+ if (self.definitions.length == 0)
+ return make_node(AST_EmptyStatement, self);
+ return self;
+ });
+
+ OPT(AST_Function, function(self, compressor){
+ self = AST_Lambda.prototype.optimize.call(self, compressor);
+ if (compressor.option("unused")) {
+ if (self.name && self.name.unreferenced()) {
+ self.name = null;
+ }
+ }
+ return self;
+ });
+
+ OPT(AST_Call, function(self, compressor){
+ if (compressor.option("unsafe")) {
+ var exp = self.expression;
+ if (exp instanceof AST_SymbolRef && exp.undeclared()) {
+ switch (exp.name) {
+ case "Array":
+ if (self.args.length != 1) {
+ return make_node(AST_Array, self, {
+ elements: self.args
+ }).transform(compressor);
+ }
+ break;
+ case "Object":
+ if (self.args.length == 0) {
+ return make_node(AST_Object, self, {
+ properties: []
+ });
+ }
+ break;
+ case "String":
+ if (self.args.length == 0) return make_node(AST_String, self, {
+ value: ""
+ });
+ if (self.args.length <= 1) return make_node(AST_Binary, self, {
+ left: self.args[0],
+ operator: "+",
+ right: make_node(AST_String, self, { value: "" })
+ }).transform(compressor);
+ break;
+ case "Number":
+ if (self.args.length == 0) return make_node(AST_Number, self, {
+ value: 0
+ });
+ if (self.args.length == 1) return make_node(AST_UnaryPrefix, self, {
+ expression: self.args[0],
+ operator: "+"
+ }).transform(compressor);
+ case "Boolean":
+ if (self.args.length == 0) return make_node(AST_False, self);
+ if (self.args.length == 1) return make_node(AST_UnaryPrefix, self, {
+ expression: make_node(AST_UnaryPrefix, null, {
+ expression: self.args[0],
+ operator: "!"
+ }),
+ operator: "!"
+ }).transform(compressor);
+ break;
+ case "Function":
+ if (all(self.args, function(x){ return x instanceof AST_String })) {
+ // quite a corner-case, but we can handle it:
+ // https://github.com/mishoo/UglifyJS2/issues/203
+ // if the code argument is a constant, then we can minify it.
+ try {
+ var code = "(function(" + self.args.slice(0, -1).map(function(arg){
+ return arg.value;
+ }).join(",") + "){" + self.args[self.args.length - 1].value + "})()";
+ var ast = parse(code);
+ ast.figure_out_scope({ screw_ie8: compressor.option("screw_ie8") });
+ var comp = new Compressor(compressor.options);
+ ast = ast.transform(comp);
+ ast.figure_out_scope({ screw_ie8: compressor.option("screw_ie8") });
+ ast.mangle_names();
+ var fun;
+ try {
+ ast.walk(new TreeWalker(function(node){
+ if (node instanceof AST_Lambda) {
+ fun = node;
+ throw ast;
+ }
+ }));
+ } catch(ex) {
+ if (ex !== ast) throw ex;
+ };
+ if (!fun) return self;
+ var args = fun.argnames.map(function(arg, i){
+ return make_node(AST_String, self.args[i], {
+ value: arg.print_to_string()
+ });
+ });
+ var code = OutputStream();
+ AST_BlockStatement.prototype._codegen.call(fun, fun, code);
+ code = code.toString().replace(/^\{|\}$/g, "");
+ args.push(make_node(AST_String, self.args[self.args.length - 1], {
+ value: code
+ }));
+ self.args = args;
+ return self;
+ } catch(ex) {
+ if (ex instanceof JS_Parse_Error) {
+ compressor.warn("Error parsing code passed to new Function [{file}:{line},{col}]", self.args[self.args.length - 1].start);
+ compressor.warn(ex.toString());
+ } else {
+ console.log(ex);
+ throw ex;
+ }
+ }
+ }
+ break;
+ }
+ }
+ else if (exp instanceof AST_Dot && exp.property == "toString" && self.args.length == 0) {
+ return make_node(AST_Binary, self, {
+ left: make_node(AST_String, self, { value: "" }),
+ operator: "+",
+ right: exp.expression
+ }).transform(compressor);
+ }
+ else if (exp instanceof AST_Dot && exp.expression instanceof AST_Array && exp.property == "join") EXIT: {
+ var separator = self.args.length == 0 ? "," : self.args[0].evaluate(compressor)[1];
+ if (separator == null) break EXIT; // not a constant
+ var elements = exp.expression.elements.reduce(function(a, el){
+ el = el.evaluate(compressor);
+ if (a.length == 0 || el.length == 1) {
+ a.push(el);
+ } else {
+ var last = a[a.length - 1];
+ if (last.length == 2) {
+ // it's a constant
+ var val = "" + last[1] + separator + el[1];
+ a[a.length - 1] = [ make_node_from_constant(compressor, val, last[0]), val ];
+ } else {
+ a.push(el);
+ }
+ }
+ return a;
+ }, []);
+ if (elements.length == 0) return make_node(AST_String, self, { value: "" });
+ if (elements.length == 1) return elements[0][0];
+ if (separator == "") {
+ var first;
+ if (elements[0][0] instanceof AST_String
+ || elements[1][0] instanceof AST_String) {
+ first = elements.shift()[0];
+ } else {
+ first = make_node(AST_String, self, { value: "" });
+ }
+ return elements.reduce(function(prev, el){
+ return make_node(AST_Binary, el[0], {
+ operator : "+",
+ left : prev,
+ right : el[0],
+ });
+ }, first).transform(compressor);
+ }
+ // need this awkward cloning to not affect original element
+ // best_of will decide which one to get through.
+ var node = self.clone();
+ node.expression = node.expression.clone();
+ node.expression.expression = node.expression.expression.clone();
+ node.expression.expression.elements = elements.map(function(el){
+ return el[0];
+ });
+ return best_of(self, node);
+ }
+ }
+ if (compressor.option("side_effects")) {
+ if (self.expression instanceof AST_Function
+ && self.args.length == 0
+ && !AST_Block.prototype.has_side_effects.call(self.expression, compressor)) {
+ return make_node(AST_Undefined, self).transform(compressor);
+ }
+ }
+ if (compressor.option("drop_console")) {
+ if (self.expression instanceof AST_PropAccess &&
+ self.expression.expression instanceof AST_SymbolRef &&
+ self.expression.expression.name == "console" &&
+ self.expression.expression.undeclared()) {
+ return make_node(AST_Undefined, self).transform(compressor);
+ }
+ }
+ return self.evaluate(compressor)[0];
+ });
+
+ OPT(AST_New, function(self, compressor){
+ if (compressor.option("unsafe")) {
+ var exp = self.expression;
+ if (exp instanceof AST_SymbolRef && exp.undeclared()) {
+ switch (exp.name) {
+ case "Object":
+ case "RegExp":
+ case "Function":
+ case "Error":
+ case "Array":
+ return make_node(AST_Call, self, self).transform(compressor);
+ }
+ }
+ }
+ return self;
+ });
+
+ OPT(AST_Seq, function(self, compressor){
+ if (!compressor.option("side_effects"))
+ return self;
+ if (!self.car.has_side_effects(compressor)) {
+ // we shouldn't compress (1,eval)(something) to
+ // eval(something) because that changes the meaning of
+ // eval (becomes lexical instead of global).
+ var p;
+ if (!(self.cdr instanceof AST_SymbolRef
+ && self.cdr.name == "eval"
+ && self.cdr.undeclared()
+ && (p = compressor.parent()) instanceof AST_Call
+ && p.expression === self)) {
+ return self.cdr;
+ }
+ }
+ if (compressor.option("cascade")) {
+ if (self.car instanceof AST_Assign
+ && !self.car.left.has_side_effects(compressor)) {
+ if (self.car.left.equivalent_to(self.cdr)) {
+ return self.car;
+ }
+ if (self.cdr instanceof AST_Call
+ && self.cdr.expression.equivalent_to(self.car.left)) {
+ self.cdr.expression = self.car;
+ return self.cdr;
+ }
+ }
+ if (!self.car.has_side_effects(compressor)
+ && !self.cdr.has_side_effects(compressor)
+ && self.car.equivalent_to(self.cdr)) {
+ return self.car;
+ }
+ }
+ if (self.cdr instanceof AST_UnaryPrefix
+ && self.cdr.operator == "void"
+ && !self.cdr.expression.has_side_effects(compressor)) {
+ self.cdr.operator = self.car;
+ return self.cdr;
+ }
+ if (self.cdr instanceof AST_Undefined) {
+ return make_node(AST_UnaryPrefix, self, {
+ operator : "void",
+ expression : self.car
+ });
+ }
+ return self;
+ });
+
+ AST_Unary.DEFMETHOD("lift_sequences", function(compressor){
+ if (compressor.option("sequences")) {
+ if (this.expression instanceof AST_Seq) {
+ var seq = this.expression;
+ var x = seq.to_array();
+ this.expression = x.pop();
+ x.push(this);
+ seq = AST_Seq.from_array(x).transform(compressor);
+ return seq;
+ }
+ }
+ return this;
+ });
+
+ OPT(AST_UnaryPostfix, function(self, compressor){
+ return self.lift_sequences(compressor);
+ });
+
+ OPT(AST_UnaryPrefix, function(self, compressor){
+ self = self.lift_sequences(compressor);
+ var e = self.expression;
+ if (compressor.option("booleans") && compressor.in_boolean_context()) {
+ switch (self.operator) {
+ case "!":
+ if (e instanceof AST_UnaryPrefix && e.operator == "!") {
+ // !!foo ==> foo, if we're in boolean context
+ return e.expression;
+ }
+ break;
+ case "typeof":
+ // typeof always returns a non-empty string, thus it's
+ // always true in booleans
+ compressor.warn("Boolean expression always true [{file}:{line},{col}]", self.start);
+ return make_node(AST_True, self);
+ }
+ if (e instanceof AST_Binary && self.operator == "!") {
+ self = best_of(self, e.negate(compressor));
+ }
+ }
+ return self.evaluate(compressor)[0];
+ });
+
+ function has_side_effects_or_prop_access(node, compressor) {
+ var save_pure_getters = compressor.option("pure_getters");
+ compressor.options.pure_getters = false;
+ var ret = node.has_side_effects(compressor);
+ compressor.options.pure_getters = save_pure_getters;
+ return ret;
+ }
+
+ AST_Binary.DEFMETHOD("lift_sequences", function(compressor){
+ if (compressor.option("sequences")) {
+ if (this.left instanceof AST_Seq) {
+ var seq = this.left;
+ var x = seq.to_array();
+ this.left = x.pop();
+ x.push(this);
+ seq = AST_Seq.from_array(x).transform(compressor);
+ return seq;
+ }
+ if (this.right instanceof AST_Seq
+ && this instanceof AST_Assign
+ && !has_side_effects_or_prop_access(this.left, compressor)) {
+ var seq = this.right;
+ var x = seq.to_array();
+ this.right = x.pop();
+ x.push(this);
+ seq = AST_Seq.from_array(x).transform(compressor);
+ return seq;
+ }
+ }
+ return this;
+ });
+
+ var commutativeOperators = makePredicate("== === != !== * & | ^");
+
+ OPT(AST_Binary, function(self, compressor){
+ var reverse = compressor.has_directive("use asm") ? noop
+ : function(op, force) {
+ if (force || !(self.left.has_side_effects(compressor) || self.right.has_side_effects(compressor))) {
+ if (op) self.operator = op;
+ var tmp = self.left;
+ self.left = self.right;
+ self.right = tmp;
+ }
+ };
+ if (commutativeOperators(self.operator)) {
+ if (self.right instanceof AST_Constant
+ && !(self.left instanceof AST_Constant)) {
+ // if right is a constant, whatever side effects the
+ // left side might have could not influence the
+ // result. hence, force switch.
+
+ if (!(self.left instanceof AST_Binary
+ && PRECEDENCE[self.left.operator] >= PRECEDENCE[self.operator])) {
+ reverse(null, true);
+ }
+ }
+ if (/^[!=]==?$/.test(self.operator)) {
+ if (self.left instanceof AST_SymbolRef && self.right instanceof AST_Conditional) {
+ if (self.right.consequent instanceof AST_SymbolRef
+ && self.right.consequent.definition() === self.left.definition()) {
+ if (/^==/.test(self.operator)) return self.right.condition;
+ if (/^!=/.test(self.operator)) return self.right.condition.negate(compressor);
+ }
+ if (self.right.alternative instanceof AST_SymbolRef
+ && self.right.alternative.definition() === self.left.definition()) {
+ if (/^==/.test(self.operator)) return self.right.condition.negate(compressor);
+ if (/^!=/.test(self.operator)) return self.right.condition;
+ }
+ }
+ if (self.right instanceof AST_SymbolRef && self.left instanceof AST_Conditional) {
+ if (self.left.consequent instanceof AST_SymbolRef
+ && self.left.consequent.definition() === self.right.definition()) {
+ if (/^==/.test(self.operator)) return self.left.condition;
+ if (/^!=/.test(self.operator)) return self.left.condition.negate(compressor);
+ }
+ if (self.left.alternative instanceof AST_SymbolRef
+ && self.left.alternative.definition() === self.right.definition()) {
+ if (/^==/.test(self.operator)) return self.left.condition.negate(compressor);
+ if (/^!=/.test(self.operator)) return self.left.condition;
+ }
+ }
+ }
+ }
+ self = self.lift_sequences(compressor);
+ if (compressor.option("comparisons")) switch (self.operator) {
+ case "===":
+ case "!==":
+ if ((self.left.is_string(compressor) && self.right.is_string(compressor)) ||
+ (self.left.is_boolean() && self.right.is_boolean())) {
+ self.operator = self.operator.substr(0, 2);
+ }
+ // XXX: intentionally falling down to the next case
+ case "==":
+ case "!=":
+ if (self.left instanceof AST_String
+ && self.left.value == "undefined"
+ && self.right instanceof AST_UnaryPrefix
+ && self.right.operator == "typeof"
+ && compressor.option("unsafe")) {
+ if (!(self.right.expression instanceof AST_SymbolRef)
+ || !self.right.expression.undeclared()) {
+ self.right = self.right.expression;
+ self.left = make_node(AST_Undefined, self.left).optimize(compressor);
+ if (self.operator.length == 2) self.operator += "=";
+ }
+ }
+ break;
+ }
+ if (compressor.option("booleans") && compressor.in_boolean_context()) switch (self.operator) {
+ case "&&":
+ var ll = self.left.evaluate(compressor);
+ var rr = self.right.evaluate(compressor);
+ if ((ll.length > 1 && !ll[1]) || (rr.length > 1 && !rr[1])) {
+ compressor.warn("Boolean && always false [{file}:{line},{col}]", self.start);
+ return make_node(AST_False, self);
+ }
+ if (ll.length > 1 && ll[1]) {
+ return rr[0];
+ }
+ if (rr.length > 1 && rr[1]) {
+ return ll[0];
+ }
+ break;
+ case "||":
+ var ll = self.left.evaluate(compressor);
+ var rr = self.right.evaluate(compressor);
+ if ((ll.length > 1 && ll[1]) || (rr.length > 1 && rr[1])) {
+ compressor.warn("Boolean || always true [{file}:{line},{col}]", self.start);
+ return make_node(AST_True, self);
+ }
+ if (ll.length > 1 && !ll[1]) {
+ return rr[0];
+ }
+ if (rr.length > 1 && !rr[1]) {
+ return ll[0];
+ }
+ break;
+ case "+":
+ var ll = self.left.evaluate(compressor);
+ var rr = self.right.evaluate(compressor);
+ if ((ll.length > 1 && ll[0] instanceof AST_String && ll[1]) ||
+ (rr.length > 1 && rr[0] instanceof AST_String && rr[1])) {
+ compressor.warn("+ in boolean context always true [{file}:{line},{col}]", self.start);
+ return make_node(AST_True, self);
+ }
+ break;
+ }
+ if (compressor.option("comparisons")) {
+ if (!(compressor.parent() instanceof AST_Binary)
+ || compressor.parent() instanceof AST_Assign) {
+ var negated = make_node(AST_UnaryPrefix, self, {
+ operator: "!",
+ expression: self.negate(compressor)
+ });
+ self = best_of(self, negated);
+ }
+ switch (self.operator) {
+ case "<": reverse(">"); break;
+ case "<=": reverse(">="); break;
+ }
+ }
+ if (self.operator == "+" && self.right instanceof AST_String
+ && self.right.getValue() === "" && self.left instanceof AST_Binary
+ && self.left.operator == "+" && self.left.is_string(compressor)) {
+ return self.left;
+ }
+ if (compressor.option("evaluate")) {
+ if (self.operator == "+") {
+ if (self.left instanceof AST_Constant
+ && self.right instanceof AST_Binary
+ && self.right.operator == "+"
+ && self.right.left instanceof AST_Constant
+ && self.right.is_string(compressor)) {
+ self = make_node(AST_Binary, self, {
+ operator: "+",
+ left: make_node(AST_String, null, {
+ value: "" + self.left.getValue() + self.right.left.getValue(),
+ start: self.left.start,
+ end: self.right.left.end
+ }),
+ right: self.right.right
+ });
+ }
+ if (self.right instanceof AST_Constant
+ && self.left instanceof AST_Binary
+ && self.left.operator == "+"
+ && self.left.right instanceof AST_Constant
+ && self.left.is_string(compressor)) {
+ self = make_node(AST_Binary, self, {
+ operator: "+",
+ left: self.left.left,
+ right: make_node(AST_String, null, {
+ value: "" + self.left.right.getValue() + self.right.getValue(),
+ start: self.left.right.start,
+ end: self.right.end
+ })
+ });
+ }
+ if (self.left instanceof AST_Binary
+ && self.left.operator == "+"
+ && self.left.is_string(compressor)
+ && self.left.right instanceof AST_Constant
+ && self.right instanceof AST_Binary
+ && self.right.operator == "+"
+ && self.right.left instanceof AST_Constant
+ && self.right.is_string(compressor)) {
+ self = make_node(AST_Binary, self, {
+ operator: "+",
+ left: make_node(AST_Binary, self.left, {
+ operator: "+",
+ left: self.left.left,
+ right: make_node(AST_String, null, {
+ value: "" + self.left.right.getValue() + self.right.left.getValue(),
+ start: self.left.right.start,
+ end: self.right.left.end
+ })
+ }),
+ right: self.right.right
+ });
+ }
+ }
+ }
+ // x * (y * z) ==> x * y * z
+ if (self.right instanceof AST_Binary
+ && self.right.operator == self.operator
+ && (self.operator == "*" || self.operator == "&&" || self.operator == "||"))
+ {
+ self.left = make_node(AST_Binary, self.left, {
+ operator : self.operator,
+ left : self.left,
+ right : self.right.left
+ });
+ self.right = self.right.right;
+ return self.transform(compressor);
+ }
+ return self.evaluate(compressor)[0];
+ });
+
+ OPT(AST_SymbolRef, function(self, compressor){
+ if (self.undeclared()) {
+ var defines = compressor.option("global_defs");
+ if (defines && defines.hasOwnProperty(self.name)) {
+ return make_node_from_constant(compressor, defines[self.name], self);
+ }
+ switch (self.name) {
+ case "undefined":
+ return make_node(AST_Undefined, self);
+ case "NaN":
+ return make_node(AST_NaN, self);
+ case "Infinity":
+ return make_node(AST_Infinity, self);
+ }
+ }
+ return self;
+ });
+
+ OPT(AST_Undefined, function(self, compressor){
+ if (compressor.option("unsafe")) {
+ var scope = compressor.find_parent(AST_Scope);
+ var undef = scope.find_variable("undefined");
+ if (undef) {
+ var ref = make_node(AST_SymbolRef, self, {
+ name : "undefined",
+ scope : scope,
+ thedef : undef
+ });
+ ref.reference();
+ return ref;
+ }
+ }
+ return self;
+ });
+
+ var ASSIGN_OPS = [ '+', '-', '/', '*', '%', '>>', '<<', '>>>', '|', '^', '&' ];
+ OPT(AST_Assign, function(self, compressor){
+ self = self.lift_sequences(compressor);
+ if (self.operator == "="
+ && self.left instanceof AST_SymbolRef
+ && self.right instanceof AST_Binary
+ && self.right.left instanceof AST_SymbolRef
+ && self.right.left.name == self.left.name
+ && member(self.right.operator, ASSIGN_OPS)) {
+ self.operator = self.right.operator + "=";
+ self.right = self.right.right;
+ }
+ return self;
+ });
+
+ OPT(AST_Conditional, function(self, compressor){
+ if (!compressor.option("conditionals")) return self;
+ if (self.condition instanceof AST_Seq) {
+ var car = self.condition.car;
+ self.condition = self.condition.cdr;
+ return AST_Seq.cons(car, self);
+ }
+ var cond = self.condition.evaluate(compressor);
+ if (cond.length > 1) {
+ if (cond[1]) {
+ compressor.warn("Condition always true [{file}:{line},{col}]", self.start);
+ return self.consequent;
+ } else {
+ compressor.warn("Condition always false [{file}:{line},{col}]", self.start);
+ return self.alternative;
+ }
+ }
+ var negated = cond[0].negate(compressor);
+ if (best_of(cond[0], negated) === negated) {
+ self = make_node(AST_Conditional, self, {
+ condition: negated,
+ consequent: self.alternative,
+ alternative: self.consequent
+ });
+ }
+ var consequent = self.consequent;
+ var alternative = self.alternative;
+ if (consequent instanceof AST_Assign
+ && alternative instanceof AST_Assign
+ && consequent.operator == alternative.operator
+ && consequent.left.equivalent_to(alternative.left)
+ ) {
+ /*
+ * Stuff like this:
+ * if (foo) exp = something; else exp = something_else;
+ * ==>
+ * exp = foo ? something : something_else;
+ */
+ return make_node(AST_Assign, self, {
+ operator: consequent.operator,
+ left: consequent.left,
+ right: make_node(AST_Conditional, self, {
+ condition: self.condition,
+ consequent: consequent.right,
+ alternative: alternative.right
+ })
+ });
+ }
+ if (consequent instanceof AST_Call
+ && alternative.TYPE === consequent.TYPE
+ && consequent.args.length == alternative.args.length
+ && consequent.expression.equivalent_to(alternative.expression)) {
+ if (consequent.args.length == 0) {
+ return make_node(AST_Seq, self, {
+ car: self.condition,
+ cdr: consequent
+ });
+ }
+ if (consequent.args.length == 1) {
+ consequent.args[0] = make_node(AST_Conditional, self, {
+ condition: self.condition,
+ consequent: consequent.args[0],
+ alternative: alternative.args[0]
+ });
+ return consequent;
+ }
+ }
+ // x?y?z:a:a --> x&&y?z:a
+ if (consequent instanceof AST_Conditional
+ && consequent.alternative.equivalent_to(alternative)) {
+ return make_node(AST_Conditional, self, {
+ condition: make_node(AST_Binary, self, {
+ left: self.condition,
+ operator: "&&",
+ right: consequent.condition
+ }),
+ consequent: consequent.consequent,
+ alternative: alternative
+ });
+ }
+ // x=y?1:1 --> x=1
+ if (consequent instanceof AST_Constant
+ && alternative instanceof AST_Constant
+ && consequent.equivalent_to(alternative)) {
+ if (self.condition.has_side_effects(compressor)) {
+ return AST_Seq.from_array([self.condition, make_node_from_constant(compressor, consequent.value, self)]);
+ } else {
+ return make_node_from_constant(compressor, consequent.value, self);
+
+ }
+ }
+ return self;
+ });
+
+ OPT(AST_Boolean, function(self, compressor){
+ if (compressor.option("booleans")) {
+ var p = compressor.parent();
+ if (p instanceof AST_Binary && (p.operator == "=="
+ || p.operator == "!=")) {
+ compressor.warn("Non-strict equality against boolean: {operator} {value} [{file}:{line},{col}]", {
+ operator : p.operator,
+ value : self.value,
+ file : p.start.file,
+ line : p.start.line,
+ col : p.start.col,
+ });
+ return make_node(AST_Number, self, {
+ value: +self.value
+ });
+ }
+ return make_node(AST_UnaryPrefix, self, {
+ operator: "!",
+ expression: make_node(AST_Number, self, {
+ value: 1 - self.value
+ })
+ });
+ }
+ return self;
+ });
+
+ OPT(AST_Sub, function(self, compressor){
+ var prop = self.property;
+ if (prop instanceof AST_String && compressor.option("properties")) {
+ prop = prop.getValue();
+ if (RESERVED_WORDS(prop) ? compressor.option("screw_ie8") : is_identifier_string(prop)) {
+ return make_node(AST_Dot, self, {
+ expression : self.expression,
+ property : prop
+ }).optimize(compressor);
+ }
+ var v = parseFloat(prop);
+ if (!isNaN(v) && v.toString() == prop) {
+ self.property = make_node(AST_Number, self.property, {
+ value: v
+ });
+ }
+ }
+ return self;
+ });
+
+ OPT(AST_Dot, function(self, compressor){
+ var prop = self.property;
+ if (RESERVED_WORDS(prop) && !compressor.option("screw_ie8")) {
+ return make_node(AST_Sub, self, {
+ expression : self.expression,
+ property : make_node(AST_String, self, {
+ value: prop
+ })
+ }).optimize(compressor);
+ }
+ return self.evaluate(compressor)[0];
+ });
+
+ function literals_in_boolean_context(self, compressor) {
+ if (compressor.option("booleans") && compressor.in_boolean_context()) {
+ return make_node(AST_True, self);
+ }
+ return self;
+ };
+ OPT(AST_Array, literals_in_boolean_context);
+ OPT(AST_Object, literals_in_boolean_context);
+ OPT(AST_RegExp, literals_in_boolean_context);
+
+})();
+
+/***********************************************************************
+
+ A JavaScript tokenizer / parser / beautifier / compressor.
+ https://github.com/mishoo/UglifyJS2
+
+ -------------------------------- (C) ---------------------------------
+
+ Author: Mihai Bazon
+ <mihai.bazon@gmail.com>
+ http://mihai.bazon.net/blog
+
+ Distributed under the BSD license:
+
+ Copyright 2012 (c) Mihai Bazon <mihai.bazon@gmail.com>
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ * Redistributions of source code must retain the above
+ copyright notice, this list of conditions and the following
+ disclaimer.
+
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials
+ provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+ THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+
+ ***********************************************************************/
+
+"use strict";
+
+// a small wrapper around fitzgen's source-map library
+function SourceMap(options) {
+ options = defaults(options, {
+ file : null,
+ root : null,
+ orig : null,
+
+ orig_line_diff : 0,
+ dest_line_diff : 0,
+ });
+ var generator = new MOZ_SourceMap.SourceMapGenerator({
+ file : options.file,
+ sourceRoot : options.root
+ });
+ var orig_map = options.orig && new MOZ_SourceMap.SourceMapConsumer(options.orig);
+ function add(source, gen_line, gen_col, orig_line, orig_col, name) {
+ if (orig_map) {
+ var info = orig_map.originalPositionFor({
+ line: orig_line,
+ column: orig_col
+ });
+ if (info.source === null) {
+ return;
+ }
+ source = info.source;
+ orig_line = info.line;
+ orig_col = info.column;
+ name = info.name || name;
+ }
+ generator.addMapping({
+ generated : { line: gen_line + options.dest_line_diff, column: gen_col },
+ original : { line: orig_line + options.orig_line_diff, column: orig_col },
+ source : source,
+ name : name
+ });
+ };
+ return {
+ add : add,
+ get : function() { return generator },
+ toString : function() { return generator.toString() }
+ };
+};
+
+/***********************************************************************
+
+ A JavaScript tokenizer / parser / beautifier / compressor.
+ https://github.com/mishoo/UglifyJS2
+
+ -------------------------------- (C) ---------------------------------
+
+ Author: Mihai Bazon
+ <mihai.bazon@gmail.com>
+ http://mihai.bazon.net/blog
+
+ Distributed under the BSD license:
+
+ Copyright 2012 (c) Mihai Bazon <mihai.bazon@gmail.com>
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ * Redistributions of source code must retain the above
+ copyright notice, this list of conditions and the following
+ disclaimer.
+
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials
+ provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+ THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+
+ ***********************************************************************/
+
+"use strict";
+
+(function(){
+
+ var MOZ_TO_ME = {
+ ExpressionStatement: function(M) {
+ var expr = M.expression;
+ if (expr.type === "Literal" && typeof expr.value === "string") {
+ return new AST_Directive({
+ start: my_start_token(M),
+ end: my_end_token(M),
+ value: expr.value
+ });
+ }
+ return new AST_SimpleStatement({
+ start: my_start_token(M),
+ end: my_end_token(M),
+ body: from_moz(expr)
+ });
+ },
+ TryStatement: function(M) {
+ var handlers = M.handlers || [M.handler];
+ if (handlers.length > 1 || M.guardedHandlers && M.guardedHandlers.length) {
+ throw new Error("Multiple catch clauses are not supported.");
+ }
+ return new AST_Try({
+ start : my_start_token(M),
+ end : my_end_token(M),
+ body : from_moz(M.block).body,
+ bcatch : from_moz(handlers[0]),
+ bfinally : M.finalizer ? new AST_Finally(from_moz(M.finalizer)) : null
+ });
+ },
+ Property: function(M) {
+ var key = M.key;
+ var name = key.type == "Identifier" ? key.name : key.value;
+ var args = {
+ start : my_start_token(key),
+ end : my_end_token(M.value),
+ key : name,
+ value : from_moz(M.value)
+ };
+ switch (M.kind) {
+ case "init":
+ return new AST_ObjectKeyVal(args);
+ case "set":
+ args.value.name = from_moz(key);
+ return new AST_ObjectSetter(args);
+ case "get":
+ args.value.name = from_moz(key);
+ return new AST_ObjectGetter(args);
+ }
+ },
+ ObjectExpression: function(M) {
+ return new AST_Object({
+ start : my_start_token(M),
+ end : my_end_token(M),
+ properties : M.properties.map(function(prop){
+ prop.type = "Property";
+ return from_moz(prop)
+ })
+ });
+ },
+ SequenceExpression: function(M) {
+ return AST_Seq.from_array(M.expressions.map(from_moz));
+ },
+ MemberExpression: function(M) {
+ return new (M.computed ? AST_Sub : AST_Dot)({
+ start : my_start_token(M),
+ end : my_end_token(M),
+ property : M.computed ? from_moz(M.property) : M.property.name,
+ expression : from_moz(M.object)
+ });
+ },
+ SwitchCase: function(M) {
+ return new (M.test ? AST_Case : AST_Default)({
+ start : my_start_token(M),
+ end : my_end_token(M),
+ expression : from_moz(M.test),
+ body : M.consequent.map(from_moz)
+ });
+ },
+ VariableDeclaration: function(M) {
+ return new (M.kind === "const" ? AST_Const : AST_Var)({
+ start : my_start_token(M),
+ end : my_end_token(M),
+ definitions : M.declarations.map(from_moz)
+ });
+ },
+ Literal: function(M) {
+ var val = M.value, args = {
+ start : my_start_token(M),
+ end : my_end_token(M)
+ };
+ if (val === null) return new AST_Null(args);
+ switch (typeof val) {
+ case "string":
+ args.value = val;
+ return new AST_String(args);
+ case "number":
+ args.value = val;
+ return new AST_Number(args);
+ case "boolean":
+ return new (val ? AST_True : AST_False)(args);
+ default:
+ args.value = val;
+ return new AST_RegExp(args);
+ }
+ },
+ Identifier: function(M) {
+ var p = FROM_MOZ_STACK[FROM_MOZ_STACK.length - 2];
+ return new ( p.type == "LabeledStatement" ? AST_Label
+ : p.type == "VariableDeclarator" && p.id === M ? (p.kind == "const" ? AST_SymbolConst : AST_SymbolVar)
+ : p.type == "FunctionExpression" ? (p.id === M ? AST_SymbolLambda : AST_SymbolFunarg)
+ : p.type == "FunctionDeclaration" ? (p.id === M ? AST_SymbolDefun : AST_SymbolFunarg)
+ : p.type == "CatchClause" ? AST_SymbolCatch
+ : p.type == "BreakStatement" || p.type == "ContinueStatement" ? AST_LabelRef
+ : AST_SymbolRef)({
+ start : my_start_token(M),
+ end : my_end_token(M),
+ name : M.name
+ });
+ }
+ };
+
+ MOZ_TO_ME.UpdateExpression =
+ MOZ_TO_ME.UnaryExpression = function To_Moz_Unary(M) {
+ var prefix = "prefix" in M ? M.prefix
+ : M.type == "UnaryExpression" ? true : false;
+ return new (prefix ? AST_UnaryPrefix : AST_UnaryPostfix)({
+ start : my_start_token(M),
+ end : my_end_token(M),
+ operator : M.operator,
+ expression : from_moz(M.argument)
+ });
+ };
+
+ map("Program", AST_Toplevel, "body@body");
+ map("EmptyStatement", AST_EmptyStatement);
+ map("BlockStatement", AST_BlockStatement, "body@body");
+ map("IfStatement", AST_If, "test>condition, consequent>body, alternate>alternative");
+ map("LabeledStatement", AST_LabeledStatement, "label>label, body>body");
+ map("BreakStatement", AST_Break, "label>label");
+ map("ContinueStatement", AST_Continue, "label>label");
+ map("WithStatement", AST_With, "object>expression, body>body");
+ map("SwitchStatement", AST_Switch, "discriminant>expression, cases@body");
+ map("ReturnStatement", AST_Return, "argument>value");
+ map("ThrowStatement", AST_Throw, "argument>value");
+ map("WhileStatement", AST_While, "test>condition, body>body");
+ map("DoWhileStatement", AST_Do, "test>condition, body>body");
+ map("ForStatement", AST_For, "init>init, test>condition, update>step, body>body");
+ map("ForInStatement", AST_ForIn, "left>init, right>object, body>body");
+ map("DebuggerStatement", AST_Debugger);
+ map("FunctionDeclaration", AST_Defun, "id>name, params@argnames, body%body");
+ map("VariableDeclarator", AST_VarDef, "id>name, init>value");
+ map("CatchClause", AST_Catch, "param>argname, body%body");
+
+ map("ThisExpression", AST_This);
+ map("ArrayExpression", AST_Array, "elements@elements");
+ map("FunctionExpression", AST_Function, "id>name, params@argnames, body%body");
+ map("BinaryExpression", AST_Binary, "operator=operator, left>left, right>right");
+ map("LogicalExpression", AST_Binary, "operator=operator, left>left, right>right");
+ map("AssignmentExpression", AST_Assign, "operator=operator, left>left, right>right");
+ map("ConditionalExpression", AST_Conditional, "test>condition, consequent>consequent, alternate>alternative");
+ map("NewExpression", AST_New, "callee>expression, arguments@args");
+ map("CallExpression", AST_Call, "callee>expression, arguments@args");
+
+ def_to_moz(AST_Directive, function To_Moz_Directive(M) {
+ return {
+ type: "ExpressionStatement",
+ expression: {
+ type: "Literal",
+ value: M.value
+ }
+ };
+ });
+
+ def_to_moz(AST_SimpleStatement, function To_Moz_ExpressionStatement(M) {
+ return {
+ type: "ExpressionStatement",
+ expression: to_moz(M.body)
+ };
+ });
+
+ def_to_moz(AST_SwitchBranch, function To_Moz_SwitchCase(M) {
+ return {
+ type: "SwitchCase",
+ test: to_moz(M.expression),
+ consequent: M.body.map(to_moz)
+ };
+ });
+
+ def_to_moz(AST_Try, function To_Moz_TryStatement(M) {
+ return {
+ type: "TryStatement",
+ block: to_moz_block(M),
+ handler: to_moz(M.bcatch),
+ guardedHandlers: [],
+ finalizer: to_moz(M.bfinally)
+ };
+ });
+
+ def_to_moz(AST_Catch, function To_Moz_CatchClause(M) {
+ return {
+ type: "CatchClause",
+ param: to_moz(M.argname),
+ guard: null,
+ body: to_moz_block(M)
+ };
+ });
+
+ def_to_moz(AST_Definitions, function To_Moz_VariableDeclaration(M) {
+ return {
+ type: "VariableDeclaration",
+ kind: M instanceof AST_Const ? "const" : "var",
+ declarations: M.definitions.map(to_moz)
+ };
+ });
+
+ def_to_moz(AST_Seq, function To_Moz_SequenceExpression(M) {
+ return {
+ type: "SequenceExpression",
+ expressions: M.to_array().map(to_moz)
+ };
+ });
+
+ def_to_moz(AST_PropAccess, function To_Moz_MemberExpression(M) {
+ var isComputed = M instanceof AST_Sub;
+ return {
+ type: "MemberExpression",
+ object: to_moz(M.expression),
+ computed: isComputed,
+ property: isComputed ? to_moz(M.property) : {type: "Identifier", name: M.property}
+ };
+ });
+
+ def_to_moz(AST_Unary, function To_Moz_Unary(M) {
+ return {
+ type: M.operator == "++" || M.operator == "--" ? "UpdateExpression" : "UnaryExpression",
+ operator: M.operator,
+ prefix: M instanceof AST_UnaryPrefix,
+ argument: to_moz(M.expression)
+ };
+ });
+
+ def_to_moz(AST_Binary, function To_Moz_BinaryExpression(M) {
+ return {
+ type: M.operator == "&&" || M.operator == "||" ? "LogicalExpression" : "BinaryExpression",
+ left: to_moz(M.left),
+ operator: M.operator,
+ right: to_moz(M.right)
+ };
+ });
+
+ def_to_moz(AST_Object, function To_Moz_ObjectExpression(M) {
+ return {
+ type: "ObjectExpression",
+ properties: M.properties.map(to_moz)
+ };
+ });
+
+ def_to_moz(AST_ObjectProperty, function To_Moz_Property(M) {
+ var key = (
+ is_identifier(M.key)
+ ? {type: "Identifier", name: M.key}
+ : {type: "Literal", value: M.key}
+ );
+ var kind;
+ if (M instanceof AST_ObjectKeyVal) {
+ kind = "init";
+ } else
+ if (M instanceof AST_ObjectGetter) {
+ kind = "get";
+ } else
+ if (M instanceof AST_ObjectSetter) {
+ kind = "set";
+ }
+ return {
+ type: "Property",
+ kind: kind,
+ key: key,
+ value: to_moz(M.value)
+ };
+ });
+
+ def_to_moz(AST_Symbol, function To_Moz_Identifier(M) {
+ var def = M.definition();
+ return {
+ type: "Identifier",
+ name: def ? def.mangled_name || def.name : M.name
+ };
+ });
+
+ def_to_moz(AST_Constant, function To_Moz_Literal(M) {
+ var value = M.value;
+ if (typeof value === 'number' && (value < 0 || (value === 0 && 1 / value < 0))) {
+ return {
+ type: "UnaryExpression",
+ operator: "-",
+ prefix: true,
+ argument: {
+ type: "Literal",
+ value: -value
+ }
+ };
+ }
+ return {
+ type: "Literal",
+ value: value
+ };
+ });
+
+ def_to_moz(AST_Atom, function To_Moz_Atom(M) {
+ return {
+ type: "Identifier",
+ name: String(M.value)
+ };
+ });
+
+ AST_Boolean.DEFMETHOD("to_mozilla_ast", AST_Constant.prototype.to_mozilla_ast);
+ AST_Null.DEFMETHOD("to_mozilla_ast", AST_Constant.prototype.to_mozilla_ast);
+ AST_Hole.DEFMETHOD("to_mozilla_ast", function To_Moz_ArrayHole() { return null });
+
+ AST_Block.DEFMETHOD("to_mozilla_ast", AST_BlockStatement.prototype.to_mozilla_ast);
+ AST_Lambda.DEFMETHOD("to_mozilla_ast", AST_Function.prototype.to_mozilla_ast);
+
+ /* -----[ tools ]----- */
+
+ function my_start_token(moznode) {
+ var loc = moznode.loc;
+ var range = moznode.range;
+ return new AST_Token({
+ file : loc && loc.source,
+ line : loc && loc.start.line,
+ col : loc && loc.start.column,
+ pos : range ? range[0] : moznode.start,
+ endpos : range ? range[0] : moznode.start
+ });
+ };
+
+ function my_end_token(moznode) {
+ var loc = moznode.loc;
+ var range = moznode.range;
+ return new AST_Token({
+ file : loc && loc.source,
+ line : loc && loc.end.line,
+ col : loc && loc.end.column,
+ pos : range ? range[1] : moznode.end,
+ endpos : range ? range[1] : moznode.end
+ });
+ };
+
+ function map(moztype, mytype, propmap) {
+ var moz_to_me = "function From_Moz_" + moztype + "(M){\n";
+ moz_to_me += "return new " + mytype.name + "({\n" +
+ "start: my_start_token(M),\n" +
+ "end: my_end_token(M)";
+
+ var me_to_moz = "function To_Moz_" + moztype + "(M){\n";
+ me_to_moz += "return {\n" +
+ "type: " + JSON.stringify(moztype);
+
+ if (propmap) propmap.split(/\s*,\s*/).forEach(function(prop){
+ var m = /([a-z0-9$_]+)(=|@|>|%)([a-z0-9$_]+)/i.exec(prop);
+ if (!m) throw new Error("Can't understand property map: " + prop);
+ var moz = m[1], how = m[2], my = m[3];
+ moz_to_me += ",\n" + my + ": ";
+ me_to_moz += ",\n" + moz + ": ";
+ switch (how) {
+ case "@":
+ moz_to_me += "M." + moz + ".map(from_moz)";
+ me_to_moz += "M." + my + ".map(to_moz)";
+ break;
+ case ">":
+ moz_to_me += "from_moz(M." + moz + ")";
+ me_to_moz += "to_moz(M." + my + ")";
+ break;
+ case "=":
+ moz_to_me += "M." + moz;
+ me_to_moz += "M." + my;
+ break;
+ case "%":
+ moz_to_me += "from_moz(M." + moz + ").body";
+ me_to_moz += "to_moz_block(M)";
+ break;
+ default:
+ throw new Error("Can't understand operator in propmap: " + prop);
+ }
+ });
+
+ moz_to_me += "\n})\n}";
+ me_to_moz += "\n}\n}";
+
+ //moz_to_me = parse(moz_to_me).print_to_string({ beautify: true });
+ //me_to_moz = parse(me_to_moz).print_to_string({ beautify: true });
+ //console.log(moz_to_me);
+
+ moz_to_me = new Function("my_start_token", "my_end_token", "from_moz", "return(" + moz_to_me + ")")(
+ my_start_token, my_end_token, from_moz
+ );
+ me_to_moz = new Function("to_moz", "to_moz_block", "return(" + me_to_moz + ")")(
+ to_moz, to_moz_block
+ );
+ MOZ_TO_ME[moztype] = moz_to_me;
+ def_to_moz(mytype, me_to_moz);
+ };
+
+ var FROM_MOZ_STACK = null;
+
+ function from_moz(node) {
+ FROM_MOZ_STACK.push(node);
+ var ret = node != null ? MOZ_TO_ME[node.type](node) : null;
+ FROM_MOZ_STACK.pop();
+ return ret;
+ };
+
+ AST_Node.from_mozilla_ast = function(node){
+ var save_stack = FROM_MOZ_STACK;
+ FROM_MOZ_STACK = [];
+ var ast = from_moz(node);
+ FROM_MOZ_STACK = save_stack;
+ return ast;
+ };
+
+ function moz_sub_loc(token) {
+ return token.line ? {
+ line: token.line,
+ column: token.col
+ } : null;
+ };
+
+ function set_moz_loc(mynode, moznode) {
+ var start = mynode.start;
+ var end = mynode.end;
+ if (start.pos != null && end.pos != null) {
+ moznode.range = [start.pos, end.pos];
+ }
+ if (start.line) {
+ moznode.loc = {
+ start: moz_sub_loc(start),
+ end: moz_sub_loc(end)
+ };
+ if (start.file) {
+ moznode.loc.source = start.file;
+ }
+ }
+ return moznode;
+ };
+
+ function def_to_moz(mytype, handler) {
+ mytype.DEFMETHOD("to_mozilla_ast", function() {
+ return set_moz_loc(this, handler(this));
+ });
+ };
+
+ function to_moz(node) {
+ return node != null ? node.to_mozilla_ast() : null;
+ };
+
+ function to_moz_block(node) {
+ return {
+ type: "BlockStatement",
+ body: node.body.map(to_moz)
+ };
+ };
+
+})();
+
+AST_Node.warn_function = function(txt) { logger.error("uglifyjs2 WARN: " + txt); };
+exports.minify = function(files, options, name) {
+ options = defaults(options, {
+ spidermonkey : false,
+ outSourceMap : null,
+ sourceRoot : null,
+ inSourceMap : null,
+ fromString : false,
+ warnings : false,
+ mangle : {},
+ output : null,
+ compress : {}
+ });
+ base54.reset();
+
+ // 1. parse
+ var toplevel = null,
+ sourcesContent = {};
+
+ if (options.spidermonkey) {
+ toplevel = AST_Node.from_mozilla_ast(files);
+ } else {
+ if (typeof files == "string")
+ files = [ files ];
+ files.forEach(function(file){
+ var code = options.fromString
+ ? file
+ : rjsFile.readFile(file, "utf8");
+ sourcesContent[file] = code;
+ toplevel = parse(code, {
+ filename: options.fromString ? name : file,
+ toplevel: toplevel
+ });
+ });
+ }
+
+ // 2. compress
+ if (options.compress) {
+ var compress = { warnings: options.warnings };
+ merge(compress, options.compress);
+ toplevel.figure_out_scope();
+ var sq = Compressor(compress);
+ toplevel = toplevel.transform(sq);
+ }
+
+ // 3. mangle
+ if (options.mangle) {
+ toplevel.figure_out_scope();
+ toplevel.compute_char_frequency();
+ toplevel.mangle_names(options.mangle);
+ }
+
+ // 4. output
+ var inMap = options.inSourceMap;
+ var output = {};
+ if (typeof options.inSourceMap == "string") {
+ inMap = rjsFile.readFile(options.inSourceMap, "utf8");
+ }
+ if (options.outSourceMap) {
+ output.source_map = SourceMap({
+ file: options.outSourceMap,
+ orig: inMap,
+ root: options.sourceRoot
+ });
+ if (options.sourceMapIncludeSources) {
+ for (var file in sourcesContent) {
+ if (sourcesContent.hasOwnProperty(file)) {
+ output.source_map.get().setSourceContent(file, sourcesContent[file]);
+ }
+ }
+ }
+
+ }
+ if (options.output) {
+ merge(output, options.output);
+ }
+ var stream = OutputStream(output);
+ toplevel.print(stream);
+
+ if(options.outSourceMap){
+ stream += "\n//# sourceMappingURL=" + options.outSourceMap;
+ }
+
+ return {
+ code : stream + "",
+ map : output.source_map + ""
+ };
+};
+
+// exports.describe_ast = function() {
+// function doitem(ctor) {
+// var sub = {};
+// ctor.SUBCLASSES.forEach(function(ctor){
+// sub[ctor.TYPE] = doitem(ctor);
+// });
+// var ret = {};
+// if (ctor.SELF_PROPS.length > 0) ret.props = ctor.SELF_PROPS;
+// if (ctor.SUBCLASSES.length > 0) ret.sub = sub;
+// return ret;
+// }
+// return doitem(AST_Node).sub;
+// }
+
+exports.describe_ast = function() {
+ var out = OutputStream({ beautify: true });
+ function doitem(ctor) {
+ out.print("AST_" + ctor.TYPE);
+ var props = ctor.SELF_PROPS.filter(function(prop){
+ return !/^\$/.test(prop);
+ });
+ if (props.length > 0) {
+ out.space();
+ out.with_parens(function(){
+ props.forEach(function(prop, i){
+ if (i) out.space();
+ out.print(prop);
+ });
+ });
+ }
+ if (ctor.documentation) {
+ out.space();
+ out.print_string(ctor.documentation);
+ }
+ if (ctor.SUBCLASSES.length > 0) {
+ out.space();
+ out.with_block(function(){
+ ctor.SUBCLASSES.forEach(function(ctor, i){
+ out.indent();
+ doitem(ctor);
+ out.newline();
+ });
+ });
+ }
+ };
+ doitem(AST_Node);
+ return out + "";
+};
+
+
+});
+/**
+ * @license Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+
+/*jslint plusplus: true */
+/*global define: false */
+
+define('parse', ['./esprimaAdapter', 'lang'], function (esprima, lang) {
+ 'use strict';
+
+ function arrayToString(ary) {
+ var output = '[';
+ if (ary) {
+ ary.forEach(function (item, i) {
+ output += (i > 0 ? ',' : '') + '"' + lang.jsEscape(item) + '"';
+ });
+ }
+ output += ']';
+
+ return output;
+ }
+
+ //This string is saved off because JSLint complains
+ //about obj.arguments use, as 'reserved word'
+ var argPropName = 'arguments',
+ //Default object to use for "scope" checking for UMD identifiers.
+ emptyScope = {},
+ mixin = lang.mixin,
+ hasProp = lang.hasProp;
+
+ //From an esprima example for traversing its ast.
+ function traverse(object, visitor) {
+ var key, child;
+
+ if (!object) {
+ return;
+ }
+
+ if (visitor.call(null, object) === false) {
+ return false;
+ }
+ for (key in object) {
+ if (object.hasOwnProperty(key)) {
+ child = object[key];
+ if (typeof child === 'object' && child !== null) {
+ if (traverse(child, visitor) === false) {
+ return false;
+ }
+ }
+ }
+ }
+ }
+
+ //Like traverse, but visitor returning false just
+ //stops that subtree analysis, not the rest of tree
+ //visiting.
+ function traverseBroad(object, visitor) {
+ var key, child;
+
+ if (!object) {
+ return;
+ }
+
+ if (visitor.call(null, object) === false) {
+ return false;
+ }
+ for (key in object) {
+ if (object.hasOwnProperty(key)) {
+ child = object[key];
+ if (typeof child === 'object' && child !== null) {
+ traverseBroad(child, visitor);
+ }
+ }
+ }
+ }
+
+ /**
+ * Pulls out dependencies from an array literal with just string members.
+ * If string literals, will just return those string values in an array,
+ * skipping other items in the array.
+ *
+ * @param {Node} node an AST node.
+ *
+ * @returns {Array} an array of strings.
+ * If null is returned, then it means the input node was not a valid
+ * dependency.
+ */
+ function getValidDeps(node) {
+ if (!node || node.type !== 'ArrayExpression' || !node.elements) {
+ return;
+ }
+
+ var deps = [];
+
+ node.elements.some(function (elem) {
+ if (elem.type === 'Literal') {
+ deps.push(elem.value);
+ }
+ });
+
+ return deps.length ? deps : undefined;
+ }
+
+ // Detects regular or arrow function expressions as the desired expression
+ // type.
+ function isFnExpression(node) {
+ return (node && (node.type === 'FunctionExpression' ||
+ node.type === 'ArrowFunctionExpression'));
+ }
+
+ /**
+ * Main parse function. Returns a string of any valid require or
+ * define/require.def calls as part of one JavaScript source string.
+ * @param {String} moduleName the module name that represents this file.
+ * It is used to create a default define if there is not one already for the
+ * file. This allows properly tracing dependencies for builds. Otherwise, if
+ * the file just has a require() call, the file dependencies will not be
+ * properly reflected: the file will come before its dependencies.
+ * @param {String} moduleName
+ * @param {String} fileName
+ * @param {String} fileContents
+ * @param {Object} options optional options. insertNeedsDefine: true will
+ * add calls to require.needsDefine() if appropriate.
+ * @returns {String} JS source string or null, if no require or
+ * define/require.def calls are found.
+ */
+ function parse(moduleName, fileName, fileContents, options) {
+ options = options || {};
+
+ //Set up source input
+ var i, moduleCall, depString,
+ moduleDeps = [],
+ result = '',
+ moduleList = [],
+ needsDefine = true,
+ astRoot = esprima.parse(fileContents);
+
+ parse.recurse(astRoot, function (callName, config, name, deps, node, factoryIdentifier, fnExpScope) {
+ if (!deps) {
+ deps = [];
+ }
+
+ if (callName === 'define' && (!name || name === moduleName)) {
+ needsDefine = false;
+ }
+
+ if (!name) {
+ //If there is no module name, the dependencies are for
+ //this file/default module name.
+ moduleDeps = moduleDeps.concat(deps);
+ } else {
+ moduleList.push({
+ name: name,
+ deps: deps
+ });
+ }
+
+ if (callName === 'define' && factoryIdentifier && hasProp(fnExpScope, factoryIdentifier)) {
+ return factoryIdentifier;
+ }
+
+ //If define was found, no need to dive deeper, unless
+ //the config explicitly wants to dig deeper.
+ return !!options.findNestedDependencies;
+ }, options);
+
+ if (options.insertNeedsDefine && needsDefine) {
+ result += 'require.needsDefine("' + moduleName + '");';
+ }
+
+ if (moduleDeps.length || moduleList.length) {
+ for (i = 0; i < moduleList.length; i++) {
+ moduleCall = moduleList[i];
+ if (result) {
+ result += '\n';
+ }
+
+ //If this is the main module for this file, combine any
+ //"anonymous" dependencies (could come from a nested require
+ //call) with this module.
+ if (moduleCall.name === moduleName) {
+ moduleCall.deps = moduleCall.deps.concat(moduleDeps);
+ moduleDeps = [];
+ }
+
+ depString = arrayToString(moduleCall.deps);
+ result += 'define("' + moduleCall.name + '",' +
+ depString + ');';
+ }
+ if (moduleDeps.length) {
+ if (result) {
+ result += '\n';
+ }
+ depString = arrayToString(moduleDeps);
+ result += 'define("' + moduleName + '",' + depString + ');';
+ }
+ }
+
+ return result || null;
+ }
+
+ parse.traverse = traverse;
+ parse.traverseBroad = traverseBroad;
+ parse.isFnExpression = isFnExpression;
+
+ /**
+ * Handles parsing a file recursively for require calls.
+ * @param {Array} parentNode the AST node to start with.
+ * @param {Function} onMatch function to call on a parse match.
+ * @param {Object} [options] This is normally the build config options if
+ * it is passed.
+ * @param {Object} [fnExpScope] holds list of function expresssion
+ * argument identifiers, set up internally, not passed in
+ */
+ parse.recurse = function (object, onMatch, options, fnExpScope) {
+ //Like traverse, but skips if branches that would not be processed
+ //after has application that results in tests of true or false boolean
+ //literal values.
+ var key, child, result, i, params, param, tempObject,
+ hasHas = options && options.has;
+
+ fnExpScope = fnExpScope || emptyScope;
+
+ if (!object) {
+ return;
+ }
+
+ //If has replacement has resulted in if(true){} or if(false){}, take
+ //the appropriate branch and skip the other one.
+ if (hasHas && object.type === 'IfStatement' && object.test.type &&
+ object.test.type === 'Literal') {
+ if (object.test.value) {
+ //Take the if branch
+ this.recurse(object.consequent, onMatch, options, fnExpScope);
+ } else {
+ //Take the else branch
+ this.recurse(object.alternate, onMatch, options, fnExpScope);
+ }
+ } else {
+ result = this.parseNode(object, onMatch, fnExpScope);
+ if (result === false) {
+ return;
+ } else if (typeof result === 'string') {
+ return result;
+ }
+
+ //Build up a "scope" object that informs nested recurse calls if
+ //the define call references an identifier that is likely a UMD
+ //wrapped function expression argument.
+ //Catch (function(a) {... wrappers
+ if (object.type === 'ExpressionStatement' && object.expression &&
+ object.expression.type === 'CallExpression' && object.expression.callee &&
+ isFnExpression(object.expression.callee)) {
+ tempObject = object.expression.callee;
+ }
+ // Catch !function(a) {... wrappers
+ if (object.type === 'UnaryExpression' && object.argument &&
+ object.argument.type === 'CallExpression' && object.argument.callee &&
+ isFnExpression(object.argument.callee)) {
+ tempObject = object.argument.callee;
+ }
+ if (tempObject && tempObject.params && tempObject.params.length) {
+ params = tempObject.params;
+ fnExpScope = mixin({}, fnExpScope, true);
+ for (i = 0; i < params.length; i++) {
+ param = params[i];
+ if (param.type === 'Identifier') {
+ fnExpScope[param.name] = true;
+ }
+ }
+ }
+
+ for (key in object) {
+ if (object.hasOwnProperty(key)) {
+ child = object[key];
+ if (typeof child === 'object' && child !== null) {
+ result = this.recurse(child, onMatch, options, fnExpScope);
+ if (typeof result === 'string') {
+ break;
+ }
+ }
+ }
+ }
+
+ //Check for an identifier for a factory function identifier being
+ //passed in as a function expression, indicating a UMD-type of
+ //wrapping.
+ if (typeof result === 'string') {
+ if (hasProp(fnExpScope, result)) {
+ //result still in scope, keep jumping out indicating the
+ //identifier still in use.
+ return result;
+ }
+
+ return;
+ }
+ }
+ };
+
+ /**
+ * Determines if the file defines the require/define module API.
+ * Specifically, it looks for the `define.amd = ` expression.
+ * @param {String} fileName
+ * @param {String} fileContents
+ * @returns {Boolean}
+ */
+ parse.definesRequire = function (fileName, fileContents) {
+ var found = false;
+
+ traverse(esprima.parse(fileContents), function (node) {
+ if (parse.hasDefineAmd(node)) {
+ found = true;
+
+ //Stop traversal
+ return false;
+ }
+ });
+
+ return found;
+ };
+
+ /**
+ * Finds require("") calls inside a CommonJS anonymous module wrapped in a
+ * define(function(require, exports, module){}) wrapper. These dependencies
+ * will be added to a modified define() call that lists the dependencies
+ * on the outside of the function.
+ * @param {String} fileName
+ * @param {String|Object} fileContents: a string of contents, or an already
+ * parsed AST tree.
+ * @returns {Array} an array of module names that are dependencies. Always
+ * returns an array, but could be of length zero.
+ */
+ parse.getAnonDeps = function (fileName, fileContents) {
+ var astRoot = typeof fileContents === 'string' ?
+ esprima.parse(fileContents) : fileContents,
+ defFunc = this.findAnonDefineFactory(astRoot);
+
+ return parse.getAnonDepsFromNode(defFunc);
+ };
+
+ /**
+ * Finds require("") calls inside a CommonJS anonymous module wrapped
+ * in a define function, given an AST node for the definition function.
+ * @param {Node} node the AST node for the definition function.
+ * @returns {Array} and array of dependency names. Can be of zero length.
+ */
+ parse.getAnonDepsFromNode = function (node) {
+ var deps = [],
+ funcArgLength;
+
+ if (node) {
+ this.findRequireDepNames(node, deps);
+
+ //If no deps, still add the standard CommonJS require, exports,
+ //module, in that order, to the deps, but only if specified as
+ //function args. In particular, if exports is used, it is favored
+ //over the return value of the function, so only add it if asked.
+ funcArgLength = node.params && node.params.length;
+ if (funcArgLength) {
+ deps = (funcArgLength > 1 ? ["require", "exports", "module"] :
+ ["require"]).concat(deps);
+ }
+ }
+ return deps;
+ };
+
+ parse.isDefineNodeWithArgs = function (node) {
+ return node && node.type === 'CallExpression' &&
+ node.callee && node.callee.type === 'Identifier' &&
+ node.callee.name === 'define' && node[argPropName];
+ };
+
+ /**
+ * Finds the function in define(function (require, exports, module){});
+ * @param {Array} node
+ * @returns {Boolean}
+ */
+ parse.findAnonDefineFactory = function (node) {
+ var match;
+
+ traverse(node, function (node) {
+ var arg0, arg1;
+
+ if (parse.isDefineNodeWithArgs(node)) {
+
+ //Just the factory function passed to define
+ arg0 = node[argPropName][0];
+ if (isFnExpression(arg0)) {
+ match = arg0;
+ return false;
+ }
+
+ //A string literal module ID followed by the factory function.
+ arg1 = node[argPropName][1];
+ if (arg0.type === 'Literal' && isFnExpression(arg1)) {
+ match = arg1;
+ return false;
+ }
+ }
+ });
+
+ return match;
+ };
+
+ /**
+ * Finds any config that is passed to requirejs. That includes calls to
+ * require/requirejs.config(), as well as require({}, ...) and
+ * requirejs({}, ...)
+ * @param {String} fileContents
+ *
+ * @returns {Object} a config details object with the following properties:
+ * - config: {Object} the config object found. Can be undefined if no
+ * config found.
+ * - range: {Array} the start index and end index in the contents where
+ * the config was found. Can be undefined if no config found.
+ * Can throw an error if the config in the file cannot be evaluated in
+ * a build context to valid JavaScript.
+ */
+ parse.findConfig = function (fileContents) {
+ /*jslint evil: true */
+ var jsConfig, foundConfig, stringData, foundRange, quote, quoteMatch,
+ quoteRegExp = /(:\s|\[\s*)(['"])/,
+ astRoot = esprima.parse(fileContents, {
+ loc: true
+ });
+
+ traverse(astRoot, function (node) {
+ var arg,
+ requireType = parse.hasRequire(node);
+
+ if (requireType && (requireType === 'require' ||
+ requireType === 'requirejs' ||
+ requireType === 'requireConfig' ||
+ requireType === 'requirejsConfig')) {
+
+ arg = node[argPropName] && node[argPropName][0];
+
+ if (arg && arg.type === 'ObjectExpression') {
+ stringData = parse.nodeToString(fileContents, arg);
+ jsConfig = stringData.value;
+ foundRange = stringData.range;
+ return false;
+ }
+ } else {
+ arg = parse.getRequireObjectLiteral(node);
+ if (arg) {
+ stringData = parse.nodeToString(fileContents, arg);
+ jsConfig = stringData.value;
+ foundRange = stringData.range;
+ return false;
+ }
+ }
+ });
+
+ if (jsConfig) {
+ // Eval the config
+ quoteMatch = quoteRegExp.exec(jsConfig);
+ quote = (quoteMatch && quoteMatch[2]) || '"';
+ foundConfig = eval('(' + jsConfig + ')');
+ }
+
+ return {
+ config: foundConfig,
+ range: foundRange,
+ quote: quote
+ };
+ };
+
+ /** Returns the node for the object literal assigned to require/requirejs,
+ * for holding a declarative config.
+ */
+ parse.getRequireObjectLiteral = function (node) {
+ if (node.id && node.id.type === 'Identifier' &&
+ (node.id.name === 'require' || node.id.name === 'requirejs') &&
+ node.init && node.init.type === 'ObjectExpression') {
+ return node.init;
+ }
+ };
+
+ /**
+ * Renames require/requirejs/define calls to be ns + '.' + require/requirejs/define
+ * Does *not* do .config calls though. See pragma.namespace for the complete
+ * set of namespace transforms. This function is used because require calls
+ * inside a define() call should not be renamed, so a simple regexp is not
+ * good enough.
+ * @param {String} fileContents the contents to transform.
+ * @param {String} ns the namespace, *not* including trailing dot.
+ * @return {String} the fileContents with the namespace applied
+ */
+ parse.renameNamespace = function (fileContents, ns) {
+ var lines,
+ locs = [],
+ astRoot = esprima.parse(fileContents, {
+ loc: true
+ });
+
+ parse.recurse(astRoot, function (callName, config, name, deps, node) {
+ locs.push(node.loc);
+ //Do not recurse into define functions, they should be using
+ //local defines.
+ return callName !== 'define';
+ }, {});
+
+ if (locs.length) {
+ lines = fileContents.split('\n');
+
+ //Go backwards through the found locs, adding in the namespace name
+ //in front.
+ locs.reverse();
+ locs.forEach(function (loc) {
+ var startIndex = loc.start.column,
+ //start.line is 1-based, not 0 based.
+ lineIndex = loc.start.line - 1,
+ line = lines[lineIndex];
+
+ lines[lineIndex] = line.substring(0, startIndex) +
+ ns + '.' +
+ line.substring(startIndex,
+ line.length);
+ });
+
+ fileContents = lines.join('\n');
+ }
+
+ return fileContents;
+ };
+
+ /**
+ * Finds all dependencies specified in dependency arrays and inside
+ * simplified commonjs wrappers.
+ * @param {String} fileName
+ * @param {String} fileContents
+ *
+ * @returns {Array} an array of dependency strings. The dependencies
+ * have not been normalized, they may be relative IDs.
+ */
+ parse.findDependencies = function (fileName, fileContents, options) {
+ var dependencies = [],
+ astRoot = esprima.parse(fileContents);
+
+ parse.recurse(astRoot, function (callName, config, name, deps) {
+ if (deps) {
+ dependencies = dependencies.concat(deps);
+ }
+ }, options);
+
+ return dependencies;
+ };
+
+ /**
+ * Finds only CJS dependencies, ones that are the form
+ * require('stringLiteral')
+ */
+ parse.findCjsDependencies = function (fileName, fileContents) {
+ var dependencies = [];
+
+ traverse(esprima.parse(fileContents), function (node) {
+ var arg;
+
+ if (node && node.type === 'CallExpression' && node.callee &&
+ node.callee.type === 'Identifier' &&
+ node.callee.name === 'require' && node[argPropName] &&
+ node[argPropName].length === 1) {
+ arg = node[argPropName][0];
+ if (arg.type === 'Literal') {
+ dependencies.push(arg.value);
+ }
+ }
+ });
+
+ return dependencies;
+ };
+
+ //function define() {}
+ parse.hasDefDefine = function (node) {
+ return node.type === 'FunctionDeclaration' && node.id &&
+ node.id.type === 'Identifier' && node.id.name === 'define';
+ };
+
+ //define.amd = ...
+ parse.hasDefineAmd = function (node) {
+ return node && node.type === 'AssignmentExpression' &&
+ node.left && node.left.type === 'MemberExpression' &&
+ node.left.object && node.left.object.name === 'define' &&
+ node.left.property && node.left.property.name === 'amd';
+ };
+
+ //define.amd reference, as in: if (define.amd)
+ parse.refsDefineAmd = function (node) {
+ return node && node.type === 'MemberExpression' &&
+ node.object && node.object.name === 'define' &&
+ node.object.type === 'Identifier' &&
+ node.property && node.property.name === 'amd' &&
+ node.property.type === 'Identifier';
+ };
+
+ //require(), requirejs(), require.config() and requirejs.config()
+ parse.hasRequire = function (node) {
+ var callName,
+ c = node && node.callee;
+
+ if (node && node.type === 'CallExpression' && c) {
+ if (c.type === 'Identifier' &&
+ (c.name === 'require' ||
+ c.name === 'requirejs')) {
+ //A require/requirejs({}, ...) call
+ callName = c.name;
+ } else if (c.type === 'MemberExpression' &&
+ c.object &&
+ c.object.type === 'Identifier' &&
+ (c.object.name === 'require' ||
+ c.object.name === 'requirejs') &&
+ c.property && c.property.name === 'config') {
+ // require/requirejs.config({}) call
+ callName = c.object.name + 'Config';
+ }
+ }
+
+ return callName;
+ };
+
+ //define()
+ parse.hasDefine = function (node) {
+ return node && node.type === 'CallExpression' && node.callee &&
+ node.callee.type === 'Identifier' &&
+ node.callee.name === 'define';
+ };
+
+ /**
+ * If there is a named define in the file, returns the name. Does not
+ * scan for mulitple names, just the first one.
+ */
+ parse.getNamedDefine = function (fileContents) {
+ var name;
+ traverse(esprima.parse(fileContents), function (node) {
+ if (node && node.type === 'CallExpression' && node.callee &&
+ node.callee.type === 'Identifier' &&
+ node.callee.name === 'define' &&
+ node[argPropName] && node[argPropName][0] &&
+ node[argPropName][0].type === 'Literal') {
+ name = node[argPropName][0].value;
+ return false;
+ }
+ });
+
+ return name;
+ };
+
+ /**
+ * Determines if define(), require({}|[]) or requirejs was called in the
+ * file. Also finds out if define() is declared and if define.amd is called.
+ */
+ parse.usesAmdOrRequireJs = function (fileName, fileContents) {
+ var uses;
+
+ traverse(esprima.parse(fileContents), function (node) {
+ var type, callName, arg;
+
+ if (parse.hasDefDefine(node)) {
+ //function define() {}
+ type = 'declaresDefine';
+ } else if (parse.hasDefineAmd(node)) {
+ type = 'defineAmd';
+ } else {
+ callName = parse.hasRequire(node);
+ if (callName) {
+ arg = node[argPropName] && node[argPropName][0];
+ if (arg && (arg.type === 'ObjectExpression' ||
+ arg.type === 'ArrayExpression')) {
+ type = callName;
+ }
+ } else if (parse.hasDefine(node)) {
+ type = 'define';
+ }
+ }
+
+ if (type) {
+ if (!uses) {
+ uses = {};
+ }
+ uses[type] = true;
+ }
+ });
+
+ return uses;
+ };
+
+ /**
+ * Determines if require(''), exports.x =, module.exports =,
+ * __dirname, __filename are used. So, not strictly traditional CommonJS,
+ * also checks for Node variants.
+ */
+ parse.usesCommonJs = function (fileName, fileContents) {
+ var uses = null,
+ assignsExports = false;
+
+
+ traverse(esprima.parse(fileContents), function (node) {
+ var type,
+ exp = node.expression || node.init;
+
+ if (node.type === 'Identifier' &&
+ (node.name === '__dirname' || node.name === '__filename')) {
+ type = node.name.substring(2);
+ } else if (node.type === 'VariableDeclarator' && node.id &&
+ node.id.type === 'Identifier' &&
+ node.id.name === 'exports') {
+ //Hmm, a variable assignment for exports, so does not use cjs
+ //exports.
+ type = 'varExports';
+ } else if (exp && exp.type === 'AssignmentExpression' && exp.left &&
+ exp.left.type === 'MemberExpression' && exp.left.object) {
+ if (exp.left.object.name === 'module' && exp.left.property &&
+ exp.left.property.name === 'exports') {
+ type = 'moduleExports';
+ } else if (exp.left.object.name === 'exports' &&
+ exp.left.property) {
+ type = 'exports';
+ }
+
+ } else if (node && node.type === 'CallExpression' && node.callee &&
+ node.callee.type === 'Identifier' &&
+ node.callee.name === 'require' && node[argPropName] &&
+ node[argPropName].length === 1 &&
+ node[argPropName][0].type === 'Literal') {
+ type = 'require';
+ }
+
+ if (type) {
+ if (type === 'varExports') {
+ assignsExports = true;
+ } else if (type !== 'exports' || !assignsExports) {
+ if (!uses) {
+ uses = {};
+ }
+ uses[type] = true;
+ }
+ }
+ });
+
+ return uses;
+ };
+
+
+ parse.findRequireDepNames = function (node, deps) {
+ traverse(node, function (node) {
+ var arg;
+
+ if (node && node.type === 'CallExpression' && node.callee &&
+ node.callee.type === 'Identifier' &&
+ node.callee.name === 'require' &&
+ node[argPropName] && node[argPropName].length === 1) {
+
+ arg = node[argPropName][0];
+ if (arg.type === 'Literal') {
+ deps.push(arg.value);
+ }
+ }
+ });
+ };
+
+ /**
+ * Determines if a specific node is a valid require or define/require.def
+ * call.
+ * @param {Array} node
+ * @param {Function} onMatch a function to call when a match is found.
+ * It is passed the match name, and the config, name, deps possible args.
+ * The config, name and deps args are not normalized.
+ * @param {Object} fnExpScope an object whose keys are all function
+ * expression identifiers that should be in scope. Useful for UMD wrapper
+ * detection to avoid parsing more into the wrapped UMD code.
+ *
+ * @returns {String} a JS source string with the valid require/define call.
+ * Otherwise null.
+ */
+ parse.parseNode = function (node, onMatch, fnExpScope) {
+ var name, deps, cjsDeps, arg, factory, exp, refsDefine, bodyNode,
+ args = node && node[argPropName],
+ callName = parse.hasRequire(node);
+
+ if (callName === 'require' || callName === 'requirejs') {
+ //A plain require/requirejs call
+ arg = node[argPropName] && node[argPropName][0];
+ if (arg && arg.type !== 'ArrayExpression') {
+ if (arg.type === 'ObjectExpression') {
+ //A config call, try the second arg.
+ arg = node[argPropName][1];
+ }
+ }
+
+ deps = getValidDeps(arg);
+ if (!deps) {
+ return;
+ }
+
+ return onMatch("require", null, null, deps, node);
+ } else if (parse.hasDefine(node) && args && args.length) {
+ name = args[0];
+ deps = args[1];
+ factory = args[2];
+
+ if (name.type === 'ArrayExpression') {
+ //No name, adjust args
+ factory = deps;
+ deps = name;
+ name = null;
+ } else if (isFnExpression(name)) {
+ //Just the factory, no name or deps
+ factory = name;
+ name = deps = null;
+ } else if (name.type !== 'Literal') {
+ //An object literal, just null out
+ name = deps = factory = null;
+ }
+
+ if (name && name.type === 'Literal' && deps) {
+ if (isFnExpression(deps)) {
+ //deps is the factory
+ factory = deps;
+ deps = null;
+ } else if (deps.type === 'ObjectExpression') {
+ //deps is object literal, null out
+ deps = factory = null;
+ } else if (deps.type === 'Identifier' && args.length === 2) {
+ // define('id', factory)
+ deps = factory = null;
+ }
+ }
+
+ if (deps && deps.type === 'ArrayExpression') {
+ deps = getValidDeps(deps);
+ } else if (isFnExpression(factory)) {
+ //If no deps and a factory function, could be a commonjs sugar
+ //wrapper, scan the function for dependencies.
+ cjsDeps = parse.getAnonDepsFromNode(factory);
+ if (cjsDeps.length) {
+ deps = cjsDeps;
+ }
+ } else if (deps || factory) {
+ //Does not match the shape of an AMD call.
+ return;
+ }
+
+ //Just save off the name as a string instead of an AST object.
+ if (name && name.type === 'Literal') {
+ name = name.value;
+ }
+
+ return onMatch("define", null, name, deps, node,
+ (factory && factory.type === 'Identifier' ? factory.name : undefined),
+ fnExpScope);
+ } else if (node.type === 'CallExpression' && node.callee &&
+ isFnExpression(node.callee) &&
+ node.callee.body && node.callee.body.body &&
+ node.callee.body.body.length === 1 &&
+ node.callee.body.body[0].type === 'IfStatement') {
+ bodyNode = node.callee.body.body[0];
+ //Look for a define(Identifier) case, but only if inside an
+ //if that has a define.amd test
+ if (bodyNode.consequent && bodyNode.consequent.body) {
+ exp = bodyNode.consequent.body[0];
+ if (exp.type === 'ExpressionStatement' && exp.expression &&
+ parse.hasDefine(exp.expression) &&
+ exp.expression.arguments &&
+ exp.expression.arguments.length === 1 &&
+ exp.expression.arguments[0].type === 'Identifier') {
+
+ //Calls define(Identifier) as first statement in body.
+ //Confirm the if test references define.amd
+ traverse(bodyNode.test, function (node) {
+ if (parse.refsDefineAmd(node)) {
+ refsDefine = true;
+ return false;
+ }
+ });
+
+ if (refsDefine) {
+ return onMatch("define", null, null, null, exp.expression,
+ exp.expression.arguments[0].name, fnExpScope);
+ }
+ }
+ }
+ }
+ };
+
+ /**
+ * Converts an AST node into a JS source string by extracting
+ * the node's location from the given contents string. Assumes
+ * esprima.parse() with loc was done.
+ * @param {String} contents
+ * @param {Object} node
+ * @returns {String} a JS source string.
+ */
+ parse.nodeToString = function (contents, node) {
+ var extracted,
+ loc = node.loc,
+ lines = contents.split('\n'),
+ firstLine = loc.start.line > 1 ?
+ lines.slice(0, loc.start.line - 1).join('\n') + '\n' :
+ '',
+ preamble = firstLine +
+ lines[loc.start.line - 1].substring(0, loc.start.column);
+
+ if (loc.start.line === loc.end.line) {
+ extracted = lines[loc.start.line - 1].substring(loc.start.column,
+ loc.end.column);
+ } else {
+ extracted = lines[loc.start.line - 1].substring(loc.start.column) +
+ '\n' +
+ lines.slice(loc.start.line, loc.end.line - 1).join('\n') +
+ '\n' +
+ lines[loc.end.line - 1].substring(0, loc.end.column);
+ }
+
+ return {
+ value: extracted,
+ range: [
+ preamble.length,
+ preamble.length + extracted.length
+ ]
+ };
+ };
+
+ /**
+ * Extracts license comments from JS text.
+ * @param {String} fileName
+ * @param {String} contents
+ * @returns {String} a string of license comments.
+ */
+ parse.getLicenseComments = function (fileName, contents) {
+ var commentNode, refNode, subNode, value, i, j,
+ //xpconnect's Reflect does not support comment or range, but
+ //prefer continued operation vs strict parity of operation,
+ //as license comments can be expressed in other ways, like
+ //via wrap args, or linked via sourcemaps.
+ ast = esprima.parse(contents, {
+ comment: true,
+ range: true
+ }),
+ result = '',
+ existsMap = {},
+ lineEnd = contents.indexOf('\r') === -1 ? '\n' : '\r\n';
+
+ if (ast.comments) {
+ for (i = 0; i < ast.comments.length; i++) {
+ commentNode = ast.comments[i];
+
+ if (commentNode.type === 'Line') {
+ value = '//' + commentNode.value + lineEnd;
+ refNode = commentNode;
+
+ if (i + 1 >= ast.comments.length) {
+ value += lineEnd;
+ } else {
+ //Look for immediately adjacent single line comments
+ //since it could from a multiple line comment made out
+ //of single line comments. Like this comment.
+ for (j = i + 1; j < ast.comments.length; j++) {
+ subNode = ast.comments[j];
+ if (subNode.type === 'Line' &&
+ subNode.range[0] === refNode.range[1] + 1) {
+ //Adjacent single line comment. Collect it.
+ value += '//' + subNode.value + lineEnd;
+ refNode = subNode;
+ } else {
+ //No more single line comment blocks. Break out
+ //and continue outer looping.
+ break;
+ }
+ }
+ value += lineEnd;
+ i = j - 1;
+ }
+ } else {
+ value = '/*' + commentNode.value + '*/' + lineEnd + lineEnd;
+ }
+
+ if (!existsMap[value] && (value.indexOf('license') !== -1 ||
+ (commentNode.type === 'Block' &&
+ value.indexOf('/*!') === 0) ||
+ value.indexOf('opyright') !== -1 ||
+ value.indexOf('(c)') !== -1)) {
+
+ result += value;
+ existsMap[value] = true;
+ }
+
+ }
+ }
+
+ return result;
+ };
+
+ return parse;
+});
+/**
+ * @license Copyright (c) 2012-2014, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+
+/*global define */
+
+define('transform', [ './esprimaAdapter', './parse', 'logger', 'lang'],
+function (esprima, parse, logger, lang) {
+ 'use strict';
+ var transform,
+ baseIndentRegExp = /^([ \t]+)/,
+ indentRegExp = /\{[\r\n]+([ \t]+)/,
+ keyRegExp = /^[_A-Za-z]([A-Za-z\d_]*)$/,
+ bulkIndentRegExps = {
+ '\n': /\n/g,
+ '\r\n': /\r\n/g
+ };
+
+ function applyIndent(str, indent, lineReturn) {
+ var regExp = bulkIndentRegExps[lineReturn];
+ return str.replace(regExp, '$&' + indent);
+ }
+
+ transform = {
+ toTransport: function (namespace, moduleName, path, contents, onFound, options) {
+ options = options || {};
+
+ var astRoot, contentLines, modLine,
+ foundAnon,
+ scanCount = 0,
+ scanReset = false,
+ defineInfos = [],
+ applySourceUrl = function (contents) {
+ if (options.useSourceUrl) {
+ contents = 'eval("' + lang.jsEscape(contents) +
+ '\\n//# sourceURL=' + (path.indexOf('/') === 0 ? '' : '/') +
+ path +
+ '");\n';
+ }
+ return contents;
+ };
+
+ try {
+ astRoot = esprima.parse(contents, {
+ loc: true
+ });
+ } catch (e) {
+ logger.trace('toTransport skipping ' + path + ': ' +
+ e.toString());
+ return contents;
+ }
+
+ //Find the define calls and their position in the files.
+ parse.traverse(astRoot, function (node) {
+ var args, firstArg, firstArgLoc, factoryNode,
+ needsId, depAction, foundId, init,
+ sourceUrlData, range,
+ namespaceExists = false;
+
+ // If a bundle script with a define declaration, do not
+ // parse any further at this level. Likely a built layer
+ // by some other tool.
+ if (node.type === 'VariableDeclarator' &&
+ node.id && node.id.name === 'define' &&
+ node.id.type === 'Identifier') {
+ init = node.init;
+ if (init && init.callee &&
+ init.callee.type === 'CallExpression' &&
+ init.callee.callee &&
+ init.callee.callee.type === 'Identifier' &&
+ init.callee.callee.name === 'require' &&
+ init.callee.arguments && init.callee.arguments.length === 1 &&
+ init.callee.arguments[0].type === 'Literal' &&
+ init.callee.arguments[0].value &&
+ init.callee.arguments[0].value.indexOf('amdefine') !== -1) {
+ // the var define = require('amdefine')(module) case,
+ // keep going in that case.
+ } else {
+ return false;
+ }
+ }
+
+ namespaceExists = namespace &&
+ node.type === 'CallExpression' &&
+ node.callee && node.callee.object &&
+ node.callee.object.type === 'Identifier' &&
+ node.callee.object.name === namespace &&
+ node.callee.property.type === 'Identifier' &&
+ node.callee.property.name === 'define';
+
+ if (namespaceExists || parse.isDefineNodeWithArgs(node)) {
+ //The arguments are where its at.
+ args = node.arguments;
+ if (!args || !args.length) {
+ return;
+ }
+
+ firstArg = args[0];
+ firstArgLoc = firstArg.loc;
+
+ if (args.length === 1) {
+ if (firstArg.type === 'Identifier') {
+ //The define(factory) case, but
+ //only allow it if one Identifier arg,
+ //to limit impact of false positives.
+ needsId = true;
+ depAction = 'empty';
+ } else if (parse.isFnExpression(firstArg)) {
+ //define(function(){})
+ factoryNode = firstArg;
+ needsId = true;
+ depAction = 'scan';
+ } else if (firstArg.type === 'ObjectExpression') {
+ //define({});
+ needsId = true;
+ depAction = 'skip';
+ } else if (firstArg.type === 'Literal' &&
+ typeof firstArg.value === 'number') {
+ //define('12345');
+ needsId = true;
+ depAction = 'skip';
+ } else if (firstArg.type === 'UnaryExpression' &&
+ firstArg.operator === '-' &&
+ firstArg.argument &&
+ firstArg.argument.type === 'Literal' &&
+ typeof firstArg.argument.value === 'number') {
+ //define('-12345');
+ needsId = true;
+ depAction = 'skip';
+ } else if (firstArg.type === 'MemberExpression' &&
+ firstArg.object &&
+ firstArg.property &&
+ firstArg.property.type === 'Identifier') {
+ //define(this.key);
+ needsId = true;
+ depAction = 'empty';
+ }
+ } else if (firstArg.type === 'ArrayExpression') {
+ //define([], ...);
+ needsId = true;
+ depAction = 'skip';
+ } else if (firstArg.type === 'Literal' &&
+ typeof firstArg.value === 'string') {
+ //define('string', ....)
+ //Already has an ID.
+ needsId = false;
+ if (args.length === 2 &&
+ parse.isFnExpression(args[1])) {
+ //Needs dependency scanning.
+ factoryNode = args[1];
+ depAction = 'scan';
+ } else {
+ depAction = 'skip';
+ }
+ } else {
+ //Unknown define entity, keep looking, even
+ //in the subtree for this node.
+ return;
+ }
+
+ range = {
+ foundId: foundId,
+ needsId: needsId,
+ depAction: depAction,
+ namespaceExists: namespaceExists,
+ node: node,
+ defineLoc: node.loc,
+ firstArgLoc: firstArgLoc,
+ factoryNode: factoryNode,
+ sourceUrlData: sourceUrlData
+ };
+
+ //Only transform ones that do not have IDs. If it has an
+ //ID but no dependency array, assume it is something like
+ //a phonegap implementation, that has its own internal
+ //define that cannot handle dependency array constructs,
+ //and if it is a named module, then it means it has been
+ //set for transport form.
+ if (range.needsId) {
+ if (foundAnon) {
+ logger.trace(path + ' has more than one anonymous ' +
+ 'define. May be a built file from another ' +
+ 'build system like, Ender. Skipping normalization.');
+ defineInfos = [];
+ return false;
+ } else {
+ foundAnon = range;
+ defineInfos.push(range);
+ }
+ } else if (depAction === 'scan') {
+ scanCount += 1;
+ if (scanCount > 1) {
+ //Just go back to an array that just has the
+ //anon one, since this is an already optimized
+ //file like the phonegap one.
+ if (!scanReset) {
+ defineInfos = foundAnon ? [foundAnon] : [];
+ scanReset = true;
+ }
+ } else {
+ defineInfos.push(range);
+ }
+ }
+ }
+ });
+
+
+ if (!defineInfos.length) {
+ return applySourceUrl(contents);
+ }
+
+ //Reverse the matches, need to start from the bottom of
+ //the file to modify it, so that the ranges are still true
+ //further up.
+ defineInfos.reverse();
+
+ contentLines = contents.split('\n');
+
+ modLine = function (loc, contentInsertion) {
+ var startIndex = loc.start.column,
+ //start.line is 1-based, not 0 based.
+ lineIndex = loc.start.line - 1,
+ line = contentLines[lineIndex];
+ contentLines[lineIndex] = line.substring(0, startIndex) +
+ contentInsertion +
+ line.substring(startIndex,
+ line.length);
+ };
+
+ defineInfos.forEach(function (info) {
+ var deps,
+ contentInsertion = '',
+ depString = '';
+
+ //Do the modifications "backwards", in other words, start with the
+ //one that is farthest down and work up, so that the ranges in the
+ //defineInfos still apply. So that means deps, id, then namespace.
+ if (info.needsId && moduleName) {
+ contentInsertion += "'" + moduleName + "',";
+ }
+
+ if (info.depAction === 'scan') {
+ deps = parse.getAnonDepsFromNode(info.factoryNode);
+
+ if (deps.length) {
+ depString = '[' + deps.map(function (dep) {
+ return "'" + dep + "'";
+ }) + ']';
+ } else {
+ depString = '[]';
+ }
+ depString += ',';
+
+ if (info.factoryNode) {
+ //Already have a named module, need to insert the
+ //dependencies after the name.
+ modLine(info.factoryNode.loc, depString);
+ } else {
+ contentInsertion += depString;
+ }
+ }
+
+ if (contentInsertion) {
+ modLine(info.firstArgLoc, contentInsertion);
+ }
+
+ //Do namespace last so that ui does not mess upthe parenRange
+ //used above.
+ if (namespace && !info.namespaceExists) {
+ modLine(info.defineLoc, namespace + '.');
+ }
+
+ //Notify any listener for the found info
+ if (onFound) {
+ onFound(info);
+ }
+ });
+
+ contents = contentLines.join('\n');
+
+ return applySourceUrl(contents);
+ },
+
+ /**
+ * Modify the contents of a require.config/requirejs.config call. This
+ * call will LOSE any existing comments that are in the config string.
+ *
+ * @param {String} fileContents String that may contain a config call
+ * @param {Function} onConfig Function called when the first config
+ * call is found. It will be passed an Object which is the current
+ * config, and the onConfig function should return an Object to use
+ * as the config.
+ * @return {String} the fileContents with the config changes applied.
+ */
+ modifyConfig: function (fileContents, onConfig) {
+ var details = parse.findConfig(fileContents),
+ config = details.config;
+
+ if (config) {
+ config = onConfig(config);
+ if (config) {
+ return transform.serializeConfig(config,
+ fileContents,
+ details.range[0],
+ details.range[1],
+ {
+ quote: details.quote
+ });
+ }
+ }
+
+ return fileContents;
+ },
+
+ serializeConfig: function (config, fileContents, start, end, options) {
+ //Calculate base level of indent
+ var indent, match, configString, outDentRegExp,
+ baseIndent = '',
+ startString = fileContents.substring(0, start),
+ existingConfigString = fileContents.substring(start, end),
+ lineReturn = existingConfigString.indexOf('\r') === -1 ? '\n' : '\r\n',
+ lastReturnIndex = startString.lastIndexOf('\n');
+
+ //Get the basic amount of indent for the require config call.
+ if (lastReturnIndex === -1) {
+ lastReturnIndex = 0;
+ }
+
+ match = baseIndentRegExp.exec(startString.substring(lastReturnIndex + 1, start));
+ if (match && match[1]) {
+ baseIndent = match[1];
+ }
+
+ //Calculate internal indentation for config
+ match = indentRegExp.exec(existingConfigString);
+ if (match && match[1]) {
+ indent = match[1];
+ }
+
+ if (!indent || indent.length < baseIndent) {
+ indent = ' ';
+ } else {
+ indent = indent.substring(baseIndent.length);
+ }
+
+ outDentRegExp = new RegExp('(' + lineReturn + ')' + indent, 'g');
+
+ configString = transform.objectToString(config, {
+ indent: indent,
+ lineReturn: lineReturn,
+ outDentRegExp: outDentRegExp,
+ quote: options && options.quote
+ });
+
+ //Add in the base indenting level.
+ configString = applyIndent(configString, baseIndent, lineReturn);
+
+ return startString + configString + fileContents.substring(end);
+ },
+
+ /**
+ * Tries converting a JS object to a string. This will likely suck, and
+ * is tailored to the type of config expected in a loader config call.
+ * So, hasOwnProperty fields, strings, numbers, arrays and functions,
+ * no weird recursively referenced stuff.
+ * @param {Object} obj the object to convert
+ * @param {Object} options options object with the following values:
+ * {String} indent the indentation to use for each level
+ * {String} lineReturn the type of line return to use
+ * {outDentRegExp} outDentRegExp the regexp to use to outdent functions
+ * {String} quote the quote type to use, ' or ". Optional. Default is "
+ * @param {String} totalIndent the total indent to print for this level
+ * @return {String} a string representation of the object.
+ */
+ objectToString: function (obj, options, totalIndent) {
+ var startBrace, endBrace, nextIndent,
+ first = true,
+ value = '',
+ lineReturn = options.lineReturn,
+ indent = options.indent,
+ outDentRegExp = options.outDentRegExp,
+ quote = options.quote || '"';
+
+ totalIndent = totalIndent || '';
+ nextIndent = totalIndent + indent;
+
+ if (obj === null) {
+ value = 'null';
+ } else if (obj === undefined) {
+ value = 'undefined';
+ } else if (typeof obj === 'number' || typeof obj === 'boolean') {
+ value = obj;
+ } else if (typeof obj === 'string') {
+ //Use double quotes in case the config may also work as JSON.
+ value = quote + lang.jsEscape(obj) + quote;
+ } else if (lang.isArray(obj)) {
+ lang.each(obj, function (item, i) {
+ value += (i !== 0 ? ',' + lineReturn : '' ) +
+ nextIndent +
+ transform.objectToString(item,
+ options,
+ nextIndent);
+ });
+
+ startBrace = '[';
+ endBrace = ']';
+ } else if (lang.isFunction(obj) || lang.isRegExp(obj)) {
+ //The outdent regexp just helps pretty up the conversion
+ //just in node. Rhino strips comments and does a different
+ //indent scheme for Function toString, so not really helpful
+ //there.
+ value = obj.toString().replace(outDentRegExp, '$1');
+ } else {
+ //An object
+ lang.eachProp(obj, function (v, prop) {
+ value += (first ? '': ',' + lineReturn) +
+ nextIndent +
+ (keyRegExp.test(prop) ? prop : quote + lang.jsEscape(prop) + quote )+
+ ': ' +
+ transform.objectToString(v,
+ options,
+ nextIndent);
+ first = false;
+ });
+ startBrace = '{';
+ endBrace = '}';
+ }
+
+ if (startBrace) {
+ value = startBrace +
+ lineReturn +
+ value +
+ lineReturn + totalIndent +
+ endBrace;
+ }
+
+ return value;
+ }
+ };
+
+ return transform;
+});
+/**
+ * @license Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+
+/*jslint regexp: true, plusplus: true */
+/*global define: false */
+
+define('pragma', ['parse', 'logger'], function (parse, logger) {
+ 'use strict';
+ function Temp() {}
+
+ function create(obj, mixin) {
+ Temp.prototype = obj;
+ var temp = new Temp(), prop;
+
+ //Avoid any extra memory hanging around
+ Temp.prototype = null;
+
+ if (mixin) {
+ for (prop in mixin) {
+ if (mixin.hasOwnProperty(prop) && !temp.hasOwnProperty(prop)) {
+ temp[prop] = mixin[prop];
+ }
+ }
+ }
+
+ return temp; // Object
+ }
+
+ var pragma = {
+ conditionalRegExp: /(exclude|include)Start\s*\(\s*["'](\w+)["']\s*,(.*)\)/,
+ useStrictRegExp: /(^|[^{]\r?\n)['"]use strict['"];/g,
+ hasRegExp: /has\s*\(\s*['"]([^'"]+)['"]\s*\)/g,
+ configRegExp: /(^|[^\.])(requirejs|require)(\.config)\s*\(/g,
+ nsWrapRegExp: /\/\*requirejs namespace: true \*\//,
+ apiDefRegExp: /var requirejs,\s*require,\s*define;/,
+ defineCheckRegExp: /typeof\s+define\s*===?\s*["']function["']\s*&&\s*define\s*\.\s*amd/g,
+ defineStringCheckRegExp: /typeof\s+define\s*===?\s*["']function["']\s*&&\s*define\s*\[\s*["']amd["']\s*\]/g,
+ defineTypeFirstCheckRegExp: /\s*["']function["']\s*==(=?)\s*typeof\s+define\s*&&\s*define\s*\.\s*amd/g,
+ defineJQueryRegExp: /typeof\s+define\s*===?\s*["']function["']\s*&&\s*define\s*\.\s*amd\s*&&\s*define\s*\.\s*amd\s*\.\s*jQuery/g,
+ defineHasRegExp: /typeof\s+define\s*==(=)?\s*['"]function['"]\s*&&\s*typeof\s+define\.amd\s*==(=)?\s*['"]object['"]\s*&&\s*define\.amd/g,
+ defineTernaryRegExp: /typeof\s+define\s*===?\s*['"]function["']\s*&&\s*define\s*\.\s*amd\s*\?\s*define/,
+ amdefineRegExp: /if\s*\(\s*typeof define\s*\!==\s*'function'\s*\)\s*\{\s*[^\{\}]+amdefine[^\{\}]+\}/g,
+
+ removeStrict: function (contents, config) {
+ return config.useStrict ? contents : contents.replace(pragma.useStrictRegExp, '$1');
+ },
+
+ namespace: function (fileContents, ns, onLifecycleName) {
+ if (ns) {
+ //Namespace require/define calls
+ fileContents = fileContents.replace(pragma.configRegExp, '$1' + ns + '.$2$3(');
+
+
+ fileContents = parse.renameNamespace(fileContents, ns);
+
+ //Namespace define ternary use:
+ fileContents = fileContents.replace(pragma.defineTernaryRegExp,
+ "typeof " + ns + ".define === 'function' && " + ns + ".define.amd ? " + ns + ".define");
+
+ //Namespace define jquery use:
+ fileContents = fileContents.replace(pragma.defineJQueryRegExp,
+ "typeof " + ns + ".define === 'function' && " + ns + ".define.amd && " + ns + ".define.amd.jQuery");
+
+ //Namespace has.js define use:
+ fileContents = fileContents.replace(pragma.defineHasRegExp,
+ "typeof " + ns + ".define === 'function' && typeof " + ns + ".define.amd === 'object' && " + ns + ".define.amd");
+
+ //Namespace define checks.
+ //Do these ones last, since they are a subset of the more specific
+ //checks above.
+ fileContents = fileContents.replace(pragma.defineCheckRegExp,
+ "typeof " + ns + ".define === 'function' && " + ns + ".define.amd");
+ fileContents = fileContents.replace(pragma.defineStringCheckRegExp,
+ "typeof " + ns + ".define === 'function' && " + ns + ".define['amd']");
+ fileContents = fileContents.replace(pragma.defineTypeFirstCheckRegExp,
+ "'function' === typeof " + ns + ".define && " + ns + ".define.amd");
+
+ //Check for require.js with the require/define definitions
+ if (pragma.apiDefRegExp.test(fileContents) &&
+ fileContents.indexOf("if (!" + ns + " || !" + ns + ".requirejs)") === -1) {
+ //Wrap the file contents in a typeof check, and a function
+ //to contain the API globals.
+ fileContents = "var " + ns + ";(function () { if (!" + ns + " || !" + ns + ".requirejs) {\n" +
+ "if (!" + ns + ") { " + ns + ' = {}; } else { require = ' + ns + '; }\n' +
+ fileContents +
+ "\n" +
+ ns + ".requirejs = requirejs;" +
+ ns + ".require = require;" +
+ ns + ".define = define;\n" +
+ "}\n}());";
+ }
+
+ //Finally, if the file wants a special wrapper because it ties
+ //in to the requirejs internals in a way that would not fit
+ //the above matches, do that. Look for /*requirejs namespace: true*/
+ if (pragma.nsWrapRegExp.test(fileContents)) {
+ //Remove the pragma.
+ fileContents = fileContents.replace(pragma.nsWrapRegExp, '');
+
+ //Alter the contents.
+ fileContents = '(function () {\n' +
+ 'var require = ' + ns + '.require,' +
+ 'requirejs = ' + ns + '.requirejs,' +
+ 'define = ' + ns + '.define;\n' +
+ fileContents +
+ '\n}());';
+ }
+ }
+
+ return fileContents;
+ },
+
+ /**
+ * processes the fileContents for some //>> conditional statements
+ */
+ process: function (fileName, fileContents, config, onLifecycleName, pluginCollector) {
+ /*jslint evil: true */
+ var foundIndex = -1, startIndex = 0, lineEndIndex, conditionLine,
+ matches, type, marker, condition, isTrue, endRegExp, endMatches,
+ endMarkerIndex, shouldInclude, startLength, lifecycleHas, deps,
+ i, dep, moduleName, collectorMod,
+ lifecyclePragmas, pragmas = config.pragmas, hasConfig = config.has,
+ //Legacy arg defined to help in dojo conversion script. Remove later
+ //when dojo no longer needs conversion:
+ kwArgs = pragmas;
+
+ //Mix in a specific lifecycle scoped object, to allow targeting
+ //some pragmas/has tests to only when files are saved, or at different
+ //lifecycle events. Do not bother with kwArgs in this section, since
+ //the old dojo kwArgs were for all points in the build lifecycle.
+ if (onLifecycleName) {
+ lifecyclePragmas = config['pragmas' + onLifecycleName];
+ lifecycleHas = config['has' + onLifecycleName];
+
+ if (lifecyclePragmas) {
+ pragmas = create(pragmas || {}, lifecyclePragmas);
+ }
+
+ if (lifecycleHas) {
+ hasConfig = create(hasConfig || {}, lifecycleHas);
+ }
+ }
+
+ //Replace has references if desired
+ if (hasConfig) {
+ fileContents = fileContents.replace(pragma.hasRegExp, function (match, test) {
+ if (hasConfig.hasOwnProperty(test)) {
+ return !!hasConfig[test];
+ }
+ return match;
+ });
+ }
+
+ if (!config.skipPragmas) {
+
+ while ((foundIndex = fileContents.indexOf("//>>", startIndex)) !== -1) {
+ //Found a conditional. Get the conditional line.
+ lineEndIndex = fileContents.indexOf("\n", foundIndex);
+ if (lineEndIndex === -1) {
+ lineEndIndex = fileContents.length - 1;
+ }
+
+ //Increment startIndex past the line so the next conditional search can be done.
+ startIndex = lineEndIndex + 1;
+
+ //Break apart the conditional.
+ conditionLine = fileContents.substring(foundIndex, lineEndIndex + 1);
+ matches = conditionLine.match(pragma.conditionalRegExp);
+ if (matches) {
+ type = matches[1];
+ marker = matches[2];
+ condition = matches[3];
+ isTrue = false;
+ //See if the condition is true.
+ try {
+ isTrue = !!eval("(" + condition + ")");
+ } catch (e) {
+ throw "Error in file: " +
+ fileName +
+ ". Conditional comment: " +
+ conditionLine +
+ " failed with this error: " + e;
+ }
+
+ //Find the endpoint marker.
+ endRegExp = new RegExp('\\/\\/\\>\\>\\s*' + type + 'End\\(\\s*[\'"]' + marker + '[\'"]\\s*\\)', "g");
+ endMatches = endRegExp.exec(fileContents.substring(startIndex, fileContents.length));
+ if (endMatches) {
+ endMarkerIndex = startIndex + endRegExp.lastIndex - endMatches[0].length;
+
+ //Find the next line return based on the match position.
+ lineEndIndex = fileContents.indexOf("\n", endMarkerIndex);
+ if (lineEndIndex === -1) {
+ lineEndIndex = fileContents.length - 1;
+ }
+
+ //Should we include the segment?
+ shouldInclude = ((type === "exclude" && !isTrue) || (type === "include" && isTrue));
+
+ //Remove the conditional comments, and optionally remove the content inside
+ //the conditional comments.
+ startLength = startIndex - foundIndex;
+ fileContents = fileContents.substring(0, foundIndex) +
+ (shouldInclude ? fileContents.substring(startIndex, endMarkerIndex) : "") +
+ fileContents.substring(lineEndIndex + 1, fileContents.length);
+
+ //Move startIndex to foundIndex, since that is the new position in the file
+ //where we need to look for more conditionals in the next while loop pass.
+ startIndex = foundIndex;
+ } else {
+ throw "Error in file: " +
+ fileName +
+ ". Cannot find end marker for conditional comment: " +
+ conditionLine;
+
+ }
+ }
+ }
+ }
+
+ //If need to find all plugin resources to optimize, do that now,
+ //before namespacing, since the namespacing will change the API
+ //names.
+ //If there is a plugin collector, scan the file for plugin resources.
+ if (config.optimizeAllPluginResources && pluginCollector) {
+ try {
+ deps = parse.findDependencies(fileName, fileContents);
+ if (deps.length) {
+ for (i = 0; i < deps.length; i++) {
+ dep = deps[i];
+ if (dep.indexOf('!') !== -1) {
+ moduleName = dep.split('!')[0];
+ collectorMod = pluginCollector[moduleName];
+ if (!collectorMod) {
+ collectorMod = pluginCollector[moduleName] = [];
+ }
+ collectorMod.push(dep);
+ }
+ }
+ }
+ } catch (eDep) {
+ logger.error('Parse error looking for plugin resources in ' +
+ fileName + ', skipping.');
+ }
+ }
+
+ //Strip amdefine use for node-shared modules.
+ if (!config.keepAmdefine) {
+ fileContents = fileContents.replace(pragma.amdefineRegExp, '');
+ }
+
+ //Do namespacing
+ if (onLifecycleName === 'OnSave' && config.namespace) {
+ fileContents = pragma.namespace(fileContents, config.namespace, onLifecycleName);
+ }
+
+
+ return pragma.removeStrict(fileContents, config);
+ }
+ };
+
+ return pragma;
+});
+if(env === 'browser') {
+/**
+ * @license Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+
+/*jslint strict: false */
+/*global define: false */
+
+define('browser/optimize', {});
+
+}
+
+if(env === 'node') {
+/**
+ * @license Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+
+/*jslint strict: false */
+/*global define: false */
+
+define('node/optimize', {});
+
+}
+
+if(env === 'rhino') {
+/**
+ * @license Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+
+/*jslint sloppy: true, plusplus: true */
+/*global define, java, Packages, com */
+
+define('rhino/optimize', ['logger', 'env!env/file'], function (logger, file) {
+
+ //Add .reduce to Rhino so UglifyJS can run in Rhino,
+ //inspired by https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/reduce
+ //but rewritten for brevity, and to be good enough for use by UglifyJS.
+ if (!Array.prototype.reduce) {
+ Array.prototype.reduce = function (fn /*, initialValue */) {
+ var i = 0,
+ length = this.length,
+ accumulator;
+
+ if (arguments.length >= 2) {
+ accumulator = arguments[1];
+ } else {
+ if (length) {
+ while (!(i in this)) {
+ i++;
+ }
+ accumulator = this[i++];
+ }
+ }
+
+ for (; i < length; i++) {
+ if (i in this) {
+ accumulator = fn.call(undefined, accumulator, this[i], i, this);
+ }
+ }
+
+ return accumulator;
+ };
+ }
+
+ var JSSourceFilefromCode, optimize,
+ mapRegExp = /"file":"[^"]+"/;
+
+ //Bind to Closure compiler, but if it is not available, do not sweat it.
+ try {
+ // Try older closure compiler that worked on Java 6
+ JSSourceFilefromCode = java.lang.Class.forName('com.google.javascript.jscomp.JSSourceFile').getMethod('fromCode', [java.lang.String, java.lang.String]);
+ } catch (e) {
+ try {
+ // Try for newer closure compiler that needs Java 7+
+ JSSourceFilefromCode = java.lang.Class.forName('com.google.javascript.jscomp.SourceFile').getMethod('fromCode', [java.lang.String, java.lang.String]);
+ } catch (e) {}
+ }
+
+ //Helper for closure compiler, because of weird Java-JavaScript interactions.
+ function closurefromCode(filename, content) {
+ return JSSourceFilefromCode.invoke(null, [filename, content]);
+ }
+
+
+ function getFileWriter(fileName, encoding) {
+ var outFile = new java.io.File(fileName), outWriter, parentDir;
+
+ parentDir = outFile.getAbsoluteFile().getParentFile();
+ if (!parentDir.exists()) {
+ if (!parentDir.mkdirs()) {
+ throw "Could not create directory: " + parentDir.getAbsolutePath();
+ }
+ }
+
+ if (encoding) {
+ outWriter = new java.io.OutputStreamWriter(new java.io.FileOutputStream(outFile), encoding);
+ } else {
+ outWriter = new java.io.OutputStreamWriter(new java.io.FileOutputStream(outFile));
+ }
+
+ return new java.io.BufferedWriter(outWriter);
+ }
+
+ optimize = {
+ closure: function (fileName, fileContents, outFileName, keepLines, config) {
+ config = config || {};
+ var result, mappings, optimized, compressed, baseName, writer,
+ outBaseName, outFileNameMap, outFileNameMapContent,
+ srcOutFileName, concatNameMap,
+ jscomp = Packages.com.google.javascript.jscomp,
+ flags = Packages.com.google.common.flags,
+ //Set up source input
+ jsSourceFile = closurefromCode(String(fileName), String(fileContents)),
+ sourceListArray = new java.util.ArrayList(),
+ options, option, FLAG_compilation_level, compiler,
+ Compiler = Packages.com.google.javascript.jscomp.Compiler,
+ CommandLineRunner = Packages.com.google.javascript.jscomp.CommandLineRunner;
+
+ logger.trace("Minifying file: " + fileName);
+
+ baseName = (new java.io.File(fileName)).getName();
+
+ //Set up options
+ options = new jscomp.CompilerOptions();
+ for (option in config.CompilerOptions) {
+ // options are false by default and jslint wanted an if statement in this for loop
+ if (config.CompilerOptions[option]) {
+ options[option] = config.CompilerOptions[option];
+ }
+
+ }
+ options.prettyPrint = keepLines || options.prettyPrint;
+
+ FLAG_compilation_level = jscomp.CompilationLevel[config.CompilationLevel || 'SIMPLE_OPTIMIZATIONS'];
+ FLAG_compilation_level.setOptionsForCompilationLevel(options);
+
+ if (config.generateSourceMaps) {
+ mappings = new java.util.ArrayList();
+
+ mappings.add(new com.google.javascript.jscomp.SourceMap.LocationMapping(fileName, baseName + ".src.js"));
+ options.setSourceMapLocationMappings(mappings);
+ options.setSourceMapOutputPath(fileName + ".map");
+ }
+
+ //Trigger the compiler
+ Compiler.setLoggingLevel(Packages.java.util.logging.Level[config.loggingLevel || 'WARNING']);
+ compiler = new Compiler();
+
+ //fill the sourceArrrayList; we need the ArrayList because the only overload of compile
+ //accepting the getDefaultExterns return value (a List) also wants the sources as a List
+ sourceListArray.add(jsSourceFile);
+
+ result = compiler.compile(CommandLineRunner.getDefaultExterns(), sourceListArray, options);
+ if (result.success) {
+ optimized = String(compiler.toSource());
+
+ if (config.generateSourceMaps && result.sourceMap && outFileName) {
+ outBaseName = (new java.io.File(outFileName)).getName();
+
+ srcOutFileName = outFileName + ".src.js";
+ outFileNameMap = outFileName + ".map";
+
+ //If previous .map file exists, move it to the ".src.js"
+ //location. Need to update the sourceMappingURL part in the
+ //src.js file too.
+ if (file.exists(outFileNameMap)) {
+ concatNameMap = outFileNameMap.replace(/\.map$/, '.src.js.map');
+ file.saveFile(concatNameMap, file.readFile(outFileNameMap));
+ file.saveFile(srcOutFileName,
+ fileContents.replace(/\/\# sourceMappingURL=(.+).map/,
+ '/# sourceMappingURL=$1.src.js.map'));
+ } else {
+ file.saveUtf8File(srcOutFileName, fileContents);
+ }
+
+ writer = getFileWriter(outFileNameMap, "utf-8");
+ result.sourceMap.appendTo(writer, outFileName);
+ writer.close();
+
+ //Not sure how better to do this, but right now the .map file
+ //leaks the full OS path in the "file" property. Manually
+ //modify it to not do that.
+ file.saveFile(outFileNameMap,
+ file.readFile(outFileNameMap).replace(mapRegExp, '"file":"' + baseName + '"'));
+
+ fileContents = optimized + "\n//# sourceMappingURL=" + outBaseName + ".map";
+ } else {
+ fileContents = optimized;
+ }
+ return fileContents;
+ } else {
+ throw new Error('Cannot closure compile file: ' + fileName + '. Skipping it.');
+ }
+
+ return fileContents;
+ }
+ };
+
+ return optimize;
+});
+}
+
+if(env === 'xpconnect') {
+define('xpconnect/optimize', {});
+}
+/**
+ * @license Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+
+/*jslint plusplus: true, nomen: true, regexp: true */
+/*global define: false */
+
+define('optimize', [ 'lang', 'logger', 'env!env/optimize', 'env!env/file', 'parse',
+ 'pragma', 'uglifyjs/index', 'uglifyjs2',
+ 'source-map'],
+function (lang, logger, envOptimize, file, parse,
+ pragma, uglify, uglify2,
+ sourceMap) {
+ 'use strict';
+
+ var optimize,
+ cssImportRegExp = /\@import\s+(url\()?\s*([^);]+)\s*(\))?([\w, ]*)(;)?/ig,
+ cssCommentImportRegExp = /\/\*[^\*]*@import[^\*]*\*\//g,
+ cssUrlRegExp = /\url\(\s*([^\)]+)\s*\)?/g,
+ protocolRegExp = /^\w+:/,
+ SourceMapGenerator = sourceMap.SourceMapGenerator,
+ SourceMapConsumer =sourceMap.SourceMapConsumer;
+
+ /**
+ * If an URL from a CSS url value contains start/end quotes, remove them.
+ * This is not done in the regexp, since my regexp fu is not that strong,
+ * and the CSS spec allows for ' and " in the URL if they are backslash escaped.
+ * @param {String} url
+ */
+ function cleanCssUrlQuotes(url) {
+ //Make sure we are not ending in whitespace.
+ //Not very confident of the css regexps above that there will not be ending
+ //whitespace.
+ url = url.replace(/\s+$/, "");
+
+ if (url.charAt(0) === "'" || url.charAt(0) === "\"") {
+ url = url.substring(1, url.length - 1);
+ }
+
+ return url;
+ }
+
+ function fixCssUrlPaths(fileName, path, contents, cssPrefix) {
+ return contents.replace(cssUrlRegExp, function (fullMatch, urlMatch) {
+ var firstChar, hasProtocol, parts, i,
+ fixedUrlMatch = cleanCssUrlQuotes(urlMatch);
+
+ fixedUrlMatch = fixedUrlMatch.replace(lang.backSlashRegExp, "/");
+
+ //Only do the work for relative URLs. Skip things that start with / or #, or have
+ //a protocol.
+ firstChar = fixedUrlMatch.charAt(0);
+ hasProtocol = protocolRegExp.test(fixedUrlMatch);
+ if (firstChar !== "/" && firstChar !== "#" && !hasProtocol) {
+ //It is a relative URL, tack on the cssPrefix and path prefix
+ urlMatch = cssPrefix + path + fixedUrlMatch;
+ } else if (!hasProtocol) {
+ logger.trace(fileName + "\n URL not a relative URL, skipping: " + urlMatch);
+ }
+
+ //Collapse .. and .
+ parts = urlMatch.split("/");
+ for (i = parts.length - 1; i > 0; i--) {
+ if (parts[i] === ".") {
+ parts.splice(i, 1);
+ } else if (parts[i] === "..") {
+ if (i !== 0 && parts[i - 1] !== "..") {
+ parts.splice(i - 1, 2);
+ i -= 1;
+ }
+ }
+ }
+
+ return "url(" + parts.join("/") + ")";
+ });
+ }
+
+ /**
+ * Inlines nested stylesheets that have @import calls in them.
+ * @param {String} fileName the file name
+ * @param {String} fileContents the file contents
+ * @param {String} cssImportIgnore comma delimited string of files to ignore
+ * @param {String} cssPrefix string to be prefixed before relative URLs
+ * @param {Object} included an object used to track the files already imported
+ */
+ function flattenCss(fileName, fileContents, cssImportIgnore, cssPrefix, included, topLevel) {
+ //Find the last slash in the name.
+ fileName = fileName.replace(lang.backSlashRegExp, "/");
+ var endIndex = fileName.lastIndexOf("/"),
+ //Make a file path based on the last slash.
+ //If no slash, so must be just a file name. Use empty string then.
+ filePath = (endIndex !== -1) ? fileName.substring(0, endIndex + 1) : "",
+ //store a list of merged files
+ importList = [],
+ skippedList = [];
+
+ //First make a pass by removing any commented out @import calls.
+ fileContents = fileContents.replace(cssCommentImportRegExp, '');
+
+ //Make sure we have a delimited ignore list to make matching faster
+ if (cssImportIgnore && cssImportIgnore.charAt(cssImportIgnore.length - 1) !== ",") {
+ cssImportIgnore += ",";
+ }
+
+ fileContents = fileContents.replace(cssImportRegExp, function (fullMatch, urlStart, importFileName, urlEnd, mediaTypes) {
+ //Only process media type "all" or empty media type rules.
+ if (mediaTypes && ((mediaTypes.replace(/^\s\s*/, '').replace(/\s\s*$/, '')) !== "all")) {
+ skippedList.push(fileName);
+ return fullMatch;
+ }
+
+ importFileName = cleanCssUrlQuotes(importFileName);
+
+ //Ignore the file import if it is part of an ignore list.
+ if (cssImportIgnore && cssImportIgnore.indexOf(importFileName + ",") !== -1) {
+ return fullMatch;
+ }
+
+ //Make sure we have a unix path for the rest of the operation.
+ importFileName = importFileName.replace(lang.backSlashRegExp, "/");
+
+ try {
+ //if a relative path, then tack on the filePath.
+ //If it is not a relative path, then the readFile below will fail,
+ //and we will just skip that import.
+ var fullImportFileName = importFileName.charAt(0) === "/" ? importFileName : filePath + importFileName,
+ importContents = file.readFile(fullImportFileName),
+ importEndIndex, importPath, flat;
+
+ //Skip the file if it has already been included.
+ if (included[fullImportFileName]) {
+ return '';
+ }
+ included[fullImportFileName] = true;
+
+ //Make sure to flatten any nested imports.
+ flat = flattenCss(fullImportFileName, importContents, cssImportIgnore, cssPrefix, included);
+ importContents = flat.fileContents;
+
+ if (flat.importList.length) {
+ importList.push.apply(importList, flat.importList);
+ }
+ if (flat.skippedList.length) {
+ skippedList.push.apply(skippedList, flat.skippedList);
+ }
+
+ //Make the full import path
+ importEndIndex = importFileName.lastIndexOf("/");
+
+ //Make a file path based on the last slash.
+ //If no slash, so must be just a file name. Use empty string then.
+ importPath = (importEndIndex !== -1) ? importFileName.substring(0, importEndIndex + 1) : "";
+
+ //fix url() on relative import (#5)
+ importPath = importPath.replace(/^\.\//, '');
+
+ //Modify URL paths to match the path represented by this file.
+ importContents = fixCssUrlPaths(importFileName, importPath, importContents, cssPrefix);
+
+ importList.push(fullImportFileName);
+ return importContents;
+ } catch (e) {
+ logger.warn(fileName + "\n Cannot inline css import, skipping: " + importFileName);
+ return fullMatch;
+ }
+ });
+
+ if (cssPrefix && topLevel) {
+ //Modify URL paths to match the path represented by this file.
+ fileContents = fixCssUrlPaths(fileName, '', fileContents, cssPrefix);
+ }
+
+ return {
+ importList : importList,
+ skippedList: skippedList,
+ fileContents : fileContents
+ };
+ }
+
+ optimize = {
+ /**
+ * Optimizes a file that contains JavaScript content. Optionally collects
+ * plugin resources mentioned in a file, and then passes the content
+ * through an minifier if one is specified via config.optimize.
+ *
+ * @param {String} fileName the name of the file to optimize
+ * @param {String} fileContents the contents to optimize. If this is
+ * a null value, then fileName will be used to read the fileContents.
+ * @param {String} outFileName the name of the file to use for the
+ * saved optimized content.
+ * @param {Object} config the build config object.
+ * @param {Array} [pluginCollector] storage for any plugin resources
+ * found.
+ */
+ jsFile: function (fileName, fileContents, outFileName, config, pluginCollector) {
+ if (!fileContents) {
+ fileContents = file.readFile(fileName);
+ }
+
+ fileContents = optimize.js(fileName, fileContents, outFileName, config, pluginCollector);
+
+ file.saveUtf8File(outFileName, fileContents);
+ },
+
+ /**
+ * Optimizes a file that contains JavaScript content. Optionally collects
+ * plugin resources mentioned in a file, and then passes the content
+ * through an minifier if one is specified via config.optimize.
+ *
+ * @param {String} fileName the name of the file that matches the
+ * fileContents.
+ * @param {String} fileContents the string of JS to optimize.
+ * @param {Object} [config] the build config object.
+ * @param {Array} [pluginCollector] storage for any plugin resources
+ * found.
+ */
+ js: function (fileName, fileContents, outFileName, config, pluginCollector) {
+ var optFunc, optConfig,
+ parts = (String(config.optimize)).split('.'),
+ optimizerName = parts[0],
+ keepLines = parts[1] === 'keepLines',
+ licenseContents = '';
+
+ config = config || {};
+
+ //Apply pragmas/namespace renaming
+ fileContents = pragma.process(fileName, fileContents, config, 'OnSave', pluginCollector);
+
+ //Optimize the JS files if asked.
+ if (optimizerName && optimizerName !== 'none') {
+ optFunc = envOptimize[optimizerName] || optimize.optimizers[optimizerName];
+ if (!optFunc) {
+ throw new Error('optimizer with name of "' +
+ optimizerName +
+ '" not found for this environment');
+ }
+
+ optConfig = config[optimizerName] || {};
+ if (config.generateSourceMaps) {
+ optConfig.generateSourceMaps = !!config.generateSourceMaps;
+ optConfig._buildSourceMap = config._buildSourceMap;
+ }
+
+ try {
+ if (config.preserveLicenseComments) {
+ //Pull out any license comments for prepending after optimization.
+ try {
+ licenseContents = parse.getLicenseComments(fileName, fileContents);
+ } catch (e) {
+ throw new Error('Cannot parse file: ' + fileName + ' for comments. Skipping it. Error is:\n' + e.toString());
+ }
+ }
+
+ fileContents = licenseContents + optFunc(fileName,
+ fileContents,
+ outFileName,
+ keepLines,
+ optConfig);
+ if (optConfig._buildSourceMap && optConfig._buildSourceMap !== config._buildSourceMap) {
+ config._buildSourceMap = optConfig._buildSourceMap;
+ }
+ } catch (e) {
+ if (config.throwWhen && config.throwWhen.optimize) {
+ throw e;
+ } else {
+ logger.error(e);
+ }
+ }
+ } else {
+ if (config._buildSourceMap) {
+ config._buildSourceMap = null;
+ }
+ }
+
+ return fileContents;
+ },
+
+ /**
+ * Optimizes one CSS file, inlining @import calls, stripping comments, and
+ * optionally removes line returns.
+ * @param {String} fileName the path to the CSS file to optimize
+ * @param {String} outFileName the path to save the optimized file.
+ * @param {Object} config the config object with the optimizeCss and
+ * cssImportIgnore options.
+ */
+ cssFile: function (fileName, outFileName, config) {
+
+ //Read in the file. Make sure we have a JS string.
+ var originalFileContents = file.readFile(fileName),
+ flat = flattenCss(fileName, originalFileContents, config.cssImportIgnore, config.cssPrefix, {}, true),
+ //Do not use the flattened CSS if there was one that was skipped.
+ fileContents = flat.skippedList.length ? originalFileContents : flat.fileContents,
+ startIndex, endIndex, buildText, comment;
+
+ if (flat.skippedList.length) {
+ logger.warn('Cannot inline @imports for ' + fileName +
+ ',\nthe following files had media queries in them:\n' +
+ flat.skippedList.join('\n'));
+ }
+
+ //Do comment removal.
+ try {
+ if (config.optimizeCss.indexOf(".keepComments") === -1) {
+ startIndex = 0;
+ //Get rid of comments.
+ while ((startIndex = fileContents.indexOf("/*", startIndex)) !== -1) {
+ endIndex = fileContents.indexOf("*/", startIndex + 2);
+ if (endIndex === -1) {
+ throw "Improper comment in CSS file: " + fileName;
+ }
+ comment = fileContents.substring(startIndex, endIndex);
+
+ if (config.preserveLicenseComments &&
+ (comment.indexOf('license') !== -1 ||
+ comment.indexOf('opyright') !== -1 ||
+ comment.indexOf('(c)') !== -1)) {
+ //Keep the comment, just increment the startIndex
+ startIndex = endIndex;
+ } else {
+ fileContents = fileContents.substring(0, startIndex) + fileContents.substring(endIndex + 2, fileContents.length);
+ startIndex = 0;
+ }
+ }
+ }
+ //Get rid of newlines.
+ if (config.optimizeCss.indexOf(".keepLines") === -1) {
+ fileContents = fileContents.replace(/[\r\n]/g, " ");
+ fileContents = fileContents.replace(/\s+/g, " ");
+ fileContents = fileContents.replace(/\{\s/g, "{");
+ fileContents = fileContents.replace(/\s\}/g, "}");
+ } else {
+ //Remove multiple empty lines.
+ fileContents = fileContents.replace(/(\r\n)+/g, "\r\n");
+ fileContents = fileContents.replace(/(\n)+/g, "\n");
+ }
+ //Remove unnecessary whitespace
+ if (config.optimizeCss.indexOf(".keepWhitespace") === -1) {
+ //Remove leading and trailing whitespace from lines
+ fileContents = fileContents.replace(/^[ \t]+/gm, "");
+ fileContents = fileContents.replace(/[ \t]+$/gm, "");
+ //Remove whitespace after semicolon, colon, curly brackets and commas
+ fileContents = fileContents.replace(/(;|:|\{|}|,)[ \t]+/g, "$1");
+ //Remove whitespace before opening curly brackets
+ fileContents = fileContents.replace(/[ \t]+(\{)/g, "$1");
+ //Truncate double whitespace
+ fileContents = fileContents.replace(/([ \t])+/g, "$1");
+ //Remove empty lines
+ fileContents = fileContents.replace(/^[ \t]*[\r\n]/gm,'');
+ }
+ } catch (e) {
+ fileContents = originalFileContents;
+ logger.error("Could not optimized CSS file: " + fileName + ", error: " + e);
+ }
+
+ file.saveUtf8File(outFileName, fileContents);
+
+ //text output to stdout and/or written to build.txt file
+ buildText = "\n"+ outFileName.replace(config.dir, "") +"\n----------------\n";
+ flat.importList.push(fileName);
+ buildText += flat.importList.map(function(path){
+ return path.replace(config.dir, "");
+ }).join("\n");
+
+ return {
+ importList: flat.importList,
+ buildText: buildText +"\n"
+ };
+ },
+
+ /**
+ * Optimizes CSS files, inlining @import calls, stripping comments, and
+ * optionally removes line returns.
+ * @param {String} startDir the path to the top level directory
+ * @param {Object} config the config object with the optimizeCss and
+ * cssImportIgnore options.
+ */
+ css: function (startDir, config) {
+ var buildText = "",
+ importList = [],
+ shouldRemove = config.dir && config.removeCombined,
+ i, fileName, result, fileList;
+ if (config.optimizeCss.indexOf("standard") !== -1) {
+ fileList = file.getFilteredFileList(startDir, /\.css$/, true);
+ if (fileList) {
+ for (i = 0; i < fileList.length; i++) {
+ fileName = fileList[i];
+ logger.trace("Optimizing (" + config.optimizeCss + ") CSS file: " + fileName);
+ result = optimize.cssFile(fileName, fileName, config);
+ buildText += result.buildText;
+ if (shouldRemove) {
+ result.importList.pop();
+ importList = importList.concat(result.importList);
+ }
+ }
+ }
+
+ if (shouldRemove) {
+ importList.forEach(function (path) {
+ if (file.exists(path)) {
+ file.deleteFile(path);
+ }
+ });
+ }
+ }
+ return buildText;
+ },
+
+ optimizers: {
+ uglify: function (fileName, fileContents, outFileName, keepLines, config) {
+ var parser = uglify.parser,
+ processor = uglify.uglify,
+ ast, errMessage, errMatch;
+
+ config = config || {};
+
+ logger.trace("Uglifying file: " + fileName);
+
+ try {
+ ast = parser.parse(fileContents, config.strict_semicolons);
+ if (config.no_mangle !== true) {
+ ast = processor.ast_mangle(ast, config);
+ }
+ ast = processor.ast_squeeze(ast, config);
+
+ fileContents = processor.gen_code(ast, config);
+
+ if (config.max_line_length) {
+ fileContents = processor.split_lines(fileContents, config.max_line_length);
+ }
+
+ //Add trailing semicolon to match uglifyjs command line version
+ fileContents += ';';
+ } catch (e) {
+ errMessage = e.toString();
+ errMatch = /\nError(\r)?\n/.exec(errMessage);
+ if (errMatch) {
+ errMessage = errMessage.substring(0, errMatch.index);
+ }
+ throw new Error('Cannot uglify file: ' + fileName + '. Skipping it. Error is:\n' + errMessage);
+ }
+ return fileContents;
+ },
+ uglify2: function (fileName, fileContents, outFileName, keepLines, config) {
+ var result, existingMap, resultMap, finalMap, sourceIndex,
+ uconfig = {},
+ existingMapPath = outFileName + '.map',
+ baseName = fileName && fileName.split('/').pop();
+
+ config = config || {};
+
+ lang.mixin(uconfig, config, true);
+
+ uconfig.fromString = true;
+
+ if (config.generateSourceMaps && (outFileName || config._buildSourceMap)) {
+ uconfig.outSourceMap = baseName;
+
+ if (config._buildSourceMap) {
+ existingMap = JSON.parse(config._buildSourceMap);
+ uconfig.inSourceMap = existingMap;
+ } else if (file.exists(existingMapPath)) {
+ uconfig.inSourceMap = existingMapPath;
+ existingMap = JSON.parse(file.readFile(existingMapPath));
+ }
+ }
+
+ logger.trace("Uglify2 file: " + fileName);
+
+ try {
+ //var tempContents = fileContents.replace(/\/\/\# sourceMappingURL=.*$/, '');
+ result = uglify2.minify(fileContents, uconfig, baseName + '.src.js');
+ if (uconfig.outSourceMap && result.map) {
+ resultMap = result.map;
+ if (existingMap) {
+ resultMap = JSON.parse(resultMap);
+ finalMap = SourceMapGenerator.fromSourceMap(new SourceMapConsumer(resultMap));
+ finalMap.applySourceMap(new SourceMapConsumer(existingMap));
+ resultMap = finalMap.toString();
+ } else if (!config._buildSourceMap) {
+ file.saveFile(outFileName + '.src.js', fileContents);
+ }
+
+ fileContents = result.code;
+
+ if (config._buildSourceMap) {
+ config._buildSourceMap = resultMap;
+ } else {
+ file.saveFile(outFileName + '.map', resultMap);
+ fileContents += "\n//# sourceMappingURL=" + baseName + ".map";
+ }
+ } else {
+ fileContents = result.code;
+ }
+ } catch (e) {
+ throw new Error('Cannot uglify2 file: ' + fileName + '. Skipping it. Error is:\n' + e.toString());
+ }
+ return fileContents;
+ }
+ }
+ };
+
+ return optimize;
+});
+/**
+ * @license RequireJS Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+/*
+ * This file patches require.js to communicate with the build system.
+ */
+
+//Using sloppy since this uses eval for some code like plugins,
+//which may not be strict mode compliant. So if use strict is used
+//below they will have strict rules applied and may cause an error.
+/*jslint sloppy: true, nomen: true, plusplus: true, regexp: true */
+/*global require, define: true */
+
+//NOT asking for require as a dependency since the goal is to modify the
+//global require below
+define('requirePatch', [ 'env!env/file', 'pragma', 'parse', 'lang', 'logger', 'commonJs', 'prim'], function (
+ file,
+ pragma,
+ parse,
+ lang,
+ logger,
+ commonJs,
+ prim
+) {
+
+ var allowRun = true,
+ hasProp = lang.hasProp,
+ falseProp = lang.falseProp,
+ getOwn = lang.getOwn,
+ // Used to strip out use strict from toString()'d functions for the
+ // shim config since they will explicitly want to not be bound by strict,
+ // but some envs, explicitly xpcshell, adds a use strict.
+ useStrictRegExp = /['"]use strict['"];/g;
+
+ //Turn off throwing on resolution conflict, that was just an older prim
+ //idea about finding errors early, but does not comply with how promises
+ //should operate.
+ prim.hideResolutionConflict = true;
+
+ //This method should be called when the patches to require should take hold.
+ return function () {
+ if (!allowRun) {
+ return;
+ }
+ allowRun = false;
+
+ var layer,
+ pluginBuilderRegExp = /(["']?)pluginBuilder(["']?)\s*[=\:]\s*["']([^'"\s]+)["']/,
+ oldNewContext = require.s.newContext,
+ oldDef,
+
+ //create local undefined values for module and exports,
+ //so that when files are evaled in this function they do not
+ //see the node values used for r.js
+ exports,
+ module;
+
+ /**
+ * Reset "global" build caches that are kept around between
+ * build layer builds. Useful to do when there are multiple
+ * top level requirejs.optimize() calls.
+ */
+ require._cacheReset = function () {
+ //Stored raw text caches, used by browser use.
+ require._cachedRawText = {};
+ //Stored cached file contents for reuse in other layers.
+ require._cachedFileContents = {};
+ //Store which cached files contain a require definition.
+ require._cachedDefinesRequireUrls = {};
+ };
+ require._cacheReset();
+
+ /**
+ * Makes sure the URL is something that can be supported by the
+ * optimization tool.
+ * @param {String} url
+ * @returns {Boolean}
+ */
+ require._isSupportedBuildUrl = function (url) {
+ //Ignore URLs with protocols, hosts or question marks, means either network
+ //access is needed to fetch it or it is too dynamic. Note that
+ //on Windows, full paths are used for some urls, which include
+ //the drive, like c:/something, so need to test for something other
+ //than just a colon.
+ if (url.indexOf("://") === -1 && url.indexOf("?") === -1 &&
+ url.indexOf('empty:') !== 0 && url.indexOf('//') !== 0) {
+ return true;
+ } else {
+ if (!layer.ignoredUrls[url]) {
+ if (url.indexOf('empty:') === -1) {
+ logger.info('Cannot optimize network URL, skipping: ' + url);
+ }
+ layer.ignoredUrls[url] = true;
+ }
+ return false;
+ }
+ };
+
+ function normalizeUrlWithBase(context, moduleName, url) {
+ //Adjust the URL if it was not transformed to use baseUrl.
+ if (require.jsExtRegExp.test(moduleName)) {
+ url = (context.config.dir || context.config.dirBaseUrl) + url;
+ }
+ return url;
+ }
+
+ //Overrides the new context call to add existing tracking features.
+ require.s.newContext = function (name) {
+ var context = oldNewContext(name),
+ oldEnable = context.enable,
+ moduleProto = context.Module.prototype,
+ oldInit = moduleProto.init,
+ oldCallPlugin = moduleProto.callPlugin;
+
+ //Only do this for the context used for building.
+ if (name === '_') {
+ //For build contexts, do everything sync
+ context.nextTick = function (fn) {
+ fn();
+ };
+
+ context.needFullExec = {};
+ context.fullExec = {};
+ context.plugins = {};
+ context.buildShimExports = {};
+
+ //Override the shim exports function generator to just
+ //spit out strings that can be used in the stringified
+ //build output.
+ context.makeShimExports = function (value) {
+ var fn;
+ if (context.config.wrapShim) {
+ fn = function () {
+ var str = 'return ';
+ // If specifies an export that is just a global
+ // name, no dot for a `this.` and such, then also
+ // attach to the global, for `var a = {}` files
+ // where the function closure would hide that from
+ // the global object.
+ if (value.exports && value.exports.indexOf('.') === -1) {
+ str += 'root.' + value.exports + ' = ';
+ }
+
+ if (value.init) {
+ str += '(' + value.init.toString()
+ .replace(useStrictRegExp, '') + '.apply(this, arguments))';
+ }
+ if (value.init && value.exports) {
+ str += ' || ';
+ }
+ if (value.exports) {
+ str += value.exports;
+ }
+ str += ';';
+ return str;
+ };
+ } else {
+ fn = function () {
+ return '(function (global) {\n' +
+ ' return function () {\n' +
+ ' var ret, fn;\n' +
+ (value.init ?
+ (' fn = ' + value.init.toString()
+ .replace(useStrictRegExp, '') + ';\n' +
+ ' ret = fn.apply(global, arguments);\n') : '') +
+ (value.exports ?
+ ' return ret || global.' + value.exports + ';\n' :
+ ' return ret;\n') +
+ ' };\n' +
+ '}(this))';
+ };
+ }
+
+ return fn;
+ };
+
+ context.enable = function (depMap, parent) {
+ var id = depMap.id,
+ parentId = parent && parent.map.id,
+ needFullExec = context.needFullExec,
+ fullExec = context.fullExec,
+ mod = getOwn(context.registry, id);
+
+ if (mod && !mod.defined) {
+ if (parentId && getOwn(needFullExec, parentId)) {
+ needFullExec[id] = depMap;
+ }
+
+ } else if ((getOwn(needFullExec, id) && falseProp(fullExec, id)) ||
+ (parentId && getOwn(needFullExec, parentId) &&
+ falseProp(fullExec, id))) {
+ context.require.undef(id);
+ }
+
+ return oldEnable.apply(context, arguments);
+ };
+
+ //Override load so that the file paths can be collected.
+ context.load = function (moduleName, url) {
+ /*jslint evil: true */
+ var contents, pluginBuilderMatch, builderName,
+ shim, shimExports;
+
+ //Do not mark the url as fetched if it is
+ //not an empty: URL, used by the optimizer.
+ //In that case we need to be sure to call
+ //load() for each module that is mapped to
+ //empty: so that dependencies are satisfied
+ //correctly.
+ if (url.indexOf('empty:') === 0) {
+ delete context.urlFetched[url];
+ }
+
+ //Only handle urls that can be inlined, so that means avoiding some
+ //URLs like ones that require network access or may be too dynamic,
+ //like JSONP
+ if (require._isSupportedBuildUrl(url)) {
+ //Adjust the URL if it was not transformed to use baseUrl.
+ url = normalizeUrlWithBase(context, moduleName, url);
+
+ //Save the module name to path and path to module name mappings.
+ layer.buildPathMap[moduleName] = url;
+ layer.buildFileToModule[url] = moduleName;
+
+ if (hasProp(context.plugins, moduleName)) {
+ //plugins need to have their source evaled as-is.
+ context.needFullExec[moduleName] = true;
+ }
+
+ prim().start(function () {
+ if (hasProp(require._cachedFileContents, url) &&
+ (falseProp(context.needFullExec, moduleName) ||
+ getOwn(context.fullExec, moduleName))) {
+ contents = require._cachedFileContents[url];
+
+ //If it defines require, mark it so it can be hoisted.
+ //Done here and in the else below, before the
+ //else block removes code from the contents.
+ //Related to #263
+ if (!layer.existingRequireUrl && require._cachedDefinesRequireUrls[url]) {
+ layer.existingRequireUrl = url;
+ }
+ } else {
+ //Load the file contents, process for conditionals, then
+ //evaluate it.
+ return require._cacheReadAsync(url).then(function (text) {
+ contents = text;
+
+ if (context.config.cjsTranslate &&
+ (!context.config.shim || !lang.hasProp(context.config.shim, moduleName))) {
+ contents = commonJs.convert(url, contents);
+ }
+
+ //If there is a read filter, run it now.
+ if (context.config.onBuildRead) {
+ contents = context.config.onBuildRead(moduleName, url, contents);
+ }
+
+ contents = pragma.process(url, contents, context.config, 'OnExecute');
+
+ //Find out if the file contains a require() definition. Need to know
+ //this so we can inject plugins right after it, but before they are needed,
+ //and to make sure this file is first, so that define calls work.
+ try {
+ if (!layer.existingRequireUrl && parse.definesRequire(url, contents)) {
+ layer.existingRequireUrl = url;
+ require._cachedDefinesRequireUrls[url] = true;
+ }
+ } catch (e1) {
+ throw new Error('Parse error using esprima ' +
+ 'for file: ' + url + '\n' + e1);
+ }
+ }).then(function () {
+ if (hasProp(context.plugins, moduleName)) {
+ //This is a loader plugin, check to see if it has a build extension,
+ //otherwise the plugin will act as the plugin builder too.
+ pluginBuilderMatch = pluginBuilderRegExp.exec(contents);
+ if (pluginBuilderMatch) {
+ //Load the plugin builder for the plugin contents.
+ builderName = context.makeModuleMap(pluginBuilderMatch[3],
+ context.makeModuleMap(moduleName),
+ null,
+ true).id;
+ return require._cacheReadAsync(context.nameToUrl(builderName));
+ }
+ }
+ return contents;
+ }).then(function (text) {
+ contents = text;
+
+ //Parse out the require and define calls.
+ //Do this even for plugins in case they have their own
+ //dependencies that may be separate to how the pluginBuilder works.
+ try {
+ if (falseProp(context.needFullExec, moduleName)) {
+ contents = parse(moduleName, url, contents, {
+ insertNeedsDefine: true,
+ has: context.config.has,
+ findNestedDependencies: context.config.findNestedDependencies
+ });
+ }
+ } catch (e2) {
+ throw new Error('Parse error using esprima ' +
+ 'for file: ' + url + '\n' + e2);
+ }
+
+ require._cachedFileContents[url] = contents;
+ });
+ }
+ }).then(function () {
+ if (contents) {
+ eval(contents);
+ }
+
+ try {
+ //If have a string shim config, and this is
+ //a fully executed module, try to see if
+ //it created a variable in this eval scope
+ if (getOwn(context.needFullExec, moduleName)) {
+ shim = getOwn(context.config.shim, moduleName);
+ if (shim && shim.exports) {
+ shimExports = eval(shim.exports);
+ if (typeof shimExports !== 'undefined') {
+ context.buildShimExports[moduleName] = shimExports;
+ }
+ }
+ }
+
+ //Need to close out completion of this module
+ //so that listeners will get notified that it is available.
+ context.completeLoad(moduleName);
+ } catch (e) {
+ //Track which module could not complete loading.
+ if (!e.moduleTree) {
+ e.moduleTree = [];
+ }
+ e.moduleTree.push(moduleName);
+ throw e;
+ }
+ }).then(null, function (eOuter) {
+
+ if (!eOuter.fileName) {
+ eOuter.fileName = url;
+ }
+ throw eOuter;
+ }).end();
+ } else {
+ //With unsupported URLs still need to call completeLoad to
+ //finish loading.
+ context.completeLoad(moduleName);
+ }
+ };
+
+ //Marks module has having a name, and optionally executes the
+ //callback, but only if it meets certain criteria.
+ context.execCb = function (name, cb, args, exports) {
+ var buildShimExports = getOwn(layer.context.buildShimExports, name);
+
+ if (buildShimExports) {
+ return buildShimExports;
+ } else if (cb.__requireJsBuild || getOwn(layer.context.needFullExec, name)) {
+ return cb.apply(exports, args);
+ }
+ return undefined;
+ };
+
+ moduleProto.init = function (depMaps) {
+ if (context.needFullExec[this.map.id]) {
+ lang.each(depMaps, lang.bind(this, function (depMap) {
+ if (typeof depMap === 'string') {
+ depMap = context.makeModuleMap(depMap,
+ (this.map.isDefine ? this.map : this.map.parentMap));
+ }
+
+ if (!context.fullExec[depMap.id]) {
+ context.require.undef(depMap.id);
+ }
+ }));
+ }
+
+ return oldInit.apply(this, arguments);
+ };
+
+ moduleProto.callPlugin = function () {
+ var map = this.map,
+ pluginMap = context.makeModuleMap(map.prefix),
+ pluginId = pluginMap.id,
+ pluginMod = getOwn(context.registry, pluginId);
+
+ context.plugins[pluginId] = true;
+ context.needFullExec[pluginId] = map;
+
+ //If the module is not waiting to finish being defined,
+ //undef it and start over, to get full execution.
+ if (falseProp(context.fullExec, pluginId) && (!pluginMod || pluginMod.defined)) {
+ context.require.undef(pluginMap.id);
+ }
+
+ return oldCallPlugin.apply(this, arguments);
+ };
+ }
+
+ return context;
+ };
+
+ //Clear up the existing context so that the newContext modifications
+ //above will be active.
+ delete require.s.contexts._;
+
+ /** Reset state for each build layer pass. */
+ require._buildReset = function () {
+ var oldContext = require.s.contexts._;
+
+ //Clear up the existing context.
+ delete require.s.contexts._;
+
+ //Set up new context, so the layer object can hold onto it.
+ require({});
+
+ layer = require._layer = {
+ buildPathMap: {},
+ buildFileToModule: {},
+ buildFilePaths: [],
+ pathAdded: {},
+ modulesWithNames: {},
+ needsDefine: {},
+ existingRequireUrl: "",
+ ignoredUrls: {},
+ context: require.s.contexts._
+ };
+
+ //Return the previous context in case it is needed, like for
+ //the basic config object.
+ return oldContext;
+ };
+
+ require._buildReset();
+
+ //Override define() to catch modules that just define an object, so that
+ //a dummy define call is not put in the build file for them. They do
+ //not end up getting defined via context.execCb, so we need to catch them
+ //at the define call.
+ oldDef = define;
+
+ //This function signature does not have to be exact, just match what we
+ //are looking for.
+ define = function (name) {
+ if (typeof name === "string" && falseProp(layer.needsDefine, name)) {
+ layer.modulesWithNames[name] = true;
+ }
+ return oldDef.apply(require, arguments);
+ };
+
+ define.amd = oldDef.amd;
+
+ //Add some utilities for plugins
+ require._readFile = file.readFile;
+ require._fileExists = function (path) {
+ return file.exists(path);
+ };
+
+ //Called when execManager runs for a dependency. Used to figure out
+ //what order of execution.
+ require.onResourceLoad = function (context, map) {
+ var id = map.id,
+ url;
+
+ // Fix up any maps that need to be normalized as part of the fullExec
+ // plumbing for plugins to participate in the build.
+ if (context.plugins && lang.hasProp(context.plugins, id)) {
+ lang.eachProp(context.needFullExec, function(value, prop) {
+ // For plugin entries themselves, they do not have a map
+ // value in needFullExec, just a "true" entry.
+ if (value !== true && value.prefix === id && value.unnormalized) {
+ var map = context.makeModuleMap(value.originalName, value.parentMap);
+ context.needFullExec[map.id] = map;
+ }
+ });
+ }
+
+ //If build needed a full execution, indicate it
+ //has been done now. But only do it if the context is tracking
+ //that. Only valid for the context used in a build, not for
+ //other contexts being run, like for useLib, plain requirejs
+ //use in node/rhino.
+ if (context.needFullExec && getOwn(context.needFullExec, id)) {
+ context.fullExec[id] = map;
+ }
+
+ //A plugin.
+ if (map.prefix) {
+ if (falseProp(layer.pathAdded, id)) {
+ layer.buildFilePaths.push(id);
+ //For plugins the real path is not knowable, use the name
+ //for both module to file and file to module mappings.
+ layer.buildPathMap[id] = id;
+ layer.buildFileToModule[id] = id;
+ layer.modulesWithNames[id] = true;
+ layer.pathAdded[id] = true;
+ }
+ } else if (map.url && require._isSupportedBuildUrl(map.url)) {
+ //If the url has not been added to the layer yet, and it
+ //is from an actual file that was loaded, add it now.
+ url = normalizeUrlWithBase(context, id, map.url);
+ if (!layer.pathAdded[url] && getOwn(layer.buildPathMap, id)) {
+ //Remember the list of dependencies for this layer.
+ layer.buildFilePaths.push(url);
+ layer.pathAdded[url] = true;
+ }
+ }
+ };
+
+ //Called by output of the parse() function, when a file does not
+ //explicitly call define, probably just require, but the parse()
+ //function normalizes on define() for dependency mapping and file
+ //ordering works correctly.
+ require.needsDefine = function (moduleName) {
+ layer.needsDefine[moduleName] = true;
+ };
+ };
+});
+/**
+ * @license RequireJS Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+
+/*jslint */
+/*global define: false, console: false */
+
+define('commonJs', ['env!env/file', 'parse'], function (file, parse) {
+ 'use strict';
+ var commonJs = {
+ //Set to false if you do not want this file to log. Useful in environments
+ //like node where you want the work to happen without noise.
+ useLog: true,
+
+ convertDir: function (commonJsPath, savePath) {
+ var fileList, i,
+ jsFileRegExp = /\.js$/,
+ fileName, convertedFileName, fileContents;
+
+ //Get list of files to convert.
+ fileList = file.getFilteredFileList(commonJsPath, /\w/, true);
+
+ //Normalize on front slashes and make sure the paths do not end in a slash.
+ commonJsPath = commonJsPath.replace(/\\/g, "/");
+ savePath = savePath.replace(/\\/g, "/");
+ if (commonJsPath.charAt(commonJsPath.length - 1) === "/") {
+ commonJsPath = commonJsPath.substring(0, commonJsPath.length - 1);
+ }
+ if (savePath.charAt(savePath.length - 1) === "/") {
+ savePath = savePath.substring(0, savePath.length - 1);
+ }
+
+ //Cycle through all the JS files and convert them.
+ if (!fileList || !fileList.length) {
+ if (commonJs.useLog) {
+ if (commonJsPath === "convert") {
+ //A request just to convert one file.
+ console.log('\n\n' + commonJs.convert(savePath, file.readFile(savePath)));
+ } else {
+ console.log("No files to convert in directory: " + commonJsPath);
+ }
+ }
+ } else {
+ for (i = 0; i < fileList.length; i++) {
+ fileName = fileList[i];
+ convertedFileName = fileName.replace(commonJsPath, savePath);
+
+ //Handle JS files.
+ if (jsFileRegExp.test(fileName)) {
+ fileContents = file.readFile(fileName);
+ fileContents = commonJs.convert(fileName, fileContents);
+ file.saveUtf8File(convertedFileName, fileContents);
+ } else {
+ //Just copy the file over.
+ file.copyFile(fileName, convertedFileName, true);
+ }
+ }
+ }
+ },
+
+ /**
+ * Does the actual file conversion.
+ *
+ * @param {String} fileName the name of the file.
+ *
+ * @param {String} fileContents the contents of a file :)
+ *
+ * @returns {String} the converted contents
+ */
+ convert: function (fileName, fileContents) {
+ //Strip out comments.
+ try {
+ var preamble = '',
+ commonJsProps = parse.usesCommonJs(fileName, fileContents);
+
+ //First see if the module is not already RequireJS-formatted.
+ if (parse.usesAmdOrRequireJs(fileName, fileContents) || !commonJsProps) {
+ return fileContents;
+ }
+
+ if (commonJsProps.dirname || commonJsProps.filename) {
+ preamble = 'var __filename = module.uri || "", ' +
+ '__dirname = __filename.substring(0, __filename.lastIndexOf("/") + 1); ';
+ }
+
+ //Construct the wrapper boilerplate.
+ fileContents = 'define(function (require, exports, module) {' +
+ preamble +
+ fileContents +
+ '\n});\n';
+
+ } catch (e) {
+ console.log("commonJs.convert: COULD NOT CONVERT: " + fileName + ", so skipping it. Error was: " + e);
+ return fileContents;
+ }
+
+ return fileContents;
+ }
+ };
+
+ return commonJs;
+});
+/**
+ * @license Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+
+/*jslint plusplus: true, nomen: true, regexp: true */
+/*global define, requirejs, java, process, console */
+
+
+define('build', function (require) {
+ 'use strict';
+
+ var build,
+ lang = require('lang'),
+ prim = require('prim'),
+ logger = require('logger'),
+ file = require('env!env/file'),
+ parse = require('parse'),
+ optimize = require('optimize'),
+ pragma = require('pragma'),
+ transform = require('transform'),
+ requirePatch = require('requirePatch'),
+ env = require('env'),
+ commonJs = require('commonJs'),
+ SourceMapGenerator = require('source-map/source-map-generator'),
+ hasProp = lang.hasProp,
+ getOwn = lang.getOwn,
+ falseProp = lang.falseProp,
+ endsWithSemiColonRegExp = /;\s*$/,
+ endsWithSlashRegExp = /[\/\\]$/,
+ resourceIsModuleIdRegExp = /^[\w\/\\\.]+$/;
+
+ prim.nextTick = function (fn) {
+ fn();
+ };
+
+ //Now map require to the outermost requirejs, now that we have
+ //local dependencies for this module. The rest of the require use is
+ //manipulating the requirejs loader.
+ require = requirejs;
+
+ //Caching function for performance. Attached to
+ //require so it can be reused in requirePatch.js. _cachedRawText
+ //set up by requirePatch.js
+ require._cacheReadAsync = function (path, encoding) {
+ var d;
+
+ if (lang.hasProp(require._cachedRawText, path)) {
+ d = prim();
+ d.resolve(require._cachedRawText[path]);
+ return d.promise;
+ } else {
+ return file.readFileAsync(path, encoding).then(function (text) {
+ require._cachedRawText[path] = text;
+ return text;
+ });
+ }
+ };
+
+ function makeBuildBaseConfig() {
+ return {
+ appDir: "",
+ pragmas: {},
+ paths: {},
+ optimize: "uglify",
+ optimizeCss: "standard.keepLines.keepWhitespace",
+ inlineText: true,
+ isBuild: true,
+ optimizeAllPluginResources: false,
+ findNestedDependencies: false,
+ preserveLicenseComments: true,
+ //By default, all files/directories are copied, unless
+ //they match this regexp, by default just excludes .folders
+ dirExclusionRegExp: file.dirExclusionRegExp,
+ _buildPathToModuleIndex: {}
+ };
+ }
+
+ /**
+ * Some JS may not be valid if concatenated with other JS, in particular
+ * the style of omitting semicolons and rely on ASI. Add a semicolon in
+ * those cases.
+ */
+ function addSemiColon(text, config) {
+ if (config.skipSemiColonInsertion || endsWithSemiColonRegExp.test(text)) {
+ return text;
+ } else {
+ return text + ";";
+ }
+ }
+
+ function endsWithSlash(dirName) {
+ if (dirName.charAt(dirName.length - 1) !== "/") {
+ dirName += "/";
+ }
+ return dirName;
+ }
+
+ //Method used by plugin writeFile calls, defined up here to avoid
+ //jslint warning about "making a function in a loop".
+ function makeWriteFile(namespace, layer) {
+ function writeFile(name, contents) {
+ logger.trace('Saving plugin-optimized file: ' + name);
+ file.saveUtf8File(name, contents);
+ }
+
+ writeFile.asModule = function (moduleName, fileName, contents) {
+ writeFile(fileName,
+ build.toTransport(namespace, moduleName, fileName, contents, layer));
+ };
+
+ return writeFile;
+ }
+
+ /**
+ * Main API entry point into the build. The args argument can either be
+ * an array of arguments (like the onese passed on a command-line),
+ * or it can be a JavaScript object that has the format of a build profile
+ * file.
+ *
+ * If it is an object, then in addition to the normal properties allowed in
+ * a build profile file, the object should contain one other property:
+ *
+ * The object could also contain a "buildFile" property, which is a string
+ * that is the file path to a build profile that contains the rest
+ * of the build profile directives.
+ *
+ * This function does not return a status, it should throw an error if
+ * there is a problem completing the build.
+ */
+ build = function (args) {
+ var buildFile, cmdConfig, errorMsg, errorStack, stackMatch, errorTree,
+ i, j, errorMod,
+ stackRegExp = /( {4}at[^\n]+)\n/,
+ standardIndent = ' ';
+
+ return prim().start(function () {
+ if (!args || lang.isArray(args)) {
+ if (!args || args.length < 1) {
+ logger.error("build.js buildProfile.js\n" +
+ "where buildProfile.js is the name of the build file (see example.build.js for hints on how to make a build file).");
+ return undefined;
+ }
+
+ //Next args can include a build file path as well as other build args.
+ //build file path comes first. If it does not contain an = then it is
+ //a build file path. Otherwise, just all build args.
+ if (args[0].indexOf("=") === -1) {
+ buildFile = args[0];
+ args.splice(0, 1);
+ }
+
+ //Remaining args are options to the build
+ cmdConfig = build.convertArrayToObject(args);
+ cmdConfig.buildFile = buildFile;
+ } else {
+ cmdConfig = args;
+ }
+
+ return build._run(cmdConfig);
+ }).then(null, function (e) {
+ var err;
+
+ errorMsg = e.toString();
+ errorTree = e.moduleTree;
+ stackMatch = stackRegExp.exec(errorMsg);
+
+ if (stackMatch) {
+ errorMsg += errorMsg.substring(0, stackMatch.index + stackMatch[0].length + 1);
+ }
+
+ //If a module tree that shows what module triggered the error,
+ //print it out.
+ if (errorTree && errorTree.length > 0) {
+ errorMsg += '\nIn module tree:\n';
+
+ for (i = errorTree.length - 1; i > -1; i--) {
+ errorMod = errorTree[i];
+ if (errorMod) {
+ for (j = errorTree.length - i; j > -1; j--) {
+ errorMsg += standardIndent;
+ }
+ errorMsg += errorMod + '\n';
+ }
+ }
+
+ logger.error(errorMsg);
+ }
+
+ errorStack = e.stack;
+
+ if (typeof args === 'string' && args.indexOf('stacktrace=true') !== -1) {
+ errorMsg += '\n' + errorStack;
+ } else {
+ if (!stackMatch && errorStack) {
+ //Just trim out the first "at" in the stack.
+ stackMatch = stackRegExp.exec(errorStack);
+ if (stackMatch) {
+ errorMsg += '\n' + stackMatch[0] || '';
+ }
+ }
+ }
+
+ err = new Error(errorMsg);
+ err.originalError = e;
+ throw err;
+ });
+ };
+
+ build._run = function (cmdConfig) {
+ var buildPaths, fileName, fileNames,
+ paths, i,
+ baseConfig, config,
+ modules, srcPath, buildContext,
+ destPath, moduleMap, parentModuleMap, context,
+ resources, resource, plugin, fileContents,
+ pluginProcessed = {},
+ buildFileContents = "",
+ pluginCollector = {};
+
+ return prim().start(function () {
+ var prop;
+
+ //Can now run the patches to require.js to allow it to be used for
+ //build generation. Do it here instead of at the top of the module
+ //because we want normal require behavior to load the build tool
+ //then want to switch to build mode.
+ requirePatch();
+
+ config = build.createConfig(cmdConfig);
+ paths = config.paths;
+
+ //Remove the previous build dir, in case it contains source transforms,
+ //like the ones done with onBuildRead and onBuildWrite.
+ if (config.dir && !config.keepBuildDir && file.exists(config.dir)) {
+ file.deleteFile(config.dir);
+ }
+
+ if (!config.out && !config.cssIn) {
+ //This is not just a one-off file build but a full build profile, with
+ //lots of files to process.
+
+ //First copy all the baseUrl content
+ file.copyDir((config.appDir || config.baseUrl), config.dir, /\w/, true);
+
+ //Adjust baseUrl if config.appDir is in play, and set up build output paths.
+ buildPaths = {};
+ if (config.appDir) {
+ //All the paths should be inside the appDir, so just adjust
+ //the paths to use the dirBaseUrl
+ for (prop in paths) {
+ if (hasProp(paths, prop)) {
+ buildPaths[prop] = paths[prop].replace(config.appDir, config.dir);
+ }
+ }
+ } else {
+ //If no appDir, then make sure to copy the other paths to this directory.
+ for (prop in paths) {
+ if (hasProp(paths, prop)) {
+ //Set up build path for each path prefix, but only do so
+ //if the path falls out of the current baseUrl
+ if (paths[prop].indexOf(config.baseUrl) === 0) {
+ buildPaths[prop] = paths[prop].replace(config.baseUrl, config.dirBaseUrl);
+ } else {
+ buildPaths[prop] = paths[prop] === 'empty:' ? 'empty:' : prop;
+
+ //Make sure source path is fully formed with baseUrl,
+ //if it is a relative URL.
+ srcPath = paths[prop];
+ if (srcPath.indexOf('/') !== 0 && srcPath.indexOf(':') === -1) {
+ srcPath = config.baseUrl + srcPath;
+ }
+
+ destPath = config.dirBaseUrl + buildPaths[prop];
+
+ //Skip empty: paths
+ if (srcPath !== 'empty:') {
+ //If the srcPath is a directory, copy the whole directory.
+ if (file.exists(srcPath) && file.isDirectory(srcPath)) {
+ //Copy files to build area. Copy all files (the /\w/ regexp)
+ file.copyDir(srcPath, destPath, /\w/, true);
+ } else {
+ //Try a .js extension
+ srcPath += '.js';
+ destPath += '.js';
+ file.copyFile(srcPath, destPath);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ //Figure out source file location for each module layer. Do this by seeding require
+ //with source area configuration. This is needed so that later the module layers
+ //can be manually copied over to the source area, since the build may be
+ //require multiple times and the above copyDir call only copies newer files.
+ require({
+ baseUrl: config.baseUrl,
+ paths: paths,
+ packagePaths: config.packagePaths,
+ packages: config.packages
+ });
+ buildContext = require.s.contexts._;
+ modules = config.modules;
+
+ if (modules) {
+ modules.forEach(function (module) {
+ if (module.name) {
+ module._sourcePath = buildContext.nameToUrl(module.name);
+ //If the module does not exist, and this is not a "new" module layer,
+ //as indicated by a true "create" property on the module, and
+ //it is not a plugin-loaded resource, and there is no
+ //'rawText' containing the module's source then throw an error.
+ if (!file.exists(module._sourcePath) && !module.create &&
+ module.name.indexOf('!') === -1 &&
+ (!config.rawText || !lang.hasProp(config.rawText, module.name))) {
+ throw new Error("ERROR: module path does not exist: " +
+ module._sourcePath + " for module named: " + module.name +
+ ". Path is relative to: " + file.absPath('.'));
+ }
+ }
+ });
+ }
+
+ if (config.out) {
+ //Just set up the _buildPath for the module layer.
+ require(config);
+ if (!config.cssIn) {
+ config.modules[0]._buildPath = typeof config.out === 'function' ?
+ 'FUNCTION' : config.out;
+ }
+ } else if (!config.cssIn) {
+ //Now set up the config for require to use the build area, and calculate the
+ //build file locations. Pass along any config info too.
+ baseConfig = {
+ baseUrl: config.dirBaseUrl,
+ paths: buildPaths
+ };
+
+ lang.mixin(baseConfig, config);
+ require(baseConfig);
+
+ if (modules) {
+ modules.forEach(function (module) {
+ if (module.name) {
+ module._buildPath = buildContext.nameToUrl(module.name, null);
+
+ //If buildPath and sourcePath are the same, throw since this
+ //would result in modifying source. This condition can happen
+ //with some more tricky paths: config and appDir/baseUrl
+ //setting, which is a sign of incorrect config.
+ if (module._buildPath === module._sourcePath) {
+ throw new Error('Module ID \'' + module.name +
+ '\' has a source path that is same as output path: ' +
+ module._sourcePath +
+ '. Stopping, config is malformed.');
+ }
+
+ if (!module.create) {
+ file.copyFile(module._sourcePath, module._buildPath);
+ }
+ }
+ });
+ }
+ }
+
+ //Run CSS optimizations before doing JS module tracing, to allow
+ //things like text loader plugins loading CSS to get the optimized
+ //CSS.
+ if (config.optimizeCss && config.optimizeCss !== "none" && config.dir) {
+ buildFileContents += optimize.css(config.dir, config);
+ }
+ }).then(function() {
+ baseConfig = lang.deeplikeCopy(require.s.contexts._.config);
+ }).then(function () {
+ var actions = [];
+
+ if (modules) {
+ actions = modules.map(function (module, i) {
+ return function () {
+ //Save off buildPath to module index in a hash for quicker
+ //lookup later.
+ config._buildPathToModuleIndex[file.normalize(module._buildPath)] = i;
+
+ //Call require to calculate dependencies.
+ return build.traceDependencies(module, config, baseConfig)
+ .then(function (layer) {
+ module.layer = layer;
+ });
+ };
+ });
+
+ return prim.serial(actions);
+ }
+ }).then(function () {
+ var actions;
+
+ if (modules) {
+ //Now build up shadow layers for anything that should be excluded.
+ //Do this after tracing dependencies for each module, in case one
+ //of those modules end up being one of the excluded values.
+ actions = modules.map(function (module) {
+ return function () {
+ if (module.exclude) {
+ module.excludeLayers = [];
+ return prim.serial(module.exclude.map(function (exclude, i) {
+ return function () {
+ //See if it is already in the list of modules.
+ //If not trace dependencies for it.
+ var found = build.findBuildModule(exclude, modules);
+ if (found) {
+ module.excludeLayers[i] = found;
+ } else {
+ return build.traceDependencies({name: exclude}, config, baseConfig)
+ .then(function (layer) {
+ module.excludeLayers[i] = { layer: layer };
+ });
+ }
+ };
+ }));
+ }
+ };
+ });
+
+ return prim.serial(actions);
+ }
+ }).then(function () {
+ if (modules) {
+ return prim.serial(modules.map(function (module) {
+ return function () {
+ if (module.exclude) {
+ //module.exclude is an array of module names. For each one,
+ //get the nested dependencies for it via a matching entry
+ //in the module.excludeLayers array.
+ module.exclude.forEach(function (excludeModule, i) {
+ var excludeLayer = module.excludeLayers[i].layer,
+ map = excludeLayer.buildFileToModule;
+ excludeLayer.buildFilePaths.forEach(function(filePath){
+ build.removeModulePath(map[filePath], filePath, module.layer);
+ });
+ });
+ }
+ if (module.excludeShallow) {
+ //module.excludeShallow is an array of module names.
+ //shallow exclusions are just that module itself, and not
+ //its nested dependencies.
+ module.excludeShallow.forEach(function (excludeShallowModule) {
+ var path = getOwn(module.layer.buildPathMap, excludeShallowModule);
+ if (path) {
+ build.removeModulePath(excludeShallowModule, path, module.layer);
+ }
+ });
+ }
+
+ //Flatten them and collect the build output for each module.
+ return build.flattenModule(module, module.layer, config).then(function (builtModule) {
+ var finalText, baseName;
+ //Save it to a temp file for now, in case there are other layers that
+ //contain optimized content that should not be included in later
+ //layer optimizations. See issue #56.
+ if (module._buildPath === 'FUNCTION') {
+ module._buildText = builtModule.text;
+ module._buildSourceMap = builtModule.sourceMap;
+ } else {
+ finalText = builtModule.text;
+ if (builtModule.sourceMap) {
+ baseName = module._buildPath.split('/');
+ baseName = baseName.pop();
+ finalText += '\n//# sourceMappingURL=' + baseName + '.map';
+ file.saveUtf8File(module._buildPath + '.map', builtModule.sourceMap);
+ }
+ file.saveUtf8File(module._buildPath + '-temp', finalText);
+
+ }
+ buildFileContents += builtModule.buildText;
+ });
+ };
+ }));
+ }
+ }).then(function () {
+ var moduleName, outOrigSourceMap;
+ if (modules) {
+ //Now move the build layers to their final position.
+ modules.forEach(function (module) {
+ var finalPath = module._buildPath;
+ if (finalPath !== 'FUNCTION') {
+ if (file.exists(finalPath)) {
+ file.deleteFile(finalPath);
+ }
+ file.renameFile(finalPath + '-temp', finalPath);
+
+ //And finally, if removeCombined is specified, remove
+ //any of the files that were used in this layer.
+ //Be sure not to remove other build layers.
+ if (config.removeCombined && !config.out) {
+ module.layer.buildFilePaths.forEach(function (path) {
+ var isLayer = modules.some(function (mod) {
+ return mod._buildPath === path;
+ }),
+ relPath = build.makeRelativeFilePath(config.dir, path);
+
+ if (file.exists(path) &&
+ // not a build layer target
+ !isLayer &&
+ // not outside the build directory
+ relPath.indexOf('..') !== 0) {
+ file.deleteFile(path);
+ }
+ });
+ }
+ }
+
+ //Signal layer is done
+ if (config.onModuleBundleComplete) {
+ config.onModuleBundleComplete(module.onCompleteData);
+ }
+ });
+ }
+
+ //If removeCombined in play, remove any empty directories that
+ //may now exist because of its use
+ if (config.removeCombined && !config.out && config.dir) {
+ file.deleteEmptyDirs(config.dir);
+ }
+
+ //Do other optimizations.
+ if (config.out && !config.cssIn) {
+ //Just need to worry about one JS file.
+ fileName = config.modules[0]._buildPath;
+ if (fileName === 'FUNCTION') {
+ outOrigSourceMap = config.modules[0]._buildSourceMap;
+ config._buildSourceMap = outOrigSourceMap;
+ config.modules[0]._buildText = optimize.js((config.modules[0].name ||
+ config.modules[0].include[0] ||
+ fileName) + '.build.js',
+ config.modules[0]._buildText,
+ null,
+ config);
+ if (config._buildSourceMap && config._buildSourceMap !== outOrigSourceMap) {
+ config.modules[0]._buildSourceMap = config._buildSourceMap;
+ config._buildSourceMap = null;
+ }
+ } else {
+ optimize.jsFile(fileName, null, fileName, config);
+ }
+ } else if (!config.cssIn) {
+ //Normal optimizations across modules.
+
+ //JS optimizations.
+ fileNames = file.getFilteredFileList(config.dir, /\.js$/, true);
+ fileNames.forEach(function (fileName) {
+ var cfg, override, moduleIndex;
+
+ //Generate the module name from the config.dir root.
+ moduleName = fileName.replace(config.dir, '');
+ //Get rid of the extension
+ moduleName = moduleName.substring(0, moduleName.length - 3);
+
+ //If there is an override for a specific layer build module,
+ //and this file is that module, mix in the override for use
+ //by optimize.jsFile.
+ moduleIndex = getOwn(config._buildPathToModuleIndex, fileName);
+ //Normalize, since getOwn could have returned undefined
+ moduleIndex = moduleIndex === 0 || moduleIndex > 0 ? moduleIndex : -1;
+
+ //Try to avoid extra work if the other files do not need to
+ //be read. Build layers should be processed at the very
+ //least for optimization.
+ if (moduleIndex > -1 || !config.skipDirOptimize ||
+ config.normalizeDirDefines === "all" ||
+ config.cjsTranslate) {
+ //Convert the file to transport format, but without a name
+ //inserted (by passing null for moduleName) since the files are
+ //standalone, one module per file.
+ fileContents = file.readFile(fileName);
+
+
+ //For builds, if wanting cjs translation, do it now, so that
+ //the individual modules can be loaded cross domain via
+ //plain script tags.
+ if (config.cjsTranslate &&
+ (!config.shim || !lang.hasProp(config.shim, moduleName))) {
+ fileContents = commonJs.convert(fileName, fileContents);
+ }
+
+ if (moduleIndex === -1) {
+ if (config.onBuildRead) {
+ fileContents = config.onBuildRead(moduleName,
+ fileName,
+ fileContents);
+ }
+
+ //Only do transport normalization if this is not a build
+ //layer (since it was already normalized) and if
+ //normalizeDirDefines indicated all should be done.
+ if (config.normalizeDirDefines === "all") {
+ fileContents = build.toTransport(config.namespace,
+ null,
+ fileName,
+ fileContents);
+ }
+
+ if (config.onBuildWrite) {
+ fileContents = config.onBuildWrite(moduleName,
+ fileName,
+ fileContents);
+ }
+ }
+
+ override = moduleIndex > -1 ?
+ config.modules[moduleIndex].override : null;
+ if (override) {
+ cfg = build.createOverrideConfig(config, override);
+ } else {
+ cfg = config;
+ }
+
+ if (moduleIndex > -1 || !config.skipDirOptimize) {
+ optimize.jsFile(fileName, fileContents, fileName, cfg, pluginCollector);
+ }
+ }
+ });
+
+ //Normalize all the plugin resources.
+ context = require.s.contexts._;
+
+ for (moduleName in pluginCollector) {
+ if (hasProp(pluginCollector, moduleName)) {
+ parentModuleMap = context.makeModuleMap(moduleName);
+ resources = pluginCollector[moduleName];
+ for (i = 0; i < resources.length; i++) {
+ resource = resources[i];
+ moduleMap = context.makeModuleMap(resource, parentModuleMap);
+ if (falseProp(context.plugins, moduleMap.prefix)) {
+ //Set the value in context.plugins so it
+ //will be evaluated as a full plugin.
+ context.plugins[moduleMap.prefix] = true;
+
+ //Do not bother if the plugin is not available.
+ if (!file.exists(require.toUrl(moduleMap.prefix + '.js'))) {
+ continue;
+ }
+
+ //Rely on the require in the build environment
+ //to be synchronous
+ context.require([moduleMap.prefix]);
+
+ //Now that the plugin is loaded, redo the moduleMap
+ //since the plugin will need to normalize part of the path.
+ moduleMap = context.makeModuleMap(resource, parentModuleMap);
+ }
+
+ //Only bother with plugin resources that can be handled
+ //processed by the plugin, via support of the writeFile
+ //method.
+ if (falseProp(pluginProcessed, moduleMap.id)) {
+ //Only do the work if the plugin was really loaded.
+ //Using an internal access because the file may
+ //not really be loaded.
+ plugin = getOwn(context.defined, moduleMap.prefix);
+ if (plugin && plugin.writeFile) {
+ plugin.writeFile(
+ moduleMap.prefix,
+ moduleMap.name,
+ require,
+ makeWriteFile(
+ config.namespace
+ ),
+ context.config
+ );
+ }
+
+ pluginProcessed[moduleMap.id] = true;
+ }
+ }
+
+ }
+ }
+
+ //console.log('PLUGIN COLLECTOR: ' + JSON.stringify(pluginCollector, null, " "));
+
+
+ //All module layers are done, write out the build.txt file.
+ file.saveUtf8File(config.dir + "build.txt", buildFileContents);
+ }
+
+ //If just have one CSS file to optimize, do that here.
+ if (config.cssIn) {
+ buildFileContents += optimize.cssFile(config.cssIn, config.out, config).buildText;
+ }
+
+ if (typeof config.out === 'function') {
+ config.out(config.modules[0]._buildText, config.modules[0]._buildSourceMap);
+ }
+
+ //Print out what was built into which layers.
+ if (buildFileContents) {
+ logger.info(buildFileContents);
+ return buildFileContents;
+ }
+
+ return '';
+ });
+ };
+
+ /**
+ * Converts command line args like "paths.foo=../some/path"
+ * result.paths = { foo: '../some/path' } where prop = paths,
+ * name = paths.foo and value = ../some/path, so it assumes the
+ * name=value splitting has already happened.
+ */
+ function stringDotToObj(result, name, value) {
+ var parts = name.split('.');
+
+ parts.forEach(function (prop, i) {
+ if (i === parts.length - 1) {
+ result[prop] = value;
+ } else {
+ if (falseProp(result, prop)) {
+ result[prop] = {};
+ }
+ result = result[prop];
+ }
+
+ });
+ }
+
+ build.objProps = {
+ paths: true,
+ wrap: true,
+ pragmas: true,
+ pragmasOnSave: true,
+ has: true,
+ hasOnSave: true,
+ uglify: true,
+ uglify2: true,
+ closure: true,
+ map: true,
+ throwWhen: true
+ };
+
+ build.hasDotPropMatch = function (prop) {
+ var dotProp,
+ index = prop.indexOf('.');
+
+ if (index !== -1) {
+ dotProp = prop.substring(0, index);
+ return hasProp(build.objProps, dotProp);
+ }
+ return false;
+ };
+
+ /**
+ * Converts an array that has String members of "name=value"
+ * into an object, where the properties on the object are the names in the array.
+ * Also converts the strings "true" and "false" to booleans for the values.
+ * member name/value pairs, and converts some comma-separated lists into
+ * arrays.
+ * @param {Array} ary
+ */
+ build.convertArrayToObject = function (ary) {
+ var result = {}, i, separatorIndex, prop, value,
+ needArray = {
+ "include": true,
+ "exclude": true,
+ "excludeShallow": true,
+ "insertRequire": true,
+ "stubModules": true,
+ "deps": true,
+ "mainConfigFile": true
+ };
+
+ for (i = 0; i < ary.length; i++) {
+ separatorIndex = ary[i].indexOf("=");
+ if (separatorIndex === -1) {
+ throw "Malformed name/value pair: [" + ary[i] + "]. Format should be name=value";
+ }
+
+ value = ary[i].substring(separatorIndex + 1, ary[i].length);
+ if (value === "true") {
+ value = true;
+ } else if (value === "false") {
+ value = false;
+ }
+
+ prop = ary[i].substring(0, separatorIndex);
+
+ //Convert to array if necessary
+ if (getOwn(needArray, prop)) {
+ value = value.split(",");
+ }
+
+ if (build.hasDotPropMatch(prop)) {
+ stringDotToObj(result, prop, value);
+ } else {
+ result[prop] = value;
+ }
+ }
+ return result; //Object
+ };
+
+ build.makeAbsPath = function (path, absFilePath) {
+ if (!absFilePath) {
+ return path;
+ }
+
+ //Add abspath if necessary. If path starts with a slash or has a colon,
+ //then already is an abolute path.
+ if (path.indexOf('/') !== 0 && path.indexOf(':') === -1) {
+ path = absFilePath +
+ (absFilePath.charAt(absFilePath.length - 1) === '/' ? '' : '/') +
+ path;
+ path = file.normalize(path);
+ }
+ return path.replace(lang.backSlashRegExp, '/');
+ };
+
+ build.makeAbsObject = function (props, obj, absFilePath) {
+ var i, prop;
+ if (obj) {
+ for (i = 0; i < props.length; i++) {
+ prop = props[i];
+ if (hasProp(obj, prop) && typeof obj[prop] === 'string') {
+ obj[prop] = build.makeAbsPath(obj[prop], absFilePath);
+ }
+ }
+ }
+ };
+
+ /**
+ * For any path in a possible config, make it absolute relative
+ * to the absFilePath passed in.
+ */
+ build.makeAbsConfig = function (config, absFilePath) {
+ var props, prop, i;
+
+ props = ["appDir", "dir", "baseUrl"];
+ for (i = 0; i < props.length; i++) {
+ prop = props[i];
+
+ if (getOwn(config, prop)) {
+ //Add abspath if necessary, make sure these paths end in
+ //slashes
+ if (prop === "baseUrl") {
+ config.originalBaseUrl = config.baseUrl;
+ if (config.appDir) {
+ //If baseUrl with an appDir, the baseUrl is relative to
+ //the appDir, *not* the absFilePath. appDir and dir are
+ //made absolute before baseUrl, so this will work.
+ config.baseUrl = build.makeAbsPath(config.originalBaseUrl, config.appDir);
+ } else {
+ //The dir output baseUrl is same as regular baseUrl, both
+ //relative to the absFilePath.
+ config.baseUrl = build.makeAbsPath(config[prop], absFilePath);
+ }
+ } else {
+ config[prop] = build.makeAbsPath(config[prop], absFilePath);
+ }
+
+ config[prop] = endsWithSlash(config[prop]);
+ }
+ }
+
+ build.makeAbsObject((config.out === "stdout" ? ["cssIn"] : ["out", "cssIn"]),
+ config, absFilePath);
+ build.makeAbsObject(["startFile", "endFile"], config.wrap, absFilePath);
+ };
+
+ /**
+ * Creates a relative path to targetPath from refPath.
+ * Only deals with file paths, not folders. If folders,
+ * make sure paths end in a trailing '/'.
+ */
+ build.makeRelativeFilePath = function (refPath, targetPath) {
+ var i, dotLength, finalParts, length, targetParts, targetName,
+ refParts = refPath.split('/'),
+ hasEndSlash = endsWithSlashRegExp.test(targetPath),
+ dotParts = [];
+
+ targetPath = file.normalize(targetPath);
+ if (hasEndSlash && !endsWithSlashRegExp.test(targetPath)) {
+ targetPath += '/';
+ }
+ targetParts = targetPath.split('/');
+ //Pull off file name
+ targetName = targetParts.pop();
+
+ //Also pop off the ref file name to make the matches against
+ //targetParts equivalent.
+ refParts.pop();
+
+ length = refParts.length;
+
+ for (i = 0; i < length; i += 1) {
+ if (refParts[i] !== targetParts[i]) {
+ break;
+ }
+ }
+
+ //Now i is the index in which they diverge.
+ finalParts = targetParts.slice(i);
+
+ dotLength = length - i;
+ for (i = 0; i > -1 && i < dotLength; i += 1) {
+ dotParts.push('..');
+ }
+
+ return dotParts.join('/') + (dotParts.length ? '/' : '') +
+ finalParts.join('/') + (finalParts.length ? '/' : '') +
+ targetName;
+ };
+
+ build.nestedMix = {
+ paths: true,
+ has: true,
+ hasOnSave: true,
+ pragmas: true,
+ pragmasOnSave: true
+ };
+
+ /**
+ * Mixes additional source config into target config, and merges some
+ * nested config, like paths, correctly.
+ */
+ function mixConfig(target, source, skipArrays) {
+ var prop, value, isArray, targetValue;
+
+ for (prop in source) {
+ if (hasProp(source, prop)) {
+ //If the value of the property is a plain object, then
+ //allow a one-level-deep mixing of it.
+ value = source[prop];
+ isArray = lang.isArray(value);
+ if (typeof value === 'object' && value &&
+ !isArray && !lang.isFunction(value) &&
+ !lang.isRegExp(value)) {
+
+ // TODO: need to generalize this work, maybe also reuse
+ // the work done in requirejs configure, perhaps move to
+ // just a deep copy/merge overall. However, given the
+ // amount of observable change, wait for a dot release.
+ // This change is in relation to #645
+ if (prop === 'map') {
+ if (!target.map) {
+ target.map = {};
+ }
+ lang.deepMix(target.map, source.map);
+ } else {
+ target[prop] = lang.mixin({}, target[prop], value, true);
+ }
+ } else if (isArray) {
+ if (!skipArrays) {
+ // Some config, like packages, are arrays. For those,
+ // just merge the results.
+ targetValue = target[prop];
+ if (lang.isArray(targetValue)) {
+ target[prop] = targetValue.concat(value);
+ } else {
+ target[prop] = value;
+ }
+ }
+ } else {
+ target[prop] = value;
+ }
+ }
+ }
+
+ //Set up log level since it can affect if errors are thrown
+ //or caught and passed to errbacks while doing config setup.
+ if (lang.hasProp(target, 'logLevel')) {
+ logger.logLevel(target.logLevel);
+ }
+ }
+
+ /**
+ * Converts a wrap.startFile or endFile to be start/end as a string.
+ * the startFile/endFile values can be arrays.
+ */
+ function flattenWrapFile(wrap, keyName, absFilePath) {
+ var keyFileName = keyName + 'File';
+
+ if (typeof wrap[keyName] !== 'string' && wrap[keyFileName]) {
+ wrap[keyName] = '';
+ if (typeof wrap[keyFileName] === 'string') {
+ wrap[keyFileName] = [wrap[keyFileName]];
+ }
+ wrap[keyFileName].forEach(function (fileName) {
+ wrap[keyName] += (wrap[keyName] ? '\n' : '') +
+ file.readFile(build.makeAbsPath(fileName, absFilePath));
+ });
+ } else if (wrap[keyName] === null || wrap[keyName] === undefined) {
+ //Allow missing one, just set to empty string.
+ wrap[keyName] = '';
+ } else if (typeof wrap[keyName] !== 'string') {
+ throw new Error('wrap.' + keyName + ' or wrap.' + keyFileName + ' malformed');
+ }
+ }
+
+ function normalizeWrapConfig(config, absFilePath) {
+ //Get any wrap text.
+ try {
+ if (config.wrap) {
+ if (config.wrap === true) {
+ //Use default values.
+ config.wrap = {
+ start: '(function () {',
+ end: '}());'
+ };
+ } else {
+ flattenWrapFile(config.wrap, 'start', absFilePath);
+ flattenWrapFile(config.wrap, 'end', absFilePath);
+ }
+ }
+ } catch (wrapError) {
+ throw new Error('Malformed wrap config: ' + wrapError.toString());
+ }
+ }
+
+ /**
+ * Creates a config object for an optimization build.
+ * It will also read the build profile if it is available, to create
+ * the configuration.
+ *
+ * @param {Object} cfg config options that take priority
+ * over defaults and ones in the build file. These options could
+ * be from a command line, for instance.
+ *
+ * @param {Object} the created config object.
+ */
+ build.createConfig = function (cfg) {
+ /*jslint evil: true */
+ var buildFileContents, buildFileConfig, mainConfig,
+ mainConfigFile, mainConfigPath, buildFile, absFilePath,
+ config = {},
+ buildBaseConfig = makeBuildBaseConfig();
+
+ //Make sure all paths are relative to current directory.
+ absFilePath = file.absPath('.');
+ build.makeAbsConfig(cfg, absFilePath);
+ build.makeAbsConfig(buildBaseConfig, absFilePath);
+
+ lang.mixin(config, buildBaseConfig);
+ lang.mixin(config, cfg, true);
+
+ //Set up log level early since it can affect if errors are thrown
+ //or caught and passed to errbacks, even while constructing config.
+ if (lang.hasProp(config, 'logLevel')) {
+ logger.logLevel(config.logLevel);
+ }
+
+ if (config.buildFile) {
+ //A build file exists, load it to get more config.
+ buildFile = file.absPath(config.buildFile);
+
+ //Find the build file, and make sure it exists, if this is a build
+ //that has a build profile, and not just command line args with an in=path
+ if (!file.exists(buildFile)) {
+ throw new Error("ERROR: build file does not exist: " + buildFile);
+ }
+
+ absFilePath = config.baseUrl = file.absPath(file.parent(buildFile));
+
+ //Load build file options.
+ buildFileContents = file.readFile(buildFile);
+ try {
+ //Be a bit lenient in the file ending in a ; or ending with
+ //a //# sourceMappingUrl comment, mostly for compiled languages
+ //that create a config, like typescript.
+ buildFileContents = buildFileContents
+ .replace(/\/\/\#[^\n\r]+[\n\r]*$/, '')
+ .trim()
+ .replace(/;$/, '');
+
+ buildFileConfig = eval("(" + buildFileContents + ")");
+ build.makeAbsConfig(buildFileConfig, absFilePath);
+
+ //Mix in the config now so that items in mainConfigFile can
+ //be resolved relative to them if necessary, like if appDir
+ //is set here, but the baseUrl is in mainConfigFile. Will
+ //re-mix in the same build config later after mainConfigFile
+ //is processed, since build config should take priority.
+ mixConfig(config, buildFileConfig);
+ } catch (e) {
+ throw new Error("Build file " + buildFile + " is malformed: " + e);
+ }
+ }
+
+ mainConfigFile = config.mainConfigFile || (buildFileConfig && buildFileConfig.mainConfigFile);
+ if (mainConfigFile) {
+ if (typeof mainConfigFile === 'string') {
+ mainConfigFile = [mainConfigFile];
+ }
+
+ mainConfigFile.forEach(function (configFile) {
+ configFile = build.makeAbsPath(configFile, absFilePath);
+ if (!file.exists(configFile)) {
+ throw new Error(configFile + ' does not exist.');
+ }
+ try {
+ mainConfig = parse.findConfig(file.readFile(configFile)).config;
+ } catch (configError) {
+ throw new Error('The config in mainConfigFile ' +
+ configFile +
+ ' cannot be used because it cannot be evaluated' +
+ ' correctly while running in the optimizer. Try only' +
+ ' using a config that is also valid JSON, or do not use' +
+ ' mainConfigFile and instead copy the config values needed' +
+ ' into a build file or command line arguments given to the optimizer.\n' +
+ 'Source error from parsing: ' + configFile + ': ' + configError);
+ }
+ if (mainConfig) {
+ mainConfigPath = configFile.substring(0, configFile.lastIndexOf('/'));
+
+ //Add in some existing config, like appDir, since they can be
+ //used inside the configFile -- paths and baseUrl are
+ //relative to them.
+ if (config.appDir && !mainConfig.appDir) {
+ mainConfig.appDir = config.appDir;
+ }
+
+ //If no baseUrl, then use the directory holding the main config.
+ if (!mainConfig.baseUrl) {
+ mainConfig.baseUrl = mainConfigPath;
+ }
+
+ build.makeAbsConfig(mainConfig, mainConfigPath);
+ mixConfig(config, mainConfig);
+ }
+ });
+ }
+
+ //Mix in build file config, but only after mainConfig has been mixed in.
+ //Since this is a re-application, skip array merging.
+ if (buildFileConfig) {
+ mixConfig(config, buildFileConfig, true);
+ }
+
+ //Re-apply the override config values. Command line
+ //args should take precedence over build file values.
+ //Since this is a re-application, skip array merging.
+ mixConfig(config, cfg, true);
+
+ //Fix paths to full paths so that they can be adjusted consistently
+ //lately to be in the output area.
+ lang.eachProp(config.paths, function (value, prop) {
+ if (lang.isArray(value)) {
+ throw new Error('paths fallback not supported in optimizer. ' +
+ 'Please provide a build config path override ' +
+ 'for ' + prop);
+ }
+ config.paths[prop] = build.makeAbsPath(value, config.baseUrl);
+ });
+
+ //Set final output dir
+ if (hasProp(config, "baseUrl")) {
+ if (config.appDir) {
+ if (!config.originalBaseUrl) {
+ throw new Error('Please set a baseUrl in the build config');
+ }
+ config.dirBaseUrl = build.makeAbsPath(config.originalBaseUrl, config.dir);
+ } else {
+ config.dirBaseUrl = config.dir || config.baseUrl;
+ }
+ //Make sure dirBaseUrl ends in a slash, since it is
+ //concatenated with other strings.
+ config.dirBaseUrl = endsWithSlash(config.dirBaseUrl);
+ }
+
+
+ //If out=stdout, write output to STDOUT instead of a file.
+ if (config.out && config.out === 'stdout') {
+ config.out = function (content) {
+ var e = env.get();
+ if (e === 'rhino') {
+ var out = new java.io.PrintStream(java.lang.System.out, true, 'UTF-8');
+ out.println(content);
+ } else if (e === 'node') {
+ process.stdout.setEncoding('utf8');
+ process.stdout.write(content);
+ } else {
+ console.log(content);
+ }
+ };
+ }
+
+ //Check for errors in config
+ if (config.main) {
+ throw new Error('"main" passed as an option, but the ' +
+ 'supported option is called "name".');
+ }
+ if (config.out && !config.name && !config.modules && !config.include &&
+ !config.cssIn) {
+ throw new Error('Missing either a "name", "include" or "modules" ' +
+ 'option');
+ }
+ if (config.cssIn) {
+ if (config.dir || config.appDir) {
+ throw new Error('cssIn is only for the output of single file ' +
+ 'CSS optimizations and is not compatible with "dir" or "appDir" configuration.');
+ }
+ if (!config.out) {
+ throw new Error('"out" option missing.');
+ }
+ }
+ if (!config.cssIn && !config.baseUrl) {
+ //Just use the current directory as the baseUrl
+ config.baseUrl = './';
+ }
+ if (!config.out && !config.dir) {
+ throw new Error('Missing either an "out" or "dir" config value. ' +
+ 'If using "appDir" for a full project optimization, ' +
+ 'use "dir". If you want to optimize to one file, ' +
+ 'use "out".');
+ }
+ if (config.appDir && config.out) {
+ throw new Error('"appDir" is not compatible with "out". Use "dir" ' +
+ 'instead. appDir is used to copy whole projects, ' +
+ 'where "out" with "baseUrl" is used to just ' +
+ 'optimize to one file.');
+ }
+ if (config.out && config.dir) {
+ throw new Error('The "out" and "dir" options are incompatible.' +
+ ' Use "out" if you are targeting a single file' +
+ ' for optimization, and "dir" if you want the appDir' +
+ ' or baseUrl directories optimized.');
+ }
+
+ if (config.dir) {
+ // Make sure the output dir is not set to a parent of the
+ // source dir or the same dir, as it will result in source
+ // code deletion.
+ if (!config.allowSourceOverwrites && (config.dir === config.baseUrl ||
+ config.dir === config.appDir ||
+ (config.baseUrl && build.makeRelativeFilePath(config.dir,
+ config.baseUrl).indexOf('..') !== 0) ||
+ (config.appDir &&
+ build.makeRelativeFilePath(config.dir, config.appDir).indexOf('..') !== 0))) {
+ throw new Error('"dir" is set to a parent or same directory as' +
+ ' "appDir" or "baseUrl". This can result in' +
+ ' the deletion of source code. Stopping. If' +
+ ' you want to allow possible overwriting of' +
+ ' source code, set "allowSourceOverwrites"' +
+ ' to true in the build config, but do so at' +
+ ' your own risk. In that case, you may want' +
+ ' to also set "keepBuildDir" to true.');
+ }
+ }
+
+ if (config.insertRequire && !lang.isArray(config.insertRequire)) {
+ throw new Error('insertRequire should be a list of module IDs' +
+ ' to insert in to a require([]) call.');
+ }
+
+ if (config.generateSourceMaps) {
+ if (config.preserveLicenseComments && config.optimize !== 'none') {
+ throw new Error('Cannot use preserveLicenseComments and ' +
+ 'generateSourceMaps together. Either explcitly set ' +
+ 'preserveLicenseComments to false (default is true) or ' +
+ 'turn off generateSourceMaps. If you want source maps with ' +
+ 'license comments, see: ' +
+ 'http://requirejs.org/docs/errors.html#sourcemapcomments');
+ } else if (config.optimize !== 'none' &&
+ config.optimize !== 'closure' &&
+ config.optimize !== 'uglify2') {
+ //Allow optimize: none to pass, since it is useful when toggling
+ //minification on and off to debug something, and it implicitly
+ //works, since it does not need a source map.
+ throw new Error('optimize: "' + config.optimize +
+ '" does not support generateSourceMaps.');
+ }
+ }
+
+ if ((config.name || config.include) && !config.modules) {
+ //Just need to build one file, but may be part of a whole appDir/
+ //baseUrl copy, but specified on the command line, so cannot do
+ //the modules array setup. So create a modules section in that
+ //case.
+ config.modules = [
+ {
+ name: config.name,
+ out: config.out,
+ create: config.create,
+ include: config.include,
+ exclude: config.exclude,
+ excludeShallow: config.excludeShallow,
+ insertRequire: config.insertRequire,
+ stubModules: config.stubModules
+ }
+ ];
+ delete config.stubModules;
+ } else if (config.modules && config.out) {
+ throw new Error('If the "modules" option is used, then there ' +
+ 'should be a "dir" option set and "out" should ' +
+ 'not be used since "out" is only for single file ' +
+ 'optimization output.');
+ } else if (config.modules && config.name) {
+ throw new Error('"name" and "modules" options are incompatible. ' +
+ 'Either use "name" if doing a single file ' +
+ 'optimization, or "modules" if you want to target ' +
+ 'more than one file for optimization.');
+ }
+
+ if (config.out && !config.cssIn) {
+ //Just one file to optimize.
+
+ //Does not have a build file, so set up some defaults.
+ //Optimizing CSS should not be allowed, unless explicitly
+ //asked for on command line. In that case the only task is
+ //to optimize a CSS file.
+ if (!cfg.optimizeCss) {
+ config.optimizeCss = "none";
+ }
+ }
+
+ //Normalize cssPrefix
+ if (config.cssPrefix) {
+ //Make sure cssPrefix ends in a slash
+ config.cssPrefix = endsWithSlash(config.cssPrefix);
+ } else {
+ config.cssPrefix = '';
+ }
+
+ //Cycle through modules and normalize
+ if (config.modules && config.modules.length) {
+ config.modules.forEach(function (mod) {
+
+ //Combine any local stubModules with global values.
+ if (config.stubModules) {
+ mod.stubModules = config.stubModules.concat(mod.stubModules || []);
+ }
+
+ //Create a hash lookup for the stubModules config to make lookup
+ //cheaper later.
+ if (mod.stubModules) {
+ mod.stubModules._byName = {};
+ mod.stubModules.forEach(function (id) {
+ mod.stubModules._byName[id] = true;
+ });
+ }
+
+ // Legacy command support, which allowed a single string ID
+ // for include.
+ if (typeof mod.include === 'string') {
+ mod.include = [mod.include];
+ }
+
+ //Allow wrap config in overrides, but normalize it.
+ if (mod.override) {
+ normalizeWrapConfig(mod.override, absFilePath);
+ }
+ });
+ }
+
+ normalizeWrapConfig(config, absFilePath);
+
+ //Do final input verification
+ if (config.context) {
+ throw new Error('The build argument "context" is not supported' +
+ ' in a build. It should only be used in web' +
+ ' pages.');
+ }
+
+ //Set up normalizeDirDefines. If not explicitly set, if optimize "none",
+ //set to "skip" otherwise set to "all".
+ if (!hasProp(config, 'normalizeDirDefines')) {
+ if (config.optimize === 'none' || config.skipDirOptimize) {
+ config.normalizeDirDefines = 'skip';
+ } else {
+ config.normalizeDirDefines = 'all';
+ }
+ }
+
+ //Set file.fileExclusionRegExp if desired
+ if (hasProp(config, 'fileExclusionRegExp')) {
+ if (typeof config.fileExclusionRegExp === "string") {
+ file.exclusionRegExp = new RegExp(config.fileExclusionRegExp);
+ } else {
+ file.exclusionRegExp = config.fileExclusionRegExp;
+ }
+ } else if (hasProp(config, 'dirExclusionRegExp')) {
+ //Set file.dirExclusionRegExp if desired, this is the old
+ //name for fileExclusionRegExp before 1.0.2. Support for backwards
+ //compatibility
+ file.exclusionRegExp = config.dirExclusionRegExp;
+ }
+
+ //Track the deps, but in a different key, so that they are not loaded
+ //as part of config seeding before all config is in play (#648). Was
+ //going to merge this in with "include", but include is added after
+ //the "name" target. To preserve what r.js has done previously, make
+ //sure "deps" comes before the "name".
+ if (config.deps) {
+ config._depsInclude = config.deps;
+ }
+
+
+ //Remove things that may cause problems in the build.
+ //deps already merged above
+ delete config.deps;
+ delete config.jQuery;
+ delete config.enforceDefine;
+ delete config.urlArgs;
+
+ return config;
+ };
+
+ /**
+ * finds the module being built/optimized with the given moduleName,
+ * or returns null.
+ * @param {String} moduleName
+ * @param {Array} modules
+ * @returns {Object} the module object from the build profile, or null.
+ */
+ build.findBuildModule = function (moduleName, modules) {
+ var i, module;
+ for (i = 0; i < modules.length; i++) {
+ module = modules[i];
+ if (module.name === moduleName) {
+ return module;
+ }
+ }
+ return null;
+ };
+
+ /**
+ * Removes a module name and path from a layer, if it is supposed to be
+ * excluded from the layer.
+ * @param {String} moduleName the name of the module
+ * @param {String} path the file path for the module
+ * @param {Object} layer the layer to remove the module/path from
+ */
+ build.removeModulePath = function (module, path, layer) {
+ var index = layer.buildFilePaths.indexOf(path);
+ if (index !== -1) {
+ layer.buildFilePaths.splice(index, 1);
+ }
+ };
+
+ /**
+ * Uses the module build config object to trace the dependencies for the
+ * given module.
+ *
+ * @param {Object} module the module object from the build config info.
+ * @param {Object} config the build config object.
+ * @param {Object} [baseLoaderConfig] the base loader config to use for env resets.
+ *
+ * @returns {Object} layer information about what paths and modules should
+ * be in the flattened module.
+ */
+ build.traceDependencies = function (module, config, baseLoaderConfig) {
+ var include, override, layer, context, oldContext,
+ rawTextByIds,
+ syncChecks = {
+ rhino: true,
+ node: true,
+ xpconnect: true
+ },
+ deferred = prim();
+
+ //Reset some state set up in requirePatch.js, and clean up require's
+ //current context.
+ oldContext = require._buildReset();
+
+ //Grab the reset layer and context after the reset, but keep the
+ //old config to reuse in the new context.
+ layer = require._layer;
+ context = layer.context;
+
+ //Put back basic config, use a fresh object for it.
+ if (baseLoaderConfig) {
+ require(lang.deeplikeCopy(baseLoaderConfig));
+ }
+
+ logger.trace("\nTracing dependencies for: " + (module.name ||
+ (typeof module.out === 'function' ? 'FUNCTION' : module.out)));
+ include = config._depsInclude || [];
+ include = include.concat(module.name && !module.create ? [module.name] : []);
+ if (module.include) {
+ include = include.concat(module.include);
+ }
+
+ //If there are overrides to basic config, set that up now.;
+ if (module.override) {
+ if (baseLoaderConfig) {
+ override = build.createOverrideConfig(baseLoaderConfig, module.override);
+ } else {
+ override = lang.deeplikeCopy(module.override);
+ }
+ require(override);
+ }
+
+ //Now, populate the rawText cache with any values explicitly passed in
+ //via config.
+ rawTextByIds = require.s.contexts._.config.rawText;
+ if (rawTextByIds) {
+ lang.eachProp(rawTextByIds, function (contents, id) {
+ var url = require.toUrl(id) + '.js';
+ require._cachedRawText[url] = contents;
+ });
+ }
+
+
+ //Configure the callbacks to be called.
+ deferred.reject.__requireJsBuild = true;
+
+ //Use a wrapping function so can check for errors.
+ function includeFinished(value) {
+ //If a sync build environment, check for errors here, instead of
+ //in the then callback below, since some errors, like two IDs pointed
+ //to same URL but only one anon ID will leave the loader in an
+ //unresolved state since a setTimeout cannot be used to check for
+ //timeout.
+ var hasError = false;
+ if (syncChecks[env.get()]) {
+ try {
+ build.checkForErrors(context);
+ } catch (e) {
+ hasError = true;
+ deferred.reject(e);
+ }
+ }
+
+ if (!hasError) {
+ deferred.resolve(value);
+ }
+ }
+ includeFinished.__requireJsBuild = true;
+
+ //Figure out module layer dependencies by calling require to do the work.
+ require(include, includeFinished, deferred.reject);
+
+ // If a sync env, then with the "two IDs to same anon module path"
+ // issue, the require never completes, need to check for errors
+ // here.
+ if (syncChecks[env.get()]) {
+ build.checkForErrors(context);
+ }
+
+ return deferred.promise.then(function () {
+ //Reset config
+ if (module.override && baseLoaderConfig) {
+ require(lang.deeplikeCopy(baseLoaderConfig));
+ }
+
+ build.checkForErrors(context);
+
+ return layer;
+ });
+ };
+
+ build.checkForErrors = function (context) {
+ //Check to see if it all loaded. If not, then throw, and give
+ //a message on what is left.
+ var id, prop, mod, idParts, pluginId, pluginResources,
+ errMessage = '',
+ failedPluginMap = {},
+ failedPluginIds = [],
+ errIds = [],
+ errUrlMap = {},
+ errUrlConflicts = {},
+ hasErrUrl = false,
+ hasUndefined = false,
+ defined = context.defined,
+ registry = context.registry;
+
+ function populateErrUrlMap(id, errUrl, skipNew) {
+ // Loader plugins do not have an errUrl, so skip them.
+ if (!errUrl) {
+ return;
+ }
+
+ if (!skipNew) {
+ errIds.push(id);
+ }
+
+ if (errUrlMap[errUrl]) {
+ hasErrUrl = true;
+ //This error module has the same URL as another
+ //error module, could be misconfiguration.
+ if (!errUrlConflicts[errUrl]) {
+ errUrlConflicts[errUrl] = [];
+ //Store the original module that had the same URL.
+ errUrlConflicts[errUrl].push(errUrlMap[errUrl]);
+ }
+ errUrlConflicts[errUrl].push(id);
+ } else if (!skipNew) {
+ errUrlMap[errUrl] = id;
+ }
+ }
+
+ for (id in registry) {
+ if (hasProp(registry, id) && id.indexOf('_@r') !== 0) {
+ hasUndefined = true;
+ mod = getOwn(registry, id);
+ idParts = id.split('!');
+ pluginId = idParts[0];
+
+ if (id.indexOf('_unnormalized') === -1 && mod && mod.enabled) {
+ populateErrUrlMap(id, mod.map.url);
+ }
+
+ //Look for plugins that did not call load()
+
+ if (idParts.length > 1) {
+ if (falseProp(failedPluginMap, pluginId)) {
+ failedPluginIds.push(pluginId);
+ }
+ pluginResources = failedPluginMap[pluginId];
+ if (!pluginResources) {
+ pluginResources = failedPluginMap[pluginId] = [];
+ }
+ pluginResources.push(id + (mod.error ? ': ' + mod.error : ''));
+ }
+ }
+ }
+
+ // If have some modules that are not defined/stuck in the registry,
+ // then check defined modules for URL overlap.
+ if (hasUndefined) {
+ for (id in defined) {
+ if (hasProp(defined, id) && id.indexOf('!') === -1) {
+ populateErrUrlMap(id, require.toUrl(id) + '.js', true);
+ }
+ }
+ }
+
+ if (errIds.length || failedPluginIds.length) {
+ if (failedPluginIds.length) {
+ errMessage += 'Loader plugin' +
+ (failedPluginIds.length === 1 ? '' : 's') +
+ ' did not call ' +
+ 'the load callback in the build:\n' +
+ failedPluginIds.map(function (pluginId) {
+ var pluginResources = failedPluginMap[pluginId];
+ return pluginId + ':\n ' + pluginResources.join('\n ');
+ }).join('\n') + '\n';
+ }
+ errMessage += 'Module loading did not complete for: ' + errIds.join(', ');
+
+ if (hasErrUrl) {
+ errMessage += '\nThe following modules share the same URL. This ' +
+ 'could be a misconfiguration if that URL only has ' +
+ 'one anonymous module in it:';
+ for (prop in errUrlConflicts) {
+ if (hasProp(errUrlConflicts, prop)) {
+ errMessage += '\n' + prop + ': ' +
+ errUrlConflicts[prop].join(', ');
+ }
+ }
+ }
+ throw new Error(errMessage);
+ }
+ };
+
+ build.createOverrideConfig = function (config, override) {
+ var cfg = lang.deeplikeCopy(config),
+ oride = lang.deeplikeCopy(override);
+
+ lang.eachProp(oride, function (value, prop) {
+ if (hasProp(build.objProps, prop)) {
+ //An object property, merge keys. Start a new object
+ //so that source object in config does not get modified.
+ cfg[prop] = {};
+ lang.mixin(cfg[prop], config[prop], true);
+ lang.mixin(cfg[prop], override[prop], true);
+ } else {
+ cfg[prop] = override[prop];
+ }
+ });
+
+ return cfg;
+ };
+
+ /**
+ * Uses the module build config object to create an flattened version
+ * of the module, with deep dependencies included.
+ *
+ * @param {Object} module the module object from the build config info.
+ *
+ * @param {Object} layer the layer object returned from build.traceDependencies.
+ *
+ * @param {Object} the build config object.
+ *
+ * @returns {Object} with two properties: "text", the text of the flattened
+ * module, and "buildText", a string of text representing which files were
+ * included in the flattened module text.
+ */
+ build.flattenModule = function (module, layer, config) {
+ var fileContents, sourceMapGenerator,
+ sourceMapBase,
+ buildFileContents = '';
+
+ return prim().start(function () {
+ var reqIndex, currContents, fileForSourceMap,
+ moduleName, shim, packageName,
+ parts, builder, writeApi,
+ namespace, namespaceWithDot, stubModulesByName,
+ context = layer.context,
+ onLayerEnds = [],
+ onLayerEndAdded = {},
+ pkgsMainMap = {};
+
+ //Use override settings, particularly for pragmas
+ //Do this before the var readings since it reads config values.
+ if (module.override) {
+ config = build.createOverrideConfig(config, module.override);
+ }
+
+ namespace = config.namespace || '';
+ namespaceWithDot = namespace ? namespace + '.' : '';
+ stubModulesByName = (module.stubModules && module.stubModules._byName) || {};
+
+ //Start build output for the module.
+ module.onCompleteData = {
+ name: module.name,
+ path: (config.dir ? module._buildPath.replace(config.dir, "") : module._buildPath),
+ included: []
+ };
+
+ buildFileContents += "\n" +
+ module.onCompleteData.path +
+ "\n----------------\n";
+
+ //If there was an existing file with require in it, hoist to the top.
+ if (layer.existingRequireUrl) {
+ reqIndex = layer.buildFilePaths.indexOf(layer.existingRequireUrl);
+ if (reqIndex !== -1) {
+ layer.buildFilePaths.splice(reqIndex, 1);
+ layer.buildFilePaths.unshift(layer.existingRequireUrl);
+ }
+ }
+
+ if (config.generateSourceMaps) {
+ sourceMapBase = config.dir || config.baseUrl;
+ fileForSourceMap = module._buildPath === 'FUNCTION' ?
+ (module.name || module.include[0] || 'FUNCTION') + '.build.js' :
+ module._buildPath.replace(sourceMapBase, '');
+ sourceMapGenerator = new SourceMapGenerator.SourceMapGenerator({
+ file: fileForSourceMap
+ });
+ }
+
+ //Create a reverse lookup for packages main module IDs to their package
+ //names, useful for knowing when to write out define() package main ID
+ //adapters.
+ lang.eachProp(layer.context.config.pkgs, function(value, prop) {
+ pkgsMainMap[value] = prop;
+ });
+
+ //Write the built module to disk, and build up the build output.
+ fileContents = config.wrap ? config.wrap.start : "";
+ return prim.serial(layer.buildFilePaths.map(function (path) {
+ return function () {
+ var lineCount,
+ singleContents = '';
+
+ moduleName = layer.buildFileToModule[path];
+
+ //If the moduleName is a package main, then hold on to the
+ //packageName in case an adapter needs to be written.
+ packageName = getOwn(pkgsMainMap, moduleName);
+
+ return prim().start(function () {
+ //Figure out if the module is a result of a build plugin, and if so,
+ //then delegate to that plugin.
+ parts = context.makeModuleMap(moduleName);
+ builder = parts.prefix && getOwn(context.defined, parts.prefix);
+ if (builder) {
+ if (builder.onLayerEnd && falseProp(onLayerEndAdded, parts.prefix)) {
+ onLayerEnds.push(builder);
+ onLayerEndAdded[parts.prefix] = true;
+ }
+
+ if (builder.write) {
+ writeApi = function (input) {
+ singleContents += "\n" + addSemiColon(input, config);
+ if (config.onBuildWrite) {
+ singleContents = config.onBuildWrite(moduleName, path, singleContents);
+ }
+ };
+ writeApi.asModule = function (moduleName, input) {
+ singleContents += "\n" +
+ addSemiColon(build.toTransport(namespace, moduleName, path, input, layer, {
+ useSourceUrl: layer.context.config.useSourceUrl
+ }), config);
+ if (config.onBuildWrite) {
+ singleContents = config.onBuildWrite(moduleName, path, singleContents);
+ }
+ };
+ builder.write(parts.prefix, parts.name, writeApi);
+ }
+ return;
+ } else {
+ return prim().start(function () {
+ if (hasProp(stubModulesByName, moduleName)) {
+ //Just want to insert a simple module definition instead
+ //of the source module. Useful for plugins that inline
+ //all their resources.
+ if (hasProp(layer.context.plugins, moduleName)) {
+ //Slightly different content for plugins, to indicate
+ //that dynamic loading will not work.
+ return 'define({load: function(id){throw new Error("Dynamic load not allowed: " + id);}});';
+ } else {
+ return 'define({});';
+ }
+ } else {
+ return require._cacheReadAsync(path);
+ }
+ }).then(function (text) {
+ var hasPackageName;
+
+ currContents = text;
+
+ if (config.cjsTranslate &&
+ (!config.shim || !lang.hasProp(config.shim, moduleName))) {
+ currContents = commonJs.convert(path, currContents);
+ }
+
+ if (config.onBuildRead) {
+ currContents = config.onBuildRead(moduleName, path, currContents);
+ }
+
+ if (packageName) {
+ hasPackageName = (packageName === parse.getNamedDefine(currContents));
+ }
+
+ if (namespace) {
+ currContents = pragma.namespace(currContents, namespace);
+ }
+
+ currContents = build.toTransport(namespace, moduleName, path, currContents, layer, {
+ useSourceUrl: config.useSourceUrl
+ });
+
+ if (packageName && !hasPackageName) {
+ currContents = addSemiColon(currContents, config) + '\n';
+ currContents += namespaceWithDot + "define('" +
+ packageName + "', ['" + moduleName +
+ "'], function (main) { return main; });\n";
+ }
+
+ if (config.onBuildWrite) {
+ currContents = config.onBuildWrite(moduleName, path, currContents);
+ }
+
+ //Semicolon is for files that are not well formed when
+ //concatenated with other content.
+ singleContents += addSemiColon(currContents, config);
+ });
+ }
+ }).then(function () {
+ var refPath, pluginId, resourcePath,
+ sourceMapPath, sourceMapLineNumber,
+ shortPath = path.replace(config.dir, "");
+
+ module.onCompleteData.included.push(shortPath);
+ buildFileContents += shortPath + "\n";
+
+ //Some files may not have declared a require module, and if so,
+ //put in a placeholder call so the require does not try to load them
+ //after the module is processed.
+ //If we have a name, but no defined module, then add in the placeholder.
+ if (moduleName && falseProp(layer.modulesWithNames, moduleName) && !config.skipModuleInsertion) {
+ shim = config.shim && (getOwn(config.shim, moduleName) || (packageName && getOwn(config.shim, packageName)));
+ if (shim) {
+ if (config.wrapShim) {
+ singleContents = '(function(root) {\n' +
+ namespaceWithDot + 'define("' + moduleName + '", ' +
+ (shim.deps && shim.deps.length ?
+ build.makeJsArrayString(shim.deps) + ', ' : '[], ') +
+ 'function() {\n' +
+ ' return (function() {\n' +
+ singleContents +
+ // Start with a \n in case last line is a comment
+ // in the singleContents, like a sourceURL comment.
+ '\n' + (shim.exportsFn ? shim.exportsFn() : '') +
+ '\n' +
+ ' }).apply(root, arguments);\n' +
+ '});\n' +
+ '}(this));\n';
+ } else {
+ singleContents += '\n' + namespaceWithDot + 'define("' + moduleName + '", ' +
+ (shim.deps && shim.deps.length ?
+ build.makeJsArrayString(shim.deps) + ', ' : '') +
+ (shim.exportsFn ? shim.exportsFn() : 'function(){}') +
+ ');\n';
+ }
+ } else {
+ singleContents += '\n' + namespaceWithDot + 'define("' + moduleName + '", function(){});\n';
+ }
+ }
+
+ //Add line break at end of file, instead of at beginning,
+ //so source map line numbers stay correct, but still allow
+ //for some space separation between files in case ASI issues
+ //for concatenation would cause an error otherwise.
+ singleContents += '\n';
+
+ //Add to the source map
+ if (sourceMapGenerator) {
+ refPath = config.out ? config.baseUrl : module._buildPath;
+ parts = path.split('!');
+ if (parts.length === 1) {
+ //Not a plugin resource, fix the path
+ sourceMapPath = build.makeRelativeFilePath(refPath, path);
+ } else {
+ //Plugin resource. If it looks like just a plugin
+ //followed by a module ID, pull off the plugin
+ //and put it at the end of the name, otherwise
+ //just leave it alone.
+ pluginId = parts.shift();
+ resourcePath = parts.join('!');
+ if (resourceIsModuleIdRegExp.test(resourcePath)) {
+ sourceMapPath = build.makeRelativeFilePath(refPath, require.toUrl(resourcePath)) +
+ '!' + pluginId;
+ } else {
+ sourceMapPath = path;
+ }
+ }
+
+ sourceMapLineNumber = fileContents.split('\n').length - 1;
+ lineCount = singleContents.split('\n').length;
+ for (var i = 1; i <= lineCount; i += 1) {
+ sourceMapGenerator.addMapping({
+ generated: {
+ line: sourceMapLineNumber + i,
+ column: 0
+ },
+ original: {
+ line: i,
+ column: 0
+ },
+ source: sourceMapPath
+ });
+ }
+
+ //Store the content of the original in the source
+ //map since other transforms later like minification
+ //can mess up translating back to the original
+ //source.
+ sourceMapGenerator.setSourceContent(sourceMapPath, singleContents);
+ }
+
+ //Add the file to the final contents
+ fileContents += singleContents;
+ });
+ };
+ })).then(function () {
+ if (onLayerEnds.length) {
+ onLayerEnds.forEach(function (builder) {
+ var path;
+ if (typeof module.out === 'string') {
+ path = module.out;
+ } else if (typeof module._buildPath === 'string') {
+ path = module._buildPath;
+ }
+ builder.onLayerEnd(function (input) {
+ fileContents += "\n" + addSemiColon(input, config);
+ }, {
+ name: module.name,
+ path: path
+ });
+ });
+ }
+
+ if (module.create) {
+ //The ID is for a created layer. Write out
+ //a module definition for it in case the
+ //built file is used with enforceDefine
+ //(#432)
+ fileContents += '\n' + namespaceWithDot + 'define("' + module.name + '", function(){});\n';
+ }
+
+ //Add a require at the end to kick start module execution, if that
+ //was desired. Usually this is only specified when using small shim
+ //loaders like almond.
+ if (module.insertRequire) {
+ fileContents += '\n' + namespaceWithDot + 'require(["' + module.insertRequire.join('", "') + '"]);\n';
+ }
+ });
+ }).then(function () {
+ return {
+ text: config.wrap ?
+ fileContents + config.wrap.end :
+ fileContents,
+ buildText: buildFileContents,
+ sourceMap: sourceMapGenerator ?
+ JSON.stringify(sourceMapGenerator.toJSON(), null, ' ') :
+ undefined
+ };
+ });
+ };
+
+ //Converts an JS array of strings to a string representation.
+ //Not using JSON.stringify() for Rhino's sake.
+ build.makeJsArrayString = function (ary) {
+ return '["' + ary.map(function (item) {
+ //Escape any double quotes, backslashes
+ return lang.jsEscape(item);
+ }).join('","') + '"]';
+ };
+
+ build.toTransport = function (namespace, moduleName, path, contents, layer, options) {
+ var baseUrl = layer && layer.context.config.baseUrl;
+
+ function onFound(info) {
+ //Only mark this module as having a name if not a named module,
+ //or if a named module and the name matches expectations.
+ if (layer && (info.needsId || info.foundId === moduleName)) {
+ layer.modulesWithNames[moduleName] = true;
+ }
+ }
+
+ //Convert path to be a local one to the baseUrl, useful for
+ //useSourceUrl.
+ if (baseUrl) {
+ path = path.replace(baseUrl, '');
+ }
+
+ return transform.toTransport(namespace, moduleName, path, contents, onFound, options);
+ };
+
+ return build;
+});
+
+ }
+
+
+ /**
+ * Sets the default baseUrl for requirejs to be directory of top level
+ * script.
+ */
+ function setBaseUrl(fileName) {
+ //Use the file name's directory as the baseUrl if available.
+ dir = fileName.replace(/\\/g, '/');
+ if (dir.indexOf('/') !== -1) {
+ dir = dir.split('/');
+ dir.pop();
+ dir = dir.join('/');
+ //Make sure dir is JS-escaped, since it will be part of a JS string.
+ exec("require({baseUrl: '" + dir.replace(/[\\"']/g, '\\$&') + "'});");
+ }
+ }
+
+ function createRjsApi() {
+ //Create a method that will run the optimzer given an object
+ //config.
+ requirejs.optimize = function (config, callback, errback) {
+ if (!loadedOptimizedLib) {
+ loadLib();
+ loadedOptimizedLib = true;
+ }
+
+ //Create the function that will be called once build modules
+ //have been loaded.
+ var runBuild = function (build, logger, quit) {
+ //Make sure config has a log level, and if not,
+ //make it "silent" by default.
+ config.logLevel = config.hasOwnProperty('logLevel') ?
+ config.logLevel : logger.SILENT;
+
+ //Reset build internals first in case this is part
+ //of a long-running server process that could have
+ //exceptioned out in a bad state. It is only defined
+ //after the first call though.
+ if (requirejs._buildReset) {
+ requirejs._buildReset();
+ requirejs._cacheReset();
+ }
+
+ function done(result) {
+ //And clean up, in case something else triggers
+ //a build in another pathway.
+ if (requirejs._buildReset) {
+ requirejs._buildReset();
+ requirejs._cacheReset();
+ }
+
+ // Ensure errors get propagated to the errback
+ if (result instanceof Error) {
+ throw result;
+ }
+
+ return result;
+ }
+
+ errback = errback || function (err) {
+ // Using console here since logger may have
+ // turned off error logging. Since quit is
+ // called want to be sure a message is printed.
+ console.log(err);
+ quit(1);
+ };
+
+ build(config).then(done, done).then(callback, errback);
+ };
+
+ requirejs({
+ context: 'build'
+ }, ['build', 'logger', 'env!env/quit'], runBuild);
+ };
+
+ requirejs.tools = {
+ useLib: function (contextName, callback) {
+ if (!callback) {
+ callback = contextName;
+ contextName = 'uselib';
+ }
+
+ if (!useLibLoaded[contextName]) {
+ loadLib();
+ useLibLoaded[contextName] = true;
+ }
+
+ var req = requirejs({
+ context: contextName
+ });
+
+ req(['build'], function () {
+ callback(req);
+ });
+ }
+ };
+
+ requirejs.define = define;
+ }
+
+ //If in Node, and included via a require('requirejs'), just export and
+ //THROW IT ON THE GROUND!
+ if (env === 'node' && reqMain !== module) {
+ setBaseUrl(path.resolve(reqMain ? reqMain.filename : '.'));
+
+ createRjsApi();
+
+ module.exports = requirejs;
+ return;
+ } else if (env === 'browser') {
+ //Only option is to use the API.
+ setBaseUrl(location.href);
+ createRjsApi();
+ return;
+ } else if ((env === 'rhino' || env === 'xpconnect') &&
+ //User sets up requirejsAsLib variable to indicate it is loaded
+ //via load() to be used as a library.
+ typeof requirejsAsLib !== 'undefined' && requirejsAsLib) {
+ //This script is loaded via rhino's load() method, expose the
+ //API and get out.
+ setBaseUrl(fileName);
+ createRjsApi();
+ return;
+ }
+
+ if (commandOption === 'o') {
+ //Do the optimizer work.
+ loadLib();
+
+ /**
+ * @license Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+
+/*
+ * Create a build.js file that has the build options you want and pass that
+ * build file to this file to do the build. See example.build.js for more information.
+ */
+
+/*jslint strict: false, nomen: false */
+/*global require: false */
+
+require({
+ baseUrl: require.s.contexts._.config.baseUrl,
+ //Use a separate context than the default context so that the
+ //build can use the default context.
+ context: 'build',
+ catchError: {
+ define: true
+ }
+}, ['env!env/args', 'env!env/quit', 'logger', 'build'],
+function (args, quit, logger, build) {
+ build(args).then(function () {}, function (err) {
+ logger.error(err);
+ quit(1);
+ });
+});
+
+
+ } else if (commandOption === 'v') {
+ console.log('r.js: ' + version +
+ ', RequireJS: ' + this.requirejsVars.require.version +
+ ', UglifyJS2: 2.4.16, UglifyJS: 1.3.4');
+ } else if (commandOption === 'convert') {
+ loadLib();
+
+ this.requirejsVars.require(['env!env/args', 'commonJs', 'env!env/print'],
+ function (args, commonJs, print) {
+
+ var srcDir, outDir;
+ srcDir = args[0];
+ outDir = args[1];
+
+ if (!srcDir || !outDir) {
+ print('Usage: path/to/commonjs/modules output/dir');
+ return;
+ }
+
+ commonJs.convertDir(args[0], args[1]);
+ });
+ } else {
+ //Just run an app
+
+ //Load the bundled libraries for use in the app.
+ if (commandOption === 'lib') {
+ loadLib();
+ }
+
+ setBaseUrl(fileName);
+
+ if (exists(fileName)) {
+ exec(readFile(fileName), fileName);
+ } else {
+ showHelp();
+ }
+ }
+
+}((typeof console !== 'undefined' ? console : undefined),
+ (typeof Packages !== 'undefined' || (typeof window === 'undefined' &&
+ typeof Components !== 'undefined' && Components.interfaces) ?
+ Array.prototype.slice.call(arguments, 0) : []),
+ (typeof readFile !== 'undefined' ? readFile : undefined)));
diff --git a/system/libraries/javascript/index.html b/system/libraries/javascript/index.html
new file mode 100644
index 000000000..c942a79ce
--- /dev/null
+++ b/system/libraries/javascript/index.html
@@ -0,0 +1,10 @@
+<html>
+<head>
+ <title>403 Forbidden</title>
+</head>
+<body>
+
+<p>Directory access is forbidden.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/tests/Bootstrap.php b/tests/Bootstrap.php
deleted file mode 100644
index ada6a5998..000000000
--- a/tests/Bootstrap.php
+++ /dev/null
@@ -1,83 +0,0 @@
-<?php
-// Errors on full!
-ini_set('display_errors', 1);
-error_reporting(E_ALL | E_STRICT);
-
-$dir = realpath(dirname(__FILE__));
-
-// Path constants
-defined('PROJECT_BASE') OR define('PROJECT_BASE', realpath($dir.'/../').'/');
-defined('SYSTEM_PATH') OR define('SYSTEM_PATH', PROJECT_BASE.'system/');
-
-// Get vfsStream either via PEAR or composer
-foreach (explode(PATH_SEPARATOR, get_include_path()) as $path)
-{
- if (file_exists($path.DIRECTORY_SEPARATOR.'vfsStream/vfsStream.php'))
- {
- require_once 'vfsStream/vfsStream.php';
- break;
- }
-}
-
-if ( ! class_exists('vfsStream') && file_exists(PROJECT_BASE.'vendor/autoload.php'))
-{
- include_once PROJECT_BASE.'vendor/autoload.php';
- class_alias('org\bovigo\vfs\vfsStream', 'vfsStream');
- class_alias('org\bovigo\vfs\vfsStreamDirectory', 'vfsStreamDirectory');
- class_alias('org\bovigo\vfs\vfsStreamWrapper', 'vfsStreamWrapper');
-}
-
-// Define CI path constants to VFS (filesystem setup in CI_TestCase::setUp)
-defined('BASEPATH') OR define('BASEPATH', vfsStream::url('system/'));
-defined('APPPATH') OR define('APPPATH', vfsStream::url('application/'));
-defined('VIEWPATH') OR define('VIEWPATH', APPPATH.'views/');
-defined('ENVIRONMENT') OR define('ENVIRONMENT', 'development');
-
-// Set localhost "remote" IP
-isset($_SERVER['REMOTE_ADDR']) OR $_SERVER['REMOTE_ADDR'] = '127.0.0.1';
-
-// Prep our test environment
-include_once $dir.'/mocks/core/common.php';
-include_once SYSTEM_PATH.'core/Common.php';
-
-ini_set('default_charset', 'UTF-8');
-
-if (extension_loaded('mbstring'))
-{
- defined('MB_ENABLED') OR define('MB_ENABLED', TRUE);
- @ini_set('mbstring.internal_encoding', 'UTF-8');
- mb_substitute_character('none');
-}
-else
-{
- defined('MB_ENABLED') OR define('MB_ENABLED', FALSE);
-}
-
-if (extension_loaded('iconv'))
-{
- defined('ICONV_ENABLED') OR define('ICONV_ENABLED', TRUE);
- @ini_set('iconv.internal_encoding', 'UTF-8');
-}
-else
-{
- defined('ICONV_ENABLED') OR define('ICONV_ENABLED', FALSE);
-}
-
-is_php('5.6') && ini_set('php.internal_encoding', 'UTF-8');
-
-if (is_php('7.0'))
-{
- $test_case_code = file_get_contents(PROJECT_BASE.'vendor/phpunit/phpunit/src/Framework/TestCase.php');
- $test_case_code = preg_replace('/^\s+((?:protected|public)(?: static)? function \w+\(\)): void/m', '$1', $test_case_code);
- file_put_contents(PROJECT_BASE.'vendor/phpunit/phpunit/src/Framework/TestCase.php', $test_case_code);
-}
-
-include_once SYSTEM_PATH.'core/compat/mbstring.php';
-include_once SYSTEM_PATH.'core/compat/hash.php';
-include_once SYSTEM_PATH.'core/compat/password.php';
-include_once SYSTEM_PATH.'core/compat/standard.php';
-
-include_once $dir.'/mocks/autoloader.php';
-spl_autoload_register('autoload');
-
-unset($dir); \ No newline at end of file
diff --git a/tests/README.md b/tests/README.md
deleted file mode 100644
index 04dfbc3d8..000000000
--- a/tests/README.md
+++ /dev/null
@@ -1,226 +0,0 @@
-# CodeIgniter Unit Tests #
-
-Status : [![Build Status](https://secure.travis-ci.org/bcit-ci/CodeIgniter.png?branch=develop)](http://travis-ci.org/bcit-ci/CodeIgniter)
-
-### Introduction:
-
-This is the preliminary CodeIgniter testing documentation. It
-will cover both internal as well as external APIs and the reasoning
-behind their implementation, where appropriate. As with all CodeIgniter
-documentation, this file should maintain a mostly human readable
-format to facilitate clean api design. [see http://arrenbrecht.ch/testing/]
-
-*First public draft: everything is subject to change*
-
-### Requirements
-
-PHP Unit >= 3.5.6
-
- pear channel-discover pear.phpunit.de
- pear channel-discover pear.symfony.com
- pear install phpunit/PHPUnit
-
-vfsStream
-
- pear channel-discover pear.bovigo.org
- pear install bovigo/vfsStream-beta
-
-#### Installation of PEAR and PHPUnit on Ubuntu
-
- Installation on Ubuntu requires a few steps. Depending on your setup you may
- need to use 'sudo' to install these. Mileage may vary but these steps are a
- good start.
-
- # Install the PEAR package
- sudo apt-get install php-pear
-
- # Add a few sources to PEAR
- pear channel-discover pear.phpunit.de
- pear channel-discover pear.symfony-project.com
- pear channel-discover components.ez.no
- pear channel-discover pear.bovigo.org
-
- # Finally install PHPUnit and vfsStream (including dependencies)
- pear install --alldeps phpunit/PHPUnit
- pear install --alldeps bovigo/vfsStream-beta
-
- # Finally, run 'phpunit' from within the ./tests directory
- # and you should be on your way!
-
-## Test Suites:
-
-CodeIgniter bootstraps a request very directly, with very flat class
-hierarchy. As a result, there is no main CodeIgniter class until the
-controller is instantiated.
-
-This has forced the core classes to be relatively decoupled, which is
-a good thing. However, it makes that portion of code relatively hard
-to test.
-
-Right now that means we'll probably have two core test suites, along
-with a base for application and package tests. That gives us:
-
-1. Bootstrap Test - test common.php and sanity check codeigniter.php [in planning]
-2. System Test - test core components in relative isolation [in development]
-3. Application Test - bootstrapping for application/tests [not started]
-4. Package Test - bootstrapping for <package>/tests [not started]
-
-### Test Environment:
-
-The test/Bootstrap.php file establishes global constants such as BASEPATH,
-APPPATH, and VIEWPATH, initializing them to point to VFS locations. The
-test case class employs vfsStream to make a clean virtual filesystem with
-the necessary paths for every individual test.
-
-Within each test case, VFS directory objects are available to use as arguments
-to the VFS convenience functions (see below):
-
-- ci_vfs_root: VFS filesystem root
-- ci_app_root: Application directory
-- ci_base_root: System directory
-- ci_view_root: Views directory
-
-Classes being instantiated for testing are read from the actual filesystem
-by the unit test autoloader, as are mockups created in tests/mocks. If you
-need access to the real system directory, the SYSTEM_PATH constant always
-points to it.
-
-Any other resources which need to be read from the path constants must be
-created or cloned within your test. Functions for doing so are outlined
-below.
-
-### CI_TestCase Documentation
-
-Test cases should extend CI_TestCase. This internally extends
-PHPUnit\_Framework\_TestCase, so you have access to all of your
-usual PHPUnit methods.
-
-We need to provide a simple way to modify the globals and the
-common function output. We also need to be able to mock up
-the super object as we please.
-
-Current API is *not stable*. Names and implementations will change.
-
- $this->ci_set_config($key, $val)
-
-Set the global config variables in a mock Config object. If key is an array,
-it will replace the entire config array. They are _not_ merged. If called
-without any parameters, it will create the mock object but not set any values.
-The mock Config object also provides rudimentary item() and load() stubs for
-delivering configured values to classes being tested and handling config load
-calls, respectively. The load() stub does _not_ actually load any files, it
-only records the filename provided. Check the config->loaded array to verify
-calls made.
-
- $this->ci_instance($obj)
-
-Set the object to use as the "super object", in a lot
-of cases this will be a simple stdClass with the attributes
-you need it to have. If no parameter, will return the instance.
-
- $this->ci_instance_var($name, $val)
-
-Add an attribute to the super object. This is useful if you
-set up a simple instance in setUp and then need to add different
-class mockups to your super object.
-
- $this->ci_core_class($name)
-
-Get the _class name_ of a core class, so that you can instantiate
-it. The variable is returned by reference and is tied to the correct
-$GLOBALS key. For example:
-
- $cfg =& $this->ci_core_class('cfg'); // returns 'CI_Config'
- $cfg = new $cfg; // instantiates config and overwrites the CFG global
-
- $this->ci_set_core_class($name, $obj)
-
-An alternative way to set one of the core globals.
-
- $this->ci_vfs_mkdir($name, $root)
-
-Creates a new directory in the test VFS. Pass a directory object to be the
-parent directory or none to create a root-level directory. Returns the new
-directory object.
-
- $this->ci_vfs_create($file, $content, $root, $path)
-
-Creates a new VFS file. '.php' is automatically appended to the filename if
-it has no extension. Pass a directory object as the root, and an optional path
-to recurse and/or create for containing the file. Path may be a string (such
-as 'models/subdir') or an array (e.g. - array('models', 'subdir') ). Existing
-directories in the VFS root will be recursed until a new directory is
-identified - all others in the path will be created, so you can mix-and-match
-old and new directories. If $file is an array (key = name, value = content),
-multiple files will be created in the same path.
-
- $this->ci_vfs_clone($path)
-
-Clones an existing file from the real filesystem to exist in the same path of
-the VFS. Path must be relative to the project root (i.e. - starting with
-'system' or 'application').
-
- $this->ci_vfs_path($path, $base)
-
-Creates a VFS file path string suitable for use with PHP file operations. Path
-may be absolute from the VFS root, or relative to a base path. It is often
-useful to use APPPATH or BASEPATH as the base.
-
- $this->helper($name)
-
-Loads a helper from the real filesystem.
-
- $this->lang($name)
-
-Loads a language file from the real filesystem and returns the $lang array.
-
- $this->ci_get_config() __internal__
-
-Returns the global config array. Internal as you shouldn't need to
-call this (you're setting it, after all). Used internally to make
-CI's get_config() work.
-
- CI_TestCase::instance() __internal__
-
-Returns an instance of the current test case. We force phpunit to
-run with backup-globals enabled, so this will always be the instance
-of the currently running test class.
-
-### Going forward
-
-#### 1. Bootstrap Test
-
-Testing common.php should be pretty simple. Include the file, and test the
-functions. May require some tweaking so that we can grab the statics from all
-methods (see is_loaded()). Testing the actual CodeIgniter.php file will most
-likely be an output test for the default view, with some object checking after
-the file runs. Needs consideration.
-
-#### 2. System Test
-
-Testing the core system relies on being able to isolate the core components
-as much as possible. A few of them access other core classes as globals. These
-should be mocked up and easy to manipulate.
-
-All functions in common.php should be a minimal implementation, or and mapped
-to a method in the test's parent class to gives us full control of their output.
-
-#### 3. Application Test:
-
-Not sure yet, needs to handle:
-
-- Libraries
-- Helpers
-- Models
-- MY_* files
-- Controllers (uh...?)
-- Views? (watir, selenium, cucumber?)
-- Database Testing
-
-#### 4. Package Test:
-
-I don't have a clue how this will work.
-
-Needs to be able to handle packages
-that are used multiple times within the application (i.e. EE/Pyro modules)
-as well as packages that are used by multiple applications (library distributions) \ No newline at end of file
diff --git a/tests/codeigniter/Setup_test.php b/tests/codeigniter/Setup_test.php
deleted file mode 100644
index 43545822a..000000000
--- a/tests/codeigniter/Setup_test.php
+++ /dev/null
@@ -1,13 +0,0 @@
-<?php
-
-class Setup_test extends \PHPUnit\Framework\TestCase {
-
- public function test_bootstrap_constants()
- {
- $this->assertTrue(defined('PROJECT_BASE'));
- $this->assertTrue(defined('BASEPATH'));
- $this->assertTrue(defined('APPPATH'));
- $this->assertTrue(defined('VIEWPATH'));
- }
-
-} \ No newline at end of file
diff --git a/tests/codeigniter/core/Benchmark_test.php b/tests/codeigniter/core/Benchmark_test.php
deleted file mode 100644
index 33bd742b2..000000000
--- a/tests/codeigniter/core/Benchmark_test.php
+++ /dev/null
@@ -1,67 +0,0 @@
-<?php
-
-class Benchmark_test extends CI_TestCase {
-
- public function set_up()
- {
- $this->benchmark = new CI_Benchmark();
- }
-
- // --------------------------------------------------------------------
-
- public function test_mark()
- {
- $this->assertEmpty($this->benchmark->marker);
-
- $this->benchmark->mark('code_start');
-
- $this->assertCount(1, $this->benchmark->marker);
- $this->assertArrayHasKey('code_start', $this->benchmark->marker);
- }
-
- // --------------------------------------------------------------------
-
- public function test_elapsed_time()
- {
- $this->assertEquals('{elapsed_time}', $this->benchmark->elapsed_time());
- $this->assertEmpty($this->benchmark->elapsed_time('undefined_point'));
-
- $this->benchmark->mark('code_start');
- $this->benchmark->mark('code_end');
-
- // Override values, because time isn't testable, but make sure the markers were set
- if (isset($this->benchmark->marker['code_start']) && is_float($this->benchmark->marker['code_start']))
- {
- $this->benchmark->marker['code_start'] = 1389956144.1944;
- }
-
- if (isset($this->benchmark->marker['code_end']) && is_float($this->benchmark->marker['code_end']))
- {
- $this->benchmark->marker['code_end'] = 1389956145.1946;
- }
-
- $this->assertEquals('1', $this->benchmark->elapsed_time('code_start', 'code_end', 0));
- $this->assertEquals('1.0', $this->benchmark->elapsed_time('code_start', 'code_end', 1));
- $this->assertEquals('1.00', $this->benchmark->elapsed_time('code_start', 'code_end', 2));
- $this->assertEquals('1.000', $this->benchmark->elapsed_time('code_start', 'code_end', 3));
- $this->assertEquals('1.0002', $this->benchmark->elapsed_time('code_start', 'code_end', 4));
- $this->assertEquals('1.0002', $this->benchmark->elapsed_time('code_start', 'code_end'));
-
- // Test with non-existing 2nd marker, but again - we need to override the value
- $this->benchmark->elapsed_time('code_start', 'code_end2');
- if (isset($this->benchmark->marker['code_end2']) && is_float($this->benchmark->marker['code_end2']))
- {
- $this->benchmark->marker['code_end2'] = 1389956146.2046;
- }
-
- $this->assertEquals('2.0102', $this->benchmark->elapsed_time('code_start', 'code_end2'));
- }
-
- // --------------------------------------------------------------------
-
- public function test_memory_usage()
- {
- $this->assertEquals('{memory_usage}', $this->benchmark->memory_usage());
- }
-
-}
diff --git a/tests/codeigniter/core/Common_test.php b/tests/codeigniter/core/Common_test.php
deleted file mode 100644
index effae50c5..000000000
--- a/tests/codeigniter/core/Common_test.php
+++ /dev/null
@@ -1,69 +0,0 @@
-<?php
-
-class Common_test extends CI_TestCase {
-
- public function test_is_php()
- {
- $this->assertTrue(is_php('1.2.0'));
- $this->assertFalse(is_php('9999.9.9'));
- }
-
- // ------------------------------------------------------------------------
-
- public function test_stringify_attributes()
- {
- $this->assertEquals(' class="foo" id="bar"', _stringify_attributes(array('class' => 'foo', 'id' => 'bar')));
-
- $atts = new stdClass;
- $atts->class = 'foo';
- $atts->id = 'bar';
- $this->assertEquals(' class="foo" id="bar"', _stringify_attributes($atts));
-
- $atts = new stdClass;
- $this->assertEquals('', _stringify_attributes($atts));
-
- $this->assertEquals(' class="foo" id="bar"', _stringify_attributes('class="foo" id="bar"'));
-
- $this->assertEquals('', _stringify_attributes(array()));
- }
-
- // ------------------------------------------------------------------------
-
- public function test_stringify_js_attributes()
- {
- $this->assertEquals('width=800,height=600', _stringify_attributes(array('width' => '800', 'height' => '600'), TRUE));
-
- $atts = new stdClass;
- $atts->width = 800;
- $atts->height = 600;
- $this->assertEquals('width=800,height=600', _stringify_attributes($atts, TRUE));
- }
-
- // ------------------------------------------------------------------------
-
- public function test_html_escape()
- {
- $this->assertEquals(
- html_escape('Here is a string containing "quoted" text.'),
- 'Here is a string containing &quot;quoted&quot; text.'
- );
-
- $this->assertEquals(
- html_escape(array('associative' => 'and', array('multi' => 'dimentional'))),
- array('associative' => 'and', array('multi' => 'dimentional'))
- );
- }
-
- // ------------------------------------------------------------------------
-
- public function test_remove_invisible_characters()
- {
- $raw_string = 'Here is a string containing invisible'.chr(0x08).' text %0e.';
- $removed_string = 'Here is a string containing invisible text %0e.';
- $this->assertEquals($removed_string, remove_invisible_characters($raw_string, FALSE));
-
- $raw_string = 'Here is a string %0econtaining url_encoded invisible%1F text.';
- $removed_string = 'Here is a string containing url_encoded invisible text.';
- $this->assertEquals($removed_string, remove_invisible_characters($raw_string));
- }
-}
diff --git a/tests/codeigniter/core/Config_test.php b/tests/codeigniter/core/Config_test.php
deleted file mode 100644
index b5c9e849d..000000000
--- a/tests/codeigniter/core/Config_test.php
+++ /dev/null
@@ -1,240 +0,0 @@
-<?php
-
-class Config_test extends CI_TestCase {
-
- public function set_up()
- {
- $cls =& $this->ci_core_class('cfg');
-
- // set predictable config values
- $this->cfg = array(
- 'index_page' => 'index.php',
- 'base_url' => 'http://example.com/',
- 'subclass_prefix' => 'MY_'
- );
- $this->ci_set_config($this->cfg);
-
- $this->config = new $cls;
- }
-
- // --------------------------------------------------------------------
-
- public function test_item()
- {
- $this->assertEquals($this->cfg['base_url'], $this->config->item('base_url'));
-
- // Bad Config value
- $this->assertNull($this->config->item('no_good_item'));
-
- // Index
- $this->assertNull($this->config->item('no_good_item', 'bad_index'));
- $this->assertNull($this->config->item('no_good_item', 'default'));
- }
-
- // --------------------------------------------------------------------
-
- public function test_set_item()
- {
- $this->assertNull($this->config->item('not_yet_set'));
-
- $this->config->set_item('not_yet_set', 'is set');
- $this->assertEquals('is set', $this->config->item('not_yet_set'));
- }
-
- // --------------------------------------------------------------------
-
- public function test_slash_item()
- {
- // Bad Config value
- $this->assertNull($this->config->slash_item('no_good_item'));
-
- $this->assertEquals($this->cfg['base_url'], $this->config->slash_item('base_url'));
- $this->assertEquals($this->cfg['subclass_prefix'].'/', $this->config->slash_item('subclass_prefix'));
- }
-
- // --------------------------------------------------------------------
-
- public function test_base_url()
- {
- // Test regular base URL
- $base_url = $this->cfg['base_url'];
- $this->assertEquals($base_url, $this->config->base_url());
-
- // Test with URI
- $uri = 'test';
- $this->assertEquals($base_url.$uri, $this->config->base_url($uri));
-
- // Clear base_url
- $this->ci_set_config('base_url', '');
-
- // Rerun constructor
- $cls =& $this->ci_core_class('cfg');
- $this->config = new $cls;
-
- // Test default base
- $this->assertEquals('http://localhost/', $this->config->base_url());
-
- // Capture server vars
- $old_host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : NULL;
- $old_script_name = isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME'] : NULL;
- $old_script_filename = $_SERVER['SCRIPT_FILENAME'];
- $old_https = isset($_SERVER['HTTPS']) ? $_SERVER['HTTPS'] : NULL;
- $old_server_addr = isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : NULL;
-
- // The 'Host' header is user input and must not be trusted
- $_SERVER['HTTP_HOST'] = 'test.com';
- $this->config = new $cls;
- $this->assertEquals('http://localhost/', $this->config->base_url());
-
- // However, we may fallback to the server's IP address
- $_SERVER['SERVER_ADDR'] = '127.0.0.1';
- $_SERVER['SCRIPT_NAME'] = '/base_test.php';
- $_SERVER['SCRIPT_FILENAME'] = '/foo/bar/base_test.php';
- $this->config = new $cls;
- $this->assertEquals('http://127.0.0.1/', $this->config->base_url());
-
- // Making sure that HTTPS and URI path are also detected
- $_SERVER['HTTPS'] = 'on';
- $_SERVER['SCRIPT_NAME'] = '/path/base_test.php';
- $_SERVER['SCRIPT_FILENAME'] = '/foo/bar/path/base_test.php';
- $this->config = new $cls;
- $this->assertEquals('https://127.0.0.1/path/', $this->config->base_url());
-
- // Restore server vars
- $_SERVER['HTTP_HOST'] = $old_host;
- $_SERVER['SCRIPT_NAME'] = $old_script_name;
- $_SERVER['SCRIPT_FILENAME'] = $old_script_filename;
- $_SERVER['HTTPS'] = $old_https;
- $_SERVER['SERVER_ADDR'] = $old_server_addr;
- }
-
- // --------------------------------------------------------------------
-
- public function test_site_url()
- {
- $base_url = $this->cfg['base_url'];
- $index_page = $this->cfg['index_page'];
- $this->assertEquals($base_url.$index_page, $this->config->site_url());
-
- $old_base = $this->config->item('base_url');
- $this->config->set_item('base_url', '');
-
- $q_string = $this->config->item('enable_query_strings');
- $this->config->set_item('enable_query_strings', FALSE);
-
- $uri = 'test';
- $uri2 = '1';
- $this->assertEquals($index_page.'/'.$uri, $this->config->site_url($uri));
- $this->assertEquals($index_page.'/'.$uri.'/'.$uri2, $this->config->site_url(array($uri, $uri2)));
-
- $this->assertEquals($index_page.'/test/', $this->config->site_url('test/'));
-
- $suffix = 'ing';
- $this->config->set_item('url_suffix', $suffix);
-
- $arg = 'pass';
- $this->assertEquals($index_page.'/'.$uri.$suffix, $this->config->site_url($uri));
- $this->assertEquals($index_page.'/'.$uri.$suffix.'?'.$arg, $this->config->site_url($uri.'?'.$arg));
-
- $this->config->set_item('url_suffix', FALSE);
- $this->config->set_item('enable_query_strings', TRUE);
-
- $this->assertEquals($index_page.'?'.$uri, $this->config->site_url($uri));
- $this->assertEquals($index_page.'?0='.$uri.'&1='.$uri2, $this->config->site_url(array($uri, $uri2)));
-
- $this->config->set_item('base_url', $old_base);
-
- $this->assertEquals($base_url.$index_page.'?'.$uri, $this->config->site_url($uri));
-
- // back to home base
- $this->config->set_item('enable_query_strings', $q_string);
- }
-
- // --------------------------------------------------------------------
-
- public function test_system_url()
- {
- $this->assertEquals($this->cfg['base_url'].'system/', $this->config->system_url());
- }
-
- // --------------------------------------------------------------------
-
- public function test_load()
- {
- // Test regular load
- $file = 'test.php';
- $key = 'testconfig';
- $val = 'my_value';
- $cfg = array($key => $val);
- $this->ci_vfs_create($file, '<?php $config = '.var_export($cfg, TRUE).';', $this->ci_app_root, 'config');
- $this->assertTrue($this->config->load($file));
- $this->assertEquals($val, $this->config->item($key));
-
- // Test reload - value should not change
- $val2 = 'new_value';
- $cfg = array($key => $val2);
- $this->ci_vfs_create($file, '<?php $config = '.var_export($cfg, TRUE).';', $this->ci_app_root, 'config');
- $this->assertTrue($this->config->load($file));
- $this->assertEquals($val, $this->config->item($key));
-
- // Test section load
- $file = 'secttest';
- $cfg = array(
- 'one' => 'prime',
- 'two' => 2,
- 'three' => TRUE
- );
- $this->ci_vfs_create($file.'.php', '<?php $config = '.var_export($cfg, TRUE).';', $this->ci_app_root, 'config');
- $this->assertTrue($this->config->load($file, TRUE));
- $this->assertEquals($cfg, $this->config->item($file));
-
- // Test section merge
- $cfg2 = array(
- 'three' => 'tres',
- 'number' => 42,
- 'letter' => 'Z'
- );
-
- $pkg_dir = 'package';
- $this->ci_vfs_create(
- $file.'.php',
- '<?php $config = '.var_export($cfg2, TRUE).';',
- $this->ci_app_root,
- array($pkg_dir, 'config')
- );
- array_unshift($this->config->_config_paths, $this->ci_vfs_path($pkg_dir.'/', APPPATH));
- $this->assertTrue($this->config->load($file, TRUE));
- $this->assertEquals(array_merge($cfg, $cfg2), $this->config->item($file));
- array_shift($this->config->_config_paths);
-
- // Test graceful fail of invalid file
- $file = 'badfile';
- $this->ci_vfs_create($file, '', $this->ci_app_root, 'config');
- $this->assertFalse($this->config->load($file, FALSE, TRUE));
-
- // Test regular fail of invalid file
- $this->setExpectedException(
- 'RuntimeException',
- 'CI Error: Your '.$this->ci_vfs_path('config/'.$file.'.php', APPPATH).
- ' file does not appear to contain a valid configuration array.'
- );
- $this->assertNull($this->config->load($file));
- }
-
- // --------------------------------------------------------------------
-
- public function test_load_nonexistent()
- {
- // Test graceful fail of nonexistent file
- $this->assertFalse($this->config->load('not_config_file', FALSE, TRUE));
-
- // Test regular fail
- $file = 'absentia';
- $this->setExpectedException(
- 'RuntimeException',
- 'CI Error: The configuration file '.$file.'.php does not exist.'
- );
- $this->assertNull($this->config->load($file));
- }
-
-} \ No newline at end of file
diff --git a/tests/codeigniter/core/Input_test.php b/tests/codeigniter/core/Input_test.php
deleted file mode 100644
index 3cce00414..000000000
--- a/tests/codeigniter/core/Input_test.php
+++ /dev/null
@@ -1,289 +0,0 @@
-<?php
-
-class Input_test extends CI_TestCase {
-
- public function set_up()
- {
- // Set server variable to GET as default, since this will leave unset in STDIN env
- $_SERVER['REQUEST_METHOD'] = 'GET';
-
- // Set config for Input class
- $this->ci_set_config('allow_get_array', TRUE);
- $this->ci_set_config('global_xss_filtering', FALSE);
- $this->ci_set_config('csrf_protection', FALSE);
-
- $security = new Mock_Core_Security();
-
- $this->ci_set_config('charset', 'UTF-8');
- $utf8 = new Mock_Core_Utf8();
-
- $this->input = new Mock_Core_Input($security, $utf8);
- }
-
- // --------------------------------------------------------------------
-
- public function tear_down()
- {
- $_POST = [];
- $_GET = [];
- }
-
- // --------------------------------------------------------------------
-
- public function test_get_not_exists()
- {
- $this->assertSame(array(), $this->input->get());
- $this->assertNull($this->input->get('foo'));
- }
-
- // --------------------------------------------------------------------
-
- public function test_get_exist()
- {
- $_SERVER['REQUEST_METHOD'] = 'GET';
- $_GET['foo'] = 'bar';
-
- $this->assertArrayHasKey('foo', $this->input->get());
- $this->assertEquals('bar', $this->input->get('foo'));
- }
-
- // --------------------------------------------------------------------
-
- public function test_get_exist_with_xss_clean()
- {
- $_SERVER['REQUEST_METHOD'] = 'GET';
- $_GET['harm'] = "Hello, i try to <script>alert('Hack');</script> your site";
-
- $this->assertArrayHasKey('harm', $this->input->get());
- $this->assertEquals("Hello, i try to <script>alert('Hack');</script> your site", $this->input->get('harm'));
- $this->assertEquals("Hello, i try to [removed]alert&#40;'Hack'&#41;;[removed] your site", $this->input->get('harm', TRUE));
- }
-
- // --------------------------------------------------------------------
-
- public function test_post_not_exists()
- {
- $this->assertSame(array(), $this->input->post());
- $this->assertNull($this->input->post('foo'));
- }
-
- // --------------------------------------------------------------------
-
- public function test_post_exist()
- {
- $_SERVER['REQUEST_METHOD'] = 'POST';
- $_POST['foo'] = 'bar';
-
- $this->assertArrayHasKey('foo', $this->input->post());
- $this->assertEquals('bar', $this->input->post('foo'));
- }
-
- // --------------------------------------------------------------------
-
- public function test_post_exist_with_xss_clean()
- {
- $_SERVER['REQUEST_METHOD'] = 'POST';
- $_POST['harm'] = "Hello, i try to <script>alert('Hack');</script> your site";
-
- $this->assertArrayHasKey('harm', $this->input->post());
- $this->assertEquals("Hello, i try to <script>alert('Hack');</script> your site", $this->input->post('harm'));
- $this->assertEquals("Hello, i try to [removed]alert&#40;'Hack'&#41;;[removed] your site", $this->input->post('harm', TRUE));
- }
-
- // --------------------------------------------------------------------
-
- public function test_post_get()
- {
- $_SERVER['REQUEST_METHOD'] = 'POST';
- $_POST['foo'] = 'bar';
-
- $this->assertEquals('bar', $this->input->post_get('foo'));
- }
-
- // --------------------------------------------------------------------
-
- public function test_get_post()
- {
- $_SERVER['REQUEST_METHOD'] = 'GET';
- $_GET['foo'] = 'bar';
-
- $this->assertEquals('bar', $this->input->get_post('foo'));
- }
-
- // --------------------------------------------------------------------
-
- public function test_cookie()
- {
- $_COOKIE['foo'] = 'bar';
- $this->assertEquals('bar', $this->input->cookie('foo'));
- $this->assertNull($this->input->cookie('bar'));
- }
-
- // --------------------------------------------------------------------
-
- public function test_server()
- {
- $this->assertEquals('GET', $this->input->server('REQUEST_METHOD'));
- }
-
- // --------------------------------------------------------------------
-
- public function test_fetch_from_array()
- {
- $data = array(
- 'foo' => 'bar',
- 'harm' => 'Hello, i try to <script>alert(\'Hack\');</script> your site',
- );
-
- $foo = $this->input->fetch_from_array($data, 'foo');
- $harm = $this->input->fetch_from_array($data, 'harm');
- $harmless = $this->input->fetch_from_array($data, 'harm', TRUE);
-
- $this->assertEquals('bar', $foo);
- $this->assertEquals("Hello, i try to <script>alert('Hack');</script> your site", $harm);
- $this->assertEquals("Hello, i try to [removed]alert&#40;'Hack'&#41;;[removed] your site", $harmless);
-
- $_SERVER['REQUEST_METHOD'] = 'POST';
- $_POST['foo'] = array('bar' => 'baz');
- $barArray = array('bar' => 'baz');
-
- $this->assertEquals('baz', $this->input->post('foo[bar]'));
- $this->assertEquals($barArray, $this->input->post('foo[]'));
- $this->assertNull($this->input->post('foo[baz]'));
- }
-
- // --------------------------------------------------------------------
-
- public function test_valid_ip()
- {
- $this->assertTrue($this->input->valid_ip('192.18.0.1'));
- $this->assertTrue($this->input->valid_ip('192.18.0.1', 'ipv4'));
- $this->assertFalse($this->input->valid_ip('555.0.0.0'));
- $this->assertFalse($this->input->valid_ip('2001:db8:0:85a3::ac1f:8001', 'ipv4'));
-
- // v6 tests
- $this->assertFalse($this->input->valid_ip('192.18.0.1', 'ipv6'));
-
- $ip_v6 = array(
- '2001:0db8:0000:85a3:0000:0000:ac1f:8001',
- '2001:db8:0:85a3:0:0:ac1f:8001',
- '2001:db8:0:85a3::ac1f:8001'
- );
-
- foreach ($ip_v6 as $ip)
- {
- $this->assertTrue($this->input->valid_ip($ip));
- $this->assertTrue($this->input->valid_ip($ip, 'ipv6'));
- }
- }
-
- // --------------------------------------------------------------------
-
- public function test_method()
- {
- $_SERVER['REQUEST_METHOD'] = 'GET';
- $this->assertEquals('get', $this->input->method());
- $this->assertEquals('GET', $this->input->method(TRUE));
- $_SERVER['REQUEST_METHOD'] = 'POST';
- $this->assertEquals('post', $this->input->method());
- $this->assertEquals('POST', $this->input->method(TRUE));
- }
-
- // --------------------------------------------------------------------
-
- public function test_is_ajax_request()
- {
- $this->assertFalse($this->input->is_ajax_request());
- $_SERVER['HTTP_X_REQUESTED_WITH'] = 'test';
- $this->assertFalse($this->input->is_ajax_request());
- $_SERVER['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest';
- $this->assertTrue($this->input->is_ajax_request());
- }
-
- // --------------------------------------------------------------------
-
- public function test_input_stream()
- {
- $this->markTestSkipped('TODO: Find a way to test input://');
- }
-
- // --------------------------------------------------------------------
-
- public function test_set_cookie()
- {
- $this->markTestSkipped('TODO: Find a way to test HTTP headers');
- }
-
- // --------------------------------------------------------------------
-
- public function test_get_request_header()
- {
- $this->markTestSkipped('TODO: Find a way to test HTTP headers');
- }
-
- // --------------------------------------------------------------------
-
- public function test_ip_address()
- {
- $this->input->ip_address = '127.0.0.1';
- $this->assertEquals('127.0.0.1', $this->input->ip_address());
-
- // 127.0.0.1 is set in our Bootstrap file
- $this->input->ip_address = FALSE;
- $this->assertEquals('127.0.0.1', $this->input->ip_address());
-
- // Invalid
- $_SERVER['REMOTE_ADDR'] = 'invalid_ip_address';
- $this->input->ip_address = FALSE; // reset cached value
- $this->assertEquals('0.0.0.0', $this->input->ip_address());
-
- $_SERVER['REMOTE_ADDR'] = '127.0.0.1';
-
- // Proxy_ips tests
- $this->input->ip_address = FALSE;
- $this->ci_set_config('proxy_ips', '127.0.0.3, 127.0.0.4, 127.0.0.2');
- $_SERVER['HTTP_CLIENT_IP'] = '127.0.0.2';
- $this->assertEquals('127.0.0.1', $this->input->ip_address());
-
- // Invalid spoof
- $this->input->ip_address = FALSE;
- $this->ci_set_config('proxy_ips', 'invalid_ip_address');
- $_SERVER['HTTP_CLIENT_IP'] = 'invalid_ip_address';
- $this->assertEquals('127.0.0.1', $this->input->ip_address());
-
- $this->input->ip_address = FALSE;
- $this->ci_set_config('proxy_ips', 'http://foo/bar/baz, 127.0.0.1/1');
- $_SERVER['HTTP_CLIENT_IP'] = '127.0.0.1';
- $this->assertEquals('127.0.0.1', $this->input->ip_address());
-
- $this->input->ip_address = FALSE;
- $this->ci_set_config('proxy_ips', 'http://foo/bar/baz, 127.0.0.2');
- $_SERVER['HTTP_CLIENT_IP'] = '127.0.0.2';
- $_SERVER['REMOTE_ADDR'] = '127.0.0.2';
- $this->assertEquals('127.0.0.2', $this->input->ip_address());
-
- //IPv6
- $this->input->ip_address = FALSE;
- $this->ci_set_config('proxy_ips', 'FE80:0000:0000:0000:0202:B3FF:FE1E:8329/1, FE80:0000:0000:0000:0202:B3FF:FE1E:8300/2');
- $_SERVER['HTTP_CLIENT_IP'] = 'FE80:0000:0000:0000:0202:B3FF:FE1E:8300';
- $_SERVER['REMOTE_ADDR'] = 'FE80:0000:0000:0000:0202:B3FF:FE1E:8329';
- $this->assertEquals('FE80:0000:0000:0000:0202:B3FF:FE1E:8300', $this->input->ip_address());
-
- $this->input->ip_address = FALSE;
- $this->ci_set_config('proxy_ips', '0::/32');
- $_SERVER['HTTP_CLIENT_IP'] = '127.0.0.7';
- $_SERVER['REMOTE_ADDR'] = '0000:0000:0000:0000:0000:0000:0000:0001';
- $this->assertEquals('127.0.0.7', $this->input->ip_address());
-
- $this->input->ip_address = FALSE;
- $_SERVER['REMOTE_ADDR'] = '127.0.0.1'; // back to reality
- }
-
- // --------------------------------------------------------------------
-
- public function test_user_agent()
- {
- $_SERVER['HTTP_USER_AGENT'] = 'test';
- $this->assertEquals('test', $this->input->user_agent());
- }
-}
diff --git a/tests/codeigniter/core/Lang_test.php b/tests/codeigniter/core/Lang_test.php
deleted file mode 100644
index 4958f42e1..000000000
--- a/tests/codeigniter/core/Lang_test.php
+++ /dev/null
@@ -1,101 +0,0 @@
-<?php
-
-class Lang_test extends CI_TestCase {
-
- protected $lang;
-
- public function set_up()
- {
- $loader_cls = $this->ci_core_class('load');
- $this->ci_instance_var('load', new $loader_cls);
- $cls = $this->ci_core_class('lang');
- $this->lang = new $cls;
- }
-
- // --------------------------------------------------------------------
-
- public function test_load()
- {
- // Regular usage
- $this->ci_vfs_clone('system/language/english/profiler_lang.php');
- $this->assertTrue($this->lang->load('profiler', 'english'));
- $this->assertEquals('URI STRING', $this->lang->language['profiler_uri_string']);
-
- // Already loaded file
- $this->assertNull($this->lang->load('profiler', 'english'));
-
- // Unspecified language (defaults to english)
- $this->ci_vfs_clone('system/language/english/date_lang.php');
- $this->assertTrue($this->lang->load('date'));
- $this->assertEquals('Year', $this->lang->language['date_year']);
-
- // A language other than english
- $this->ci_vfs_clone('system/language/english/email_lang.php', 'system/language/german/');
- $this->assertTrue($this->lang->load('email', 'german'));
- $this->assertEquals('german', $this->lang->is_loaded['email_lang.php']);
-
- // Non-existent file
- $this->setExpectedException(
- 'RuntimeException',
- 'CI Error: Unable to load the requested language file: language/english/nonexistent_lang.php'
- );
- $this->lang->load('nonexistent');
- }
-
- // --------------------------------------------------------------------
-
- public function test_non_alpha_idiom()
- {
- // Non-alpha idiom (should act the same as unspecified language)
- // test with existing file
- $this->ci_vfs_clone('system/language/english/number_lang.php');
- $this->ci_vfs_clone('system/language/english/number_lang.php', 'system/language/123funny/');
- $this->assertTrue($this->lang->load('number', '123funny'));
- $this->assertEquals('Bytes', $this->lang->language['bytes']);
-
- // test without existing file
- $this->ci_vfs_clone('system/language/english/email_lang.php');
- $this->assertTrue($this->lang->load('email', '456funny'));
- $this->assertEquals('You did not specify a SMTP hostname.', $this->lang->language['email_no_hostname']);
- }
-
- // --------------------------------------------------------------------
-
- public function test_multiple_file_load()
- {
- // Multiple files
- $this->ci_vfs_clone('system/language/english/profiler_lang.php');
- $files = array(
- 0 => 'profiler',
- 1 => 'nonexistent'
- );
- $this->setExpectedException(
- 'RuntimeException',
- 'CI Error: Unable to load the requested language file: language/english/nonexistent_lang.php'
- );
- $this->lang->load($files, 'english');
- }
-
- // --------------------------------------------------------------------
-
- public function test_alternative_path_load()
- {
- // Alternative Path
- $this->ci_vfs_clone('system/language/english/profiler_lang.php');
- $this->assertTrue($this->lang->load('profiler', 'english', FALSE, TRUE, 'vfs://system/'));
- }
-
- // --------------------------------------------------------------------
-
- /**
- * @depends test_load
- */
- public function test_line()
- {
- $this->ci_vfs_clone('system/language/english/profiler_lang.php');
- $this->lang->load('profiler', 'english');
- $this->assertEquals('URI STRING', $this->lang->line('profiler_uri_string'));
- $this->assertFalse($this->lang->line('nonexistent_string'));
- $this->assertFalse($this->lang->line(NULL));
- }
-}
diff --git a/tests/codeigniter/core/Loader_test.php b/tests/codeigniter/core/Loader_test.php
deleted file mode 100644
index 6a7aa916a..000000000
--- a/tests/codeigniter/core/Loader_test.php
+++ /dev/null
@@ -1,594 +0,0 @@
-<?php
-
-class Loader_test extends CI_TestCase {
-
- private $ci_obj;
-
- public function set_up()
- {
- // Instantiate a new loader
- $loader = $this->ci_core_class('loader');
- $this->load = new $loader();
-
- // Get CI instance
- $this->ci_obj = $this->ci_instance();
-
- // Set subclass prefix
- $this->prefix = 'MY_';
- $this->ci_set_config('subclass_prefix', $this->prefix);
- }
-
- // --------------------------------------------------------------------
-
- public function test_library()
- {
- // Test getting CI_Loader object
- $this->assertInstanceOf('CI_Loader', $this->load->library(NULL));
-
- // Create library in VFS
- $lib = 'unit_test_lib';
- $class = 'CI_'.ucfirst($lib);
- $this->ci_vfs_create(ucfirst($lib), '<?php class '.$class.' { }', $this->ci_base_root, 'libraries');
-
- // Test is_loaded fail
- $this->assertFalse($this->load->is_loaded(ucfirst($lib)));
-
- // Test loading as an array.
- $this->assertInstanceOf('CI_Loader', $this->load->library(array($lib)));
- $this->assertTrue(class_exists($class), $class.' does not exist');
- $this->assertObjectHasAttribute($lib, $this->ci_obj);
- $this->assertInstanceOf($class, $this->ci_obj->$lib);
-
- // Create library in VFS
- $lib = array('unit_test_lib' => 'unit_test_lib');
-
- // Test loading as an array (int).
- $this->assertInstanceOf('CI_Loader', $this->load->library($lib));
- $this->assertTrue(class_exists($class), $class.' does not exist');
-
- // Test a string given to params
- $this->assertInstanceOf('CI_Loader', $this->load->library($lib, ' '));
-
- // test non existent lib
- $lib = 'non_existent_test_lib';
-
- $this->setExpectedException(
- 'RuntimeException',
- 'CI Error: Unable to load the requested class: '.ucfirst($lib)
- );
- $this->assertInstanceOf('CI_Loader', $this->load->library($lib));
- }
-
- // --------------------------------------------------------------------
-
- public function test_bad_library()
- {
- $lib = 'bad_test_lib';
- $this->ci_vfs_create(ucfirst($lib), '', $this->ci_app_root, 'libraries');
- $this->setExpectedException(
- 'RuntimeException',
- 'CI Error: Non-existent class: '.ucfirst($lib)
- );
- $this->assertInstanceOf('CI_Loader', $this->load->library($lib));
- }
-
- // --------------------------------------------------------------------
-
- public function test_library_extension()
- {
- // Create library and extension in VFS
- $name = 'ext_test_lib';
- $lib = ucfirst($name);
- $class = 'CI_'.$lib;
- $ext = $this->prefix.$lib;
- $this->ci_vfs_create($lib, '<?php class '.$class.' { }', $this->ci_base_root, 'libraries');
- $this->ci_vfs_create($ext, '<?php class '.$ext.' extends '.$class.' { }', $this->ci_app_root, 'libraries');
-
- // Test loading with extension
- $this->assertInstanceOf('CI_Loader', $this->load->library($lib));
- $this->assertTrue(class_exists($class), $class.' does not exist');
- $this->assertTrue(class_exists($ext), $ext.' does not exist');
- $this->assertObjectHasAttribute($name, $this->ci_obj);
- $this->assertInstanceOf($class, $this->ci_obj->$name);
- $this->assertInstanceOf($ext, $this->ci_obj->$name);
-
- // Test reloading with object name
- $obj = 'exttest';
- $this->assertInstanceOf('CI_Loader', $this->load->library($lib, NULL, $obj));
- $this->assertObjectHasAttribute($obj, $this->ci_obj);
- $this->assertInstanceOf($class, $this->ci_obj->$obj);
- $this->assertInstanceOf($ext, $this->ci_obj->$obj);
-
- // Test reloading
- unset($this->ci_obj->$name);
- $this->assertInstanceOf('CI_Loader', $this->load->library($lib));
- $this->assertObjectHasAttribute($name, $this->ci_obj);
-
- // Create baseless library
- $name = 'ext_baseless_lib';
- $lib = ucfirst($name);
- $class = $this->prefix.$lib;
- $this->ci_vfs_create($class, '<?php class '.$class.' { }', $this->ci_app_root, 'libraries');
-
- // Test missing base class
- $this->setExpectedException(
- 'RuntimeException',
- 'CI Error: Unable to load the requested class: '.$lib
- );
- $this->assertInstanceOf('CI_Loader', $this->load->library($lib));
- }
-
- // --------------------------------------------------------------------
-
- public function test_library_config()
- {
- // Create library in VFS
- $lib = 'unit_test_config_lib';
- $class = 'CI_'.ucfirst($lib);
- $content = '<?php class '.$class.' { public function __construct($params) { $this->config = $params; } }';
- $this->ci_vfs_create(ucfirst($lib), $content, $this->ci_base_root, 'libraries');
-
- // Create config file
- $cfg = array(
- 'foo' => 'bar',
- 'bar' => 'baz',
- 'baz' => false
- );
- $this->ci_vfs_create($lib, '<?php $config = '.var_export($cfg, TRUE).';', $this->ci_app_root, 'config');
-
- // Test object name and config
- $obj = 'testy';
- $this->assertInstanceOf('CI_Loader', $this->load->library($lib, NULL, $obj));
- $this->assertTrue(class_exists($class), $class.' does not exist');
- $this->assertObjectHasAttribute($obj, $this->ci_obj);
- $this->assertInstanceOf($class, $this->ci_obj->$obj);
- $this->assertEquals($cfg, $this->ci_obj->$obj->config);
-
- // Test is_loaded
- $this->assertEquals($obj, $this->load->is_loaded(ucfirst($lib)));
-
- // Test to load another class with the same object name
- $lib = 'another_test_lib';
- $class = ucfirst($lib);
- $this->ci_vfs_create(ucfirst($lib), '<?php class '.$class.' { }', $this->ci_app_root, 'libraries');
- $this->setExpectedException(
- 'RuntimeException',
- "CI Error: Resource '".$obj."' already exists and is not a ".$class." instance."
- );
- $this->load->library($lib, NULL, $obj);
- }
-
- // --------------------------------------------------------------------
-
- public function test_load_library_in_application_dir()
- {
- // Create library in VFS
- $lib = 'super_test_library';
- $class = ucfirst($lib);
- $this->ci_vfs_create(ucfirst($lib), '<?php class '.$class.' { }', $this->ci_app_root, 'libraries');
-
- // Load library
- $this->assertInstanceOf('CI_Loader', $this->load->library($lib));
-
- // Was the model class instantiated.
- $this->assertTrue(class_exists($class), $class.' does not exist');
- $this->assertObjectHasAttribute($lib, $this->ci_obj);
- $this->assertInstanceOf($class, $this->ci_obj->$lib);
- }
-
- // --------------------------------------------------------------------
-
- public function test_driver()
- {
- // Call the autoloader, to include system/libraries/Driver.php
- class_exists('CI_Driver_Library', TRUE);
-
- // Create driver in VFS
- $driver = 'unit_test_driver';
- $dir = ucfirst($driver);
- $class = 'CI_'.$dir;
- $content = '<?php class '.$class.' { } ';
- $this->ci_vfs_create(ucfirst($driver), $content, $this->ci_base_root, 'libraries/'.$dir);
-
- // Test loading as an array.
- $this->assertInstanceOf('CI_Loader', $this->load->driver(array($driver)));
- $this->assertTrue(class_exists($class), $class.' does not exist');
- $this->assertObjectHasAttribute($driver, $this->ci_obj);
- $this->assertInstanceOf($class, $this->ci_obj->$driver);
-
- // Test loading as a library with a name
- $obj = 'testdrive';
- $this->assertInstanceOf('CI_Loader', $this->load->library($driver, NULL, $obj));
- $this->assertObjectHasAttribute($obj, $this->ci_obj);
- $this->assertInstanceOf($class, $this->ci_obj->$obj);
-
- // Test a string given to params
- $this->assertInstanceOf('CI_Loader', $this->load->driver($driver, ' '));
- }
-
- // --------------------------------------------------------------------
-
- public function test_models()
- {
- $this->ci_set_core_class('model', 'CI_Model');
-
- // Create model in VFS
- $model = 'Unit_test_model';
- $content = '<?php class '.$model.' extends CI_Model {} ';
- $this->ci_vfs_create($model, $content, $this->ci_app_root, 'models');
-
- // Load model
- $this->assertInstanceOf('CI_Loader', $this->load->model($model));
-
- // Was the model class instantiated.
- $this->assertTrue(class_exists($model));
- $this->assertObjectHasAttribute($model, $this->ci_obj);
-
- // Test no model given
- $this->assertInstanceOf('CI_Loader', $this->load->model(''));
- }
-
- // --------------------------------------------------------------------
-
- public function test_model_subdir()
- {
- // Make sure base class is loaded - we'll test _ci_include later
- $this->ci_core_class('model');
-
- // Create modelin VFS
- $model = 'Test_sub_model';
- $base = 'CI_Model';
- $subdir = 'cars';
- $this->ci_vfs_create($model, '<?php class '.$model.' extends '.$base.' { }', $this->ci_app_root,
- array('models', $subdir));
-
- // Load model
- $name = 'testors';
- $this->assertInstanceOf('CI_Loader', $this->load->model($subdir.'/'.$model, $name));
-
- // Was the model class instantiated?
- $this->assertTrue(class_exists($model));
- $this->assertObjectHasAttribute($name, $this->ci_obj);
- $this->assertObjectHasAttribute($name, $this->ci_obj);
- $this->assertInstanceOf($base, $this->ci_obj->$name);
- $this->assertInstanceOf($model, $this->ci_obj->$name);
-
- // Test name conflict
- $obj = 'conflict';
- $this->ci_obj->$obj = new stdClass();
- $this->setExpectedException(
- 'RuntimeException',
- 'The model name you are loading is the name of a resource that is already being used: '.$obj
- );
- $this->load->model('not_real', $obj);
- }
-
- // --------------------------------------------------------------------
-
- public function test_non_existent_model()
- {
- $this->setExpectedException(
- 'RuntimeException',
- 'Unable to locate the model you have specified: Ci_test_nonexistent_model.php'
- );
-
- $this->load->model('ci_test_nonexistent_model.php');
- }
-
- // --------------------------------------------------------------------
-
- // public function testDatabase()
- // {
- // $this->assertInstanceOf('CI_Loader', $this->load->database());
- // $this->assertInstanceOf('CI_Loader', $this->load->dbutil());
- // }
-
- // --------------------------------------------------------------------
-
- public function test_load_view()
- {
- // Create view in VFS
- $view = 'unit_test_view';
- $var = 'hello';
- $value = 'World!';
- $content = 'This is my test page. ';
- $this->ci_vfs_create($view, $content.'<?php echo $'.$var.';', $this->ci_app_root, 'views');
-
- // Test returning view
- $out = $this->load->view($view, array($var => $value), TRUE);
- $this->assertEquals($content.$value, $out);
-
- // Mock output class
- $output = $this->getMockBuilder('CI_Output')->setMethods(array('append_output'))->getMock();
- $output->expects($this->once())->method('append_output')->with($content.$value);
- $this->ci_instance_var('output', $output);
-
- // Test view output and $vars as an object
- $vars = new stdClass();
- $vars->$var = $value;
- $this->assertInstanceOf('CI_Loader', $this->load->view($view, $vars));
- }
-
- // --------------------------------------------------------------------
-
- public function test_non_existent_view()
- {
- $this->setExpectedException(
- 'RuntimeException',
- 'CI Error: Unable to load the requested file: ci_test_nonexistent_view.php'
- );
-
- $this->load->view('ci_test_nonexistent_view', array('foo' => 'bar'));
- }
-
- // --------------------------------------------------------------------
-
- public function test_file()
- {
- // Create view in VFS
- $dir = 'views';
- $file = 'ci_test_mock_file';
- $content = 'Here is a test file, which we will load now.';
- $this->ci_vfs_create($file, $content, $this->ci_app_root, $dir);
-
- // Just like load->view(), take the output class out of the mix here.
- $out = $this->load->file(APPPATH.$dir.'/'.$file.'.php', TRUE);
- $this->assertEquals($content, $out);
-
- // Test non-existent file
- $this->setExpectedException(
- 'RuntimeException',
- 'CI Error: Unable to load the requested file: ci_test_file_not_exists'
- );
-
- $this->load->file('ci_test_file_not_exists', TRUE);
- }
-
- // --------------------------------------------------------------------
-
- public function test_vars()
- {
- $key1 = 'foo';
- $val1 = 'bar';
- $key2 = 'boo';
- $val2 = 'hoo';
- $this->assertInstanceOf('CI_Loader', $this->load->vars(array($key1 => $val1)));
- $this->assertInstanceOf('CI_Loader', $this->load->vars($key2, $val2));
- $this->assertEquals($val1, $this->load->get_var($key1));
- $this->assertEquals(array($key1 => $val1, $key2 => $val2), $this->load->get_vars());
- }
-
- // --------------------------------------------------------------------
-
- public function test_clear_vars()
- {
- $key1 = 'foo';
- $val1 = 'bar';
- $key2 = 'boo';
- $val2 = 'hoo';
- $this->assertInstanceOf('CI_Loader', $this->load->vars(array($key1 => $val1)));
- $this->assertInstanceOf('CI_Loader', $this->load->vars($key2, $val2));
- $this->assertEquals($val1, $this->load->get_var($key1));
- $this->assertEquals(array($key1 => $val1, $key2 => $val2), $this->load->get_vars());
-
- $this->assertInstanceOf('CI_Loader', $this->load->clear_vars());
- $this->assertEquals('', $this->load->get_var($key1));
- $this->assertEquals('', $this->load->get_var($key2));
- }
-
- // --------------------------------------------------------------------
-
- public function test_helper()
- {
- // Create helper in VFS
- $helper = 'test';
- $func = '_my_helper_test_func';
- $content = '<?php function '.$func.'() { return TRUE; } ';
- $this->ci_vfs_create($helper.'_helper', $content, $this->ci_base_root, 'helpers');
-
- // Create helper extension
- $exfunc = '_my_extension_func';
- $content = '<?php function '.$exfunc.'() { return TRUE; } ';
- $this->ci_vfs_create($this->prefix.$helper.'_helper', $content, $this->ci_app_root, 'helpers');
-
- // Load helper
- $this->assertInstanceOf('CI_Loader', $this->load->helper($helper));
- $this->assertTrue(function_exists($func), $func.' does not exist');
- $this->assertTrue(function_exists($exfunc), $exfunc.' does not exist');
-
- // Create baseless extension
- $ext = 'bad_ext';
- $this->ci_vfs_create($this->prefix.$ext.'_helper', '', $this->ci_app_root, 'helpers');
-
- // Test bad extension
- $this->setExpectedException(
- 'RuntimeException',
- 'CI Error: Unable to load the requested file: helpers/'.$ext.'_helper.php'
- );
- $this->load->helper($ext);
- }
-
- // --------------------------------------------------------------------
-
- public function test_non_existent_helper()
- {
- $this->setExpectedException(
- 'RuntimeException',
- 'CI Error: Unable to load the requested file: helpers/bad_helper.php'
- );
- $this->load->helper('bad');
- }
-
- // --------------------------------------------------------------------
-
- public function test_loading_multiple_helpers()
- {
- // Create helpers in VFS
- $helpers = array();
- $funcs = array();
- $files = array();
- for ($i = 1; $i <= 3; ++$i) {
- $helper = 'test'.$i;
- $helpers[] = $helper;
- $func = '_my_helper_test_func'.$i;
- $funcs[] = $func;
- $files[$helper.'_helper'] = '<?php function '.$func.'() { return TRUE; } ';
- }
- $this->ci_vfs_create($files, NULL, $this->ci_base_root, 'helpers');
-
- // Load helpers
- $this->assertInstanceOf('CI_Loader', $this->load->helpers($helpers));
-
- // Verify helper existence
- foreach ($funcs as $func) {
- $this->assertTrue(function_exists($func), $func.' does not exist');
- }
- }
-
- // --------------------------------------------------------------------
-
- public function test_language()
- {
- // Mock lang class and test load call
- $file = 'test';
- $lang = $this->getMockBuilder('CI_Lang')->setMethods(array('load'))->getMock();
- $lang->expects($this->once())->method('load')->with($file);
- $this->ci_instance_var('lang', $lang);
- $this->assertInstanceOf('CI_Loader', $this->load->language($file));
- }
-
- // --------------------------------------------------------------------
-
- public function test_packages()
- {
- // Create model in VFS package path
- $dir = 'third-party';
- $lib = 'unit_test_package';
- $class = ucfirst($lib);
- $this->ci_vfs_create(ucfirst($lib), '<?php class '.$class.' { }', $this->ci_app_root, array($dir, 'libraries'));
-
- // Get paths
- $paths = $this->load->get_package_paths(TRUE);
-
- // Test failed load without path
- $this->setExpectedException(
- 'RuntimeException',
- 'CI Error: Unable to load the requested class: '.ucfirst($lib)
- );
- $this->load->library($lib);
-
- // Add path and verify
- $path = APPPATH.$dir.'/';
- $this->assertInstanceOf('CI_Loader', $this->load->add_package_path($path));
- $this->assertContains($path, $this->load->get_package_paths(TRUE));
-
- // Test successful load
- $this->assertInstanceOf('CI_Loader', $this->load->library($lib));
- $this->assertTrue(class_exists($class), $class.' does not exist');
-
- // Add another path
- $path2 = APPPATH.'another/';
- $this->assertInstanceOf('CI_Loader', $this->load->add_package_path($path2));
- $this->assertContains($path2, $this->load->get_package_paths(TRUE));
-
- // Remove last path
- $this->assertInstanceOf('CI_Loader', $this->load->remove_package_path());
- $this->assertNotContains($path2, $this->load->get_package_paths(TRUE));
-
- // Remove path and verify restored paths
- $this->assertInstanceOf('CI_Loader', $this->load->remove_package_path($path));
- $this->assertEquals($paths, $this->load->get_package_paths(TRUE));
- }
-
- // --------------------------------------------------------------------
-
- public function test_remove_package_path()
- {
- $dir = 'third-party';
- $path = APPPATH.$dir.'/';
- $path2 = APPPATH.'another/';
- $paths = $this->load->get_package_paths(TRUE);
-
- $this->assertInstanceOf('CI_Loader', $this->load->add_package_path($path));
- $this->assertInstanceOf('CI_Loader', $this->load->remove_package_path($path));
- $this->assertEquals($paths, $this->load->get_package_paths(TRUE));
-
- $this->assertInstanceOf('CI_Loader', $this->load->add_package_path($path2));
- $this->assertInstanceOf('CI_Loader', $this->load->remove_package_path());
- $this->assertNotContains($path2, $this->load->get_package_paths(TRUE));
- }
-
- // --------------------------------------------------------------------
-
- public function test_load_config()
- {
- $cfg = 'someconfig';
- $this->assertTrue($this->load->config($cfg, FALSE));
- $this->assertContains($cfg, $this->ci_obj->config->loaded);
- }
-
- // --------------------------------------------------------------------
-
- public function test_initialize()
- {
- // Create helper in VFS
- $helper = 'autohelp';
- $hlp_func = '_autohelp_test_func';
- $content = '<?php function '.$hlp_func.'() { return TRUE; }';
- $this->ci_vfs_create($helper.'_helper', $content, $this->ci_app_root, 'helpers');
-
- // Create library in VFS
- $lib = 'autolib';
- $lib_class = 'CI_'.ucfirst($lib);
- $this->ci_vfs_create(ucfirst($lib), '<?php class '.$lib_class.' { }', $this->ci_base_root, 'libraries');
-
- // Create driver in VFS
- $drv = 'autodrv';
- $subdir = ucfirst($drv);
- $drv_class = 'CI_'.$subdir;
- $this->ci_vfs_create(ucfirst($drv), '<?php class '.$drv_class.' { }', $this->ci_base_root, array('libraries', $subdir));
-
- // Create model in VFS package path
- $dir = 'testdir';
- $path = APPPATH.$dir.'/';
- $model = 'Automod';
- $this->ci_vfs_create($model, '<?php class '.$model.' { }', $this->ci_app_root, array($dir, 'models'));
-
- // Create autoloader config
- $cfg = array(
- 'packages' => array($path),
- 'helper' => array($helper),
- 'libraries' => array($lib),
- 'drivers' => array($drv),
- 'model' => array($model),
- 'config' => array('config1', 'config2')
- );
- $this->ci_vfs_create('autoload', '<?php $autoload = '.var_export($cfg, TRUE).';', $this->ci_app_root, 'config');
-
- $this->load->initialize();
-
- // Verify path
- $this->assertContains($path, $this->load->get_package_paths());
-
- // Verify helper
- $this->assertTrue(function_exists($hlp_func), $hlp_func.' does not exist');
-
- // Verify library
- $this->assertTrue(class_exists($lib_class), $lib_class.' does not exist');
- $this->assertObjectHasAttribute($lib, $this->ci_obj);
- $this->assertInstanceOf($lib_class, $this->ci_obj->$lib);
-
- // Verify driver
- $this->assertTrue(class_exists($drv_class), $drv_class.' does not exist');
- $this->assertObjectHasAttribute($drv, $this->ci_obj);
- $this->assertInstanceOf($drv_class, $this->ci_obj->$drv);
-
- // Verify model
- $this->assertTrue(class_exists($model), $model.' does not exist');
- $this->assertObjectHasAttribute($model, $this->ci_obj);
- $this->assertInstanceOf($model, $this->ci_obj->$model);
-
- // Verify config calls
- $this->assertEquals($cfg['config'], $this->ci_obj->config->loaded);
- }
-}
diff --git a/tests/codeigniter/core/Log_test.php b/tests/codeigniter/core/Log_test.php
deleted file mode 100644
index 927984385..000000000
--- a/tests/codeigniter/core/Log_test.php
+++ /dev/null
@@ -1,63 +0,0 @@
-<?php
-class Log_test extends CI_TestCase {
-
- public function test_configuration()
- {
- $path = new ReflectionProperty('CI_Log', '_log_path');
- $path->setAccessible(TRUE);
- $threshold = new ReflectionProperty('CI_Log', '_threshold');
- $threshold->setAccessible(TRUE);
- $date_fmt = new ReflectionProperty('CI_Log', '_date_fmt');
- $date_fmt->setAccessible(TRUE);
- $file_ext = new ReflectionProperty('CI_Log', '_file_ext');
- $file_ext->setAccessible(TRUE);
- $file_perms = new ReflectionProperty('CI_Log', '_file_permissions');
- $file_perms->setAccessible(TRUE);
- $enabled = new ReflectionProperty('CI_Log', '_enabled');
- $enabled->setAccessible(TRUE);
-
- $this->ci_set_config('log_path', '/root/');
- $this->ci_set_config('log_threshold', 'z');
- $this->ci_set_config('log_date_format', 'd.m.Y');
- $this->ci_set_config('log_file_extension', '');
- $this->ci_set_config('log_file_permissions', '');
- $instance = new CI_Log();
-
- $this->assertEquals($path->getValue($instance), '/root/');
- $this->assertEquals($threshold->getValue($instance), 1);
- $this->assertEquals($date_fmt->getValue($instance), 'd.m.Y');
- $this->assertEquals($file_ext->getValue($instance), 'php');
- $this->assertEquals($file_perms->getValue($instance), 0644);
- $this->assertFalse($enabled->getValue($instance));
-
- $this->ci_set_config('log_path', '');
- $this->ci_set_config('log_threshold', '0');
- $this->ci_set_config('log_date_format', '');
- $this->ci_set_config('log_file_extension', '.log');
- $this->ci_set_config('log_file_permissions', 0600);
- $instance = new CI_Log();
-
- $this->assertEquals($path->getValue($instance), APPPATH.'logs/');
- $this->assertEquals($threshold->getValue($instance), 0);
- $this->assertEquals($date_fmt->getValue($instance), 'Y-m-d H:i:s');
- $this->assertEquals($file_ext->getValue($instance), 'log');
- $this->assertEquals($file_perms->getValue($instance), 0600);
- $this->assertEquals($enabled->getValue($instance), TRUE);
- }
-
- // --------------------------------------------------------------------
-
- public function test_format_line()
- {
- $this->ci_set_config('log_path', '');
- $this->ci_set_config('log_threshold', 0);
- $instance = new CI_Log();
-
- $format_line = new ReflectionMethod($instance, '_format_line');
- $format_line->setAccessible(TRUE);
- $this->assertEquals(
- $format_line->invoke($instance, 'LEVEL', 'Timestamp', 'Message'),
- "LEVEL - Timestamp --> Message".PHP_EOL
- );
- }
-}
diff --git a/tests/codeigniter/core/Model_test.php b/tests/codeigniter/core/Model_test.php
deleted file mode 100644
index 80dc97b3b..000000000
--- a/tests/codeigniter/core/Model_test.php
+++ /dev/null
@@ -1,37 +0,0 @@
-<?php
-
-class Model_test extends CI_TestCase {
-
- private $ci_obj;
-
- public function set_up()
- {
- $loader = $this->ci_core_class('loader');
- $this->load = new $loader();
- $this->ci_obj = $this->ci_instance();
- $this->ci_set_core_class('model', 'CI_Model');
-
- $model_code =<<<MODEL
-<?php
-class Test_model extends CI_Model {
-
- public \$property = 'foo';
-
-}
-MODEL;
-
- $this->ci_vfs_create('Test_model', $model_code, $this->ci_app_root, 'models');
- $this->load->model('test_model');
- }
-
- // --------------------------------------------------------------------
-
- public function test__get()
- {
- $this->assertEquals('foo', $this->ci_obj->test_model->property);
-
- $this->ci_obj->controller_property = 'bar';
- $this->assertEquals('bar', $this->ci_obj->test_model->controller_property);
- }
-
-} \ No newline at end of file
diff --git a/tests/codeigniter/core/Output_test.php b/tests/codeigniter/core/Output_test.php
deleted file mode 100644
index 887c077d7..000000000
--- a/tests/codeigniter/core/Output_test.php
+++ /dev/null
@@ -1,63 +0,0 @@
-<?php
-
-class Output_test extends CI_TestCase {
-
- public $output;
- protected $_output_data = '';
-
- public function set_up()
- {
- $this->_output_data =<<<HTML
- <html>
- <head>
- <title>Basic HTML</title>
- </head>
- <body>
- Test
- </body>
- </html>
-HTML;
- $this->ci_set_config('charset', 'UTF-8');
- $output = $this->ci_core_class('output');
- $this->output = new $output();
- }
-
- // --------------------------------------------------------------------
-
- public function test_set_get_append_output()
- {
- $append = "<!-- comment /-->\n";
-
- $this->assertEquals(
- $this->_output_data.$append,
- $this->output
- ->set_output($this->_output_data)
- ->append_output("<!-- comment /-->\n")
- ->get_output()
- );
- }
-
- // --------------------------------------------------------------------
-
- public function test_get_content_type()
- {
- $this->assertEquals('text/html', $this->output->get_content_type());
- }
-
- // --------------------------------------------------------------------
-
- public function test_get_header()
- {
- $this->assertNull($this->output->get_header('Non-Existent-Header'));
-
- // TODO: Find a way to test header() values as well. Currently,
- // PHPUnit prevents this by not using output buffering.
-
- $this->output->set_content_type('text/plain', 'WINDOWS-1251');
- $this->assertEquals(
- 'text/plain; charset=WINDOWS-1251',
- $this->output->get_header('content-type')
- );
- }
-
-}
diff --git a/tests/codeigniter/core/Security_test.php b/tests/codeigniter/core/Security_test.php
deleted file mode 100644
index c650315ce..000000000
--- a/tests/codeigniter/core/Security_test.php
+++ /dev/null
@@ -1,356 +0,0 @@
-<?php
-
-class Security_test extends CI_TestCase {
-
- public function set_up()
- {
- // Set cookie for security test
- $_COOKIE['ci_csrf_cookie'] = md5(uniqid(mt_rand(), TRUE));
-
- // Set config for Security class
- $this->ci_set_config('csrf_protection', TRUE);
- $this->ci_set_config('csrf_token_name', 'ci_csrf_token');
- $this->ci_set_config('csrf_cookie_name', 'ci_csrf_cookie');
-
- $this->security = new Mock_Core_Security();
- }
-
- // --------------------------------------------------------------------
-
- public function test_csrf_verify()
- {
- $_SERVER['REQUEST_METHOD'] = 'GET';
-
- $this->assertInstanceOf('CI_Security', $this->security->csrf_verify());
- }
-
- // --------------------------------------------------------------------
-
- public function test_csrf_verify_invalid()
- {
- // Without issuing $_POST[csrf_token_name], this request will triggering CSRF error
- $_SERVER['REQUEST_METHOD'] = 'POST';
-
- $this->setExpectedException('RuntimeException', 'CI Error: The action you have requested is not allowed');
-
- $this->security->csrf_verify();
- }
-
- // --------------------------------------------------------------------
-
- public function test_csrf_verify_valid()
- {
- $_SERVER['REQUEST_METHOD'] = 'POST';
- $_POST[$this->security->csrf_token_name] = $this->security->csrf_hash;
-
- $this->assertInstanceOf('CI_Security', $this->security->csrf_verify());
- }
-
- // --------------------------------------------------------------------
-
- public function test_get_csrf_hash()
- {
- $this->assertEquals($this->security->csrf_hash, $this->security->get_csrf_hash());
- }
-
- // --------------------------------------------------------------------
-
- public function test_get_csrf_token_name()
- {
- $this->assertEquals('ci_csrf_token', $this->security->get_csrf_token_name());
- }
-
- // --------------------------------------------------------------------
-
- public function test_xss_clean()
- {
- $harm_string = "Hello, i try to <script>alert('Hack');</script> your site";
-
- $harmless_string = $this->security->xss_clean($harm_string);
-
- $this->assertEquals("Hello, i try to [removed]alert&#40;'Hack'&#41;;[removed] your site", $harmless_string);
- }
-
- // --------------------------------------------------------------------
-
- public function test_xss_clean_string_array()
- {
- $harm_strings = array(
- "Hello, i try to <script>alert('Hack');</script> your site",
- "Simple clean string",
- "Hello, i try to <script>alert('Hack');</script> your site"
- );
-
- $harmless_strings = $this->security->xss_clean($harm_strings);
-
- $this->assertEquals("Hello, i try to [removed]alert&#40;'Hack'&#41;;[removed] your site", $harmless_strings[0]);
- $this->assertEquals("Simple clean string", $harmless_strings[1]);
- $this->assertEquals("Hello, i try to [removed]alert&#40;'Hack'&#41;;[removed] your site", $harmless_strings[2]);
- }
-
- // --------------------------------------------------------------------
-
- public function test_xss_clean_image_valid()
- {
- $harm_string = '<img src="test.png">';
-
- $xss_clean_return = $this->security->xss_clean($harm_string, TRUE);
-
-// $this->assertTrue($xss_clean_return);
- }
-
- // --------------------------------------------------------------------
-
- public function test_xss_clean_image_invalid()
- {
- $harm_string = '<img src=javascript:alert(String.fromCharCode(88,83,83))>';
-
- $xss_clean_return = $this->security->xss_clean($harm_string, TRUE);
-
- $this->assertFalse($xss_clean_return);
- }
-
- // --------------------------------------------------------------------
-
- public function test_xss_clean_entity_double_encoded()
- {
- $input = '<a href="&#38&#35&#49&#48&#54&#38&#35&#57&#55&#38&#35&#49&#49&#56&#38&#35&#57&#55&#38&#35&#49&#49&#53&#38&#35&#57&#57&#38&#35&#49&#49&#52&#38&#35&#49&#48&#53&#38&#35&#49&#49&#50&#38&#35&#49&#49&#54&#38&#35&#53&#56&#38&#35&#57&#57&#38&#35&#49&#49&#49&#38&#35&#49&#49&#48&#38&#35&#49&#48&#50&#38&#35&#49&#48&#53&#38&#35&#49&#49&#52&#38&#35&#49&#48&#57&#38&#35&#52&#48&#38&#35&#52&#57&#38&#35&#52&#49">Clickhere</a>';
- $this->assertEquals('<a>Clickhere</a>', $this->security->xss_clean($input));
- }
-
- // --------------------------------------------------------------------
-
- public function text_xss_clean_js_link_removal()
- {
- // This one is to prevent a false positive
- $this->assertEquals(
- "<a href=\"javascrip\n<t\n:alert\n&#40;1&#41;\"\n>",
- $this->security->xss_clean("<a href=\"javascrip\n<t\n:alert\n(1)\"\n>")
- );
- }
-
- // --------------------------------------------------------------------
-
- public function test_xss_clean_js_img_removal()
- {
- $input = '<img src="&#38&#35&#49&#48&#54&#38&#35&#57&#55&#38&#35&#49&#49&#56&#38&#35&#57&#55&#38&#35&#49&#49&#53&#38&#35&#57&#57&#38&#35&#49&#49&#52&#38&#35&#49&#48&#53&#38&#35&#49&#49&#50&#38&#35&#49&#49&#54&#38&#35&#53&#56&#38&#35&#57&#57&#38&#35&#49&#49&#49&#38&#35&#49&#49&#48&#38&#35&#49&#48&#50&#38&#35&#49&#48&#53&#38&#35&#49&#49&#52&#38&#35&#49&#48&#57&#38&#35&#52&#48&#38&#35&#52&#57&#38&#35&#52&#49">Clickhere';
- $this->assertEquals('<img>', $this->security->xss_clean($input));
- }
-
- // --------------------------------------------------------------------
-
- public function test_xss_clean_sanitize_naughty_html_tags()
- {
- $this->assertEquals('&lt;unclosedTag', $this->security->xss_clean('<unclosedTag'));
- $this->assertEquals('&lt;blink&gt;', $this->security->xss_clean('<blink>'));
- $this->assertEquals('<fubar>', $this->security->xss_clean('<fubar>'));
-
- $this->assertEquals(
- '<img svg=""> src="x">',
- $this->security->xss_clean('<img <svg=""> src="x">')
- );
-
- $this->assertEquals(
- '<img src="b on=">on=">"x onerror="alert&#40;1&#41;">',
- $this->security->xss_clean('<img src="b on="<x">on=">"x onerror="alert(1)">')
- );
-
- $this->assertEquals(
- "\n>&lt;!-\n<b d=\"'e><iframe onload=alert&#40;1&#41; src=x>\n<a HREF=\">\n",
- $this->security->xss_clean("\n><!-\n<b\n<c d=\"'e><iframe onload=alert(1) src=x>\n<a HREF=\"\">\n")
- );
- }
-
- // --------------------------------------------------------------------
-
- public function test_xss_clean_sanitize_naughty_html_attributes()
- {
- $this->assertEquals('<foo xss=removed>', $this->security->xss_clean('<foo onAttribute="bar">'));
- $this->assertEquals('<foo xss=removed>', $this->security->xss_clean('<foo onAttributeNoQuotes=bar>'));
- $this->assertEquals('<foo xss=removed>', $this->security->xss_clean('<foo onAttributeWithSpaces = bar>'));
- $this->assertEquals('<foo prefixOnAttribute="bar">', $this->security->xss_clean('<foo prefixOnAttribute="bar">'));
- $this->assertEquals('<foo>onOutsideOfTag=test</foo>', $this->security->xss_clean('<foo>onOutsideOfTag=test</foo>'));
- $this->assertEquals('onNoTagAtAll = true', $this->security->xss_clean('onNoTagAtAll = true'));
- $this->assertEquals('<foo xss=removed>', $this->security->xss_clean('<foo fscommand=case-insensitive>'));
- $this->assertEquals('<foo xss=removed>', $this->security->xss_clean('<foo seekSegmentTime=whatever>'));
-
- $this->assertEquals(
- '<foo bar=">" baz=\'>\' xss=removed>',
- $this->security->xss_clean('<foo bar=">" baz=\'>\' onAfterGreaterThan="quotes">')
- );
- $this->assertEquals(
- '<foo bar=">" baz=\'>\' xss=removed>',
- $this->security->xss_clean('<foo bar=">" baz=\'>\' onAfterGreaterThan=noQuotes>')
- );
-
- $this->assertEquals(
- '<img src="x" on=""> on=&lt;svg&gt; onerror=alert&#40;1&#41;>',
- $this->security->xss_clean('<img src="x" on=""> on=<svg> onerror=alert(1)>')
- );
-
- $this->assertEquals(
- '<img src="on=\'">"&lt;svg&gt; onerror=alert&#40;1&#41; onmouseover=alert&#40;1&#41;>',
- $this->security->xss_clean('<img src="on=\'">"<svg> onerror=alert(1) onmouseover=alert(1)>')
- );
-
- $this->assertEquals(
- '<img src="x"> on=\'x\' onerror=``,alert&#40;1&#41;>',
- $this->security->xss_clean('<img src="x"> on=\'x\' onerror=``,alert(1)>')
- );
-
- $this->assertEquals(
- '<a xss=removed>',
- $this->security->xss_clean('<a< onmouseover="alert(1)">')
- );
-
- $this->assertEquals(
- '<img src="x"> on=\'x\' onerror=,xssm()>',
- $this->security->xss_clean('<img src="x"> on=\'x\' onerror=,xssm()>')
- );
-
- $this->assertEquals(
- '<image src="<>" xss=removed>',
- $this->security->xss_clean('<image src="<>" onerror=\'alert(1)\'>')
- );
-
- $this->assertEquals(
- '<b xss=removed>',
- $this->security->xss_clean('<b "=<= onmouseover=alert(1)>')
- );
-
- $this->assertEquals(
- '<b xss=removed xss=removed>1">',
- $this->security->xss_clean('<b a=<=" onmouseover="alert(1),1>1">')
- );
-
- $this->assertEquals(
- '<b x=" onmouseover=alert&#40;1&#41;//">',
- $this->security->xss_clean('<b "="< x=" onmouseover=alert(1)//">')
- );
- }
-
- // --------------------------------------------------------------------
-
- /**
- * @depends test_xss_clean_sanitize_naughty_html_tags
- * @depends test_xss_clean_sanitize_naughty_html_attributes
- */
- public function test_naughty_html_plus_evil_attributes()
- {
- $this->assertEquals(
- '&lt;svg<img src="x" xss=removed>',
- $this->security->xss_clean('<svg<img > src="x" onerror="location=/javascript/.source+/:alert/.source+/(1)/.source">')
- );
- }
-
- // --------------------------------------------------------------------
-
- public function test_xss_hash()
- {
- $this->assertEmpty($this->security->xss_hash);
-
- // Perform hash
- $this->security->xss_hash();
-
- $assertRegExp = class_exists('PHPUnit_Runner_Version')
- ? 'assertRegExp'
- : 'assertMatchesRegularExpression';
- $this->$assertRegExp('#^[0-9a-f]{32}$#iS', $this->security->xss_hash);
- }
-
- // --------------------------------------------------------------------
-
- public function test_get_random_bytes()
- {
- $length = "invalid";
- $this->assertFalse($this->security->get_random_bytes($length));
-
- $length = 10;
- $this->assertNotEmpty($this->security->get_random_bytes($length));
- }
-
- // --------------------------------------------------------------------
-
- public function test_entity_decode()
- {
- $encoded = '&lt;div&gt;Hello &lt;b&gt;Booya&lt;/b&gt;&lt;/div&gt;';
- $decoded = $this->security->entity_decode($encoded);
-
- $this->assertEquals('<div>Hello <b>Booya</b></div>', $decoded);
-
- $this->assertEquals('colon:', $this->security->entity_decode('colon&colon;'));
- $this->assertEquals("NewLine\n", $this->security->entity_decode('NewLine&NewLine;'));
- $this->assertEquals("Tab\t", $this->security->entity_decode('Tab&Tab;'));
- $this->assertEquals("lpar(", $this->security->entity_decode('lpar&lpar;'));
- $this->assertEquals("rpar)", $this->security->entity_decode('rpar&rpar;'));
-
- // Issue #3057 (https://github.com/bcit-ci/CodeIgniter/issues/3057)
- $this->assertEquals(
- '&foo should not include a semicolon',
- $this->security->entity_decode('&foo should not include a semicolon')
- );
- }
-
- // --------------------------------------------------------------------
-
- public function test_sanitize_filename()
- {
- $filename = './<!--foo-->';
- $safe_filename = $this->security->sanitize_filename($filename);
-
- $this->assertEquals('foo', $safe_filename);
- }
-
- // --------------------------------------------------------------------
-
- public function test_strip_image_tags()
- {
- $imgtags = array(
- '<img src="smiley.gif" alt="Smiley face" height="42" width="42">',
- '<img alt="Smiley face" height="42" width="42" src="smiley.gif">',
- '<img src="http://www.w3schools.com/images/w3schools_green.jpg">',
- '<img src="/img/sunset.gif" height="100%" width="100%">',
- '<img src="mdn-logo-sm.png" alt="MD Logo" srcset="mdn-logo-HD.png 2x, mdn-logo-small.png 15w, mdn-banner-HD.png 100w 2x" />',
- '<img sqrc="/img/sunset.gif" height="100%" width="100%">',
- '<img srqc="/img/sunset.gif" height="100%" width="100%">',
- '<img srcq="/img/sunset.gif" height="100%" width="100%">',
- '<img src=non-quoted.attribute foo="bar">'
- );
-
- $urls = array(
- 'smiley.gif',
- 'smiley.gif',
- 'http://www.w3schools.com/images/w3schools_green.jpg',
- '/img/sunset.gif',
- 'mdn-logo-sm.png',
- '<img sqrc="/img/sunset.gif" height="100%" width="100%">',
- '<img srqc="/img/sunset.gif" height="100%" width="100%">',
- '<img srcq="/img/sunset.gif" height="100%" width="100%">',
- 'non-quoted.attribute'
- );
-
- for ($i = 0; $i < count($imgtags); $i++)
- {
- $this->assertEquals($urls[$i], $this->security->strip_image_tags($imgtags[$i]));
- }
- }
-
- // --------------------------------------------------------------------
-
- public function test_csrf_set_hash()
- {
- // Set cookie for security test
- $_COOKIE['ci_csrf_cookie'] = md5(uniqid(mt_rand(), TRUE));
-
- // Set config for Security class
- $this->ci_set_config('csrf_protection', TRUE);
- $this->ci_set_config('csrf_token_name', 'ci_csrf_token');
-
- // leave csrf_cookie_name as blank to test _csrf_set_hash function
- $this->ci_set_config('csrf_cookie_name', '');
-
- $this->security = new Mock_Core_Security();
-
- $this->assertNotEmpty($this->security->get_csrf_hash());
- }
-}
diff --git a/tests/codeigniter/core/URI_test.php b/tests/codeigniter/core/URI_test.php
deleted file mode 100644
index 42dff3639..000000000
--- a/tests/codeigniter/core/URI_test.php
+++ /dev/null
@@ -1,254 +0,0 @@
-<?php
-
-class URI_test extends CI_TestCase {
-
- public function set_up()
- {
- $this->uri = new Mock_Core_URI();
- }
-
- // --------------------------------------------------------------------
-
- /* As of the following commit, _set_uri_string() is a protected method:
-
- https://github.com/bcit-ci/CodeIgniter/commit/d461934184d95b0cfb2feec93f27b621ef72a5c2
-
- public function test_set_uri_string()
- {
- // Slashes get killed
- $this->uri->_set_uri_string('/');
- $this->assertEquals('', $this->uri->uri_string);
-
- $this->uri->_set_uri_string('nice/uri');
- $this->assertEquals('nice/uri', $this->uri->uri_string);
- }
- */
-
- // --------------------------------------------------------------------
-
- /*
-
- This has been moved to the constructor
-
- public function test_fetch_uri_string()
- {
- define('SELF', 'index.php');
-
- // uri_protocol: AUTO
- $this->uri->config->set_item('uri_protocol', 'AUTO');
-
- // Test a variety of request uris
- $requests = array(
- '/index.php/controller/method' => 'controller/method',
- '/index.php?/controller/method' => 'controller/method',
- '/index.php?/controller/method/?var=foo' => 'controller/method'
- );
-
- foreach ($requests as $request => $expected)
- {
- $_SERVER['SCRIPT_NAME'] = '/index.php';
- $_SERVER['REQUEST_URI'] = $request;
-
- $this->uri->_fetch_uri_string();
- $this->assertEquals($expected, $this->uri->uri_string);
- }
-
- // Test a subfolder
- $_SERVER['SCRIPT_NAME'] = '/subfolder/index.php';
- $_SERVER['REQUEST_URI'] = '/subfolder/index.php/controller/method';
-
- $this->uri->_fetch_uri_string();
- $this->assertEquals('controller/method', $this->uri->uri_string);
-
- // death to request uri
- unset($_SERVER['REQUEST_URI']);
-
- // life to path info
- $_SERVER['PATH_INFO'] = '/controller/method/';
-
- $this->uri->_fetch_uri_string();
- $this->assertEquals('controller/method', $this->uri->uri_string);
-
- // death to path info
- // At this point your server must be seriously drunk
- unset($_SERVER['PATH_INFO']);
-
- $_SERVER['QUERY_STRING'] = '/controller/method/';
-
- $this->uri->_fetch_uri_string();
- $this->assertEquals('controller/method', $this->uri->uri_string);
-
- // At this point your server is a labotomy victim
- unset($_SERVER['QUERY_STRING']);
-
- $_GET['/controller/method/'] = '';
-
- $this->uri->_fetch_uri_string();
- $this->assertEquals('controller/method', $this->uri->uri_string);
-
- // Test coverage implies that these will work
- // uri_protocol: REQUEST_URI
- // uri_protocol: CLI
- }
- */
-
- // --------------------------------------------------------------------
-
- /*
-
- This has been moved into _set_uri_string()
-
- public function test_explode_segments()
- {
- // Let's test the function's ability to clean up this mess
- $uris = array(
- 'test/uri' => array('test', 'uri'),
- '/test2/uri2' => array('test2', 'uri2'),
- '//test3/test3///' => array('test3', 'test3')
- );
-
- foreach ($uris as $uri => $a)
- {
- $this->uri->segments = array();
- $this->uri->uri_string = $uri;
- $this->uri->_explode_segments();
-
- $this->assertEquals($a, $this->uri->segments);
- }
- }
- */
- // --------------------------------------------------------------------
-
- public function test_filter_uri_passing()
- {
- $this->uri->_set_permitted_uri_chars('a-z 0-9~%.:_\-');
-
- $str = 'abc01239~%.:_-';
- $this->uri->filter_uri($str);
- }
-
- // --------------------------------------------------------------------
-
- public function test_filter_uri_throws_error()
- {
- $this->setExpectedException('RuntimeException');
-
- $this->uri->config->set_item('enable_query_strings', FALSE);
- $this->uri->_set_permitted_uri_chars('a-z 0-9~%.:_\-');
- $segment = '$this()'; // filter_uri() accepts by reference
- $this->uri->filter_uri($segment);
- }
-
- // --------------------------------------------------------------------
-
- public function test_segment()
- {
- $this->uri->segments = array(1 => 'controller');
- $this->assertEquals($this->uri->segment(1), 'controller');
- $this->assertEquals($this->uri->segment(2, 'default'), 'default');
- }
-
- // --------------------------------------------------------------------
-
- public function test_rsegment()
- {
- $this->uri->rsegments = array(1 => 'method');
- $this->assertEquals($this->uri->rsegment(1), 'method');
- $this->assertEquals($this->uri->rsegment(2, 'default'), 'default');
- }
-
- // --------------------------------------------------------------------
-
- public function test_uri_to_assoc()
- {
- $this->uri->segments = array('a', '1', 'b', '2', 'c', '3');
-
- $this->assertEquals(
- array('a' => '1', 'b' => '2', 'c' => '3'),
- $this->uri->uri_to_assoc(1)
- );
-
- $this->assertEquals(
- array('b' => '2', 'c' => '3'),
- $this->uri->uri_to_assoc(3)
- );
-
- $this->uri->keyval = array(); // reset cache
- $this->uri->segments = array('a', '1', 'b', '2', 'c');
-
- $this->assertEquals(
- array('a' => '1', 'b' => '2', 'c' => FALSE),
- $this->uri->uri_to_assoc(1)
- );
-
- $this->uri->keyval = array(); // reset cache
- $this->uri->segments = array('a', '1');
-
- // test default
- $this->assertEquals(
- array('a' => '1', 'b' => FALSE),
- $this->uri->uri_to_assoc(1, array('a', 'b'))
- );
- }
-
- // --------------------------------------------------------------------
-
- public function test_ruri_to_assoc()
- {
- $this->uri->rsegments = array('x', '1', 'y', '2', 'z', '3');
-
- $this->assertEquals(
- array('x' => '1', 'y' => '2', 'z' => '3'),
- $this->uri->ruri_to_assoc(1)
- );
-
- $this->assertEquals(
- array('y' => '2', 'z' => '3'),
- $this->uri->ruri_to_assoc(3)
- );
-
- $this->uri->keyval = array(); // reset cache
- $this->uri->rsegments = array('x', '1', 'y', '2', 'z');
-
- $this->assertEquals(
- array('x' => '1', 'y' => '2', 'z' => FALSE),
- $this->uri->ruri_to_assoc(1)
- );
-
- $this->uri->keyval = array(); // reset cache
- $this->uri->rsegments = array('x', '1');
-
- // test default
- $this->assertEquals(
- array('x' => '1', 'y' => FALSE),
- $this->uri->ruri_to_assoc(1, array('x', 'y'))
- );
- }
-
- // --------------------------------------------------------------------
-
- public function test_assoc_to_uri()
- {
- $this->uri->config->set_item('uri_string_slashes', 'none');
- $this->assertEquals('a/1/b/2', $this->uri->assoc_to_uri(array('a' => '1', 'b' => '2')));
- }
-
- // --------------------------------------------------------------------
-
- public function test_slash_segment()
- {
- $this->uri->segments[1] = 'segment';
- $this->uri->rsegments[1] = 'segment';
-
- $this->assertEquals('/segment/', $this->uri->slash_segment(1, 'both'));
- $this->assertEquals('/segment/', $this->uri->slash_rsegment(1, 'both'));
-
- $a = '/segment';
- $this->assertEquals('/segment', $this->uri->slash_segment(1, 'leading'));
- $this->assertEquals('/segment', $this->uri->slash_rsegment(1, 'leading'));
-
- $this->assertEquals('segment/', $this->uri->slash_segment(1, 'trailing'));
- $this->assertEquals('segment/', $this->uri->slash_rsegment(1, 'trailing'));
- }
-
-}
diff --git a/tests/codeigniter/core/Utf8_test.php b/tests/codeigniter/core/Utf8_test.php
deleted file mode 100644
index c02c1dd87..000000000
--- a/tests/codeigniter/core/Utf8_test.php
+++ /dev/null
@@ -1,91 +0,0 @@
-<?php
-
-class Utf8_test extends CI_TestCase {
-
- public function set_up()
- {
- $this->ci_set_config('charset', 'UTF-8');
- $this->utf8 = new Mock_Core_Utf8();
- $this->ci_instance_var('utf8', $this->utf8);
- }
-
- // --------------------------------------------------------------------
-
- /**
- * __construct() test
- *
- * @covers CI_Utf8::__construct
- */
- public function test___construct()
- {
- if (defined('PREG_BAD_UTF8_ERROR') && (ICONV_ENABLED === TRUE OR MB_ENABLED === TRUE) && strtoupper(config_item('charset')) === 'UTF-8')
- {
- $this->assertTrue(UTF8_ENABLED);
- }
- else
- {
- $this->assertFalse(UTF8_ENABLED);
- }
- }
-
- // --------------------------------------------------------------------
-
- /**
- * is_ascii() test
- *
- * Note: DO NOT move this below test_clean_string()
- */
- public function test_is_ascii()
- {
- $this->assertTrue($this->utf8->is_ascii('foo bar'));
- $this->assertFalse($this->utf8->is_ascii('тест'));
- }
-
- // --------------------------------------------------------------------
-
- /**
- * clean_string() test
- *
- * @depends test_is_ascii
- * @covers CI_Utf8::clean_string
- */
- public function test_clean_string()
- {
- $this->assertEquals('foo bar', $this->utf8->clean_string('foo bar'));
-
- $illegal_utf8 = "\xc0тест";
- if (MB_ENABLED)
- {
- $this->assertEquals('тест', $this->utf8->clean_string($illegal_utf8));
- }
- elseif (ICONV_ENABLED)
- {
- // This is a known issue, iconv doesn't always work with //IGNORE
- $this->assertContains($this->utf8->clean_string($illegal_utf8), array('тест', ''));
- }
- else
- {
- $this->assertEquals($illegal_utf8, $this->utf8->clean_string($illegal_utf8));
- }
- }
-
- // --------------------------------------------------------------------
-
- /**
- * convert_to_utf8() test
- *
- * @covers CI_Utf8::convert_to_utf8
- */
- public function test_convert_to_utf8()
- {
- if (MB_ENABLED OR ICONV_ENABLED)
- {
- $this->assertEquals('тест', $this->utf8->convert_to_utf8('', 'WINDOWS-1251'));
- }
- else
- {
- $this->assertFalse($this->utf8->convert_to_utf8('', 'WINDOWS-1251'));
- }
- }
-
-}
diff --git a/tests/codeigniter/core/compat/hash_test.php b/tests/codeigniter/core/compat/hash_test.php
deleted file mode 100644
index d8cd0bb16..000000000
--- a/tests/codeigniter/core/compat/hash_test.php
+++ /dev/null
@@ -1,77 +0,0 @@
-<?php
-
-class hash_test extends CI_TestCase {
-
- public function test_bootstrap()
- {
- if (is_php('5.6'))
- {
- return $this->markTestSkipped('ext/hash is available on PHP 5.6');
- }
-
- $this->assertTrue(function_exists('hash_equals'));
- is_php('5.5') OR $this->assertTrue(function_exists('hash_pbkdf2'));
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * hash_equals() test
- *
- * Borrowed from PHP's own tests
- *
- * @depends test_bootstrap
- */
- public function test_hash_equals()
- {
- $this->assertTrue(hash_equals('same', 'same'));
- $this->assertFalse(hash_equals('not1same', 'not2same'));
- $this->assertFalse(hash_equals('short', 'longer'));
- $this->assertFalse(hash_equals('longer', 'short'));
- $this->assertFalse(hash_equals('', 'notempty'));
- $this->assertFalse(hash_equals('notempty', ''));
- $this->assertTrue(hash_equals('', ''));
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * hash_pbkdf2() test
- *
- * Borrowed from PHP's own tests
- *
- * @depends test_bootstrap
- */
- public function test_hash_pbkdf2()
- {
- if (is_php('5.5'))
- {
- return $this->markTestSkipped('hash_pbkdf2() is available on PHP 5.5');
- }
-
- $this->assertEquals('0c60c80f961f0e71f3a9', hash_pbkdf2('sha1', 'password', 'salt', 1, 20));
- $this->assertEquals(
- "\x0c\x60\xc8\x0f\x96\x1f\x0e\x71\xf3\xa9\xb5\x24\xaf\x60\x12\x06\x2f\xe0\x37\xa6",
- hash_pbkdf2('sha1', 'password', 'salt', 1, 20, TRUE)
- );
- $this->assertEquals('3d2eec4fe41c849b80c8d8366', hash_pbkdf2('sha1', 'passwordPASSWORDpassword', 'saltSALTsaltSALTsaltSALTsaltSALTsalt', 4096, 25));
- $this->assertEquals(
- "\x3d\x2e\xec\x4f\xe4\x1c\x84\x9b\x80\xc8\xd8\x36\x62\xc0\xe4\x4a\x8b\x29\x1a\x96\x4c\xf2\xf0\x70\x38",
- hash_pbkdf2('sha1', 'passwordPASSWORDpassword', 'saltSALTsaltSALTsaltSALTsaltSALTsalt', 4096, 25, TRUE)
- );
- $this->assertEquals('120fb6cffcf8b32c43e7', hash_pbkdf2('sha256', 'password', 'salt', 1, 20));
- $this->assertEquals(
- "\x12\x0f\xb6\xcf\xfc\xf8\xb3\x2c\x43\xe7\x22\x52\x56\xc4\xf8\x37\xa8\x65\x48\xc9",
- hash_pbkdf2('sha256', 'password', 'salt', 1, 20, TRUE)
- );
- $this->assertEquals(
- '348c89dbcbd32b2f32d814b8116e84cf2b17347e',
- hash_pbkdf2('sha256', 'passwordPASSWORDpassword', 'saltSALTsaltSALTsaltSALTsaltSALTsalt', 4096, 40)
- );
- $this->assertEquals(
- "\x34\x8c\x89\xdb\xcb\xd3\x2b\x2f\x32\xd8\x14\xb8\x11\x6e\x84\xcf\x2b\x17\x34\x7e\xbc\x18\x00\x18\x1c\x4e\x2a\x1f\xb8\xdd\x53\xe1\xc6\x35\x51\x8c\x7d\xac\x47\xe9",
- hash_pbkdf2('sha256', 'passwordPASSWORDpassword', 'saltSALTsaltSALTsaltSALTsaltSALTsalt', 4096, 40, TRUE)
- );
- }
-
-} \ No newline at end of file
diff --git a/tests/codeigniter/core/compat/mbstring_test.php b/tests/codeigniter/core/compat/mbstring_test.php
deleted file mode 100644
index 39f48ac10..000000000
--- a/tests/codeigniter/core/compat/mbstring_test.php
+++ /dev/null
@@ -1,54 +0,0 @@
-<?php
-
-class mbstring_test extends CI_TestCase {
-
- public function test_bootstrap()
- {
- if (MB_ENABLED)
- {
- return $this->markTestSkipped('ext/mbstring is loaded');
- }
-
- $this->assertTrue(function_exists('mb_strlen'));
- $this->assertTrue(function_exists('mb_substr'));
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * @depends test_bootstrap
- */
- public function test_mb_strlen()
- {
- $this->assertEquals(ICONV_ENABLED ? 4 : 8, mb_strlen('тест'));
- $this->assertEquals(ICONV_ENABLED ? 4 : 8, mb_strlen('тест', 'UTF-8'));
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * @depends test_bootstrap
- */
- public function test_mb_strpos()
- {
- $this->assertEquals(ICONV_ENABLED ? 2 : 4, mb_strpos('тест', 'с'));
- $this->assertFalse(mb_strpos('тест', 'с', 3));
- $this->assertEquals(ICONV_ENABLED ? 2 : 4, mb_strpos('тест', 'с', 1, 'UTF-8'));
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * @depends test_bootstrap
- */
- public function test_mb_substr()
- {
- $this->assertEquals(ICONV_ENABLED ? 'стинг' : 'естинг', mb_substr('тестинг', 2));
- $this->assertEquals(ICONV_ENABLED ? 'нг' : 'г', mb_substr('тестинг', -2));
- $this->assertEquals(ICONV_ENABLED ? 'ст' : 'е', mb_substr('тестинг', 2, 2));
- $this->assertEquals(ICONV_ENABLED ? 'стинг' : 'естинг', mb_substr('тестинг', 2, NULL, 'UTF-8'));
- $this->assertEquals(ICONV_ENABLED ? 'нг' : 'г', mb_substr('тестинг', -2, NULL, 'UTF-8'));
- $this->assertEquals(ICONV_ENABLED ? 'ст' : 'е', mb_substr('тестинг', 2, 2, 'UTF-8'));
- }
-
-}
diff --git a/tests/codeigniter/core/compat/password_test.php b/tests/codeigniter/core/compat/password_test.php
deleted file mode 100644
index b6dbcfab1..000000000
--- a/tests/codeigniter/core/compat/password_test.php
+++ /dev/null
@@ -1,159 +0,0 @@
-<?php
-
-class password_test extends CI_TestCase {
-
- public function test_bootstrap()
- {
- if (is_php('5.5'))
- {
- return $this->markTestSkipped('ext/standard/password is available on PHP 5.5');
- }
- // defined as of HHVM 2.3.0, which is also when they introduce password_*() as well
- // Note: Do NOT move this after the CRYPT_BLOWFISH check
- elseif (defined('HHVM_VERSION'))
- {
- $this->markTestSkipped('HHVM 2.3.0+ already has it');
- }
- elseif ( ! defined('CRYPT_BLOWFISH') OR CRYPT_BLOWFISH !== 1)
- {
- $this->assertFalse(defined('PASSWORD_BCRYPT'));
- return $this->markTestSkipped('CRYPT_BLOWFISH is not available');
- }
-
- $this->assertTrue(defined('PASSWORD_BCRYPT'));
- $this->assertTrue(defined('PASSWORD_DEFAULT'));
- $this->assertEquals(1, PASSWORD_BCRYPT);
- $this->assertEquals(PASSWORD_BCRYPT, PASSWORD_DEFAULT);
- $this->assertTrue(function_exists('password_get_info'));
- $this->assertTrue(function_exists('password_hash'));
- $this->assertTrue(function_exists('password_needs_rehash'));
- $this->assertTrue(function_exists('password_verify'));
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * password_get_info() test
- *
- * Borrowed from PHP's own tests
- *
- * @depends test_bootstrap
- */
- public function test_password_get_info()
- {
- $expected = array(
- 'algo' => 1,
- 'algoName' => 'bcrypt',
- 'options' => array('cost' => 10)
- );
-
- // default
- $this->assertEquals($expected, password_get_info('$2y$10$MTIzNDU2Nzg5MDEyMzQ1Nej0NmcAWSLR.oP7XOR9HD/vjUuOj100y'));
-
- $expected['options']['cost'] = 11;
-
- // cost
- $this->assertEquals($expected, password_get_info('$2y$11$MTIzNDU2Nzg5MDEyMzQ1Nej0NmcAWSLR.oP7XOR9HD/vjUuOj100y'));
-
- $expected = array(
- 'algo' => 0,
- 'algoName' => 'unknown',
- 'options' => array()
- );
-
- // invalid length
- $this->assertEquals($expected, password_get_info('$2y$11$MTIzNDU2Nzg5MDEyMzQ1Nej0NmcAWSLR.oP7XOR9HD/vjUuOj100'));
-
- // non-bcrypt
- $this->assertEquals($expected, password_get_info('$1$rasmusle$rISCgZzpwk3UhDidwXvin0'));
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * password_hash() test
- *
- * Borrowed from PHP's own tests
- *
- * @depends test_bootstrap
- */
- public function test_password_hash()
- {
- // FALSE is returned if no CSPRNG source is available
- if ( ! defined('MCRYPT_DEV_URANDOM') && ! function_exists('openssl_random_pseudo_bytes')
- && (DIRECTORY_SEPARATOR !== '/' OR ! is_readable('/dev/arandom') OR ! is_readable('/dev/urandom'))
- )
- {
- $this->assertFalse(password_hash('foo', PASSWORD_BCRYPT));
- }
- else
- {
- $this->assertEquals(60, strlen(password_hash('foo', PASSWORD_BCRYPT)));
- $this->assertTrue(($hash = password_hash('foo', PASSWORD_BCRYPT)) === crypt('foo', $hash));
- }
-
- $this->assertEquals(
- '$2y$07$usesomesillystringfore2uDLvp1Ii2e./U9C8sBjqp8I90dH6hi',
- password_hash('rasmuslerdorf', PASSWORD_BCRYPT, array('cost' => 7, 'salt' => 'usesomesillystringforsalt'))
- );
-
- $this->assertEquals(
- '$2y$10$MTIzNDU2Nzg5MDEyMzQ1Nej0NmcAWSLR.oP7XOR9HD/vjUuOj100y',
- password_hash('test', PASSWORD_BCRYPT, array('salt' => '123456789012345678901'.chr(0)))
- );
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * password_needs_rehash() test
- *
- * Borrowed from PHP's own tests
- *
- * @depends test_password_get_info
- */
- public function test_password_needs_rehash()
- {
- // invalid hash: always rehash
- $this->assertTrue(password_needs_rehash('', PASSWORD_BCRYPT));
-
- // valid, because it's an unknown algorithm
- $this->assertFalse(password_needs_rehash('', 0));
-
- // valid with same cost
- $this->assertFalse(password_needs_rehash('$2y$10$MTIzNDU2Nzg5MDEyMzQ1Nej0NmcAWSLR.oP7XOR9HD/vjUuOj100y', PASSWORD_BCRYPT, array('cost' => 10)));
-
- // valid with same cost and additional parameters
- $this->assertFalse(password_needs_rehash('$2y$10$MTIzNDU2Nzg5MDEyMzQ1Nej0NmcAWSLR.oP7XOR9HD/vjUuOj100y', PASSWORD_BCRYPT, array('cost' => 10, 'foo' => 3)));
-
- // invalid: different (lower) cost
- $this->assertTrue(password_needs_rehash('$2y$10$MTIzNDU2Nzg5MDEyMzQ1Nej0NmcAWSLR.oP7XOR9HD/vjUuOj100y', PASSWORD_BCRYPT, array('cost' => 9)));
-
- // invalid: different (higher) cost
- $this->assertTrue(password_needs_rehash('$2y$10$MTIzNDU2Nzg5MDEyMzQ1Nej0NmcAWSLR.oP7XOR9HD/vjUuOj100y', PASSWORD_BCRYPT, array('cost' => 11)));
-
- // valid with default cost
- $this->assertFalse(password_needs_rehash('$2y$'.str_pad(10, 2, '0', STR_PAD_LEFT).'$MTIzNDU2Nzg5MDEyMzQ1Nej0NmcAWSLR.oP7XOR9HD/vjUuOj100y', PASSWORD_BCRYPT));
-
- // invalid: 'foo' is cast to 0
- $this->assertTrue(password_needs_rehash('$2y$10$MTIzNDU2Nzg5MDEyMzQ1Nej0NmcAWSLR.oP7XOR9HD/vjUuOj100y', PASSWORD_BCRYPT, array('cost' => 'foo')));
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * password_verify() test
- *
- * Borrowed from PHP's own tests
- *
- * @depends test_bootstrap
- */
- public function test_password_verify()
- {
- $this->assertFalse(password_verify(123, 123));
- $this->assertFalse(password_verify('foo', '$2a$07$usesomesillystringforsalt$'));
- $this->assertFalse(password_verify('rasmusler', '$2a$07$usesomesillystringfore2uDLvp1Ii2e./U9C8sBjqp8I90dH6hi'));
- $this->assertTrue(password_verify('rasmuslerdorf', '$2a$07$usesomesillystringfore2uDLvp1Ii2e./U9C8sBjqp8I90dH6hi'));
- }
-
-}
diff --git a/tests/codeigniter/core/compat/standard_test.php b/tests/codeigniter/core/compat/standard_test.php
deleted file mode 100644
index a98460129..000000000
--- a/tests/codeigniter/core/compat/standard_test.php
+++ /dev/null
@@ -1,378 +0,0 @@
-<?php
-
-class standard_test extends CI_TestCase {
-
- public function test_bootstrap()
- {
- if (is_php('5.5'))
- {
- return $this->markTestSkipped('All array functions are already available on PHP 5.5');
- }
-
- $this->assertTrue(function_exists('array_column'));
-
- if ( ! is_php('5.4'))
- {
- $this->assertTrue(function_exists('hex2bin'));
- }
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * array_column() test
- *
- * Borrowed from PHP's own tests
- *
- * @depends test_bootstrap
- */
- public function test_array_column()
- {
- // Basic tests
-
- $input = array(
- array(
- 'id' => 1,
- 'first_name' => 'John',
- 'last_name' => 'Doe'
- ),
- array(
- 'id' => 2,
- 'first_name' => 'Sally',
- 'last_name' => 'Smith'
- ),
- array(
- 'id' => 3,
- 'first_name' => 'Jane',
- 'last_name' => 'Jones'
- )
- );
-
- // Ensure internal array position doesn't break it
- next($input);
-
- $this->assertEquals(
- array('John', 'Sally', 'Jane'),
- array_column($input, 'first_name')
- );
-
- $this->assertEquals(
- array(1, 2, 3),
- array_column($input, 'id')
- );
-
- $this->assertEquals(
- array(
- 1 => 'Doe',
- 2 => 'Smith',
- 3 => 'Jones'
- ),
- array_column($input, 'last_name', 'id')
- );
-
- $this->assertEquals(
- array(
- 'John' => 'Doe',
- 'Sally' => 'Smith',
- 'Jane' => 'Jones'
- ),
- array_column($input, 'last_name', 'first_name')
- );
-
- // Object key search
-
- $f = new Foo();
- $b = new Bar();
-
- $this->assertEquals(
- array('Doe', 'Smith', 'Jones'),
- array_column($input, $f)
- );
-
- $this->assertEquals(
- array(
- 'John' => 'Doe',
- 'Sally' => 'Smith',
- 'Jane' => 'Jones'
- ),
- array_column($input, $f, $b)
- );
-
- // NULL parameters
-
- $input = array(
- 456 => array(
- 'id' => '3',
- 'title' => 'Foo',
- 'date' => '2013-03-25'
- ),
- 457 => array(
- 'id' => '5',
- 'title' => 'Bar',
- 'date' => '2012-05-20'
- )
- );
-
- $this->assertEquals(
- array(
- 3 => array(
- 'id' => '3',
- 'title' => 'Foo',
- 'date' => '2013-03-25'
- ),
- 5 => array(
- 'id' => '5',
- 'title' => 'Bar',
- 'date' => '2012-05-20'
- )
- ),
- array_column($input, NULL, 'id')
- );
-
- $this->assertEquals(
- array(
- array(
- 'id' => '3',
- 'title' => 'Foo',
- 'date' => '2013-03-25'
- ),
- array(
- 'id' => '5',
- 'title' => 'Bar',
- 'date' => '2012-05-20'
- )
- ),
- array_column($input, NULL, 'foo')
- );
-
- $this->assertEquals(
- array(
- array(
- 'id' => '3',
- 'title' => 'Foo',
- 'date' => '2013-03-25'
- ),
- array(
- 'id' => '5',
- 'title' => 'Bar',
- 'date' => '2012-05-20'
- )
- ),
- array_column($input, NULL)
- );
-
- // Data types
-
- $fh = fopen(__FILE__, 'r', TRUE);
- $stdClass = new stdClass();
- $input = array(
- array(
- 'id' => 1,
- 'value' => $stdClass
- ),
- array(
- 'id' => 2,
- 'value' => 34.2345
- ),
- array(
- 'id' => 3,
- 'value' => TRUE
- ),
- array(
- 'id' => 4,
- 'value' => FALSE
- ),
- array(
- 'id' => 5,
- 'value' => NULL
- ),
- array(
- 'id' => 6,
- 'value' => 1234
- ),
- array(
- 'id' => 7,
- 'value' => 'Foo'
- ),
- array(
- 'id' => 8,
- 'value' => $fh
- )
- );
-
- $this->assertEquals(
- array(
- $stdClass,
- 34.2345,
- TRUE,
- FALSE,
- NULL,
- 1234,
- 'Foo',
- $fh
- ),
- array_column($input, 'value')
- );
-
- $this->assertEquals(
- array(
- 1 => $stdClass,
- 2 => 34.2345,
- 3 => TRUE,
- 4 => FALSE,
- 5 => NULL,
- 6 => 1234,
- 7 => 'Foo',
- 8 => $fh
- ),
- array_column($input, 'value', 'id')
- );
-
- // Numeric column keys
-
- $input = array(
- array('aaa', '111'),
- array('bbb', '222'),
- array('ccc', '333', -1 => 'ddd')
- );
-
- $this->assertEquals(
- array('111', '222', '333'),
- array_column($input, 1)
- );
-
- $this->assertEquals(
- array(
- 'aaa' => '111',
- 'bbb' => '222',
- 'ccc' => '333'
- ),
- array_column($input, 1, 0)
- );
-
- $this->assertEquals(
- array(
- 'aaa' => '111',
- 'bbb' => '222',
- 'ccc' => '333'
- ),
- array_column($input, 1, 0.123)
- );
-
- $this->assertEquals(
- array(
- 0 => '111',
- 1 => '222',
- 'ddd' => '333'
- ),
- array_column($input, 1, -1)
- );
-
- // Non-existing columns
-
- $this->assertEquals(array(), array_column($input, 2));
- $this->assertEquals(array(), array_column($input, 'foo'));
- $this->assertEquals(
- array('aaa', 'bbb', 'ccc'),
- array_column($input, 0, 'foo')
- );
- $this->assertEquals(array(), array_column($input, 3.14));
-
- // One-dimensional array
- $this->assertEquals(array(), array_column(array('foo', 'bar', 'baz'), 1));
-
- // Columns not present in all rows
-
- $input = array(
- array('a' => 'foo', 'b' => 'bar', 'e' => 'bbb'),
- array('a' => 'baz', 'c' => 'qux', 'd' => 'aaa'),
- array('a' => 'eee', 'b' => 'fff', 'e' => 'ggg')
- );
-
- $this->assertEquals(
- array('qux'),
- array_column($input, 'c')
- );
-
- $this->assertEquals(
- array('baz' => 'qux'),
- array_column($input, 'c', 'a')
- );
-
- $this->assertEquals(
- array(
- 0 => 'foo',
- 'aaa' => 'baz',
- 1 => 'eee'
- ),
- array_column($input, 'a', 'd')
- );
-
- $this->assertEquals(
- array(
- 'bbb' => 'foo',
- 0 => 'baz',
- 'ggg' => 'eee'
- ),
- array_column($input, 'a', 'e')
- );
-
- $this->assertEquals(
- array('bar', 'fff'),
- array_column($input, 'b')
- );
-
- $this->assertEquals(
- array(
- 'foo' => 'bar',
- 'eee' => 'fff'
- ),
- array_column($input, 'b', 'a')
- );
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * hex2bin() tests
- *
- * @depends test_bootstrap
- */
- public function test_hex2bin()
- {
- if (is_php('5.4'))
- {
- return $this->markTestSkipped('hex2bin() is already available on PHP 5.4');
- }
-
- $this->assertEquals("\x03\x04", hex2bin("0304"));
- $this->assertEquals('', hex2bin(''));
- $this->assertEquals("\x01\x02\x03", hex2bin(new FooHex()));
- }
-}
-
-// ------------------------------------------------------------------------
-
-class Foo {
-
- public function __toString()
- {
- return 'last_name';
- }
-}
-
-class Bar {
-
- public function __toString()
- {
- return 'first_name';
- }
-}
-
-class FooHex {
-
- public function __toString()
- {
- return '010203';
- }
-}
diff --git a/tests/codeigniter/database/DB_driver_test.php b/tests/codeigniter/database/DB_driver_test.php
deleted file mode 100644
index 26416d3fc..000000000
--- a/tests/codeigniter/database/DB_driver_test.php
+++ /dev/null
@@ -1,39 +0,0 @@
-<?php
-
-class DB_driver_test extends CI_TestCase {
-
- public function test_initialize()
- {
- $config = Mock_Database_DB::config(DB_DRIVER);
- sscanf(DB_DRIVER, '%[^/]/', $driver_name);
- $driver = $this->{$driver_name}($config[DB_DRIVER]);
-
- $this->assertTrue($driver->initialize());
- }
-
- protected function pdo($config)
- {
- return new Mock_Database_Drivers_PDO($config);
- }
-
- protected function mysql($config)
- {
- return new Mock_Database_Drivers_Mysql($config);
- }
-
- protected function mysqli($config)
- {
- return new Mock_Database_Drivers_Mysqli($config);
- }
-
- protected function sqlite($config)
- {
- return new Mock_Database_Drivers_Sqlite($config);
- }
-
- protected function pgsql($config)
- {
- return new Mock_Database_Drivers_Postgre($config);
- }
-
-} \ No newline at end of file
diff --git a/tests/codeigniter/database/DB_test.php b/tests/codeigniter/database/DB_test.php
deleted file mode 100644
index 9d53fd6f2..000000000
--- a/tests/codeigniter/database/DB_test.php
+++ /dev/null
@@ -1,61 +0,0 @@
-<?php
-
-class DB_test extends CI_TestCase {
-
- public function test_db_invalid()
- {
- $connection = new Mock_Database_DB(array(
- 'undefined' => array(
- 'dsn' => '',
- 'hostname' => 'undefined',
- 'username' => 'undefined',
- 'password' => 'undefined',
- 'database' => 'undefined',
- 'dbdriver' => 'undefined',
- ),
- ));
-
- $this->setExpectedException('RuntimeException', 'CI Error: Invalid DB driver');
-
- Mock_Database_DB::DB($connection->set_dsn('undefined'), TRUE);
- }
-
- // ------------------------------------------------------------------------
-
- public function test_db_valid()
- {
- $config = Mock_Database_DB::config(DB_DRIVER);
- $connection = new Mock_Database_DB($config);
-
- // E_DEPRECATED notices thrown by mysql_connect(), mysql_pconnect()
- // on PHP 5.5+ cause the tests to fail
- if (DB_DRIVER === 'mysql' && version_compare(PHP_VERSION, '5.5', '>='))
- {
- error_reporting(E_ALL & ~E_DEPRECATED);
- }
-
- $db = Mock_Database_DB::DB($connection->set_dsn(DB_DRIVER), TRUE);
-
- $this->assertInstanceOf('CI_DB', $db);
- $this->assertInstanceOf('CI_DB_Driver', $db);
- }
-
- // ------------------------------------------------------------------------
-
-/*
- This test is unusable, because whoever wrote it apparently thought that
- an E_WARNING should equal an Exception and based the whole test suite
- around that bogus assumption.
-
- public function test_db_failover()
- {
- $config = Mock_Database_DB::config(DB_DRIVER);
- $connection = new Mock_Database_DB($config);
- $db = Mock_Database_DB::DB($connection->set_dsn(DB_DRIVER.'_failover'), TRUE);
-
- $this->assertInstanceOf('CI_DB', $db);
- $this->assertInstanceOf('CI_DB_Driver', $db);
- }
-*/
-
-}
diff --git a/tests/codeigniter/database/query_builder/count_test.php b/tests/codeigniter/database/query_builder/count_test.php
deleted file mode 100644
index da312d866..000000000
--- a/tests/codeigniter/database/query_builder/count_test.php
+++ /dev/null
@@ -1,48 +0,0 @@
-<?php
-
-class Count_test extends CI_TestCase {
-
- /**
- * @var object Database/Query Builder holder
- */
- protected $db;
-
- public function set_up()
- {
- $this->db = Mock_Database_Schema_Skeleton::init(DB_DRIVER);
-
- Mock_Database_Schema_Skeleton::create_tables();
- Mock_Database_Schema_Skeleton::create_data();
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * @see ./mocks/schema/skeleton.php
- */
- public function test_count_all()
- {
- $this->assertEquals(4, $this->db->count_all('job'));
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * @see ./mocks/schema/skeleton.php
- */
- public function test_count_all_results()
- {
- $this->assertEquals(2, $this->db->like('name', 'ian')->count_all_results('job'));
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * @see ./mocks/schema/skeleton.php
- */
- public function test_count_all_results_limit()
- {
- $this->assertEquals(1, $this->db->like('name', 'ian')->limit(1)->count_all_results('job'));
- }
-
-} \ No newline at end of file
diff --git a/tests/codeigniter/database/query_builder/delete_test.php b/tests/codeigniter/database/query_builder/delete_test.php
deleted file mode 100644
index ab9d97f56..000000000
--- a/tests/codeigniter/database/query_builder/delete_test.php
+++ /dev/null
@@ -1,64 +0,0 @@
-<?php
-
-class Delete_test extends CI_TestCase {
-
- /**
- * @var object Database/Query Builder holder
- */
- protected $db;
-
- public function set_up()
- {
- $this->db = Mock_Database_Schema_Skeleton::init(DB_DRIVER);
-
- Mock_Database_Schema_Skeleton::create_tables();
- Mock_Database_Schema_Skeleton::create_data();
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * @see ./mocks/schema/skeleton.php
- */
- public function test_delete()
- {
- // Check initial record
- $job1 = $this->db->where('id', 1)->get('job')->row();
-
- $this->assertEquals('Developer', $job1->name);
-
- // Do the delete
- $this->db->delete('job', array('id' => 1));
-
- // Check the record
- $job1 = $this->db->where('id', 1)->get('job');
-
- $this->assertEmpty($job1->result_array());
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * @see ./mocks/schema/skeleton.php
- */
- public function test_delete_several_tables()
- {
- // Check initial record
- $user4 = $this->db->where('id', 4)->get('user')->row();
- $job4 = $this->db->where('id', 4)->get('job')->row();
-
- $this->assertEquals('Musician', $job4->name);
- $this->assertEquals('Chris Martin', $user4->name);
-
- // Do the delete
- $this->db->delete(array('job', 'user'), array('id' => 4));
-
- // Check the record
- $job4 = $this->db->where('id', 4)->get('job');
- $user4 = $this->db->where('id', 4)->get('user');
-
- $this->assertEmpty($job4->result_array());
- $this->assertEmpty($user4->result_array());
- }
-
-} \ No newline at end of file
diff --git a/tests/codeigniter/database/query_builder/distinct_test.php b/tests/codeigniter/database/query_builder/distinct_test.php
deleted file mode 100644
index 81fabe448..000000000
--- a/tests/codeigniter/database/query_builder/distinct_test.php
+++ /dev/null
@@ -1,33 +0,0 @@
-<?php
-
-class Distinct_test extends CI_TestCase {
-
- /**
- * @var object Database/Query Builder holder
- */
- protected $db;
-
- public function set_up()
- {
- $this->db = Mock_Database_Schema_Skeleton::init(DB_DRIVER);
-
- Mock_Database_Schema_Skeleton::create_tables();
- Mock_Database_Schema_Skeleton::create_data();
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * @see ./mocks/schema/skeleton.php
- */
- public function test_distinct()
- {
- $users = $this->db->select('country')
- ->distinct()
- ->get('user')
- ->result_array();
-
- $this->assertCount(3, $users);
- }
-
-}
diff --git a/tests/codeigniter/database/query_builder/empty_test.php b/tests/codeigniter/database/query_builder/empty_test.php
deleted file mode 100644
index 3f63a60f5..000000000
--- a/tests/codeigniter/database/query_builder/empty_test.php
+++ /dev/null
@@ -1,39 +0,0 @@
-<?php
-
-class Empty_test extends CI_TestCase {
-
- /**
- * @var object Database/Query Builder holder
- */
- protected $db;
-
- public function set_up()
- {
- $this->db = Mock_Database_Schema_Skeleton::init(DB_DRIVER);
-
- Mock_Database_Schema_Skeleton::create_tables();
- Mock_Database_Schema_Skeleton::create_data();
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * @see ./mocks/schema/skeleton.php
- */
- public function test_empty_table()
- {
- // Check initial record
- $jobs = $this->db->get('job')->result_array();
-
- $this->assertCount(4, $jobs);
-
- // Do the empty
- $this->db->empty_table('job');
-
- // Check the record
- $jobs = $this->db->get('job');
-
- $this->assertEmpty($jobs->result_array());
- }
-
-}
diff --git a/tests/codeigniter/database/query_builder/escape_test.php b/tests/codeigniter/database/query_builder/escape_test.php
deleted file mode 100644
index de6cd0a9d..000000000
--- a/tests/codeigniter/database/query_builder/escape_test.php
+++ /dev/null
@@ -1,68 +0,0 @@
-<?php
-
-class Escape_test extends CI_TestCase {
-
- /**
- * @var object Database/Query Builder holder
- */
- protected $db;
-
- public function set_up()
- {
- $this->db = Mock_Database_Schema_Skeleton::init(DB_DRIVER);
-
- Mock_Database_Schema_Skeleton::create_tables();
- Mock_Database_Schema_Skeleton::create_data();
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * @see ./mocks/schema/skeleton.php
- */
- public function test_escape_like_percent_sign()
- {
- // Escape the like string
- $string = $this->db->escape_like_str('\%foo');
-
- if (strpos(DB_DRIVER, 'mysql') !== FALSE)
- {
- $sql = "SELECT `value` FROM `misc` WHERE `key` LIKE '$string%' ESCAPE '!';";
- }
- else
- {
- $sql = 'SELECT "value" FROM "misc" WHERE "key" LIKE \''.$string.'%\' ESCAPE \'!\';';
- }
-
- $res = $this->db->query($sql)->result_array();
-
- // Check the result
- $this->assertCount(1, $res);
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * @see ./mocks/schema/skeleton.php
- */
- public function test_escape_like_backslash_sign()
- {
- // Escape the like string
- $string = $this->db->escape_like_str('\\');
-
- if (strpos(DB_DRIVER, 'mysql') !== FALSE)
- {
- $sql = "SELECT `value` FROM `misc` WHERE `key` LIKE '$string%' ESCAPE '!';";
- }
- else
- {
- $sql = 'SELECT "value" FROM "misc" WHERE "key" LIKE \''.$string.'%\' ESCAPE \'!\';';
- }
-
- $res = $this->db->query($sql)->result_array();
-
- // Check the result
- $this->assertCount(2, $res);
- }
-
-}
diff --git a/tests/codeigniter/database/query_builder/from_test.php b/tests/codeigniter/database/query_builder/from_test.php
deleted file mode 100644
index 5a4ac690d..000000000
--- a/tests/codeigniter/database/query_builder/from_test.php
+++ /dev/null
@@ -1,49 +0,0 @@
-<?php
-
-class From_test extends CI_TestCase {
-
- /**
- * @var object Database/Query Builder holder
- */
- protected $db;
-
- public function set_up()
- {
- $this->db = Mock_Database_Schema_Skeleton::init(DB_DRIVER);
-
- Mock_Database_Schema_Skeleton::create_tables();
- Mock_Database_Schema_Skeleton::create_data();
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * @see ./mocks/schema/skeleton.php
- */
- public function test_from_simple()
- {
- $jobs = $this->db->from('job')
- ->get()
- ->result_array();
-
- $this->assertCount(4, $jobs);
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * @see ./mocks/schema/skeleton.php
- */
- public function test_from_with_where()
- {
- $job1 = $this->db->from('job')
- ->where('id', 1)
- ->get()
- ->row();
-
- $this->assertEquals('1', $job1->id);
- $this->assertEquals('Developer', $job1->name);
- $this->assertEquals('Awesome job, but sometimes makes you bored', $job1->description);
- }
-
-}
diff --git a/tests/codeigniter/database/query_builder/get_test.php b/tests/codeigniter/database/query_builder/get_test.php
deleted file mode 100644
index 156027537..000000000
--- a/tests/codeigniter/database/query_builder/get_test.php
+++ /dev/null
@@ -1,53 +0,0 @@
-<?php
-
-class Get_test extends CI_TestCase {
-
- /**
- * @var object Database/Query Builder holder
- */
- protected $db;
-
- public function set_up()
- {
- $this->db = Mock_Database_Schema_Skeleton::init(DB_DRIVER);
-
- Mock_Database_Schema_Skeleton::create_tables();
- Mock_Database_Schema_Skeleton::create_data();
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * @see ./mocks/schema/skeleton.php
- */
- public function test_get_simple()
- {
- $jobs = $this->db->get('job')->result_array();
-
- // Dummy jobs contain 4 rows
- $this->assertCount(4, $jobs);
-
- // Check rows item
- $this->assertEquals('Developer', $jobs[0]['name']);
- $this->assertEquals('Politician', $jobs[1]['name']);
- $this->assertEquals('Accountant', $jobs[2]['name']);
- $this->assertEquals('Musician', $jobs[3]['name']);
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * @see ./mocks/schema/skeleton.php
- */
- public function test_get_where()
- {
- $job1 = $this->db->get_where('job', array('id' => 1))->result_array();
-
- // Dummy jobs contain 1 rows
- $this->assertCount(1, $job1);
-
- // Check rows item
- $this->assertEquals('Developer', $job1[0]['name']);
- }
-
-} \ No newline at end of file
diff --git a/tests/codeigniter/database/query_builder/group_test.php b/tests/codeigniter/database/query_builder/group_test.php
deleted file mode 100644
index b40e5e507..000000000
--- a/tests/codeigniter/database/query_builder/group_test.php
+++ /dev/null
@@ -1,50 +0,0 @@
-<?php
-
-class Group_test extends CI_TestCase {
-
- /**
- * @var object Database/Query Builder holder
- */
- protected $db;
-
- public function set_up()
- {
- $this->db = Mock_Database_Schema_Skeleton::init(DB_DRIVER);
-
- Mock_Database_Schema_Skeleton::create_tables();
- Mock_Database_Schema_Skeleton::create_data();
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * @see ./mocks/schema/skeleton.php
- */
- public function test_group_by()
- {
- $jobs = $this->db->select('name')
- ->from('job')
- ->group_by('name')
- ->get()
- ->result_array();
-
- $this->assertCount(4, $jobs);
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * @see ./mocks/schema/skeleton.php
- */
- public function test_having_by()
- {
- $jobs = $this->db->select('name')
- ->from('job')
- ->group_by('name')
- ->having('SUM(id) > 2')
- ->get()
- ->result_array();
-
- $this->assertCount(2, $jobs);
- }
-}
diff --git a/tests/codeigniter/database/query_builder/insert_test.php b/tests/codeigniter/database/query_builder/insert_test.php
deleted file mode 100644
index 30c055680..000000000
--- a/tests/codeigniter/database/query_builder/insert_test.php
+++ /dev/null
@@ -1,66 +0,0 @@
-<?php
-
-class Insert_test extends CI_TestCase {
-
- /**
- * @var object Database/Query Builder holder
- * @see ./mocks/schema/skeleton.php
- */
- protected $db;
-
- public function set_up()
- {
- $this->db = Mock_Database_Schema_Skeleton::init(DB_DRIVER);
-
- Mock_Database_Schema_Skeleton::create_tables();
-
- // Truncate the current datas
- $this->db->truncate('job');
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * @see ./mocks/schema/skeleton.php
- */
- public function test_insert()
- {
- $job_data = array('id' => 1, 'name' => 'Grocery Sales', 'description' => 'Discount!');
-
- // Do normal insert
- $this->assertTrue($this->db->insert('job', $job_data));
-
- $job1 = $this->db->get('job')->row();
-
- // Check the result
- $this->assertEquals('Grocery Sales', $job1->name);
-
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * @see ./mocks/schema/skeleton.php
- */
- public function test_insert_batch()
- {
- $job_datas = array(
- array('id' => 2, 'name' => 'Commedian', 'description' => 'Theres something in your teeth'),
- array('id' => 3, 'name' => 'Cab Driver', 'description' => 'Iam yellow'),
- );
-
- // Do insert batch except for sqlite driver
- if (strpos(DB_DRIVER, 'sqlite') === FALSE)
- {
- $this->assertEquals(2, $this->db->insert_batch('job', $job_datas));
-
- $job_2 = $this->db->where('id', 2)->get('job')->row();
- $job_3 = $this->db->where('id', 3)->get('job')->row();
-
- // Check the result
- $this->assertEquals('Commedian', $job_2->name);
- $this->assertEquals('Cab Driver', $job_3->name);
- }
- }
-
-} \ No newline at end of file
diff --git a/tests/codeigniter/database/query_builder/join_test.php b/tests/codeigniter/database/query_builder/join_test.php
deleted file mode 100644
index 54b2a4e18..000000000
--- a/tests/codeigniter/database/query_builder/join_test.php
+++ /dev/null
@@ -1,101 +0,0 @@
-<?php
-
-class Join_test extends CI_TestCase {
-
- /**
- * @var object Database/Query Builder holder
- */
- protected $db;
-
- public function set_up()
- {
- $this->db = Mock_Database_Schema_Skeleton::init(DB_DRIVER);
-
- Mock_Database_Schema_Skeleton::create_tables();
- Mock_Database_Schema_Skeleton::create_data();
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * @see ./mocks/schema/skeleton.php
- */
- public function test_join_simple()
- {
- $job_user = $this->db->select('job.id as job_id, job.name as job_name, user.id as user_id, user.name as user_name')
- ->from('job')
- ->join('user', 'user.id = job.id')
- ->get()
- ->result_array();
-
- // Check the result
- $this->assertEquals('1', $job_user[0]['job_id']);
- $this->assertEquals('1', $job_user[0]['user_id']);
- $this->assertEquals('Derek Jones', $job_user[0]['user_name']);
- $this->assertEquals('Developer', $job_user[0]['job_name']);
- }
-
- // ------------------------------------------------------------------------
-
- public function test_join_escape_is_null()
- {
- $expected = 'SELECT '.$this->db->escape_identifiers('field')
- ."\nFROM ".$this->db->escape_identifiers('table1')
- ."\nJOIN ".$this->db->escape_identifiers('table2').' ON '.$this->db->escape_identifiers('field').' IS NULL';
-
- $this->assertEquals(
- $expected,
- $this->db->select('field')->from('table1')->join('table2', 'field IS NULL')->get_compiled_select()
- );
-
- $expected = 'SELECT '.$this->db->escape_identifiers('field')
- ."\nFROM ".$this->db->escape_identifiers('table1')
- ."\nJOIN ".$this->db->escape_identifiers('table2').' ON '.$this->db->escape_identifiers('field').' IS NOT NULL';
-
- $this->assertEquals(
- $expected,
- $this->db->select('field')->from('table1')->join('table2', 'field IS NOT NULL')->get_compiled_select()
- );
- }
-
- // ------------------------------------------------------------------------
-
- public function test_join_escape_multiple_conditions()
- {
- // We just need a valid query produced, not one that makes sense
- $fields = array($this->db->protect_identifiers('table1.field1'), $this->db->protect_identifiers('table2.field2'));
-
- $expected = 'SELECT '.implode(', ', $fields)
- ."\nFROM ".$this->db->escape_identifiers('table1')
- ."\nLEFT JOIN ".$this->db->escape_identifiers('table2').' ON '.implode(' = ', $fields)
- .' AND '.$fields[0]." = 'foo' AND ".$fields[1].' = 0';
-
- $result = $this->db->select('table1.field1, table2.field2')
- ->from('table1')
- ->join('table2', "table1.field1 = table2.field2 AND table1.field1 = 'foo' AND table2.field2 = 0", 'LEFT')
- ->get_compiled_select();
-
- $this->assertEquals($expected, $result);
- }
-
- // ------------------------------------------------------------------------
-
- public function test_join_escape_multiple_conditions_with_parentheses()
- {
- // We just need a valid query produced, not one that makes sense
- $fields = array($this->db->protect_identifiers('table1.field1'), $this->db->protect_identifiers('table2.field2'));
-
- $expected = 'SELECT '.implode(', ', $fields)
- ."\nFROM ".$this->db->escape_identifiers('table1')
- ."\nRIGHT JOIN ".$this->db->escape_identifiers('table2').' ON '.implode(' = ', $fields)
- .' AND ('.$fields[0]." = 'foo' OR ".$fields[1].' IS NULL)';
-
- $result = $this->db->select('table1.field1, table2.field2')
- ->from('table1')
- ->join('table2', "table1.field1 = table2.field2 AND (table1.field1 = 'foo' OR table2.field2 IS NULL)", 'RIGHT')
- ->get_compiled_select();
-
- $this->assertEquals($expected, $result);
- }
-
-} \ No newline at end of file
diff --git a/tests/codeigniter/database/query_builder/like_test.php b/tests/codeigniter/database/query_builder/like_test.php
deleted file mode 100644
index 4d8673d99..000000000
--- a/tests/codeigniter/database/query_builder/like_test.php
+++ /dev/null
@@ -1,129 +0,0 @@
-<?php
-
-class Like_test extends CI_TestCase {
-
- /**
- * @var object Database/Query Builder holder
- */
- protected $db;
-
- public function set_up()
- {
- $this->db = Mock_Database_Schema_Skeleton::init(DB_DRIVER);
-
- Mock_Database_Schema_Skeleton::create_tables();
- Mock_Database_Schema_Skeleton::create_data();
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * @see ./mocks/schema/skeleton.php
- */
- public function test_like()
- {
- $job1 = $this->db->like('name', 'veloper')
- ->get('job')
- ->row();
-
- // Check the result
- $this->assertEquals('1', $job1->id);
- $this->assertEquals('Developer', $job1->name);
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * @see ./mocks/schema/skeleton.php
- */
- public function test_or_like()
- {
- $jobs = $this->db->like('name', 'ian')
- ->or_like('name', 'veloper')
- ->get('job')
- ->result_array();
-
- // Check the result
- $this->assertCount(3, $jobs);
- $this->assertEquals('Developer', $jobs[0]['name']);
- $this->assertEquals('Politician', $jobs[1]['name']);
- $this->assertEquals('Musician', $jobs[2]['name']);
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * @see ./mocks/schema/skeleton.php
- */
- public function test_not_like()
- {
- $jobs = $this->db->not_like('name', 'veloper')
- ->get('job')
- ->result_array();
-
- // Check the result
- $this->assertCount(3, $jobs);
- $this->assertEquals('Politician', $jobs[0]['name']);
- $this->assertEquals('Accountant', $jobs[1]['name']);
- $this->assertEquals('Musician', $jobs[2]['name']);
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * @see ./mocks/schema/skeleton.php
- */
- public function test_or_not_like()
- {
- $jobs = $this->db->like('name', 'an')
- ->or_not_like('name', 'veloper')
- ->get('job')
- ->result_array();
-
- // Check the result
- $this->assertCount(3, $jobs);
- $this->assertEquals('Politician', $jobs[0]['name']);
- $this->assertEquals('Accountant', $jobs[1]['name']);
- $this->assertEquals('Musician', $jobs[2]['name']);
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * GitHub issue #273
- *
- * @see ./mocks/schema/skeleton.php
- */
- public function test_like_spaces_and_tabs()
- {
- $spaces = $this->db->like('value', ' ')->get('misc')->result_array();
- $tabs = $this->db->like('value', "\t")->get('misc')->result_array();
-
- $this->assertCount(1, $spaces);
- $this->assertCount(1, $tabs);
- }
-
- /**
- * GitHub issue #5462
- *
- * @see ./mocks/schema/skeleton.php
- *
- * @dataProvider like_set_side_provider
- */
- public function test_like_set_side($str, $side, $expected_name)
- {
- $actual = $this->db->like('name', $str, $side)->get('job')->result_array();
- $this->assertCount(1, $actual);
- $this->assertEquals($expected_name, $actual[0]['name']);
- }
-
- public function like_set_side_provider()
- {
- return array(
- array('Developer', 'none', 'Developer'),
- array('tician', 'before', 'Politician'),
- array('Accou', 'after', 'Accountant'),
- array('usicia', 'both', 'Musician'),
- );
- }
-}
diff --git a/tests/codeigniter/database/query_builder/limit_test.php b/tests/codeigniter/database/query_builder/limit_test.php
deleted file mode 100644
index a1976d457..000000000
--- a/tests/codeigniter/database/query_builder/limit_test.php
+++ /dev/null
@@ -1,48 +0,0 @@
-<?php
-
-class Limit_test extends CI_TestCase {
-
- /**
- * @var object Database/Query Builder holder
- */
- protected $db;
-
- public function set_up()
- {
- $this->db = Mock_Database_Schema_Skeleton::init(DB_DRIVER);
-
- Mock_Database_Schema_Skeleton::create_tables();
- Mock_Database_Schema_Skeleton::create_data();
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * @see ./mocks/schema/skeleton.php
- */
- public function test_limit()
- {
- $jobs = $this->db->limit(2)
- ->get('job')
- ->result_array();
-
- $this->assertCount(2, $jobs);
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * @see ./mocks/schema/skeleton.php
- */
- public function test_limit_and_offset()
- {
- $jobs = $this->db->limit(2, 2)
- ->get('job')
- ->result_array();
-
- $this->assertCount(2, $jobs);
- $this->assertEquals('Accountant', $jobs[0]['name']);
- $this->assertEquals('Musician', $jobs[1]['name']);
- }
-
-}
diff --git a/tests/codeigniter/database/query_builder/order_test.php b/tests/codeigniter/database/query_builder/order_test.php
deleted file mode 100644
index ff5bc543d..000000000
--- a/tests/codeigniter/database/query_builder/order_test.php
+++ /dev/null
@@ -1,55 +0,0 @@
-<?php
-
-class Order_test extends CI_TestCase {
-
- /**
- * @var object Database/Query Builder holder
- */
- protected $db;
-
- public function set_up()
- {
- $this->db = Mock_Database_Schema_Skeleton::init(DB_DRIVER);
-
- Mock_Database_Schema_Skeleton::create_tables();
- Mock_Database_Schema_Skeleton::create_data();
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * @see ./mocks/schema/skeleton.php
- */
- public function test_order_ascending()
- {
- $jobs = $this->db->order_by('name', 'asc')
- ->get('job')
- ->result_array();
-
- // Check the result
- $this->assertCount(4, $jobs);
- $this->assertEquals('Accountant', $jobs[0]['name']);
- $this->assertEquals('Developer', $jobs[1]['name']);
- $this->assertEquals('Musician', $jobs[2]['name']);
- $this->assertEquals('Politician', $jobs[3]['name']);
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * @see ./mocks/schema/skeleton.php
- */
- public function test_order_descending()
- {
- $jobs = $this->db->order_by('name', 'desc')
- ->get('job')
- ->result_array();
-
- $this->assertCount(4, $jobs);
- $this->assertEquals('Politician', $jobs[0]['name']);
- $this->assertEquals('Musician', $jobs[1]['name']);
- $this->assertEquals('Developer', $jobs[2]['name']);
- $this->assertEquals('Accountant', $jobs[3]['name']);
- }
-
-}
diff --git a/tests/codeigniter/database/query_builder/select_test.php b/tests/codeigniter/database/query_builder/select_test.php
deleted file mode 100644
index facda791f..000000000
--- a/tests/codeigniter/database/query_builder/select_test.php
+++ /dev/null
@@ -1,95 +0,0 @@
-<?php
-
-class Select_test extends CI_TestCase {
-
- /**
- * @var object Database/Query Builder holder
- */
- protected $db;
-
- public function set_up()
- {
- $this->db = Mock_Database_Schema_Skeleton::init(DB_DRIVER);
-
- Mock_Database_Schema_Skeleton::create_tables();
- Mock_Database_Schema_Skeleton::create_data();
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * @see ./mocks/schema/skeleton.php
- */
- public function test_select_only_one_collumn()
- {
- $jobs_name = $this->db->select('name')
- ->get('job')
- ->result_array();
-
- // Check rows item
- $this->assertArrayHasKey('name',$jobs_name[0]);
- $this->assertArrayNotHasKey('id', $jobs_name[0]);
- $this->assertArrayNotHasKey('description', $jobs_name[0]);
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * @see ./mocks/schema/skeleton.php
- */
- public function test_select_min()
- {
- $job_min = $this->db->select_min('id')
- ->get('job')
- ->row();
-
- // Minimum id was 1
- $this->assertEquals('1', $job_min->id);
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * @see ./mocks/schema/skeleton.php
- */
- public function test_select_max()
- {
- $job_max = $this->db->select_max('id')
- ->get('job')
- ->row();
-
- // Maximum id was 4
- $this->assertEquals('4', $job_max->id);
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * @see ./mocks/schema/skeleton.php
- */
- public function test_select_avg()
- {
- $job_avg = $this->db->select_avg('id')
- ->get('job')
- ->row();
-
- // Average should be 2.5
- $this->assertEquals(2.5, (float) $job_avg->id);
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * @see ./mocks/schema/skeleton.php
- */
- public function test_select_sum()
- {
- $job_sum = $this->db->select_sum('id')
- ->get('job')
- ->row();
-
- // Sum of ids should be 10
- $this->assertEquals('10', $job_sum->id);
- }
-
-}
diff --git a/tests/codeigniter/database/query_builder/truncate_test.php b/tests/codeigniter/database/query_builder/truncate_test.php
deleted file mode 100644
index 64abe2872..000000000
--- a/tests/codeigniter/database/query_builder/truncate_test.php
+++ /dev/null
@@ -1,56 +0,0 @@
-<?php
-
-class Truncate_test extends CI_TestCase {
-
- /**
- * @var object Database/Query Builder holder
- */
- protected $db;
-
- public function set_up()
- {
- $this->db = Mock_Database_Schema_Skeleton::init(DB_DRIVER);
-
- Mock_Database_Schema_Skeleton::create_tables();
- Mock_Database_Schema_Skeleton::create_data();
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * @see ./mocks/schema/skeleton.php
- */
- public function test_truncate()
- {
- // Check initial record
- $jobs = $this->db->get('job')->result_array();
- $this->assertCount(4, $jobs);
-
- // Do the empty
- $this->db->truncate('job');
-
- // Check the record
- $jobs = $this->db->get('job');
- $this->assertEmpty($jobs->result_array());
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * @see ./mocks/schema/skeleton.php
- */
- public function test_truncate_with_from()
- {
- // Check initial record
- $users = $this->db->get('user')->result_array();
- $this->assertCount(4, $users);
-
- // Do the empty
- $this->db->from('user')->truncate();
-
- // Check the record
- $users = $this->db->get('user');
- $this->assertEmpty($users->result_array());
- }
-
-}
diff --git a/tests/codeigniter/database/query_builder/update_test.php b/tests/codeigniter/database/query_builder/update_test.php
deleted file mode 100644
index 27a647c45..000000000
--- a/tests/codeigniter/database/query_builder/update_test.php
+++ /dev/null
@@ -1,57 +0,0 @@
-<?php
-
-class Update_test extends CI_TestCase {
-
- /**
- * @var object Database/Query Builder holder
- */
- protected $db;
-
- public function set_up()
- {
- $this->db = Mock_Database_Schema_Skeleton::init(DB_DRIVER);
-
- Mock_Database_Schema_Skeleton::create_tables();
- Mock_Database_Schema_Skeleton::create_data();
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * @see ./mocks/schema/skeleton.php
- */
- public function test_update()
- {
- // Check initial record
- $job1 = $this->db->where('id', 1)->get('job')->row();
- $this->assertEquals('Developer', $job1->name);
-
- // Do the update
- $this->db->where('id', 1)->update('job', array('name' => 'Programmer'));
-
- // Check updated record
- $job1 = $this->db->where('id', 1)->get('job')->row();
- $this->assertEquals('Programmer', $job1->name);
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * @see ./mocks/schema/skeleton.php
- */
- public function test_update_with_set()
- {
- // Check initial record
- $job1 = $this->db->where('id', 4)->get('job')->row();
- $this->assertEquals('Musician', $job1->name);
-
- // Do the update
- $this->db->set('name', 'Vocalist');
- $this->db->update('job', NULL, 'id = 4');
-
- // Check updated record
- $job1 = $this->db->where('id', 4)->get('job')->row();
- $this->assertEquals('Vocalist', $job1->name);
- }
-
-} \ No newline at end of file
diff --git a/tests/codeigniter/database/query_builder/where_test.php b/tests/codeigniter/database/query_builder/where_test.php
deleted file mode 100644
index 8a7a09ddb..000000000
--- a/tests/codeigniter/database/query_builder/where_test.php
+++ /dev/null
@@ -1,134 +0,0 @@
-<?php
-
-class Where_test extends CI_TestCase {
-
- /**
- * @var object Database/Query Builder holder
- */
- protected $db;
-
- public function set_up()
- {
- $this->db = Mock_Database_Schema_Skeleton::init(DB_DRIVER);
-
- Mock_Database_Schema_Skeleton::create_tables();
- Mock_Database_Schema_Skeleton::create_data();
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * @see ./mocks/schema/skeleton.php
- */
- public function test_where_simple_key_value()
- {
- $job1 = $this->db->where('id', 1)->get('job')->row();
-
- $this->assertEquals('1', $job1->id);
- $this->assertEquals('Developer', $job1->name);
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * @see ./mocks/schema/skeleton.php
- */
- public function test_where_custom_key_value()
- {
- $jobs = $this->db->where('id !=', 1)->get('job')->result_array();
- $this->assertCount(3, $jobs);
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * @see ./mocks/schema/skeleton.php
- */
- public function test_where_associative_array()
- {
- $where = array('id >' => 2, 'name !=' => 'Accountant');
- $jobs = $this->db->where($where)->get('job')->result_array();
-
- $this->assertCount(1, $jobs);
-
- // Should be Musician
- $job = current($jobs);
- $this->assertEquals('Musician', $job['name']);
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * @see ./mocks/schema/skeleton.php
- */
- public function test_where_custom_string()
- {
- $where = "id > 2 AND name != 'Accountant'";
- $jobs = $this->db->where($where)->get('job')->result_array();
-
- $this->assertCount(1, $jobs);
-
- // Should be Musician
- $job = current($jobs);
- $this->assertEquals('Musician', $job['name']);
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * @see ./mocks/schema/skeleton.php
- */
- public function test_where_or()
- {
- $jobs = $this->db->where('name !=', 'Accountant')
- ->or_where('id >', 3)
- ->get('job')
- ->result_array();
-
- $this->assertCount(3, $jobs);
- $this->assertEquals('Developer', $jobs[0]['name']);
- $this->assertEquals('Politician', $jobs[1]['name']);
- $this->assertEquals('Musician', $jobs[2]['name']);
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * @see ./mocks/schema/skeleton.php
- */
- public function test_where_in()
- {
- $jobs = $this->db->where_in('name', array('Politician', 'Accountant'))
- ->get('job')
- ->result_array();
-
- $this->assertCount(2, $jobs);
- $this->assertEquals('Politician', $jobs[0]['name']);
- $this->assertEquals('Accountant', $jobs[1]['name']);
- }
-
- // ------------------------------------------------------------------------
-
- /**
- * @see ./mocks/schema/skeleton.php
- */
- public function test_where_not_in()
- {
- $jobs = $this->db->where_not_in('name', array('Politician', 'Accountant'))
- ->get('job')
- ->result_array();
-
- $this->assertCount(2, $jobs);
- $this->assertEquals('Developer', $jobs[0]['name']);
- $this->assertEquals('Musician', $jobs[1]['name']);
- }
-
- // ------------------------------------------------------------------------
-
- public function test_issue4093()
- {
- $input = 'bar and baz or qux';
- $sql = $this->db->where('foo', $input)->get_compiled_select('dummy');
- $this->assertEquals("'".$input."'", substr($sql, -20));
- }
-}
diff --git a/tests/codeigniter/helpers/array_helper_test.php b/tests/codeigniter/helpers/array_helper_test.php
deleted file mode 100644
index f4e344673..000000000
--- a/tests/codeigniter/helpers/array_helper_test.php
+++ /dev/null
@@ -1,45 +0,0 @@
-<?php
-
-class Array_helper_test extends CI_TestCase {
-
- public $my_array = array(
- 'foo' => 'bar',
- 'sally' => 'jim',
- 'maggie' => 'bessie',
- 'herb' => 'cook'
- );
-
- public function set_up()
- {
- $this->helper('array');
- }
-
- // ------------------------------------------------------------------------
-
- public function test_element_with_existing_item()
- {
- $this->assertEquals(FALSE, element('testing', $this->my_array));
- $this->assertEquals('not set', element('testing', $this->my_array, 'not set'));
- $this->assertEquals('bar', element('foo', $this->my_array));
- }
-
- // ------------------------------------------------------------------------
-
- public function test_random_element()
- {
- // Send a string, not an array to random_element
- $this->assertEquals('my string', random_element('my string'));
-
- // Test sending an array
- $this->assertContains(random_element($this->my_array), $this->my_array);
- }
-
- // ------------------------------------------------------------------------
-
- public function test_elements()
- {
- $this->assertEquals('array', gettype(elements('test', $this->my_array)));
- $this->assertEquals('array', gettype(elements('foo', $this->my_array)));
- }
-
-}
diff --git a/tests/codeigniter/helpers/captcha_helper_test.php b/tests/codeigniter/helpers/captcha_helper_test.php
deleted file mode 100644
index bb8760a15..000000000
--- a/tests/codeigniter/helpers/captcha_helper_test.php
+++ /dev/null
@@ -1,10 +0,0 @@
-<?php
-
-class Captcha_helper_test extends CI_TestCase {
-
- public function test_create_captcha()
- {
- $this->markTestSkipped("Can't test");
- }
-
-} \ No newline at end of file
diff --git a/tests/codeigniter/helpers/cookie_helper_test.php b/tests/codeigniter/helpers/cookie_helper_test.php
deleted file mode 100644
index fba68f20f..000000000
--- a/tests/codeigniter/helpers/cookie_helper_test.php
+++ /dev/null
@@ -1,59 +0,0 @@
-<?php
-
-class Cookie_helper_test extends CI_TestCase {
-
- public function set_up()
- {
- $this->helper('cookie');
- }
-
- // ------------------------------------------------------------------------
-
- function test_set_cookie()
- {
- /*$input_cls = $this->ci_core_class('input');
- $this->ci_instance_var('input', new $input_cls);
-
- $this->assertTrue(set_cookie(
- 'my_cookie',
- 'foobar'
- ));*/
-
- $this->markTestSkipped('Need to find a way to overcome a headers already set exception');
- }
-
- // ------------------------------------------------------------------------
-
- function test_get_cookie()
- {
- $_COOKIE['foo'] = 'bar';
-
- $security = new Mock_Core_Security();
- $utf8 = new Mock_Core_Utf8();
- $input_cls = $this->ci_core_class('input');
- $this->ci_instance_var('input', new Mock_Core_Input($security, $utf8));
-
- $this->assertEquals('bar', get_cookie('foo', FALSE));
- $this->assertEquals('bar', get_cookie('foo', TRUE));
-
- $_COOKIE['bar'] = "Hello, i try to <script>alert('Hack');</script> your site";
-
- $this->assertEquals("Hello, i try to [removed]alert&#40;'Hack'&#41;;[removed] your site", get_cookie('bar', TRUE));
- $this->assertEquals("Hello, i try to <script>alert('Hack');</script> your site", get_cookie('bar', FALSE));
- }
-
- // ------------------------------------------------------------------------
-
- function test_delete_cookie()
- {
- /*$input_cls = $this->ci_core_class('input');
- $this->ci_instance_var('input', new $input_cls);
-
- $this->assertTrue(delete_cookie(
- 'my_cookie'
- ));*/
-
- $this->markTestSkipped('Need to find a way to overcome a headers already set exception');
- }
-
-} \ No newline at end of file
diff --git a/tests/codeigniter/helpers/date_helper_test.php b/tests/codeigniter/helpers/date_helper_test.php
deleted file mode 100644
index b419418bf..000000000
--- a/tests/codeigniter/helpers/date_helper_test.php
+++ /dev/null
@@ -1,325 +0,0 @@
-<?php
-
-class Date_helper_test extends CI_TestCase {
-
- public function set_up()
- {
- $this->helper('date');
- $this->time = time();
- }
-
- // ------------------------------------------------------------------------
-
- public function test_nice_date()
- {
- $this->assertEquals('2016-11-01', nice_date('201611', 'Y-m-d'));
- $this->assertEquals('2016-11-23', nice_date('20161123', 'Y-m-d'));
- }
-
- // ------------------------------------------------------------------------
-
- public function test_now_local()
- {
- /*
-
- // This stub job, is simply to cater $config['time_reference']
- $config = $this->getMockBuilder('CI_Config')->getMock();
- $config->expects($this->any())
- ->method('item')
- ->will($this->returnValue('local'));
-
- // Add the stub to our test instance
- $this->ci_instance_var('config', $config);
-
- */
-
- $this->ci_set_config('time_reference', 'local');
-
- $this->assertEquals(time(), now());
- }
-
- // ------------------------------------------------------------------------
-
- public function test_now_utc()
- {
- /*
-
- // This stub job, is simply to cater $config['time_reference']
- $config = $this->getMockBuilder('CI_Config')->getMock();
- $config->expects($this->any())
- ->method('item')
- ->will($this->returnValue('UTC'));
-
- // Add the stub to our stdClass
- $this->ci_instance_var('config', $config);
-
- */
-
- $this->assertEquals(
- mktime(gmdate('G'), gmdate('i'), gmdate('s'), gmdate('n'), gmdate('j'), gmdate('Y')),
- now('UTC')
- );
- }
-
- // ------------------------------------------------------------------------
-
- public function test_mdate()
- {
- $this->assertEquals(
- date('Y-m-d - h:i a', $this->time),
- mdate('%Y-%m-%d - %h:%i %a', $this->time)
- );
- }
-
- // ------------------------------------------------------------------------
-
- public function test_standard_date_rfc822()
- {
- $this->assertEquals(
- date(DATE_RFC822, $this->time),
- standard_date('DATE_RFC822', $this->time)
- );
- }
-
- // ------------------------------------------------------------------------
-
- public function test_standard_date_atom()
- {
- $this->assertEquals(
- date(DATE_ATOM, $this->time),
- standard_date('DATE_ATOM', $this->time)
- );
- }
-
- // ------------------------------------------------------------------------
-
- public function test_standard_date_cookie()
- {
- $this->assertEquals(
- date(DATE_COOKIE, $this->time),
- standard_date('DATE_COOKIE', $this->time)
- );
- }
-
- // ------------------------------------------------------------------------
-
- public function test_standard_date_iso8601()
- {
- $this->assertEquals(
- date(DATE_ISO8601, $this->time),
- standard_date('DATE_ISO8601', $this->time)
- );
- }
-
- // ------------------------------------------------------------------------
-
- public function test_standard_date_rfc850()
- {
- $this->assertEquals(
- date(DATE_RFC850, $this->time),
- standard_date('DATE_RFC850', $this->time)
- );
- }
-
- // ------------------------------------------------------------------------
-
- public function test_standard_date_rfc1036()
- {
- $this->assertEquals(
- date(DATE_RFC1036, $this->time),
- standard_date('DATE_RFC1036', $this->time)
- );
- }
-
- // ------------------------------------------------------------------------
-
- public function test_standard_date_rfc1123()
- {
- $this->assertEquals(
- date(DATE_RFC1123, $this->time),
- standard_date('DATE_RFC1123', $this->time)
- );
- }
-
- // ------------------------------------------------------------------------
-
- public function test_standard_date_rfc2822()
- {
- $this->assertEquals(
- date(DATE_RFC2822, $this->time),
- standard_date('DATE_RFC2822', $this->time)
- );
- }
-
- // ------------------------------------------------------------------------
-
- public function test_standard_date_rss()
- {
- $this->assertEquals(
- date(DATE_RSS, $this->time),
- standard_date('DATE_RSS', $this->time)
- );
- }
-
- // ------------------------------------------------------------------------
-
- public function test_standard_date_w3c()
- {
- $this->assertEquals(
- date(DATE_W3C, $this->time),
- standard_date('DATE_W3C', $this->time)
- );
- }
-
- // ------------------------------------------------------------------------
-
- public function test_timespan()
- {
- $this->ci_vfs_clone('system/language/english/date_lang.php');
-
- $loader_cls = $this->ci_core_class('load');
- $this->ci_instance_var('load', new $loader_cls);
-
- $lang_cls = $this->ci_core_class('lang');
- $this->ci_instance_var('lang', new $lang_cls);
-
- $this->assertEquals('1 Second', timespan(time(), time()+1));
- $this->assertEquals('1 Minute', timespan(time(), time()+60));
- $this->assertEquals('1 Hour', timespan(time(), time()+3600));
- $this->assertEquals('2 Hours', timespan(time(), time()+7200));
- }
-
- // ------------------------------------------------------------------------
-
- public function test_days_in_month()
- {
- $this->assertEquals(30, days_in_month(06, 2005));
- $this->assertEquals(28, days_in_month(02, 2011));
- $this->assertEquals(29, days_in_month(02, 2012));
- }
-
- // ------------------------------------------------------------------------
-
- public function test_local_to_gmt()
- {
- $this->assertEquals(
- mktime(
- gmdate('G', $this->time), gmdate('i', $this->time), gmdate('s', $this->time),
- gmdate('n', $this->time), gmdate('j', $this->time), gmdate('Y', $this->time)
- ),
- local_to_gmt($this->time)
- );
- }
-
- // ------------------------------------------------------------------------
-
- public function test_gmt_to_local()
- {
- $this->assertEquals(1140128493, gmt_to_local('1140153693', 'UM8', TRUE));
- }
-
- // ------------------------------------------------------------------------
-
- public function test_mysql_to_unix()
- {
- $this->assertEquals($this->time, mysql_to_unix(date('Y-m-d H:i:s', $this->time)));
- }
-
- // ------------------------------------------------------------------------
-
- public function test_unix_to_human()
- {
- $this->assertEquals(date('Y-m-d h:i A', $this->time), unix_to_human($this->time));
- $this->assertEquals(date('Y-m-d h:i:s A', $this->time), unix_to_human($this->time, TRUE, 'us'));
- $this->assertEquals(date('Y-m-d H:i:s', $this->time), unix_to_human($this->time, TRUE, 'eu'));
- }
-
- // ------------------------------------------------------------------------
-
- public function test_human_to_unix()
- {
- $date = '2000-12-31 10:00:00 PM';
- $this->assertEquals(strtotime($date), human_to_unix($date));
- $this->assertFalse(human_to_unix());
- }
-
- // ------------------------------------------------------------------------
-
- public function test_timezones()
- {
- $zones = array(
- 'UM12' => -12,
- 'UM11' => -11,
- 'UM10' => -10,
- 'UM95' => -9.5,
- 'UM9' => -9,
- 'UM8' => -8,
- 'UM7' => -7,
- 'UM6' => -6,
- 'UM5' => -5,
- 'UM45' => -4.5,
- 'UM4' => -4,
- 'UM35' => -3.5,
- 'UM3' => -3,
- 'UM2' => -2,
- 'UM1' => -1,
- 'UTC' => 0,
- 'UP1' => +1,
- 'UP2' => +2,
- 'UP3' => +3,
- 'UP35' => +3.5,
- 'UP4' => +4,
- 'UP45' => +4.5,
- 'UP5' => +5,
- 'UP55' => +5.5,
- 'UP575' => +5.75,
- 'UP6' => +6,
- 'UP65' => +6.5,
- 'UP7' => +7,
- 'UP8' => +8,
- 'UP875' => +8.75,
- 'UP9' => +9,
- 'UP95' => +9.5,
- 'UP10' => +10,
- 'UP105' => +10.5,
- 'UP11' => +11,
- 'UP115' => +11.5,
- 'UP12' => +12,
- 'UP1275' => +12.75,
- 'UP13' => +13,
- 'UP14' => +14
- );
-
- foreach ($zones AS $test => $expected)
- {
- $this->assertEquals($expected, timezones($test));
- }
-
- $this->assertArrayHasKey('UP3', timezones());
- $this->assertEquals(0, timezones('non_existent'));
- }
-
- // ------------------------------------------------------------------------
-
- public function test_date_range()
- {
- $dates = array(
- '29-01-2012', '30-01-2012', '31-01-2012',
- '01-02-2012', '02-02-2012', '03-02-2012',
- '04-02-2012', '05-02-2012', '06-02-2012',
- '07-02-2012', '08-02-2012', '09-02-2012',
- '10-02-2012', '11-02-2012', '12-02-2012',
- '13-02-2012', '14-02-2012', '15-02-2012',
- '16-02-2012', '17-02-2012', '18-02-2012',
- '19-02-2012', '20-02-2012', '21-02-2012',
- '22-02-2012', '23-02-2012', '24-02-2012',
- '25-02-2012', '26-02-2012', '27-02-2012',
- '28-02-2012', '29-02-2012', '01-03-2012'
- );
-
- $this->assertEquals($dates, date_range(mktime(12, 0, 0, 1, 29, 2012), mktime(12, 0, 0, 3, 1, 2012), TRUE, 'd-m-Y'));
- array_pop($dates);
- $this->assertEquals($dates, date_range(mktime(12, 0, 0, 1, 29, 2012), 31, FALSE, 'd-m-Y'));
- }
-
-}
diff --git a/tests/codeigniter/helpers/directory_helper_test.php b/tests/codeigniter/helpers/directory_helper_test.php
deleted file mode 100644
index 253c1e368..000000000
--- a/tests/codeigniter/helpers/directory_helper_test.php
+++ /dev/null
@@ -1,59 +0,0 @@
-<?php
-
-class Directory_helper_test extends CI_TestCase {
-
- public function set_up()
- {
- $this->helper('directory');
-
- vfsStreamWrapper::register();
- vfsStreamWrapper::setRoot(new vfsStreamDirectory('testDir'));
-
- $this->_test_dir = vfsStreamWrapper::getRoot();
- }
-
- public function test_directory_map()
- {
- $ds = DIRECTORY_SEPARATOR;
-
- $structure = array(
- 'libraries' => array(
- 'benchmark.html' => '',
- 'database' => array('active_record.html' => '', 'binds.html' => ''),
- 'email.html' => '',
- '0' => '',
- '.hiddenfile.txt' => ''
- )
- );
-
- vfsStream::create($structure, $this->_test_dir);
-
- // is_dir(), opendir(), etc. seem to fail on Windows + vfsStream when there are trailing backslashes in directory names
- if ( ! is_dir(vfsStream::url('testDir').DIRECTORY_SEPARATOR))
- {
- $this->markTestSkipped("Can't test this under Windows");
- return;
- }
-
- // test default recursive behavior
- $expected = array(
- 'libraries'.$ds => array(
- 'benchmark.html',
- 'database'.$ds => array('active_record.html', 'binds.html'),
- 'email.html',
- '0'
- )
- );
-
- $this->assertEquals($expected, directory_map(vfsStream::url('testDir')));
-
- // test detection of hidden files
- $expected['libraries'.$ds][] = '.hiddenfile.txt';
-
- $this->assertEquals($expected, directory_map(vfsStream::url('testDir'), 0, TRUE));
-
- // test recursion depth behavior
- $this->assertEquals(array('libraries'.$ds), directory_map(vfsStream::url('testDir'), 1));
- }
-
-}
diff --git a/tests/codeigniter/helpers/download_helper_test.php b/tests/codeigniter/helpers/download_helper_test.php
deleted file mode 100644
index d2b42e46b..000000000
--- a/tests/codeigniter/helpers/download_helper_test.php
+++ /dev/null
@@ -1,10 +0,0 @@
-<?php
-
-class Download_helper_test extends CI_TestCase {
-
- public function test_force_download()
- {
- $this->markTestSkipped('Cant easily test');
- }
-
-} \ No newline at end of file
diff --git a/tests/codeigniter/helpers/email_helper_test.php b/tests/codeigniter/helpers/email_helper_test.php
deleted file mode 100644
index 529e96910..000000000
--- a/tests/codeigniter/helpers/email_helper_test.php
+++ /dev/null
@@ -1,24 +0,0 @@
-<?php
-
-class Email_helper_test extends CI_TestCase {
-
- public function set_up()
- {
- $this->helper('email');
- }
-
- public function test_valid_email()
- {
- $this->assertEquals(FALSE, valid_email('test'));
- $this->assertEquals(FALSE, valid_email('test@test@test.com'));
- $this->assertEquals(TRUE, valid_email('test@test.com'));
- $this->assertEquals(TRUE, valid_email('my.test@test.com'));
- $this->assertEquals(TRUE, valid_email('my.test@subdomain.test.com'));
- }
-
- public function test_send_mail()
- {
- $this->markTestSkipped("Can't test");
- }
-
-} \ No newline at end of file
diff --git a/tests/codeigniter/helpers/file_helper_test.php b/tests/codeigniter/helpers/file_helper_test.php
deleted file mode 100644
index 0d7ae96ee..000000000
--- a/tests/codeigniter/helpers/file_helper_test.php
+++ /dev/null
@@ -1,144 +0,0 @@
-<?php
-
-class File_helper_Test extends CI_TestCase {
-
- public function set_up()
- {
- $this->helper('file');
-
- $this->_test_dir = vfsStream::setup('');
- }
-
- // --------------------------------------------------------------------
-
- public function test_read_file()
- {
- $this->assertFalse(read_file('does_not_exist'));
-
- $content = 'Jack and Jill went up the mountain to fight a billy goat.';
-
- $file = vfsStream::newFile('my_file.txt')->withContent($content)->at($this->_test_dir);
-
- $this->assertEquals($content, read_file(vfsStream::url('my_file.txt')));
- }
-
- // --------------------------------------------------------------------
-
- public function test_octal_permissions()
- {
- $content = 'Jack and Jill went up the mountain to fight a billy goat.';
-
- $file = vfsStream::newFile('my_file.txt', 0777)
- ->withContent($content)
- ->lastModified(time() - 86400)
- ->at($this->_test_dir);
-
- $this->assertEquals('777', octal_permissions($file->getPermissions()));
- }
-
- // --------------------------------------------------------------------
-
- /**
- * More tests should happen here, since I'm not hitting the whole function.
- */
- public function test_symbolic_permissions()
- {
- $content = 'Jack and Jill went up the mountain to fight a billy goat.';
-
- $file = vfsStream::newFile('my_file.txt', 0777)
- ->withContent($content)
- ->lastModified(time() - 86400)
- ->at($this->_test_dir);
-
- $this->assertEquals('urwxrwxrwx', symbolic_permissions($file->getPermissions()));
- }
-
- // --------------------------------------------------------------------
-
- public function test_get_mime_by_extension()
- {
- $content = 'Jack and Jill went up the mountain to fight a billy goat.';
-
- $file = vfsStream::newFile('my_file.txt', 0777)
- ->withContent($content)
- ->lastModified(time() - 86400)
- ->at($this->_test_dir);
-
- $this->assertEquals('text/plain', get_mime_by_extension(vfsStream::url('my_file.txt')));
-
- // Test a mime with an array, such as png
- $file = vfsStream::newFile('foo.png')->at($this->_test_dir);
-
- $this->assertEquals('image/png', get_mime_by_extension(vfsStream::url('foo.png')));
-
- // Test a file not in the mimes array
- $file = vfsStream::newFile('foo.blarfengar')->at($this->_test_dir);
-
- $this->assertFalse(get_mime_by_extension(vfsStream::url('foo.blarfengar')));
- }
-
- // --------------------------------------------------------------------
-
- public function test_get_file_info()
- {
- // Test Bad File
- $this->assertFalse(get_file_info('i_am_bad_boo'));
-
- // Test the rest
-
- // First pass in an array
- $vals = array(
- 'name', 'server_path', 'size', 'date',
- 'readable', 'writable', 'executable', 'fileperms'
- );
-
- $this->_test_get_file_info($vals);
-
- // Test passing in vals as a string.
- $this->_test_get_file_info(implode(', ', $vals));
- }
-
- private function _test_get_file_info($vals)
- {
- $content = 'Jack and Jill went up the mountain to fight a billy goat.';
- $last_modified = time() - 86400;
-
- $file = vfsStream::newFile('my_file.txt', 0777)
- ->withContent($content)
- ->lastModified($last_modified)
- ->at($this->_test_dir);
-
- $ret_values = array(
- 'name' => 'my_file.txt',
- 'server_path' => 'vfs://my_file.txt',
- 'size' => 57,
- 'date' => $last_modified,
- 'readable' => TRUE,
- 'writable' => TRUE,
- 'executable' => TRUE,
- 'fileperms' => 33279
- );
-
- $info = get_file_info(vfsStream::url('my_file.txt'), $vals);
-
- foreach ($info as $k => $v)
- {
- $this->assertEquals($ret_values[$k], $v);
- }
- }
-
- // --------------------------------------------------------------------
-
- public function test_write_file()
- {
- $content = 'Jack and Jill went up the mountain to fight a billy goat.';
-
- $file = vfsStream::newFile('write.txt', 0777)
- ->withContent('')
- ->lastModified(time() - 86400)
- ->at($this->_test_dir);
-
- $this->assertTrue(write_file(vfsStream::url('write.txt'), $content));
- }
-
-} \ No newline at end of file
diff --git a/tests/codeigniter/helpers/form_helper_test.php b/tests/codeigniter/helpers/form_helper_test.php
deleted file mode 100644
index b5fe99b96..000000000
--- a/tests/codeigniter/helpers/form_helper_test.php
+++ /dev/null
@@ -1,290 +0,0 @@
-<?php
-
-class Form_helper_test extends CI_TestCase
-{
- public function set_up()
- {
- $this->helper('form');
- }
-
- // ------------------------------------------------------------------------
-
- public function test_form_hidden()
- {
- $expected = <<<EOH
-
-<input type="hidden" name="username" value="johndoe" />
-
-EOH;
-
- $this->assertEquals($expected, form_hidden('username', 'johndoe'));
- }
-
- // ------------------------------------------------------------------------
-
- public function test_form_input()
- {
- $expected = <<<EOH
-<input type="text" name="username" value="johndoe" id="username" maxlength="100" size="50" style="width:50%" />
-
-EOH;
-
- $data = array(
- 'name' => 'username',
- 'id' => 'username',
- 'value' => 'johndoe',
- 'maxlength' => '100',
- 'size' => '50',
- 'style' => 'width:50%',
- );
-
- $this->assertEquals($expected, form_input($data));
- }
-
- // ------------------------------------------------------------------------
-
- public function test_form_password()
- {
- $expected = <<<EOH
-<input type="password" name="password" value="" />
-
-EOH;
-
- $this->assertEquals($expected, form_password('password'));
- }
-
- // ------------------------------------------------------------------------
-
- public function test_form_upload()
- {
- $expected = <<<EOH
-<input type="file" name="attachment" />
-
-EOH;
-
- $this->assertEquals($expected, form_upload('attachment'));
- }
-
- // ------------------------------------------------------------------------
-
- public function test_form_textarea()
- {
- $expected = <<<EOH
-<textarea name="notes" cols="40" rows="10" >Notes</textarea>
-
-EOH;
-
- $this->assertEquals($expected, form_textarea('notes', 'Notes'));
- }
-
- // ------------------------------------------------------------------------
-
- public function test_form_dropdown()
- {
- $expected = <<<EOH
-<select name="shirts">
-<option value="small">Small Shirt</option>
-<option value="med">Medium Shirt</option>
-<option value="large" selected="selected">Large Shirt</option>
-<option value="xlarge">Extra Large Shirt</option>
-</select>
-
-EOH;
-
- $options = array(
- 'small' => 'Small Shirt',
- 'med' => 'Medium Shirt',
- 'large' => 'Large Shirt',
- 'xlarge' => 'Extra Large Shirt',
- );
-
- $this->assertEquals($expected, form_dropdown('shirts', $options, 'large'));
-
- $expected = <<<EOH
-<select name="shirts" multiple="multiple">
-<option value="small" selected="selected">Small Shirt</option>
-<option value="med">Medium Shirt</option>
-<option value="large" selected="selected">Large Shirt</option>
-<option value="xlarge">Extra Large Shirt</option>
-</select>
-
-EOH;
-
- $shirts_on_sale = array('small', 'large');
-
- $this->assertEquals($expected, form_dropdown('shirts', $options, $shirts_on_sale));
-
- $options = array(
- 'Swedish Cars' => array(
- 'volvo' => 'Volvo',
- 'saab' => 'Saab'
- ),
- 'German Cars' => array(
- 'mercedes' => 'Mercedes',
- 'audi' => 'Audi'
- )
- );
-
- $expected = <<<EOH
-<select name="cars" multiple="multiple">
-<optgroup label="Swedish Cars">
-<option value="volvo" selected="selected">Volvo</option>
-<option value="saab">Saab</option>
-</optgroup>
-<optgroup label="German Cars">
-<option value="mercedes">Mercedes</option>
-<option value="audi" selected="selected">Audi</option>
-</optgroup>
-</select>
-
-EOH;
-
- $this->assertEquals($expected, form_dropdown('cars', $options, array('volvo', 'audi')));
- }
-
- // ------------------------------------------------------------------------
-
- public function test_form_multiselect()
- {
- $expected = <<<EOH
-<select name="shirts[]" multiple="multiple">
-<option value="small">Small Shirt</option>
-<option value="med" selected="selected">Medium Shirt</option>
-<option value="large" selected="selected">Large Shirt</option>
-<option value="xlarge">Extra Large Shirt</option>
-</select>
-
-EOH;
-
- $options = array(
- 'small' => 'Small Shirt',
- 'med' => 'Medium Shirt',
- 'large' => 'Large Shirt',
- 'xlarge' => 'Extra Large Shirt',
- );
-
- $this->assertEquals($expected, form_multiselect('shirts[]', $options, array('med', 'large')));
- }
-
- // ------------------------------------------------------------------------
-
- public function test_form_fieldset()
- {
- $expected = <<<EOH
-<fieldset>
-<legend>Address Information</legend>
-
-EOH;
-
- $this->assertEquals($expected, form_fieldset('Address Information'));
- }
-
- // ------------------------------------------------------------------------
-
- public function test_form_fieldset_close()
- {
- $expected = <<<EOH
-</fieldset></div></div>
-EOH;
-
- $this->assertEquals($expected, form_fieldset_close('</div></div>'));
- }
-
- // ------------------------------------------------------------------------
-
- public function test_form_checkbox()
- {
- $expected = <<<EOH
-<input type="checkbox" name="newsletter" value="accept" checked="checked" />
-
-EOH;
-
- $this->assertEquals($expected, form_checkbox('newsletter', 'accept', TRUE));
- }
-
- // ------------------------------------------------------------------------
-
- public function test_form_radio()
- {
- $expected = <<<EOH
-<input type="radio" name="newsletter" value="accept" checked="checked" />
-
-EOH;
-
- $this->assertEquals($expected, form_radio('newsletter', 'accept', TRUE));
- }
-
- // ------------------------------------------------------------------------
-
- public function test_form_submit()
- {
- $expected = <<<EOH
-<input type="submit" name="mysubmit" value="Submit Post!" />
-
-EOH;
-
- $this->assertEquals($expected, form_submit('mysubmit', 'Submit Post!'));
- }
-
- // ------------------------------------------------------------------------
-
- public function test_form_label()
- {
- $expected = <<<EOH
-<label for="username">What is your Name</label>
-EOH;
-
- $this->assertEquals($expected, form_label('What is your Name', 'username'));
- }
-
- // ------------------------------------------------------------------------
-
- public function test_form_reset()
- {
- $expected = <<<EOH
-<input type="reset" name="myreset" value="Reset" />
-
-EOH;
-
- $this->assertEquals($expected, form_reset('myreset', 'Reset'));
- }
-
- // ------------------------------------------------------------------------
-
- public function test_form_button()
- {
- $expected = <<<EOH
-<button name="name" type="button" >content</button>
-
-EOH;
-
- $this->assertEquals($expected, form_button('name', 'content'));
- }
-
- // ------------------------------------------------------------------------
-
- public function test_form_close()
- {
- $expected = <<<EOH
-</form></div></div>
-EOH;
-
- $this->assertEquals($expected, form_close('</div></div>'));
- }
-
- // ------------------------------------------------------------------------
-
- public function test_form_prep()
- {
- $this->assertEquals(
- 'Here is a string containing &quot;quoted&quot; text.',
- form_prep('Here is a string containing "quoted" text.')
- );
-
- $this->assertEquals(
- 'Here is a string containing a &lt;tag&gt;.',
- form_prep('Here is a string containing a <tag>.', TRUE)
- );
- }
-
-}
diff --git a/tests/codeigniter/helpers/html_helper_test.php b/tests/codeigniter/helpers/html_helper_test.php
deleted file mode 100644
index 3cf1016ec..000000000
--- a/tests/codeigniter/helpers/html_helper_test.php
+++ /dev/null
@@ -1,106 +0,0 @@
-<?php
-
-class Html_helper_test extends CI_TestCase {
-
- public function set_up()
- {
- $this->helper('html');
- }
-
- // ------------------------------------------------------------------------
-
- public function test_br()
- {
- $this->assertEquals('<br /><br />', br(2));
- }
-
- // ------------------------------------------------------------------------
-
- public function test_heading()
- {
- $this->assertEquals('<h1>foobar</h1>', heading('foobar'));
- $this->assertEquals('<h2 class="bar">foobar</h2>', heading('foobar', 2, 'class="bar"'));
- }
-
- public function test_heading_array_attributes()
- {
- // Test array of attributes
- $this->assertEquals('<h2 class="bar" id="foo">foobar</h2>', heading('foobar', 2, array('class' => 'bar', 'id' => 'foo')));
- }
-
- public function test_heading_object_attributes()
- {
- // Test array of attributes
- $this->assertEquals('<h2 class="bar" id="foo">foobar</h2>', heading('foobar', 2, array('class' => 'bar', 'id' => 'foo')));
- $test = new stdClass;
- $test->class = "bar";
- $test->id = "foo";
- $this->assertEquals('<h2 class="bar" id="foo">foobar</h2>', heading('foobar', 2, $test));
- }
-
- // ------------------------------------------------------------------------
-
- public function test_img()
- {
- $this->ci_set_config('base_url', 'http://localhost/');
- $this->assertEquals('<img src="http://localhost/test" alt="" />', img("test"));
- $this->assertEquals('<img src="data:foo/bar,baz" alt="" />', img("data:foo/bar,baz"));
- $this->assertEquals('<img src="http://localhost/data://foo" alt="" />', img("data://foo"));
- $this->assertEquals('<img src="//foo.bar/baz" alt="" />', img("//foo.bar/baz"));
- $this->assertEquals('<img src="http://foo.bar/baz" alt="" />', img("http://foo.bar/baz"));
- $this->assertEquals('<img src="https://foo.bar/baz" alt="" />', img("https://foo.bar/baz"));
- $this->assertEquals('<img src="ftp://foo.bar/baz" alt="" />', img("ftp://foo.bar/baz"));
- }
-
- // ------------------------------------------------------------------------
-
- public function test_Ul()
- {
- $expect = <<<EOH
-<ul>
- <li>foo</li>
- <li>bar</li>
-</ul>
-
-EOH;
-
- $expect = ltrim($expect);
- $list = array('foo', 'bar');
-
- $this->assertEquals(ltrim($expect), ul($list));
-
- $expect = <<<EOH
-<ul class="test">
- <li>foo</li>
- <li>bar</li>
-</ul>
-
-EOH;
-
- $expect = ltrim($expect);
-
- $this->assertEquals($expect, ul($list, 'class="test"'));
-
- $this->assertEquals($expect, ul($list, array('class' => 'test')));
- }
-
- // ------------------------------------------------------------------------
-
- public function test_NBS()
- {
- $this->assertEquals('&nbsp;&nbsp;&nbsp;', nbs(3));
- }
-
- // ------------------------------------------------------------------------
-
- public function test_meta()
- {
- $this->assertEquals("<meta name=\"test\" content=\"foo\" />\n", meta('test', 'foo'));
-
- $expect = "<meta name=\"foo\" content=\"\" />\n";
-
- $this->assertEquals($expect, meta(array('name' => 'foo')));
-
- }
-
-}
diff --git a/tests/codeigniter/helpers/inflector_helper_test.php b/tests/codeigniter/helpers/inflector_helper_test.php
deleted file mode 100644
index 3ec681bcd..000000000
--- a/tests/codeigniter/helpers/inflector_helper_test.php
+++ /dev/null
@@ -1,96 +0,0 @@
-<?php
-
-class Inflector_helper_test extends CI_TestCase {
-
- public function set_up()
- {
- $this->helper('inflector');
- }
-
- public function test_singular()
- {
- $strs = array(
- 'tellies' => 'telly',
- 'smellies' => 'smelly',
- 'abjectnesses' => 'abjectness',
- 'smells' => 'smell',
- 'equipment' => 'equipment'
- );
-
- foreach ($strs as $str => $expect)
- {
- $this->assertEquals($expect, singular($str));
- }
- }
-
- // --------------------------------------------------------------------
-
- public function test_plural()
- {
- $strs = array(
- 'telly' => 'tellies',
- 'smelly' => 'smellies',
- 'abjectness' => 'abjectnesses', // ref : http://en.wiktionary.org/wiki/abjectnesses
- 'smell' => 'smells',
- 'witch' => 'witches',
- 'equipment' => 'equipment'
- );
-
- foreach ($strs as $str => $expect)
- {
- $this->assertEquals($expect, plural($str));
- }
- }
-
- // --------------------------------------------------------------------
-
- public function test_camelize()
- {
- $strs = array(
- 'this is the string' => 'thisIsTheString',
- 'this is another one' => 'thisIsAnotherOne',
- 'i-am-playing-a-trick' => 'i-am-playing-a-trick',
- 'what_do_you_think-yo?' => 'whatDoYouThink-yo?',
- );
-
- foreach ($strs as $str => $expect)
- {
- $this->assertEquals($expect, camelize($str));
- }
- }
-
- // --------------------------------------------------------------------
-
- public function test_underscore()
- {
- $strs = array(
- 'this is the string' => 'this_is_the_string',
- 'this is another one' => 'this_is_another_one',
- 'i-am-playing-a-trick' => 'i-am-playing-a-trick',
- 'what_do_you_think-yo?' => 'what_do_you_think-yo?',
- );
-
- foreach ($strs as $str => $expect)
- {
- $this->assertEquals($expect, underscore($str));
- }
- }
-
- // --------------------------------------------------------------------
-
- public function test_humanize()
- {
- $strs = array(
- 'this_is_the_string' => 'This Is The String',
- 'this_is_another_one' => 'This Is Another One',
- 'i-am-playing-a-trick' => 'I-am-playing-a-trick',
- 'what_do_you_think-yo?' => 'What Do You Think-yo?',
- );
-
- foreach ($strs as $str => $expect)
- {
- $this->assertEquals($expect, humanize($str));
- }
- }
-
-}
diff --git a/tests/codeigniter/helpers/language_helper_test.php b/tests/codeigniter/helpers/language_helper_test.php
deleted file mode 100644
index 1ddabea3d..000000000
--- a/tests/codeigniter/helpers/language_helper_test.php
+++ /dev/null
@@ -1,16 +0,0 @@
-<?php
-
-class Language_helper_test extends CI_TestCase {
-
- public function test_lang()
- {
- $this->helper('language');
- $lang = $this->getMockBuilder('CI_Lang')->setMethods(array('line'))->getMock();
- $lang->expects($this->any())->method('line')->will($this->returnValue(FALSE));
- $this->ci_instance_var('lang', $lang);
-
- $this->assertFalse(lang(1));
- $this->assertEquals('<label for="foo" class="bar"></label>', lang(1, 'foo', array('class' => 'bar')));
- }
-
-}
diff --git a/tests/codeigniter/helpers/number_helper_test.php b/tests/codeigniter/helpers/number_helper_test.php
deleted file mode 100644
index 663e354fe..000000000
--- a/tests/codeigniter/helpers/number_helper_test.php
+++ /dev/null
@@ -1,63 +0,0 @@
-<?php
-
-class Number_helper_test extends CI_TestCase {
-
- public function set_up()
- {
- $this->helper('number');
-
- // Grab the core lang class
- $lang_cls = $this->ci_core_class('lang');
-
- // Mock away load, too much going on in there,
- // we'll just check for the expected parameter
- $lang = $this->getMockBuilder('CI_Lang')->setMethods(array('load'))->getMock();
- $lang->expects($this->once())
- ->method('load')
- ->with($this->equalTo('number'));
-
- // Assign the proper language array
- $lang->language = $this->lang('number');
-
- // We don't have a controller, so just create
- // a cheap class to act as our super object.
- // Make sure it has a lang attribute.
- $this->ci_instance_var('lang', $lang);
- }
-
- public function test_byte_format()
- {
- $this->assertEquals('456 Bytes', byte_format(456));
- }
-
- public function test_kb_format()
- {
- $this->assertEquals('4.5 KB', byte_format(4567));
- }
-
- public function test_kb_format_medium()
- {
- $this->assertEquals('44.6 KB', byte_format(45678));
- }
-
- public function test_kb_format_large()
- {
- $this->assertEquals('446.1 KB', byte_format(456789));
- }
-
- public function test_mb_format()
- {
- $this->assertEquals('3.3 MB', byte_format(3456789));
- }
-
- public function test_gb_format()
- {
- $this->assertEquals('1.8 GB', byte_format(1932735283.2));
- }
-
- public function test_tb_format()
- {
- $this->assertEquals('112,283.3 TB', byte_format(123456789123456789));
- }
-
-}
diff --git a/tests/codeigniter/helpers/path_helper_test.php b/tests/codeigniter/helpers/path_helper_test.php
deleted file mode 100644
index 9d325e70d..000000000
--- a/tests/codeigniter/helpers/path_helper_test.php
+++ /dev/null
@@ -1,30 +0,0 @@
-<?php
-
-class Path_helper_test extends CI_TestCase {
-
- public function set_up()
- {
- $this->helper('path');
- }
-
- public function test_set_realpath()
- {
- $this->assertEquals(getcwd().DIRECTORY_SEPARATOR, set_realpath(getcwd()));
- }
-
- public function test_set_realpath_nonexistent_directory()
- {
- $expected = '/path/to/nowhere';
- $this->assertEquals($expected, set_realpath('/path/to/nowhere', FALSE));
- }
-
- public function test_set_realpath_error_trigger()
- {
- $this->setExpectedException(
- 'RuntimeException', 'CI Error: Not a valid path: /path/to/nowhere'
- );
-
- set_realpath('/path/to/nowhere', TRUE);
- }
-
-}
diff --git a/tests/codeigniter/helpers/security_helper_test.php b/tests/codeigniter/helpers/security_helper_test.php
deleted file mode 100644
index effd3ec02..000000000
--- a/tests/codeigniter/helpers/security_helper_test.php
+++ /dev/null
@@ -1,64 +0,0 @@
-<?php
-
-class Security_helper_tests extends CI_TestCase {
-
- function setUp()
- {
- $this->helper('security');
- $obj = new stdClass;
- $obj->security = new Mock_Core_Security();
- $this->ci_instance($obj);
- }
-
- function test_xss_clean()
- {
- $this->assertEquals('foo', xss_clean('foo'));
-
- $this->assertEquals("Hello, i try to [removed]alert&#40;'Hack'&#41;;[removed] your site", xss_clean("Hello, i try to <script>alert('Hack');</script> your site"));
- }
-
- function test_sanitize_filename()
- {
- $this->assertEquals('hello.doc', sanitize_filename('hello.doc'));
-
- $filename = './<!--foo-->';
- $this->assertEquals('foo', sanitize_filename($filename));
- }
-
- function test_do_hash()
- {
- $md5 = md5('foo');
- $sha1 = sha1('foo');
-
- $algos = hash_algos();
- $algo_results = array();
- foreach ($algos as $k => $v)
- {
- $algo_results[$v] = hash($v, 'foo');
- }
-
- $this->assertEquals($sha1, do_hash('foo'));
- $this->assertEquals($sha1, do_hash('foo', 'sha1'));
- $this->assertEquals($md5, do_hash('foo', 'md5'));
- $this->assertEquals($md5, do_hash('foo', 'foobar'));
-
- // Test each algorithm available to PHP
- foreach ($algo_results as $algo => $result)
- {
- $this->assertEquals($result, do_hash('foo', $algo));
- }
- }
-
- function test_strip_image_tags()
- {
- $this->assertEquals('http://example.com/spacer.gif', strip_image_tags('http://example.com/spacer.gif'));
-
- $this->assertEquals('http://example.com/spacer.gif', strip_image_tags('<img src="http://example.com/spacer.gif" alt="Who needs CSS when you have a spacer.gif?" />'));
- }
-
- function test_encode_php_tags()
- {
- $this->assertEquals('&lt;? echo $foo; ?&gt;', encode_php_tags('<? echo $foo; ?>'));
- }
-
-} \ No newline at end of file
diff --git a/tests/codeigniter/helpers/string_helper_test.php b/tests/codeigniter/helpers/string_helper_test.php
deleted file mode 100644
index 9bd1ea816..000000000
--- a/tests/codeigniter/helpers/string_helper_test.php
+++ /dev/null
@@ -1,148 +0,0 @@
-<?php
-
-class String_helper_test extends CI_TestCase {
-
- public function set_up()
- {
- $this->helper('string');
- }
-
- public function test_strip_slashes()
- {
- $expected = array(
- "Is your name O'reilly?",
- "No, my name is O'connor."
- );
-
- $str = array(
- "Is your name O\'reilly?",
- "No, my name is O\'connor."
- );
-
- $this->assertEquals($expected, strip_slashes($str));
- }
-
- public function test_trim_slashes()
- {
- $strs = array(
- '//Slashes//\/' => 'Slashes//\\',
- '/var/www/html/' => 'var/www/html'
- );
-
- foreach ($strs as $str => $expect)
- {
- $this->assertEquals($expect, trim_slashes($str));
- }
- }
-
- // --------------------------------------------------------------------
-
- public function test_strip_quotes()
- {
- $strs = array(
- '"me oh my!"' => 'me oh my!',
- "it's a winner!" => 'its a winner!',
- );
-
- foreach ($strs as $str => $expect)
- {
- $this->assertEquals($expect, strip_quotes($str));
- }
- }
-
- // --------------------------------------------------------------------
-
- public function test_quotes_to_entities()
- {
- $strs = array(
- '"me oh my!"' => '&quot;me oh my!&quot;',
- "it's a winner!" => 'it&#39;s a winner!',
- );
-
- foreach ($strs as $str => $expect)
- {
- $this->assertEquals($expect, quotes_to_entities($str));
- }
- }
-
- // --------------------------------------------------------------------
-
- public function test_reduce_double_slashes()
- {
- $strs = array(
- 'http://codeigniter.com' => 'http://codeigniter.com',
- '//var/www/html/example.com/' => '/var/www/html/example.com/',
- '/var/www/html//index.php' => '/var/www/html/index.php'
- );
-
- foreach ($strs as $str => $expect)
- {
- $this->assertEquals($expect, reduce_double_slashes($str));
- }
- }
-
- // --------------------------------------------------------------------
-
- public function test_reduce_multiples()
- {
- $strs = array(
- 'Fred, Bill,, Joe, Jimmy' => 'Fred, Bill, Joe, Jimmy',
- 'Ringo, John, Paul,,' => 'Ringo, John, Paul,'
- );
-
- foreach ($strs as $str => $expect)
- {
- $this->assertEquals($expect, reduce_multiples($str));
- }
-
- $strs = array(
- 'Fred, Bill,, Joe, Jimmy' => 'Fred, Bill, Joe, Jimmy',
- 'Ringo, John, Paul,,' => 'Ringo, John, Paul'
- );
-
- foreach ($strs as $str => $expect)
- {
- $this->assertEquals($expect, reduce_multiples($str, ',', TRUE));
- }
- }
-
- // --------------------------------------------------------------------
-
- public function test_repeater()
- {
- $strs = array(
- 'a' => 'aaaaaaaaaa',
- '&nbsp;' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
- '<br>' => '<br><br><br><br><br><br><br><br><br><br>'
-
- );
-
- foreach ($strs as $str => $expect)
- {
- $this->assertEquals($expect, repeater($str, 10));
- }
- }
-
- // --------------------------------------------------------------------
-
- public function test_random_string()
- {
- $this->assertEquals(16, strlen(random_string('alnum', 16)));
- $this->assertEquals(32, strlen(random_string('unique', 16)));
- $this->assertEquals('string', gettype(random_string('numeric', 16)));
- }
-
- // --------------------------------------------------------------------
-
- public function test_increment_string()
- {
- $this->assertEquals('my-test_1', increment_string('my-test'));
- $this->assertEquals('my-test-1', increment_string('my-test', '-'));
- $this->assertEquals('file_5', increment_string('file_4'));
- $this->assertEquals('file-5', increment_string('file-4', '-'));
- $this->assertEquals('file-5', increment_string('file-4', '-'));
- $this->assertEquals('file-1', increment_string('file', '-', '1'));
- $this->assertEquals(124, increment_string('123', ''));
- }
-
-} \ No newline at end of file
diff --git a/tests/codeigniter/helpers/text_helper_test.php b/tests/codeigniter/helpers/text_helper_test.php
deleted file mode 100644
index 5be1837b8..000000000
--- a/tests/codeigniter/helpers/text_helper_test.php
+++ /dev/null
@@ -1,179 +0,0 @@
-<?php
-
-class Text_helper_test extends CI_TestCase {
-
- private $_long_string;
-
- public function set_up()
- {
- $this->helper('text');
-
- $this->_long_string = 'Once upon a time, a framework had no tests. It sad. So some nice people began to write tests. The more time that went on, the happier it became. Everyone was happy.';
- }
-
- // ------------------------------------------------------------------------
-
- public function test_word_limiter()
- {
- $this->assertEquals('Once upon a time,&#8230;', word_limiter($this->_long_string, 4));
- $this->assertEquals('Once upon a time,&hellip;', word_limiter($this->_long_string, 4, '&hellip;'));
- $this->assertEquals('', word_limiter('', 4));
- }
-
- // ------------------------------------------------------------------------
-
- public function test_character_limiter()
- {
- $this->assertEquals('Once upon a time, a&#8230;', character_limiter($this->_long_string, 20));
- $this->assertEquals('Once upon a time, a&hellip;', character_limiter($this->_long_string, 20, '&hellip;'));
- $this->assertEquals('Short', character_limiter('Short', 20));
- $this->assertEquals('Short', character_limiter('Short', 5));
- }
-
- // ------------------------------------------------------------------------
-
- public function test_ascii_to_entities()
- {
- $strs = array(
- '“‘ “test”' => '&#8220;&#8216; &#8220;test&#8221;',
- '†¥¨ˆøåß∂ƒ©˙∆˚¬' => '&#8224;&#165;&#168;&#710;&#248;&#229;&#223;&#8706;&#402;&#169;&#729;&#8710;&#730;&#172;'
- );
-
- foreach ($strs as $str => $expect)
- {
- $this->assertEquals($expect, ascii_to_entities($str));
- }
- }
-
- // ------------------------------------------------------------------------
-
- public function test_entities_to_ascii()
- {
- $strs = array(
- '&#8220;&#8216; &#8220;test&#8221;' => '“‘ “test”',
- '&#8224;&#165;&#168;&#710;&#248;&#229;&#223;&#8706;&#402;&#169;&#729;&#8710;&#730;&#172;' => '†¥¨ˆøåß∂ƒ©˙∆˚¬'
- );
-
- foreach ($strs as $str => $expect)
- {
- $this->assertEquals($expect, entities_to_ascii($str));
- }
- }
-
- // ------------------------------------------------------------------------
-
- public function test_convert_accented_characters()
- {
- if (substr(PHP_VERSION, 0, 3) === '7.4')
- {
- return $this->markTestSkipped('For some reason all PHP 7.4 instances on GitHub Actions trigger a parse error when foreign_chars.php is loaded');
- }
-
- $this->ci_vfs_clone('application/config/foreign_chars.php');
- $this->assertEquals('AAAeEEEIIOOEUUUeY', convert_accented_characters('ÀÂÄÈÊËÎÏÔŒÙÛÜŸ'));
- $this->assertEquals('a e i o u n ue', convert_accented_characters('á é í ó ú ñ ü'));
- }
-
- // ------------------------------------------------------------------------
-
- public function test_censored_words()
- {
- $censored = array('boob', 'nerd', 'ass', 'fart');
-
- $strs = array(
- 'Ted bobbled the ball' => 'Ted bobbled the ball',
- 'Jake is a nerdo' => 'Jake is a nerdo',
- 'The borg will assimilate you' => 'The borg will assimilate you',
- 'Did Mary Fart?' => 'Did Mary $*#?',
- 'Jake is really a boob' => 'Jake is really a $*#'
- );
-
- foreach ($strs as $str => $expect)
- {
- $this->assertEquals($expect, word_censor($str, $censored, '$*#'));
- }
-
- // test censored words being sent as a string
- $this->assertEquals('test', word_censor('test', 'test'));
- }
-
- // ------------------------------------------------------------------------
-
- public function test_highlight_code()
- {
- $expect = "<code><span style=\"color: #000000\">\n<span style=\"color: #0000BB\">&lt;?php&nbsp;var_dump</span><span style=\"color: #007700\">(</span><span style=\"color: #0000BB\">\$this</span><span style=\"color: #007700\">);&nbsp;</span><span style=\"color: #0000BB\">?&gt;&nbsp;</span>\n</span>\n</code>";
-
- $this->assertEquals($expect, highlight_code('<?php var_dump($this); ?>'));
- }
-
- // ------------------------------------------------------------------------
-
- public function test_highlight_phrase()
- {
- $strs = array(
- 'this is a phrase' => '<mark>this is</mark> a phrase',
- 'this is another' => '<mark>this is</mark> another',
- 'Gimme a test, Sally' => 'Gimme a test, Sally',
- 'Or tell me what this is' => 'Or tell me what <mark>this is</mark>',
- '' => ''
- );
-
- foreach ($strs as $str => $expect)
- {
- $this->assertEquals($expect, highlight_phrase($str, 'this is'));
- }
-
- $this->assertEquals('<strong>this is</strong> a strong test', highlight_phrase('this is a strong test', 'this is', '<strong>', '</strong>'));
- }
-
- // ------------------------------------------------------------------------
-
- public function test_ellipsize()
- {
- $strs = array(
- '0' => array(
- 'this is my string' => '&hellip; my string',
- "here's another one" => '&hellip;nother one',
- 'this one is just a bit longer' => '&hellip;bit longer',
- 'short' => 'short'
- ),
- '.5' => array(
- 'this is my string' => 'this &hellip;tring',
- "here's another one" => "here'&hellip;r one",
- 'this one is just a bit longer' => 'this &hellip;onger',
- 'short' => 'short'
- ),
- '1' => array(
- 'this is my string' => 'this is my&hellip;',
- "here's another one" => "here's ano&hellip;",
- 'this one is just a bit longer' => 'this one i&hellip;',
- 'short' => 'short'
- ),
- );
-
- foreach ($strs as $pos => $s)
- {
- foreach ($s as $str => $expect)
- {
- $this->assertEquals($expect, ellipsize($str, 10, $pos));
- }
- }
- }
-
- // ------------------------------------------------------------------------
-
- public function test_word_wrap()
- {
- $string = 'Here is a simple string of text that will help us demonstrate this function.';
- $this->assertEquals(substr_count(word_wrap($string, 25), "\n"), 4);
- }
-
- // ------------------------------------------------------------------------
-
- public function test_default_word_wrap_charlim()
- {
- $string = "Here is a longer string of text that will help us demonstrate the default charlim of this function.";
- $this->assertEquals(strpos(word_wrap($string), "\n"), 73);
- }
-
-}
diff --git a/tests/codeigniter/helpers/url_helper_test.php b/tests/codeigniter/helpers/url_helper_test.php
deleted file mode 100644
index 83a8c0ec2..000000000
--- a/tests/codeigniter/helpers/url_helper_test.php
+++ /dev/null
@@ -1,89 +0,0 @@
-<?php
-
-class Url_helper_test extends CI_TestCase {
-
- public function set_up()
- {
- $this->helper('url');
- }
-
- public function test_url_title()
- {
- $words = array(
- 'foo bar /' => 'foo-bar',
- '\ testing 12' => 'testing-12'
- );
-
- foreach ($words as $in => $out)
- {
- $this->assertEquals($out, url_title($in, 'dash', TRUE));
- }
- }
-
- // --------------------------------------------------------------------
-
- public function test_url_title_extra_dashes()
- {
- $words = array(
- '_foo bar_' => 'foo_bar',
- '_What\'s wrong with CSS?_' => 'Whats_wrong_with_CSS'
- );
-
- foreach ($words as $in => $out)
- {
- $this->assertEquals($out, url_title($in, 'underscore'));
- }
- }
-
- // --------------------------------------------------------------------
-
- public function test_prep_url()
- {
- $this->assertEquals('http://codeigniter.com', prep_url('codeigniter.com'));
- $this->assertEquals('http://www.codeigniter.com', prep_url('www.codeigniter.com'));
- }
-
- // --------------------------------------------------------------------
-
- public function test_auto_link_url()
- {
- $strings = array(
- 'www.codeigniter.com test' => '<a href="http://www.codeigniter.com">www.codeigniter.com</a> test',
- 'This is my noreply@codeigniter.com test' => 'This is my noreply@codeigniter.com test',
- '<br />www.google.com' => '<br /><a href="http://www.google.com">www.google.com</a>',
- 'Download CodeIgniter at www.codeigniter.com. Period test.' => 'Download CodeIgniter at <a href="http://www.codeigniter.com">www.codeigniter.com</a>. Period test.',
- 'Download CodeIgniter at www.codeigniter.com, comma test' => 'Download CodeIgniter at <a href="http://www.codeigniter.com">www.codeigniter.com</a>, comma test',
- 'This one: ://codeigniter.com must not break this one: http://codeigniter.com' => 'This one: <a href="://codeigniter.com">://codeigniter.com</a> must not break this one: <a href="http://codeigniter.com">http://codeigniter.com</a>',
- 'Trailing slash: https://codeigniter.com/ fubar' => 'Trailing slash: <a href="https://codeigniter.com/">https://codeigniter.com/</a> fubar'
- );
-
- foreach ($strings as $in => $out)
- {
- $this->assertEquals($out, auto_link($in, 'url'));
- }
- }
-
- // --------------------------------------------------------------------
-
- public function test_pull_675()
- {
- $strings = array(
- '<br />www.google.com' => '<br /><a href="http://www.google.com">www.google.com</a>',
- );
-
- foreach ($strings as $in => $out)
- {
- $this->assertEquals($out, auto_link($in, 'url'));
- }
- }
-
- // --------------------------------------------------------------------
-
- public function test_issue_5331()
- {
- $this->assertEquals(
- 'this is some text that includes '.safe_mailto('www.email@domain.com').' which is causing an issue',
- auto_link('this is some text that includes www.email@domain.com which is causing an issue')
- );
- }
-}
diff --git a/tests/codeigniter/helpers/xml_helper_test.php b/tests/codeigniter/helpers/xml_helper_test.php
deleted file mode 100644
index e8cf411da..000000000
--- a/tests/codeigniter/helpers/xml_helper_test.php
+++ /dev/null
@@ -1,15 +0,0 @@
-<?php
-
-class Xml_helper_test extends CI_TestCase {
-
- public function set_up()
- {
- $this->helper('xml');
- }
-
- public function test_xml_convert()
- {
- $this->assertEquals('&lt;tag&gt;my &amp; test &#45; &lt;/tag&gt;', xml_convert('<tag>my & test - </tag>'));
- }
-
-} \ No newline at end of file
diff --git a/tests/codeigniter/libraries/Calendar_test.php b/tests/codeigniter/libraries/Calendar_test.php
deleted file mode 100644
index ad1f45e8c..000000000
--- a/tests/codeigniter/libraries/Calendar_test.php
+++ /dev/null
@@ -1,222 +0,0 @@
-<?php
-
-class Calendar_test extends CI_TestCase {
-
- public function set_up()
- {
- // Required for get_total_days()
- $this->ci_instance_var('load', $this->getMockBuilder('CI_Loader')->setMethods(array('helper'))->getMock());
-
- $lang = $this->getMockBuilder('CI_Lang')->setMethods(array('load', 'line'))->getMock();
- $lang->expects($this->any())->method('line')->will($this->returnValue(FALSE));
- $this->ci_instance_var('lang', $lang);
-
- $this->calendar = new CI_Calendar();
- }
-
- // --------------------------------------------------------------------
-
- public function test_initialize()
- {
- $this->calendar->initialize(array(
- 'month_type' => 'short',
- 'start_day' => 'monday'
- ));
- $this->assertEquals('short', $this->calendar->month_type);
- $this->assertEquals('monday', $this->calendar->start_day);
- }
-
- // --------------------------------------------------------------------
-
- public function test_generate()
- {
- $no_events = '<table border="0" cellpadding="4" cellspacing="0">
-
-<tr>
-<th colspan="7">September&nbsp;2011</th>
-
-</tr>
-
-<tr>
-<td>Su</td><td>Mo</td><td>Tu</td><td>We</td><td>Th</td><td>Fr</td><td>Sa</td>
-</tr>
-
-<tr>
-<td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>1</td><td>2</td><td>3</td>
-</tr>
-
-<tr>
-<td>4</td><td>5</td><td>6</td><td>7</td><td>8</td><td>9</td><td>10</td>
-</tr>
-
-<tr>
-<td>11</td><td>12</td><td>13</td><td>14</td><td>15</td><td>16</td><td>17</td>
-</tr>
-
-<tr>
-<td>18</td><td>19</td><td>20</td><td>21</td><td>22</td><td>23</td><td>24</td>
-</tr>
-
-<tr>
-<td>25</td><td>26</td><td>27</td><td>28</td><td>29</td><td>30</td><td>&nbsp;</td>
-</tr>
-
-</table>';
-
- $this->assertEquals($no_events, $this->calendar->generate(2011, 9));
-
- $data = array(
- 3 => 'http://example.com/news/article/2006/03/',
- 7 => 'http://example.com/news/article/2006/07/',
- 13 => 'http://example.com/news/article/2006/13/',
- 26 => 'http://example.com/news/article/2006/26/'
- );
-
- $events = '<table border="0" cellpadding="4" cellspacing="0">
-
-<tr>
-<th colspan="7">September&nbsp;2011</th>
-
-</tr>
-
-<tr>
-<td>Su</td><td>Mo</td><td>Tu</td><td>We</td><td>Th</td><td>Fr</td><td>Sa</td>
-</tr>
-
-<tr>
-<td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>1</td><td>2</td><td><a href="http://example.com/news/article/2006/03/">3</a></td>
-</tr>
-
-<tr>
-<td>4</td><td>5</td><td>6</td><td><a href="http://example.com/news/article/2006/07/">7</a></td><td>8</td><td>9</td><td>10</td>
-</tr>
-
-<tr>
-<td>11</td><td>12</td><td><a href="http://example.com/news/article/2006/13/">13</a></td><td>14</td><td>15</td><td>16</td><td>17</td>
-</tr>
-
-<tr>
-<td>18</td><td>19</td><td>20</td><td>21</td><td>22</td><td>23</td><td>24</td>
-</tr>
-
-<tr>
-<td>25</td><td><a href="http://example.com/news/article/2006/26/">26</a></td><td>27</td><td>28</td><td>29</td><td>30</td><td>&nbsp;</td>
-</tr>
-
-</table>';
-
- $this->assertEquals($events, $this->calendar->generate(2011, 9, $data));
- }
-
- // --------------------------------------------------------------------
-
- public function test_get_month_name()
- {
- $this->calendar->month_type = NULL;
- $this->assertEquals('January', $this->calendar->get_month_name('01'));
-
- $this->calendar->month_type = 'short';
- $this->assertEquals('Jan', $this->calendar->get_month_name('01'));
- }
-
- // --------------------------------------------------------------------
-
- public function test_get_day_names()
- {
- $this->assertEquals(array(
- 'Sunday',
- 'Monday',
- 'Tuesday',
- 'Wednesday',
- 'Thursday',
- 'Friday',
- 'Saturday'
- ), $this->calendar->get_day_names('long'));
-
- $this->assertEquals(array(
- 'Sun',
- 'Mon',
- 'Tue',
- 'Wed',
- 'Thu',
- 'Fri',
- 'Sat'
- ), $this->calendar->get_day_names('short'));
-
- $this->calendar->day_type = NULL;
-
- $this->assertEquals(array(
- 'Su',
- 'Mo',
- 'Tu',
- 'We',
- 'Th',
- 'Fr',
- 'Sa'
- ), $this->calendar->get_day_names());
- }
-
- // --------------------------------------------------------------------
-
- public function test_adjust_date()
- {
- $this->assertEquals(array('month' => 8, 'year' => 2012), $this->calendar->adjust_date(8, 2012));
- $this->assertEquals(array('month' => 1, 'year' => 2013), $this->calendar->adjust_date(13, 2012));
- }
-
- // --------------------------------------------------------------------
-
- public function test_get_total_days()
- {
- $this->assertEquals(0, $this->calendar->get_total_days(13, 2012));
-
- $this->assertEquals(31, $this->calendar->get_total_days(1, 2012));
- $this->assertEquals(28, $this->calendar->get_total_days(2, 2011));
- $this->assertEquals(29, $this->calendar->get_total_days(2, 2012));
- $this->assertEquals(31, $this->calendar->get_total_days(3, 2012));
- $this->assertEquals(30, $this->calendar->get_total_days(4, 2012));
- $this->assertEquals(31, $this->calendar->get_total_days(5, 2012));
- $this->assertEquals(30, $this->calendar->get_total_days(6, 2012));
- $this->assertEquals(31, $this->calendar->get_total_days(7, 2012));
- $this->assertEquals(31, $this->calendar->get_total_days(8, 2012));
- $this->assertEquals(30, $this->calendar->get_total_days(9, 2012));
- $this->assertEquals(31, $this->calendar->get_total_days(10, 2012));
- $this->assertEquals(30, $this->calendar->get_total_days(11, 2012));
- $this->assertEquals(31, $this->calendar->get_total_days(12, 2012));
- }
-
- // --------------------------------------------------------------------
-
- public function test_default_template()
- {
- $array = array(
- 'table_open' => '<table border="0" cellpadding="4" cellspacing="0">',
- 'heading_row_start' => '<tr>',
- 'heading_previous_cell' => '<th><a href="{previous_url}">&lt;&lt;</a></th>',
- 'heading_title_cell' => '<th colspan="{colspan}">{heading}</th>',
- 'heading_next_cell' => '<th><a href="{next_url}">&gt;&gt;</a></th>',
- 'heading_row_end' => '</tr>',
- 'week_row_start' => '<tr>',
- 'week_day_cell' => '<td>{week_day}</td>',
- 'week_row_end' => '</tr>',
- 'cal_row_start' => '<tr>',
- 'cal_cell_start' => '<td>',
- 'cal_cell_start_today' => '<td>',
- 'cal_cell_content' => '<a href="{content}">{day}</a>',
- 'cal_cell_content_today' => '<a href="{content}"><strong>{day}</strong></a>',
- 'cal_cell_no_content' => '{day}',
- 'cal_cell_no_content_today' => '<strong>{day}</strong>',
- 'cal_cell_blank' => '&nbsp;',
- 'cal_cell_end' => '</td>',
- 'cal_cell_end_today' => '</td>',
- 'cal_row_end' => '</tr>',
- 'table_close' => '</table>',
- 'cal_cell_start_other' => '<td style="color: #666;">',
- 'cal_cell_other' => '{day}',
- 'cal_cell_end_other' => '</td>'
- );
-
- $this->assertEquals($array, $this->calendar->default_template());
- }
-
-}
diff --git a/tests/codeigniter/libraries/Driver_test.php b/tests/codeigniter/libraries/Driver_test.php
deleted file mode 100644
index ea5cfa235..000000000
--- a/tests/codeigniter/libraries/Driver_test.php
+++ /dev/null
@@ -1,180 +0,0 @@
-<?php
-
-/**
- * Driver library base class unit test
- */
-class Driver_test extends CI_TestCase {
-
- private $name;
-
- /**
- * Set up test framework
- */
- public function set_up()
- {
- // Set our subclass prefix
- $this->subclass = 'Mock_Libraries_';
- $this->ci_set_config('subclass_prefix', $this->subclass);
-
- // Mock Loader->get_package_paths
- $paths = 'get_package_paths';
- $ldr = $this->getMockBuilder('CI_Loader')->setMethods(array($paths))->getMock();
- $ldr->expects($this->any())->method($paths)->will($this->returnValue(array(APPPATH, BASEPATH)));
- $this->ci_instance_var('load', $ldr);
-
- // Create mock driver library
- $this->name = 'Driver';
- $this->lib = new Mock_Libraries_Driver();
- }
-
- /**
- * Test driver child loading
- */
- public function test_load_driver()
- {
- // Create driver file
- $driver = 'basic';
- $file = $this->name.'_'.$driver;
- $class = 'CI_'.$file;
- $prop = 'called';
- $content = '<?php class '.$class.' extends CI_Driver { public $'.$prop.' = FALSE; '.
- 'public function decorate($parent) { $this->'.$prop.' = TRUE; } }';
- $this->ci_vfs_create($file, $content, $this->ci_base_root, array('libraries', $this->name, 'drivers'));
-
- // Make driver valid
- $this->lib->driver_list($driver);
-
- // Load driver
- $this->assertNotNull($this->lib->load_driver($driver));
-
- // Did lib name get set?
- $this->assertEquals($this->name, $this->lib->get_name());
-
- // Was driver loaded?
- $this->assertObjectHasAttribute($driver, $this->lib);
- $this->assertInstanceOf($class, $this->lib->$driver);
- $this->assertInstanceOf('CI_Driver', $this->lib->$driver);
-
- // Was decorate called?
- $this->assertObjectHasAttribute($prop, $this->lib->$driver);
- $this->assertTrue($this->lib->$driver->$prop);
-
- // Do we get an error for an invalid driver?
- $driver = 'unlisted';
- $this->setExpectedException('RuntimeException', 'CI Error: Invalid driver requested: '.$this->name.'_'.$driver);
- $this->lib->load_driver($driver);
- }
-
- /**
- * Test loading lowercase from app path
- */
- public function test_load_app_driver()
- {
- // Create driver file
- $driver = 'lowpack';
- $file = $this->name.'_'.$driver;
- $class = 'CI_'.$file;
- $content = '<?php class '.$class.' extends CI_Driver { }';
- $this->ci_vfs_create($file, $content, $this->ci_app_root,
- array('libraries', $this->name, 'drivers'));
-
- // Make valid list
- $nodriver = 'absent';
- $this->lib->driver_list(array($driver, $nodriver));
-
- // Load driver
- $this->assertNotNull($this->lib->load_driver($driver));
-
- // Was driver loaded?
- $this->assertObjectHasAttribute($driver, $this->lib);
- $this->assertInstanceOf($class, $this->lib->$driver);
- $this->assertInstanceOf('CI_Driver', $this->lib->$driver);
-
- // Do we get an error for a non-existent driver?
- $this->setExpectedException('RuntimeException', 'CI Error: Unable to load the requested driver: CI_'.
- $this->name.'_'.$nodriver);
- $this->lib->load_driver($nodriver);
- }
-
- /**
- * Test loading driver extension
- */
- public function test_load_driver_ext()
- {
- // Create base file
- $driver = 'extend';
- $base = $this->name.'_'.$driver;
- $baseclass = 'CI_'.$base;
- $content = '<?php class '.$baseclass.' extends CI_Driver { }';
- $this->ci_vfs_create($base, $content, $this->ci_base_root, array('libraries', $this->name, 'drivers'));
-
- // Create driver file
- $class = $this->subclass.$base;
- $content = '<?php class '.$class.' extends '.$baseclass.' { }';
- $this->ci_vfs_create($class, $content, $this->ci_app_root, array('libraries', $this->name, 'drivers'));
-
- // Make valid list
- $this->lib->driver_list($driver);
-
- // Load driver
- $this->assertNotNull($this->lib->load_driver($driver));
-
- // Was driver loaded?
- $this->assertObjectHasAttribute($driver, $this->lib);
- $this->assertInstanceOf($class, $this->lib->$driver);
- $this->assertInstanceOf($baseclass, $this->lib->$driver);
- $this->assertInstanceOf('CI_Driver', $this->lib->$driver);
-
- // Create driver extension without base
- $driver = 'baseless';
- $base = $this->name.'_'.$driver;
- $class = $this->subclass.$base;
- $content = '<?php class '.$class.' extends CI_Driver { }';
- $this->ci_vfs_create($class, $content, $this->ci_app_root, array('libraries', $this->name, 'drivers'));
- $this->lib->driver_list($driver);
-
- // Do we get an error when base class isn't found?
- $this->setExpectedException('RuntimeException', 'CI Error: Unable to load the requested class: CI_'.$base);
- $this->lib->load_driver($driver);
- }
-
- /**
- * Test decorating driver with parent attributes
- */
- public function test_decorate()
- {
- // Create parent with a method and property to access
- $pclass = 'Test_Parent';
- $prop = 'parent_prop';
- $value = 'initial';
- $method = 'parent_func';
- $return = 'func return';
- $code = 'class '.$pclass.' { public $'.$prop.' = \''.$value.'\'; '.
- 'public function '.$method.'() { return \''.$return.'\'; } }';
- eval($code);
- $parent = new $pclass();
-
- // Create child driver to decorate
- $class = 'Test_Driver';
- eval('class '.$class.' extends CI_Driver { }');
- $child = new $class();
-
- // Decorate child
- $child->decorate($parent);
-
- // Do we get the initial parent property value?
- $this->assertEquals($value, $child->$prop);
-
- // Can we change the parent property?
- $newval = 'changed';
- $child->$prop = $newval;
- $this->assertEquals($newval, $parent->$prop);
-
- // Do we get back the updated value?
- $this->assertEquals($newval, $child->$prop);
-
- // Can we call the parent method?
- $this->assertEquals($return, $child->$method());
- }
-
-}
diff --git a/tests/codeigniter/libraries/Encrypt_test.php b/tests/codeigniter/libraries/Encrypt_test.php
deleted file mode 100644
index adbca31b2..000000000
--- a/tests/codeigniter/libraries/Encrypt_test.php
+++ /dev/null
@@ -1,79 +0,0 @@
-<?php
-/**
- * @requires extension mcrypt
- */
-class Encrypt_test extends CI_TestCase {
-
- public function set_up()
- {
- if ( ! extension_loaded('mcrypt'))
- {
- return;
- }
- elseif (version_compare(PHP_VERSION, '7.1.0-alpha', '>='))
- {
- return $this->markTestSkipped('ext/mcrypt is deprecated since PHP 7.1 and will generate notices here.');
- }
-
- $this->encrypt = new Mock_Libraries_Encrypt();
- $this->ci_instance_var('encrypt', $this->encrypt);
-
- $this->ci_set_config('encryption_key', "Encryptin'glike@boss!");
- $this->msg = 'My secret message';
- }
-
- // --------------------------------------------------------------------
-
- public function test_encode()
- {
- $this->assertNotEquals($this->msg, $this->encrypt->encode($this->msg));
- }
-
- // --------------------------------------------------------------------
-
- public function test_decode()
- {
- $encoded_msg = $this->encrypt->encode($this->msg);
- $this->assertEquals($this->msg, $this->encrypt->decode($encoded_msg));
- }
-
- // --------------------------------------------------------------------
-
- public function test_optional_key()
- {
- $key = 'Ohai!ù0129°03182%HD1892P0';
- $encoded_msg = $this->encrypt->encode($this->msg, $key);
- $this->assertEquals($this->msg, $this->encrypt->decode($encoded_msg, $key));
- }
-
- // --------------------------------------------------------------------
-
- public function test_default_cipher()
- {
- $this->assertEquals('rijndael-256', $this->encrypt->get_cipher());
- }
-
- // --------------------------------------------------------------------
-
- public function test_set_cipher()
- {
- $this->encrypt->set_cipher(MCRYPT_BLOWFISH);
- $this->assertEquals('blowfish', $this->encrypt->get_cipher());
- }
-
- // --------------------------------------------------------------------
-
- public function test_default_mode()
- {
- $this->assertEquals('cbc', $this->encrypt->get_mode());
- }
-
- // --------------------------------------------------------------------
-
- public function test_set_mode()
- {
- $this->encrypt->set_mode(MCRYPT_MODE_CFB);
- $this->assertEquals('cfb', $this->encrypt->get_mode());
- }
-
-}
diff --git a/tests/codeigniter/libraries/Encryption_test.php b/tests/codeigniter/libraries/Encryption_test.php
deleted file mode 100644
index 68bc3d804..000000000
--- a/tests/codeigniter/libraries/Encryption_test.php
+++ /dev/null
@@ -1,400 +0,0 @@
-<?php
-
-class Encryption_test extends CI_TestCase {
-
- public function set_up()
- {
- $this->encryption = new Mock_Libraries_Encryption();
- }
-
- // --------------------------------------------------------------------
-
- /**
- * __construct test
- *
- * Covers behavior with $config['encryption_key'] set or not
- */
- public function test___construct()
- {
- // Assume no configuration from set_up()
- $this->assertNull($this->encryption->get_key());
-
- // Try with an empty value
- $this->ci_set_config('encryption_key');
- $this->encrypt = new Mock_Libraries_Encryption();
- $this->assertNull($this->encrypt->get_key());
-
- $this->ci_set_config('encryption_key', str_repeat("\x0", 16));
- $this->encrypt = new Mock_Libraries_Encryption();
- $this->assertEquals(str_repeat("\x0", 16), $this->encrypt->get_key());
- }
-
- // --------------------------------------------------------------------
-
- /**
- * hkdf() test
- *
- * Applies test vectors described in Appendix A(1-3) RFC5869.
- * Described vectors 4-7 SHA-1, which we don't support and are
- * therefore excluded.
- *
- * Because our implementation is a single method instead of being
- * split into hkdf_extract() and hkdf_expand(), we cannot test for
- * the PRK value. As long as the OKM is correct though, it's fine.
- *
- * @link https://tools.ietf.org/rfc/rfc5869.txt
- */
- public function test_hkdf()
- {
- $vectors = array(
- // A.1: Basic test case with SHA-256
- array(
- 'digest' => 'sha256',
- 'ikm' => "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
- 'salt' => "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c",
- 'length' => 42,
- 'info' => "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9",
- // 'prk' => "\x07\x77\x09\x36\x2c\x2e\x32\xdf\x0d\xdc\x3f\x0d\xc4\x7b\xba\x63\x90\xb6\xc7\x3b\xb5\x0f\x9c\x31\x22\xec\x84\x4a\xd7\xc2\xb3\xe5",
- 'okm' => "\x3c\xb2\x5f\x25\xfa\xac\xd5\x7a\x90\x43\x4f\x64\xd0\x36\x2f\x2a\x2d\x2d\x0a\x90\xcf\x1a\x5a\x4c\x5d\xb0\x2d\x56\xec\xc4\xc5\xbf\x34\x00\x72\x08\xd5\xb8\x87\x18\x58\x65"
- ),
- // A.2: Test with SHA-256 and longer inputs/outputs
- array(
- 'digest' => 'sha256',
- 'ikm' => "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f",
- 'salt' => "\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf",
- 'length' => 82,
- 'info' => "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
- // 'prk' => "\x06\xa6\xb8\x8c\x58\x53\x36\x1a\x06\x10\x4c\x9c\xeb\x35\xb4\x5c\xef\x76\x00\x14\x90\x46\x71\x01\x4a\x19\x3f\x40\xc1\x5f\xc2\x44",
- 'okm' => "\xb1\x1e\x39\x8d\xc8\x03\x27\xa1\xc8\xe7\xf7\x8c\x59\x6a\x49\x34\x4f\x01\x2e\xda\x2d\x4e\xfa\xd8\xa0\x50\xcc\x4c\x19\xaf\xa9\x7c\x59\x04\x5a\x99\xca\xc7\x82\x72\x71\xcb\x41\xc6\x5e\x59\x0e\x09\xda\x32\x75\x60\x0c\x2f\x09\xb8\x36\x77\x93\xa9\xac\xa3\xdb\x71\xcc\x30\xc5\x81\x79\xec\x3e\x87\xc1\x4c\x01\xd5\xc1\xf3\x43\x4f\x1d\x87",
- ),
- // A.3: Test with SHA-256 and zero-length salt/info
- array(
- 'digest' => 'sha256',
- 'ikm' => "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
- 'salt' => '',
- 'length' => 42,
- 'info' => '',
- // 'prk' => "\x19\xef\x24\xa3\x2c\x71\x7b\x16\x7f\x33\xa9\x1d\x6f\x64\x8b\xdf\x96\x59\x67\x76\xaf\xdb\x63\x77\xac\x43\x4c\x1c\x29\x3c\xcb\x04",
- 'okm' => "\x8d\xa4\xe7\x75\xa5\x63\xc1\x8f\x71\x5f\x80\x2a\x06\x3c\x5a\x31\xb8\xa1\x1f\x5c\x5e\xe1\x87\x9e\xc3\x45\x4e\x5f\x3c\x73\x8d\x2d\x9d\x20\x13\x95\xfa\xa4\xb6\x1a\x96\xc8",
- )
- );
-
- foreach ($vectors as $test)
- {
- $this->assertEquals(
- $test['okm'],
- $this->encryption->hkdf(
- $test['ikm'],
- $test['digest'],
- $test['salt'],
- $test['length'],
- $test['info']
- )
- );
- }
-
- // Test default length, it must match the digest size
- $hkdf_result = $this->encryption->hkdf('foobar', 'sha512');
- $this->assertEquals(
- 64,
- defined('MB_OVERLOAD_STRING')
- ? mb_strlen($hkdf_result, '8bit')
- : strlen($hkdf_result)
- );
-
- // Test maximum length (RFC5869 says that it must be up to 255 times the digest size)
- $hkdf_result = $this->encryption->hkdf('foobar', 'sha384', NULL, 48 * 255);
- $this->assertEquals(
- 12240,
- defined('MB_OVERLOAD_STRING')
- ? mb_strlen($hkdf_result, '8bit')
- : strlen($hkdf_result)
- );
- $this->assertFalse($this->encryption->hkdf('foobar', 'sha224', NULL, 28 * 255 + 1));
-
- // CI-specific test for an invalid digest
- $this->assertFalse($this->encryption->hkdf('fobar', 'sha1'));
- }
-
- // --------------------------------------------------------------------
-
- /**
- * _get_params() test
- */
- public function test__get_params()
- {
- $key = str_repeat("\x0", 16);
-
- // Invalid custom parameters
- $params = array(
- // No cipher, mode or key
- array('cipher' => 'aes-128', 'mode' => 'cbc'),
- array('cipher' => 'aes-128', 'key' => $key),
- array('mode' => 'cbc', 'key' => $key),
- // No HMAC key or not a valid digest
- array('cipher' => 'aes-128', 'mode' => 'cbc', 'key' => $key),
- array('cipher' => 'aes-128', 'mode' => 'cbc', 'key' => $key, 'hmac_digest' => 'sha1', 'hmac_key' => $key),
- // Invalid mode
- array('cipher' => 'aes-128', 'mode' => 'foo', 'key' => $key, 'hmac_digest' => 'sha256', 'hmac_key' => $key)
- );
-
- for ($i = 0, $c = count($params); $i < $c; $i++)
- {
- $this->assertFalse($this->encryption->__get_params($params[$i]));
- }
-
- // Valid parameters
- $params = array(
- 'cipher' => 'aes-128',
- 'mode' => 'cbc',
- 'key' => str_repeat("\x0", 16),
- 'hmac_key' => str_repeat("\x0", 16)
- );
-
- $this->assertEquals('array', gettype($this->encryption->__get_params($params)));
-
- $params['base64'] = TRUE;
- $params['hmac_digest'] = 'sha512';
-
- // Including all parameters
- $params = array(
- 'cipher' => 'aes-128',
- 'mode' => 'cbc',
- 'key' => str_repeat("\x0", 16),
- 'raw_data' => TRUE,
- 'hmac_key' => str_repeat("\x0", 16),
- 'hmac_digest' => 'sha256'
- );
-
- $output = $this->encryption->__get_params($params);
- unset($output['handle'], $output['cipher'], $params['raw_data'], $params['cipher']);
- $params['base64'] = FALSE;
- $this->assertEquals($params, $output);
-
- // HMAC disabled
- unset($params['hmac_key'], $params['hmac_digest']);
- $params['hmac'] = $params['raw_data'] = FALSE;
- $params['cipher'] = 'aes-128';
- $output = $this->encryption->__get_params($params);
- unset($output['handle'], $output['cipher'], $params['hmac'], $params['raw_data'], $params['cipher']);
- $params['base64'] = TRUE;
- $params['hmac_digest'] = $params['hmac_key'] = NULL;
- $this->assertEquals($params, $output);
- }
-
- // --------------------------------------------------------------------
-
- /**
- * initialize(), encrypt(), decrypt() test
- *
- * Testing the three methods separately is not realistic as they are
- * designed to work together. A more thorough test for initialize()
- * though is the OpenSSL/MCrypt compatibility test.
- *
- * @depends test_hkdf
- * @depends test__get_params
- */
- public function test_initialize_encrypt_decrypt()
- {
- $message = 'This is a plain-text message.';
- $key = "\xd0\xc9\x08\xc4\xde\x52\x12\x6e\xf8\xcc\xdb\x03\xea\xa0\x3a\x5c";
-
- // Default state (AES-128/Rijndael-128 in CBC mode)
- $this->encryption->initialize(array('key' => $key));
-
- // Was the key properly set?
- $this->assertEquals($key, $this->encryption->get_key());
-
- $this->assertEquals($message, $this->encryption->decrypt($this->encryption->encrypt($message)));
-
- // Try DES in ECB mode, just for the sake of changing stuff
- $this->encryption->initialize(array('cipher' => 'des', 'mode' => 'ecb', 'key' => substr($key, 0, 8)));
- $this->assertEquals($message, $this->encryption->decrypt($this->encryption->encrypt($message)));
- }
-
- // --------------------------------------------------------------------
-
- /**
- * encrypt(), decrypt test with custom parameters
- *
- * @depends test__get_params
- */
- public function test_encrypt_decrypt_custom()
- {
- $message = 'Another plain-text message.';
-
- // A random invalid parameter
- $this->assertFalse($this->encryption->encrypt($message, array('foo')));
- $this->assertFalse($this->encryption->decrypt($message, array('foo')));
-
- // No HMAC, binary output
- $params = array(
- 'cipher' => 'tripledes',
- 'mode' => 'cfb',
- 'key' => str_repeat("\x1", 16),
- 'base64' => FALSE,
- 'hmac' => FALSE
- );
-
- $ciphertext = $this->encryption->encrypt($message, $params);
-
- $this->assertEquals($message, $this->encryption->decrypt($ciphertext, $params));
- }
-
- // --------------------------------------------------------------------
-
- /**
- * _mcrypt_get_handle() test
- */
- public function test__mcrypt_get_handle()
- {
- if ($this->encryption->drivers['mcrypt'] === FALSE)
- {
- return $this->markTestSkipped('Cannot test MCrypt because it is not available.');
- }
- elseif (version_compare(PHP_VERSION, '7.1.0-alpha', '>='))
- {
- return $this->markTestSkipped('ext/mcrypt is deprecated since PHP 7.1 and will generate notices here.');
- }
-
- $this->assertInternalType('resource', $this->encryption->__driver_get_handle('mcrypt', 'rijndael-128', 'cbc'));
- }
-
- // --------------------------------------------------------------------
-
- /**
- * _openssl_get_handle() test
- */
- public function test__openssl_mcrypt_get_handle()
- {
- if ($this->encryption->drivers['openssl'] === FALSE)
- {
- return $this->markTestSkipped('Cannot test OpenSSL because it is not available.');
- }
-
- $this->assertEquals('aes-128-cbc', $this->encryption->__driver_get_handle('openssl', 'aes-128', 'cbc'));
- $this->assertEquals('rc4-40', $this->encryption->__driver_get_handle('openssl', 'rc4-40', 'stream'));
- }
-
- // --------------------------------------------------------------------
-
- /**
- * OpenSSL/MCrypt portability test
- *
- * Amongst the obvious stuff, _cipher_alias() is also tested here.
- */
- public function test_portability()
- {
- if ( ! $this->encryption->drivers['mcrypt'] OR ! $this->encryption->drivers['openssl'])
- {
- $this->markTestSkipped('Both MCrypt and OpenSSL support are required for portability tests.');
- return;
- }
- elseif (version_compare(PHP_VERSION, '7.1.0-alpha', '>='))
- {
- return $this->markTestSkipped('ext/mcrypt is deprecated since PHP 7.1 and will generate notices here.');
- }
-
- $message = 'This is a message encrypted via MCrypt and decrypted via OpenSSL, or vice-versa.';
-
- // Format is: <Cipher name>, <Cipher mode>, <Key size>
- $portable = array(
- array('aes-128', 'cbc', 16),
- array('aes-128', 'cfb', 16),
- array('aes-128', 'cfb8', 16),
- array('aes-128', 'ofb', 16),
- array('aes-128', 'ecb', 16),
- array('aes-128', 'ctr', 16),
- array('aes-192', 'cbc', 24),
- array('aes-192', 'cfb', 24),
- array('aes-192', 'cfb8', 24),
- array('aes-192', 'ofb', 24),
- array('aes-192', 'ecb', 24),
- array('aes-192', 'ctr', 24),
- array('aes-256', 'cbc', 32),
- array('aes-256', 'cfb', 32),
- array('aes-256', 'cfb8', 32),
- array('aes-256', 'ofb', 32),
- array('aes-256', 'ecb', 32),
- array('aes-256', 'ctr', 32),
- array('des', 'cbc', 7),
- array('des', 'cfb', 7),
- array('des', 'cfb8', 7),
- array('des', 'ofb', 7),
- array('des', 'ecb', 7),
- array('tripledes', 'cbc', 7),
- array('tripledes', 'cfb', 7),
- array('tripledes', 'cfb8', 7),
- array('tripledes', 'ofb', 7),
- array('tripledes', 'cbc', 14),
- array('tripledes', 'cfb', 14),
- array('tripledes', 'cfb8', 14),
- array('tripledes', 'ofb', 14),
- array('tripledes', 'cbc', 21),
- array('tripledes', 'cfb', 21),
- array('tripledes', 'cfb8', 21),
- array('tripledes', 'ofb', 21),
- array('blowfish', 'cbc', 16),
- array('blowfish', 'cfb', 16),
- array('blowfish', 'ofb', 16),
- array('blowfish', 'ecb', 16),
- array('blowfish', 'cbc', 56),
- array('blowfish', 'cfb', 56),
- array('blowfish', 'ofb', 56),
- array('blowfish', 'ecb', 56),
- array('cast5', 'cbc', 11),
- array('cast5', 'cfb', 11),
- array('cast5', 'ofb', 11),
- array('cast5', 'ecb', 11),
- array('cast5', 'cbc', 16),
- array('cast5', 'cfb', 16),
- array('cast5', 'ofb', 16),
- array('cast5', 'ecb', 16),
- array('rc4', 'stream', 5),
- array('rc4', 'stream', 8),
- array('rc4', 'stream', 16),
- array('rc4', 'stream', 32),
- array('rc4', 'stream', 64),
- array('rc4', 'stream', 128),
- array('rc4', 'stream', 256)
- );
- $driver_index = array('mcrypt', 'openssl');
-
- foreach ($portable as &$test)
- {
- // Add some randomness to the selected driver
- $driver = mt_rand(0,1);
- $params = array(
- 'driver' => $driver_index[$driver],
- 'cipher' => $test[0],
- 'mode' => $test[1],
- 'key' => openssl_random_pseudo_bytes($test[2])
- );
-
- $this->encryption->initialize($params);
- $ciphertext = $this->encryption->encrypt($message);
-
- $driver = (int) ! $driver;
- $params['driver'] = $driver_index[$driver];
-
- $this->encryption->initialize($params);
- $this->assertEquals($message, $this->encryption->decrypt($ciphertext));
- }
- }
-
- // --------------------------------------------------------------------
-
- /**
- * __get() test
- */
- public function test_magic_get()
- {
- $this->assertNull($this->encryption->foo);
- $this->assertEquals(array('mcrypt', 'openssl'), array_keys($this->encryption->drivers));
-
- // 'stream' mode is translated into an empty string for OpenSSL
- $this->encryption->initialize(array('cipher' => 'rc4', 'mode' => 'stream'));
- $this->assertEquals('stream', $this->encryption->mode);
- }
-
-}
diff --git a/tests/codeigniter/libraries/Form_validation_test.php b/tests/codeigniter/libraries/Form_validation_test.php
deleted file mode 100644
index 6872b3abd..000000000
--- a/tests/codeigniter/libraries/Form_validation_test.php
+++ /dev/null
@@ -1,629 +0,0 @@
-<?php
-
-class Form_validation_test extends CI_TestCase {
-
- public function set_up()
- {
- $_SERVER['REQUEST_METHOD'] = 'POST';
-
- // Create a mock loader since load->helper() looks in the wrong directories for unit tests,
- // We'll use CI_TestCase->helper() instead
- $loader = $this->getMockBuilder('CI_Loader')->setMethods(array('helper'))->getMock();
-
- // Same applies for lang
- $lang = $this->getMockBuilder('CI_Lang')->setMethods(array('load'))->getMock();
-
- $this->ci_set_config('charset', 'UTF-8');
- $utf8 = new Mock_Core_Utf8();
- $security = new Mock_Core_Security();
- $input = new Mock_Core_Input($security, $utf8);
-
- $this->ci_instance_var('lang', $lang);
- $this->ci_instance_var('load', $loader);
- $this->ci_instance_var('input', $input);
-
- $this->lang('form_validation');
- $this->helper('form');
-
- $this->form_validation = new CI_Form_validation();
- }
-
- public function test_empty_array_input()
- {
- $this->assertFalse(
- $this->run_rules(
- array(array('field' => 'foo', 'label' => 'Foo Label', 'rules' => 'required')),
- array('foo' => array())
- )
- );
- }
-
- public function test_rule_required()
- {
- $rules = array(array('field' => 'foo', 'label' => 'Foo', 'rules' => 'is_numeric'));
-
- // Empty, not required
- $this->assertTrue($this->run_rules($rules, array('foo' => '')));
-
-
- // Not required, but also not empty
- $this->assertTrue($this->run_rules($rules, array('foo' => '123')));
- $this->assertFalse($this->run_rules($rules, array('foo' => 'bar')));
-
- // Required variations
- $rules[0]['rules'] .= '|required';
- $this->assertTrue($this->run_rules($rules, array('foo' => '123')));
- $this->assertFalse($this->run_rules($rules, array('foo' => '')));
- $this->assertFalse($this->run_rules($rules, array('foo' => ' ')));
- $this->assertFalse($this->run_rules($rules, array('foo' => 'bar')));
- }
-
- public function test_rule_matches()
- {
- $rules = array(
- array('field' => 'foo', 'label' => 'label', 'rules' => 'required'),
- array('field' => 'bar', 'label' => 'label2', 'rules' => 'matches[foo]')
- );
- $values_base = array('foo' => 'sample');
-
- $this->assertTrue($this->run_rules($rules, array_merge($values_base, array('bar' => 'sample'))));
-
- $this->assertFalse($this->run_rules($rules, array_merge($values_base, array('bar' => ''))));
- $this->assertFalse($this->run_rules($rules, array_merge($values_base, array('bar' => 'Sample'))));
- $this->assertFalse($this->run_rules($rules, array_merge($values_base, array('bar' => ' sample'))));
- }
-
- public function test_rule_differs()
- {
- $rules = array(
- array('field' => 'foo', 'label' => 'label', 'rules' => 'required'),
- array('field' => 'bar', 'label' => 'label2', 'rules' => 'differs[foo]')
- );
- $values_base = array('foo' => 'sample');
-
- $this->assertTrue($this->run_rules($rules, array_merge($values_base, array('bar' => 'does_not_match'))));
- $this->assertTrue($this->run_rules($rules, array_merge($values_base, array('bar' => 'Sample'))));
- $this->assertTrue($this->run_rules($rules, array_merge($values_base, array('bar' => ' sample'))));
-
- $this->assertFalse($this->run_rules($rules, array_merge($values_base, array('bar' => 'sample'))));
- }
-
- public function test_rule_min_length()
- {
- $this->assertTrue($this->form_validation->min_length('12345', '5'));
- $this->assertTrue($this->form_validation->min_length('test', '0'));
-
- $this->assertFalse($this->form_validation->min_length('123', '4'));
- $this->assertFalse($this->form_validation->min_length('should_fail', 'A'));
- $this->assertFalse($this->form_validation->min_length('', '4'));
- }
-
- public function test_rule_max_length()
- {
- $this->assertTrue($this->form_validation->max_length('', '4'));
- $this->assertTrue($this->form_validation->max_length('1234', '4'));
-
- $this->assertFalse($this->form_validation->max_length('12345', '4'));
- $this->assertFalse($this->form_validation->max_length('should_fail', 'A'));
- }
-
- public function test_rule_exact_length()
- {
- $this->assertTrue($this->form_validation->exact_length('1234', '4'));
-
- $this->assertFalse($this->form_validation->exact_length('', '3'));
- $this->assertFalse($this->form_validation->exact_length('12345', '4'));
- $this->assertFalse($this->form_validation->exact_length('123', '4'));
- $this->assertFalse($this->form_validation->exact_length('should_fail', 'A'));
- }
-
- public function test_rule_greater_than()
- {
- $this->assertTrue($this->form_validation->greater_than('-10', '-11'));
- $this->assertTrue($this->form_validation->greater_than('10', '9'));
-
- $this->assertFalse($this->form_validation->greater_than('10', '10'));
- $this->assertFalse($this->form_validation->greater_than('10', 'a'));
- $this->assertFalse($this->form_validation->greater_than('10a', '10'));
- }
-
- public function test_rule_greater_than_equal_to()
- {
- $this->assertTrue($this->form_validation->greater_than_equal_to('0', '0'));
- $this->assertTrue($this->form_validation->greater_than_equal_to('1', '0'));
-
- $this->assertFalse($this->form_validation->greater_than_equal_to('-1', '0'));
- $this->assertFalse($this->form_validation->greater_than_equal_to('10a', '0'));
- }
-
- public function test_rule_less_than()
- {
- $this->assertTrue($this->form_validation->less_than('4', '5'));
- $this->assertTrue($this->form_validation->less_than('-1', '0'));
-
- $this->assertFalse($this->form_validation->less_than('4', '4'));
- $this->assertFalse($this->form_validation->less_than('10a', '5'));
- }
-
- public function test_rule_less_than_equal_to()
- {
- $this->assertTrue($this->form_validation->less_than_equal_to('-1', '0'));
- $this->assertTrue($this->form_validation->less_than_equal_to('-1', '-1'));
- $this->assertTrue($this->form_validation->less_than_equal_to('4', '4'));
-
- $this->assertFalse($this->form_validation->less_than_equal_to('0', '-1'));
- $this->assertFalse($this->form_validation->less_than_equal_to('10a', '0'));
- }
-
- public function test_rule_in_list()
- {
- $this->assertTrue($this->form_validation->in_list('red', 'red,Blue,123'));
- $this->assertTrue($this->form_validation->in_list('Blue', 'red,Blue,123'));
- $this->assertTrue($this->form_validation->in_list('123', 'red,Blue,123'));
-
- $this->assertFalse($this->form_validation->in_list('Red', 'red,Blue,123'));
- $this->assertFalse($this->form_validation->in_list(' red', 'red,Blue,123'));
- $this->assertFalse($this->form_validation->in_list('1234', 'red,Blue,123'));
- }
-
- public function test_rule_alpha()
- {
- $this->assertTrue($this->form_validation->alpha('abcdefghijklmnopqrstuvwxyzABCDEFGHLIJKLMNOPQRSTUVWXYZ'));
-
- $this->assertFalse($this->form_validation->alpha('abcdefghijklmnopqrstuvwxyzABCDEFGHLIJKLMNOPQRSTUVWXYZ '));
- $this->assertFalse($this->form_validation->alpha('abcdefghijklmnopqrstuvwxyzABCDEFGHLIJKLMNOPQRSTUVWXYZ1'));
- $this->assertFalse($this->form_validation->alpha('abcdefghijklmnopqrstuvwxyzABCDEFGHLIJKLMNOPQRSTUVWXYZ*'));
- }
-
- public function test_rule_alpha_numeric()
- {
- $this->assertTrue($this->form_validation->alpha_numeric('abcdefghijklmnopqrstuvwxyzABCDEFGHLIJKLMNOPQRSTUVWXYZ0123456789'));
-
- $this->assertFalse($this->form_validation->alpha_numeric('abcdefghijklmnopqrstuvwxyzABCDEFGHLIJKLMNOPQRSTUVWXYZ0123456789\ '));
- $this->assertFalse($this->form_validation->alpha_numeric('abcdefghijklmnopqrstuvwxyzABCDEFGHLIJKLMNOPQRSTUVWXYZ0123456789_'));
- }
-
- public function test_rule_alpha_numeric_spaces()
- {
- $this->assertTrue($this->form_validation->alpha_numeric_spaces(' abcdefghijklmnopqrstuvwxyzABCDEFGHLIJKLMNOPQRSTUVWXYZ0123456789'));
-
- $this->assertFalse($this->form_validation->alpha_numeric_spaces(' abcdefghijklmnopqrstuvwxyzABCDEFGHLIJKLMNOPQRSTUVWXYZ0123456789_'));
- }
-
- public function test_rule_alpha_dash()
- {
- $this->assertTrue($this->form_validation->alpha_dash('abcdefghijklmnopqrstuvwxyzABCDEFGHLIJKLMNOPQRSTUVWXYZ0123456789-_'));
-
- $this->assertFalse($this->form_validation->alpha_dash('abcdefghijklmnopqrstuvwxyzABCDEFGHLIJKLMNOPQRSTUVWXYZ0123456789-_\ '));
- }
-
- public function test_rule_numeric()
- {
- $this->assertTrue($this->form_validation->numeric('0'));
- $this->assertTrue($this->form_validation->numeric('12314'));
- $this->assertTrue($this->form_validation->numeric('-42'));
-
- $this->assertFalse($this->form_validation->numeric('123a'));
- $this->assertFalse($this->form_validation->numeric('--1'));
- }
-
- public function test_rule_integer()
- {
- $this->assertTrue($this->form_validation->integer('0'));
- $this->assertTrue($this->form_validation->integer('42'));
- $this->assertTrue($this->form_validation->integer('-1'));
-
- $this->assertFalse($this->form_validation->integer('124a'));
- $this->assertFalse($this->form_validation->integer('1.9'));
- $this->assertFalse($this->form_validation->integer('--1'));
- }
-
- public function test_rule_decimal()
- {
- $this->assertTrue($this->form_validation->decimal('1.0'));
- $this->assertTrue($this->form_validation->decimal('-0.98'));
-
- $this->assertFalse($this->form_validation->decimal('0'));
- $this->assertFalse($this->form_validation->decimal('1.0a'));
- $this->assertFalse($this->form_validation->decimal('-i'));
- $this->assertFalse($this->form_validation->decimal('--1'));
- }
-
- public function test_rule_is_natural()
- {
- $this->assertTrue($this->form_validation->is_natural('0'));
- $this->assertTrue($this->form_validation->is_natural('12'));
-
- $this->assertFalse($this->form_validation->is_natural('42a'));
- $this->assertFalse($this->form_validation->is_natural('-1'));
- }
-
- public function test_rule_is_natural_no_zero()
- {
- $this->assertTrue($this->form_validation->is_natural_no_zero('42'));
-
- $this->assertFalse($this->form_validation->is_natural_no_zero('0'));
- $this->assertFalse($this->form_validation->is_natural_no_zero('42a'));
- $this->assertFalse($this->form_validation->is_natural_no_zero('-1'));
- }
-
- public function test_rule_valid_url()
- {
- $this->assertTrue($this->form_validation->valid_url('www.codeigniter.com'));
- $this->assertTrue($this->form_validation->valid_url('http://codeigniter.com'));
-
- // https://bugs.php.net/bug.php?id=51192
- $this->assertTrue($this->form_validation->valid_url('http://accept-dashes.tld'));
- $this->assertFalse($this->form_validation->valid_url('http://reject_underscores.tld'));
-
- // https://github.com/bcit-ci/CodeIgniter/issues/4415
- $this->assertTrue($this->form_validation->valid_url('http://[::1]/ipv6'));
-
- // URI scheme case-sensitivity: https://github.com/bcit-ci/CodeIgniter/pull/4758
- $this->assertTrue($this->form_validation->valid_url('HtTp://127.0.0.1/'));
-
- // https://github.com/bcit-ci/CodeIgniter/issues/5755
- $this->assertFalse($this->form_validation->valid_url('1'));
-
- $this->assertFalse($this->form_validation->valid_url('htt://www.codeIgniter.com'));
- $this->assertFalse($this->form_validation->valid_url(''));
- $this->assertFalse($this->form_validation->valid_url('code igniter'));
- }
-
- public function test_rule_valid_email()
- {
- $this->assertTrue($this->form_validation->valid_email('email@sample.com'));
- $this->assertFalse($this->form_validation->valid_email('email@sample.com foo bar'));
- $this->assertFalse($this->form_validation->valid_email('valid_email', '@sample.com'));
- }
-
- public function test_rule_valid_emails()
- {
- $this->assertTrue($this->form_validation->valid_emails('1@sample.com,2@sample.com'));
- $this->assertTrue($this->form_validation->valid_emails('email@sample.com'));
-
- $this->assertFalse($this->form_validation->valid_emails('valid_email', '@sample.com'));
- $this->assertFalse($this->form_validation->valid_emails('@sample.com,2@sample.com,validemail@email.ca'));
- }
-
- public function test_rule_valid_ip()
- {
- $this->assertTrue($this->form_validation->valid_ip('127.0.0.1'));
- $this->assertTrue($this->form_validation->valid_ip('127.0.0.1', 'ipv4'));
- $this->assertTrue($this->form_validation->valid_ip('2001:0db8:85a3:0000:0000:8a2e:0370:7334'));
- $this->assertTrue($this->form_validation->valid_ip('2001:0db8:85a3:0000:0000:8a2e:0370:7334', 'ipv6'));
-
- $this->assertFalse($this->form_validation->valid_ip('2001:0db8:85a3:0000:0000:8a2e:0370:7334', 'ipv4'));
- $this->assertFalse($this->form_validation->valid_ip('127.0.0.1', 'ipv6'));
- $this->assertFalse($this->form_validation->valid_ip('H001:0db8:85a3:0000:0000:8a2e:0370:7334'));
- $this->assertFalse($this->form_validation->valid_ip('127.0.0.259'));
- }
-
- public function test_rule_valid_base64()
- {
- $this->assertTrue($this->form_validation->valid_base64(base64_encode('string')));
-
- $this->assertFalse($this->form_validation->valid_base64('FA08GG'));
- }
-
- public function test_set_data()
- {
- $data = array('field' => 'some_data');
- $this->form_validation->set_data($data);
- $this->form_validation->set_rules('field', 'label', 'required');
- $this->assertTrue($this->form_validation->run());
-
- // Test with empty array
- $_POST = array();
- $this->form_validation->reset_validation();
- $data = array('field' => 'some_data');
- $this->form_validation->set_data($data);
- // This should do nothing. Old data will still be used
- $this->form_validation->set_data(array());
- $this->form_validation->set_rules('field', 'label', 'required');
- $this->assertTrue($this->form_validation->run());
- }
-
- public function test_set_message()
- {
- $err_message = 'What a terrible error!';
- $rules = array(
- array(
- 'field' => 'req_field',
- 'label' => 'label',
- 'rules' => 'required'
- )
- );
- $errorless_data = array('req_field' => 'some text');
- $erroneous_data = array('req_field' => '');
-
- $this->form_validation->set_message('required', $err_message);
- $this->form_validation->set_data($erroneous_data);
- $this->form_validation->set_rules($rules);
- $this->form_validation->run();
- $this->assertEquals('<p>'.$err_message.'</p>', $this->form_validation->error('req_field'));
-
- $this->form_validation->reset_validation();
- $this->form_validation->set_message('required', $err_message);
- $this->form_validation->set_data($errorless_data);
- $this->form_validation->set_rules($rules);
- $this->form_validation->run();
- $this->assertEquals('', $this->form_validation->error('req_field'));
- }
-
- public function test_set_error_delimiters()
- {
- $prefix = '<div class="error">';
- $suffix = '</div>';
- $this->form_validation->set_error_delimiters($prefix, $suffix);
- $this->form_validation->set_rules('foo', 'label', 'required');
- $_POST = array('foo' => '');
- $this->form_validation->run();
- $error_msg = $this->form_validation->error('foo');
-
- $this->assertStringStartsWith($prefix, $error_msg);
- $this->assertTrue(strrpos($error_msg, $suffix, -strlen($suffix)) === (strlen($error_msg) - strlen($suffix)));
-
- $_POST = array();
- }
-
- public function test_error_array()
- {
- $error_message = 'What a terrible error!';
- $this->form_validation->set_message('required', $error_message);
- $this->form_validation->set_rules('foo', 'label', 'required');
- $_POST = array('foo' => '');
- $this->form_validation->run();
- $error_array = $this->form_validation->error_array();
- $this->assertEquals($error_message, $error_array['foo']);
-
- $_POST = array();
- }
-
- public function test_error_string()
- {
- $error_message = 'What a terrible error!';
- $prefix_default = '<foo>';
- $suffix_default = '</foo>';
- $prefix_test = '<bar>';
- $suffix_test = '</bar>';
- $this->form_validation->set_error_delimiters($prefix_default, $suffix_default);
- $this->form_validation->set_message('required', $error_message);
- $this->form_validation->set_rules('foo', 'label', 'required');
- $_POST = array('foo' => '');
- $this->form_validation->run();
-
- $this->assertEquals($prefix_default.$error_message.$suffix_default."\n", $this->form_validation->error_string());
- $this->assertEquals($prefix_test.$error_message.$suffix_default."\n", $this->form_validation->error_string($prefix_test, ''));
- $this->assertEquals($prefix_default.$error_message.$suffix_test."\n", $this->form_validation->error_string('', $suffix_test));
- $this->assertEquals($prefix_test.$error_message.$suffix_test."\n", $this->form_validation->error_string($prefix_test, $suffix_test));
-
- $this->form_validation->reset_validation();
- $this->form_validation->set_rules('foo', 'label', 'required');
- $_POST = array('foo' => 'bar');
- $this->form_validation->run();
- $this->assertEquals('', $this->form_validation->error_string());
-
- $_POST = array();
- }
-
- public function test_run()
- {
- // form_validation->run() is tested in many of the other unit tests
- // This test will only test run(group='') when group is not empty
- $config = array(
- 'pass' => array(
- array(
- 'field' => 'username',
- 'label' => 'user',
- 'rules' => 'alpha_numeric'
- )
- ),
- 'fail' => array(
- array(
- 'field' => 'username',
- 'label' => 'user',
- 'rules' => 'alpha'
- )
- )
- );
- $_POST = array('username' => 'foo42');
- $form_validation = new CI_Form_validation($config);
- $this->assertTrue($form_validation->run('pass'));
-
- $form_validation = new CI_Form_validation($config);
- $this->assertFalse($form_validation->run('fail'));
-
- $_POST = array();
- }
-
- public function test_has_rule()
- {
- $this->form_validation->set_rules('foo', 'label', 'required');
-
- $this->assertTrue($this->form_validation->has_rule('foo'));
- $this->assertFalse($this->form_validation->has_rule('bar'));
- }
-
- public function test_set_value()
- {
- $default = 'default';
- $this->form_validation->set_rules('foo', 'label', 'required');
- $this->form_validation->set_rules('bar[]', 'label', 'required');
-
- // No post data yet: should return the default value provided
- $this->assertEquals($default, $this->form_validation->set_value('foo', $default));
- $_POST = array('foo' => 'foo', 'bar' => array('bar1', 'bar2'));
- $this->form_validation->run();
- $this->assertEquals('foo', $this->form_validation->set_value('foo', $default));
- $this->assertEquals('bar1', $this->form_validation->set_value('bar[]', $default));
- $this->assertEquals('bar2', $this->form_validation->set_value('bar[]', $default));
-
- $_POST = array();
- }
-
- public function test_set_select()
- {
- // Test 1: No options selected
- $this->form_validation->run();
-
- $this->assertEquals('', $this->form_validation->set_select('select', 'foo'));
- $this->assertEquals(' selected="selected"', $this->form_validation->set_select('select', 'bar', TRUE));
-
- // Test 2: 1 option selected
- $this->form_validation->reset_validation();
- $this->form_validation->set_rules('select', 'label', 'alpha_numeric');
- $_POST = array('select' => 'foo');
- $this->form_validation->run();
-
- $this->assertEquals(' selected="selected"', $this->form_validation->set_select('select', 'foo'));
- $this->assertEquals(' selected="selected"', $this->form_validation->set_select('select', 'foo', TRUE));
- $this->assertEquals('', $this->form_validation->set_select('select', 'bar'));
- $this->assertEquals('', $this->form_validation->set_select('select', 'bar', TRUE));
-
- // Test 3: Multiple options selected
- $this->form_validation->reset_validation();
- $this->form_validation->set_rules('select[]', 'label', 'alpha_numeric');
- $_POST = array('select' => array('foo', 'bar'));
- $this->form_validation->run();
-
- $this->assertEquals(' selected="selected"', $this->form_validation->set_select('select[]', 'foo'));
- $this->assertEquals(' selected="selected"', $this->form_validation->set_select('select[]', 'foo', TRUE));
- $this->assertEquals(' selected="selected"', $this->form_validation->set_select('select[]', 'bar'));
- $this->assertEquals(' selected="selected"', $this->form_validation->set_select('select[]', 'bar', TRUE));
- $this->assertEquals('', $this->form_validation->set_select('select[]', 'foobar'));
- $this->assertEquals('', $this->form_validation->set_select('select[]', 'foobar', TRUE));
-
- $_POST = array();
- }
-
- public function test_set_radio()
- {
- // Test 1: No options selected
- $this->form_validation->run();
-
- $this->assertEquals('', $this->form_validation->set_radio('select', 'foo'));
- // Default should only work when no rules are set
- $this->assertEquals(' checked="checked"', $this->form_validation->set_radio('select', 'bar', TRUE));
-
- // Test 2: 1 option selected
- $this->form_validation->reset_validation();
- $this->form_validation->set_rules('select', 'label', 'alpha_numeric');
- $_POST = array('select' => 'foo');
- $this->form_validation->run();
-
- $this->assertEquals(' checked="checked"', $this->form_validation->set_radio('select', 'foo'));
- $this->assertEquals(' checked="checked"', $this->form_validation->set_radio('select', 'foo', TRUE));
- $this->assertEquals('', $this->form_validation->set_radio('select', 'bar'));
- $this->assertEquals('', $this->form_validation->set_radio('select', 'bar', TRUE));
-
- // Test 3: Multiple options checked
- $this->form_validation->reset_validation();
- $this->form_validation->set_rules('select[]', 'label', 'alpha_numeric');
- $_POST = array('select' => array('foo', 'bar'));
- $this->form_validation->run();
-
- $this->assertEquals(' checked="checked"', $this->form_validation->set_radio('select[]', 'foo'));
- $this->assertEquals(' checked="checked"', $this->form_validation->set_radio('select[]', 'foo', TRUE));
- $this->assertEquals(' checked="checked"', $this->form_validation->set_radio('select[]', 'bar'));
- $this->assertEquals(' checked="checked"', $this->form_validation->set_radio('select[]', 'bar', TRUE));
- $this->assertEquals('', $this->form_validation->set_radio('select[]', 'foobar'));
- $this->assertEquals('', $this->form_validation->set_radio('select[]', 'foobar', TRUE));
-
- $_POST = array();
- }
-
- public function test_set_checkbox()
- {
- // Test 1: No options selected
- $this->form_validation->run();
-
- $this->assertEquals('', $this->form_validation->set_checkbox('select', 'foo'));
- $this->assertEquals(' checked="checked"', $this->form_validation->set_checkbox('select', 'bar', TRUE));
-
- // Test 2: 1 option selected
- $this->form_validation->reset_validation();
- $this->form_validation->set_rules('select', 'label', 'alpha_numeric');
- $_POST = array('select' => 'foo');
- $this->form_validation->run();
-
- $this->assertEquals(' checked="checked"', $this->form_validation->set_checkbox('select', 'foo'));
- $this->assertEquals(' checked="checked"', $this->form_validation->set_checkbox('select', 'foo', TRUE));
- $this->assertEquals('', $this->form_validation->set_checkbox('select', 'bar'));
- $this->assertEquals('', $this->form_validation->set_checkbox('select', 'bar', TRUE));
-
- // Test 3: Multiple options selected
- $this->form_validation->reset_validation();
- $this->form_validation->set_rules('select[]', 'label', 'alpha_numeric');
- $_POST = array('select' => array('foo', 'bar'));
- $this->form_validation->run();
-
- $this->assertEquals(' checked="checked"', $this->form_validation->set_checkbox('select[]', 'foo'));
- $this->assertEquals(' checked="checked"', $this->form_validation->set_checkbox('select[]', 'foo', TRUE));
- $this->assertEquals(' checked="checked"', $this->form_validation->set_checkbox('select[]', 'bar'));
- $this->assertEquals(' checked="checked"', $this->form_validation->set_checkbox('select[]', 'bar', TRUE));
- $this->assertEquals('', $this->form_validation->set_checkbox('select[]', 'foobar'));
- $this->assertEquals('', $this->form_validation->set_checkbox('select[]', 'foobar', TRUE));
-
- $_POST = array();
- }
-
- public function test_regex_match()
- {
- $regex = '/f[a-zA-Z]+/';
- $this->assertTrue($this->form_validation->regex_match('foo', $regex));
- $this->assertFalse($this->form_validation->regex_match('bar', $regex));
- }
-
- public function test_prep_for_form()
- {
- $this->form_validation->reset_validation();
- $error_msg_unprepped = '<error =\'foobar\'">';
- $error_msg_prepped = '&lt;error =&#39;foobar&#39;&quot;&gt;';
- $this->form_validation->set_rules('foo', 'label', 'required', array('required' => $error_msg_unprepped));
- $_POST = array('foo' => '');
- $this->form_validation->run();
- $error_arr = $this->form_validation->error_array();
-
- $this->assertEquals('', $this->form_validation->prep_for_form(''));
- $this->assertEquals(array('foo' => $error_msg_prepped), $this->form_validation->prep_for_form($error_arr));
- }
-
- public function test_prep_url()
- {
- $this->assertEquals('', $this->form_validation->prep_url(''));
- $this->assertEquals('http://codeigniter.com', $this->form_validation->prep_url('codeigniter.com'));
- $this->assertEquals('https://codeigniter.com', $this->form_validation->prep_url('https://codeigniter.com'));
- $this->assertEquals('http://codeigniter.com', $this->form_validation->prep_url('http://codeigniter.com'));
- $this->assertEquals('http://www.codeigniter.com', $this->form_validation->prep_url('www.codeigniter.com'));
- }
-
- public function test_encode_php_tags()
- {
- $this->assertEquals("&lt;?php", $this->form_validation->encode_php_tags('<?php'));
- $this->assertEquals('?&gt;', $this->form_validation->encode_php_tags('?>'));
- }
-
- /**
- * Run rules
- *
- * Helper method to set rules and run them at once, not
- * an actual test case.
- */
- public function run_rules($rules, $values)
- {
- $this->form_validation->reset_validation();
- $_POST = array();
- $this->form_validation->set_rules($rules);
-
- foreach ($values as $field => $value)
- {
- $_POST[$field] = $value;
- }
-
- $valid = $this->form_validation->run();
- $_POST = array();
-
- return $valid;
- }
-}
diff --git a/tests/codeigniter/libraries/Parser_test.php b/tests/codeigniter/libraries/Parser_test.php
deleted file mode 100644
index 2a2348793..000000000
--- a/tests/codeigniter/libraries/Parser_test.php
+++ /dev/null
@@ -1,95 +0,0 @@
-<?php
-
-class Parser_test extends CI_TestCase {
-
- public function set_up()
- {
- $this->parser = new CI_Parser();
- $this->ci_instance_var('parser', $this->parser);
- }
-
- // --------------------------------------------------------------------
-
- public function test_set_delimiters()
- {
- // Make sure default delimiters are there
- $this->assertEquals('{', $this->parser->l_delim);
- $this->assertEquals('}', $this->parser->r_delim);
-
- // Change them to square brackets
- $this->parser->set_delimiters('[', ']');
-
- // Make sure they changed
- $this->assertEquals('[', $this->parser->l_delim);
- $this->assertEquals(']', $this->parser->r_delim);
-
- // Reset them
- $this->parser->set_delimiters();
-
- // Make sure default delimiters are there
- $this->assertEquals('{', $this->parser->l_delim);
- $this->assertEquals('}', $this->parser->r_delim);
- }
-
- // --------------------------------------------------------------------
-
- public function test_parse_string()
- {
- $data = array(
- 'title' => 'Page Title',
- 'body' => 'Lorem ipsum dolor sit amet.'
- );
-
- $template = "{title}\n{body}";
-
- $result = implode("\n", $data);
-
- $this->assertEquals($result, $this->parser->parse_string($template, $data, TRUE));
- }
-
- // --------------------------------------------------------------------
-
- public function test_parse()
- {
- $this->_parse_no_template();
- $this->_parse_var_pair();
- $this->_mismatched_var_pair();
- }
-
- // --------------------------------------------------------------------
-
- private function _parse_no_template()
- {
- $this->assertFalse($this->parser->parse_string('', '', TRUE));
- }
-
- // --------------------------------------------------------------------
-
- private function _parse_var_pair()
- {
- $data = array(
- 'title' => 'Super Heroes',
- 'powers' => array(array('invisibility' => 'yes', 'flying' => 'no'))
- );
-
- $template = "{title}\n{powers}{invisibility}\n{flying}{/powers}\nsecond:{powers} {invisibility} {flying}{/powers}";
-
- $this->assertEquals("Super Heroes\nyes\nno\nsecond: yes no", $this->parser->parse_string($template, $data, TRUE));
- }
-
- // --------------------------------------------------------------------
-
- private function _mismatched_var_pair()
- {
- $data = array(
- 'title' => 'Super Heroes',
- 'powers' => array(array('invisibility' => 'yes', 'flying' => 'no'))
- );
-
- $template = "{title}\n{powers}{invisibility}\n{flying}";
- $result = "Super Heroes\n{powers}{invisibility}\n{flying}";
-
- $this->assertEquals($result, $this->parser->parse_string($template, $data, TRUE));
- }
-
-} \ No newline at end of file
diff --git a/tests/codeigniter/libraries/Session_test.php b/tests/codeigniter/libraries/Session_test.php
deleted file mode 100644
index 76a4fcc98..000000000
--- a/tests/codeigniter/libraries/Session_test.php
+++ /dev/null
@@ -1,440 +0,0 @@
-<?php
-
-/**
- * Session driver library unit test
- */
-class Session_test extends CI_TestCase {
-
- protected $settings = array(
- 'use_cookies' => 0,
- 'use_only_cookies' => 0,
- 'cache_limiter' => FALSE
- );
- protected $setting_vals = array();
- protected $cookie_vals;
- protected $session;
-
- /**
- * Set up test framework
- */
- public function set_up()
- {
-return;
- // Override settings
- foreach ($this->settings as $name => $value) {
- $this->setting_vals[$name] = ini_get('session.'.$name);
- ini_set('session.'.$name, $value);
- }
-
- // Start with clean environment
- $this->cookie_vals = $_COOKIE;
- $_COOKIE = array();
-
- // Set subclass prefix to match our mock
- $this->ci_set_config('subclass_prefix', 'Mock_Libraries_');
-
- // Establish necessary support classes
- $ci = $this->ci_instance();
- $ldr = $this->ci_core_class('load');
- $ci->load = new $ldr();
- $ci->input = new Mock_Core_Input(NULL, NULL);
-
- // Make sure string helper is available
- $this->ci_vfs_clone('system/helpers/string_helper.php');
-
- // Attach session instance locally
- $config = array(
- 'sess_encrypt_cookie' => FALSE,
- 'sess_use_database' => FALSE,
- 'sess_table_name' => '',
- 'sess_expiration' => 7200,
- 'sess_expire_on_close' => FALSE,
- 'sess_match_ip' => FALSE,
- 'sess_match_useragent' => TRUE,
- 'sess_cookie_name' => 'ci_session',
- 'cookie_path' => '',
- 'cookie_domain' => '',
- 'cookie_secure' => FALSE,
- 'cookie_httponly' => FALSE,
- 'sess_time_to_update' => 300,
- 'time_reference' => 'local',
- 'cookie_prefix' => '',
- 'encryption_key' => 'foobar'
- );
- $this->session = new Mock_Libraries_Session($config);
- }
-
- /**
- * Tear down test framework
- */
- public function tear_down()
- {
-return;
- // Restore environment
- if (session_id()) session_destroy();
- $_SESSION = array();
- $_COOKIE = $this->cookie_vals;
-
- // Restore settings
- foreach ($this->settings as $name => $value) {
- ini_set('session.'.$name, $this->setting_vals[$name]);
- }
- }
-
- /**
- * Test set_userdata() function
- */
- public function test_set_userdata()
- {
-return;
- // Set userdata values for each driver
- $key1 = 'test1';
- $ckey2 = 'test2';
- $nkey2 = 'test3';
- $cmsg1 = 'Some test data';
- $cmsg2 = 42;
- $nmsg1 = 'Other test data';
- $nmsg2 = TRUE;
- $this->session->cookie->set_userdata($key1, $cmsg1);
- $this->session->set_userdata($ckey2, $cmsg2);
- $this->session->native->set_userdata($key1, $nmsg1);
- $this->session->set_userdata($nkey2, $nmsg2);
-
- // Verify independent messages
- $this->assertEquals($cmsg1, $this->session->cookie->userdata($key1));
- $this->assertEquals($nmsg1, $this->session->native->userdata($key1));
-
- // Verify pre-selected driver sets
- $this->assertEquals($cmsg2, $this->session->cookie->userdata($ckey2));
- $this->assertEquals($nmsg2, $this->session->native->userdata($nkey2));
-
- // Verify no crossover
- $this->assertNull($this->session->cookie->userdata($nkey2));
- $this->assertNull($this->session->native->userdata($ckey2));
- }
-
- /**
- * Test the has_userdata() function
- */
- public function test_has_userdata()
- {
-return;
- // Set a userdata value for each driver
- $key = 'hastest';
- $cmsg = 'My test data';
- $this->session->cookie->set_userdata($key, $cmsg);
- $nmsg = 'Your test data';
- $this->session->native->set_userdata($key, $nmsg);
-
- // Verify values exist
- $this->assertTrue($this->session->cookie->has_userdata($key));
- $this->assertTrue($this->session->native->has_userdata($key));
-
- // Verify non-existent values
- $nokey = 'hasnot';
- $this->assertFalse($this->session->cookie->has_userdata($nokey));
- $this->assertFalse($this->session->native->has_userdata($nokey));
- }
-
- /**
- * Test the all_userdata() function
- */
- public function test_all_userdata()
- {
-return;
- // Set a specific series of data for each driver
- $cdata = array(
- 'one' => 'first',
- 'two' => 'second',
- 'three' => 'third',
- 'foo' => 'bar',
- 'bar' => 'baz'
- );
- $ndata = array(
- 'one' => 'gold',
- 'two' => 'silver',
- 'three' => 'bronze',
- 'foo' => 'baz',
- 'bar' => 'foo'
- );
- $this->session->cookie->set_userdata($cdata);
- $this->session->native->set_userdata($ndata);
-
- // Make sure all values are present
- $call = $this->session->cookie->userdata();
- foreach ($cdata as $key => $value) {
- $this->assertEquals($value, $call[$key]);
- }
- $nall = $this->session->native->userdata();
- foreach ($ndata as $key => $value) {
- $this->assertEquals($value, $nall[$key]);
- }
- }
-
- /**
- * Test the unset_userdata() function
- */
- public function test_unset_userdata()
- {
-return;
- // Set a userdata message for each driver
- $key = 'untest';
- $cmsg = 'Other test data';
- $this->session->cookie->set_userdata($key, $cmsg);
- $nmsg = 'Sundry test data';
- $this->session->native->set_userdata($key, $nmsg);
-
- // Verify independent messages
- $this->assertEquals($this->session->cookie->userdata($key), $cmsg);
- $this->assertEquals($this->session->native->userdata($key), $nmsg);
-
- // Unset them and verify absence
- $this->session->cookie->unset_userdata($key);
- $this->session->native->unset_userdata($key);
- $this->assertNull($this->session->cookie->userdata($key));
- $this->assertNull($this->session->native->userdata($key));
- }
-
- /**
- * Test the flashdata() functions
- */
- public function test_flashdata()
- {
-return;
- // Set flashdata message for each driver
- $key = 'fltest';
- $cmsg = 'Some flash data';
- $this->session->cookie->set_flashdata($key, $cmsg);
- $nmsg = 'Other flash data';
- $this->session->native->set_flashdata($key, $nmsg);
-
- // Simulate page reload
- $this->session->cookie->reload();
- $this->session->native->reload();
-
- // Verify independent messages
- $this->assertEquals($cmsg, $this->session->cookie->flashdata($key));
- $this->assertEquals($nmsg, $this->session->native->flashdata($key));
-
- // Simulate next page reload
- $this->session->cookie->reload();
- $this->session->native->reload();
-
- // Verify absence of messages
- $this->assertNull($this->session->cookie->flashdata($key));
- $this->assertNull($this->session->native->flashdata($key));
- }
-
- /**
- * Test the keep_flashdata() function
- */
- public function test_keep_flashdata()
- {
-return;
- // Set flashdata message for each driver
- $key = 'kfltest';
- $cmsg = 'My flash data';
- $this->session->cookie->set_flashdata($key, $cmsg);
- $nmsg = 'Your flash data';
- $this->session->native->set_flashdata($key, $nmsg);
-
- // Simulate page reload and verify independent messages
- $this->session->cookie->reload();
- $this->session->native->reload();
- $this->assertEquals($cmsg, $this->session->cookie->flashdata($key));
- $this->assertEquals($nmsg, $this->session->native->flashdata($key));
-
- // Keep messages
- $this->session->cookie->keep_flashdata($key);
- $this->session->native->keep_flashdata($key);
-
- // Simulate next page reload and verify message persistence
- $this->session->cookie->reload();
- $this->session->native->reload();
- $this->assertEquals($cmsg, $this->session->cookie->flashdata($key));
- $this->assertEquals($nmsg, $this->session->native->flashdata($key));
-
- // Simulate next page reload and verify absence of messages
- $this->session->cookie->reload();
- $this->session->native->reload();
- $this->assertNull($this->session->cookie->flashdata($key));
- $this->assertNull($this->session->native->flashdata($key));
- }
-
- public function test_keep_flashdata_with_array()
- {
-return;
- // Set flashdata array for each driver
- $cdata = array(
- 'one' => 'first',
- 'two' => 'second',
- 'three' => 'third',
- 'foo' => 'bar',
- 'bar' => 'baz'
- );
- $ndata = array(
- 'one' => 'gold',
- 'two' => 'silver',
- 'three' => 'bronze',
- 'foo' => 'baz',
- 'bar' => 'foo'
- );
- $kdata = array(
- 'one',
- 'two',
- 'three',
- 'foo',
- 'bar'
- );
- $this->session->cookie->set_flashdata($cdata);
- $this->session->native->set_flashdata($ndata);
-
- // Simulate page reload and verify independent messages
- $this->session->cookie->reload();
- $this->session->native->reload();
- $this->assertEquals($cdata, $this->session->cookie->flashdata());
- $this->assertEquals($ndata, $this->session->native->flashdata());
-
- // Keep messages
- $this->session->cookie->keep_flashdata($kdata);
- $this->session->native->keep_flashdata($kdata);
-
- // Simulate next page reload and verify message persistence
- $this->session->cookie->reload();
- $this->session->native->reload();
- $this->assertEquals($cdata, $this->session->cookie->flashdata());
- $this->assertEquals($ndata, $this->session->native->flashdata());
-
- // Simulate next page reload and verify absence of messages
- $this->session->cookie->reload();
- $this->session->native->reload();
- $this->assertEmpty($this->session->cookie->flashdata());
- $this->assertEmpty($this->session->native->flashdata());
- }
-
- /**
- * Test the all_flashdata() function
- */
- public function test_all_flashdata()
- {
-return;
- // Set a specific series of data for each driver
- $cdata = array(
- 'one' => 'first',
- 'two' => 'second',
- 'three' => 'third',
- 'foo' => 'bar',
- 'bar' => 'baz'
- );
- $ndata = array(
- 'one' => 'gold',
- 'two' => 'silver',
- 'three' => 'bronze',
- 'foo' => 'baz',
- 'bar' => 'foo'
- );
- $this->session->cookie->set_flashdata($cdata);
- $this->session->native->set_flashdata($ndata);
-
- // Simulate page reload and make sure all values are present
- $this->session->cookie->reload();
- $this->session->native->reload();
- $this->assertEquals($cdata, $this->session->cookie->flashdata());
- $this->assertEquals($ndata, $this->session->native->flashdata());
- }
-
- /**
- * Test the tempdata() functions
- */
- public function test_set_tempdata()
- {
-return;
- // Set tempdata message for each driver - 1 second timeout
- $key = 'tmptest';
- $cmsg = 'Some temp data';
- $this->session->cookie->set_tempdata($key, $cmsg, 1);
- $nmsg = 'Other temp data';
- $this->session->native->set_tempdata($key, $nmsg, 1);
-
- // Simulate page reload and verify independent messages
- $this->session->cookie->reload();
- $this->session->native->reload();
- $this->assertEquals($cmsg, $this->session->cookie->tempdata($key));
- $this->assertEquals($nmsg, $this->session->native->tempdata($key));
-
- // Wait 2 seconds, simulate page reload and verify message absence
- sleep(2);
- $this->session->cookie->reload();
- $this->session->native->reload();
- $this->assertNull($this->session->cookie->tempdata($key));
- $this->assertNull($this->session->native->tempdata($key));
- }
-
- /**
- * Test the unset_tempdata() function
- */
- public function test_unset_tempdata()
- {
-return;
- // Set tempdata message for each driver - 1 second timeout
- $key = 'utmptest';
- $cmsg = 'My temp data';
- $this->session->cookie->set_tempdata($key, $cmsg, 1);
- $nmsg = 'Your temp data';
- $this->session->native->set_tempdata($key, $nmsg, 1);
-
- // Verify independent messages
- $this->assertEquals($cmsg, $this->session->cookie->tempdata($key));
- $this->assertEquals($nmsg, $this->session->native->tempdata($key));
-
- // Unset data and verify message absence
- $this->session->cookie->unset_tempdata($key);
- $this->session->native->unset_tempdata($key);
- $this->assertNull($this->session->cookie->tempdata($key));
- $this->assertNull($this->session->native->tempdata($key));
- }
-
- /**
- * Test the sess_regenerate() function
- */
- public function test_sess_regenerate()
- {
-return;
- // Get current session id, regenerate, and compare
- // Cookie driver
- $oldid = $this->session->cookie->userdata('session_id');
- $this->session->cookie->sess_regenerate();
- $newid = $this->session->cookie->userdata('session_id');
- $this->assertNotEquals($oldid, $newid);
-
- // Native driver - bug #55267 (https://bugs.php.net/bug.php?id=55267) prevents testing this
- // $oldid = session_id();
- // $this->session->native->sess_regenerate();
- // $oldid = session_id();
- // $this->assertNotEquals($oldid, $newid);
- }
-
- /**
- * Test the sess_destroy() function
- */
- public function test_sess_destroy()
- {
-return;
- // Set a userdata message, destroy session, and verify absence
- $key = 'dsttest';
- $msg = 'More test data';
-
- // Cookie driver
- $this->session->cookie->set_userdata($key, $msg);
- $this->assertEquals($msg, $this->session->cookie->userdata($key));
- $this->session->cookie->sess_destroy();
- $this->assertNull($this->session->cookie->userdata($key));
-
- // Native driver
- $this->session->native->set_userdata($key, $msg);
- $this->assertEquals($msg, $this->session->native->userdata($key));
- $this->session->native->sess_destroy();
- $this->assertNull($this->session->native->userdata($key));
- }
-
-} \ No newline at end of file
diff --git a/tests/codeigniter/libraries/Table_test.php b/tests/codeigniter/libraries/Table_test.php
deleted file mode 100644
index 6efae5d18..000000000
--- a/tests/codeigniter/libraries/Table_test.php
+++ /dev/null
@@ -1,300 +0,0 @@
-<?php
-
-class Table_test extends CI_TestCase {
-
- public function set_up()
- {
- $this->table = new Mock_Libraries_Table();
- $this->ci_instance_var('table', $this->table);
- }
-
- // Setter Methods
- // --------------------------------------------------------------------
-
- public function test_set_template()
- {
- $this->assertFalse($this->table->set_template('not an array'));
-
- $template = array('a' => 'b');
-
- $this->table->set_template($template);
- $this->assertEquals($template, $this->table->template);
- }
-
- public function test_set_empty()
- {
- $this->table->set_empty('nada');
- $this->assertEquals('nada', $this->table->empty_cells);
- }
-
- public function test_set_caption()
- {
- $this->table->set_caption('awesome cap');
- $this->assertEquals('awesome cap', $this->table->caption);
- }
-
- /*
- * @depends test_prep_args
- */
- public function test_set_heading()
- {
- // uses _prep_args internally, so we'll just do a quick
- // check to verify that func_get_args and prep_args are
- // being called.
-
- $this->table->set_heading('name', 'color', 'size');
-
- $this->assertEquals(
- array(
- array('data' => 'name'),
- array('data' => 'color'),
- array('data' => 'size')
- ),
- $this->table->heading
- );
- }
-
- /*
- * @depends test_prep_args
- */
- public function test_add_row()
- {
- // uses _prep_args internally, so we'll just do a quick
- // check to verify that func_get_args and prep_args are
- // being called.
-
- $this->table->add_row('my', 'pony', 'sings');
- $this->table->add_row('your', 'pony', 'stinks');
- $this->table->add_row('my pony', '>', 'your pony');
-
- $this->assertCount(3, $this->table->rows);
-
- $this->assertEquals(
- array(
- array('data' => 'your'),
- array('data' => 'pony'),
- array('data' => 'stinks')
- ),
- $this->table->rows[1]
- );
- }
-
- // Uility Methods
- // --------------------------------------------------------------------
-
- public function test_prep_args()
- {
- $expected = array(
- array('data' => 'name'),
- array('data' => 'color'),
- array('data' => 'size')
- );
-
- $this->assertEquals(
- $expected,
- $this->table->prep_args(array('name', 'color', 'size'))
- );
-
- // with cell attributes
- // need to add that new argument row to our expected outcome
- $expected[] = array('data' => 'weight', 'class' => 'awesome');
-
- $this->assertEquals(
- $expected,
- $this->table->prep_args(array('name', 'color', 'size', array('data' => 'weight', 'class' => 'awesome')))
- );
- }
-
- public function test_default_template_keys()
- {
- $keys = array(
- 'table_open',
- 'thead_open', 'thead_close',
- 'heading_row_start', 'heading_row_end', 'heading_cell_start', 'heading_cell_end',
- 'tbody_open', 'tbody_close',
- 'row_start', 'row_end', 'cell_start', 'cell_end',
- 'row_alt_start', 'row_alt_end', 'cell_alt_start', 'cell_alt_end',
- 'table_close'
- );
-
- foreach ($keys as $key)
- {
- $this->assertArrayHasKey($key, $this->table->default_template());
- }
- }
-
- public function test_compile_template()
- {
- $this->assertFalse($this->table->set_template('invalid_junk'));
-
- // non default key
- $this->table->set_template(array('nonsense' => 'foo'));
- $this->table->compile_template();
-
- $this->assertArrayHasKey('nonsense', $this->table->template);
- $this->assertEquals('foo', $this->table->template['nonsense']);
-
- // override default
- $this->table->set_template(array('table_close' => '</table junk>'));
- $this->table->compile_template();
-
- $this->assertArrayHasKey('table_close', $this->table->template);
- $this->assertEquals('</table junk>', $this->table->template['table_close']);
- }
-
- public function test_make_columns()
- {
- // Test bogus parameters
- $this->assertFalse($this->table->make_columns('invalid_junk'));
- $this->assertFalse($this->table->make_columns(array()));
- $this->assertFalse($this->table->make_columns(array('one', 'two'), '2.5'));
-
- // Now on to the actual column creation
-
- $five_values = array(
- 'Laura', 'Red', '15',
- 'Katie', 'Blue'
- );
-
- // No column count - no changes to the array
- $this->assertEquals(
- $five_values,
- $this->table->make_columns($five_values)
- );
-
- // Column count of 3 leaves us with one &nbsp;
- $this->assertEquals(
- array(
- array('Laura', 'Red', '15'),
- array('Katie', 'Blue', '&nbsp;')
- ),
- $this->table->make_columns($five_values, 3)
- );
- }
-
- public function test_clear()
- {
- $this->table->set_heading('Name', 'Color', 'Size');
-
- // Make columns changes auto_heading
- $rows = $this->table->make_columns(array(
- 'Laura', 'Red', '15',
- 'Katie', 'Blue'
- ), 3);
-
- foreach ($rows as $row)
- {
- $this->table->add_row($row);
- }
-
- $this->assertFalse($this->table->auto_heading);
- $this->assertCount(3, $this->table->heading);
- $this->assertCount(2, $this->table->rows);
-
- $this->table->clear();
-
- $this->assertTrue($this->table->auto_heading);
- $this->assertEmpty($this->table->heading);
- $this->assertEmpty($this->table->rows);
- }
-
- public function test_set_from_array()
- {
- $data = array(
- array('name', 'color', 'number'),
- array('Laura', 'Red', '22'),
- array('Katie', 'Blue')
- );
-
- $this->table->auto_heading = FALSE;
- $this->table->set_from_array($data);
- $this->assertEmpty($this->table->heading);
-
- $this->table->clear();
-
- $this->table->set_from_array($data);
- $this->assertCount(2, $this->table->rows);
-
- $expected = array(
- array('data' => 'name'),
- array('data' => 'color'),
- array('data' => 'number')
- );
-
- $this->assertEquals($expected, $this->table->heading);
-
- $expected = array(
- array('data' => 'Katie'),
- array('data' => 'Blue'),
- );
-
- $this->assertEquals($expected, $this->table->rows[1]);
- }
-
- public function test_set_from_object()
- {
- // This needs to be passed by reference to CI_DB_result::__construct()
- $dummy = new stdClass();
- $dummy->conn_id = NULL;
- $dummy->result_id = NULL;
-
- $db_result = new DB_result_dummy($dummy);
-
- $this->table->set_from_db_result($db_result);
-
- $expected = array(
- array('data' => 'name'),
- array('data' => 'email')
- );
-
- $this->assertEquals($expected, $this->table->heading);
-
- $expected = array(
- 'name' => array('data' => 'Foo Bar'),
- 'email' => array('data' => 'foo@bar.com'),
- );
-
- $this->assertEquals($expected, $this->table->rows[1]);
- }
-
- public function test_generate()
- {
- // Prepare the data
- $data = array(
- array('Name', 'Color', 'Size'),
- array('Fred', 'Blue', 'Small'),
- array('Mary', 'Red', 'Large'),
- array('John', 'Green', 'Medium')
- );
-
- $table = $this->table->generate($data);
-
- // Test the table header
- $this->assertEquals(1, substr_count($table, '<th>Name</th>'));
- $this->assertEquals(1, substr_count($table, '<th>Color</th>'));
- $this->assertEquals(1, substr_count($table, '<th>Size</th>'));
-
- // Test the first entry
- $this->assertEquals(1, substr_count($table, '<td>Fred</td>'));
- $this->assertEquals(1, substr_count($table, '<td>Blue</td>'));
- $this->assertEquals(1, substr_count($table, '<td>Small</td>'));
- }
-
-}
-
-// We need this for the _set_from_db_result() test
-class DB_result_dummy extends CI_DB_result
-{
- public function list_fields()
- {
- return array('name', 'email');
- }
-
- public function result_array()
- {
- return array(
- array('name' => 'John Doe', 'email' => 'john@doe.com'),
- array('name' => 'Foo Bar', 'email' => 'foo@bar.com')
- );
- }
-}
diff --git a/tests/codeigniter/libraries/Typography_test.php b/tests/codeigniter/libraries/Typography_test.php
deleted file mode 100644
index e6ee7b05c..000000000
--- a/tests/codeigniter/libraries/Typography_test.php
+++ /dev/null
@@ -1,182 +0,0 @@
-<?php
-
-class Typography_test extends CI_TestCase {
-
- public function set_up()
- {
- $this->type = new CI_Typography();
- $this->ci_instance('type', $this->type);
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Tests the format_characters() function.
- *
- * this can and should grow.
- */
- public function test_format_characters()
- {
- $strs = array(
- '"double quotes"' => '&#8220;double quotes&#8221;',
- '"testing" in "theory" that is' => '&#8220;testing&#8221; in &#8220;theory&#8221; that is',
- "Here's what I'm" => 'Here&#8217;s what I&#8217;m',
- '&' => '&amp;',
- '&amp;' => '&amp;',
- '&nbsp;' => '&nbsp;',
- '--' => '&#8212;',
- 'foo...' => 'foo&#8230;',
- 'foo..' => 'foo..',
- 'foo...bar.' => 'foo&#8230;bar.',
- 'test. new' => 'test.&nbsp; new',
- );
-
- foreach ($strs as $str => $expected)
- {
- $this->assertEquals($expected, $this->type->format_characters($str));
- }
- }
-
- // --------------------------------------------------------------------
-
- public function test_nl2br_except_pre()
- {
- $str = <<<EOH
-Hello, I'm a happy string with some new lines.
-
-I like to skip.
-
-Jump
-
-and sing.
-
-<pre>
-I am inside a pre tag. Please don't mess with me.
-
-k?
-</pre>
-
-That's my story and I'm sticking to it.
-
-The End.
-EOH;
-
- $expected = <<<EOH
-Hello, I'm a happy string with some new lines. <br />
-<br />
-I like to skip.<br />
-<br />
-Jump<br />
-<br />
-and sing.<br />
-<br />
-<pre>
-I am inside a pre tag. Please don't mess with me.
-
-k?
-</pre><br />
-<br />
-That's my story and I'm sticking to it.<br />
-<br />
-The End.
-EOH;
-
- $this->assertEquals($expected, $this->type->nl2br_except_pre($str));
- }
-
- // --------------------------------------------------------------------
-
- public function test_auto_typography()
- {
- $this->_blank_string();
- $this->_standardize_new_lines();
- $this->_reduce_linebreaks();
- $this->_remove_comments();
- $this->_protect_pre();
- $this->_no_opening_block();
- $this->_protect_braced_quotes();
- }
-
- // --------------------------------------------------------------------
-
- private function _blank_string()
- {
- // Test blank string
- $this->assertEquals('', $this->type->auto_typography(''));
- }
-
- // --------------------------------------------------------------------
-
- private function _standardize_new_lines()
- {
- $strs = array(
- "My string\rhas return characters" => "<p>My string<br />\nhas return characters</p>",
- 'This one does not!' => '<p>This one does not!</p>'
- );
-
- foreach ($strs as $str => $expect)
- {
- $this->assertEquals($expect, $this->type->auto_typography($str));
- }
- }
-
- // --------------------------------------------------------------------
-
- private function _reduce_linebreaks()
- {
- $str = "This has way too many linebreaks.\n\n\n\nSee?";
- $expect = "<p>This has way too many linebreaks.</p>\n\n<p>See?</p>";
-
- $this->assertEquals($expect, $this->type->auto_typography($str, TRUE));
- }
-
- // --------------------------------------------------------------------
-
- private function _remove_comments()
- {
- $str = '<!-- I can haz comments? --> But no!';
- $expect = '<p><!-- I can haz comments? -->&nbsp; But no!</p>';
-
- $this->assertEquals($expect, $this->type->auto_typography($str));
- }
-
- // --------------------------------------------------------------------
-
- private function _protect_pre()
- {
- $str = '<p>My Sentence</p><pre>var_dump($this);</pre>';
- $expect = '<p>My Sentence</p><pre>var_dump($this);</pre>';
-
- $this->assertEquals($expect, $this->type->auto_typography($str));
- }
-
- // --------------------------------------------------------------------
-
- private function _no_opening_block()
- {
- $str = 'My Sentence<pre>var_dump($this);</pre>';
- $expect = '<p>My Sentence</p><pre>var_dump($this);</pre>';
-
- $this->assertEquals($expect, $this->type->auto_typography($str));
- }
-
- // --------------------------------------------------------------------
-
- public function _protect_braced_quotes()
- {
- $this->type->protect_braced_quotes = TRUE;
-
- $str = 'Test {parse="foobar"}';
- $expect = '<p>Test {parse="foobar"}</p>';
-
- $this->assertEquals($expect, $this->type->auto_typography($str));
-
- $this->type->protect_braced_quotes = FALSE;
-
- $str = 'Test {parse="foobar"}';
- $expect = '<p>Test {parse=&#8220;foobar&#8221;}</p>';
-
- $this->assertEquals($expect, $this->type->auto_typography($str));
- }
-
-} \ No newline at end of file
diff --git a/tests/codeigniter/libraries/Upload_test.php b/tests/codeigniter/libraries/Upload_test.php
deleted file mode 100644
index 8bac597b3..000000000
--- a/tests/codeigniter/libraries/Upload_test.php
+++ /dev/null
@@ -1,299 +0,0 @@
-<?php
-
-class Upload_test extends CI_TestCase {
-
- public function set_up()
- {
- $ci = $this->ci_instance();
- $ci->upload = new CI_Upload();
- $ci->security = new Mock_Core_Security();
- $ci->lang = $this->getMockBuilder('CI_Lang')->setMethods(array('load', 'line'))->getMock();
- $ci->lang->expects($this->any())->method('line')->will($this->returnValue(FALSE));
- $this->upload = $ci->upload;
- }
-
- // --------------------------------------------------------------------
-
- public function test___construct_initialize()
- {
- // via __construct
-
- $upload = new CI_Upload(
- array(
- 'file_name' => 'foo',
- 'file_ext_tolower' => TRUE
- )
- );
-
- $reflection = new ReflectionClass($upload);
- $reflection = $reflection->getProperty('_file_name_override');
- $reflection->setAccessible(TRUE);
- $this->assertEquals('foo', $reflection->getValue($upload));
-
- $this->assertTrue($upload->file_ext_tolower);
-
- // reset (defaults to true)
-
- $upload->initialize(array('file_name' => 'bar'));
- $this->assertEquals('bar', $upload->file_name);
- $this->assertFalse($upload->file_ext_tolower);
-
- // no reset
-
- $upload->initialize(array('file_ext_tolower' => TRUE), FALSE);
- $this->assertTrue($upload->file_ext_tolower);
- $this->assertEquals('bar', $upload->file_name);
- }
-
- // --------------------------------------------------------------------
-
- public function test_do_upload()
- {
- $this->markTestSkipped("We can't test this at the moment because of the call to is_uploaded_file() in do_upload() which isn't supported by vfsStream.");
- }
-
- // --------------------------------------------------------------------
-
- function test_data()
- {
- $data = array(
- 'file_name' => 'hello.txt',
- 'file_type' => 'text/plain',
- 'file_path' => '/tmp/',
- 'full_path' => '/tmp/hello.txt',
- 'raw_name' => 'hello',
- 'orig_name' => 'hello.txt',
- 'client_name' => '',
- 'file_ext' => '.txt',
- 'file_size' => 100,
- 'is_image' => FALSE,
- 'image_width' => '',
- 'image_height' => '',
- 'image_type' => '',
- 'image_size_str' => ''
- );
-
- $this->upload->set_upload_path('/tmp/');
-
- foreach ($data as $k => $v)
- {
- $this->upload->{$k} = $v;
- }
-
- $this->assertEquals('hello.txt', $this->upload->data('file_name'));
- $this->assertEquals($data, $this->upload->data());
- }
-
- function test_set_upload_path()
- {
- $this->upload->set_upload_path('/tmp/');
- $this->assertEquals('/tmp/', $this->upload->upload_path);
-
- $this->upload->set_upload_path('/tmp');
- $this->assertEquals('/tmp/', $this->upload->upload_path);
- }
-
- function test_set_filename()
- {
- $dir = 'uploads';
- $isnew = 'helloworld.txt';
- $exists = 'hello-world.txt';
- $this->ci_vfs_create($exists, 'Hello world.', $this->ci_app_root, $dir);
- $path = $this->ci_vfs_path($dir.'/', APPPATH);
- $this->upload->file_ext = '.txt';
-
- $this->assertEquals($isnew, $this->upload->set_filename($path, $isnew));
- $this->assertEquals('hello-world1.txt', $this->upload->set_filename($path, $exists));
- }
-
- function test_set_max_filesize()
- {
- $this->upload->set_max_filesize(100);
- $this->assertEquals(100, $this->upload->max_size);
- }
-
- function test_set_max_filename()
- {
- $this->upload->set_max_filename(100);
- $this->assertEquals(100, $this->upload->max_filename);
- }
-
- function test_set_max_width()
- {
- $this->upload->set_max_width(100);
- $this->assertEquals(100, $this->upload->max_width);
- }
-
- function test_set_max_height()
- {
- $this->upload->set_max_height(100);
- $this->assertEquals(100, $this->upload->max_height);
- }
-
- function test_set_allowed_types()
- {
- $this->upload->set_allowed_types('*');
- $this->assertEquals('*', $this->upload->allowed_types);
-
- $this->upload->set_allowed_types('foo|bar');
- $this->assertEquals(array('foo', 'bar'), $this->upload->allowed_types);
- }
-
- function test_set_image_properties()
- {
- $this->upload->file_type = 'image/gif';
- $this->upload->file_temp = realpath(PROJECT_BASE.'tests/mocks/uploads/ci_logo.gif');
-
- $props = array(
- 'image_width' => 170,
- 'image_height' => 73,
- 'image_type' => 'gif',
- 'image_size_str' => 'width="170" height="73"'
- );
-
- $this->upload->set_image_properties($this->upload->file_temp);
-
- $this->assertEquals($props['image_width'], $this->upload->image_width);
- $this->assertEquals($props['image_height'], $this->upload->image_height);
- $this->assertEquals($props['image_type'], $this->upload->image_type);
- $this->assertEquals($props['image_size_str'], $this->upload->image_size_str);
- }
-
- function test_set_xss_clean()
- {
- $this->upload->set_xss_clean(TRUE);
- $this->assertTrue($this->upload->xss_clean);
-
- $this->upload->set_xss_clean(FALSE);
- $this->assertFalse($this->upload->xss_clean);
- }
-
- function test_is_image()
- {
- $this->upload->file_type = 'image/x-png';
- $this->assertTrue($this->upload->is_image());
-
- $this->upload->file_type = 'text/plain';
- $this->assertFalse($this->upload->is_image());
- }
-
- function test_is_allowed_filetype()
- {
- $this->upload->allowed_types = array('html', 'gif');
-
- $this->upload->file_ext = '.txt';
- $this->upload->file_type = 'text/plain';
- $this->assertFalse($this->upload->is_allowed_filetype(FALSE));
- $this->assertFalse($this->upload->is_allowed_filetype(TRUE));
-
- $this->upload->file_ext = '.html';
- $this->upload->file_type = 'text/html';
- $this->assertTrue($this->upload->is_allowed_filetype(FALSE));
- $this->assertTrue($this->upload->is_allowed_filetype(TRUE));
-
- $this->upload->file_temp = realpath(PROJECT_BASE.'tests/mocks/uploads/ci_logo.gif');
- $this->upload->file_ext = '.gif';
- $this->upload->file_type = 'image/gif';
- $this->assertTrue($this->upload->is_allowed_filetype());
- }
-
- function test_is_allowed_filesize()
- {
- $this->upload->max_size = 100;
- $this->upload->file_size = 99;
-
- $this->assertTrue($this->upload->is_allowed_filesize());
-
- $this->upload->file_size = 101;
- $this->assertFalse($this->upload->is_allowed_filesize());
- }
-
- function test_is_allowed_dimensions()
- {
- $this->upload->file_type = 'text/plain';
- $this->assertTrue($this->upload->is_allowed_dimensions());
-
- $this->upload->file_type = 'image/gif';
- $this->upload->file_temp = realpath(PROJECT_BASE.'tests/mocks/uploads/ci_logo.gif');
-
- $this->upload->max_width = 10;
- $this->assertFalse($this->upload->is_allowed_dimensions());
-
- $this->upload->max_width = 170;
- $this->upload->max_height = 10;
- $this->assertFalse($this->upload->is_allowed_dimensions());
-
- $this->upload->max_height = 73;
- $this->assertTrue($this->upload->is_allowed_dimensions());
- }
-
- function test_validate_upload_path()
- {
- $this->upload->upload_path = '';
- $this->assertFalse($this->upload->validate_upload_path());
-
- $dir = 'uploads';
- $this->ci_vfs_mkdir($dir);
- $this->upload->upload_path = $this->ci_vfs_path($dir);
- $this->assertTrue($this->upload->validate_upload_path());
- }
-
- function test_get_extension()
- {
- $this->assertEquals('.txt', $this->upload->get_extension('hello.txt'));
- $this->assertEquals('.htaccess', $this->upload->get_extension('.htaccess'));
- $this->assertEquals('', $this->upload->get_extension('hello'));
- }
-
- function test_limit_filename_length()
- {
- $this->assertEquals('hello.txt', $this->upload->limit_filename_length('hello.txt', 10));
- $this->assertEquals('hello.txt', $this->upload->limit_filename_length('hello-world.txt', 9));
- }
-
- function test_do_xss_clean()
- {
- $dir = 'uploads';
- $file1 = 'file1.txt';
- $file2 = 'file2.txt';
- $file3 = 'file3.txt';
- $this->ci_vfs_create($file1, 'The billy goat was waiting for them.', $this->ci_vfs_root, $dir);
- $this->ci_vfs_create($file2, '', $this->ci_vfs_root, $dir);
- $this->ci_vfs_create($file3, '<script type="text/javascript">alert("Boo! said the billy goat")</script>', $this->ci_vfs_root, $dir);
-
- $this->upload->file_temp = $this->ci_vfs_path($file1, $dir);
- $this->assertTrue($this->upload->do_xss_clean());
-
- $this->upload->file_temp = $this->ci_vfs_path($file2, $dir);
- $this->assertFalse($this->upload->do_xss_clean());
-
- $this->upload->file_temp = $this->ci_vfs_path($file3, $dir);
- $this->assertFalse($this->upload->do_xss_clean());
-
- $this->upload->file_temp = realpath(PROJECT_BASE.'tests/mocks/uploads/ci_logo.gif');
- $this->assertTrue($this->upload->do_xss_clean());
- }
-
- function test_set_error()
- {
- $errors = array(
- 'An error!'
- );
-
- $another = 'Another error!';
-
- $this->upload->set_error($errors);
- $this->assertEquals($errors, $this->upload->error_msg);
-
- $errors[] = $another;
- $this->upload->set_error($another);
- $this->assertEquals($errors, $this->upload->error_msg);
- }
-
- function test_display_errors()
- {
- $this->upload->error_msg[] = 'Error test';
- $this->assertEquals('<p>Error test</p>', $this->upload->display_errors());
- }
-
-}
diff --git a/tests/codeigniter/libraries/Useragent_test.php b/tests/codeigniter/libraries/Useragent_test.php
deleted file mode 100644
index 087544a1a..000000000
--- a/tests/codeigniter/libraries/Useragent_test.php
+++ /dev/null
@@ -1,125 +0,0 @@
-<?php
-
-class UserAgent_test extends CI_TestCase {
-
- protected $_user_agent = 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-us) AppleWebKit/533.20.25 (KHTML, like Gecko) Version/5.0.4 Safari/533.20.27';
- protected $_mobile_ua = 'Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_1 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8B117 Safari/6531.22.7';
-
- public function set_up()
- {
- // set a baseline user agent
- $_SERVER['HTTP_USER_AGENT'] = $this->_user_agent;
-
- $this->ci_vfs_clone('application/config/user_agents.php');
- $this->agent = new CI_User_agent();
- $this->ci_instance_var('agent', $this->agent);
- }
-
- // --------------------------------------------------------------------
-
- public function test_accept_lang()
- {
- $_SERVER['HTTP_ACCEPT_LANGUAGE'] = 'en';
- $this->assertTrue($this->agent->accept_lang());
- unset($_SERVER['HTTP_ACCEPT_LANGUAGE']);
- $this->assertTrue($this->agent->accept_lang('en'));
- $this->assertFalse($this->agent->accept_lang('fr'));
- }
-
- // --------------------------------------------------------------------
-
- public function test_mobile()
- {
- // Mobile Not Set
- $_SERVER['HTTP_USER_AGENT'] = $this->_mobile_ua;
- $this->assertEquals('', $this->agent->mobile());
- unset($_SERVER['HTTP_USER_AGENT']);
- }
-
- // --------------------------------------------------------------------
-
- public function test_is_functions()
- {
- $this->assertTrue($this->agent->is_browser());
- $this->assertTrue($this->agent->is_browser('Safari'));
- $this->assertFalse($this->agent->is_browser('Firefox'));
- $this->assertFalse($this->agent->is_robot());
- $this->assertFalse($this->agent->is_mobile());
- }
-
- // --------------------------------------------------------------------
-
- public function test_referrer()
- {
- $_SERVER['HTTP_REFERER'] = 'http://codeigniter.com/userguide3/';
- $this->assertTrue($this->agent->is_referral());
- $this->assertEquals('http://codeigniter.com/userguide3/', $this->agent->referrer());
-
- $this->agent->referer = NULL;
- unset($_SERVER['HTTP_REFERER']);
- $this->assertFalse($this->agent->is_referral());
- $this->assertEquals('', $this->agent->referrer());
- }
-
- // --------------------------------------------------------------------
-
- public function test_agent_string()
- {
- $this->assertEquals($this->_user_agent, $this->agent->agent_string());
- }
-
- // --------------------------------------------------------------------
-
- public function test_browser_info()
- {
- $this->assertEquals('Mac OS X', $this->agent->platform());
- $this->assertEquals('Safari', $this->agent->browser());
- $this->assertEquals('533.20.27', $this->agent->version());
- $this->assertEquals('', $this->agent->robot());
- }
-
- // --------------------------------------------------------------------
-
- public function test_charsets()
- {
- $_SERVER['HTTP_ACCEPT_CHARSET'] = 'utf8';
- $this->agent->charsets = array();
- $this->agent->charsets();
- $this->assertTrue($this->agent->accept_charset('utf8'));
- $this->assertFalse($this->agent->accept_charset('foo'));
- $this->assertEquals('utf8', $this->agent->charsets[0]);
-
- $_SERVER['HTTP_ACCEPT_CHARSET'] = '';
- $this->agent->charsets = array();
- $this->assertFalse($this->agent->accept_charset());
- $this->assertEquals('Undefined', $this->agent->charsets[0]);
-
- $_SERVER['HTTP_ACCEPT_CHARSET'] = 'iso-8859-5, unicode-1-1; q=0.8';
- $this->agent->charsets = array();
- $this->assertTrue($this->agent->accept_charset('iso-8859-5'));
- $this->assertTrue($this->agent->accept_charset('unicode-1-1'));
- $this->assertFalse($this->agent->accept_charset('foo'));
- $this->assertEquals('iso-8859-5', $this->agent->charsets[0]);
- $this->assertEquals('unicode-1-1', $this->agent->charsets[1]);
-
- unset($_SERVER['HTTP_ACCEPT_CHARSET']);
- }
-
- public function test_parse()
- {
- $new_agent = 'Mozilla/5.0 (Android; Mobile; rv:13.0) Gecko/13.0 Firefox/13.0';
- $this->agent->parse($new_agent);
-
- $this->assertEquals('Android', $this->agent->platform());
- $this->assertEquals('Firefox', $this->agent->browser());
- $this->assertEquals('13.0', $this->agent->version());
- $this->assertEquals('', $this->agent->robot());
- $this->assertEquals('Android', $this->agent->mobile());
- $this->assertEquals($new_agent, $this->agent->agent_string());
- $this->assertTrue($this->agent->is_browser());
- $this->assertFalse($this->agent->is_robot());
- $this->assertTrue($this->agent->is_mobile());
- $this->assertTrue($this->agent->is_mobile('android'));
- }
-
-} \ No newline at end of file
diff --git a/tests/mocks/autoloader.php b/tests/mocks/autoloader.php
deleted file mode 100644
index 9360a2b34..000000000
--- a/tests/mocks/autoloader.php
+++ /dev/null
@@ -1,119 +0,0 @@
-<?php
-
-// This autoloader provide convenient way to working with mock object
-// make the test looks natural. This autoloader support cascade file loading as well
-// within mocks directory.
-//
-// Prototype :
-//
-// $mock_table = new Mock_Libraries_Table(); // Will load ./mocks/libraries/table.php
-// $mock_database_driver = new Mock_Database_Driver(); // Will load ./mocks/database/driver.php
-// and so on...
-function autoload($class)
-{
- $dir = realpath(dirname(__FILE__)).DIRECTORY_SEPARATOR;
-
- $ci_core = array(
- 'Benchmark',
- 'Config',
- 'Controller',
- 'Exceptions',
- 'Hooks',
- 'Input',
- 'Lang',
- 'Loader',
- 'Log',
- 'Model',
- 'Output',
- 'Router',
- 'Security',
- 'URI',
- 'Utf8'
- );
-
- $ci_libraries = array(
- 'Calendar',
- 'Cart',
- 'Driver_Library',
- 'Email',
- 'Encrypt',
- 'Encryption',
- 'Form_validation',
- 'Ftp',
- 'Image_lib',
- 'Javascript',
- 'Migration',
- 'Pagination',
- 'Parser',
- 'Profiler',
- 'Table',
- 'Trackback',
- 'Typography',
- 'Unit_test',
- 'Upload',
- 'User_agent',
- 'Xmlrpc',
- 'Zip'
- );
-
- $ci_drivers = array('Session', 'Cache');
-
- if (strpos($class, 'Mock_') === 0)
- {
- $class = strtolower(str_replace(array('Mock_', '_'), array('', DIRECTORY_SEPARATOR), $class));
- }
- elseif (strpos($class, 'CI_') === 0)
- {
- $subclass = substr($class, 3);
-
- if (in_array($subclass, $ci_core))
- {
- $dir = SYSTEM_PATH.'core'.DIRECTORY_SEPARATOR;
- $class = $subclass;
- }
- elseif (in_array($subclass, $ci_libraries))
- {
- $dir = SYSTEM_PATH.'libraries'.DIRECTORY_SEPARATOR;
- $class = ($subclass === 'Driver_Library') ? 'Driver' : $subclass;
- }
- elseif (in_array($subclass, $ci_drivers))
- {
- $dir = SYSTEM_PATH.'libraries'.DIRECTORY_SEPARATOR.$subclass.DIRECTORY_SEPARATOR;
- $class = $subclass;
- }
- elseif (in_array(($parent = strtok($subclass, '_')), $ci_drivers)) {
- $dir = SYSTEM_PATH.'libraries'.DIRECTORY_SEPARATOR.$parent.DIRECTORY_SEPARATOR.'drivers'.DIRECTORY_SEPARATOR;
- $class = $subclass;
- }
- elseif (preg_match('/^CI_DB_(.+)_(.+)_(driver|forge|result|utility)$/', $class, $m) && count($m) === 4)
- {
- $driver_path = SYSTEM_PATH.'database'.DIRECTORY_SEPARATOR.'drivers'.DIRECTORY_SEPARATOR;
- $dir = $driver_path.$m[1].DIRECTORY_SEPARATOR.'subdrivers'.DIRECTORY_SEPARATOR;
- $file = $dir.$m[1].'_'.$m[2].'_'.$m[3].'.php';
- }
- elseif (preg_match('/^CI_DB_(.+)_(driver|forge|result|utility)$/', $class, $m) && count($m) === 3)
- {
- $driver_path = SYSTEM_PATH.'database'.DIRECTORY_SEPARATOR.'drivers'.DIRECTORY_SEPARATOR;
- $dir = $driver_path.$m[1].DIRECTORY_SEPARATOR;
- $file = $dir.$m[1].'_'.$m[2].'.php';
- }
- elseif (strpos($class, 'CI_DB') === 0)
- {
- $dir = SYSTEM_PATH.'database'.DIRECTORY_SEPARATOR;
- $file = $dir.str_replace(array('CI_DB','active_record'), array('DB', 'active_rec'), $subclass).'.php';
- }
- else
- {
- $class = strtolower($class);
- }
- }
-
- $file = isset($file) ? $file : $dir.$class.'.php';
-
- if ( ! file_exists($file))
- {
- return FALSE;
- }
-
- include_once($file);
-}
diff --git a/tests/mocks/ci_testcase.php b/tests/mocks/ci_testcase.php
deleted file mode 100644
index de46f6df6..000000000
--- a/tests/mocks/ci_testcase.php
+++ /dev/null
@@ -1,398 +0,0 @@
-<?php
-
-class CI_TestCase extends \PHPUnit\Framework\TestCase {
-
- public $ci_vfs_root;
- public $ci_app_root;
- public $ci_base_root;
- protected $ci_instance;
- protected static $ci_test_instance;
-
- private $global_map = array(
- 'benchmark' => 'bm',
- 'config' => 'cfg',
- 'hooks' => 'ext',
- 'utf8' => 'uni',
- 'router' => 'rtr',
- 'output' => 'out',
- 'security' => 'sec',
- 'input' => 'in',
- 'lang' => 'lang',
- 'loader' => 'load',
- 'model' => 'model'
- );
-
- // --------------------------------------------------------------------
-
- public function __construct($name = null, array $data = array(), $dataName = '')
- {
- parent::__construct($name, $data, $dataName);
- $this->ci_instance = new stdClass();
- }
-
- // --------------------------------------------------------------------
-
- public function setUp()
- {
- // Setup VFS with base directories
- $this->ci_vfs_root = vfsStream::setup('');
- $this->ci_app_root = vfsStream::newDirectory('application')->at($this->ci_vfs_root);
- $this->ci_base_root = vfsStream::newDirectory('system')->at($this->ci_vfs_root);
- $this->ci_view_root = vfsStream::newDirectory('views')->at($this->ci_app_root);
-
- if (method_exists($this, 'set_up'))
- {
- $this->set_up();
- }
- }
-
- // --------------------------------------------------------------------
-
- public function tearDown()
- {
- if (method_exists($this, 'tear_down'))
- {
- $this->tear_down();
- }
- }
-
- // --------------------------------------------------------------------
-
- public static function instance()
- {
- return self::$ci_test_instance;
- }
-
- // --------------------------------------------------------------------
-
- public function ci_set_config($key = '', $val = '')
- {
- // Add test config
- if ( ! isset($this->ci_instance->config))
- {
- $this->ci_instance->config = new CI_TestConfig();
- }
-
- // Empty key means just do setup above
- if ($key === '')
- {
- return;
- }
-
- if (is_array($key))
- {
- $this->ci_instance->config->config = $key;
- }
- else
- {
- $this->ci_instance->config->config[$key] = $val;
- }
- }
-
- // --------------------------------------------------------------------
-
- public function ci_get_config()
- {
- return isset($this->ci_instance->config) ? $this->ci_instance->config->config : array();
- }
-
- // --------------------------------------------------------------------
-
- public function ci_instance($obj = FALSE)
- {
- if ( ! is_object($obj))
- {
- return $this->ci_instance;
- }
-
- $this->ci_instance = $obj;
- }
-
- // --------------------------------------------------------------------
-
- public function ci_instance_var($name, $obj = FALSE)
- {
- if ( ! is_object($obj))
- {
- return $this->ci_instance->$name;
- }
-
- $this->ci_instance->$name =& $obj;
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Grab a core class
- *
- * Loads the correct core class without extensions
- * and returns a reference to the class name in the
- * globals array with the correct key. This way the
- * test can modify the variable it assigns to and
- * still maintain the global.
- */
- public function &ci_core_class($name)
- {
- $name = strtolower($name);
-
- if (isset($this->global_map[$name]))
- {
- $class_name = ucfirst($name);
- $global_name = $this->global_map[$name];
- }
- elseif (in_array($name, $this->global_map))
- {
- $class_name = ucfirst(array_search($name, $this->global_map));
- $global_name = $name;
- }
- else
- {
- throw new Exception('Not a valid core class.');
- }
-
- if ( ! class_exists('CI_'.$class_name))
- {
- require_once SYSTEM_PATH.'core/'.$class_name.'.php';
- }
-
- $GLOBALS[strtoupper($global_name)] = 'CI_'.$class_name;
- return $GLOBALS[strtoupper($global_name)];
- }
-
- // --------------------------------------------------------------------
-
- // convenience function for global mocks
- public function ci_set_core_class($name, $obj)
- {
- $orig =& $this->ci_core_class($name);
- $orig = $obj;
- }
-
- /**
- * Create VFS directory
- *
- * @param string Directory name
- * @param object Optional root to create in
- * @return object New directory object
- */
- public function ci_vfs_mkdir($name, $root = NULL)
- {
- // Check for root
- if ( ! $root)
- {
- $root = $this->ci_vfs_root;
- }
-
- // Return new directory object
- return vfsStream::newDirectory($name)->at($root);
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Create VFS content
- *
- * @param string File name
- * @param string File content
- * @param object VFS directory object
- * @param mixed Optional subdirectory path or array of subs
- * @return void
- */
- public function ci_vfs_create($file, $content = '', $root = NULL, $path = NULL)
- {
- // Check for array
- if (is_array($file))
- {
- foreach ($file as $name => $content)
- {
- $this->ci_vfs_create($name, $content, $root, $path);
- }
- return;
- }
-
- // Assert .php extension if none given
- if (pathinfo($file, PATHINFO_EXTENSION) == '')
- {
- $file .= '.php';
- }
-
- // Build content
- $tree = array($file => $content);
-
- // Check for path
- $subs = array();
- if ($path)
- {
- // Explode if not array
- $subs = is_array($path) ? $path : explode('/', trim($path, '/'));
- }
-
- // Check for root
- if ( ! $root)
- {
- // Use base VFS root
- $root = $this->ci_vfs_root;
- }
-
- // Handle subdirectories
- while (($dir = array_shift($subs)))
- {
- // See if subdir exists under current root
- $dir_root = $root->getChild($dir);
- if ($dir_root)
- {
- // Yes - recurse into subdir
- $root = $dir_root;
- }
- else
- {
- // No - put subdirectory back and quit
- array_unshift($subs, $dir);
- break;
- }
- }
-
- // Create any remaining subdirectories
- if ($subs)
- {
- foreach (array_reverse($subs) as $dir)
- {
- // Wrap content in subdirectory for creation
- $tree = array($dir => $tree);
- }
- }
-
- // Create tree
- vfsStream::create($tree, $root);
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Clone a real file into VFS
- *
- * @param string Path from base directory
- * @return bool TRUE on success, otherwise FALSE
- */
- public function ci_vfs_clone($path, $dest='')
- {
- // Check for array
- if (is_array($path))
- {
- foreach ($path as $file)
- {
- $this->ci_vfs_clone($file, $dest);
- }
- return;
- }
-
- // Get real file contents
- $content = file_get_contents(PROJECT_BASE.$path);
- if ($content === FALSE)
- {
- // Couldn't find file to clone
- return FALSE;
- }
-
- if (empty($dest))
- {
- $dest = dirname($path);
- }
-
- $this->ci_vfs_create(basename($path), $content, NULL, $dest);
- return TRUE;
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Helper to get a VFS URL path
- *
- * @param string Path
- * @param string Optional base path
- * @return string Path URL
- */
- public function ci_vfs_path($path, $base = '')
- {
- // Check for base path
- if ($base)
- {
- // Prepend to path
- $path = rtrim($base, '/').'/'.ltrim($path, '/');
-
- // Is it already in URL form?
- if (strpos($path, '://') !== FALSE)
- {
- // Done - return path
- return $path;
- }
- }
-
- // Trim leading slash and return URL
- return vfsStream::url(ltrim($path, '/'));
- }
-
- // --------------------------------------------------------------------
- // Internals
- // --------------------------------------------------------------------
-
- /**
- * Overwrite runBare
- *
- * PHPUnit instantiates the test classes before
- * running them individually. So right before a test
- * runs we set our instance. Normally this step would
- * happen in setUp, but someone is bound to forget to
- * call the parent method and debugging this is no fun.
- */
- public function runBare()
- {
- self::$ci_test_instance = $this;
- parent::runBare();
- }
-
- // --------------------------------------------------------------------
-
- public function helper($name)
- {
- require_once(SYSTEM_PATH.'helpers/'.$name.'_helper.php');
- }
-
- // --------------------------------------------------------------------
-
- public function lang($name)
- {
- require(SYSTEM_PATH.'language/english/'.$name.'_lang.php');
- return $lang;
- }
-
- // --------------------------------------------------------------------
-
- /**
- * This overload is useful to create a stub, that need to have a specific method.
- */
- public function __call($method, $args)
- {
- if ($this->{$method} instanceof Closure)
- {
- return call_user_func_array($this->{$method},$args);
- }
-
- return parent::__call($method, $args);
- }
-
- public function setExpectedException($exception_class, $exception_message = '', $exception_code = null)
- {
- $use_expect_exception = method_exists($this, 'expectException');
-
- if ($use_expect_exception)
- {
- $this->expectException($exception_class);
- $exception_message !== '' && $this->expectExceptionMessage($exception_message);
- }
- else
- {
- parent::setExpectedException($exception_class, $exception_message, $exception_code);
- }
- }
-}
diff --git a/tests/mocks/ci_testconfig.php b/tests/mocks/ci_testconfig.php
deleted file mode 100644
index afdb71001..000000000
--- a/tests/mocks/ci_testconfig.php
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-
-class CI_TestConfig extends CI_Config {
-
- public $config = array();
- public $_config_paths = array(APPPATH);
- public $loaded = array();
-
- public function item($key, $index = '')
- {
- return isset($this->config[$key]) ? $this->config[$key] : FALSE;
- }
-
- public function load($file = '', $use_sections = FALSE, $fail_gracefully = FALSE)
- {
- $this->loaded[] = $file;
- return TRUE;
- }
-
-}
diff --git a/tests/mocks/core/common.php b/tests/mocks/core/common.php
deleted file mode 100644
index 2e8265b15..000000000
--- a/tests/mocks/core/common.php
+++ /dev/null
@@ -1,153 +0,0 @@
-<?php
-
-// Set up the global CI functions in their most minimal core representation
-
-if ( ! function_exists('get_instance'))
-{
- function &get_instance()
- {
- $test = CI_TestCase::instance();
- $test = $test->ci_instance();
- return $test;
- }
-}
-
-// --------------------------------------------------------------------
-
-if ( ! function_exists('get_config'))
-{
- function &get_config()
- {
- $test = CI_TestCase::instance();
- $config = $test->ci_get_config();
- return $config;
- }
-}
-
-if ( ! function_exists('config_item'))
-{
- function config_item($item)
- {
- $config =& get_config();
-
- if ( ! isset($config[$item]))
- {
- return NULL;
- }
-
- return $config[$item];
- }
-}
-
-if ( ! function_exists('get_mimes'))
-{
- /**
- * Returns the MIME types array from config/mimes.php
- *
- * @return array
- */
- function &get_mimes()
- {
- static $_mimes = array();
-
- if (empty($_mimes))
- {
- $path = realpath(PROJECT_BASE.'application/config/mimes.php');
- if (is_file($path))
- {
- $_mimes = include($path);
- }
- }
-
- return $_mimes;
- }
-}
-
-// --------------------------------------------------------------------
-
-/*
-if ( ! function_exists('load_class'))
-{
- function load_class($class, $directory = 'libraries', $prefix = 'CI_')
- {
- if ($directory !== 'core' OR $prefix !== 'CI_')
- {
- throw new Exception('Not Implemented: Non-core load_class()');
- }
-
- $test = CI_TestCase::instance();
-
- $obj =& $test->ci_core_class($class);
-
- if (is_string($obj))
- {
- throw new Exception('Bad Isolation: Use ci_set_core_class to set '.$class);
- }
-
- return $obj;
- }
-}
-*/
-
-// Clean up error messages
-// --------------------------------------------------------------------
-
-if ( ! function_exists('show_error'))
-{
- function show_error($message, $status_code = 500, $heading = 'An Error Was Encountered')
- {
- throw new RuntimeException('CI Error: '.$message);
- }
-}
-
-if ( ! function_exists('show_404'))
-{
- function show_404($page = '', $log_error = TRUE)
- {
- throw new RuntimeException('CI Error: 404');
- }
-}
-
-if ( ! function_exists('_exception_handler'))
-{
- function _exception_handler($severity, $message, $filepath, $line)
- {
- throw new RuntimeException('CI Exception: '.$message.' | '.$filepath.' | '.$line);
- }
-}
-
-// We assume a few things about our environment ...
-// --------------------------------------------------------------------
-if ( ! function_exists('is_loaded'))
-{
- function &is_loaded()
- {
- $loaded = array();
- return $loaded;
- }
-}
-
-if ( ! function_exists('log_message'))
-{
- function log_message($level, $message)
- {
- return TRUE;
- }
-}
-
-if ( ! function_exists('set_status_header'))
-{
- function set_status_header($code = 200, $text = '')
- {
- return TRUE;
- }
-}
-
-if ( ! function_exists('is_cli'))
-{
- // In order to test HTTP functionality, we need to lie about this
- function is_cli()
- {
- return FALSE;
- }
-} \ No newline at end of file
diff --git a/tests/mocks/core/input.php b/tests/mocks/core/input.php
deleted file mode 100644
index 40e27441f..000000000
--- a/tests/mocks/core/input.php
+++ /dev/null
@@ -1,49 +0,0 @@
-<?php
-
-class Mock_Core_Input extends CI_Input {
-
- /**
- * Since we use GLOBAL to fetch Security and Utf8 classes,
- * we need to use inversion of control to mock up
- * the same process within CI_Input class constructor.
- *
- * @covers CI_Input::__construct()
- */
- public function __construct($security, $utf8)
- {
- $this->_allow_get_array = (config_item('allow_get_array') === TRUE);
- $this->_enable_xss = (config_item('global_xss_filtering') === TRUE);
- $this->_enable_csrf = (config_item('csrf_protection') === TRUE);
-
- // Assign Security and Utf8 classes
- $this->security = $security;
- $this->uni = $utf8;
-
- // Sanitize global arrays
- $this->_sanitize_globals();
- }
-
- public function fetch_from_array($array, $index = '', $xss_clean = FALSE)
- {
- return parent::_fetch_from_array($array, $index, $xss_clean);
- }
-
- /**
- * Lie about being a CLI request
- *
- * We take advantage of this in libraries/Session_test
- */
- public function is_cli_request()
- {
- return FALSE;
- }
-
- public function __set($name, $value)
- {
- if ($name === 'ip_address')
- {
- $this->ip_address = $value;
- }
- }
-
-} \ No newline at end of file
diff --git a/tests/mocks/core/security.php b/tests/mocks/core/security.php
deleted file mode 100644
index 6cff85860..000000000
--- a/tests/mocks/core/security.php
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-
-class Mock_Core_Security extends CI_Security {
-
- public function csrf_set_cookie()
- {
- // We cannot set cookie in CLI mode, so for csrf test, who rely on $_COOKIE,
- // we superseded set_cookie with directly set the cookie variable,
- // @see : ./tests/codeigniter/core/Security_test.php, line 8
- return $this;
- }
-
- // Override inaccessible protected properties
- public function __get($property)
- {
- return isset($this->{'_'.$property}) ? $this->{'_'.$property} : NULL;
- }
-
- public function remove_evil_attributes($str, $is_image)
- {
- return $this->_remove_evil_attributes($str, $is_image);
- }
-
- // Override inaccessible protected method
- public function __call($method, $params)
- {
- if (is_callable(array($this, '_'.$method)))
- {
- return call_user_func_array(array($this, '_'.$method), $params);
- }
-
- throw new BadMethodCallException('Method '.$method.' was not found');
- }
-
-}
diff --git a/tests/mocks/core/uri.php b/tests/mocks/core/uri.php
deleted file mode 100644
index 96ec5afa1..000000000
--- a/tests/mocks/core/uri.php
+++ /dev/null
@@ -1,32 +0,0 @@
-<?php
-
-class Mock_Core_URI extends CI_URI {
-
- public function __construct()
- {
- $test = CI_TestCase::instance();
- $cls =& $test->ci_core_class('cfg');
-
- // set predictable config values
- $test->ci_set_config(array(
- 'index_page' => 'index.php',
- 'base_url' => 'http://example.com/',
- 'subclass_prefix' => 'MY_',
- 'enable_query_strings' => FALSE,
- 'permitted_uri_chars' => 'a-z 0-9~%.:_\-'
- ));
-
- $this->config = new $cls;
-
- if ($this->config->item('enable_query_strings') !== TRUE OR is_cli())
- {
- $this->_permitted_uri_chars = $this->config->item('permitted_uri_chars');
- }
- }
-
- public function _set_permitted_uri_chars($value)
- {
- $this->_permitted_uri_chars = $value;
- }
-
-} \ No newline at end of file
diff --git a/tests/mocks/core/utf8.php b/tests/mocks/core/utf8.php
deleted file mode 100644
index 3a6282e1d..000000000
--- a/tests/mocks/core/utf8.php
+++ /dev/null
@@ -1,19 +0,0 @@
-<?php
-
-class Mock_Core_Utf8 extends CI_Utf8 {
-
- /**
- * We need to define UTF8_ENABLED the same way that
- * CI_Utf8 constructor does.
- */
- public function __construct()
- {
- if (defined('UTF8_ENABLED'))
- {
- return;
- }
-
- parent::__construct();
- }
-
-} \ No newline at end of file
diff --git a/tests/mocks/database/config/mysql.php b/tests/mocks/database/config/mysql.php
deleted file mode 100644
index ca30cb9ca..000000000
--- a/tests/mocks/database/config/mysql.php
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-
-return array(
-
- // Typical Database configuration
- 'mysql' => array(
- 'dsn' => '',
- 'hostname' => '127.0.0.1',
- 'username' => 'travis',
- 'password' => 'travis',
- 'database' => 'ci_test',
- 'dbdriver' => 'mysql'
- ),
-
- // Database configuration with failover
- 'mysql_failover' => array(
- 'dsn' => '',
- 'hostname' => '127.0.0.1',
- 'username' => 'not_travis',
- 'password' => 'wrong password',
- 'database' => 'not_ci_test',
- 'dbdriver' => 'mysql',
- 'failover' => array(
- array(
- 'dsn' => '',
- 'hostname' => '127.0.0.1',
- 'username' => 'travis',
- 'password' => 'travis',
- 'database' => 'ci_test',
- 'dbdriver' => 'mysql',
- )
- )
- )
-); \ No newline at end of file
diff --git a/tests/mocks/database/config/mysqli.php b/tests/mocks/database/config/mysqli.php
deleted file mode 100644
index fd8fec962..000000000
--- a/tests/mocks/database/config/mysqli.php
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-
-return array(
-
- // Typical Database configuration
- 'mysqli' => array(
- 'dsn' => '',
- 'hostname' => '127.0.0.1',
- 'username' => 'travis',
- 'password' => 'travis',
- 'database' => 'ci_test',
- 'dbdriver' => 'mysqli'
- ),
-
- // Database configuration with failover
- 'mysqli_failover' => array(
- 'dsn' => '',
- 'hostname' => '127.0.0.1',
- 'username' => 'not_travis',
- 'password' => 'wrong password',
- 'database' => 'not_ci_test',
- 'dbdriver' => 'mysqli',
- 'failover' => array(
- array(
- 'dsn' => '',
- 'hostname' => '127.0.0.1',
- 'username' => 'travis',
- 'password' => 'travis',
- 'database' => 'ci_test',
- 'dbdriver' => 'mysqli',
- )
- )
- )
-); \ No newline at end of file
diff --git a/tests/mocks/database/config/pdo/mysql.php b/tests/mocks/database/config/pdo/mysql.php
deleted file mode 100644
index 89e9fb130..000000000
--- a/tests/mocks/database/config/pdo/mysql.php
+++ /dev/null
@@ -1,37 +0,0 @@
-<?php
-
-return array(
-
- // Typical Database configuration
- 'pdo/mysql' => array(
- 'dsn' => 'mysql:host=127.0.0.1;dbname=ci_test',
- 'hostname' => '127.0.0.1',
- 'username' => 'travis',
- 'password' => 'travis',
- 'database' => 'ci_test',
- 'dbdriver' => 'pdo',
- 'subdriver' => 'mysql'
- ),
-
- // Database configuration with failover
- 'pdo/mysql_failover' => array(
- 'dsn' => '',
- 'hostname' => '127.0.0.1',
- 'username' => 'not_travis',
- 'password' => 'wrong password',
- 'database' => 'not_ci_test',
- 'dbdriver' => 'pdo',
- 'subdriver' => 'mysql',
- 'failover' => array(
- array(
- 'dsn' => 'mysql:host=127.0.0.1;dbname=ci_test',
- 'hostname' => '127.0.0.1',
- 'username' => 'travis',
- 'password' => 'travis',
- 'database' => 'ci_test',
- 'dbdriver' => 'pdo',
- 'subdriver' => 'mysql'
- )
- )
- )
-); \ No newline at end of file
diff --git a/tests/mocks/database/config/pdo/pgsql.php b/tests/mocks/database/config/pdo/pgsql.php
deleted file mode 100644
index 846c70be9..000000000
--- a/tests/mocks/database/config/pdo/pgsql.php
+++ /dev/null
@@ -1,37 +0,0 @@
-<?php
-
-return array(
-
- // Typical Database configuration
- 'pdo/pgsql' => array(
- 'dsn' => 'pgsql:host=localhost;port=5432;dbname=ci_test;',
- 'hostname' => 'localhost',
- 'username' => 'postgres',
- 'password' => 'postgres',
- 'database' => 'ci_test',
- 'dbdriver' => 'pdo',
- 'subdriver' => 'pgsql'
- ),
-
- // Database configuration with failover
- 'pdo/pgsql_failover' => array(
- 'dsn' => '',
- 'hostname' => 'localhost',
- 'username' => 'not_travis',
- 'password' => 'wrong password',
- 'database' => 'not_ci_test',
- 'dbdriver' => 'pdo',
- 'subdriver' => 'pgsql',
- 'failover' => array(
- array(
- 'dsn' => 'pgsql:host=localhost;port=5432;dbname=ci_test;',
- 'hostname' => 'localhost',
- 'username' => 'postgres',
- 'password' => 'postgres',
- 'database' => 'ci_test',
- 'dbdriver' => 'pdo',
- 'subdriver' => 'pgsql'
- )
- )
- )
-); \ No newline at end of file
diff --git a/tests/mocks/database/config/pdo/sqlite.php b/tests/mocks/database/config/pdo/sqlite.php
deleted file mode 100644
index 1bf56b3ac..000000000
--- a/tests/mocks/database/config/pdo/sqlite.php
+++ /dev/null
@@ -1,37 +0,0 @@
-<?php
-
-return array(
-
- // Typical Database configuration
- 'pdo/sqlite' => array(
- 'dsn' => 'sqlite:/'.realpath(__DIR__.'/../..').'/ci_test.sqlite',
- 'hostname' => 'localhost',
- 'username' => 'sqlite',
- 'password' => 'sqlite',
- 'database' => 'sqlite',
- 'dbdriver' => 'pdo',
- 'subdriver' => 'sqlite'
- ),
-
- // Database configuration with failover
- 'pdo/sqlite_failover' => array(
- 'dsn' => 'sqlite:not_exists.sqlite',
- 'hostname' => 'localhost',
- 'username' => 'sqlite',
- 'password' => 'sqlite',
- 'database' => 'sqlite',
- 'dbdriver' => 'pdo',
- 'subdriver' => 'sqlite',
- 'failover' => array(
- array(
- 'dsn' => 'sqlite:/'.realpath(__DIR__.'/../..').'/ci_test.sqlite',
- 'hostname' => 'localhost',
- 'username' => 'sqlite',
- 'password' => 'sqlite',
- 'database' => 'sqlite',
- 'dbdriver' => 'pdo',
- 'subdriver' => 'sqlite'
- )
- )
- )
-); \ No newline at end of file
diff --git a/tests/mocks/database/config/pgsql.php b/tests/mocks/database/config/pgsql.php
deleted file mode 100644
index ce4583728..000000000
--- a/tests/mocks/database/config/pgsql.php
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-
-return array(
-
- // Typical Database configuration
- 'pgsql' => array(
- 'dsn' => '',
- 'hostname' => 'localhost',
- 'username' => 'postgres',
- 'password' => 'postgres',
- 'database' => 'ci_test',
- 'dbdriver' => 'postgre'
- ),
-
- // Database configuration with failover
- 'pgsql_failover' => array(
- 'dsn' => '',
- 'hostname' => 'localhost',
- 'username' => 'not_travis',
- 'password' => 'wrong password',
- 'database' => 'not_ci_test',
- 'dbdriver' => 'postgre',
- 'failover' => array(
- array(
- 'dsn' => '',
- 'hostname' => 'localhost',
- 'username' => 'postgres',
- 'password' => 'postgres',
- 'database' => 'ci_test',
- 'dbdriver' => 'postgre',
- )
- )
- )
-); \ No newline at end of file
diff --git a/tests/mocks/database/config/sqlite.php b/tests/mocks/database/config/sqlite.php
deleted file mode 100644
index d37ee4871..000000000
--- a/tests/mocks/database/config/sqlite.php
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-
-return array(
-
- // Typical Database configuration
- 'sqlite' => array(
- 'dsn' => '',
- 'hostname' => 'localhost',
- 'username' => 'sqlite',
- 'password' => 'sqlite',
- 'database' => realpath(__DIR__.'/..').'/ci_test.sqlite',
- 'dbdriver' => 'sqlite3'
- ),
-
- // Database configuration with failover
- 'sqlite_failover' => array(
- 'dsn' => '',
- 'hostname' => 'localhost',
- 'username' => 'sqlite',
- 'password' => 'sqlite',
- 'database' => '../not_exists.sqlite',
- 'dbdriver' => 'sqlite3',
- 'failover' => array(
- array(
- 'dsn' => '',
- 'hostname' => 'localhost',
- 'username' => 'sqlite',
- 'password' => 'sqlite',
- 'database' => realpath(__DIR__.'/..').'/ci_test.sqlite',
- 'dbdriver' => 'sqlite3'
- )
- )
- )
-); \ No newline at end of file
diff --git a/tests/mocks/database/db.php b/tests/mocks/database/db.php
deleted file mode 100644
index 00dd884b0..000000000
--- a/tests/mocks/database/db.php
+++ /dev/null
@@ -1,142 +0,0 @@
-<?php
-
-class Mock_Database_DB {
-
- /**
- * @var array DB configuration
- */
- private $config = array();
-
- /**
- * @var string DB driver name
- */
- private static $dbdriver = '';
-
- /**
- * @var string DB sub-driver name
- */
- private static $subdriver = '';
-
- /**
- * Prepare database configuration skeleton
- *
- * @param array DB configuration to set
- * @return void
- */
- public function __construct($config = array())
- {
- $this->config = $config;
- }
-
- /**
- * Build DSN connection string for DB driver instantiate process
- *
- * @param string Group name
- * @return string DSN Connection string
- */
- public function set_dsn($group = 'default')
- {
- if ( ! isset($this->config[$group]))
- {
- throw new InvalidArgumentException('Group '.$group.' not exists');
- }
-
- self::$dbdriver = $this->config[$group]['dbdriver'];
- if (isset($this->config[$group]['subdriver']))
- {
- self::$subdriver = $this->config[$group]['subdriver'];
- }
-
- $params = array(
- 'dbprefix' => '',
- 'pconnect' => FALSE,
- 'db_debug' => FALSE,
- 'cache_on' => FALSE,
- 'cachedir' => '',
- 'char_set' => 'utf8',
- 'dbcollat' => 'utf8_general_ci',
- 'swap_pre' => '',
- 'stricton' => FALSE
- );
-
- $config = array_merge($this->config[$group], $params);
- $dsnstring = empty($config['dsn']) ? FALSE : $config['dsn'];
- $subdriver = empty($config['subdriver']) ? FALSE: $config['subdriver'];
- $failover = empty($config['failover']) ? FALSE : $config['failover'];
-
- $dsn = $config['dbdriver'].'://'.$config['username'].':'.$config['password']
- .'@'.$config['hostname'].'/'.$config['database'];
-
- // Build the parameter
- $other_params = array_slice($config, 6);
- if ($dsnstring) $other_params['dsn'] = $dsnstring;
- if ($subdriver) $other_params['subdriver'] = $subdriver;
- if ($failover) $other_params['failover'] = $failover;
-
- return $dsn.'?'.http_build_query($other_params);
- }
-
- /**
- * Return a database config array
- *
- * @see ./config
- * @param string Driver based configuration
- * @return array
- */
- public static function config($driver)
- {
- $dir = realpath(dirname(__FILE__)).DIRECTORY_SEPARATOR;
- return include($dir.'config'.DIRECTORY_SEPARATOR.$driver.'.php');
- }
-
- /**
- * Main DB method wrapper
- *
- * @param string Group or DSN string
- * @param bool
- * @return object
- */
- public static function DB($group, $query_builder = FALSE)
- {
- // Create dummy driver and builder files to "load" - the mocks have
- // already triggered autoloading of the real files
- $case = CI_TestCase::instance();
- $driver = self::$dbdriver;
- $subdriver = self::$subdriver;
- $case->ci_vfs_create(array(
- 'DB_driver.php' => '',
- 'DB_result.php' => '',
- 'DB_forge.php' => '',
- 'DB_query_builder.php' => ''
- ), '', $case->ci_base_root, 'database');
- if (file_exists(SYSTEM_PATH.'database/drivers/'.$driver.'/'.$driver.'_driver.php'))
- {
- $case->ci_vfs_create(array(
- $driver.'_driver.php' => '',
- $driver.'_result.php' => '',
- $driver.'_forge.php' => ''
- ), '', $case->ci_base_root, 'database/drivers/'.$driver);
- }
- if ($subdriver)
- {
- $case->ci_vfs_create(array(
- $driver.'_'.$subdriver.'_driver.php' => '',
- $driver.'_'.$subdriver.'_forge.php' => ''
- ), '', $case->ci_base_root, 'database/drivers/'.$driver.'/subdrivers');
- }
-
- include_once(SYSTEM_PATH.'database/DB.php');
-
- try
- {
- $db = DB($group, $query_builder);
- }
- catch (Exception $e)
- {
- throw new RuntimeException($e->getMessage());
- }
-
- return $db;
- }
-
-} \ No newline at end of file
diff --git a/tests/mocks/database/db/driver.php b/tests/mocks/database/db/driver.php
deleted file mode 100644
index 86f7efd54..000000000
--- a/tests/mocks/database/db/driver.php
+++ /dev/null
@@ -1,40 +0,0 @@
-<?php
-
-class Mock_Database_DB_Driver extends CI_DB_driver {
-
- /**
- * @var object The actual Driver
- */
- protected $ci_db_driver;
-
- /**
- * Instantiate the database driver
- *
- * @param string DB Driver class name
- * @param array DB configuration to set
- * @return void
- */
- public function __construct($driver_class, $config = array())
- {
- if (is_string($driver_class))
- {
- $this->ci_db_driver = new $driver_class($config);
- }
- }
-
- /**
- * Overloading method, emulate the actual driver method (multiple inheritance workaround)
- */
- public function __call($method, $arguments)
- {
- if ( ! is_callable(array($this->ci_db_driver, $method)))
- {
- throw new BadMethodCallException($method. ' not exists or not implemented');
- }
-
- return call_user_func_array(array($this->ci_db_driver, $method), $arguments);
- }
-
-}
-
-class CI_DB extends CI_DB_query_builder {} \ No newline at end of file
diff --git a/tests/mocks/database/drivers/mysql.php b/tests/mocks/database/drivers/mysql.php
deleted file mode 100644
index b7718ebaf..000000000
--- a/tests/mocks/database/drivers/mysql.php
+++ /dev/null
@@ -1,16 +0,0 @@
-<?php
-
-class Mock_Database_Drivers_Mysql extends Mock_Database_DB_Driver {
-
- /**
- * Instantiate the database driver
- *
- * @param array DB configuration to set
- * @return void
- */
- public function __construct($config = array())
- {
- parent::__construct('CI_DB_mysql_driver', $config);
- }
-
-} \ No newline at end of file
diff --git a/tests/mocks/database/drivers/mysqli.php b/tests/mocks/database/drivers/mysqli.php
deleted file mode 100644
index f747aad46..000000000
--- a/tests/mocks/database/drivers/mysqli.php
+++ /dev/null
@@ -1,16 +0,0 @@
-<?php
-
-class Mock_Database_Drivers_Mysqli extends Mock_Database_DB_Driver {
-
- /**
- * Instantiate the database driver
- *
- * @param array DB configuration to set
- * @return void
- */
- public function __construct($config = array())
- {
- parent::__construct('CI_DB_mysqli_driver', $config);
- }
-
-} \ No newline at end of file
diff --git a/tests/mocks/database/drivers/pdo.php b/tests/mocks/database/drivers/pdo.php
deleted file mode 100644
index af1958aea..000000000
--- a/tests/mocks/database/drivers/pdo.php
+++ /dev/null
@@ -1,15 +0,0 @@
-<?php
-
-class Mock_Database_Drivers_PDO extends Mock_Database_DB_Driver {
-
- /**
- * Instantiate the database driver
- *
- * @param array DB configuration to set
- * @return void
- */
- public function __construct($config = array())
- {
- parent::__construct('CI_DB_pdo_driver', $config);
- }
-} \ No newline at end of file
diff --git a/tests/mocks/database/drivers/postgre.php b/tests/mocks/database/drivers/postgre.php
deleted file mode 100644
index 8c91e54a9..000000000
--- a/tests/mocks/database/drivers/postgre.php
+++ /dev/null
@@ -1,16 +0,0 @@
-<?php
-
-class Mock_Database_Drivers_Postgre extends Mock_Database_DB_Driver {
-
- /**
- * Instantiate the database driver
- *
- * @param array DB configuration to set
- * @return void
- */
- public function __construct($config = array())
- {
- parent::__construct('CI_DB_postgre_driver', $config);
- }
-
-} \ No newline at end of file
diff --git a/tests/mocks/database/drivers/sqlite.php b/tests/mocks/database/drivers/sqlite.php
deleted file mode 100644
index b2aec28e6..000000000
--- a/tests/mocks/database/drivers/sqlite.php
+++ /dev/null
@@ -1,16 +0,0 @@
-<?php
-
-class Mock_Database_Drivers_Sqlite extends Mock_Database_DB_Driver {
-
- /**
- * Instantiate the database driver
- *
- * @param array DB configuration to set
- * @return void
- */
- public function __construct($config = array())
- {
- parent::__construct('CI_DB_sqlite3_driver', $config);
- }
-
-} \ No newline at end of file
diff --git a/tests/mocks/database/schema/skeleton.php b/tests/mocks/database/schema/skeleton.php
deleted file mode 100644
index e2b6e7d0e..000000000
--- a/tests/mocks/database/schema/skeleton.php
+++ /dev/null
@@ -1,155 +0,0 @@
-<?php
-
-class Mock_Database_Schema_Skeleton {
-
- /**
- * @var object Database Holder
- */
- public static $db;
-
- /**
- * @var object Forge Holder
- */
- public static $forge;
-
- /**
- * @var object Driver Holder
- */
- public static $driver;
-
- /**
- * Initialize both database and forge components
- */
- public static function init($driver)
- {
- if (empty(self::$db) && empty(self::$forge))
- {
- // E_DEPRECATED notices thrown by mysql_connect(), mysql_pconnect()
- // on PHP 5.5+ cause the tests to fail
- if ($driver === 'mysql' && version_compare(PHP_VERSION, '5.5', '>='))
- {
- error_reporting(E_ALL & ~E_DEPRECATED);
- }
-
- $config = Mock_Database_DB::config($driver);
- $connection = new Mock_Database_DB($config);
- $db = Mock_Database_DB::DB($connection->set_dsn($driver), TRUE);
-
- CI_TestCase::instance()->ci_instance_var('db', $db);
-
- $loader = new CI_Loader();
- $loader->dbforge();
- $forge = CI_TestCase::instance()->ci_instance_var('dbforge');
-
- self::$db = $db;
- self::$forge = $forge;
- self::$driver = $driver;
- }
-
- return self::$db;
- }
-
- /**
- * Create the dummy tables
- *
- * @return void
- */
- public static function create_tables()
- {
- // User Table
- self::$forge->add_field(array(
- 'id' => array(
- 'type' => 'INTEGER',
- 'constraint' => 3
- ),
- 'name' => array(
- 'type' => 'VARCHAR',
- 'constraint' => 40
- ),
- 'email' => array(
- 'type' => 'VARCHAR',
- 'constraint' => 100
- ),
- 'country' => array(
- 'type' => 'VARCHAR',
- 'constraint' => 40
- )
- ));
- self::$forge->add_key('id', TRUE);
- self::$forge->create_table('user', TRUE) OR show_error('Unable to create the `user` table');
-
- // Job Table
- self::$forge->add_field(array(
- 'id' => array(
- 'type' => 'INTEGER',
- 'constraint' => 3
- ),
- 'name' => array(
- 'type' => 'VARCHAR',
- 'constraint' => 40
- ),
- 'description' => array(
- 'type' => 'TEXT'
- )
- ));
- self::$forge->add_key('id', TRUE);
- self::$forge->create_table('job', TRUE) OR show_error('Unable to create the `job` table');
-
- // Misc Table
- self::$forge->add_field(array(
- 'id' => array(
- 'type' => 'INTEGER',
- 'constraint' => 3
- ),
- 'key' => array(
- 'type' => 'VARCHAR',
- 'constraint' => 40
- ),
- 'value' => array(
- 'type' => 'TEXT'
- )
- ));
- self::$forge->add_key('id', TRUE);
- self::$forge->create_table('misc', TRUE) OR show_error('Unable to create the `misc` table');
- }
-
- /**
- * Create the dummy datas
- *
- * @return void
- */
- public static function create_data()
- {
- // Job Data
- $data = array(
- 'user' => array(
- array('id' => 1, 'name' => 'Derek Jones', 'email' => 'derek@world.com', 'country' => 'US'),
- array('id' => 2, 'name' => 'Ahmadinejad', 'email' => 'ahmadinejad@world.com', 'country' => 'Iran'),
- array('id' => 3, 'name' => 'Richard A Causey', 'email' => 'richard@world.com', 'country' => 'US'),
- array('id' => 4, 'name' => 'Chris Martin', 'email' => 'chris@world.com', 'country' => 'UK')
- ),
- 'job' => array(
- array('id' => 1, 'name' => 'Developer', 'description' => 'Awesome job, but sometimes makes you bored'),
- array('id' => 2, 'name' => 'Politician', 'description' => 'This is not really a job'),
- array('id' => 3, 'name' => 'Accountant', 'description' => 'Boring job, but you will get free snack at lunch'),
- array('id' => 4, 'name' => 'Musician', 'description' => 'Only Coldplay can actually called Musician')
- ),
- 'misc' => array(
- array('id' => 1, 'key' => '\\xxxfoo456', 'value' => 'Entry with \\xxx'),
- array('id' => 2, 'key' => '\\%foo456', 'value' => 'Entry with \\%'),
- array('id' => 3, 'key' => 'spaces and tabs', 'value' => ' One two three tab')
- )
- );
-
- foreach ($data as $table => $dummy_data)
- {
- self::$db->truncate($table) OR show_error("Unable to truncate `{$table}` table");
-
- foreach ($dummy_data as $single_dummy_data)
- {
- self::$db->insert($table, $single_dummy_data) OR show_error("Unable to insert data into `{$table}` table");
- }
- }
- }
-
-}
diff --git a/tests/mocks/libraries/driver.php b/tests/mocks/libraries/driver.php
deleted file mode 100644
index 633194345..000000000
--- a/tests/mocks/libraries/driver.php
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-
-/**
- * Mock library to subclass Driver for testing
- */
-class Mock_Libraries_Driver extends CI_Driver_Library {
- /**
- * Set valid drivers list
- */
- public function driver_list($drivers = NULL)
- {
- if (empty($drivers))
- {
- return $this->valid_drivers;
- }
-
- $this->valid_drivers = (array) $drivers;
- }
-
- /**
- * Get library name
- */
- public function get_name()
- {
- return $this->lib_name;
- }
-} \ No newline at end of file
diff --git a/tests/mocks/libraries/encrypt.php b/tests/mocks/libraries/encrypt.php
deleted file mode 100644
index c14d1e02f..000000000
--- a/tests/mocks/libraries/encrypt.php
+++ /dev/null
@@ -1,16 +0,0 @@
-<?php
-
-class Mock_Libraries_Encrypt extends CI_Encrypt {
-
- // Override inaccessible protected method
- public function __call($method, $params)
- {
- if (is_callable(array($this, '_'.$method)))
- {
- return call_user_func_array(array($this, '_'.$method), $params);
- }
-
- throw new BadMethodCallException('Method '.$method.' was not found');
- }
-
-}
diff --git a/tests/mocks/libraries/encryption.php b/tests/mocks/libraries/encryption.php
deleted file mode 100644
index 028eecc72..000000000
--- a/tests/mocks/libraries/encryption.php
+++ /dev/null
@@ -1,39 +0,0 @@
-<?php
-
-class Mock_Libraries_Encryption extends CI_Encryption {
-
- /**
- * __get_params()
- *
- * Allows public calls to the otherwise protected _get_params().
- */
- public function __get_params($params)
- {
- return $this->_get_params($params);
- }
-
- // --------------------------------------------------------------------
-
- /**
- * get_key()
- *
- * Allows checking for key changes.
- */
- public function get_key()
- {
- return $this->_key;
- }
-
- // --------------------------------------------------------------------
-
- /**
- * __driver_get_handle()
- *
- * Allows checking for _mcrypt_get_handle(), _openssl_get_handle()
- */
- public function __driver_get_handle($driver, $cipher, $mode)
- {
- return $this->{'_'.$driver.'_get_handle'}($cipher, $mode);
- }
-
-} \ No newline at end of file
diff --git a/tests/mocks/libraries/session.php b/tests/mocks/libraries/session.php
deleted file mode 100644
index adbecb329..000000000
--- a/tests/mocks/libraries/session.php
+++ /dev/null
@@ -1,38 +0,0 @@
-<?php
-
-/**
- * Mock library to add testing features to Session driver library
- */
-class Mock_Libraries_Session extends CI_Session {
- /**
- * Simulate new page load
- */
- public function reload()
- {
- $this->_flashdata_sweep();
- $this->_flashdata_mark();
- $this->_tempdata_sweep();
- }
-}
-
-/**
- * Mock cookie driver to overload cookie setting
- */
-class Mock_Libraries_Session_cookie extends CI_Session_cookie {
- /**
- * Overload _setcookie to manage $_COOKIE values, since actual cookies can't be set in unit testing
- */
- protected function _setcookie($name, $value = '', $expire = 0, $path = '', $domain = '', $secure = FALSE, $httponly = FALSE)
- {
- if (empty($value) OR $expire <= time())
- {
- unset($_COOKIE[$name]);
- }
- else
- {
- $_COOKIE[$name] = $value;
- }
- }
-}
-
-class Mock_Libraries_Session_native extends CI_Session_native {} \ No newline at end of file
diff --git a/tests/mocks/libraries/table.php b/tests/mocks/libraries/table.php
deleted file mode 100644
index 08f80072a..000000000
--- a/tests/mocks/libraries/table.php
+++ /dev/null
@@ -1,16 +0,0 @@
-<?php
-
-class Mock_Libraries_Table extends CI_Table {
-
- // Override inaccessible protected method
- public function __call($method, $params)
- {
- if (is_callable(array($this, '_'.$method)))
- {
- return call_user_func_array(array($this, '_'.$method), $params);
- }
-
- throw new BadMethodCallException('Method '.$method.' was not found');
- }
-
-}
diff --git a/tests/mocks/uploads/ci_logo.gif b/tests/mocks/uploads/ci_logo.gif
deleted file mode 100644
index 073ec14b4..000000000
--- a/tests/mocks/uploads/ci_logo.gif
+++ /dev/null
Binary files differ
diff --git a/tests/phpunit.xml b/tests/phpunit.xml
deleted file mode 100644
index a1626ce91..000000000
--- a/tests/phpunit.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<phpunit
- bootstrap="./Bootstrap.php"
- colors="true"
- convertNoticesToExceptions="true"
- convertWarningsToExceptions="true"
- stopOnError="false"
- stopOnFailure="false"
- stopOnIncomplete="false"
- stopOnSkipped="false"
- beStrictAboutTestsThatDoNotTestAnything="false">
- <testsuites>
- <testsuite name="CodeIgniter Core Test Suite">
- <directory suffix="test.php">./codeigniter/core</directory>
- <directory suffix="test.php">./codeigniter/helpers</directory>
- <directory suffix="test.php">./codeigniter/libraries</directory>
- </testsuite>
- </testsuites>
- <filter>
- <whitelist>
- <directory suffix=".php">../system/</directory>
- </whitelist>
- </filter>
-</phpunit>
diff --git a/tests/travis/mysql.phpunit.xml b/tests/travis/mysql.phpunit.xml
deleted file mode 100644
index 15063fd5a..000000000
--- a/tests/travis/mysql.phpunit.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<phpunit
- bootstrap="../Bootstrap.php"
- colors="true"
- convertNoticesToExceptions="true"
- convertWarningsToExceptions="true"
- stopOnError="false"
- stopOnFailure="false"
- stopOnIncomplete="false"
- stopOnSkipped="false"
- beStrictAboutTestsThatDoNotTestAnything="false">
- <php>
- <const name="DB_DRIVER" value="mysql"/>
- </php>
- <testsuites>
- <testsuite name="CodeIgniter Core Test Suite">
- <directory suffix="test.php">../codeigniter</directory>
- </testsuite>
- </testsuites>
- <filter>
- <whitelist addUncoveredFilesFromWhitelist="false">
- <directory suffix=".php">../../system</directory>
- </whitelist>
- </filter>
-</phpunit> \ No newline at end of file
diff --git a/tests/travis/mysqli.phpunit.xml b/tests/travis/mysqli.phpunit.xml
deleted file mode 100644
index c77aaa303..000000000
--- a/tests/travis/mysqli.phpunit.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<phpunit
- bootstrap="../Bootstrap.php"
- colors="true"
- convertNoticesToExceptions="true"
- convertWarningsToExceptions="true"
- stopOnError="false"
- stopOnFailure="false"
- stopOnIncomplete="false"
- stopOnSkipped="false"
- beStrictAboutTestsThatDoNotTestAnything="false">
- <php>
- <const name="DB_DRIVER" value="mysqli"/>
- </php>
- <testsuites>
- <testsuite name="CodeIgniter Core Test Suite">
- <directory suffix="test.php">../codeigniter</directory>
- </testsuite>
- </testsuites>
- <filter>
- <whitelist addUncoveredFilesFromWhitelist="false">
- <directory suffix=".php">../../system</directory>
- </whitelist>
- </filter>
-</phpunit> \ No newline at end of file
diff --git a/tests/travis/pdo/mysql.phpunit.xml b/tests/travis/pdo/mysql.phpunit.xml
deleted file mode 100644
index 1a9030ddf..000000000
--- a/tests/travis/pdo/mysql.phpunit.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<phpunit
- bootstrap="../../Bootstrap.php"
- colors="true"
- convertNoticesToExceptions="true"
- convertWarningsToExceptions="true"
- stopOnError="false"
- stopOnFailure="false"
- stopOnIncomplete="false"
- stopOnSkipped="false"
- beStrictAboutTestsThatDoNotTestAnything="false">
- <php>
- <const name="DB_DRIVER" value="pdo/mysql"/>
- </php>
- <testsuites>
- <testsuite name="CodeIgniter Core Test Suite">
- <directory suffix="test.php">../../codeigniter</directory>
- </testsuite>
- </testsuites>
- <filter>
- <whitelist addUncoveredFilesFromWhitelist="false">
- <directory suffix=".php">../../../system</directory>
- </whitelist>
- </filter>
-</phpunit> \ No newline at end of file
diff --git a/tests/travis/pdo/pgsql.phpunit.xml b/tests/travis/pdo/pgsql.phpunit.xml
deleted file mode 100644
index 22261ee7d..000000000
--- a/tests/travis/pdo/pgsql.phpunit.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<phpunit
- bootstrap="../../Bootstrap.php"
- colors="true"
- convertNoticesToExceptions="true"
- convertWarningsToExceptions="true"
- stopOnError="false"
- stopOnFailure="false"
- stopOnIncomplete="false"
- stopOnSkipped="false"
- beStrictAboutTestsThatDoNotTestAnything="false">
- <php>
- <const name="DB_DRIVER" value="pdo/pgsql"/>
- </php>
- <testsuites>
- <testsuite name="CodeIgniter Core Test Suite">
- <directory suffix="test.php">../../codeigniter</directory>
- </testsuite>
- </testsuites>
- <filter>
- <whitelist addUncoveredFilesFromWhitelist="false">
- <directory suffix=".php">../../../system</directory>
- </whitelist>
- </filter>
-</phpunit> \ No newline at end of file
diff --git a/tests/travis/pdo/sqlite.phpunit.xml b/tests/travis/pdo/sqlite.phpunit.xml
deleted file mode 100644
index 4b0ca2fe7..000000000
--- a/tests/travis/pdo/sqlite.phpunit.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<phpunit
- bootstrap="../../Bootstrap.php"
- colors="true"
- convertNoticesToExceptions="true"
- convertWarningsToExceptions="true"
- stopOnError="false"
- stopOnFailure="false"
- stopOnIncomplete="false"
- stopOnSkipped="false"
- beStrictAboutTestsThatDoNotTestAnything="false">
- <php>
- <const name="DB_DRIVER" value="pdo/sqlite"/>
- </php>
- <testsuites>
- <testsuite name="CodeIgniter Core Test Suite">
- <directory suffix="test.php">../../codeigniter</directory>
- </testsuite>
- </testsuites>
- <filter>
- <whitelist addUncoveredFilesFromWhitelist="false">
- <directory suffix=".php">../../../system</directory>
- </whitelist>
- </filter>
-</phpunit> \ No newline at end of file
diff --git a/tests/travis/pgsql.phpunit.xml b/tests/travis/pgsql.phpunit.xml
deleted file mode 100644
index 8d7979a0f..000000000
--- a/tests/travis/pgsql.phpunit.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<phpunit
- bootstrap="../Bootstrap.php"
- colors="true"
- convertNoticesToExceptions="true"
- convertWarningsToExceptions="true"
- stopOnError="false"
- stopOnFailure="false"
- stopOnIncomplete="false"
- stopOnSkipped="false"
- beStrictAboutTestsThatDoNotTestAnything="false">
- <php>
- <const name="DB_DRIVER" value="pgsql"/>
- </php>
- <testsuites>
- <testsuite name="CodeIgniter Core Test Suite">
- <directory suffix="test.php">../codeigniter</directory>
- </testsuite>
- </testsuites>
- <filter>
- <whitelist addUncoveredFilesFromWhitelist="false">
- <directory suffix=".php">../../system</directory>
- </whitelist>
- </filter>
-</phpunit> \ No newline at end of file
diff --git a/tests/travis/sqlite.phpunit.xml b/tests/travis/sqlite.phpunit.xml
deleted file mode 100644
index 4eaafc19f..000000000
--- a/tests/travis/sqlite.phpunit.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- bootstrap="../Bootstrap.php"
- colors="true"
- convertNoticesToExceptions="true"
- convertWarningsToExceptions="true"
- stopOnError="false"
- stopOnFailure="false"
- stopOnIncomplete="false"
- stopOnSkipped="false"
- beStrictAboutTestsThatDoNotTestAnything="false"
- xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
->
- <coverage includeUncoveredFiles="false">
- <include>
- <directory suffix=".php">../../system</directory>
- </include>
- </coverage>
- <php>
- <const name="DB_DRIVER" value="sqlite"/>
- </php>
- <testsuites>
- <testsuite name="CodeIgniter Core Test Suite">
- <directory suffix="test.php">../codeigniter</directory>
- </testsuite>
- </testsuites>
-</phpunit>
diff --git a/user_guide_src/Makefile b/user_guide_src/Makefile
deleted file mode 100644
index 519e1136f..000000000
--- a/user_guide_src/Makefile
+++ /dev/null
@@ -1,130 +0,0 @@
-# Makefile for Sphinx documentation
-#
-
-# You can set these variables from the command line.
-SPHINXOPTS =
-SPHINXBUILD = sphinx-build
-PAPER =
-BUILDDIR = build
-
-# Internal variables.
-PAPEROPT_a4 = -D latex_paper_size=a4
-PAPEROPT_letter = -D latex_paper_size=letter
-ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
-
-.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
-
-help:
- @echo "Please use \`make <target>' where <target> is one of"
- @echo " html to make standalone HTML files"
- @echo " dirhtml to make HTML files named index.html in directories"
- @echo " singlehtml to make a single large HTML file"
- @echo " pickle to make pickle files"
- @echo " json to make JSON files"
- @echo " htmlhelp to make HTML files and a HTML help project"
- @echo " qthelp to make HTML files and a qthelp project"
- @echo " devhelp to make HTML files and a Devhelp project"
- @echo " epub to make an epub"
- @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
- @echo " latexpdf to make LaTeX files and run them through pdflatex"
- @echo " text to make text files"
- @echo " man to make manual pages"
- @echo " changes to make an overview of all changed/added/deprecated items"
- @echo " linkcheck to check all external links for integrity"
- @echo " doctest to run all doctests embedded in the documentation (if enabled)"
-
-clean:
- -rm -rf $(BUILDDIR)/*
-
-html:
- $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
- @echo
- @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
-
-dirhtml:
- $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
- @echo
- @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
-
-singlehtml:
- $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
- @echo
- @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
-
-pickle:
- $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
- @echo
- @echo "Build finished; now you can process the pickle files."
-
-json:
- $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
- @echo
- @echo "Build finished; now you can process the JSON files."
-
-htmlhelp:
- $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
- @echo
- @echo "Build finished; now you can run HTML Help Workshop with the" \
- ".hhp project file in $(BUILDDIR)/htmlhelp."
-
-qthelp:
- $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
- @echo
- @echo "Build finished; now you can run "qcollectiongenerator" with the" \
- ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
- @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/CodeIgniter.qhcp"
- @echo "To view the help file:"
- @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/CodeIgniter.qhc"
-
-devhelp:
- $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
- @echo
- @echo "Build finished."
- @echo "To view the help file:"
- @echo "# mkdir -p $$HOME/.local/share/devhelp/CodeIgniter"
- @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/CodeIgniter"
- @echo "# devhelp"
-
-epub:
- $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
- @echo
- @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
-
-latex:
- $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
- @echo
- @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
- @echo "Run \`make' in that directory to run these through (pdf)latex" \
- "(use \`make latexpdf' here to do that automatically)."
-
-latexpdf:
- $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
- @echo "Running LaTeX files through pdflatex..."
- make -C $(BUILDDIR)/latex all-pdf
- @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
-
-text:
- $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
- @echo
- @echo "Build finished. The text files are in $(BUILDDIR)/text."
-
-man:
- $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
- @echo
- @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
-
-changes:
- $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
- @echo
- @echo "The overview file is in $(BUILDDIR)/changes."
-
-linkcheck:
- $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
- @echo
- @echo "Link check complete; look for any errors in the above output " \
- "or in $(BUILDDIR)/linkcheck/output.txt."
-
-doctest:
- $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
- @echo "Testing of doctests in the sources finished, look at the " \
- "results in $(BUILDDIR)/doctest/output.txt."
diff --git a/user_guide_src/README.rst b/user_guide_src/README.rst
deleted file mode 100644
index b31db7cf8..000000000
--- a/user_guide_src/README.rst
+++ /dev/null
@@ -1,65 +0,0 @@
-######################
-CodeIgniter User Guide
-######################
-
-******************
-Setup Instructions
-******************
-
-The CodeIgniter user guide uses Sphinx to manage the documentation and
-output it to various formats. Pages are written in human-readable
-`ReStructured Text <http://sphinx.pocoo.org/rest.html>`_ format.
-
-Prerequisites
-=============
-
-Sphinx requires Python 2.7. If you are on OS X, then you already have Python.
-You can confirm in a Terminal window by executing the ``python`` command
-without any parameters. It should load up and tell you which version you have
-installed.
-
-Note: If you're not on Python 2.7, then you must upgrade. E.g. Install 2.7.2
-from http://python.org/download/releases/2.7.2/
-
-Installation
-============
-
-1. Install `easy_install <http://peak.telecommunity.com/DevCenter/EasyInstall#installing-easy-install>`_
-2. ``easy_install "sphinx==1.6.3"``
-3. ``easy_install "sphinxcontrib-phpdomain==0.1.3.post1"``
-4. Install the CI Lexer which allows PHP, HTML, CSS, and JavaScript syntax highlighting in code examples (see *cilexer/README*)
-5. ``cd user_guide_src``
-6. ``make html``
-
-Editing and Creating Documentation
-==================================
-
-All of the source files exist under *source/* and is where you will add new
-documentation or modify existing documentation. Just as with code changes,
-we recommend working from feature branches and making pull requests to
-the *develop* branch of this repo.
-
-So where's the HTML?
-====================
-
-Obviously, the HTML documentation is what we care most about, as it is the
-primary documentation that our users encounter. Since revisions to the built
-files are not of value, they are not under source control. This also allows
-you to regenerate as necessary if you want to "preview" your work. Generating
-the HTML is very simple. From the root directory of your user guide repo
-fork issue the command you used at the end of the installation instructions::
-
- make html
-
-You will see it do a whiz-bang compilation, at which point the fully rendered
-user guide and images will be in *build/html/*. After the HTML has been built,
-each successive build will only rebuild files that have changed, saving
-considerable time. If for any reason you want to "reset" your build files,
-simply delete the *build* folder's contents and rebuild.
-
-***************
-Style Guideline
-***************
-
-Please refer to source/documentation/index.rst for general guidelines for
-using Sphinx to document CodeIgniter.
diff --git a/user_guide_src/cilexer/README b/user_guide_src/cilexer/README
deleted file mode 100644
index b9d9baf09..000000000
--- a/user_guide_src/cilexer/README
+++ /dev/null
@@ -1,22 +0,0 @@
-To install the CodeIgniter Lexer to Pygments, run:
-
- sudo python setup.py install
-
-Confirm with
-
- pygmentize -L
-
-
-You should see in the lexer output:
-
-* ci, codeigniter:
- CodeIgniter (filenames *.html, *.css, *.php, *.xml, *.static)
-
-You will need to run setup.py and install the cilexer package anytime after cilexer/cilexer.py is updated
-
-NOTE: Depending on how you installed Sphinx and Pygments,
-you may be installing to the wrong version.
-If you need to install to a different version of python
-specify its path when using setup.py, e.g.:
-
- sudo /usr/bin/python2.5 setup.py install \ No newline at end of file
diff --git a/user_guide_src/cilexer/cilexer/__init__.py b/user_guide_src/cilexer/cilexer/__init__.py
deleted file mode 100644
index 8b1378917..000000000
--- a/user_guide_src/cilexer/cilexer/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/user_guide_src/cilexer/cilexer/cilexer.py b/user_guide_src/cilexer/cilexer/cilexer.py
deleted file mode 100644
index 4ecfd0bc4..000000000
--- a/user_guide_src/cilexer/cilexer/cilexer.py
+++ /dev/null
@@ -1,56 +0,0 @@
-# CodeIgniter
-# https://codeigniter.com
-#
-# An open source application development framework for PHP
-#
-# This content is released under the MIT License (MIT)
-#
-# Copyright (c) 2014 - 2017, British Columbia Institute of Technology
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-#
-# Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
-# Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
-#
-# http://opensource.org/licenses/MIT MIT License
-
-import re
-import copy
-
-from pygments.lexer import DelegatingLexer
-from pygments.lexers.web import PhpLexer, HtmlLexer
-
-__all__ = ['CodeIgniterLexer']
-
-
-class CodeIgniterLexer(DelegatingLexer):
- """
- Handles HTML, PHP, JavaScript, and CSS is highlighted
- PHP is highlighted with the "startline" option
- """
-
- name = 'CodeIgniter'
- aliases = ['ci', 'codeigniter']
- filenames = ['*.html', '*.css', '*.php', '*.xml', '*.static']
- mimetypes = ['text/html', 'application/xhtml+xml']
-
- def __init__(self, **options):
- super(CodeIgniterLexer, self).__init__(HtmlLexer,
- PhpLexer,
- startinline=True)
diff --git a/user_guide_src/cilexer/setup.py b/user_guide_src/cilexer/setup.py
deleted file mode 100644
index db4bbea43..000000000
--- a/user_guide_src/cilexer/setup.py
+++ /dev/null
@@ -1,23 +0,0 @@
-"""
-Install and setup CodeIgniter highlighting for Pygments.
-"""
-
-from setuptools import setup
-
-entry_points = """
-[pygments.lexers]
-cilexer = cilexer.cilexer:CodeIgniterLexer
-"""
-
-setup(
- name='pycilexer',
- version='0.1',
- description=__doc__,
- author="EllisLab, Inc.",
- packages=['cilexer'],
- install_requires=(
- 'sphinx >= 1.0.7',
- 'sphinxcontrib-phpdomain >= 0.1.3-1'
- ),
- entry_points=entry_points
-)
diff --git a/user_guide_src/source/DCO.rst b/user_guide_src/source/DCO.rst
deleted file mode 100644
index c8f9b49c6..000000000
--- a/user_guide_src/source/DCO.rst
+++ /dev/null
@@ -1,27 +0,0 @@
-#####################################
-Developer's Certificate of Origin 1.1
-#####################################
-
-By making a contribution to this project, I certify that:
-
-(1) The contribution was created in whole or in part by me and I
- have the right to submit it under the open source license
- indicated in the file; or
-
-(2) The contribution is based upon previous work that, to the best
- of my knowledge, is covered under an appropriate open source
- license and I have the right under that license to submit that
- work with modifications, whether created in whole or in part
- by me, under the same open source license (unless I am
- permitted to submit under a different license), as indicated
- in the file; or
-
-(3) The contribution was provided directly to me by some other
- person who certified (1), (2) or (3) and I have not modified
- it.
-
-(4) I understand and agree that this project and the contribution
- are public and that a record of the contribution (including all
- personal information I submit with it, including my sign-off) is
- maintained indefinitely and may be redistributed consistent with
- this project or the open source license(s) involved.
diff --git a/user_guide_src/source/_themes/sphinx_rtd_theme/LICENSE b/user_guide_src/source/_themes/sphinx_rtd_theme/LICENSE
deleted file mode 100644
index 921f07388..000000000
--- a/user_guide_src/source/_themes/sphinx_rtd_theme/LICENSE
+++ /dev/null
@@ -1,20 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2013 Dave Snider
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
-the Software, and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
-FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/user_guide_src/source/_themes/sphinx_rtd_theme/__init__.py b/user_guide_src/source/_themes/sphinx_rtd_theme/__init__.py
deleted file mode 100644
index 1440863d6..000000000
--- a/user_guide_src/source/_themes/sphinx_rtd_theme/__init__.py
+++ /dev/null
@@ -1,17 +0,0 @@
-"""Sphinx ReadTheDocs theme.
-
-From https://github.com/ryan-roemer/sphinx-bootstrap-theme.
-
-"""
-import os
-
-VERSION = (0, 1, 5)
-
-__version__ = ".".join(str(v) for v in VERSION)
-__version_full__ = __version__
-
-
-def get_html_theme_path():
- """Return list of HTML theme paths."""
- cur_dir = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
- return cur_dir
diff --git a/user_guide_src/source/_themes/sphinx_rtd_theme/breadcrumbs.html b/user_guide_src/source/_themes/sphinx_rtd_theme/breadcrumbs.html
deleted file mode 100644
index 60343661a..000000000
--- a/user_guide_src/source/_themes/sphinx_rtd_theme/breadcrumbs.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<div role="navigation" aria-label="breadcrumbs navigation">
- <ul class="wy-breadcrumbs">
- <li><a href="{{ pathto(master_doc) }}">Docs</a> &raquo;</li>
- {% for doc in parents %}
- <li><a href="{{ doc.link|e }}">{{ doc.title }}</a> &raquo;</li>
- {% endfor %}
- <li>{{ title }}</li>
- <li class="wy-breadcrumbs-aside">
- {% if display_github %}
- <a href="https://github.com/{{ github_user }}/{{ github_repo }}/blob/{{ github_version }}{{ conf_py_path }}{{ pagename }}{{ source_suffix }}" class="fa fa-github"> Edit on GitHub</a>
- {% elif display_bitbucket %}
- <a href="https://bitbucket.org/{{ bitbucket_user }}/{{ bitbucket_repo }}/src/{{ bitbucket_version}}{{ conf_py_path }}{{ pagename }}{{ source_suffix }}" class="fa fa-bitbucket"> Edit on Bitbucket</a>
- {% elif show_source and has_source and sourcename %}
- <a href="{{ pathto('_sources/' + sourcename, true)|e }}" rel="nofollow"> View page source</a>
- {% endif %}
- </li>
- <div style="float:right;margin-left:5px;" id="closeMe">
- <img title="Classic Layout" alt="classic layout" src="data:image/gif;base64,R0lGODlhFAAUAJEAAAAAADMzM////wAAACH5BAUUAAIALAAAAAAUABQAAAImlI+py+0PU5gRBRDM3DxbWoXis42X13USOLauUIqnlsaH/eY6UwAAOw==" />
- </div>
- </ul>
- <hr/>
-</div>
diff --git a/user_guide_src/source/_themes/sphinx_rtd_theme/footer.html b/user_guide_src/source/_themes/sphinx_rtd_theme/footer.html
deleted file mode 100644
index 94f6dc371..000000000
--- a/user_guide_src/source/_themes/sphinx_rtd_theme/footer.html
+++ /dev/null
@@ -1,33 +0,0 @@
-<footer>
- {% if next or prev %}
- <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
- {% if next %}
- <a href="{{ next.link|e }}" class="btn btn-neutral float-right" title="{{ next.title|striptags|e }}">Next <span class="fa fa-arrow-circle-right"></span></a>
- {% endif %}
- {% if prev %}
- <a href="{{ prev.link|e }}" class="btn btn-neutral" title="{{ prev.title|striptags|e }}"><span class="fa fa-arrow-circle-left"></span> Previous</a>
- {% endif %}
- </div>
- {% endif %}
-
- <hr/>
-
- <div role="contentinfo">
- <p>
- {%- if show_copyright %}
- {%- if hasdoc('copyright') %}
- {% trans path=pathto('copyright'), copyright=copyright|e %}&copy; <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %}
- {%- else %}
- {% trans copyright=copyright|e %}&copy; Copyright {{ copyright }}.{% endtrans %}
- {%- endif %}
- {%- endif %}
-
- {%- if last_updated %}
- {% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}
- {%- endif %}
- </p>
- </div>
-
- {% trans %}Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>{% endtrans %}.
-
-</footer>
diff --git a/user_guide_src/source/_themes/sphinx_rtd_theme/layout.html b/user_guide_src/source/_themes/sphinx_rtd_theme/layout.html
deleted file mode 100644
index cc30e5ba4..000000000
--- a/user_guide_src/source/_themes/sphinx_rtd_theme/layout.html
+++ /dev/null
@@ -1,166 +0,0 @@
-{# TEMPLATE VAR SETTINGS #}
-{%- set url_root = pathto('', 1) %}
-{%- if url_root == '#' %}{% set url_root = '' %}{% endif %}
-{%- if not embedded and docstitle %}
- {%- set titlesuffix = " &mdash; "|safe + docstitle|e %}
-{%- else %}
- {%- set titlesuffix = "" %}
-{%- endif %}
-
-<!DOCTYPE html>
-<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
-<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
-<head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- {% block htmltitle %}
- <title>{{ title|striptags|e }}{{ titlesuffix }}</title>
- {% endblock %}
-
- {# FAVICON #}
- {% if favicon %}
- <link rel="shortcut icon" href="{{ pathto('_static/' + favicon, 1) }}"/>
- {% endif %}
-
- {# CSS #}
- <link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'>
-
- {# OPENSEARCH #}
- {% if not embedded %}
- {% if use_opensearch %}
- <link rel="search" type="application/opensearchdescription+xml" title="{% trans docstitle=docstitle|e %}Search within {{ docstitle }}{% endtrans %}" href="{{ pathto('_static/opensearch.xml', 1) }}"/>
- {% endif %}
-
- {% endif %}
-
- {# RTD hosts this file, so just load on non RTD builds #}
- {% if not READTHEDOCS %}
- <link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" />
- {% endif %}
-
- {% for cssfile in css_files %}
- <link rel="stylesheet" href="{{ pathto(cssfile, 1) }}" type="text/css" />
- {% endfor %}
-
- {%- block linktags %}
- {%- if hasdoc('about') %}
- <link rel="author" title="{{ _('About these documents') }}"
- href="{{ pathto('about') }}"/>
- {%- endif %}
- {%- if hasdoc('genindex') %}
- <link rel="index" title="{{ _('Index') }}"
- href="{{ pathto('genindex') }}"/>
- {%- endif %}
- {%- if hasdoc('search') %}
- <link rel="search" title="{{ _('Search') }}" href="{{ pathto('search') }}"/>
- {%- endif %}
- {%- if hasdoc('copyright') %}
- <link rel="copyright" title="{{ _('Copyright') }}" href="{{ pathto('copyright') }}"/>
- {%- endif %}
- <link rel="top" title="{{ docstitle|e }}" href="{{ pathto('index') }}"/>
- {%- if parents %}
- <link rel="up" title="{{ parents[-1].title|striptags|e }}" href="{{ parents[-1].link|e }}"/>
- {%- endif %}
- {%- if next %}
- <link rel="next" title="{{ next.title|striptags|e }}" href="{{ next.link|e }}"/>
- {%- endif %}
- {%- if prev %}
- <link rel="prev" title="{{ prev.title|striptags|e }}" href="{{ prev.link|e }}"/>
- {%- endif %}
- {%- endblock %}
- {%- block extrahead %} {% endblock %}
-
- {# Keep modernizr in head - http://modernizr.com/docs/#installing #}
- <script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js" integrity="sha384-vEQs6vKzb8v6+GpGDCnXUQ6aa2DYtn5LTi/tA/85iEZfXN0nAYj0shvYo8ldQQ7m" crossorigin="anonymous"></script>
-
-</head>
-
-<body class="wy-body-for-nav" role="document">
-
- {% include "pulldown.html" %}
-
- <div class="wy-grid-for-nav">
-
- {# SIDE NAV, TOGGLES ON MOBILE #}
- <nav data-toggle="wy-nav-shift" class="wy-nav-side">
- <div class="wy-side-nav-search">
- {% block sidebartitle %}
- <a href="{{ pathto(master_doc) }}" class="fa fa-home"> {{ project }}</a>
- {% endblock %}
- {% include "searchbox.html" %}
- </div>
-
- <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
- {% block menu %}
- {% set toctree = toctree(maxdepth=2, collapse=False, includehidden=False) %}
- {% if toctree %}
- {{ toctree }}
- {% else %}
- <!-- Local TOC -->
- <div class="local-toc">{{ toc }}</div>
- {% endif %}
- {% endblock %}
- </div>
- &nbsp;
- </nav>
-
- <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
-
- {# MOBILE NAV, TRIGGLES SIDE NAV ON TOGGLE #}
- <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
- <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
- <a href="{{ pathto(master_doc) }}">{{ project }}</a>
- </nav>
-
-
- {# PAGE CONTENT #}
- <div class="wy-nav-content">
- <div class="rst-content">
- {% include "breadcrumbs.html" %}
- <div role="main" class="document">
- {% block body %}{% endblock %}
- </div>
- {% include "footer.html" %}
- </div>
- </div>
-
- </section>
-
- </div>
- {% include "versions.html" %}
-
- {% if not embedded %}
-
- <script type="text/javascript">
- var DOCUMENTATION_OPTIONS = {
- URL_ROOT:'{{ url_root }}',
- VERSION:'{{ release|e }}',
- COLLAPSE_INDEX:false,
- FILE_SUFFIX:'{{ '' if no_search_suffix else file_suffix }}',
- HAS_SOURCE: {{ has_source|lower }}
- };
- </script>
- {%- for scriptfile in script_files %}
- <script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script>
- {%- endfor %}
-
- {% endif %}
-
- {# RTD hosts this file, so just load on non RTD builds #}
- {% if not READTHEDOCS %}
- <script type="text/javascript" src="{{ pathto('_static/js/theme.js', 1) }}"></script>
- {% endif %}
-
- {# STICKY NAVIGATION #}
- {% if theme_sticky_navigation %}
- <script type="text/javascript">
- jQuery(function () {
- SphinxRtdTheme.StickyNav.enable();
- });
- </script>
- {% endif %}
-
- {%- block footer %} {% endblock %}
-
-</body>
-</html>
diff --git a/user_guide_src/source/_themes/sphinx_rtd_theme/layout_old.html b/user_guide_src/source/_themes/sphinx_rtd_theme/layout_old.html
deleted file mode 100644
index deb8df2a1..000000000
--- a/user_guide_src/source/_themes/sphinx_rtd_theme/layout_old.html
+++ /dev/null
@@ -1,205 +0,0 @@
-{#
- basic/layout.html
- ~~~~~~~~~~~~~~~~~
-
- Master layout template for Sphinx themes.
-
- :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-#}
-{%- block doctype -%}
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-{%- endblock %}
-{%- set reldelim1 = reldelim1 is not defined and ' &raquo;' or reldelim1 %}
-{%- set reldelim2 = reldelim2 is not defined and ' |' or reldelim2 %}
-{%- set render_sidebar = (not embedded) and (not theme_nosidebar|tobool) and
- (sidebars != []) %}
-{%- set url_root = pathto('', 1) %}
-{# XXX necessary? #}
-{%- if url_root == '#' %}{% set url_root = '' %}{% endif %}
-{%- if not embedded and docstitle %}
- {%- set titlesuffix = " &mdash; "|safe + docstitle|e %}
-{%- else %}
- {%- set titlesuffix = "" %}
-{%- endif %}
-
-{%- macro relbar() %}
- <div class="related">
- <h3>{{ _('Navigation') }}</h3>
- <ul>
- {%- for rellink in rellinks %}
- <li class="right" {% if loop.first %}style="margin-right: 10px"{% endif %}>
- <a href="{{ pathto(rellink[0]) }}" title="{{ rellink[1]|striptags|e }}"
- {{ accesskey(rellink[2]) }}>{{ rellink[3] }}</a>
- {%- if not loop.first %}{{ reldelim2 }}{% endif %}</li>
- {%- endfor %}
- {%- block rootrellink %}
- <li><a href="{{ pathto(master_doc) }}">{{ shorttitle|e }}</a>{{ reldelim1 }}</li>
- {%- endblock %}
- {%- for parent in parents %}
- <li><a href="{{ parent.link|e }}" {% if loop.last %}{{ accesskey("U") }}{% endif %}>{{ parent.title }}</a>{{ reldelim1 }}</li>
- {%- endfor %}
- {%- block relbaritems %} {% endblock %}
- </ul>
- </div>
-{%- endmacro %}
-
-{%- macro sidebar() %}
- {%- if render_sidebar %}
- <div class="sphinxsidebar">
- <div class="sphinxsidebarwrapper">
- {%- block sidebarlogo %}
- {%- if logo %}
- <p class="logo"><a href="{{ pathto(master_doc) }}">
- <img class="logo" src="{{ pathto('_static/' + logo, 1) }}" alt="Logo"/>
- </a></p>
- {%- endif %}
- {%- endblock %}
- {%- if sidebars != None %}
- {#- new style sidebar: explicitly include/exclude templates #}
- {%- for sidebartemplate in sidebars %}
- {%- include sidebartemplate %}
- {%- endfor %}
- {%- else %}
- {#- old style sidebars: using blocks -- should be deprecated #}
- {%- block sidebartoc %}
- {%- include "localtoc.html" %}
- {%- endblock %}
- {%- block sidebarrel %}
- {%- include "relations.html" %}
- {%- endblock %}
- {%- block sidebarsourcelink %}
- {%- include "sourcelink.html" %}
- {%- endblock %}
- {%- if customsidebar %}
- {%- include customsidebar %}
- {%- endif %}
- {%- block sidebarsearch %}
- {%- include "searchbox.html" %}
- {%- endblock %}
- {%- endif %}
- </div>
- </div>
- {%- endif %}
-{%- endmacro %}
-
-{%- macro script() %}
- <script type="text/javascript">
- var DOCUMENTATION_OPTIONS = {
- URL_ROOT: '{{ url_root }}',
- VERSION: '{{ release|e }}',
- COLLAPSE_INDEX: false,
- FILE_SUFFIX: '{{ '' if no_search_suffix else file_suffix }}',
- HAS_SOURCE: {{ has_source|lower }}
- };
- </script>
- {%- for scriptfile in script_files %}
- <script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script>
- {%- endfor %}
-{%- endmacro %}
-
-{%- macro css() %}
- <link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" />
- <link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" />
- {%- for cssfile in css_files %}
- <link rel="stylesheet" href="{{ pathto(cssfile, 1) }}" type="text/css" />
- {%- endfor %}
-{%- endmacro %}
-
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset={{ encoding }}" />
- {{ metatags }}
- {%- block htmltitle %}
- <title>{{ title|striptags|e }}{{ titlesuffix }}</title>
- {%- endblock %}
- {{ css() }}
- {%- if not embedded %}
- {{ script() }}
- {%- if use_opensearch %}
- <link rel="search" type="application/opensearchdescription+xml"
- title="{% trans docstitle=docstitle|e %}Search within {{ docstitle }}{% endtrans %}"
- href="{{ pathto('_static/opensearch.xml', 1) }}"/>
- {%- endif %}
- {%- if favicon %}
- <link rel="shortcut icon" href="{{ pathto('_static/' + favicon, 1) }}"/>
- {%- endif %}
- {%- endif %}
-{%- block linktags %}
- {%- if hasdoc('about') %}
- <link rel="author" title="{{ _('About these documents') }}" href="{{ pathto('about') }}" />
- {%- endif %}
- {%- if hasdoc('genindex') %}
- <link rel="index" title="{{ _('Index') }}" href="{{ pathto('genindex') }}" />
- {%- endif %}
- {%- if hasdoc('search') %}
- <link rel="search" title="{{ _('Search') }}" href="{{ pathto('search') }}" />
- {%- endif %}
- {%- if hasdoc('copyright') %}
- <link rel="copyright" title="{{ _('Copyright') }}" href="{{ pathto('copyright') }}" />
- {%- endif %}
- <link rel="top" title="{{ docstitle|e }}" href="{{ pathto('index') }}" />
- {%- if parents %}
- <link rel="up" title="{{ parents[-1].title|striptags|e }}" href="{{ parents[-1].link|e }}" />
- {%- endif %}
- {%- if next %}
- <link rel="next" title="{{ next.title|striptags|e }}" href="{{ next.link|e }}" />
- {%- endif %}
- {%- if prev %}
- <link rel="prev" title="{{ prev.title|striptags|e }}" href="{{ prev.link|e }}" />
- {%- endif %}
-{%- endblock %}
-{%- block extrahead %} {% endblock %}
- </head>
- <body>
-{%- block header %}{% endblock %}
-
-{%- block relbar1 %}{{ relbar() }}{% endblock %}
-
-{%- block content %}
- {%- block sidebar1 %} {# possible location for sidebar #} {% endblock %}
-
- <div class="document">
- {%- block document %}
- <div class="documentwrapper">
- {%- if render_sidebar %}
- <div class="bodywrapper">
- {%- endif %}
- <div class="body">
- {% block body %} {% endblock %}
- </div>
- {%- if render_sidebar %}
- </div>
- {%- endif %}
- </div>
- {%- endblock %}
-
- {%- block sidebar2 %}{{ sidebar() }}{% endblock %}
- <div class="clearer"></div>
- </div>
-{%- endblock %}
-
-{%- block relbar2 %}{{ relbar() }}{% endblock %}
-
-{%- block footer %}
- <div class="footer">
- {%- if show_copyright %}
- {%- if hasdoc('copyright') %}
- {% trans path=pathto('copyright'), copyright=copyright|e %}&copy; <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %}
- {%- else %}
- {% trans copyright=copyright|e %}&copy; Copyright {{ copyright }}.{% endtrans %}
- {%- endif %}
- {%- endif %}
- {%- if last_updated %}
- {% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}
- {%- endif %}
- {%- if show_sphinx %}
- {% trans sphinx_version=sphinx_version|e %}Created using <a href="http://sphinx-doc.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %}
- {%- endif %}
- </div>
- <p>asdf asdf asdf asdf 22</p>
-{%- endblock %}
- </body>
-</html>
-
diff --git a/user_guide_src/source/_themes/sphinx_rtd_theme/pulldown.html b/user_guide_src/source/_themes/sphinx_rtd_theme/pulldown.html
deleted file mode 100644
index 7877346d8..000000000
--- a/user_guide_src/source/_themes/sphinx_rtd_theme/pulldown.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<div id="nav">
- <div id="nav_inner">
- {% block ciNav %}
- {% set toctree = toctree(maxdepth=2, collapse=False, includehidden=False) %}
- {% if toctree %}
- <div id="pulldown-menu" class="ciNav">
- {{ toctree }}
- </div>
- {% endif %}
- {% endblock %}
- </div>
-</div>
-<div id="nav2">
- <a href="#" id="openToc">
- <img src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAARgAA/+4ADkFkb2JlAGTAAAAAAf/bAIQABAMDAwMDBAMDBAYEAwQGBwUEBAUHCAYGBwYGCAoICQkJCQgKCgwMDAwMCgwMDQ0MDBERERERFBQUFBQUFBQUFAEEBQUIBwgPCgoPFA4ODhQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQU/8AAEQgAKwCaAwERAAIRAQMRAf/EAHsAAQAABwEBAAAAAAAAAAAAAAABAwQFBgcIAgkBAQAAAAAAAAAAAAAAAAAAAAAQAAEDAwICBwYEAgsAAAAAAAIBAwQAEQUSBiEHkROTVNQWGDFBUVIUCHEiMtOUFWGBobHRQlMkZIRVEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwDSC+ygkOOaUoKigUCgUCgUCgUCgUCgUCgUCgkuGguIP9FBMFb0Hqg7We+3jlmIqqYFf4ub+/QYlnOR/LqIBKGFUbf8qWv971BytQXXE7Y3Lnm3HsFhp2TaZJAdchRXpIgSpdEJWxJEW3xoKV7F5OMy7JkQn2o7D6w33XGjEAkoiqrJEqIiOIiKuhePCgqp22dyYyS3CyWHnQ5joG61HkRnmnTbaFSMhExRVQRRVJU9iUHjE7ez+fJ0MFipmUNhBV8YUd2SoIV9KkjQla9ltegttBdPLW4/qocL+UTfrMiHW4+P9M71shuyrqaHTcxsl7jegpsji8nh5ZwMvDfgTm0RTjSmjYdFCS6KoOIipdFunCgmNYTMv457MMY6U7iI6oMieDDhRm1VbIhuoOkbqtuK0Hpzb+eZcYZexUxt6UyUqK2cd0SdjtgrhOgijcgERUlJOCIl6CpgbP3blRI8XgMjNARAyKNDfeRBdFDBVUAXgQrqH4pxoJTu2NysY97LP4ac1io5q1InHFeGO24LnVKJuKOkSQ/yKir+rh7aCLG1dzypZQI2FnvTgccYOM3FeN0XWERXAUEFVQgQkUktdLpegm+Td3/Xli/L+S/mYNJIOF9G/wBeLKrZHFb0akG6W1WtQWSg3Dyg5e7V3fipE3O4/wCrktyzYA+ufas2LbZIlmnAT2kvuoN1wft95augilglX/tzP3qCu9O3LL/wV/i5v79BvmTADq14UGu91467Z6U9y0HzH/ncj/U/sT/CgynZG7I2NezpZGUjIycJkYkZSG+uQ81pbBNKLxJfjwoMqZ3/ALYHl35AJ7/cuwHcu5k7r1Q5pHetBjquqVVJWGxj9Zrtcl/Ggy3dHMvauR3HFZj5nHNxSyW5JISYDMoIwx8tFIGHZhPNaykGapr6rUAiicEoMG21lMRj8buPAz8xhJrr7uOeiPTCyAwXUaGR1mgozbTusOsFLEiJ7fbQa/h7gcjy2H3V6xppwDNtUSxCJIqp7valBuWVzJ22xuCROXNNZiJkMtms0DbjUkAZjzoDrTMd9dDRI44ZC2YsrYdKWP2WDT2S3N9dNdlRYrGMYc06IURXSYb0igrpWS485xVNS6nF4rwslkoMwnbpgZLB7bmt5uMweAhDEl4B5uSLzzqTnnyVpW2jaJHRMSIjdDiiotvy3DOE5rYTEbkl5yFn28k7JyG4c7AU2HtLH1uKfaiMPI40CdYbpNtmLdwTSn5rewLNld+7TLdeal4WarWBkbVKBjgdElMJJwAAY5fl4kB3b1fp4XvagsGS3FjJfLzDNtS8aeXx7LzT7TyzByQE5PccRGRC0ZRUDRV6y62vbjagzLmJzS2vuPK43JY6aP1TW6Jz+RIWyFtyC06y3EkiiinAo7YCqfq1AqqnGgsOH3lhZO8d1pmcpB8j5XIm9OYlBJSQ/FSS4427DKO0RC8AlcEMhFdViRR1WDWR5t3WXVuL1d106kG9vdeye2g60+1FDyW0shIcXVpyroXt8I8dfd+NB1vioAdWnD3UF1+gD4UFc6CEKpagxXN43rwJLUHz7yX2c8zokt9uHlsPIhA4aRnnHJTLptIS6CNsY7iASpxUUMkReGpfbQW0vtN5pitvrsN28rwtBD0nc0+/Yft5XhaB6TuaXfsP28rwtA9J3NPv2H7eV4Wgek7mn37D9vK8LQPSdzT79h+3leFoHpO5pd+w/byvC0D0nc0u/Yft5XhaB6TuaXfsP28rwtA9J3NLv2H7eV4Wgek7ml37D9vK8LQPSdzS79h+3leFoHpO5p9+w/byvC0E9r7Reazy2HIYVPxkS/CUHVn26cosxyv2g7h89LYmZSXOenvLEQ1YaQ222RATcQCP8rSGqqA8S02W2pQ6FhMoAIlqCtsnwoCpdKClejI4i3Sgtb+GBxVuNBSFt1pV/RQefLjPyUDy4z8lA8uM/JQPLjPyUDy4z8lA8uM/JQPLjPyUDy4z8lA8uM/JQPLjPyUDy4z8lA8utJ/koJ7WCbBU/LQXOPAFq1koK8B0pag90CggtBBf6qB0UDooHRQOigdFA6KB0UDooHRQOigdFA6KB0UDooI0EaBQf//Z" title="Toggle Table of Contents" alt="Toggle Table of Contents" />
- </a>
-</div>
diff --git a/user_guide_src/source/_themes/sphinx_rtd_theme/search.html b/user_guide_src/source/_themes/sphinx_rtd_theme/search.html
deleted file mode 100644
index e3aa9b5c6..000000000
--- a/user_guide_src/source/_themes/sphinx_rtd_theme/search.html
+++ /dev/null
@@ -1,50 +0,0 @@
-{#
- basic/search.html
- ~~~~~~~~~~~~~~~~~
-
- Template for the search page.
-
- :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-#}
-{%- extends "layout.html" %}
-{% set title = _('Search') %}
-{% set script_files = script_files + ['_static/searchtools.js'] %}
-{% block footer %}
- <script type="text/javascript">
- jQuery(function() { Search.loadIndex("{{ pathto('searchindex.js', 1) }}"); });
- </script>
- {# this is used when loading the search index using $.ajax fails,
- such as on Chrome for documents on localhost #}
- <script type="text/javascript" id="searchindexloader"></script>
- {{ super() }}
-{% endblock %}
-{% block body %}
- <noscript>
- <div id="fallback" class="admonition warning">
- <p class="last">
- {% trans %}Please activate JavaScript to enable the search
- functionality.{% endtrans %}
- </p>
- </div>
- </noscript>
-
- {% if search_performed %}
- <h2>{{ _('Search Results') }}</h2>
- {% if not search_results %}
- <p>{{ _('Your search did not match any documents. Please make sure that all words are spelled correctly and that you\'ve selected enough categories.') }}</p>
- {% endif %}
- {% endif %}
- <div id="search-results">
- {% if search_results %}
- <ul>
- {% for href, caption, context in search_results %}
- <li>
- <a href="{{ pathto(item.href) }}">{{ caption }}</a>
- <p class="context">{{ context|e }}</p>
- </li>
- {% endfor %}
- </ul>
- {% endif %}
- </div>
-{% endblock %}
diff --git a/user_guide_src/source/_themes/sphinx_rtd_theme/searchbox.html b/user_guide_src/source/_themes/sphinx_rtd_theme/searchbox.html
deleted file mode 100644
index 35ad52c5f..000000000
--- a/user_guide_src/source/_themes/sphinx_rtd_theme/searchbox.html
+++ /dev/null
@@ -1,9 +0,0 @@
-{%- if builder != 'singlehtml' %}
-<div role="search">
- <form id="rtd-search-form" class="wy-form" action="{{ pathto('search') }}" method="get">
- <input type="text" name="q" placeholder="Search docs" />
- <input type="hidden" name="check_keywords" value="yes" />
- <input type="hidden" name="area" value="default" />
- </form>
-</div>
-{%- endif %}
diff --git a/user_guide_src/source/_themes/sphinx_rtd_theme/static/css/badge_only.css b/user_guide_src/source/_themes/sphinx_rtd_theme/static/css/badge_only.css
deleted file mode 100644
index 7e17fb148..000000000
--- a/user_guide_src/source/_themes/sphinx_rtd_theme/static/css/badge_only.css
+++ /dev/null
@@ -1,2 +0,0 @@
-.fa:before{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:""}.clearfix:after{clear:both}@font-face{font-family:FontAwesome;font-weight:normal;font-style:normal;src:url("../font/fontawesome_webfont.eot");src:url("../font/fontawesome_webfont.eot?#iefix") format("embedded-opentype"),url("../font/fontawesome_webfont.woff") format("woff"),url("../font/fontawesome_webfont.ttf") format("truetype"),url("../font/fontawesome_webfont.svg#FontAwesome") format("svg")}.fa:before{display:inline-block;font-family:FontAwesome;font-style:normal;font-weight:normal;line-height:1;text-decoration:inherit}a .fa{display:inline-block;text-decoration:inherit}li .fa{display:inline-block}li .fa-large:before,li .fa-large:before{width:1.875em}ul.fas{list-style-type:none;margin-left:2em;text-indent:-0.8em}ul.fas li .fa{width:0.8em}ul.fas li .fa-large:before,ul.fas li .fa-large:before{vertical-align:baseline}.fa-book:before{content:""}.icon-book:before{content:""}.fa-caret-down:before{content:""}.icon-caret-down:before{content:""}.fa-caret-up:before{content:""}.icon-caret-up:before{content:""}.fa-caret-left:before{content:""}.icon-caret-left:before{content:""}.fa-caret-right:before{content:""}.icon-caret-right:before{content:""}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;border-top:solid 10px #343131;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;z-index:400}.rst-versions a{color:#2980B9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27AE60;*zoom:1}.rst-versions .rst-current-version:before,.rst-versions .rst-current-version:after{display:table;content:""}.rst-versions .rst-current-version:after{clear:both}.rst-versions .rst-current-version .fa{color:#fcfcfc}.rst-versions .rst-current-version .fa-book{float:left}.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#E74C3C;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#F1C40F;color:#000}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:gray;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:solid 1px #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px}.rst-versions.rst-badge .icon-book{float:none}.rst-versions.rst-badge .fa-book{float:none}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book{float:left}.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge .rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width: 768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}img{width:100%;height:auto}}
-/*# sourceMappingURL=badge_only.css.map */
diff --git a/user_guide_src/source/_themes/sphinx_rtd_theme/static/css/citheme.css b/user_guide_src/source/_themes/sphinx_rtd_theme/static/css/citheme.css
deleted file mode 100644
index a2a3b3e91..000000000
--- a/user_guide_src/source/_themes/sphinx_rtd_theme/static/css/citheme.css
+++ /dev/null
@@ -1,88 +0,0 @@
-@import 'theme.css';
-
-.highlighted {
- padding: 0px !important;
- font-weight: inherit !important;
- background-color: #f1d40f !important;
-}
-
-#nav {
- background-color: #494949;
- margin: 0;
- padding: 0;
- display: none;
-}
-
-#nav2 {
- background: url(data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAARgAA/+4ADkFkb2JlAGTAAAAAAf/bAIQABAMDAwMDBAMDBAYEAwQGBwUEBAUHCAYGBwYGCAoICQkJCQgKCgwMDAwMCgwMDQ0MDBERERERFBQUFBQUFBQUFAEEBQUIBwgPCgoPFA4ODhQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQU/8AAEQgAMgAzAwERAAIRAQMRAf/EAFkAAQADAQAAAAAAAAAAAAAAAAABBQcIAQEAAAAAAAAAAAAAAAAAAAAAEAABAgYDAAAAAAAAAAAAAAAAAVERAtMEFJRVBxgRAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/AMRAAAAAAAA7a87dZcCu3e1wHnbrLgV272uA87dZcCu3e1wHnbrLgV272uA87dZcCu3e1wHnbrLgV272uA87dZcCu3e1wN/wJGAYEjAMCRgGBIwDAkYBgSMAwJGAsoIwCCMAgjAIIwCCMAgjAIIwEgAAAAAAAAAAAAAAAAAAAAAAAH//2Q==) repeat-x scroll left top transparent;
- margin: 0;
- padding: 0 310px 0 0;
- text-align: right;
- display: none;
-}
-
-#nav_inner {
- background-color: transparent;
- font-family: Lucida Grande,Verdana,Geneva,sans-serif;
- font-size: 11px;
- margin: 0;
- padding: 8px 12px 0 20px;
-}
-
-div#pulldown-menu {
- -moz-column-count: 5;
- -moz-column-gap: 20px;
- -webkit-column-count: 5;
- -webkit-column-gap: 20px;
- column-count: 5;
- column-gap: 20px;
- -webkit-column-rule: 1px groove #b8b8b8;
- -moz-column-rule: 1px groove #b8b8b8;
- column-rule: 1px groove #b8b8b8;
-}
-
-#pulldown-menu > ul {
- padding-top: 10px;
- padding-bottom: 10px;
- -webkit-column-break-inside: avoid; /*Chrome, Safari*/
- display: table; /*Firefox*/
- break-inside: avoid; /*IE 10+ theoretically*/
-}
-
-#pulldown-menu ul li.toctree-l2 {
- font-size: 0.82em;
- margin-left: 20px;
- list-style-image: url(data:image/gif;base64,R0lGODlhCwAJALMJAO7u7uTk5PLy8unp6fb29t7e3vj4+Li4uIWFheTk5AAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAkALAAAAAALAAkAAAQoMJ1JqTQ4Z3SI98jHCWSJkByArCyiHkMsIzEX3DeCc0Xv+4hEa5iIAAA7);
-}
-
-#pulldown-menu ul li.toctree-l1 a {
- color: #ffffff;
- text-decoration: none;
- font-size: 12px;
- font-family: "Roboto Slab","ff-tisa-web-pro","Georgia",Arial,sans-serif;
- font-weight: 700;
-}
-
-#pulldown-menu ul li.toctree-l2 a {
- text-decoration: none;
- font-size: 11px;
- line-height: 1.4em;
- font-weight: 300;
- font-family: Lucida Grande,Verdana,Geneva,sans-serif;
- color: #aaaaaa;
-}
-
-/*hide pulldown menu on mobile devices*/
-@media (max-width: 768px) { /*tablet size defined by theme*/
- #closeMe {
- display: none;
- }
-
- #pulldown {
- display: none;
- }
-
- #openToc {
- display: none;
- }
-} \ No newline at end of file
diff --git a/user_guide_src/source/_themes/sphinx_rtd_theme/static/css/theme.css b/user_guide_src/source/_themes/sphinx_rtd_theme/static/css/theme.css
deleted file mode 100644
index fe7e2cbcc..000000000
--- a/user_guide_src/source/_themes/sphinx_rtd_theme/static/css/theme.css
+++ /dev/null
@@ -1,5 +0,0 @@
-*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}audio:not([controls]){display:none}[hidden]{display:none}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}a:hover,a:active{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}blockquote{margin:0}dfn{font-style:italic}ins{background:#ff9;color:#000;text-decoration:none}mark{background:#ff0;color:#000;font-style:italic;font-weight:bold}pre,code,.rst-content tt,kbd,samp{font-family:monospace,serif;_font-family:"courier new",monospace;font-size:1em}pre{white-space:pre}q{quotes:none}q:before,q:after{content:"";content:none}small{font-size:85%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}ul,ol,dl{margin:0;padding:0;list-style:none;list-style-image:none}li{list-style:none}dd{margin:0}img{border:0;-ms-interpolation-mode:bicubic;vertical-align:middle;max-width:100%}svg:not(:root){overflow:hidden}figure{margin:0}form{margin:0}fieldset{border:0;margin:0;padding:0}label{cursor:pointer}legend{border:0;*margin-left:-7px;padding:0;white-space:normal}button,input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}button,input{line-height:normal}button,input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button;*overflow:visible}button[disabled],input[disabled]{cursor:default}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0;*width:13px;*height:13px}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-decoration,input[type="search"]::-webkit-search-cancel-button{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}textarea{overflow:auto;vertical-align:top;resize:vertical}table{border-collapse:collapse;border-spacing:0}td{vertical-align:top}.chromeframe{margin:0.2em 0;background:#ccc;color:#000;padding:0.2em 0}.ir{display:block;border:0;text-indent:-999em;overflow:hidden;background-color:transparent;background-repeat:no-repeat;text-align:left;direction:ltr;*line-height:0}.ir br{display:none}.hidden{display:none !important;visibility:hidden}.visuallyhidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.visuallyhidden.focusable:active,.visuallyhidden.focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}.invisible{visibility:hidden}.relative{position:relative}big,small{font-size:100%}@media print{html,body,section{background:none !important}*{box-shadow:none !important;text-shadow:none !important;filter:none !important;-ms-filter:none !important}a,a:visited{text-decoration:underline}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:1.5cm 0.5cm 2.5cm}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}}.fa:before,.rst-content .admonition-title:before,.rst-content h1 .headerlink:before,.rst-content h2 .headerlink:before,.rst-content h3 .headerlink:before,.rst-content h4 .headerlink:before,.rst-content h5 .headerlink:before,.rst-content h6 .headerlink:before,.rst-content dl dt .headerlink:before,.icon:before,.wy-dropdown .caret:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-alert,.rst-content .note,.rst-content .attention,.rst-content .caution,.rst-content .danger,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .tip,.rst-content .warning,.rst-content .seealso,.rst-content .admonition-todo,.btn,input[type="text"],input[type="password"],input[type="email"],input[type="url"],input[type="date"],input[type="month"],input[type="time"],input[type="datetime"],input[type="datetime-local"],input[type="week"],input[type="number"],input[type="search"],input[type="tel"],input[type="color"],select,textarea,.wy-menu-vertical li.on a,.wy-menu-vertical li.current>a,.wy-side-nav-search>a,.wy-side-nav-search .wy-dropdown>a,.wy-nav-top a{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:""}.clearfix:after{clear:both}/*!
- * Font Awesome 4.1.0 by @davegandy - http://fontawesome.io - @fontawesome
- * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
- */@font-face{font-family:'FontAwesome';src:url("../fonts/fontawesome-webfont.eot?v=4.1.0");src:url("../fonts/fontawesome-webfont.eot?#iefix&v=4.1.0") format("embedded-opentype"),url("../fonts/fontawesome-webfont.woff?v=4.1.0") format("woff"),url("../fonts/fontawesome-webfont.ttf?v=4.1.0") format("truetype"),url("../fonts/fontawesome-webfont.svg?v=4.1.0#fontawesomeregular") format("svg");font-weight:normal;font-style:normal}.fa,.rst-content .admonition-title,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content dl dt .headerlink,.icon{display:inline-block;font-family:FontAwesome;font-style:normal;font-weight:normal;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333em;line-height:0.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14286em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14286em;width:2.14286em;top:0.14286em;text-align:center}.fa-li.fa-lg{left:-1.85714em}.fa-border{padding:.2em .25em .15em;border:solid 0.08em #eee;border-radius:.1em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left,.rst-content .pull-left.admonition-title,.rst-content h1 .pull-left.headerlink,.rst-content h2 .pull-left.headerlink,.rst-content h3 .pull-left.headerlink,.rst-content h4 .pull-left.headerlink,.rst-content h5 .pull-left.headerlink,.rst-content h6 .pull-left.headerlink,.rst-content dl dt .pull-left.headerlink,.pull-left.icon{margin-right:.3em}.fa.pull-right,.rst-content .pull-right.admonition-title,.rst-content h1 .pull-right.headerlink,.rst-content h2 .pull-right.headerlink,.rst-content h3 .pull-right.headerlink,.rst-content h4 .pull-right.headerlink,.rst-content h5 .pull-right.headerlink,.rst-content h6 .pull-right.headerlink,.rst-content dl dt .pull-right.headerlink,.pull-right.icon{margin-left:.3em}.fa-spin{-webkit-animation:spin 2s infinite linear;-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;animation:spin 2s infinite linear}@-moz-keyframes spin{0%{-moz-transform:rotate(0deg)}100%{-moz-transform:rotate(359deg)}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg)}}@-o-keyframes spin{0%{-o-transform:rotate(0deg)}100%{-o-transform:rotate(359deg)}}@keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-ms-transform:rotate(270deg);-o-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=0);-webkit-transform:scale(-1, 1);-moz-transform:scale(-1, 1);-ms-transform:scale(-1, 1);-o-transform:scale(-1, 1);transform:scale(-1, 1)}.fa-flip-vertical{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:scale(1, -1);-moz-transform:scale(1, -1);-ms-transform:scale(1, -1);-o-transform:scale(1, -1);transform:scale(1, -1)}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:""}.fa-music:before{content:""}.fa-search:before,.icon-search:before{content:""}.fa-envelope-o:before{content:""}.fa-heart:before{content:""}.fa-star:before{content:""}.fa-star-o:before{content:""}.fa-user:before{content:""}.fa-film:before{content:""}.fa-th-large:before{content:""}.fa-th:before{content:""}.fa-th-list:before{content:""}.fa-check:before{content:""}.fa-times:before{content:""}.fa-search-plus:before{content:""}.fa-search-minus:before{content:""}.fa-power-off:before{content:""}.fa-signal:before{content:""}.fa-gear:before,.fa-cog:before{content:""}.fa-trash-o:before{content:""}.fa-home:before,.icon-home:before{content:""}.fa-file-o:before{content:""}.fa-clock-o:before{content:""}.fa-road:before{content:""}.fa-download:before{content:""}.fa-arrow-circle-o-down:before{content:""}.fa-arrow-circle-o-up:before{content:""}.fa-inbox:before{content:""}.fa-play-circle-o:before{content:""}.fa-rotate-right:before,.fa-repeat:before{content:""}.fa-refresh:before{content:""}.fa-list-alt:before{content:""}.fa-lock:before{content:""}.fa-flag:before{content:""}.fa-headphones:before{content:""}.fa-volume-off:before{content:""}.fa-volume-down:before{content:""}.fa-volume-up:before{content:""}.fa-qrcode:before{content:""}.fa-barcode:before{content:""}.fa-tag:before{content:""}.fa-tags:before{content:""}.fa-book:before,.icon-book:before{content:""}.fa-bookmark:before{content:""}.fa-print:before{content:""}.fa-camera:before{content:""}.fa-font:before{content:""}.fa-bold:before{content:""}.fa-italic:before{content:""}.fa-text-height:before{content:""}.fa-text-width:before{content:""}.fa-align-left:before{content:""}.fa-align-center:before{content:""}.fa-align-right:before{content:""}.fa-align-justify:before{content:""}.fa-list:before{content:""}.fa-dedent:before,.fa-outdent:before{content:""}.fa-indent:before{content:""}.fa-video-camera:before{content:""}.fa-photo:before,.fa-image:before,.fa-picture-o:before{content:""}.fa-pencil:before{content:""}.fa-map-marker:before{content:""}.fa-adjust:before{content:""}.fa-tint:before{content:""}.fa-edit:before,.fa-pencil-square-o:before{content:""}.fa-share-square-o:before{content:""}.fa-check-square-o:before{content:""}.fa-arrows:before{content:""}.fa-step-backward:before{content:""}.fa-fast-backward:before{content:""}.fa-backward:before{content:""}.fa-play:before{content:""}.fa-pause:before{content:""}.fa-stop:before{content:""}.fa-forward:before{content:""}.fa-fast-forward:before{content:""}.fa-step-forward:before{content:""}.fa-eject:before{content:""}.fa-chevron-left:before{content:""}.fa-chevron-right:before{content:""}.fa-plus-circle:before{content:""}.fa-minus-circle:before{content:""}.fa-times-circle:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before{content:""}.fa-check-circle:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before{content:""}.fa-question-circle:before{content:""}.fa-info-circle:before{content:""}.fa-crosshairs:before{content:""}.fa-times-circle-o:before{content:""}.fa-check-circle-o:before{content:""}.fa-ban:before{content:""}.fa-arrow-left:before{content:""}.fa-arrow-right:before{content:""}.fa-arrow-up:before{content:""}.fa-arrow-down:before{content:""}.fa-mail-forward:before,.fa-share:before{content:""}.fa-expand:before{content:""}.fa-compress:before{content:""}.fa-plus:before{content:""}.fa-minus:before{content:""}.fa-asterisk:before{content:""}.fa-exclamation-circle:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.rst-content .admonition-title:before{content:""}.fa-gift:before{content:""}.fa-leaf:before{content:""}.fa-fire:before,.icon-fire:before{content:""}.fa-eye:before{content:""}.fa-eye-slash:before{content:""}.fa-warning:before,.fa-exclamation-triangle:before{content:""}.fa-plane:before{content:""}.fa-calendar:before{content:""}.fa-random:before{content:""}.fa-comment:before{content:""}.fa-magnet:before{content:""}.fa-chevron-up:before{content:""}.fa-chevron-down:before{content:""}.fa-retweet:before{content:""}.fa-shopping-cart:before{content:""}.fa-folder:before{content:""}.fa-folder-open:before{content:""}.fa-arrows-v:before{content:""}.fa-arrows-h:before{content:""}.fa-bar-chart-o:before{content:""}.fa-twitter-square:before{content:""}.fa-facebook-square:before{content:""}.fa-camera-retro:before{content:""}.fa-key:before{content:""}.fa-gears:before,.fa-cogs:before{content:""}.fa-comments:before{content:""}.fa-thumbs-o-up:before{content:""}.fa-thumbs-o-down:before{content:""}.fa-star-half:before{content:""}.fa-heart-o:before{content:""}.fa-sign-out:before{content:""}.fa-linkedin-square:before{content:""}.fa-thumb-tack:before{content:""}.fa-external-link:before{content:""}.fa-sign-in:before{content:""}.fa-trophy:before{content:""}.fa-github-square:before{content:""}.fa-upload:before{content:""}.fa-lemon-o:before{content:""}.fa-phone:before{content:""}.fa-square-o:before{content:""}.fa-bookmark-o:before{content:""}.fa-phone-square:before{content:""}.fa-twitter:before{content:""}.fa-facebook:before{content:""}.fa-github:before,.icon-github:before{content:""}.fa-unlock:before{content:""}.fa-credit-card:before{content:""}.fa-rss:before{content:""}.fa-hdd-o:before{content:""}.fa-bullhorn:before{content:""}.fa-bell:before{content:""}.fa-certificate:before{content:""}.fa-hand-o-right:before{content:""}.fa-hand-o-left:before{content:""}.fa-hand-o-up:before{content:""}.fa-hand-o-down:before{content:""}.fa-arrow-circle-left:before,.icon-circle-arrow-left:before{content:""}.fa-arrow-circle-right:before,.icon-circle-arrow-right:before{content:""}.fa-arrow-circle-up:before{content:""}.fa-arrow-circle-down:before{content:""}.fa-globe:before{content:""}.fa-wrench:before{content:""}.fa-tasks:before{content:""}.fa-filter:before{content:""}.fa-briefcase:before{content:""}.fa-arrows-alt:before{content:""}.fa-group:before,.fa-users:before{content:""}.fa-chain:before,.fa-link:before,.icon-link:before{content:""}.fa-cloud:before{content:""}.fa-flask:before{content:""}.fa-cut:before,.fa-scissors:before{content:""}.fa-copy:before,.fa-files-o:before{content:""}.fa-paperclip:before{content:""}.fa-save:before,.fa-floppy-o:before{content:""}.fa-square:before{content:""}.fa-navicon:before,.fa-reorder:before,.fa-bars:before{content:""}.fa-list-ul:before{content:""}.fa-list-ol:before{content:""}.fa-strikethrough:before{content:""}.fa-underline:before{content:""}.fa-table:before{content:""}.fa-magic:before{content:""}.fa-truck:before{content:""}.fa-pinterest:before{content:""}.fa-pinterest-square:before{content:""}.fa-google-plus-square:before{content:""}.fa-google-plus:before{content:""}.fa-money:before{content:""}.fa-caret-down:before,.wy-dropdown .caret:before,.icon-caret-down:before{content:""}.fa-caret-up:before{content:""}.fa-caret-left:before{content:""}.fa-caret-right:before{content:""}.fa-columns:before{content:""}.fa-unsorted:before,.fa-sort:before{content:""}.fa-sort-down:before,.fa-sort-desc:before{content:""}.fa-sort-up:before,.fa-sort-asc:before{content:""}.fa-envelope:before{content:""}.fa-linkedin:before{content:""}.fa-rotate-left:before,.fa-undo:before{content:""}.fa-legal:before,.fa-gavel:before{content:""}.fa-dashboard:before,.fa-tachometer:before{content:""}.fa-comment-o:before{content:""}.fa-comments-o:before{content:""}.fa-flash:before,.fa-bolt:before{content:""}.fa-sitemap:before{content:""}.fa-umbrella:before{content:""}.fa-paste:before,.fa-clipboard:before{content:""}.fa-lightbulb-o:before{content:""}.fa-exchange:before{content:""}.fa-cloud-download:before{content:""}.fa-cloud-upload:before{content:""}.fa-user-md:before{content:""}.fa-stethoscope:before{content:""}.fa-suitcase:before{content:""}.fa-bell-o:before{content:""}.fa-coffee:before{content:""}.fa-cutlery:before{content:""}.fa-file-text-o:before{content:""}.fa-building-o:before{content:""}.fa-hospital-o:before{content:""}.fa-ambulance:before{content:""}.fa-medkit:before{content:""}.fa-fighter-jet:before{content:""}.fa-beer:before{content:""}.fa-h-square:before{content:""}.fa-plus-square:before{content:""}.fa-angle-double-left:before{content:""}.fa-angle-double-right:before{content:""}.fa-angle-double-up:before{content:""}.fa-angle-double-down:before{content:""}.fa-angle-left:before{content:""}.fa-angle-right:before{content:""}.fa-angle-up:before{content:""}.fa-angle-down:before{content:""}.fa-desktop:before{content:""}.fa-laptop:before{content:""}.fa-tablet:before{content:""}.fa-mobile-phone:before,.fa-mobile:before{content:""}.fa-circle-o:before{content:""}.fa-quote-left:before{content:""}.fa-quote-right:before{content:""}.fa-spinner:before{content:""}.fa-circle:before{content:""}.fa-mail-reply:before,.fa-reply:before{content:""}.fa-github-alt:before{content:""}.fa-folder-o:before{content:""}.fa-folder-open-o:before{content:""}.fa-smile-o:before{content:""}.fa-frown-o:before{content:""}.fa-meh-o:before{content:""}.fa-gamepad:before{content:""}.fa-keyboard-o:before{content:""}.fa-flag-o:before{content:""}.fa-flag-checkered:before{content:""}.fa-terminal:before{content:""}.fa-code:before{content:""}.fa-mail-reply-all:before,.fa-reply-all:before{content:""}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:""}.fa-location-arrow:before{content:""}.fa-crop:before{content:""}.fa-code-fork:before{content:""}.fa-unlink:before,.fa-chain-broken:before{content:""}.fa-question:before{content:""}.fa-info:before{content:""}.fa-exclamation:before{content:""}.fa-superscript:before{content:""}.fa-subscript:before{content:""}.fa-eraser:before{content:""}.fa-puzzle-piece:before{content:""}.fa-microphone:before{content:""}.fa-microphone-slash:before{content:""}.fa-shield:before{content:""}.fa-calendar-o:before{content:""}.fa-fire-extinguisher:before{content:""}.fa-rocket:before{content:""}.fa-maxcdn:before{content:""}.fa-chevron-circle-left:before{content:""}.fa-chevron-circle-right:before{content:""}.fa-chevron-circle-up:before{content:""}.fa-chevron-circle-down:before{content:""}.fa-html5:before{content:""}.fa-css3:before{content:""}.fa-anchor:before{content:""}.fa-unlock-alt:before{content:""}.fa-bullseye:before{content:""}.fa-ellipsis-h:before{content:""}.fa-ellipsis-v:before{content:""}.fa-rss-square:before{content:""}.fa-play-circle:before{content:""}.fa-ticket:before{content:""}.fa-minus-square:before{content:""}.fa-minus-square-o:before{content:""}.fa-level-up:before{content:""}.fa-level-down:before{content:""}.fa-check-square:before{content:""}.fa-pencil-square:before{content:""}.fa-external-link-square:before{content:""}.fa-share-square:before{content:""}.fa-compass:before{content:""}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:""}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:""}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:""}.fa-euro:before,.fa-eur:before{content:""}.fa-gbp:before{content:""}.fa-dollar:before,.fa-usd:before{content:""}.fa-rupee:before,.fa-inr:before{content:""}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:""}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:""}.fa-won:before,.fa-krw:before{content:""}.fa-bitcoin:before,.fa-btc:before{content:""}.fa-file:before{content:""}.fa-file-text:before{content:""}.fa-sort-alpha-asc:before{content:""}.fa-sort-alpha-desc:before{content:""}.fa-sort-amount-asc:before{content:""}.fa-sort-amount-desc:before{content:""}.fa-sort-numeric-asc:before{content:""}.fa-sort-numeric-desc:before{content:""}.fa-thumbs-up:before{content:""}.fa-thumbs-down:before{content:""}.fa-youtube-square:before{content:""}.fa-youtube:before{content:""}.fa-xing:before{content:""}.fa-xing-square:before{content:""}.fa-youtube-play:before{content:""}.fa-dropbox:before{content:""}.fa-stack-overflow:before{content:""}.fa-instagram:before{content:""}.fa-flickr:before{content:""}.fa-adn:before{content:""}.fa-bitbucket:before,.icon-bitbucket:before{content:""}.fa-bitbucket-square:before{content:""}.fa-tumblr:before{content:""}.fa-tumblr-square:before{content:""}.fa-long-arrow-down:before{content:""}.fa-long-arrow-up:before{content:""}.fa-long-arrow-left:before{content:""}.fa-long-arrow-right:before{content:""}.fa-apple:before{content:""}.fa-windows:before{content:""}.fa-android:before{content:""}.fa-linux:before{content:""}.fa-dribbble:before{content:""}.fa-skype:before{content:""}.fa-foursquare:before{content:""}.fa-trello:before{content:""}.fa-female:before{content:""}.fa-male:before{content:""}.fa-gittip:before{content:""}.fa-sun-o:before{content:""}.fa-moon-o:before{content:""}.fa-archive:before{content:""}.fa-bug:before{content:""}.fa-vk:before{content:""}.fa-weibo:before{content:""}.fa-renren:before{content:""}.fa-pagelines:before{content:""}.fa-stack-exchange:before{content:""}.fa-arrow-circle-o-right:before{content:""}.fa-arrow-circle-o-left:before{content:""}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:""}.fa-dot-circle-o:before{content:""}.fa-wheelchair:before{content:""}.fa-vimeo-square:before{content:""}.fa-turkish-lira:before,.fa-try:before{content:""}.fa-plus-square-o:before{content:""}.fa-space-shuttle:before{content:""}.fa-slack:before{content:""}.fa-envelope-square:before{content:""}.fa-wordpress:before{content:""}.fa-openid:before{content:""}.fa-institution:before,.fa-bank:before,.fa-university:before{content:""}.fa-mortar-board:before,.fa-graduation-cap:before{content:""}.fa-yahoo:before{content:""}.fa-google:before{content:""}.fa-reddit:before{content:""}.fa-reddit-square:before{content:""}.fa-stumbleupon-circle:before{content:""}.fa-stumbleupon:before{content:""}.fa-delicious:before{content:""}.fa-digg:before{content:""}.fa-pied-piper-square:before,.fa-pied-piper:before{content:""}.fa-pied-piper-alt:before{content:""}.fa-drupal:before{content:""}.fa-joomla:before{content:""}.fa-language:before{content:""}.fa-fax:before{content:""}.fa-building:before{content:""}.fa-child:before{content:""}.fa-paw:before{content:""}.fa-spoon:before{content:""}.fa-cube:before{content:""}.fa-cubes:before{content:""}.fa-behance:before{content:""}.fa-behance-square:before{content:""}.fa-steam:before{content:""}.fa-steam-square:before{content:""}.fa-recycle:before{content:""}.fa-automobile:before,.fa-car:before{content:""}.fa-cab:before,.fa-taxi:before{content:""}.fa-tree:before{content:""}.fa-spotify:before{content:""}.fa-deviantart:before{content:""}.fa-soundcloud:before{content:""}.fa-database:before{content:""}.fa-file-pdf-o:before{content:""}.fa-file-word-o:before{content:""}.fa-file-excel-o:before{content:""}.fa-file-powerpoint-o:before{content:""}.fa-file-photo-o:before,.fa-file-picture-o:before,.fa-file-image-o:before{content:""}.fa-file-zip-o:before,.fa-file-archive-o:before{content:""}.fa-file-sound-o:before,.fa-file-audio-o:before{content:""}.fa-file-movie-o:before,.fa-file-video-o:before{content:""}.fa-file-code-o:before{content:""}.fa-vine:before{content:""}.fa-codepen:before{content:""}.fa-jsfiddle:before{content:""}.fa-life-bouy:before,.fa-life-saver:before,.fa-support:before,.fa-life-ring:before{content:""}.fa-circle-o-notch:before{content:""}.fa-ra:before,.fa-rebel:before{content:""}.fa-ge:before,.fa-empire:before{content:""}.fa-git-square:before{content:""}.fa-git:before{content:""}.fa-hacker-news:before{content:""}.fa-tencent-weibo:before{content:""}.fa-qq:before{content:""}.fa-wechat:before,.fa-weixin:before{content:""}.fa-send:before,.fa-paper-plane:before{content:""}.fa-send-o:before,.fa-paper-plane-o:before{content:""}.fa-history:before{content:""}.fa-circle-thin:before{content:""}.fa-header:before{content:""}.fa-paragraph:before{content:""}.fa-sliders:before{content:""}.fa-share-alt:before{content:""}.fa-share-alt-square:before{content:""}.fa-bomb:before{content:""}.fa,.rst-content .admonition-title,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content dl dt .headerlink,.icon,.wy-dropdown .caret,.wy-inline-validate.wy-inline-validate-success .wy-input-context,.wy-inline-validate.wy-inline-validate-danger .wy-input-context,.wy-inline-validate.wy-inline-validate-warning .wy-input-context,.wy-inline-validate.wy-inline-validate-info .wy-input-context{font-family:inherit}.fa:before,.rst-content .admonition-title:before,.rst-content h1 .headerlink:before,.rst-content h2 .headerlink:before,.rst-content h3 .headerlink:before,.rst-content h4 .headerlink:before,.rst-content h5 .headerlink:before,.rst-content h6 .headerlink:before,.rst-content dl dt .headerlink:before,.icon:before,.wy-dropdown .caret:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before{font-family:"FontAwesome";display:inline-block;font-style:normal;font-weight:normal;line-height:1;text-decoration:inherit}a .fa,a .rst-content .admonition-title,.rst-content a .admonition-title,a .rst-content h1 .headerlink,.rst-content h1 a .headerlink,a .rst-content h2 .headerlink,.rst-content h2 a .headerlink,a .rst-content h3 .headerlink,.rst-content h3 a .headerlink,a .rst-content h4 .headerlink,.rst-content h4 a .headerlink,a .rst-content h5 .headerlink,.rst-content h5 a .headerlink,a .rst-content h6 .headerlink,.rst-content h6 a .headerlink,a .rst-content dl dt .headerlink,.rst-content dl dt a .headerlink,a .icon{display:inline-block;text-decoration:inherit}.btn .fa,.btn .rst-content .admonition-title,.rst-content .btn .admonition-title,.btn .rst-content h1 .headerlink,.rst-content h1 .btn .headerlink,.btn .rst-content h2 .headerlink,.rst-content h2 .btn .headerlink,.btn .rst-content h3 .headerlink,.rst-content h3 .btn .headerlink,.btn .rst-content h4 .headerlink,.rst-content h4 .btn .headerlink,.btn .rst-content h5 .headerlink,.rst-content h5 .btn .headerlink,.btn .rst-content h6 .headerlink,.rst-content h6 .btn .headerlink,.btn .rst-content dl dt .headerlink,.rst-content dl dt .btn .headerlink,.btn .icon,.nav .fa,.nav .rst-content .admonition-title,.rst-content .nav .admonition-title,.nav .rst-content h1 .headerlink,.rst-content h1 .nav .headerlink,.nav .rst-content h2 .headerlink,.rst-content h2 .nav .headerlink,.nav .rst-content h3 .headerlink,.rst-content h3 .nav .headerlink,.nav .rst-content h4 .headerlink,.rst-content h4 .nav .headerlink,.nav .rst-content h5 .headerlink,.rst-content h5 .nav .headerlink,.nav .rst-content h6 .headerlink,.rst-content h6 .nav .headerlink,.nav .rst-content dl dt .headerlink,.rst-content dl dt .nav .headerlink,.nav .icon{display:inline}.btn .fa.fa-large,.btn .rst-content .fa-large.admonition-title,.rst-content .btn .fa-large.admonition-title,.btn .rst-content h1 .fa-large.headerlink,.rst-content h1 .btn .fa-large.headerlink,.btn .rst-content h2 .fa-large.headerlink,.rst-content h2 .btn .fa-large.headerlink,.btn .rst-content h3 .fa-large.headerlink,.rst-content h3 .btn .fa-large.headerlink,.btn .rst-content h4 .fa-large.headerlink,.rst-content h4 .btn .fa-large.headerlink,.btn .rst-content h5 .fa-large.headerlink,.rst-content h5 .btn .fa-large.headerlink,.btn .rst-content h6 .fa-large.headerlink,.rst-content h6 .btn .fa-large.headerlink,.btn .rst-content dl dt .fa-large.headerlink,.rst-content dl dt .btn .fa-large.headerlink,.btn .fa-large.icon,.nav .fa.fa-large,.nav .rst-content .fa-large.admonition-title,.rst-content .nav .fa-large.admonition-title,.nav .rst-content h1 .fa-large.headerlink,.rst-content h1 .nav .fa-large.headerlink,.nav .rst-content h2 .fa-large.headerlink,.rst-content h2 .nav .fa-large.headerlink,.nav .rst-content h3 .fa-large.headerlink,.rst-content h3 .nav .fa-large.headerlink,.nav .rst-content h4 .fa-large.headerlink,.rst-content h4 .nav .fa-large.headerlink,.nav .rst-content h5 .fa-large.headerlink,.rst-content h5 .nav .fa-large.headerlink,.nav .rst-content h6 .fa-large.headerlink,.rst-content h6 .nav .fa-large.headerlink,.nav .rst-content dl dt .fa-large.headerlink,.rst-content dl dt .nav .fa-large.headerlink,.nav .fa-large.icon{line-height:0.9em}.btn .fa.fa-spin,.btn .rst-content .fa-spin.admonition-title,.rst-content .btn .fa-spin.admonition-title,.btn .rst-content h1 .fa-spin.headerlink,.rst-content h1 .btn .fa-spin.headerlink,.btn .rst-content h2 .fa-spin.headerlink,.rst-content h2 .btn .fa-spin.headerlink,.btn .rst-content h3 .fa-spin.headerlink,.rst-content h3 .btn .fa-spin.headerlink,.btn .rst-content h4 .fa-spin.headerlink,.rst-content h4 .btn .fa-spin.headerlink,.btn .rst-content h5 .fa-spin.headerlink,.rst-content h5 .btn .fa-spin.headerlink,.btn .rst-content h6 .fa-spin.headerlink,.rst-content h6 .btn .fa-spin.headerlink,.btn .rst-content dl dt .fa-spin.headerlink,.rst-content dl dt .btn .fa-spin.headerlink,.btn .fa-spin.icon,.nav .fa.fa-spin,.nav .rst-content .fa-spin.admonition-title,.rst-content .nav .fa-spin.admonition-title,.nav .rst-content h1 .fa-spin.headerlink,.rst-content h1 .nav .fa-spin.headerlink,.nav .rst-content h2 .fa-spin.headerlink,.rst-content h2 .nav .fa-spin.headerlink,.nav .rst-content h3 .fa-spin.headerlink,.rst-content h3 .nav .fa-spin.headerlink,.nav .rst-content h4 .fa-spin.headerlink,.rst-content h4 .nav .fa-spin.headerlink,.nav .rst-content h5 .fa-spin.headerlink,.rst-content h5 .nav .fa-spin.headerlink,.nav .rst-content h6 .fa-spin.headerlink,.rst-content h6 .nav .fa-spin.headerlink,.nav .rst-content dl dt .fa-spin.headerlink,.rst-content dl dt .nav .fa-spin.headerlink,.nav .fa-spin.icon{display:inline-block}.btn.fa:before,.rst-content .btn.admonition-title:before,.rst-content h1 .btn.headerlink:before,.rst-content h2 .btn.headerlink:before,.rst-content h3 .btn.headerlink:before,.rst-content h4 .btn.headerlink:before,.rst-content h5 .btn.headerlink:before,.rst-content h6 .btn.headerlink:before,.rst-content dl dt .btn.headerlink:before,.btn.icon:before{opacity:0.5;-webkit-transition:opacity 0.05s ease-in;-moz-transition:opacity 0.05s ease-in;transition:opacity 0.05s ease-in}.btn.fa:hover:before,.rst-content .btn.admonition-title:hover:before,.rst-content h1 .btn.headerlink:hover:before,.rst-content h2 .btn.headerlink:hover:before,.rst-content h3 .btn.headerlink:hover:before,.rst-content h4 .btn.headerlink:hover:before,.rst-content h5 .btn.headerlink:hover:before,.rst-content h6 .btn.headerlink:hover:before,.rst-content dl dt .btn.headerlink:hover:before,.btn.icon:hover:before{opacity:1}.btn-mini .fa:before,.btn-mini .rst-content .admonition-title:before,.rst-content .btn-mini .admonition-title:before,.btn-mini .rst-content h1 .headerlink:before,.rst-content h1 .btn-mini .headerlink:before,.btn-mini .rst-content h2 .headerlink:before,.rst-content h2 .btn-mini .headerlink:before,.btn-mini .rst-content h3 .headerlink:before,.rst-content h3 .btn-mini .headerlink:before,.btn-mini .rst-content h4 .headerlink:before,.rst-content h4 .btn-mini .headerlink:before,.btn-mini .rst-content h5 .headerlink:before,.rst-content h5 .btn-mini .headerlink:before,.btn-mini .rst-content h6 .headerlink:before,.rst-content h6 .btn-mini .headerlink:before,.btn-mini .rst-content dl dt .headerlink:before,.rst-content dl dt .btn-mini .headerlink:before,.btn-mini .icon:before{font-size:14px;vertical-align:-15%}.wy-alert,.rst-content .note,.rst-content .attention,.rst-content .caution,.rst-content .danger,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .tip,.rst-content .warning,.rst-content .seealso,.rst-content .admonition-todo{padding:12px;line-height:24px;margin-bottom:24px;background:#dedede}.wy-alert-title,.rst-content .admonition-title{color:#fff;font-weight:bold;display:block;color:#fff;background:#8ba8af;margin:-12px;padding:6px 12px;margin-bottom:12px}.wy-alert.wy-alert-danger,.rst-content .wy-alert-danger.note,.rst-content .wy-alert-danger.attention,.rst-content .wy-alert-danger.caution,.rst-content .danger,.rst-content .error,.rst-content .wy-alert-danger.hint,.rst-content .wy-alert-danger.important,.rst-content .wy-alert-danger.tip,.rst-content .wy-alert-danger.warning,.rst-content .wy-alert-danger.seealso,.rst-content .wy-alert-danger.admonition-todo{background:#fdf3f2}.wy-alert.wy-alert-danger .wy-alert-title,.rst-content .wy-alert-danger.note .wy-alert-title,.rst-content .wy-alert-danger.attention .wy-alert-title,.rst-content .wy-alert-danger.caution .wy-alert-title,.rst-content .danger .wy-alert-title,.rst-content .error .wy-alert-title,.rst-content .wy-alert-danger.hint .wy-alert-title,.rst-content .wy-alert-danger.important .wy-alert-title,.rst-content .wy-alert-danger.tip .wy-alert-title,.rst-content .wy-alert-danger.warning .wy-alert-title,.rst-content .wy-alert-danger.seealso .wy-alert-title,.rst-content .wy-alert-danger.admonition-todo .wy-alert-title,.wy-alert.wy-alert-danger .rst-content .admonition-title,.rst-content .wy-alert.wy-alert-danger .admonition-title,.rst-content .wy-alert-danger.note .admonition-title,.rst-content .wy-alert-danger.attention .admonition-title,.rst-content .wy-alert-danger.caution .admonition-title,.rst-content .danger .admonition-title,.rst-content .error .admonition-title,.rst-content .wy-alert-danger.hint .admonition-title,.rst-content .wy-alert-danger.important .admonition-title,.rst-content .wy-alert-danger.tip .admonition-title,.rst-content .wy-alert-danger.warning .admonition-title,.rst-content .wy-alert-danger.seealso .admonition-title,.rst-content .wy-alert-danger.admonition-todo .admonition-title{background:#f29f97}.wy-alert.wy-alert-warning,.rst-content .wy-alert-warning.note,.rst-content .attention,.rst-content .caution,.rst-content .wy-alert-warning.danger,.rst-content .wy-alert-warning.error,.rst-content .wy-alert-warning.hint,.rst-content .wy-alert-warning.important,.rst-content .wy-alert-warning.tip,.rst-content .warning,.rst-content .wy-alert-warning.seealso,.rst-content .admonition-todo{background:#ffedcc}.wy-alert.wy-alert-warning .wy-alert-title,.rst-content .wy-alert-warning.note .wy-alert-title,.rst-content .attention .wy-alert-title,.rst-content .caution .wy-alert-title,.rst-content .wy-alert-warning.danger .wy-alert-title,.rst-content .wy-alert-warning.error .wy-alert-title,.rst-content .wy-alert-warning.hint .wy-alert-title,.rst-content .wy-alert-warning.important .wy-alert-title,.rst-content .wy-alert-warning.tip .wy-alert-title,.rst-content .warning .wy-alert-title,.rst-content .wy-alert-warning.seealso .wy-alert-title,.rst-content .admonition-todo .wy-alert-title,.wy-alert.wy-alert-warning .rst-content .admonition-title,.rst-content .wy-alert.wy-alert-warning .admonition-title,.rst-content .wy-alert-warning.note .admonition-title,.rst-content .attention .admonition-title,.rst-content .caution .admonition-title,.rst-content .wy-alert-warning.danger .admonition-title,.rst-content .wy-alert-warning.error .admonition-title,.rst-content .wy-alert-warning.hint .admonition-title,.rst-content .wy-alert-warning.important .admonition-title,.rst-content .wy-alert-warning.tip .admonition-title,.rst-content .warning .admonition-title,.rst-content .wy-alert-warning.seealso .admonition-title,.rst-content .admonition-todo .admonition-title{background:#f0b37e}.wy-alert.wy-alert-info,.rst-content .note,.rst-content .wy-alert-info.attention,.rst-content .wy-alert-info.caution,.rst-content .wy-alert-info.danger,.rst-content .wy-alert-info.error,.rst-content .wy-alert-info.hint,.rst-content .wy-alert-info.important,.rst-content .wy-alert-info.tip,.rst-content .wy-alert-info.warning,.rst-content .seealso,.rst-content .wy-alert-info.admonition-todo{background:#dedede}.wy-alert.wy-alert-info .wy-alert-title,.rst-content .note .wy-alert-title,.rst-content .wy-alert-info.attention .wy-alert-title,.rst-content .wy-alert-info.caution .wy-alert-title,.rst-content .wy-alert-info.danger .wy-alert-title,.rst-content .wy-alert-info.error .wy-alert-title,.rst-content .wy-alert-info.hint .wy-alert-title,.rst-content .wy-alert-info.important .wy-alert-title,.rst-content .wy-alert-info.tip .wy-alert-title,.rst-content .wy-alert-info.warning .wy-alert-title,.rst-content .seealso .wy-alert-title,.rst-content .wy-alert-info.admonition-todo .wy-alert-title,.wy-alert.wy-alert-info .rst-content .admonition-title,.rst-content .wy-alert.wy-alert-info .admonition-title,.rst-content .note .admonition-title,.rst-content .wy-alert-info.attention .admonition-title,.rst-content .wy-alert-info.caution .admonition-title,.rst-content .wy-alert-info.danger .admonition-title,.rst-content .wy-alert-info.error .admonition-title,.rst-content .wy-alert-info.hint .admonition-title,.rst-content .wy-alert-info.important .admonition-title,.rst-content .wy-alert-info.tip .admonition-title,.rst-content .wy-alert-info.warning .admonition-title,.rst-content .seealso .admonition-title,.rst-content .wy-alert-info.admonition-todo .admonition-title{background:#8ba8af}.wy-alert.wy-alert-success,.rst-content .wy-alert-success.note,.rst-content .wy-alert-success.attention,.rst-content .wy-alert-success.caution,.rst-content .wy-alert-success.danger,.rst-content .wy-alert-success.error,.rst-content .hint,.rst-content .important,.rst-content .tip,.rst-content .wy-alert-success.warning,.rst-content .wy-alert-success.seealso,.rst-content .wy-alert-success.admonition-todo{background:#dedede}.wy-alert.wy-alert-success .wy-alert-title,.rst-content .wy-alert-success.note .wy-alert-title,.rst-content .wy-alert-success.attention .wy-alert-title,.rst-content .wy-alert-success.caution .wy-alert-title,.rst-content .wy-alert-success.danger .wy-alert-title,.rst-content .wy-alert-success.error .wy-alert-title,.rst-content .hint .wy-alert-title,.rst-content .important .wy-alert-title,.rst-content .tip .wy-alert-title,.rst-content .wy-alert-success.warning .wy-alert-title,.rst-content .wy-alert-success.seealso .wy-alert-title,.rst-content .wy-alert-success.admonition-todo .wy-alert-title,.wy-alert.wy-alert-success .rst-content .admonition-title,.rst-content .wy-alert.wy-alert-success .admonition-title,.rst-content .wy-alert-success.note .admonition-title,.rst-content .wy-alert-success.attention .admonition-title,.rst-content .wy-alert-success.caution .admonition-title,.rst-content .wy-alert-success.danger .admonition-title,.rst-content .wy-alert-success.error .admonition-title,.rst-content .hint .admonition-title,.rst-content .important .admonition-title,.rst-content .tip .admonition-title,.rst-content .wy-alert-success.warning .admonition-title,.rst-content .wy-alert-success.seealso .admonition-title,.rst-content .wy-alert-success.admonition-todo .admonition-title{background:#dd4814}.wy-alert.wy-alert-neutral,.rst-content .wy-alert-neutral.note,.rst-content .wy-alert-neutral.attention,.rst-content .wy-alert-neutral.caution,.rst-content .wy-alert-neutral.danger,.rst-content .wy-alert-neutral.error,.rst-content .wy-alert-neutral.hint,.rst-content .wy-alert-neutral.important,.rst-content .wy-alert-neutral.tip,.rst-content .wy-alert-neutral.warning,.rst-content .wy-alert-neutral.seealso,.rst-content .wy-alert-neutral.admonition-todo{background:#f3f6f6}.wy-alert.wy-alert-neutral .wy-alert-title,.rst-content .wy-alert-neutral.note .wy-alert-title,.rst-content .wy-alert-neutral.attention .wy-alert-title,.rst-content .wy-alert-neutral.caution .wy-alert-title,.rst-content .wy-alert-neutral.danger .wy-alert-title,.rst-content .wy-alert-neutral.error .wy-alert-title,.rst-content .wy-alert-neutral.hint .wy-alert-title,.rst-content .wy-alert-neutral.important .wy-alert-title,.rst-content .wy-alert-neutral.tip .wy-alert-title,.rst-content .wy-alert-neutral.warning .wy-alert-title,.rst-content .wy-alert-neutral.seealso .wy-alert-title,.rst-content .wy-alert-neutral.admonition-todo .wy-alert-title,.wy-alert.wy-alert-neutral .rst-content .admonition-title,.rst-content .wy-alert.wy-alert-neutral .admonition-title,.rst-content .wy-alert-neutral.note .admonition-title,.rst-content .wy-alert-neutral.attention .admonition-title,.rst-content .wy-alert-neutral.caution .admonition-title,.rst-content .wy-alert-neutral.danger .admonition-title,.rst-content .wy-alert-neutral.error .admonition-title,.rst-content .wy-alert-neutral.hint .admonition-title,.rst-content .wy-alert-neutral.important .admonition-title,.rst-content .wy-alert-neutral.tip .admonition-title,.rst-content .wy-alert-neutral.warning .admonition-title,.rst-content .wy-alert-neutral.seealso .admonition-title,.rst-content .wy-alert-neutral.admonition-todo .admonition-title{color:#404040;background:#e1e4e5}.wy-alert.wy-alert-neutral a,.rst-content .wy-alert-neutral.note a,.rst-content .wy-alert-neutral.attention a,.rst-content .wy-alert-neutral.caution a,.rst-content .wy-alert-neutral.danger a,.rst-content .wy-alert-neutral.error a,.rst-content .wy-alert-neutral.hint a,.rst-content .wy-alert-neutral.important a,.rst-content .wy-alert-neutral.tip a,.rst-content .wy-alert-neutral.warning a,.rst-content .wy-alert-neutral.seealso a,.rst-content .wy-alert-neutral.admonition-todo a{color:#dd4814}.wy-alert p:last-child,.rst-content .note p:last-child,.rst-content .attention p:last-child,.rst-content .caution p:last-child,.rst-content .danger p:last-child,.rst-content .error p:last-child,.rst-content .hint p:last-child,.rst-content .important p:last-child,.rst-content .tip p:last-child,.rst-content .warning p:last-child,.rst-content .seealso p:last-child,.rst-content .admonition-todo p:last-child{margin-bottom:0}.wy-tray-container{position:fixed;bottom:0px;left:0;z-index:600}.wy-tray-container li{display:block;width:300px;background:transparent;color:#fff;text-align:center;box-shadow:0 5px 5px 0 rgba(0,0,0,0.1);padding:0 24px;min-width:20%;opacity:0;height:0;line-height:56px;overflow:hidden;-webkit-transition:all 0.3s ease-in;-moz-transition:all 0.3s ease-in;transition:all 0.3s ease-in}.wy-tray-container li.wy-tray-item-success{background:#27AE60}.wy-tray-container li.wy-tray-item-info{background:#dd4814}.wy-tray-container li.wy-tray-item-warning{background:#E67E22}.wy-tray-container li.wy-tray-item-danger{background:#E74C3C}.wy-tray-container li.on{opacity:1;height:56px}@media screen and (max-width: 768px){.wy-tray-container{bottom:auto;top:0;width:100%}.wy-tray-container li{width:100%}}button{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle;cursor:pointer;line-height:normal;-webkit-appearance:button;*overflow:visible}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}button[disabled]{cursor:default}.btn{display:inline-block;border-radius:2px;line-height:normal;white-space:nowrap;text-align:center;cursor:pointer;font-size:100%;padding:6px 12px 8px 12px;color:#fff;border:1px solid rgba(0,0,0,0.1);background-color:#27AE60;text-decoration:none;font-weight:normal;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;box-shadow:0px 1px 2px -1px rgba(255,255,255,0.5) inset,0px -2px 0px 0px rgba(0,0,0,0.1) inset;outline-none:false;vertical-align:middle;*display:inline;zoom:1;-webkit-user-drag:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:all 0.1s linear;-moz-transition:all 0.1s linear;transition:all 0.1s linear}.btn-hover{background:#2e8ece;color:#fff}.btn:hover{background:#2cc36b;color:#fff}.btn:focus{background:#2cc36b;outline:0}.btn:active{box-shadow:0px -1px 0px 0px rgba(0,0,0,0.05) inset,0px 2px 0px 0px rgba(0,0,0,0.1) inset;padding:8px 12px 6px 12px}.btn:visited{color:#fff}.btn:disabled{background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=40);opacity:0.4;cursor:not-allowed;box-shadow:none}.btn-disabled{background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=40);opacity:0.4;cursor:not-allowed;box-shadow:none}.btn-disabled:hover,.btn-disabled:focus,.btn-disabled:active{background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=40);opacity:0.4;cursor:not-allowed;box-shadow:none}.btn::-moz-focus-inner{padding:0;border:0}.btn-small{font-size:80%}.btn-info{background-color:#dd4814 !important}.btn-info:hover{background-color:#2e8ece !important}.btn-neutral{background-color:#f3f6f6 !important;color:#404040 !important}.btn-neutral:hover{background-color:#e5ebeb !important;color:#404040}.btn-neutral:visited{color:#404040 !important}.btn-success{background-color:#27AE60 !important}.btn-success:hover{background-color:#295 !important}.btn-danger{background-color:#E74C3C !important}.btn-danger:hover{background-color:#ea6153 !important}.btn-warning{background-color:#E67E22 !important}.btn-warning:hover{background-color:#e98b39 !important}.btn-invert{background-color:#222}.btn-invert:hover{background-color:#2f2f2f !important}.btn-link{background-color:transparent !important;color:#dd4814;box-shadow:none;border-color:transparent !important}.btn-link:hover{background-color:transparent !important;color:#409ad5 !important;box-shadow:none}.btn-link:active{background-color:transparent !important;color:#409ad5 !important;box-shadow:none}.btn-link:visited{color:#97310e}.wy-btn-group .btn,.wy-control .btn{vertical-align:middle}.wy-btn-group{margin-bottom:24px;*zoom:1}.wy-btn-group:before,.wy-btn-group:after{display:table;content:""}.wy-btn-group:after{clear:both}.wy-dropdown{position:relative;display:inline-block}.wy-dropdown-active .wy-dropdown-menu{display:block}.wy-dropdown-menu{position:absolute;left:0;display:none;float:left;top:100%;min-width:100%;background:#fcfcfc;z-index:100;border:solid 1px #cfd7dd;box-shadow:0 2px 2px 0 rgba(0,0,0,0.1);padding:12px}.wy-dropdown-menu>dd>a{display:block;clear:both;color:#404040;white-space:nowrap;font-size:90%;padding:0 12px;cursor:pointer}.wy-dropdown-menu>dd>a:hover{background:#dd4814;color:#fff}.wy-dropdown-menu>dd.divider{border-top:solid 1px #cfd7dd;margin:6px 0}.wy-dropdown-menu>dd.search{padding-bottom:12px}.wy-dropdown-menu>dd.search input[type="search"]{width:100%}.wy-dropdown-menu>dd.call-to-action{background:#e3e3e3;text-transform:uppercase;font-weight:500;font-size:80%}.wy-dropdown-menu>dd.call-to-action:hover{background:#e3e3e3}.wy-dropdown-menu>dd.call-to-action .btn{color:#fff}.wy-dropdown.wy-dropdown-up .wy-dropdown-menu{bottom:100%;top:auto;left:auto;right:0}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu{background:#fcfcfc;margin-top:2px}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu a{padding:6px 12px}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu a:hover{background:#dd4814;color:#fff}.wy-dropdown.wy-dropdown-left .wy-dropdown-menu{right:0;text-align:right}.wy-dropdown-arrow:before{content:" ";border-bottom:5px solid #f5f5f5;border-left:5px solid transparent;border-right:5px solid transparent;position:absolute;display:block;top:-4px;left:50%;margin-left:-3px}.wy-dropdown-arrow.wy-dropdown-arrow-left:before{left:11px}.wy-form-stacked select{display:block}.wy-form-aligned input,.wy-form-aligned textarea,.wy-form-aligned select,.wy-form-aligned .wy-help-inline,.wy-form-aligned label{display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.wy-form-aligned .wy-control-group>label{display:inline-block;vertical-align:middle;width:10em;margin:6px 12px 0 0;float:left}.wy-form-aligned .wy-control{float:left}.wy-form-aligned .wy-control label{display:block}.wy-form-aligned .wy-control select{margin-top:6px}fieldset{border:0;margin:0;padding:0}legend{display:block;width:100%;border:0;padding:0;white-space:normal;margin-bottom:24px;font-size:150%;*margin-left:-7px}label{display:block;margin:0 0 0.3125em 0;color:#333;font-size:90%}input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}.wy-control-group{margin-bottom:24px;*zoom:1;max-width:68em;margin-left:auto;margin-right:auto;*zoom:1}.wy-control-group:before,.wy-control-group:after{display:table;content:""}.wy-control-group:after{clear:both}.wy-control-group:before,.wy-control-group:after{display:table;content:""}.wy-control-group:after{clear:both}.wy-control-group.wy-control-group-required>label:after{content:" *";color:#E74C3C}.wy-control-group .wy-form-full,.wy-control-group .wy-form-halves,.wy-control-group .wy-form-thirds{padding-bottom:12px}.wy-control-group .wy-form-full select,.wy-control-group .wy-form-halves select,.wy-control-group .wy-form-thirds select{width:100%}.wy-control-group .wy-form-full input[type="text"],.wy-control-group .wy-form-full input[type="password"],.wy-control-group .wy-form-full input[type="email"],.wy-control-group .wy-form-full input[type="url"],.wy-control-group .wy-form-full input[type="date"],.wy-control-group .wy-form-full input[type="month"],.wy-control-group .wy-form-full input[type="time"],.wy-control-group .wy-form-full input[type="datetime"],.wy-control-group .wy-form-full input[type="datetime-local"],.wy-control-group .wy-form-full input[type="week"],.wy-control-group .wy-form-full input[type="number"],.wy-control-group .wy-form-full input[type="search"],.wy-control-group .wy-form-full input[type="tel"],.wy-control-group .wy-form-full input[type="color"],.wy-control-group .wy-form-halves input[type="text"],.wy-control-group .wy-form-halves input[type="password"],.wy-control-group .wy-form-halves input[type="email"],.wy-control-group .wy-form-halves input[type="url"],.wy-control-group .wy-form-halves input[type="date"],.wy-control-group .wy-form-halves input[type="month"],.wy-control-group .wy-form-halves input[type="time"],.wy-control-group .wy-form-halves input[type="datetime"],.wy-control-group .wy-form-halves input[type="datetime-local"],.wy-control-group .wy-form-halves input[type="week"],.wy-control-group .wy-form-halves input[type="number"],.wy-control-group .wy-form-halves input[type="search"],.wy-control-group .wy-form-halves input[type="tel"],.wy-control-group .wy-form-halves input[type="color"],.wy-control-group .wy-form-thirds input[type="text"],.wy-control-group .wy-form-thirds input[type="password"],.wy-control-group .wy-form-thirds input[type="email"],.wy-control-group .wy-form-thirds input[type="url"],.wy-control-group .wy-form-thirds input[type="date"],.wy-control-group .wy-form-thirds input[type="month"],.wy-control-group .wy-form-thirds input[type="time"],.wy-control-group .wy-form-thirds input[type="datetime"],.wy-control-group .wy-form-thirds input[type="datetime-local"],.wy-control-group .wy-form-thirds input[type="week"],.wy-control-group .wy-form-thirds input[type="number"],.wy-control-group .wy-form-thirds input[type="search"],.wy-control-group .wy-form-thirds input[type="tel"],.wy-control-group .wy-form-thirds input[type="color"]{width:100%}.wy-control-group .wy-form-full{float:left;display:block;margin-right:2.35765%;width:100%;margin-right:0}.wy-control-group .wy-form-full:last-child{margin-right:0}.wy-control-group .wy-form-halves{float:left;display:block;margin-right:2.35765%;width:48.82117%}.wy-control-group .wy-form-halves:last-child{margin-right:0}.wy-control-group .wy-form-halves:nth-of-type(2n){margin-right:0}.wy-control-group .wy-form-halves:nth-of-type(2n+1){clear:left}.wy-control-group .wy-form-thirds{float:left;display:block;margin-right:2.35765%;width:31.76157%}.wy-control-group .wy-form-thirds:last-child{margin-right:0}.wy-control-group .wy-form-thirds:nth-of-type(3n){margin-right:0}.wy-control-group .wy-form-thirds:nth-of-type(3n+1){clear:left}.wy-control-group.wy-control-group-no-input .wy-control{margin:6px 0 0 0;font-size:90%}.wy-control-no-input{display:inline-block;margin:6px 0 0 0;font-size:90%}.wy-control-group.fluid-input input[type="text"],.wy-control-group.fluid-input input[type="password"],.wy-control-group.fluid-input input[type="email"],.wy-control-group.fluid-input input[type="url"],.wy-control-group.fluid-input input[type="date"],.wy-control-group.fluid-input input[type="month"],.wy-control-group.fluid-input input[type="time"],.wy-control-group.fluid-input input[type="datetime"],.wy-control-group.fluid-input input[type="datetime-local"],.wy-control-group.fluid-input input[type="week"],.wy-control-group.fluid-input input[type="number"],.wy-control-group.fluid-input input[type="search"],.wy-control-group.fluid-input input[type="tel"],.wy-control-group.fluid-input input[type="color"]{width:100%}.wy-form-message-inline{display:inline-block;padding-left:0.3em;color:#666;vertical-align:middle;font-size:90%}.wy-form-message{display:block;color:#999;font-size:70%;margin-top:0.3125em;font-style:italic}input{line-height:normal}input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;*overflow:visible}input[type="text"],input[type="password"],input[type="email"],input[type="url"],input[type="date"],input[type="month"],input[type="time"],input[type="datetime"],input[type="datetime-local"],input[type="week"],input[type="number"],input[type="search"],input[type="tel"],input[type="color"]{-webkit-appearance:none;padding:6px;display:inline-block;border:1px solid #ccc;font-size:80%;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;box-shadow:inset 0 1px 3px #ddd;border-radius:0;-webkit-transition:border 0.3s linear;-moz-transition:border 0.3s linear;transition:border 0.3s linear}input[type="datetime-local"]{padding:0.34375em 0.625em}input[disabled]{cursor:default}input[type="checkbox"],input[type="radio"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0;margin-right:0.3125em;*height:13px;*width:13px}input[type="search"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}input[type="text"]:focus,input[type="password"]:focus,input[type="email"]:focus,input[type="url"]:focus,input[type="date"]:focus,input[type="month"]:focus,input[type="time"]:focus,input[type="datetime"]:focus,input[type="datetime-local"]:focus,input[type="week"]:focus,input[type="number"]:focus,input[type="search"]:focus,input[type="tel"]:focus,input[type="color"]:focus{outline:0;outline:thin dotted \9;border-color:#333}input.no-focus:focus{border-color:#ccc !important}input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:thin dotted #333;outline:1px auto #129FEA}input[type="text"][disabled],input[type="password"][disabled],input[type="email"][disabled],input[type="url"][disabled],input[type="date"][disabled],input[type="month"][disabled],input[type="time"][disabled],input[type="datetime"][disabled],input[type="datetime-local"][disabled],input[type="week"][disabled],input[type="number"][disabled],input[type="search"][disabled],input[type="tel"][disabled],input[type="color"][disabled]{cursor:not-allowed;background-color:#f3f6f6;color:#cad2d3}input:focus:invalid,textarea:focus:invalid,select:focus:invalid{color:#E74C3C;border:1px solid #E74C3C}input:focus:invalid:focus,textarea:focus:invalid:focus,select:focus:invalid:focus{border-color:#E74C3C}input[type="file"]:focus:invalid:focus,input[type="radio"]:focus:invalid:focus,input[type="checkbox"]:focus:invalid:focus{outline-color:#E74C3C}input.wy-input-large{padding:12px;font-size:100%}textarea{overflow:auto;vertical-align:top;width:100%;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif}select,textarea{padding:0.5em 0.625em;display:inline-block;border:1px solid #ccc;font-size:80%;box-shadow:inset 0 1px 3px #ddd;-webkit-transition:border 0.3s linear;-moz-transition:border 0.3s linear;transition:border 0.3s linear}select{border:1px solid #ccc;background-color:#fff}select[multiple]{height:auto}select:focus,textarea:focus{outline:0}select[disabled],textarea[disabled],input[readonly],select[readonly],textarea[readonly]{cursor:not-allowed;background-color:#fff;color:#cad2d3;border-color:transparent}.wy-checkbox,.wy-radio{margin:6px 0;color:#404040;display:block}.wy-checkbox input,.wy-radio input{vertical-align:baseline}.wy-form-message-inline{display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.wy-input-prefix,.wy-input-suffix{white-space:nowrap;padding:6px}.wy-input-prefix .wy-input-context,.wy-input-suffix .wy-input-context{line-height:27px;padding:0 8px;display:inline-block;font-size:80%;background-color:#f3f6f6;border:solid 1px #ccc;color:#999}.wy-input-suffix .wy-input-context{border-left:0}.wy-input-prefix .wy-input-context{border-right:0}.wy-control-group.wy-control-group-error .wy-form-message,.wy-control-group.wy-control-group-error>label{color:#E74C3C}.wy-control-group.wy-control-group-error input[type="text"],.wy-control-group.wy-control-group-error input[type="password"],.wy-control-group.wy-control-group-error input[type="email"],.wy-control-group.wy-control-group-error input[type="url"],.wy-control-group.wy-control-group-error input[type="date"],.wy-control-group.wy-control-group-error input[type="month"],.wy-control-group.wy-control-group-error input[type="time"],.wy-control-group.wy-control-group-error input[type="datetime"],.wy-control-group.wy-control-group-error input[type="datetime-local"],.wy-control-group.wy-control-group-error input[type="week"],.wy-control-group.wy-control-group-error input[type="number"],.wy-control-group.wy-control-group-error input[type="search"],.wy-control-group.wy-control-group-error input[type="tel"],.wy-control-group.wy-control-group-error input[type="color"]{border:solid 1px #E74C3C}.wy-control-group.wy-control-group-error textarea{border:solid 1px #E74C3C}.wy-inline-validate{white-space:nowrap}.wy-inline-validate .wy-input-context{padding:0.5em 0.625em;display:inline-block;font-size:80%}.wy-inline-validate.wy-inline-validate-success .wy-input-context{color:#27AE60}.wy-inline-validate.wy-inline-validate-danger .wy-input-context{color:#E74C3C}.wy-inline-validate.wy-inline-validate-warning .wy-input-context{color:#E67E22}.wy-inline-validate.wy-inline-validate-info .wy-input-context{color:#dd4814}.rotate-90{-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg)}.rotate-180{-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg)}.rotate-270{-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-ms-transform:rotate(270deg);-o-transform:rotate(270deg);transform:rotate(270deg)}.mirror{-webkit-transform:scaleX(-1);-moz-transform:scaleX(-1);-ms-transform:scaleX(-1);-o-transform:scaleX(-1);transform:scaleX(-1)}.mirror.rotate-90{-webkit-transform:scaleX(-1) rotate(90deg);-moz-transform:scaleX(-1) rotate(90deg);-ms-transform:scaleX(-1) rotate(90deg);-o-transform:scaleX(-1) rotate(90deg);transform:scaleX(-1) rotate(90deg)}.mirror.rotate-180{-webkit-transform:scaleX(-1) rotate(180deg);-moz-transform:scaleX(-1) rotate(180deg);-ms-transform:scaleX(-1) rotate(180deg);-o-transform:scaleX(-1) rotate(180deg);transform:scaleX(-1) rotate(180deg)}.mirror.rotate-270{-webkit-transform:scaleX(-1) rotate(270deg);-moz-transform:scaleX(-1) rotate(270deg);-ms-transform:scaleX(-1) rotate(270deg);-o-transform:scaleX(-1) rotate(270deg);transform:scaleX(-1) rotate(270deg)}@media only screen and (max-width: 480px){.wy-form button[type="submit"]{margin:0.7em 0 0}.wy-form input[type="text"],.wy-form input[type="password"],.wy-form input[type="email"],.wy-form input[type="url"],.wy-form input[type="date"],.wy-form input[type="month"],.wy-form input[type="time"],.wy-form input[type="datetime"],.wy-form input[type="datetime-local"],.wy-form input[type="week"],.wy-form input[type="number"],.wy-form input[type="search"],.wy-form input[type="tel"],.wy-form input[type="color"]{margin-bottom:0.3em;display:block}.wy-form label{margin-bottom:0.3em;display:block}.wy-form input[type="password"],.wy-form input[type="email"],.wy-form input[type="url"],.wy-form input[type="date"],.wy-form input[type="month"],.wy-form input[type="time"],.wy-form input[type="datetime"],.wy-form input[type="datetime-local"],.wy-form input[type="week"],.wy-form input[type="number"],.wy-form input[type="search"],.wy-form input[type="tel"],.wy-form input[type="color"]{margin-bottom:0}.wy-form-aligned .wy-control-group label{margin-bottom:0.3em;text-align:left;display:block;width:100%}.wy-form-aligned .wy-control{margin:1.5em 0 0 0}.wy-form .wy-help-inline,.wy-form-message-inline,.wy-form-message{display:block;font-size:80%;padding:6px 0}}@media screen and (max-width: 768px){.tablet-hide{display:none}.wy-table-responsive table td,.wy-table-responsive table th{white-space:nowrap}}@media screen and (max-width: 480px){.mobile-hide{display:none}}.float-left{float:left}.float-right{float:right}.full-width{width:100%}.wy-table,.rst-content table.docutils,.rst-content table.field-list{border-collapse:collapse;border-spacing:0;empty-cells:show;margin-bottom:24px}.wy-table caption,.rst-content table.docutils caption,.rst-content table.field-list caption{color:#000;font:italic 85%/1 arial,sans-serif;padding:1em 0;text-align:center}.wy-table td,.rst-content table.docutils td,.rst-content table.field-list td,.wy-table th,.rst-content table.docutils th,.rst-content table.field-list th{font-size:90%;margin:0;overflow:visible;padding:8px 16px}.wy-table td:first-child,.rst-content table.docutils td:first-child,.rst-content table.field-list td:first-child,.wy-table th:first-child,.rst-content table.docutils th:first-child,.rst-content table.field-list th:first-child{border-left-width:0}.wy-table thead,.rst-content table.docutils thead,.rst-content table.field-list thead{color:#000;text-align:left;vertical-align:bottom;white-space:nowrap}.wy-table thead th,.rst-content table.docutils thead th,.rst-content table.field-list thead th{font-weight:bold;border-bottom:solid 2px #e1e4e5}.wy-table td,.rst-content table.docutils td,.rst-content table.field-list td{background-color:transparent;vertical-align:middle}.wy-table td p,.rst-content table.docutils td p,.rst-content table.field-list td p{line-height:18px}.wy-table td p:last-child,.rst-content table.docutils td p:last-child,.rst-content table.field-list td p:last-child{margin-bottom:0}.wy-table .wy-table-cell-min,.rst-content table.docutils .wy-table-cell-min,.rst-content table.field-list .wy-table-cell-min{width:1%;padding-right:0}.wy-table .wy-table-cell-min input[type=checkbox],.rst-content table.docutils .wy-table-cell-min input[type=checkbox],.rst-content table.field-list .wy-table-cell-min input[type=checkbox],.wy-table .wy-table-cell-min input[type=checkbox],.rst-content table.docutils .wy-table-cell-min input[type=checkbox],.rst-content table.field-list .wy-table-cell-min input[type=checkbox]{margin:0}.wy-table-secondary{color:gray;font-size:90%}.wy-table-tertiary{color:gray;font-size:80%}.wy-table-odd td,.wy-table-striped tr:nth-child(2n-1) td,.rst-content table.docutils:not(.field-list) tr:nth-child(2n-1) td{background-color:#f3f6f6}.wy-table-backed{background-color:#f3f6f6}.wy-table-bordered-all,.rst-content table.docutils{border:1px solid #e1e4e5}.wy-table-bordered-all td,.rst-content table.docutils td{border-bottom:1px solid #e1e4e5;border-left:1px solid #e1e4e5}.wy-table-bordered-all tbody>tr:last-child td,.rst-content table.docutils tbody>tr:last-child td{border-bottom-width:0}.wy-table-bordered{border:1px solid #e1e4e5}.wy-table-bordered-rows td{border-bottom:1px solid #e1e4e5}.wy-table-bordered-rows tbody>tr:last-child td{border-bottom-width:0}.wy-table-horizontal tbody>tr:last-child td{border-bottom-width:0}.wy-table-horizontal td,.wy-table-horizontal th{border-width:0 0 1px 0;border-bottom:1px solid #e1e4e5}.wy-table-horizontal tbody>tr:last-child td{border-bottom-width:0}.wy-table-responsive{margin-bottom:24px;max-width:100%;overflow:auto}.wy-table-responsive table{margin-bottom:0 !important}a{color:#dd4814;text-decoration:none;cursor:pointer}a:hover{color:#97310e}a:visited{color:#97310e}html{height:100%;overflow-x:hidden}body{font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;font-weight:normal;color:#404040;min-height:100%;overflow-x:hidden;background:#edf0f2}.wy-text-left{text-align:left}.wy-text-center{text-align:center}.wy-text-right{text-align:right}.wy-text-large{font-size:120%}.wy-text-normal{font-size:100%}.wy-text-small,small{font-size:80%}.wy-text-strike{text-decoration:line-through}.wy-text-warning{color:#E67E22 !important}a.wy-text-warning:hover{color:#eb9950 !important}.wy-text-info{color:#dd4814 !important}a.wy-text-info:hover{color:#409ad5 !important}.wy-text-success{color:#27AE60 !important}a.wy-text-success:hover{color:#36d278 !important}.wy-text-danger{color:#E74C3C !important}a.wy-text-danger:hover{color:#ed7669 !important}.wy-text-neutral{color:#404040 !important}a.wy-text-neutral:hover{color:#595959 !important}h1,h2,h3,h4,h5,h6,legend{margin-top:0;font-weight:700;font-family:"Roboto Slab","ff-tisa-web-pro","Georgia",Arial,sans-serif}p{line-height:24px;margin:0;font-size:16px;margin-bottom:24px}h1{font-size:175%}h2{font-size:150%}h3{font-size:125%}h4{font-size:115%}h5{font-size:110%}h6{font-size:100%}hr{display:block;height:1px;border:0;border-top:1px solid #e1e4e5;margin:24px 0;padding:0}code,.rst-content tt{white-space:nowrap;max-width:100%;background:#fff;border:solid 1px #e1e4e5;font-size:75%;padding:0 5px;font-family:Consolas,"Andale Mono WT","Andale Mono","Lucida Console","Lucida Sans Typewriter","DejaVu Sans Mono","Bitstream Vera Sans Mono","Liberation Mono","Nimbus Mono L",Monaco,"Courier New",Courier,monospace;color:#E74C3C;overflow-x:auto}code.code-large,.rst-content tt.code-large{font-size:90%}.wy-plain-list-disc,.rst-content .section ul,.rst-content .toctree-wrapper ul,article ul{list-style:disc;line-height:24px;margin-bottom:24px}.wy-plain-list-disc li,.rst-content .section ul li,.rst-content .toctree-wrapper ul li,article ul li{list-style:disc;margin-left:24px}.wy-plain-list-disc li p:last-child,.rst-content .section ul li p:last-child,.rst-content .toctree-wrapper ul li p:last-child,article ul li p:last-child{margin-bottom:0}.wy-plain-list-disc li ul,.rst-content .section ul li ul,.rst-content .toctree-wrapper ul li ul,article ul li ul{margin-bottom:0}.wy-plain-list-disc li li,.rst-content .section ul li li,.rst-content .toctree-wrapper ul li li,article ul li li{list-style:circle}.wy-plain-list-disc li li li,.rst-content .section ul li li li,.rst-content .toctree-wrapper ul li li li,article ul li li li{list-style:square}.wy-plain-list-disc li ol li,.rst-content .section ul li ol li,.rst-content .toctree-wrapper ul li ol li,article ul li ol li{list-style:decimal}.wy-plain-list-decimal,.rst-content .section ol,.rst-content ol.arabic,article ol{list-style:decimal;line-height:24px;margin-bottom:24px}.wy-plain-list-decimal li,.rst-content .section ol li,.rst-content ol.arabic li,article ol li{list-style:decimal;margin-left:24px}.wy-plain-list-decimal li p:last-child,.rst-content .section ol li p:last-child,.rst-content ol.arabic li p:last-child,article ol li p:last-child{margin-bottom:0}.wy-plain-list-decimal li ul,.rst-content .section ol li ul,.rst-content ol.arabic li ul,article ol li ul{margin-bottom:0}.wy-plain-list-decimal li ul li,.rst-content .section ol li ul li,.rst-content ol.arabic li ul li,article ol li ul li{list-style:disc}.codeblock-example{border:1px solid #e1e4e5;border-bottom:none;padding:24px;padding-top:48px;font-weight:500;background:#fff;position:relative}.codeblock-example:after{content:"Example";position:absolute;top:0px;left:0px;background:#97310e;color:#fff;padding:6px 12px}.codeblock-example.prettyprint-example-only{border:1px solid #e1e4e5;margin-bottom:24px}.codeblock,pre.literal-block,.rst-content .literal-block,.rst-content pre.literal-block,div[class^='highlight']{border:1px solid #e1e4e5;padding:0px;overflow-x:auto;background:#fff;margin:1px 0 24px 0}.codeblock div[class^='highlight'],pre.literal-block div[class^='highlight'],.rst-content .literal-block div[class^='highlight'],div[class^='highlight'] div[class^='highlight']{border:none;background:none;margin:0}div[class^='highlight'] td.code{width:100%}.linenodiv pre{border-right:solid 1px #e6e9ea;margin:0;padding:12px 12px;font-family:Consolas,"Andale Mono WT","Andale Mono","Lucida Console","Lucida Sans Typewriter","DejaVu Sans Mono","Bitstream Vera Sans Mono","Liberation Mono","Nimbus Mono L",Monaco,"Courier New",Courier,monospace;font-size:12px;line-height:1.5;color:#d9d9d9}div[class^='highlight'] pre{white-space:pre;margin:0;padding:12px 12px;font-family:Consolas,"Andale Mono WT","Andale Mono","Lucida Console","Lucida Sans Typewriter","DejaVu Sans Mono","Bitstream Vera Sans Mono","Liberation Mono","Nimbus Mono L",Monaco,"Courier New",Courier,monospace;font-size:12px;line-height:1.5;display:block;overflow:auto;color:#404040}@media print{.codeblock,pre.literal-block,.rst-content .literal-block,.rst-content pre.literal-block,div[class^='highlight'],div[class^='highlight'] pre{white-space:pre-wrap}}.hll{background-color:#ffc;margin:0 -12px;padding:0 12px;display:block}.c{color:#998;font-style:italic}.err{color:#a61717;background-color:#e3d2d2}.k{font-weight:bold}.o{font-weight:bold}.cm{color:#998;font-style:italic}.cp{color:#999;font-weight:bold}.c1{color:#998;font-style:italic}.cs{color:#999;font-weight:bold;font-style:italic}.gd{color:#000;background-color:#fdd}.gd .x{color:#000;background-color:#faa}.ge{font-style:italic}.gr{color:#a00}.gh{color:#999}.gi{color:#000;background-color:#dfd}.gi .x{color:#000;background-color:#afa}.go{color:#888}.gp{color:#555}.gs{font-weight:bold}.gu{color:purple;font-weight:bold}.gt{color:#a00}.kc{font-weight:bold}.kd{font-weight:bold}.kn{font-weight:bold}.kp{font-weight:bold}.kr{font-weight:bold}.kt{color:#458;font-weight:bold}.m{color:#099}.s{color:#d14}.n{color:#333}.na{color:teal}.nb{color:#0086b3}.nc{color:#458;font-weight:bold}.no{color:teal}.ni{color:purple}.ne{color:#900;font-weight:bold}.nf{color:#900;font-weight:bold}.nn{color:#555}.nt{color:navy}.nv{color:teal}.ow{font-weight:bold}.w{color:#bbb}.mf{color:#099}.mh{color:#099}.mi{color:#099}.mo{color:#099}.sb{color:#d14}.sc{color:#d14}.sd{color:#d14}.s2{color:#d14}.se{color:#d14}.sh{color:#d14}.si{color:#d14}.sx{color:#d14}.sr{color:#009926}.s1{color:#d14}.ss{color:#990073}.bp{color:#999}.vc{color:teal}.vg{color:teal}.vi{color:teal}.il{color:#099}.gc{color:#999;background-color:#EAF2F5}.wy-breadcrumbs li{display:inline-block}.wy-breadcrumbs li.wy-breadcrumbs-aside{float:right}.wy-breadcrumbs li a{display:inline-block;padding:5px}.wy-breadcrumbs li a:first-child{padding-left:0}.wy-breadcrumbs-extra{margin-bottom:0;color:#b3b3b3;font-size:80%;display:inline-block}@media screen and (max-width: 480px){.wy-breadcrumbs-extra{display:none}.wy-breadcrumbs li.wy-breadcrumbs-aside{display:none}}@media print{.wy-breadcrumbs li.wy-breadcrumbs-aside{display:none}}.wy-affix{position:fixed;top:1.618em}.wy-menu a:hover{text-decoration:none}.wy-menu-horiz{*zoom:1}.wy-menu-horiz:before,.wy-menu-horiz:after{display:table;content:""}.wy-menu-horiz:after{clear:both}.wy-menu-horiz ul,.wy-menu-horiz li{display:inline-block}.wy-menu-horiz li:hover{background:rgba(255,255,255,0.1)}.wy-menu-horiz li.divide-left{border-left:solid 1px #404040}.wy-menu-horiz li.divide-right{border-right:solid 1px #404040}.wy-menu-horiz a{height:32px;display:inline-block;line-height:32px;padding:0 16px}.wy-menu-vertical header{height:32px;display:inline-block;line-height:32px;padding:0 1.618em;display:block;font-weight:bold;text-transform:uppercase;font-size:80%;color:#dd4814;white-space:nowrap}.wy-menu-vertical ul{margin-bottom:0}.wy-menu-vertical li.divide-top{border-top:solid 1px #404040}.wy-menu-vertical li.divide-bottom{border-bottom:solid 1px #404040}.wy-menu-vertical li.current{background:#e3e3e3}.wy-menu-vertical li.current a{color:gray;border-right:solid 1px #c9c9c9;padding:0.4045em 2.427em}.wy-menu-vertical li.current a:hover{background:#d6d6d6}.wy-menu-vertical li.on a,.wy-menu-vertical li.current>a{color:#404040;padding:0.4045em 1.618em;font-weight:bold;position:relative;background:#fcfcfc;border:none;border-bottom:solid 1px #c9c9c9;border-top:solid 1px #c9c9c9;padding-left:1.618em -4px}.wy-menu-vertical li.on a:hover,.wy-menu-vertical li.current>a:hover{background:#fcfcfc}.wy-menu-vertical li.toctree-l2.current>a{background:#c9c9c9;padding:0.4045em 2.427em}.wy-menu-vertical li.current ul{display:block}.wy-menu-vertical li ul{margin-bottom:0;display:none}.wy-menu-vertical .local-toc li ul{display:block}.wy-menu-vertical li ul li a{margin-bottom:0;color:#b3b3b3;font-weight:normal}.wy-menu-vertical a{display:inline-block;line-height:18px;padding:0.4045em 1.618em;display:block;position:relative;font-size:90%;color:#b3b3b3}.wy-menu-vertical a:hover{background-color:#4e4a4a;cursor:pointer}.wy-menu-vertical a:active{background-color:#dd4814;cursor:pointer;color:#fff}.wy-side-nav-search{z-index:200;background-color:#dd4814;text-align:center;padding:0.809em;display:block;color:#fcfcfc;margin-bottom:0.809em}.wy-side-nav-search input[type=text]{width:100%;border-radius:50px;padding:6px 12px;border-color:#97310e}.wy-side-nav-search img{display:block;margin:auto auto 0.809em auto;height:45px;width:45px;background-color:#dd4814;padding:5px;border-radius:100%}.wy-side-nav-search>a,.wy-side-nav-search .wy-dropdown>a{color:#fcfcfc;font-size:100%;font-weight:bold;display:inline-block;padding:4px 6px;margin-bottom:0.809em}.wy-side-nav-search>a:hover,.wy-side-nav-search .wy-dropdown>a:hover{background:rgba(255,255,255,0.1)}.wy-nav .wy-menu-vertical header{color:#dd4814}.wy-nav .wy-menu-vertical a{color:#b3b3b3}.wy-nav .wy-menu-vertical a:hover{background-color:#dd4814;color:#fff}[data-menu-wrap]{-webkit-transition:all 0.2s ease-in;-moz-transition:all 0.2s ease-in;transition:all 0.2s ease-in;position:absolute;opacity:1;width:100%;opacity:0}[data-menu-wrap].move-center{left:0;right:auto;opacity:1}[data-menu-wrap].move-left{right:auto;left:-100%;opacity:0}[data-menu-wrap].move-right{right:-100%;left:auto;opacity:0}.wy-body-for-nav{background:left repeat-y #fcfcfc;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoxOERBMTRGRDBFMUUxMUUzODUwMkJCOThDMEVFNURFMCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoxOERBMTRGRTBFMUUxMUUzODUwMkJCOThDMEVFNURFMCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjE4REExNEZCMEUxRTExRTM4NTAyQkI5OEMwRUU1REUwIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjE4REExNEZDMEUxRTExRTM4NTAyQkI5OEMwRUU1REUwIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+EwrlwAAAAA5JREFUeNpiMDU0BAgwAAE2AJgB9BnaAAAAAElFTkSuQmCC);background-size:300px 1px}.wy-grid-for-nav{position:absolute;width:100%;height:100%}.wy-nav-side{position:absolute;top:0;left:0;width:300px;overflow:hidden;min-height:100%;background:#343131;z-index:200}.wy-nav-top{display:none;background:#dd4814;color:#fff;padding:0.4045em 0.809em;position:relative;line-height:50px;text-align:center;font-size:100%;*zoom:1}.wy-nav-top:before,.wy-nav-top:after{display:table;content:""}.wy-nav-top:after{clear:both}.wy-nav-top a{color:#fff;font-weight:bold}.wy-nav-top img{margin-right:12px;height:45px;width:45px;background-color:#dd4814;padding:5px;border-radius:100%}.wy-nav-top i{font-size:30px;float:left;cursor:pointer}.wy-nav-content-wrap{margin-left:300px;background:#fcfcfc;min-height:100%}.wy-nav-content{padding:1.618em 3.236em;height:100x;margin:auto}.wy-body-mask{position:fixed;width:100%;height:100%;background:rgba(0,0,0,0.2);display:none;z-index:499}.wy-body-mask.on{display:block}footer{color:#999}footer p{margin-bottom:12px}.rst-footer-buttons{*zoom:1}.rst-footer-buttons:before,.rst-footer-buttons:after{display:table;content:""}.rst-footer-buttons:after{clear:both}#search-results .search li{margin-bottom:24px;border-bottom:solid 1px #e1e4e5;padding-bottom:24px}#search-results .search li:first-child{border-top:solid 1px #e1e4e5;padding-top:24px}#search-results .search li a{font-size:120%;margin-bottom:12px;display:inline-block}#search-results .context{color:gray;font-size:90%}@media screen and (max-width: 768px){.wy-body-for-nav{background:#fcfcfc}.wy-nav-top{display:block}.wy-nav-side{left:-300px}.wy-nav-side.shift{width:85%;left:0}.wy-nav-content-wrap{margin-left:0!important}.wy-nav-content-wrap .wy-nav-content{padding:1.618em}.wy-nav-content-wrap.shift{position:fixed;min-width:100%;left:85%;top:0;height:100%;overflow:hidden}}@media screen and (min-width: 1400px){.wy-nav-content-wrap{background:rgba(0,0,0,0.05)}.wy-nav-content{margin:0;background:#fcfcfc}}@media print{.rst-versions,footer,.wy-nav-side{display:none}.wy-nav-content-wrap{margin-left:0}}nav.stickynav{position:fixed;top:0}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;border-top:solid 10px #343131;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;z-index:400}.rst-versions a{color:#dd4814;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27AE60;*zoom:1}.rst-versions .rst-current-version:before,.rst-versions .rst-current-version:after{display:table;content:""}.rst-versions .rst-current-version:after{clear:both}.rst-versions .rst-current-version .fa,.rst-versions .rst-current-version .rst-content .admonition-title,.rst-content .rst-versions .rst-current-version .admonition-title,.rst-versions .rst-current-version .rst-content h1 .headerlink,.rst-content h1 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content h2 .headerlink,.rst-content h2 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content h3 .headerlink,.rst-content h3 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content h4 .headerlink,.rst-content h4 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content h5 .headerlink,.rst-content h5 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content h6 .headerlink,.rst-content h6 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content dl dt .headerlink,.rst-content dl dt .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .icon{color:#fcfcfc}.rst-versions .rst-current-version .fa-book,.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#E74C3C;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#F1C40F;color:#000}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:gray;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:solid 1px #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px}.rst-versions.rst-badge .icon-book{float:none}.rst-versions.rst-badge .fa-book,.rst-versions.rst-badge .icon-book{float:none}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book,.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge .rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width: 768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}img{width:100%;height:auto}}.rst-content img{max-width:100%;height:auto !important}.rst-content div.figure{margin-bottom:24px}.rst-content div.figure.align-center{text-align:center}.rst-content .section>img,.rst-content .section>a>img{margin-bottom:24px}.rst-content blockquote{margin-left:24px;line-height:24px;margin-bottom:24px}.rst-content .note .last,.rst-content .attention .last,.rst-content .caution .last,.rst-content .danger .last,.rst-content .error .last,.rst-content .hint .last,.rst-content .important .last,.rst-content .tip .last,.rst-content .warning .last,.rst-content .seealso .last,.rst-content .admonition-todo .last{margin-bottom:0}.rst-content .admonition-title:before{margin-right:4px}.rst-content .admonition table{border-color:rgba(0,0,0,0.1)}.rst-content .admonition table td,.rst-content .admonition table th{background:transparent !important;border-color:rgba(0,0,0,0.1) !important}.rst-content .section ol.loweralpha,.rst-content .section ol.loweralpha li{list-style:lower-alpha}.rst-content .section ol.upperalpha,.rst-content .section ol.upperalpha li{list-style:upper-alpha}.rst-content .section ol p,.rst-content .section ul p{margin-bottom:12px}.rst-content .line-block{margin-left:24px}.rst-content .topic-title{font-weight:bold;margin-bottom:12px}.rst-content .toc-backref{color:#404040}.rst-content .align-right{float:right;margin:0px 0px 24px 24px}.rst-content .align-left{float:left;margin:0px 24px 24px 0px}.rst-content .align-center{margin:auto;display:block}.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content dl dt .headerlink{display:none;visibility:hidden;font-size:14px}.rst-content h1 .headerlink:after,.rst-content h2 .headerlink:after,.rst-content h3 .headerlink:after,.rst-content h4 .headerlink:after,.rst-content h5 .headerlink:after,.rst-content h6 .headerlink:after,.rst-content dl dt .headerlink:after{visibility:visible;content:"";font-family:FontAwesome;display:inline-block}.rst-content h1:hover .headerlink,.rst-content h2:hover .headerlink,.rst-content h3:hover .headerlink,.rst-content h4:hover .headerlink,.rst-content h5:hover .headerlink,.rst-content h6:hover .headerlink,.rst-content dl dt:hover .headerlink{display:inline-block}.rst-content .sidebar{float:right;width:40%;display:block;margin:0 0 24px 24px;padding:24px;background:#f3f6f6;border:solid 1px #e1e4e5}.rst-content .sidebar p,.rst-content .sidebar ul,.rst-content .sidebar dl{font-size:90%}.rst-content .sidebar .last{margin-bottom:0}.rst-content .sidebar .sidebar-title{display:block;font-family:"Roboto Slab","ff-tisa-web-pro","Georgia",Arial,sans-serif;font-weight:bold;background:#e1e4e5;padding:6px 12px;margin:-24px;margin-bottom:24px;font-size:100%}.rst-content .highlighted{background:#F1C40F;display:inline-block;font-weight:bold;padding:0 6px}.rst-content .footnote-reference,.rst-content .citation-reference{vertical-align:super;font-size:90%}.rst-content table.docutils.citation,.rst-content table.docutils.footnote{background:none;border:none;color:#999}.rst-content table.docutils.citation td,.rst-content table.docutils.citation tr,.rst-content table.docutils.footnote td,.rst-content table.docutils.footnote tr{border:none;background-color:transparent !important;white-space:normal}.rst-content table.docutils.citation td.label,.rst-content table.docutils.footnote td.label{padding-left:0;padding-right:0;vertical-align:top}.rst-content table.field-list{border:none}.rst-content table.field-list td{border:none;padding-top:5px}.rst-content table.field-list td>strong{display:inline-block;margin-top:3px}.rst-content table.field-list .field-name{padding-right:10px;text-align:left;white-space:nowrap}.rst-content table.field-list .field-body{text-align:left;padding-left:0}.rst-content tt{color:#000}.rst-content tt big,.rst-content tt em{font-size:100% !important;line-height:normal}.rst-content tt .xref,a .rst-content tt{font-weight:bold}.rst-content a tt{color:#dd4814}.rst-content dl{margin-bottom:24px}.rst-content dl dt{font-weight:bold}.rst-content dl p,.rst-content dl table,.rst-content dl ul,.rst-content dl ol{margin-bottom:12px !important}.rst-content dl dd{margin:0 0 12px 24px}.rst-content dl:not(.docutils){margin-bottom:24px}.rst-content dl:not(.docutils) dt{display:inline-block;margin:6px 0;font-size:90%;line-height:normal;background:#dedede;color:#dd4814;border-top:solid 3px #8ba8af;padding:6px;position:relative}.rst-content dl:not(.docutils) dt:before{color:#8ba8af}.rst-content dl:not(.docutils) dt .headerlink{color:#404040;font-size:100% !important}.rst-content dl:not(.docutils) dl dt{margin-bottom:6px;border:none;border-left:solid 3px #ccc;background:#f0f0f0;color:gray}.rst-content dl:not(.docutils) dl dt .headerlink{color:#404040;font-size:100% !important}.rst-content dl:not(.docutils) dt:first-child{margin-top:0}.rst-content dl:not(.docutils) tt{font-weight:bold}.rst-content dl:not(.docutils) tt.descname,.rst-content dl:not(.docutils) tt.descclassname{background-color:transparent;border:none;padding:0;font-size:100% !important}.rst-content dl:not(.docutils) tt.descname{font-weight:bold}.rst-content dl:not(.docutils) .optional{display:inline-block;padding:0 4px;color:#000;font-weight:bold}.rst-content dl:not(.docutils) .property{display:inline-block;padding-right:8px}.rst-content .viewcode-link,.rst-content .viewcode-back{display:inline-block;color:#27AE60;font-size:80%;padding-left:24px}.rst-content .viewcode-back{display:block;float:right}.rst-content p.rubric{margin-bottom:12px;font-weight:bold}@media screen and (max-width: 480px){.rst-content .sidebar{width:100%}}span[id*='MathJax-Span']{color:#404040}.math{text-align:center}
-/*# sourceMappingURL=theme.css.map */
diff --git a/user_guide_src/source/_themes/sphinx_rtd_theme/static/fonts/FontAwesome.otf b/user_guide_src/source/_themes/sphinx_rtd_theme/static/fonts/FontAwesome.otf
deleted file mode 100644
index 8b0f54e47..000000000
--- a/user_guide_src/source/_themes/sphinx_rtd_theme/static/fonts/FontAwesome.otf
+++ /dev/null
Binary files differ
diff --git a/user_guide_src/source/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.eot b/user_guide_src/source/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.eot
deleted file mode 100644
index 7c79c6a6b..000000000
--- a/user_guide_src/source/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.eot
+++ /dev/null
Binary files differ
diff --git a/user_guide_src/source/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.svg b/user_guide_src/source/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.svg
deleted file mode 100644
index 45fdf3383..000000000
--- a/user_guide_src/source/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.svg
+++ /dev/null
@@ -1,414 +0,0 @@
-<?xml version="1.0" standalone="no"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
-<svg xmlns="http://www.w3.org/2000/svg">
-<metadata></metadata>
-<defs>
-<font id="fontawesomeregular" horiz-adv-x="1536" >
-<font-face units-per-em="1792" ascent="1536" descent="-256" />
-<missing-glyph horiz-adv-x="448" />
-<glyph unicode=" " horiz-adv-x="448" />
-<glyph unicode="&#x09;" horiz-adv-x="448" />
-<glyph unicode="&#xa0;" horiz-adv-x="448" />
-<glyph unicode="&#xa8;" horiz-adv-x="1792" />
-<glyph unicode="&#xa9;" horiz-adv-x="1792" />
-<glyph unicode="&#xae;" horiz-adv-x="1792" />
-<glyph unicode="&#xb4;" horiz-adv-x="1792" />
-<glyph unicode="&#xc6;" horiz-adv-x="1792" />
-<glyph unicode="&#x2000;" horiz-adv-x="768" />
-<glyph unicode="&#x2001;" />
-<glyph unicode="&#x2002;" horiz-adv-x="768" />
-<glyph unicode="&#x2003;" />
-<glyph unicode="&#x2004;" horiz-adv-x="512" />
-<glyph unicode="&#x2005;" horiz-adv-x="384" />
-<glyph unicode="&#x2006;" horiz-adv-x="256" />
-<glyph unicode="&#x2007;" horiz-adv-x="256" />
-<glyph unicode="&#x2008;" horiz-adv-x="192" />
-<glyph unicode="&#x2009;" horiz-adv-x="307" />
-<glyph unicode="&#x200a;" horiz-adv-x="85" />
-<glyph unicode="&#x202f;" horiz-adv-x="307" />
-<glyph unicode="&#x205f;" horiz-adv-x="384" />
-<glyph unicode="&#x2122;" horiz-adv-x="1792" />
-<glyph unicode="&#x221e;" horiz-adv-x="1792" />
-<glyph unicode="&#x2260;" horiz-adv-x="1792" />
-<glyph unicode="&#xe000;" horiz-adv-x="500" d="M0 0z" />
-<glyph unicode="&#xf000;" horiz-adv-x="1792" d="M1699 1350q0 -35 -43 -78l-632 -632v-768h320q26 0 45 -19t19 -45t-19 -45t-45 -19h-896q-26 0 -45 19t-19 45t19 45t45 19h320v768l-632 632q-43 43 -43 78q0 23 18 36.5t38 17.5t43 4h1408q23 0 43 -4t38 -17.5t18 -36.5z" />
-<glyph unicode="&#xf001;" d="M1536 1312v-1120q0 -50 -34 -89t-86 -60.5t-103.5 -32t-96.5 -10.5t-96.5 10.5t-103.5 32t-86 60.5t-34 89t34 89t86 60.5t103.5 32t96.5 10.5q105 0 192 -39v537l-768 -237v-709q0 -50 -34 -89t-86 -60.5t-103.5 -32t-96.5 -10.5t-96.5 10.5t-103.5 32t-86 60.5t-34 89 t34 89t86 60.5t103.5 32t96.5 10.5q105 0 192 -39v967q0 31 19 56.5t49 35.5l832 256q12 4 28 4q40 0 68 -28t28 -68z" />
-<glyph unicode="&#xf002;" horiz-adv-x="1664" d="M1152 704q0 185 -131.5 316.5t-316.5 131.5t-316.5 -131.5t-131.5 -316.5t131.5 -316.5t316.5 -131.5t316.5 131.5t131.5 316.5zM1664 -128q0 -52 -38 -90t-90 -38q-54 0 -90 38l-343 342q-179 -124 -399 -124q-143 0 -273.5 55.5t-225 150t-150 225t-55.5 273.5 t55.5 273.5t150 225t225 150t273.5 55.5t273.5 -55.5t225 -150t150 -225t55.5 -273.5q0 -220 -124 -399l343 -343q37 -37 37 -90z" />
-<glyph unicode="&#xf003;" horiz-adv-x="1792" d="M1664 32v768q-32 -36 -69 -66q-268 -206 -426 -338q-51 -43 -83 -67t-86.5 -48.5t-102.5 -24.5h-1h-1q-48 0 -102.5 24.5t-86.5 48.5t-83 67q-158 132 -426 338q-37 30 -69 66v-768q0 -13 9.5 -22.5t22.5 -9.5h1472q13 0 22.5 9.5t9.5 22.5zM1664 1083v11v13.5t-0.5 13 t-3 12.5t-5.5 9t-9 7.5t-14 2.5h-1472q-13 0 -22.5 -9.5t-9.5 -22.5q0 -168 147 -284q193 -152 401 -317q6 -5 35 -29.5t46 -37.5t44.5 -31.5t50.5 -27.5t43 -9h1h1q20 0 43 9t50.5 27.5t44.5 31.5t46 37.5t35 29.5q208 165 401 317q54 43 100.5 115.5t46.5 131.5z M1792 1120v-1088q0 -66 -47 -113t-113 -47h-1472q-66 0 -113 47t-47 113v1088q0 66 47 113t113 47h1472q66 0 113 -47t47 -113z" />
-<glyph unicode="&#xf004;" horiz-adv-x="1792" d="M896 -128q-26 0 -44 18l-624 602q-10 8 -27.5 26t-55.5 65.5t-68 97.5t-53.5 121t-23.5 138q0 220 127 344t351 124q62 0 126.5 -21.5t120 -58t95.5 -68.5t76 -68q36 36 76 68t95.5 68.5t120 58t126.5 21.5q224 0 351 -124t127 -344q0 -221 -229 -450l-623 -600 q-18 -18 -44 -18z" />
-<glyph unicode="&#xf005;" horiz-adv-x="1664" d="M1664 889q0 -22 -26 -48l-363 -354l86 -500q1 -7 1 -20q0 -21 -10.5 -35.5t-30.5 -14.5q-19 0 -40 12l-449 236l-449 -236q-22 -12 -40 -12q-21 0 -31.5 14.5t-10.5 35.5q0 6 2 20l86 500l-364 354q-25 27 -25 48q0 37 56 46l502 73l225 455q19 41 49 41t49 -41l225 -455 l502 -73q56 -9 56 -46z" />
-<glyph unicode="&#xf006;" horiz-adv-x="1664" d="M1137 532l306 297l-422 62l-189 382l-189 -382l-422 -62l306 -297l-73 -421l378 199l377 -199zM1664 889q0 -22 -26 -48l-363 -354l86 -500q1 -7 1 -20q0 -50 -41 -50q-19 0 -40 12l-449 236l-449 -236q-22 -12 -40 -12q-21 0 -31.5 14.5t-10.5 35.5q0 6 2 20l86 500 l-364 354q-25 27 -25 48q0 37 56 46l502 73l225 455q19 41 49 41t49 -41l225 -455l502 -73q56 -9 56 -46z" />
-<glyph unicode="&#xf007;" horiz-adv-x="1408" d="M1408 131q0 -120 -73 -189.5t-194 -69.5h-874q-121 0 -194 69.5t-73 189.5q0 53 3.5 103.5t14 109t26.5 108.5t43 97.5t62 81t85.5 53.5t111.5 20q9 0 42 -21.5t74.5 -48t108 -48t133.5 -21.5t133.5 21.5t108 48t74.5 48t42 21.5q61 0 111.5 -20t85.5 -53.5t62 -81 t43 -97.5t26.5 -108.5t14 -109t3.5 -103.5zM1088 1024q0 -159 -112.5 -271.5t-271.5 -112.5t-271.5 112.5t-112.5 271.5t112.5 271.5t271.5 112.5t271.5 -112.5t112.5 -271.5z" />
-<glyph unicode="&#xf008;" horiz-adv-x="1920" d="M384 -64v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM384 320v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM384 704v128q0 26 -19 45t-45 19h-128 q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1408 -64v512q0 26 -19 45t-45 19h-768q-26 0 -45 -19t-19 -45v-512q0 -26 19 -45t45 -19h768q26 0 45 19t19 45zM384 1088v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45 t45 -19h128q26 0 45 19t19 45zM1792 -64v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1408 704v512q0 26 -19 45t-45 19h-768q-26 0 -45 -19t-19 -45v-512q0 -26 19 -45t45 -19h768q26 0 45 19t19 45zM1792 320v128 q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1792 704v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1792 1088v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19 t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1920 1248v-1344q0 -66 -47 -113t-113 -47h-1600q-66 0 -113 47t-47 113v1344q0 66 47 113t113 47h1600q66 0 113 -47t47 -113z" />
-<glyph unicode="&#xf009;" horiz-adv-x="1664" d="M768 512v-384q0 -52 -38 -90t-90 -38h-512q-52 0 -90 38t-38 90v384q0 52 38 90t90 38h512q52 0 90 -38t38 -90zM768 1280v-384q0 -52 -38 -90t-90 -38h-512q-52 0 -90 38t-38 90v384q0 52 38 90t90 38h512q52 0 90 -38t38 -90zM1664 512v-384q0 -52 -38 -90t-90 -38 h-512q-52 0 -90 38t-38 90v384q0 52 38 90t90 38h512q52 0 90 -38t38 -90zM1664 1280v-384q0 -52 -38 -90t-90 -38h-512q-52 0 -90 38t-38 90v384q0 52 38 90t90 38h512q52 0 90 -38t38 -90z" />
-<glyph unicode="&#xf00a;" horiz-adv-x="1792" d="M512 288v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM512 800v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1152 288v-192q0 -40 -28 -68t-68 -28h-320 q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM512 1312v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1152 800v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28 h320q40 0 68 -28t28 -68zM1792 288v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1152 1312v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1792 800v-192 q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1792 1312v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68z" />
-<glyph unicode="&#xf00b;" horiz-adv-x="1792" d="M512 288v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM512 800v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1792 288v-192q0 -40 -28 -68t-68 -28h-960 q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h960q40 0 68 -28t28 -68zM512 1312v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1792 800v-192q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v192q0 40 28 68t68 28 h960q40 0 68 -28t28 -68zM1792 1312v-192q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h960q40 0 68 -28t28 -68z" />
-<glyph unicode="&#xf00c;" horiz-adv-x="1792" d="M1671 970q0 -40 -28 -68l-724 -724l-136 -136q-28 -28 -68 -28t-68 28l-136 136l-362 362q-28 28 -28 68t28 68l136 136q28 28 68 28t68 -28l294 -295l656 657q28 28 68 28t68 -28l136 -136q28 -28 28 -68z" />
-<glyph unicode="&#xf00d;" horiz-adv-x="1408" d="M1298 214q0 -40 -28 -68l-136 -136q-28 -28 -68 -28t-68 28l-294 294l-294 -294q-28 -28 -68 -28t-68 28l-136 136q-28 28 -28 68t28 68l294 294l-294 294q-28 28 -28 68t28 68l136 136q28 28 68 28t68 -28l294 -294l294 294q28 28 68 28t68 -28l136 -136q28 -28 28 -68 t-28 -68l-294 -294l294 -294q28 -28 28 -68z" />
-<glyph unicode="&#xf00e;" horiz-adv-x="1664" d="M1024 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-224v-224q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v224h-224q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h224v224q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5v-224h224 q13 0 22.5 -9.5t9.5 -22.5zM1152 704q0 185 -131.5 316.5t-316.5 131.5t-316.5 -131.5t-131.5 -316.5t131.5 -316.5t316.5 -131.5t316.5 131.5t131.5 316.5zM1664 -128q0 -53 -37.5 -90.5t-90.5 -37.5q-54 0 -90 38l-343 342q-179 -124 -399 -124q-143 0 -273.5 55.5 t-225 150t-150 225t-55.5 273.5t55.5 273.5t150 225t225 150t273.5 55.5t273.5 -55.5t225 -150t150 -225t55.5 -273.5q0 -220 -124 -399l343 -343q37 -37 37 -90z" />
-<glyph unicode="&#xf010;" horiz-adv-x="1664" d="M1024 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-576q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h576q13 0 22.5 -9.5t9.5 -22.5zM1152 704q0 185 -131.5 316.5t-316.5 131.5t-316.5 -131.5t-131.5 -316.5t131.5 -316.5t316.5 -131.5t316.5 131.5t131.5 316.5z M1664 -128q0 -53 -37.5 -90.5t-90.5 -37.5q-54 0 -90 38l-343 342q-179 -124 -399 -124q-143 0 -273.5 55.5t-225 150t-150 225t-55.5 273.5t55.5 273.5t150 225t225 150t273.5 55.5t273.5 -55.5t225 -150t150 -225t55.5 -273.5q0 -220 -124 -399l343 -343q37 -37 37 -90z " />
-<glyph unicode="&#xf011;" d="M1536 640q0 -156 -61 -298t-164 -245t-245 -164t-298 -61t-298 61t-245 164t-164 245t-61 298q0 182 80.5 343t226.5 270q43 32 95.5 25t83.5 -50q32 -42 24.5 -94.5t-49.5 -84.5q-98 -74 -151.5 -181t-53.5 -228q0 -104 40.5 -198.5t109.5 -163.5t163.5 -109.5 t198.5 -40.5t198.5 40.5t163.5 109.5t109.5 163.5t40.5 198.5q0 121 -53.5 228t-151.5 181q-42 32 -49.5 84.5t24.5 94.5q31 43 84 50t95 -25q146 -109 226.5 -270t80.5 -343zM896 1408v-640q0 -52 -38 -90t-90 -38t-90 38t-38 90v640q0 52 38 90t90 38t90 -38t38 -90z" />
-<glyph unicode="&#xf012;" horiz-adv-x="1792" d="M256 96v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM640 224v-320q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v320q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1024 480v-576q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23 v576q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1408 864v-960q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v960q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1792 1376v-1472q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v1472q0 14 9 23t23 9h192q14 0 23 -9t9 -23z" />
-<glyph unicode="&#xf013;" d="M1024 640q0 106 -75 181t-181 75t-181 -75t-75 -181t75 -181t181 -75t181 75t75 181zM1536 749v-222q0 -12 -8 -23t-20 -13l-185 -28q-19 -54 -39 -91q35 -50 107 -138q10 -12 10 -25t-9 -23q-27 -37 -99 -108t-94 -71q-12 0 -26 9l-138 108q-44 -23 -91 -38 q-16 -136 -29 -186q-7 -28 -36 -28h-222q-14 0 -24.5 8.5t-11.5 21.5l-28 184q-49 16 -90 37l-141 -107q-10 -9 -25 -9q-14 0 -25 11q-126 114 -165 168q-7 10 -7 23q0 12 8 23q15 21 51 66.5t54 70.5q-27 50 -41 99l-183 27q-13 2 -21 12.5t-8 23.5v222q0 12 8 23t19 13 l186 28q14 46 39 92q-40 57 -107 138q-10 12 -10 24q0 10 9 23q26 36 98.5 107.5t94.5 71.5q13 0 26 -10l138 -107q44 23 91 38q16 136 29 186q7 28 36 28h222q14 0 24.5 -8.5t11.5 -21.5l28 -184q49 -16 90 -37l142 107q9 9 24 9q13 0 25 -10q129 -119 165 -170q7 -8 7 -22 q0 -12 -8 -23q-15 -21 -51 -66.5t-54 -70.5q26 -50 41 -98l183 -28q13 -2 21 -12.5t8 -23.5z" />
-<glyph unicode="&#xf014;" horiz-adv-x="1408" d="M512 800v-576q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v576q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM768 800v-576q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v576q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM1024 800v-576q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v576 q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM1152 76v948h-896v-948q0 -22 7 -40.5t14.5 -27t10.5 -8.5h832q3 0 10.5 8.5t14.5 27t7 40.5zM480 1152h448l-48 117q-7 9 -17 11h-317q-10 -2 -17 -11zM1408 1120v-64q0 -14 -9 -23t-23 -9h-96v-948q0 -83 -47 -143.5t-113 -60.5h-832 q-66 0 -113 58.5t-47 141.5v952h-96q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h309l70 167q15 37 54 63t79 26h320q40 0 79 -26t54 -63l70 -167h309q14 0 23 -9t9 -23z" />
-<glyph unicode="&#xf015;" horiz-adv-x="1664" d="M1408 544v-480q0 -26 -19 -45t-45 -19h-384v384h-256v-384h-384q-26 0 -45 19t-19 45v480q0 1 0.5 3t0.5 3l575 474l575 -474q1 -2 1 -6zM1631 613l-62 -74q-8 -9 -21 -11h-3q-13 0 -21 7l-692 577l-692 -577q-12 -8 -24 -7q-13 2 -21 11l-62 74q-8 10 -7 23.5t11 21.5 l719 599q32 26 76 26t76 -26l244 -204v195q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-408l219 -182q10 -8 11 -21.5t-7 -23.5z" />
-<glyph unicode="&#xf016;" horiz-adv-x="1280" d="M128 0h1024v768h-416q-40 0 -68 28t-28 68v416h-512v-1280zM768 896h376q-10 29 -22 41l-313 313q-12 12 -41 22v-376zM1280 864v-896q0 -40 -28 -68t-68 -28h-1088q-40 0 -68 28t-28 68v1344q0 40 28 68t68 28h640q40 0 88 -20t76 -48l312 -312q28 -28 48 -76t20 -88z " />
-<glyph unicode="&#xf017;" d="M896 992v-448q0 -14 -9 -23t-23 -9h-320q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h224v352q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf018;" horiz-adv-x="1920" d="M1111 540v4l-24 320q-1 13 -11 22.5t-23 9.5h-186q-13 0 -23 -9.5t-11 -22.5l-24 -320v-4q-1 -12 8 -20t21 -8h244q12 0 21 8t8 20zM1870 73q0 -73 -46 -73h-704q13 0 22 9.5t8 22.5l-20 256q-1 13 -11 22.5t-23 9.5h-272q-13 0 -23 -9.5t-11 -22.5l-20 -256 q-1 -13 8 -22.5t22 -9.5h-704q-46 0 -46 73q0 54 26 116l417 1044q8 19 26 33t38 14h339q-13 0 -23 -9.5t-11 -22.5l-15 -192q-1 -14 8 -23t22 -9h166q13 0 22 9t8 23l-15 192q-1 13 -11 22.5t-23 9.5h339q20 0 38 -14t26 -33l417 -1044q26 -62 26 -116z" />
-<glyph unicode="&#xf019;" horiz-adv-x="1664" d="M1280 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1536 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1664 416v-320q0 -40 -28 -68t-68 -28h-1472q-40 0 -68 28t-28 68v320q0 40 28 68t68 28h465l135 -136 q58 -56 136 -56t136 56l136 136h464q40 0 68 -28t28 -68zM1339 985q17 -41 -14 -70l-448 -448q-18 -19 -45 -19t-45 19l-448 448q-31 29 -14 70q17 39 59 39h256v448q0 26 19 45t45 19h256q26 0 45 -19t19 -45v-448h256q42 0 59 -39z" />
-<glyph unicode="&#xf01a;" d="M1120 608q0 -12 -10 -24l-319 -319q-11 -9 -23 -9t-23 9l-320 320q-15 16 -7 35q8 20 30 20h192v352q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-352h192q14 0 23 -9t9 -23zM768 1184q-148 0 -273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273 t-73 273t-198 198t-273 73zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf01b;" d="M1118 660q-8 -20 -30 -20h-192v-352q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v352h-192q-14 0 -23 9t-9 23q0 12 10 24l319 319q11 9 23 9t23 -9l320 -320q15 -16 7 -35zM768 1184q-148 0 -273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198 t73 273t-73 273t-198 198t-273 73zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf01c;" d="M1023 576h316q-1 3 -2.5 8t-2.5 8l-212 496h-708l-212 -496q-1 -2 -2.5 -8t-2.5 -8h316l95 -192h320zM1536 546v-482q0 -26 -19 -45t-45 -19h-1408q-26 0 -45 19t-19 45v482q0 62 25 123l238 552q10 25 36.5 42t52.5 17h832q26 0 52.5 -17t36.5 -42l238 -552 q25 -61 25 -123z" />
-<glyph unicode="&#xf01d;" d="M1184 640q0 -37 -32 -55l-544 -320q-15 -9 -32 -9q-16 0 -32 8q-32 19 -32 56v640q0 37 32 56q33 18 64 -1l544 -320q32 -18 32 -55zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf01e;" d="M1536 1280v-448q0 -26 -19 -45t-45 -19h-448q-42 0 -59 40q-17 39 14 69l138 138q-148 137 -349 137q-104 0 -198.5 -40.5t-163.5 -109.5t-109.5 -163.5t-40.5 -198.5t40.5 -198.5t109.5 -163.5t163.5 -109.5t198.5 -40.5q119 0 225 52t179 147q7 10 23 12q14 0 25 -9 l137 -138q9 -8 9.5 -20.5t-7.5 -22.5q-109 -132 -264 -204.5t-327 -72.5q-156 0 -298 61t-245 164t-164 245t-61 298t61 298t164 245t245 164t298 61q147 0 284.5 -55.5t244.5 -156.5l130 129q29 31 70 14q39 -17 39 -59z" />
-<glyph unicode="&#xf021;" d="M1511 480q0 -5 -1 -7q-64 -268 -268 -434.5t-478 -166.5q-146 0 -282.5 55t-243.5 157l-129 -129q-19 -19 -45 -19t-45 19t-19 45v448q0 26 19 45t45 19h448q26 0 45 -19t19 -45t-19 -45l-137 -137q71 -66 161 -102t187 -36q134 0 250 65t186 179q11 17 53 117 q8 23 30 23h192q13 0 22.5 -9.5t9.5 -22.5zM1536 1280v-448q0 -26 -19 -45t-45 -19h-448q-26 0 -45 19t-19 45t19 45l138 138q-148 137 -349 137q-134 0 -250 -65t-186 -179q-11 -17 -53 -117q-8 -23 -30 -23h-199q-13 0 -22.5 9.5t-9.5 22.5v7q65 268 270 434.5t480 166.5 q146 0 284 -55.5t245 -156.5l130 129q19 19 45 19t45 -19t19 -45z" />
-<glyph unicode="&#xf022;" horiz-adv-x="1792" d="M384 352v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 608v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M384 864v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM1536 352v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-960q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h960q13 0 22.5 -9.5t9.5 -22.5z M1536 608v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-960q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h960q13 0 22.5 -9.5t9.5 -22.5zM1536 864v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-960q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h960q13 0 22.5 -9.5 t9.5 -22.5zM1664 160v832q0 13 -9.5 22.5t-22.5 9.5h-1472q-13 0 -22.5 -9.5t-9.5 -22.5v-832q0 -13 9.5 -22.5t22.5 -9.5h1472q13 0 22.5 9.5t9.5 22.5zM1792 1248v-1088q0 -66 -47 -113t-113 -47h-1472q-66 0 -113 47t-47 113v1088q0 66 47 113t113 47h1472q66 0 113 -47 t47 -113z" />
-<glyph unicode="&#xf023;" horiz-adv-x="1152" d="M320 768h512v192q0 106 -75 181t-181 75t-181 -75t-75 -181v-192zM1152 672v-576q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v576q0 40 28 68t68 28h32v192q0 184 132 316t316 132t316 -132t132 -316v-192h32q40 0 68 -28t28 -68z" />
-<glyph unicode="&#xf024;" horiz-adv-x="1792" d="M320 1280q0 -72 -64 -110v-1266q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v1266q-64 38 -64 110q0 53 37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1792 1216v-763q0 -25 -12.5 -38.5t-39.5 -27.5q-215 -116 -369 -116q-61 0 -123.5 22t-108.5 48 t-115.5 48t-142.5 22q-192 0 -464 -146q-17 -9 -33 -9q-26 0 -45 19t-19 45v742q0 32 31 55q21 14 79 43q236 120 421 120q107 0 200 -29t219 -88q38 -19 88 -19q54 0 117.5 21t110 47t88 47t54.5 21q26 0 45 -19t19 -45z" />
-<glyph unicode="&#xf025;" horiz-adv-x="1664" d="M1664 650q0 -166 -60 -314l-20 -49l-185 -33q-22 -83 -90.5 -136.5t-156.5 -53.5v-32q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v576q0 14 9 23t23 9h64q14 0 23 -9t9 -23v-32q71 0 130 -35.5t93 -95.5l68 12q29 95 29 193q0 148 -88 279t-236.5 209t-315.5 78 t-315.5 -78t-236.5 -209t-88 -279q0 -98 29 -193l68 -12q34 60 93 95.5t130 35.5v32q0 14 9 23t23 9h64q14 0 23 -9t9 -23v-576q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v32q-88 0 -156.5 53.5t-90.5 136.5l-185 33l-20 49q-60 148 -60 314q0 151 67 291t179 242.5 t266 163.5t320 61t320 -61t266 -163.5t179 -242.5t67 -291z" />
-<glyph unicode="&#xf026;" horiz-adv-x="768" d="M768 1184v-1088q0 -26 -19 -45t-45 -19t-45 19l-333 333h-262q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h262l333 333q19 19 45 19t45 -19t19 -45z" />
-<glyph unicode="&#xf027;" horiz-adv-x="1152" d="M768 1184v-1088q0 -26 -19 -45t-45 -19t-45 19l-333 333h-262q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h262l333 333q19 19 45 19t45 -19t19 -45zM1152 640q0 -76 -42.5 -141.5t-112.5 -93.5q-10 -5 -25 -5q-26 0 -45 18.5t-19 45.5q0 21 12 35.5t29 25t34 23t29 35.5 t12 57t-12 57t-29 35.5t-34 23t-29 25t-12 35.5q0 27 19 45.5t45 18.5q15 0 25 -5q70 -27 112.5 -93t42.5 -142z" />
-<glyph unicode="&#xf028;" horiz-adv-x="1664" d="M768 1184v-1088q0 -26 -19 -45t-45 -19t-45 19l-333 333h-262q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h262l333 333q19 19 45 19t45 -19t19 -45zM1152 640q0 -76 -42.5 -141.5t-112.5 -93.5q-10 -5 -25 -5q-26 0 -45 18.5t-19 45.5q0 21 12 35.5t29 25t34 23t29 35.5 t12 57t-12 57t-29 35.5t-34 23t-29 25t-12 35.5q0 27 19 45.5t45 18.5q15 0 25 -5q70 -27 112.5 -93t42.5 -142zM1408 640q0 -153 -85 -282.5t-225 -188.5q-13 -5 -25 -5q-27 0 -46 19t-19 45q0 39 39 59q56 29 76 44q74 54 115.5 135.5t41.5 173.5t-41.5 173.5 t-115.5 135.5q-20 15 -76 44q-39 20 -39 59q0 26 19 45t45 19q13 0 26 -5q140 -59 225 -188.5t85 -282.5zM1664 640q0 -230 -127 -422.5t-338 -283.5q-13 -5 -26 -5q-26 0 -45 19t-19 45q0 36 39 59q7 4 22.5 10.5t22.5 10.5q46 25 82 51q123 91 192 227t69 289t-69 289 t-192 227q-36 26 -82 51q-7 4 -22.5 10.5t-22.5 10.5q-39 23 -39 59q0 26 19 45t45 19q13 0 26 -5q211 -91 338 -283.5t127 -422.5z" />
-<glyph unicode="&#xf029;" horiz-adv-x="1408" d="M384 384v-128h-128v128h128zM384 1152v-128h-128v128h128zM1152 1152v-128h-128v128h128zM128 129h384v383h-384v-383zM128 896h384v384h-384v-384zM896 896h384v384h-384v-384zM640 640v-640h-640v640h640zM1152 128v-128h-128v128h128zM1408 128v-128h-128v128h128z M1408 640v-384h-384v128h-128v-384h-128v640h384v-128h128v128h128zM640 1408v-640h-640v640h640zM1408 1408v-640h-640v640h640z" />
-<glyph unicode="&#xf02a;" horiz-adv-x="1792" d="M63 0h-63v1408h63v-1408zM126 1h-32v1407h32v-1407zM220 1h-31v1407h31v-1407zM377 1h-31v1407h31v-1407zM534 1h-62v1407h62v-1407zM660 1h-31v1407h31v-1407zM723 1h-31v1407h31v-1407zM786 1h-31v1407h31v-1407zM943 1h-63v1407h63v-1407zM1100 1h-63v1407h63v-1407z M1226 1h-63v1407h63v-1407zM1352 1h-63v1407h63v-1407zM1446 1h-63v1407h63v-1407zM1635 1h-94v1407h94v-1407zM1698 1h-32v1407h32v-1407zM1792 0h-63v1408h63v-1408z" />
-<glyph unicode="&#xf02b;" d="M448 1088q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1515 512q0 -53 -37 -90l-491 -492q-39 -37 -91 -37q-53 0 -90 37l-715 716q-38 37 -64.5 101t-26.5 117v416q0 52 38 90t90 38h416q53 0 117 -26.5t102 -64.5 l715 -714q37 -39 37 -91z" />
-<glyph unicode="&#xf02c;" horiz-adv-x="1920" d="M448 1088q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1515 512q0 -53 -37 -90l-491 -492q-39 -37 -91 -37q-53 0 -90 37l-715 716q-38 37 -64.5 101t-26.5 117v416q0 52 38 90t90 38h416q53 0 117 -26.5t102 -64.5 l715 -714q37 -39 37 -91zM1899 512q0 -53 -37 -90l-491 -492q-39 -37 -91 -37q-36 0 -59 14t-53 45l470 470q37 37 37 90q0 52 -37 91l-715 714q-38 38 -102 64.5t-117 26.5h224q53 0 117 -26.5t102 -64.5l715 -714q37 -39 37 -91z" />
-<glyph unicode="&#xf02d;" horiz-adv-x="1664" d="M1639 1058q40 -57 18 -129l-275 -906q-19 -64 -76.5 -107.5t-122.5 -43.5h-923q-77 0 -148.5 53.5t-99.5 131.5q-24 67 -2 127q0 4 3 27t4 37q1 8 -3 21.5t-3 19.5q2 11 8 21t16.5 23.5t16.5 23.5q23 38 45 91.5t30 91.5q3 10 0.5 30t-0.5 28q3 11 17 28t17 23 q21 36 42 92t25 90q1 9 -2.5 32t0.5 28q4 13 22 30.5t22 22.5q19 26 42.5 84.5t27.5 96.5q1 8 -3 25.5t-2 26.5q2 8 9 18t18 23t17 21q8 12 16.5 30.5t15 35t16 36t19.5 32t26.5 23.5t36 11.5t47.5 -5.5l-1 -3q38 9 51 9h761q74 0 114 -56t18 -130l-274 -906 q-36 -119 -71.5 -153.5t-128.5 -34.5h-869q-27 0 -38 -15q-11 -16 -1 -43q24 -70 144 -70h923q29 0 56 15.5t35 41.5l300 987q7 22 5 57q38 -15 59 -43zM575 1056q-4 -13 2 -22.5t20 -9.5h608q13 0 25.5 9.5t16.5 22.5l21 64q4 13 -2 22.5t-20 9.5h-608q-13 0 -25.5 -9.5 t-16.5 -22.5zM492 800q-4 -13 2 -22.5t20 -9.5h608q13 0 25.5 9.5t16.5 22.5l21 64q4 13 -2 22.5t-20 9.5h-608q-13 0 -25.5 -9.5t-16.5 -22.5z" />
-<glyph unicode="&#xf02e;" horiz-adv-x="1280" d="M1164 1408q23 0 44 -9q33 -13 52.5 -41t19.5 -62v-1289q0 -34 -19.5 -62t-52.5 -41q-19 -8 -44 -8q-48 0 -83 32l-441 424l-441 -424q-36 -33 -83 -33q-23 0 -44 9q-33 13 -52.5 41t-19.5 62v1289q0 34 19.5 62t52.5 41q21 9 44 9h1048z" />
-<glyph unicode="&#xf02f;" horiz-adv-x="1664" d="M384 0h896v256h-896v-256zM384 640h896v384h-160q-40 0 -68 28t-28 68v160h-640v-640zM1536 576q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1664 576v-416q0 -13 -9.5 -22.5t-22.5 -9.5h-224v-160q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68 v160h-224q-13 0 -22.5 9.5t-9.5 22.5v416q0 79 56.5 135.5t135.5 56.5h64v544q0 40 28 68t68 28h672q40 0 88 -20t76 -48l152 -152q28 -28 48 -76t20 -88v-256h64q79 0 135.5 -56.5t56.5 -135.5z" />
-<glyph unicode="&#xf030;" horiz-adv-x="1920" d="M960 864q119 0 203.5 -84.5t84.5 -203.5t-84.5 -203.5t-203.5 -84.5t-203.5 84.5t-84.5 203.5t84.5 203.5t203.5 84.5zM1664 1280q106 0 181 -75t75 -181v-896q0 -106 -75 -181t-181 -75h-1408q-106 0 -181 75t-75 181v896q0 106 75 181t181 75h224l51 136 q19 49 69.5 84.5t103.5 35.5h512q53 0 103.5 -35.5t69.5 -84.5l51 -136h224zM960 128q185 0 316.5 131.5t131.5 316.5t-131.5 316.5t-316.5 131.5t-316.5 -131.5t-131.5 -316.5t131.5 -316.5t316.5 -131.5z" />
-<glyph unicode="&#xf031;" horiz-adv-x="1664" d="M725 977l-170 -450q73 -1 153.5 -2t119 -1.5t52.5 -0.5l29 2q-32 95 -92 241q-53 132 -92 211zM21 -128h-21l2 79q22 7 80 18q89 16 110 31q20 16 48 68l237 616l280 724h75h53l11 -21l205 -480q103 -242 124 -297q39 -102 96 -235q26 -58 65 -164q24 -67 65 -149 q22 -49 35 -57q22 -19 69 -23q47 -6 103 -27q6 -39 6 -57q0 -14 -1 -26q-80 0 -192 8q-93 8 -189 8q-79 0 -135 -2l-200 -11l-58 -2q0 45 4 78l131 28q56 13 68 23q12 12 12 27t-6 32l-47 114l-92 228l-450 2q-29 -65 -104 -274q-23 -64 -23 -84q0 -31 17 -43 q26 -21 103 -32q3 0 13.5 -2t30 -5t40.5 -6q1 -28 1 -58q0 -17 -2 -27q-66 0 -349 20l-48 -8q-81 -14 -167 -14z" />
-<glyph unicode="&#xf032;" horiz-adv-x="1408" d="M555 15q76 -32 140 -32q131 0 216 41t122 113q38 70 38 181q0 114 -41 180q-58 94 -141 126q-80 32 -247 32q-74 0 -101 -10v-144l-1 -173l3 -270q0 -15 12 -44zM541 761q43 -7 109 -7q175 0 264 65t89 224q0 112 -85 187q-84 75 -255 75q-52 0 -130 -13q0 -44 2 -77 q7 -122 6 -279l-1 -98q0 -43 1 -77zM0 -128l2 94q45 9 68 12q77 12 123 31q17 27 21 51q9 66 9 194l-2 497q-5 256 -9 404q-1 87 -11 109q-1 4 -12 12q-18 12 -69 15q-30 2 -114 13l-4 83l260 6l380 13l45 1q5 0 14 0.5t14 0.5q1 0 21.5 -0.5t40.5 -0.5h74q88 0 191 -27 q43 -13 96 -39q57 -29 102 -76q44 -47 65 -104t21 -122q0 -70 -32 -128t-95 -105q-26 -20 -150 -77q177 -41 267 -146q92 -106 92 -236q0 -76 -29 -161q-21 -62 -71 -117q-66 -72 -140 -108q-73 -36 -203 -60q-82 -15 -198 -11l-197 4q-84 2 -298 -11q-33 -3 -272 -11z" />
-<glyph unicode="&#xf033;" horiz-adv-x="1024" d="M0 -126l17 85q4 1 77 20q76 19 116 39q29 37 41 101l27 139l56 268l12 64q8 44 17 84.5t16 67t12.5 46.5t9 30.5t3.5 11.5l29 157l16 63l22 135l8 50v38q-41 22 -144 28q-28 2 -38 4l19 103l317 -14q39 -2 73 -2q66 0 214 9q33 2 68 4.5t36 2.5q-2 -19 -6 -38 q-7 -29 -13 -51q-55 -19 -109 -31q-64 -16 -101 -31q-12 -31 -24 -88q-9 -44 -13 -82q-44 -199 -66 -306l-61 -311l-38 -158l-43 -235l-12 -45q-2 -7 1 -27q64 -15 119 -21q36 -5 66 -10q-1 -29 -7 -58q-7 -31 -9 -41q-18 0 -23 -1q-24 -2 -42 -2q-9 0 -28 3q-19 4 -145 17 l-198 2q-41 1 -174 -11q-74 -7 -98 -9z" />
-<glyph unicode="&#xf034;" horiz-adv-x="1792" d="M81 1407l54 -27q20 -5 211 -5h130l19 3l115 1l215 -1h293l34 -2q14 -1 28 7t21 16l7 8l42 1q15 0 28 -1v-104.5t1 -131.5l1 -100l-1 -58q0 -32 -4 -51q-39 -15 -68 -18q-25 43 -54 128q-8 24 -15.5 62.5t-11.5 65.5t-6 29q-13 15 -27 19q-7 2 -42.5 2t-103.5 -1t-111 -1 q-34 0 -67 -5q-10 -97 -8 -136l1 -152v-332l3 -359l-1 -147q-1 -46 11 -85q49 -25 89 -32q2 0 18 -5t44 -13t43 -12q30 -8 50 -18q5 -45 5 -50q0 -10 -3 -29q-14 -1 -34 -1q-110 0 -187 10q-72 8 -238 8q-88 0 -233 -14q-48 -4 -70 -4q-2 22 -2 26l-1 26v9q21 33 79 49 q139 38 159 50q9 21 12 56q8 192 6 433l-5 428q-1 62 -0.5 118.5t0.5 102.5t-2 57t-6 15q-6 5 -14 6q-38 6 -148 6q-43 0 -100 -13.5t-73 -24.5q-13 -9 -22 -33t-22 -75t-24 -84q-6 -19 -19.5 -32t-20.5 -13q-44 27 -56 44v297v86zM1744 128q33 0 42 -18.5t-11 -44.5 l-126 -162q-20 -26 -49 -26t-49 26l-126 162q-20 26 -11 44.5t42 18.5h80v1024h-80q-33 0 -42 18.5t11 44.5l126 162q20 26 49 26t49 -26l126 -162q20 -26 11 -44.5t-42 -18.5h-80v-1024h80z" />
-<glyph unicode="&#xf035;" d="M81 1407l54 -27q20 -5 211 -5h130l19 3l115 1l446 -1h318l34 -2q14 -1 28 7t21 16l7 8l42 1q15 0 28 -1v-104.5t1 -131.5l1 -100l-1 -58q0 -32 -4 -51q-39 -15 -68 -18q-25 43 -54 128q-8 24 -15.5 62.5t-11.5 65.5t-6 29q-13 15 -27 19q-7 2 -58.5 2t-138.5 -1t-128 -1 q-94 0 -127 -5q-10 -97 -8 -136l1 -152v52l3 -359l-1 -147q-1 -46 11 -85q49 -25 89 -32q2 0 18 -5t44 -13t43 -12q30 -8 50 -18q5 -45 5 -50q0 -10 -3 -29q-14 -1 -34 -1q-110 0 -187 10q-72 8 -238 8q-82 0 -233 -13q-45 -5 -70 -5q-2 22 -2 26l-1 26v9q21 33 79 49 q139 38 159 50q9 21 12 56q6 137 6 433l-5 44q0 265 -2 278q-2 11 -6 15q-6 5 -14 6q-38 6 -148 6q-50 0 -168.5 -14t-132.5 -24q-13 -9 -22 -33t-22 -75t-24 -84q-6 -19 -19.5 -32t-20.5 -13q-44 27 -56 44v297v86zM1505 113q26 -20 26 -49t-26 -49l-162 -126 q-26 -20 -44.5 -11t-18.5 42v80h-1024v-80q0 -33 -18.5 -42t-44.5 11l-162 126q-26 20 -26 49t26 49l162 126q26 20 44.5 11t18.5 -42v-80h1024v80q0 33 18.5 42t44.5 -11z" />
-<glyph unicode="&#xf036;" horiz-adv-x="1792" d="M1792 192v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1408 576v-128q0 -26 -19 -45t-45 -19h-1280q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1280q26 0 45 -19t19 -45zM1664 960v-128q0 -26 -19 -45 t-45 -19h-1536q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1536q26 0 45 -19t19 -45zM1280 1344v-128q0 -26 -19 -45t-45 -19h-1152q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1152q26 0 45 -19t19 -45z" />
-<glyph unicode="&#xf037;" horiz-adv-x="1792" d="M1792 192v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1408 576v-128q0 -26 -19 -45t-45 -19h-896q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h896q26 0 45 -19t19 -45zM1664 960v-128q0 -26 -19 -45t-45 -19 h-1408q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1408q26 0 45 -19t19 -45zM1280 1344v-128q0 -26 -19 -45t-45 -19h-640q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h640q26 0 45 -19t19 -45z" />
-<glyph unicode="&#xf038;" horiz-adv-x="1792" d="M1792 192v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 576v-128q0 -26 -19 -45t-45 -19h-1280q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1280q26 0 45 -19t19 -45zM1792 960v-128q0 -26 -19 -45 t-45 -19h-1536q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1536q26 0 45 -19t19 -45zM1792 1344v-128q0 -26 -19 -45t-45 -19h-1152q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1152q26 0 45 -19t19 -45z" />
-<glyph unicode="&#xf039;" horiz-adv-x="1792" d="M1792 192v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 576v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 960v-128q0 -26 -19 -45 t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 1344v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45z" />
-<glyph unicode="&#xf03a;" horiz-adv-x="1792" d="M256 224v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-192q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h192q13 0 22.5 -9.5t9.5 -22.5zM256 608v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-192q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h192q13 0 22.5 -9.5 t9.5 -22.5zM256 992v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-192q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h192q13 0 22.5 -9.5t9.5 -22.5zM1792 224v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1344q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1344 q13 0 22.5 -9.5t9.5 -22.5zM256 1376v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-192q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h192q13 0 22.5 -9.5t9.5 -22.5zM1792 608v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1344q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5 t22.5 9.5h1344q13 0 22.5 -9.5t9.5 -22.5zM1792 992v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1344q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1344q13 0 22.5 -9.5t9.5 -22.5zM1792 1376v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1344q-13 0 -22.5 9.5t-9.5 22.5v192 q0 13 9.5 22.5t22.5 9.5h1344q13 0 22.5 -9.5t9.5 -22.5z" />
-<glyph unicode="&#xf03b;" horiz-adv-x="1792" d="M384 992v-576q0 -13 -9.5 -22.5t-22.5 -9.5q-14 0 -23 9l-288 288q-9 9 -9 23t9 23l288 288q9 9 23 9q13 0 22.5 -9.5t9.5 -22.5zM1792 224v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1728q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1728q13 0 22.5 -9.5 t9.5 -22.5zM1792 608v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1088q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1088q13 0 22.5 -9.5t9.5 -22.5zM1792 992v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1088q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1088 q13 0 22.5 -9.5t9.5 -22.5zM1792 1376v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1728q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1728q13 0 22.5 -9.5t9.5 -22.5z" />
-<glyph unicode="&#xf03c;" horiz-adv-x="1792" d="M352 704q0 -14 -9 -23l-288 -288q-9 -9 -23 -9q-13 0 -22.5 9.5t-9.5 22.5v576q0 13 9.5 22.5t22.5 9.5q14 0 23 -9l288 -288q9 -9 9 -23zM1792 224v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1728q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1728q13 0 22.5 -9.5 t9.5 -22.5zM1792 608v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1088q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1088q13 0 22.5 -9.5t9.5 -22.5zM1792 992v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1088q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1088 q13 0 22.5 -9.5t9.5 -22.5zM1792 1376v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1728q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1728q13 0 22.5 -9.5t9.5 -22.5z" />
-<glyph unicode="&#xf03d;" horiz-adv-x="1792" d="M1792 1184v-1088q0 -42 -39 -59q-13 -5 -25 -5q-27 0 -45 19l-403 403v-166q0 -119 -84.5 -203.5t-203.5 -84.5h-704q-119 0 -203.5 84.5t-84.5 203.5v704q0 119 84.5 203.5t203.5 84.5h704q119 0 203.5 -84.5t84.5 -203.5v-165l403 402q18 19 45 19q12 0 25 -5 q39 -17 39 -59z" />
-<glyph unicode="&#xf03e;" horiz-adv-x="1920" d="M640 960q0 -80 -56 -136t-136 -56t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM1664 576v-448h-1408v192l320 320l160 -160l512 512zM1760 1280h-1600q-13 0 -22.5 -9.5t-9.5 -22.5v-1216q0 -13 9.5 -22.5t22.5 -9.5h1600q13 0 22.5 9.5t9.5 22.5v1216 q0 13 -9.5 22.5t-22.5 9.5zM1920 1248v-1216q0 -66 -47 -113t-113 -47h-1600q-66 0 -113 47t-47 113v1216q0 66 47 113t113 47h1600q66 0 113 -47t47 -113z" />
-<glyph unicode="&#xf040;" d="M363 0l91 91l-235 235l-91 -91v-107h128v-128h107zM886 928q0 22 -22 22q-10 0 -17 -7l-542 -542q-7 -7 -7 -17q0 -22 22 -22q10 0 17 7l542 542q7 7 7 17zM832 1120l416 -416l-832 -832h-416v416zM1515 1024q0 -53 -37 -90l-166 -166l-416 416l166 165q36 38 90 38 q53 0 91 -38l235 -234q37 -39 37 -91z" />
-<glyph unicode="&#xf041;" horiz-adv-x="1024" d="M768 896q0 106 -75 181t-181 75t-181 -75t-75 -181t75 -181t181 -75t181 75t75 181zM1024 896q0 -109 -33 -179l-364 -774q-16 -33 -47.5 -52t-67.5 -19t-67.5 19t-46.5 52l-365 774q-33 70 -33 179q0 212 150 362t362 150t362 -150t150 -362z" />
-<glyph unicode="&#xf042;" d="M768 96v1088q-148 0 -273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf043;" horiz-adv-x="1024" d="M512 384q0 36 -20 69q-1 1 -15.5 22.5t-25.5 38t-25 44t-21 50.5q-4 16 -21 16t-21 -16q-7 -23 -21 -50.5t-25 -44t-25.5 -38t-15.5 -22.5q-20 -33 -20 -69q0 -53 37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1024 512q0 -212 -150 -362t-362 -150t-362 150t-150 362 q0 145 81 275q6 9 62.5 90.5t101 151t99.5 178t83 201.5q9 30 34 47t51 17t51.5 -17t33.5 -47q28 -93 83 -201.5t99.5 -178t101 -151t62.5 -90.5q81 -127 81 -275z" />
-<glyph unicode="&#xf044;" horiz-adv-x="1792" d="M888 352l116 116l-152 152l-116 -116v-56h96v-96h56zM1328 1072q-16 16 -33 -1l-350 -350q-17 -17 -1 -33t33 1l350 350q17 17 1 33zM1408 478v-190q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h832 q63 0 117 -25q15 -7 18 -23q3 -17 -9 -29l-49 -49q-14 -14 -32 -8q-23 6 -45 6h-832q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832q66 0 113 47t47 113v126q0 13 9 22l64 64q15 15 35 7t20 -29zM1312 1216l288 -288l-672 -672h-288v288zM1756 1084l-92 -92 l-288 288l92 92q28 28 68 28t68 -28l152 -152q28 -28 28 -68t-28 -68z" />
-<glyph unicode="&#xf045;" horiz-adv-x="1664" d="M1408 547v-259q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h255v0q13 0 22.5 -9.5t9.5 -22.5q0 -27 -26 -32q-77 -26 -133 -60q-10 -4 -16 -4h-112q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832 q66 0 113 47t47 113v214q0 19 18 29q28 13 54 37q16 16 35 8q21 -9 21 -29zM1645 1043l-384 -384q-18 -19 -45 -19q-12 0 -25 5q-39 17 -39 59v192h-160q-323 0 -438 -131q-119 -137 -74 -473q3 -23 -20 -34q-8 -2 -12 -2q-16 0 -26 13q-10 14 -21 31t-39.5 68.5t-49.5 99.5 t-38.5 114t-17.5 122q0 49 3.5 91t14 90t28 88t47 81.5t68.5 74t94.5 61.5t124.5 48.5t159.5 30.5t196.5 11h160v192q0 42 39 59q13 5 25 5q26 0 45 -19l384 -384q19 -19 19 -45t-19 -45z" />
-<glyph unicode="&#xf046;" horiz-adv-x="1664" d="M1408 606v-318q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h832q63 0 117 -25q15 -7 18 -23q3 -17 -9 -29l-49 -49q-10 -10 -23 -10q-3 0 -9 2q-23 6 -45 6h-832q-66 0 -113 -47t-47 -113v-832 q0 -66 47 -113t113 -47h832q66 0 113 47t47 113v254q0 13 9 22l64 64q10 10 23 10q6 0 12 -3q20 -8 20 -29zM1639 1095l-814 -814q-24 -24 -57 -24t-57 24l-430 430q-24 24 -24 57t24 57l110 110q24 24 57 24t57 -24l263 -263l647 647q24 24 57 24t57 -24l110 -110 q24 -24 24 -57t-24 -57z" />
-<glyph unicode="&#xf047;" horiz-adv-x="1792" d="M1792 640q0 -26 -19 -45l-256 -256q-19 -19 -45 -19t-45 19t-19 45v128h-384v-384h128q26 0 45 -19t19 -45t-19 -45l-256 -256q-19 -19 -45 -19t-45 19l-256 256q-19 19 -19 45t19 45t45 19h128v384h-384v-128q0 -26 -19 -45t-45 -19t-45 19l-256 256q-19 19 -19 45 t19 45l256 256q19 19 45 19t45 -19t19 -45v-128h384v384h-128q-26 0 -45 19t-19 45t19 45l256 256q19 19 45 19t45 -19l256 -256q19 -19 19 -45t-19 -45t-45 -19h-128v-384h384v128q0 26 19 45t45 19t45 -19l256 -256q19 -19 19 -45z" />
-<glyph unicode="&#xf048;" horiz-adv-x="1024" d="M979 1395q19 19 32 13t13 -32v-1472q0 -26 -13 -32t-32 13l-710 710q-9 9 -13 19v-678q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-678q4 11 13 19z" />
-<glyph unicode="&#xf049;" horiz-adv-x="1792" d="M1747 1395q19 19 32 13t13 -32v-1472q0 -26 -13 -32t-32 13l-710 710q-9 9 -13 19v-710q0 -26 -13 -32t-32 13l-710 710q-9 9 -13 19v-678q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-678q4 11 13 19l710 710 q19 19 32 13t13 -32v-710q4 11 13 19z" />
-<glyph unicode="&#xf04a;" horiz-adv-x="1664" d="M1619 1395q19 19 32 13t13 -32v-1472q0 -26 -13 -32t-32 13l-710 710q-8 9 -13 19v-710q0 -26 -13 -32t-32 13l-710 710q-19 19 -19 45t19 45l710 710q19 19 32 13t13 -32v-710q5 11 13 19z" />
-<glyph unicode="&#xf04b;" horiz-adv-x="1408" d="M1384 609l-1328 -738q-23 -13 -39.5 -3t-16.5 36v1472q0 26 16.5 36t39.5 -3l1328 -738q23 -13 23 -31t-23 -31z" />
-<glyph unicode="&#xf04c;" d="M1536 1344v-1408q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h512q26 0 45 -19t19 -45zM640 1344v-1408q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h512q26 0 45 -19t19 -45z" />
-<glyph unicode="&#xf04d;" d="M1536 1344v-1408q0 -26 -19 -45t-45 -19h-1408q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h1408q26 0 45 -19t19 -45z" />
-<glyph unicode="&#xf04e;" horiz-adv-x="1664" d="M45 -115q-19 -19 -32 -13t-13 32v1472q0 26 13 32t32 -13l710 -710q8 -8 13 -19v710q0 26 13 32t32 -13l710 -710q19 -19 19 -45t-19 -45l-710 -710q-19 -19 -32 -13t-13 32v710q-5 -10 -13 -19z" />
-<glyph unicode="&#xf050;" horiz-adv-x="1792" d="M45 -115q-19 -19 -32 -13t-13 32v1472q0 26 13 32t32 -13l710 -710q8 -8 13 -19v710q0 26 13 32t32 -13l710 -710q8 -8 13 -19v678q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-1408q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v678q-5 -10 -13 -19l-710 -710 q-19 -19 -32 -13t-13 32v710q-5 -10 -13 -19z" />
-<glyph unicode="&#xf051;" horiz-adv-x="1024" d="M45 -115q-19 -19 -32 -13t-13 32v1472q0 26 13 32t32 -13l710 -710q8 -8 13 -19v678q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-1408q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v678q-5 -10 -13 -19z" />
-<glyph unicode="&#xf052;" horiz-adv-x="1538" d="M14 557l710 710q19 19 45 19t45 -19l710 -710q19 -19 13 -32t-32 -13h-1472q-26 0 -32 13t13 32zM1473 0h-1408q-26 0 -45 19t-19 45v256q0 26 19 45t45 19h1408q26 0 45 -19t19 -45v-256q0 -26 -19 -45t-45 -19z" />
-<glyph unicode="&#xf053;" horiz-adv-x="1152" d="M742 -37l-652 651q-37 37 -37 90.5t37 90.5l652 651q37 37 90.5 37t90.5 -37l75 -75q37 -37 37 -90.5t-37 -90.5l-486 -486l486 -485q37 -38 37 -91t-37 -90l-75 -75q-37 -37 -90.5 -37t-90.5 37z" />
-<glyph unicode="&#xf054;" horiz-adv-x="1152" d="M1099 704q0 -52 -37 -91l-652 -651q-37 -37 -90 -37t-90 37l-76 75q-37 39 -37 91q0 53 37 90l486 486l-486 485q-37 39 -37 91q0 53 37 90l76 75q36 38 90 38t90 -38l652 -651q37 -37 37 -90z" />
-<glyph unicode="&#xf055;" d="M1216 576v128q0 26 -19 45t-45 19h-256v256q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-256h-256q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h256v-256q0 -26 19 -45t45 -19h128q26 0 45 19t19 45v256h256q26 0 45 19t19 45zM1536 640q0 -209 -103 -385.5 t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf056;" d="M1216 576v128q0 26 -19 45t-45 19h-768q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h768q26 0 45 19t19 45zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5 t103 -385.5z" />
-<glyph unicode="&#xf057;" d="M1149 414q0 26 -19 45l-181 181l181 181q19 19 19 45q0 27 -19 46l-90 90q-19 19 -46 19q-26 0 -45 -19l-181 -181l-181 181q-19 19 -45 19q-27 0 -46 -19l-90 -90q-19 -19 -19 -46q0 -26 19 -45l181 -181l-181 -181q-19 -19 -19 -45q0 -27 19 -46l90 -90q19 -19 46 -19 q26 0 45 19l181 181l181 -181q19 -19 45 -19q27 0 46 19l90 90q19 19 19 46zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf058;" d="M1284 802q0 28 -18 46l-91 90q-19 19 -45 19t-45 -19l-408 -407l-226 226q-19 19 -45 19t-45 -19l-91 -90q-18 -18 -18 -46q0 -27 18 -45l362 -362q19 -19 45 -19q27 0 46 19l543 543q18 18 18 45zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103 t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf059;" d="M896 160v192q0 14 -9 23t-23 9h-192q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h192q14 0 23 9t9 23zM1152 832q0 88 -55.5 163t-138.5 116t-170 41q-243 0 -371 -213q-15 -24 8 -42l132 -100q7 -6 19 -6q16 0 25 12q53 68 86 92q34 24 86 24q48 0 85.5 -26t37.5 -59 q0 -38 -20 -61t-68 -45q-63 -28 -115.5 -86.5t-52.5 -125.5v-36q0 -14 9 -23t23 -9h192q14 0 23 9t9 23q0 19 21.5 49.5t54.5 49.5q32 18 49 28.5t46 35t44.5 48t28 60.5t12.5 81zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5 t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf05a;" d="M1024 160v160q0 14 -9 23t-23 9h-96v512q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-160q0 -14 9 -23t23 -9h96v-320h-96q-14 0 -23 -9t-9 -23v-160q0 -14 9 -23t23 -9h448q14 0 23 9t9 23zM896 1056v160q0 14 -9 23t-23 9h-192q-14 0 -23 -9t-9 -23v-160q0 -14 9 -23 t23 -9h192q14 0 23 9t9 23zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf05b;" d="M1197 512h-109q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h109q-32 108 -112.5 188.5t-188.5 112.5v-109q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v109q-108 -32 -188.5 -112.5t-112.5 -188.5h109q26 0 45 -19t19 -45v-128q0 -26 -19 -45t-45 -19h-109 q32 -108 112.5 -188.5t188.5 -112.5v109q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-109q108 32 188.5 112.5t112.5 188.5zM1536 704v-128q0 -26 -19 -45t-45 -19h-143q-37 -161 -154.5 -278.5t-278.5 -154.5v-143q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v143 q-161 37 -278.5 154.5t-154.5 278.5h-143q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h143q37 161 154.5 278.5t278.5 154.5v143q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-143q161 -37 278.5 -154.5t154.5 -278.5h143q26 0 45 -19t19 -45z" />
-<glyph unicode="&#xf05c;" d="M1097 457l-146 -146q-10 -10 -23 -10t-23 10l-137 137l-137 -137q-10 -10 -23 -10t-23 10l-146 146q-10 10 -10 23t10 23l137 137l-137 137q-10 10 -10 23t10 23l146 146q10 10 23 10t23 -10l137 -137l137 137q10 10 23 10t23 -10l146 -146q10 -10 10 -23t-10 -23 l-137 -137l137 -137q10 -10 10 -23t-10 -23zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5 t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf05d;" d="M1171 723l-422 -422q-19 -19 -45 -19t-45 19l-294 294q-19 19 -19 45t19 45l102 102q19 19 45 19t45 -19l147 -147l275 275q19 19 45 19t45 -19l102 -102q19 -19 19 -45t-19 -45zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198t-73 -273t73 -273t198 -198 t273 -73t273 73t198 198t73 273zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf05e;" d="M1312 643q0 161 -87 295l-754 -753q137 -89 297 -89q111 0 211.5 43.5t173.5 116.5t116 174.5t43 212.5zM313 344l755 754q-135 91 -300 91q-148 0 -273 -73t-198 -199t-73 -274q0 -162 89 -299zM1536 643q0 -157 -61 -300t-163.5 -246t-245 -164t-298.5 -61t-298.5 61 t-245 164t-163.5 246t-61 300t61 299.5t163.5 245.5t245 164t298.5 61t298.5 -61t245 -164t163.5 -245.5t61 -299.5z" />
-<glyph unicode="&#xf060;" d="M1536 640v-128q0 -53 -32.5 -90.5t-84.5 -37.5h-704l293 -294q38 -36 38 -90t-38 -90l-75 -76q-37 -37 -90 -37q-52 0 -91 37l-651 652q-37 37 -37 90q0 52 37 91l651 650q38 38 91 38q52 0 90 -38l75 -74q38 -38 38 -91t-38 -91l-293 -293h704q52 0 84.5 -37.5 t32.5 -90.5z" />
-<glyph unicode="&#xf061;" d="M1472 576q0 -54 -37 -91l-651 -651q-39 -37 -91 -37q-51 0 -90 37l-75 75q-38 38 -38 91t38 91l293 293h-704q-52 0 -84.5 37.5t-32.5 90.5v128q0 53 32.5 90.5t84.5 37.5h704l-293 294q-38 36 -38 90t38 90l75 75q38 38 90 38q53 0 91 -38l651 -651q37 -35 37 -90z" />
-<glyph unicode="&#xf062;" horiz-adv-x="1664" d="M1611 565q0 -51 -37 -90l-75 -75q-38 -38 -91 -38q-54 0 -90 38l-294 293v-704q0 -52 -37.5 -84.5t-90.5 -32.5h-128q-53 0 -90.5 32.5t-37.5 84.5v704l-294 -293q-36 -38 -90 -38t-90 38l-75 75q-38 38 -38 90q0 53 38 91l651 651q35 37 90 37q54 0 91 -37l651 -651 q37 -39 37 -91z" />
-<glyph unicode="&#xf063;" horiz-adv-x="1664" d="M1611 704q0 -53 -37 -90l-651 -652q-39 -37 -91 -37q-53 0 -90 37l-651 652q-38 36 -38 90q0 53 38 91l74 75q39 37 91 37q53 0 90 -37l294 -294v704q0 52 38 90t90 38h128q52 0 90 -38t38 -90v-704l294 294q37 37 90 37q52 0 91 -37l75 -75q37 -39 37 -91z" />
-<glyph unicode="&#xf064;" horiz-adv-x="1792" d="M1792 896q0 -26 -19 -45l-512 -512q-19 -19 -45 -19t-45 19t-19 45v256h-224q-98 0 -175.5 -6t-154 -21.5t-133 -42.5t-105.5 -69.5t-80 -101t-48.5 -138.5t-17.5 -181q0 -55 5 -123q0 -6 2.5 -23.5t2.5 -26.5q0 -15 -8.5 -25t-23.5 -10q-16 0 -28 17q-7 9 -13 22 t-13.5 30t-10.5 24q-127 285 -127 451q0 199 53 333q162 403 875 403h224v256q0 26 19 45t45 19t45 -19l512 -512q19 -19 19 -45z" />
-<glyph unicode="&#xf065;" d="M755 480q0 -13 -10 -23l-332 -332l144 -144q19 -19 19 -45t-19 -45t-45 -19h-448q-26 0 -45 19t-19 45v448q0 26 19 45t45 19t45 -19l144 -144l332 332q10 10 23 10t23 -10l114 -114q10 -10 10 -23zM1536 1344v-448q0 -26 -19 -45t-45 -19t-45 19l-144 144l-332 -332 q-10 -10 -23 -10t-23 10l-114 114q-10 10 -10 23t10 23l332 332l-144 144q-19 19 -19 45t19 45t45 19h448q26 0 45 -19t19 -45z" />
-<glyph unicode="&#xf066;" d="M768 576v-448q0 -26 -19 -45t-45 -19t-45 19l-144 144l-332 -332q-10 -10 -23 -10t-23 10l-114 114q-10 10 -10 23t10 23l332 332l-144 144q-19 19 -19 45t19 45t45 19h448q26 0 45 -19t19 -45zM1523 1248q0 -13 -10 -23l-332 -332l144 -144q19 -19 19 -45t-19 -45 t-45 -19h-448q-26 0 -45 19t-19 45v448q0 26 19 45t45 19t45 -19l144 -144l332 332q10 10 23 10t23 -10l114 -114q10 -10 10 -23z" />
-<glyph unicode="&#xf067;" horiz-adv-x="1408" d="M1408 800v-192q0 -40 -28 -68t-68 -28h-416v-416q0 -40 -28 -68t-68 -28h-192q-40 0 -68 28t-28 68v416h-416q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h416v416q0 40 28 68t68 28h192q40 0 68 -28t28 -68v-416h416q40 0 68 -28t28 -68z" />
-<glyph unicode="&#xf068;" horiz-adv-x="1408" d="M1408 800v-192q0 -40 -28 -68t-68 -28h-1216q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h1216q40 0 68 -28t28 -68z" />
-<glyph unicode="&#xf069;" horiz-adv-x="1664" d="M1482 486q46 -26 59.5 -77.5t-12.5 -97.5l-64 -110q-26 -46 -77.5 -59.5t-97.5 12.5l-266 153v-307q0 -52 -38 -90t-90 -38h-128q-52 0 -90 38t-38 90v307l-266 -153q-46 -26 -97.5 -12.5t-77.5 59.5l-64 110q-26 46 -12.5 97.5t59.5 77.5l266 154l-266 154 q-46 26 -59.5 77.5t12.5 97.5l64 110q26 46 77.5 59.5t97.5 -12.5l266 -153v307q0 52 38 90t90 38h128q52 0 90 -38t38 -90v-307l266 153q46 26 97.5 12.5t77.5 -59.5l64 -110q26 -46 12.5 -97.5t-59.5 -77.5l-266 -154z" />
-<glyph unicode="&#xf06a;" d="M768 1408q209 0 385.5 -103t279.5 -279.5t103 -385.5t-103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103zM896 161v190q0 14 -9 23.5t-22 9.5h-192q-13 0 -23 -10t-10 -23v-190q0 -13 10 -23t23 -10h192 q13 0 22 9.5t9 23.5zM894 505l18 621q0 12 -10 18q-10 8 -24 8h-220q-14 0 -24 -8q-10 -6 -10 -18l17 -621q0 -10 10 -17.5t24 -7.5h185q14 0 23.5 7.5t10.5 17.5z" />
-<glyph unicode="&#xf06b;" d="M928 180v56v468v192h-320v-192v-468v-56q0 -25 18 -38.5t46 -13.5h192q28 0 46 13.5t18 38.5zM472 1024h195l-126 161q-26 31 -69 31q-40 0 -68 -28t-28 -68t28 -68t68 -28zM1160 1120q0 40 -28 68t-68 28q-43 0 -69 -31l-125 -161h194q40 0 68 28t28 68zM1536 864v-320 q0 -14 -9 -23t-23 -9h-96v-416q0 -40 -28 -68t-68 -28h-1088q-40 0 -68 28t-28 68v416h-96q-14 0 -23 9t-9 23v320q0 14 9 23t23 9h440q-93 0 -158.5 65.5t-65.5 158.5t65.5 158.5t158.5 65.5q107 0 168 -77l128 -165l128 165q61 77 168 77q93 0 158.5 -65.5t65.5 -158.5 t-65.5 -158.5t-158.5 -65.5h440q14 0 23 -9t9 -23z" />
-<glyph unicode="&#xf06c;" horiz-adv-x="1792" d="M1280 832q0 26 -19 45t-45 19q-172 0 -318 -49.5t-259.5 -134t-235.5 -219.5q-19 -21 -19 -45q0 -26 19 -45t45 -19q24 0 45 19q27 24 74 71t67 66q137 124 268.5 176t313.5 52q26 0 45 19t19 45zM1792 1030q0 -95 -20 -193q-46 -224 -184.5 -383t-357.5 -268 q-214 -108 -438 -108q-148 0 -286 47q-15 5 -88 42t-96 37q-16 0 -39.5 -32t-45 -70t-52.5 -70t-60 -32q-30 0 -51 11t-31 24t-27 42q-2 4 -6 11t-5.5 10t-3 9.5t-1.5 13.5q0 35 31 73.5t68 65.5t68 56t31 48q0 4 -14 38t-16 44q-9 51 -9 104q0 115 43.5 220t119 184.5 t170.5 139t204 95.5q55 18 145 25.5t179.5 9t178.5 6t163.5 24t113.5 56.5l29.5 29.5t29.5 28t27 20t36.5 16t43.5 4.5q39 0 70.5 -46t47.5 -112t24 -124t8 -96z" />
-<glyph unicode="&#xf06d;" horiz-adv-x="1408" d="M1408 -160v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-1344q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h1344q13 0 22.5 -9.5t9.5 -22.5zM1152 896q0 -78 -24.5 -144t-64 -112.5t-87.5 -88t-96 -77.5t-87.5 -72t-64 -81.5t-24.5 -96.5q0 -96 67 -224l-4 1l1 -1 q-90 41 -160 83t-138.5 100t-113.5 122.5t-72.5 150.5t-27.5 184q0 78 24.5 144t64 112.5t87.5 88t96 77.5t87.5 72t64 81.5t24.5 96.5q0 94 -66 224l3 -1l-1 1q90 -41 160 -83t138.5 -100t113.5 -122.5t72.5 -150.5t27.5 -184z" />
-<glyph unicode="&#xf06e;" horiz-adv-x="1792" d="M1664 576q-152 236 -381 353q61 -104 61 -225q0 -185 -131.5 -316.5t-316.5 -131.5t-316.5 131.5t-131.5 316.5q0 121 61 225q-229 -117 -381 -353q133 -205 333.5 -326.5t434.5 -121.5t434.5 121.5t333.5 326.5zM944 960q0 20 -14 34t-34 14q-125 0 -214.5 -89.5 t-89.5 -214.5q0 -20 14 -34t34 -14t34 14t14 34q0 86 61 147t147 61q20 0 34 14t14 34zM1792 576q0 -34 -20 -69q-140 -230 -376.5 -368.5t-499.5 -138.5t-499.5 139t-376.5 368q-20 35 -20 69t20 69q140 229 376.5 368t499.5 139t499.5 -139t376.5 -368q20 -35 20 -69z" />
-<glyph unicode="&#xf070;" horiz-adv-x="1792" d="M555 201l78 141q-87 63 -136 159t-49 203q0 121 61 225q-229 -117 -381 -353q167 -258 427 -375zM944 960q0 20 -14 34t-34 14q-125 0 -214.5 -89.5t-89.5 -214.5q0 -20 14 -34t34 -14t34 14t14 34q0 86 61 147t147 61q20 0 34 14t14 34zM1307 1151q0 -7 -1 -9 q-105 -188 -315 -566t-316 -567l-49 -89q-10 -16 -28 -16q-12 0 -134 70q-16 10 -16 28q0 12 44 87q-143 65 -263.5 173t-208.5 245q-20 31 -20 69t20 69q153 235 380 371t496 136q89 0 180 -17l54 97q10 16 28 16q5 0 18 -6t31 -15.5t33 -18.5t31.5 -18.5t19.5 -11.5 q16 -10 16 -27zM1344 704q0 -139 -79 -253.5t-209 -164.5l280 502q8 -45 8 -84zM1792 576q0 -35 -20 -69q-39 -64 -109 -145q-150 -172 -347.5 -267t-419.5 -95l74 132q212 18 392.5 137t301.5 307q-115 179 -282 294l63 112q95 -64 182.5 -153t144.5 -184q20 -34 20 -69z " />
-<glyph unicode="&#xf071;" horiz-adv-x="1792" d="M1024 161v190q0 14 -9.5 23.5t-22.5 9.5h-192q-13 0 -22.5 -9.5t-9.5 -23.5v-190q0 -14 9.5 -23.5t22.5 -9.5h192q13 0 22.5 9.5t9.5 23.5zM1022 535l18 459q0 12 -10 19q-13 11 -24 11h-220q-11 0 -24 -11q-10 -7 -10 -21l17 -457q0 -10 10 -16.5t24 -6.5h185 q14 0 23.5 6.5t10.5 16.5zM1008 1469l768 -1408q35 -63 -2 -126q-17 -29 -46.5 -46t-63.5 -17h-1536q-34 0 -63.5 17t-46.5 46q-37 63 -2 126l768 1408q17 31 47 49t65 18t65 -18t47 -49z" />
-<glyph unicode="&#xf072;" horiz-adv-x="1408" d="M1376 1376q44 -52 12 -148t-108 -172l-161 -161l160 -696q5 -19 -12 -33l-128 -96q-7 -6 -19 -6q-4 0 -7 1q-15 3 -21 16l-279 508l-259 -259l53 -194q5 -17 -8 -31l-96 -96q-9 -9 -23 -9h-2q-15 2 -24 13l-189 252l-252 189q-11 7 -13 23q-1 13 9 25l96 97q9 9 23 9 q6 0 8 -1l194 -53l259 259l-508 279q-14 8 -17 24q-2 16 9 27l128 128q14 13 30 8l665 -159l160 160q76 76 172 108t148 -12z" />
-<glyph unicode="&#xf073;" horiz-adv-x="1664" d="M128 -128h288v288h-288v-288zM480 -128h320v288h-320v-288zM128 224h288v320h-288v-320zM480 224h320v320h-320v-320zM128 608h288v288h-288v-288zM864 -128h320v288h-320v-288zM480 608h320v288h-320v-288zM1248 -128h288v288h-288v-288zM864 224h320v320h-320v-320z M512 1088v288q0 13 -9.5 22.5t-22.5 9.5h-64q-13 0 -22.5 -9.5t-9.5 -22.5v-288q0 -13 9.5 -22.5t22.5 -9.5h64q13 0 22.5 9.5t9.5 22.5zM1248 224h288v320h-288v-320zM864 608h320v288h-320v-288zM1248 608h288v288h-288v-288zM1280 1088v288q0 13 -9.5 22.5t-22.5 9.5h-64 q-13 0 -22.5 -9.5t-9.5 -22.5v-288q0 -13 9.5 -22.5t22.5 -9.5h64q13 0 22.5 9.5t9.5 22.5zM1664 1152v-1280q0 -52 -38 -90t-90 -38h-1408q-52 0 -90 38t-38 90v1280q0 52 38 90t90 38h128v96q0 66 47 113t113 47h64q66 0 113 -47t47 -113v-96h384v96q0 66 47 113t113 47 h64q66 0 113 -47t47 -113v-96h128q52 0 90 -38t38 -90z" />
-<glyph unicode="&#xf074;" horiz-adv-x="1792" d="M666 1055q-60 -92 -137 -273q-22 45 -37 72.5t-40.5 63.5t-51 56.5t-63 35t-81.5 14.5h-224q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h224q250 0 410 -225zM1792 256q0 -14 -9 -23l-320 -320q-9 -9 -23 -9q-13 0 -22.5 9.5t-9.5 22.5v192q-32 0 -85 -0.5t-81 -1t-73 1 t-71 5t-64 10.5t-63 18.5t-58 28.5t-59 40t-55 53.5t-56 69.5q59 93 136 273q22 -45 37 -72.5t40.5 -63.5t51 -56.5t63 -35t81.5 -14.5h256v192q0 14 9 23t23 9q12 0 24 -10l319 -319q9 -9 9 -23zM1792 1152q0 -14 -9 -23l-320 -320q-9 -9 -23 -9q-13 0 -22.5 9.5t-9.5 22.5 v192h-256q-48 0 -87 -15t-69 -45t-51 -61.5t-45 -77.5q-32 -62 -78 -171q-29 -66 -49.5 -111t-54 -105t-64 -100t-74 -83t-90 -68.5t-106.5 -42t-128 -16.5h-224q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h224q48 0 87 15t69 45t51 61.5t45 77.5q32 62 78 171q29 66 49.5 111 t54 105t64 100t74 83t90 68.5t106.5 42t128 16.5h256v192q0 14 9 23t23 9q12 0 24 -10l319 -319q9 -9 9 -23z" />
-<glyph unicode="&#xf075;" horiz-adv-x="1792" d="M1792 640q0 -174 -120 -321.5t-326 -233t-450 -85.5q-70 0 -145 8q-198 -175 -460 -242q-49 -14 -114 -22q-17 -2 -30.5 9t-17.5 29v1q-3 4 -0.5 12t2 10t4.5 9.5l6 9t7 8.5t8 9q7 8 31 34.5t34.5 38t31 39.5t32.5 51t27 59t26 76q-157 89 -247.5 220t-90.5 281 q0 130 71 248.5t191 204.5t286 136.5t348 50.5q244 0 450 -85.5t326 -233t120 -321.5z" />
-<glyph unicode="&#xf076;" d="M1536 704v-128q0 -201 -98.5 -362t-274 -251.5t-395.5 -90.5t-395.5 90.5t-274 251.5t-98.5 362v128q0 26 19 45t45 19h384q26 0 45 -19t19 -45v-128q0 -52 23.5 -90t53.5 -57t71 -30t64 -13t44 -2t44 2t64 13t71 30t53.5 57t23.5 90v128q0 26 19 45t45 19h384 q26 0 45 -19t19 -45zM512 1344v-384q0 -26 -19 -45t-45 -19h-384q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h384q26 0 45 -19t19 -45zM1536 1344v-384q0 -26 -19 -45t-45 -19h-384q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h384q26 0 45 -19t19 -45z" />
-<glyph unicode="&#xf077;" horiz-adv-x="1664" d="M1611 320q0 -53 -37 -90l-75 -75q-38 -38 -91 -38q-54 0 -90 38l-486 485l-486 -485q-36 -38 -90 -38t-90 38l-75 75q-38 36 -38 90q0 53 38 91l651 651q37 37 90 37q52 0 91 -37l650 -651q38 -38 38 -91z" />
-<glyph unicode="&#xf078;" horiz-adv-x="1664" d="M1611 832q0 -53 -37 -90l-651 -651q-38 -38 -91 -38q-54 0 -90 38l-651 651q-38 36 -38 90q0 53 38 91l74 75q39 37 91 37q53 0 90 -37l486 -486l486 486q37 37 90 37q52 0 91 -37l75 -75q37 -39 37 -91z" />
-<glyph unicode="&#xf079;" horiz-adv-x="1920" d="M1280 32q0 -13 -9.5 -22.5t-22.5 -9.5h-960q-8 0 -13.5 2t-9 7t-5.5 8t-3 11.5t-1 11.5v13v11v160v416h-192q-26 0 -45 19t-19 45q0 24 15 41l320 384q19 22 49 22t49 -22l320 -384q15 -17 15 -41q0 -26 -19 -45t-45 -19h-192v-384h576q16 0 25 -11l160 -192q7 -11 7 -21 zM1920 448q0 -24 -15 -41l-320 -384q-20 -23 -49 -23t-49 23l-320 384q-15 17 -15 41q0 26 19 45t45 19h192v384h-576q-16 0 -25 12l-160 192q-7 9 -7 20q0 13 9.5 22.5t22.5 9.5h960q8 0 13.5 -2t9 -7t5.5 -8t3 -11.5t1 -11.5v-13v-11v-160v-416h192q26 0 45 -19t19 -45z " />
-<glyph unicode="&#xf07a;" horiz-adv-x="1664" d="M640 0q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1536 0q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1664 1088v-512q0 -24 -16 -42.5t-41 -21.5 l-1044 -122q1 -7 4.5 -21.5t6 -26.5t2.5 -22q0 -16 -24 -64h920q26 0 45 -19t19 -45t-19 -45t-45 -19h-1024q-26 0 -45 19t-19 45q0 14 11 39.5t29.5 59.5t20.5 38l-177 823h-204q-26 0 -45 19t-19 45t19 45t45 19h256q16 0 28.5 -6.5t20 -15.5t13 -24.5t7.5 -26.5 t5.5 -29.5t4.5 -25.5h1201q26 0 45 -19t19 -45z" />
-<glyph unicode="&#xf07b;" horiz-adv-x="1664" d="M1664 928v-704q0 -92 -66 -158t-158 -66h-1216q-92 0 -158 66t-66 158v960q0 92 66 158t158 66h320q92 0 158 -66t66 -158v-32h672q92 0 158 -66t66 -158z" />
-<glyph unicode="&#xf07c;" horiz-adv-x="1920" d="M1879 584q0 -31 -31 -66l-336 -396q-43 -51 -120.5 -86.5t-143.5 -35.5h-1088q-34 0 -60.5 13t-26.5 43q0 31 31 66l336 396q43 51 120.5 86.5t143.5 35.5h1088q34 0 60.5 -13t26.5 -43zM1536 928v-160h-832q-94 0 -197 -47.5t-164 -119.5l-337 -396l-5 -6q0 4 -0.5 12.5 t-0.5 12.5v960q0 92 66 158t158 66h320q92 0 158 -66t66 -158v-32h544q92 0 158 -66t66 -158z" />
-<glyph unicode="&#xf07d;" horiz-adv-x="768" d="M704 1216q0 -26 -19 -45t-45 -19h-128v-1024h128q26 0 45 -19t19 -45t-19 -45l-256 -256q-19 -19 -45 -19t-45 19l-256 256q-19 19 -19 45t19 45t45 19h128v1024h-128q-26 0 -45 19t-19 45t19 45l256 256q19 19 45 19t45 -19l256 -256q19 -19 19 -45z" />
-<glyph unicode="&#xf07e;" horiz-adv-x="1792" d="M1792 640q0 -26 -19 -45l-256 -256q-19 -19 -45 -19t-45 19t-19 45v128h-1024v-128q0 -26 -19 -45t-45 -19t-45 19l-256 256q-19 19 -19 45t19 45l256 256q19 19 45 19t45 -19t19 -45v-128h1024v128q0 26 19 45t45 19t45 -19l256 -256q19 -19 19 -45z" />
-<glyph unicode="&#xf080;" horiz-adv-x="1920" d="M512 512v-384h-256v384h256zM896 1024v-896h-256v896h256zM1280 768v-640h-256v640h256zM1664 1152v-1024h-256v1024h256zM1792 32v1216q0 13 -9.5 22.5t-22.5 9.5h-1600q-13 0 -22.5 -9.5t-9.5 -22.5v-1216q0 -13 9.5 -22.5t22.5 -9.5h1600q13 0 22.5 9.5t9.5 22.5z M1920 1248v-1216q0 -66 -47 -113t-113 -47h-1600q-66 0 -113 47t-47 113v1216q0 66 47 113t113 47h1600q66 0 113 -47t47 -113z" />
-<glyph unicode="&#xf081;" d="M1280 926q-56 -25 -121 -34q68 40 93 117q-65 -38 -134 -51q-61 66 -153 66q-87 0 -148.5 -61.5t-61.5 -148.5q0 -29 5 -48q-129 7 -242 65t-192 155q-29 -50 -29 -106q0 -114 91 -175q-47 1 -100 26v-2q0 -75 50 -133.5t123 -72.5q-29 -8 -51 -8q-13 0 -39 4 q21 -63 74.5 -104t121.5 -42q-116 -90 -261 -90q-26 0 -50 3q148 -94 322 -94q112 0 210 35.5t168 95t120.5 137t75 162t24.5 168.5q0 18 -1 27q63 45 105 109zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5 t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
-<glyph unicode="&#xf082;" d="M1307 618l23 219h-198v109q0 49 15.5 68.5t71.5 19.5h110v219h-175q-152 0 -218 -72t-66 -213v-131h-131v-219h131v-635h262v635h175zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960 q119 0 203.5 -84.5t84.5 -203.5z" />
-<glyph unicode="&#xf083;" horiz-adv-x="1792" d="M928 704q0 14 -9 23t-23 9q-66 0 -113 -47t-47 -113q0 -14 9 -23t23 -9t23 9t9 23q0 40 28 68t68 28q14 0 23 9t9 23zM1152 574q0 -106 -75 -181t-181 -75t-181 75t-75 181t75 181t181 75t181 -75t75 -181zM128 0h1536v128h-1536v-128zM1280 574q0 159 -112.5 271.5 t-271.5 112.5t-271.5 -112.5t-112.5 -271.5t112.5 -271.5t271.5 -112.5t271.5 112.5t112.5 271.5zM256 1216h384v128h-384v-128zM128 1024h1536v118v138h-828l-64 -128h-644v-128zM1792 1280v-1280q0 -53 -37.5 -90.5t-90.5 -37.5h-1536q-53 0 -90.5 37.5t-37.5 90.5v1280 q0 53 37.5 90.5t90.5 37.5h1536q53 0 90.5 -37.5t37.5 -90.5z" />
-<glyph unicode="&#xf084;" horiz-adv-x="1792" d="M832 1024q0 80 -56 136t-136 56t-136 -56t-56 -136q0 -42 19 -83q-41 19 -83 19q-80 0 -136 -56t-56 -136t56 -136t136 -56t136 56t56 136q0 42 -19 83q41 -19 83 -19q80 0 136 56t56 136zM1683 320q0 -17 -49 -66t-66 -49q-9 0 -28.5 16t-36.5 33t-38.5 40t-24.5 26 l-96 -96l220 -220q28 -28 28 -68q0 -42 -39 -81t-81 -39q-40 0 -68 28l-671 671q-176 -131 -365 -131q-163 0 -265.5 102.5t-102.5 265.5q0 160 95 313t248 248t313 95q163 0 265.5 -102.5t102.5 -265.5q0 -189 -131 -365l355 -355l96 96q-3 3 -26 24.5t-40 38.5t-33 36.5 t-16 28.5q0 17 49 66t66 49q13 0 23 -10q6 -6 46 -44.5t82 -79.5t86.5 -86t73 -78t28.5 -41z" />
-<glyph unicode="&#xf085;" horiz-adv-x="1920" d="M896 640q0 106 -75 181t-181 75t-181 -75t-75 -181t75 -181t181 -75t181 75t75 181zM1664 128q0 52 -38 90t-90 38t-90 -38t-38 -90q0 -53 37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1664 1152q0 52 -38 90t-90 38t-90 -38t-38 -90q0 -53 37.5 -90.5t90.5 -37.5 t90.5 37.5t37.5 90.5zM1280 731v-185q0 -10 -7 -19.5t-16 -10.5l-155 -24q-11 -35 -32 -76q34 -48 90 -115q7 -10 7 -20q0 -12 -7 -19q-23 -30 -82.5 -89.5t-78.5 -59.5q-11 0 -21 7l-115 90q-37 -19 -77 -31q-11 -108 -23 -155q-7 -24 -30 -24h-186q-11 0 -20 7.5t-10 17.5 l-23 153q-34 10 -75 31l-118 -89q-7 -7 -20 -7q-11 0 -21 8q-144 133 -144 160q0 9 7 19q10 14 41 53t47 61q-23 44 -35 82l-152 24q-10 1 -17 9.5t-7 19.5v185q0 10 7 19.5t16 10.5l155 24q11 35 32 76q-34 48 -90 115q-7 11 -7 20q0 12 7 20q22 30 82 89t79 59q11 0 21 -7 l115 -90q34 18 77 32q11 108 23 154q7 24 30 24h186q11 0 20 -7.5t10 -17.5l23 -153q34 -10 75 -31l118 89q8 7 20 7q11 0 21 -8q144 -133 144 -160q0 -9 -7 -19q-12 -16 -42 -54t-45 -60q23 -48 34 -82l152 -23q10 -2 17 -10.5t7 -19.5zM1920 198v-140q0 -16 -149 -31 q-12 -27 -30 -52q51 -113 51 -138q0 -4 -4 -7q-122 -71 -124 -71q-8 0 -46 47t-52 68q-20 -2 -30 -2t-30 2q-14 -21 -52 -68t-46 -47q-2 0 -124 71q-4 3 -4 7q0 25 51 138q-18 25 -30 52q-149 15 -149 31v140q0 16 149 31q13 29 30 52q-51 113 -51 138q0 4 4 7q4 2 35 20 t59 34t30 16q8 0 46 -46.5t52 -67.5q20 2 30 2t30 -2q51 71 92 112l6 2q4 0 124 -70q4 -3 4 -7q0 -25 -51 -138q17 -23 30 -52q149 -15 149 -31zM1920 1222v-140q0 -16 -149 -31q-12 -27 -30 -52q51 -113 51 -138q0 -4 -4 -7q-122 -71 -124 -71q-8 0 -46 47t-52 68 q-20 -2 -30 -2t-30 2q-14 -21 -52 -68t-46 -47q-2 0 -124 71q-4 3 -4 7q0 25 51 138q-18 25 -30 52q-149 15 -149 31v140q0 16 149 31q13 29 30 52q-51 113 -51 138q0 4 4 7q4 2 35 20t59 34t30 16q8 0 46 -46.5t52 -67.5q20 2 30 2t30 -2q51 71 92 112l6 2q4 0 124 -70 q4 -3 4 -7q0 -25 -51 -138q17 -23 30 -52q149 -15 149 -31z" />
-<glyph unicode="&#xf086;" horiz-adv-x="1792" d="M1408 768q0 -139 -94 -257t-256.5 -186.5t-353.5 -68.5q-86 0 -176 16q-124 -88 -278 -128q-36 -9 -86 -16h-3q-11 0 -20.5 8t-11.5 21q-1 3 -1 6.5t0.5 6.5t2 6l2.5 5t3.5 5.5t4 5t4.5 5t4 4.5q5 6 23 25t26 29.5t22.5 29t25 38.5t20.5 44q-124 72 -195 177t-71 224 q0 139 94 257t256.5 186.5t353.5 68.5t353.5 -68.5t256.5 -186.5t94 -257zM1792 512q0 -120 -71 -224.5t-195 -176.5q10 -24 20.5 -44t25 -38.5t22.5 -29t26 -29.5t23 -25q1 -1 4 -4.5t4.5 -5t4 -5t3.5 -5.5l2.5 -5t2 -6t0.5 -6.5t-1 -6.5q-3 -14 -13 -22t-22 -7 q-50 7 -86 16q-154 40 -278 128q-90 -16 -176 -16q-271 0 -472 132q58 -4 88 -4q161 0 309 45t264 129q125 92 192 212t67 254q0 77 -23 152q129 -71 204 -178t75 -230z" />
-<glyph unicode="&#xf087;" d="M256 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1408 768q0 51 -39 89.5t-89 38.5h-352q0 58 48 159.5t48 160.5q0 98 -32 145t-128 47q-26 -26 -38 -85t-30.5 -125.5t-59.5 -109.5q-22 -23 -77 -91q-4 -5 -23 -30t-31.5 -41t-34.5 -42.5 t-40 -44t-38.5 -35.5t-40 -27t-35.5 -9h-32v-640h32q13 0 31.5 -3t33 -6.5t38 -11t35 -11.5t35.5 -12.5t29 -10.5q211 -73 342 -73h121q192 0 192 167q0 26 -5 56q30 16 47.5 52.5t17.5 73.5t-18 69q53 50 53 119q0 25 -10 55.5t-25 47.5q32 1 53.5 47t21.5 81zM1536 769 q0 -89 -49 -163q9 -33 9 -69q0 -77 -38 -144q3 -21 3 -43q0 -101 -60 -178q1 -139 -85 -219.5t-227 -80.5h-36h-93q-96 0 -189.5 22.5t-216.5 65.5q-116 40 -138 40h-288q-53 0 -90.5 37.5t-37.5 90.5v640q0 53 37.5 90.5t90.5 37.5h274q36 24 137 155q58 75 107 128 q24 25 35.5 85.5t30.5 126.5t62 108q39 37 90 37q84 0 151 -32.5t102 -101.5t35 -186q0 -93 -48 -192h176q104 0 180 -76t76 -179z" />
-<glyph unicode="&#xf088;" d="M256 1088q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1408 512q0 35 -21.5 81t-53.5 47q15 17 25 47.5t10 55.5q0 69 -53 119q18 32 18 69t-17.5 73.5t-47.5 52.5q5 30 5 56q0 85 -49 126t-136 41h-128q-131 0 -342 -73q-5 -2 -29 -10.5 t-35.5 -12.5t-35 -11.5t-38 -11t-33 -6.5t-31.5 -3h-32v-640h32q16 0 35.5 -9t40 -27t38.5 -35.5t40 -44t34.5 -42.5t31.5 -41t23 -30q55 -68 77 -91q41 -43 59.5 -109.5t30.5 -125.5t38 -85q96 0 128 47t32 145q0 59 -48 160.5t-48 159.5h352q50 0 89 38.5t39 89.5z M1536 511q0 -103 -76 -179t-180 -76h-176q48 -99 48 -192q0 -118 -35 -186q-35 -69 -102 -101.5t-151 -32.5q-51 0 -90 37q-34 33 -54 82t-25.5 90.5t-17.5 84.5t-31 64q-48 50 -107 127q-101 131 -137 155h-274q-53 0 -90.5 37.5t-37.5 90.5v640q0 53 37.5 90.5t90.5 37.5 h288q22 0 138 40q128 44 223 66t200 22h112q140 0 226.5 -79t85.5 -216v-5q60 -77 60 -178q0 -22 -3 -43q38 -67 38 -144q0 -36 -9 -69q49 -74 49 -163z" />
-<glyph unicode="&#xf089;" horiz-adv-x="896" d="M832 1504v-1339l-449 -236q-22 -12 -40 -12q-21 0 -31.5 14.5t-10.5 35.5q0 6 2 20l86 500l-364 354q-25 27 -25 48q0 37 56 46l502 73l225 455q19 41 49 41z" />
-<glyph unicode="&#xf08a;" horiz-adv-x="1792" d="M1664 940q0 81 -21.5 143t-55 98.5t-81.5 59.5t-94 31t-98 8t-112 -25.5t-110.5 -64t-86.5 -72t-60 -61.5q-18 -22 -49 -22t-49 22q-24 28 -60 61.5t-86.5 72t-110.5 64t-112 25.5t-98 -8t-94 -31t-81.5 -59.5t-55 -98.5t-21.5 -143q0 -168 187 -355l581 -560l580 559 q188 188 188 356zM1792 940q0 -221 -229 -450l-623 -600q-18 -18 -44 -18t-44 18l-624 602q-10 8 -27.5 26t-55.5 65.5t-68 97.5t-53.5 121t-23.5 138q0 220 127 344t351 124q62 0 126.5 -21.5t120 -58t95.5 -68.5t76 -68q36 36 76 68t95.5 68.5t120 58t126.5 21.5 q224 0 351 -124t127 -344z" />
-<glyph unicode="&#xf08b;" horiz-adv-x="1664" d="M640 96q0 -4 1 -20t0.5 -26.5t-3 -23.5t-10 -19.5t-20.5 -6.5h-320q-119 0 -203.5 84.5t-84.5 203.5v704q0 119 84.5 203.5t203.5 84.5h320q13 0 22.5 -9.5t9.5 -22.5q0 -4 1 -20t0.5 -26.5t-3 -23.5t-10 -19.5t-20.5 -6.5h-320q-66 0 -113 -47t-47 -113v-704 q0 -66 47 -113t113 -47h288h11h13t11.5 -1t11.5 -3t8 -5.5t7 -9t2 -13.5zM1568 640q0 -26 -19 -45l-544 -544q-19 -19 -45 -19t-45 19t-19 45v288h-448q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h448v288q0 26 19 45t45 19t45 -19l544 -544q19 -19 19 -45z" />
-<glyph unicode="&#xf08c;" d="M237 122h231v694h-231v-694zM483 1030q-1 52 -36 86t-93 34t-94.5 -34t-36.5 -86q0 -51 35.5 -85.5t92.5 -34.5h1q59 0 95 34.5t36 85.5zM1068 122h231v398q0 154 -73 233t-193 79q-136 0 -209 -117h2v101h-231q3 -66 0 -694h231v388q0 38 7 56q15 35 45 59.5t74 24.5 q116 0 116 -157v-371zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
-<glyph unicode="&#xf08d;" horiz-adv-x="1152" d="M480 672v448q0 14 -9 23t-23 9t-23 -9t-9 -23v-448q0 -14 9 -23t23 -9t23 9t9 23zM1152 320q0 -26 -19 -45t-45 -19h-429l-51 -483q-2 -12 -10.5 -20.5t-20.5 -8.5h-1q-27 0 -32 27l-76 485h-404q-26 0 -45 19t-19 45q0 123 78.5 221.5t177.5 98.5v512q-52 0 -90 38 t-38 90t38 90t90 38h640q52 0 90 -38t38 -90t-38 -90t-90 -38v-512q99 0 177.5 -98.5t78.5 -221.5z" />
-<glyph unicode="&#xf08e;" horiz-adv-x="1792" d="M1408 608v-320q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h704q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-704q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832q66 0 113 47t47 113v320 q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM1792 1472v-512q0 -26 -19 -45t-45 -19t-45 19l-176 176l-652 -652q-10 -10 -23 -10t-23 10l-114 114q-10 10 -10 23t10 23l652 652l-176 176q-19 19 -19 45t19 45t45 19h512q26 0 45 -19t19 -45z" />
-<glyph unicode="&#xf090;" d="M1184 640q0 -26 -19 -45l-544 -544q-19 -19 -45 -19t-45 19t-19 45v288h-448q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h448v288q0 26 19 45t45 19t45 -19l544 -544q19 -19 19 -45zM1536 992v-704q0 -119 -84.5 -203.5t-203.5 -84.5h-320q-13 0 -22.5 9.5t-9.5 22.5 q0 4 -1 20t-0.5 26.5t3 23.5t10 19.5t20.5 6.5h320q66 0 113 47t47 113v704q0 66 -47 113t-113 47h-288h-11h-13t-11.5 1t-11.5 3t-8 5.5t-7 9t-2 13.5q0 4 -1 20t-0.5 26.5t3 23.5t10 19.5t20.5 6.5h320q119 0 203.5 -84.5t84.5 -203.5z" />
-<glyph unicode="&#xf091;" horiz-adv-x="1664" d="M458 653q-74 162 -74 371h-256v-96q0 -78 94.5 -162t235.5 -113zM1536 928v96h-256q0 -209 -74 -371q141 29 235.5 113t94.5 162zM1664 1056v-128q0 -71 -41.5 -143t-112 -130t-173 -97.5t-215.5 -44.5q-42 -54 -95 -95q-38 -34 -52.5 -72.5t-14.5 -89.5q0 -54 30.5 -91 t97.5 -37q75 0 133.5 -45.5t58.5 -114.5v-64q0 -14 -9 -23t-23 -9h-832q-14 0 -23 9t-9 23v64q0 69 58.5 114.5t133.5 45.5q67 0 97.5 37t30.5 91q0 51 -14.5 89.5t-52.5 72.5q-53 41 -95 95q-113 5 -215.5 44.5t-173 97.5t-112 130t-41.5 143v128q0 40 28 68t68 28h288v96 q0 66 47 113t113 47h576q66 0 113 -47t47 -113v-96h288q40 0 68 -28t28 -68z" />
-<glyph unicode="&#xf092;" d="M394 184q-8 -9 -20 3q-13 11 -4 19q8 9 20 -3q12 -11 4 -19zM352 245q9 -12 0 -19q-8 -6 -17 7t0 18q9 7 17 -6zM291 305q-5 -7 -13 -2q-10 5 -7 12q3 5 13 2q10 -5 7 -12zM322 271q-6 -7 -16 3q-9 11 -2 16q6 6 16 -3q9 -11 2 -16zM451 159q-4 -12 -19 -6q-17 4 -13 15 t19 7q16 -5 13 -16zM514 154q0 -11 -16 -11q-17 -2 -17 11q0 11 16 11q17 2 17 -11zM572 164q2 -10 -14 -14t-18 8t14 15q16 2 18 -9zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-224q-16 0 -24.5 1t-19.5 5t-16 14.5t-5 27.5v239q0 97 -52 142q57 6 102.5 18t94 39 t81 66.5t53 105t20.5 150.5q0 121 -79 206q37 91 -8 204q-28 9 -81 -11t-92 -44l-38 -24q-93 26 -192 26t-192 -26q-16 11 -42.5 27t-83.5 38.5t-86 13.5q-44 -113 -7 -204q-79 -85 -79 -206q0 -85 20.5 -150t52.5 -105t80.5 -67t94 -39t102.5 -18q-40 -36 -49 -103 q-21 -10 -45 -15t-57 -5t-65.5 21.5t-55.5 62.5q-19 32 -48.5 52t-49.5 24l-20 3q-21 0 -29 -4.5t-5 -11.5t9 -14t13 -12l7 -5q22 -10 43.5 -38t31.5 -51l10 -23q13 -38 44 -61.5t67 -30t69.5 -7t55.5 3.5l23 4q0 -38 0.5 -103t0.5 -68q0 -22 -11 -33.5t-22 -13t-33 -1.5 h-224q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
-<glyph unicode="&#xf093;" horiz-adv-x="1664" d="M1280 64q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1536 64q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1664 288v-320q0 -40 -28 -68t-68 -28h-1472q-40 0 -68 28t-28 68v320q0 40 28 68t68 28h427q21 -56 70.5 -92 t110.5 -36h256q61 0 110.5 36t70.5 92h427q40 0 68 -28t28 -68zM1339 936q-17 -40 -59 -40h-256v-448q0 -26 -19 -45t-45 -19h-256q-26 0 -45 19t-19 45v448h-256q-42 0 -59 40q-17 39 14 69l448 448q18 19 45 19t45 -19l448 -448q31 -30 14 -69z" />
-<glyph unicode="&#xf094;" d="M1407 710q0 44 -7 113.5t-18 96.5q-12 30 -17 44t-9 36.5t-4 48.5q0 23 5 68.5t5 67.5q0 37 -10 55q-4 1 -13 1q-19 0 -58 -4.5t-59 -4.5q-60 0 -176 24t-175 24q-43 0 -94.5 -11.5t-85 -23.5t-89.5 -34q-137 -54 -202 -103q-96 -73 -159.5 -189.5t-88 -236t-24.5 -248.5 q0 -40 12.5 -120t12.5 -121q0 -23 -11 -66.5t-11 -65.5t12 -36.5t34 -14.5q24 0 72.5 11t73.5 11q57 0 169.5 -15.5t169.5 -15.5q181 0 284 36q129 45 235.5 152.5t166 245.5t59.5 275zM1535 712q0 -165 -70 -327.5t-196 -288t-281 -180.5q-124 -44 -326 -44 q-57 0 -170 14.5t-169 14.5q-24 0 -72.5 -14.5t-73.5 -14.5q-73 0 -123.5 55.5t-50.5 128.5q0 24 11 68t11 67q0 40 -12.5 120.5t-12.5 121.5q0 111 18 217.5t54.5 209.5t100.5 194t150 156q78 59 232 120q194 78 316 78q60 0 175.5 -24t173.5 -24q19 0 57 5t58 5 q81 0 118 -50.5t37 -134.5q0 -23 -5 -68t-5 -68q0 -10 1 -18.5t3 -17t4 -13.5t6.5 -16t6.5 -17q16 -40 25 -118.5t9 -136.5z" />
-<glyph unicode="&#xf095;" horiz-adv-x="1408" d="M1408 296q0 -27 -10 -70.5t-21 -68.5q-21 -50 -122 -106q-94 -51 -186 -51q-27 0 -52.5 3.5t-57.5 12.5t-47.5 14.5t-55.5 20.5t-49 18q-98 35 -175 83q-128 79 -264.5 215.5t-215.5 264.5q-48 77 -83 175q-3 9 -18 49t-20.5 55.5t-14.5 47.5t-12.5 57.5t-3.5 52.5 q0 92 51 186q56 101 106 122q25 11 68.5 21t70.5 10q14 0 21 -3q18 -6 53 -76q11 -19 30 -54t35 -63.5t31 -53.5q3 -4 17.5 -25t21.5 -35.5t7 -28.5q0 -20 -28.5 -50t-62 -55t-62 -53t-28.5 -46q0 -9 5 -22.5t8.5 -20.5t14 -24t11.5 -19q76 -137 174 -235t235 -174 q2 -1 19 -11.5t24 -14t20.5 -8.5t22.5 -5q18 0 46 28.5t53 62t55 62t50 28.5q14 0 28.5 -7t35.5 -21.5t25 -17.5q25 -15 53.5 -31t63.5 -35t54 -30q70 -35 76 -53q3 -7 3 -21z" />
-<glyph unicode="&#xf096;" horiz-adv-x="1408" d="M1120 1280h-832q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832q66 0 113 47t47 113v832q0 66 -47 113t-113 47zM1408 1120v-832q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h832 q119 0 203.5 -84.5t84.5 -203.5z" />
-<glyph unicode="&#xf097;" horiz-adv-x="1280" d="M1152 1280h-1024v-1242l423 406l89 85l89 -85l423 -406v1242zM1164 1408q23 0 44 -9q33 -13 52.5 -41t19.5 -62v-1289q0 -34 -19.5 -62t-52.5 -41q-19 -8 -44 -8q-48 0 -83 32l-441 424l-441 -424q-36 -33 -83 -33q-23 0 -44 9q-33 13 -52.5 41t-19.5 62v1289 q0 34 19.5 62t52.5 41q21 9 44 9h1048z" />
-<glyph unicode="&#xf098;" d="M1280 343q0 11 -2 16q-3 8 -38.5 29.5t-88.5 49.5l-53 29q-5 3 -19 13t-25 15t-21 5q-18 0 -47 -32.5t-57 -65.5t-44 -33q-7 0 -16.5 3.5t-15.5 6.5t-17 9.5t-14 8.5q-99 55 -170.5 126.5t-126.5 170.5q-2 3 -8.5 14t-9.5 17t-6.5 15.5t-3.5 16.5q0 13 20.5 33.5t45 38.5 t45 39.5t20.5 36.5q0 10 -5 21t-15 25t-13 19q-3 6 -15 28.5t-25 45.5t-26.5 47.5t-25 40.5t-16.5 18t-16 2q-48 0 -101 -22q-46 -21 -80 -94.5t-34 -130.5q0 -16 2.5 -34t5 -30.5t9 -33t10 -29.5t12.5 -33t11 -30q60 -164 216.5 -320.5t320.5 -216.5q6 -2 30 -11t33 -12.5 t29.5 -10t33 -9t30.5 -5t34 -2.5q57 0 130.5 34t94.5 80q22 53 22 101zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
-<glyph unicode="&#xf099;" horiz-adv-x="1664" d="M1620 1128q-67 -98 -162 -167q1 -14 1 -42q0 -130 -38 -259.5t-115.5 -248.5t-184.5 -210.5t-258 -146t-323 -54.5q-271 0 -496 145q35 -4 78 -4q225 0 401 138q-105 2 -188 64.5t-114 159.5q33 -5 61 -5q43 0 85 11q-112 23 -185.5 111.5t-73.5 205.5v4q68 -38 146 -41 q-66 44 -105 115t-39 154q0 88 44 163q121 -149 294.5 -238.5t371.5 -99.5q-8 38 -8 74q0 134 94.5 228.5t228.5 94.5q140 0 236 -102q109 21 205 78q-37 -115 -142 -178q93 10 186 50z" />
-<glyph unicode="&#xf09a;" horiz-adv-x="768" d="M511 980h257l-30 -284h-227v-824h-341v824h-170v284h170v171q0 182 86 275.5t283 93.5h227v-284h-142q-39 0 -62.5 -6.5t-34 -23.5t-13.5 -34.5t-3 -49.5v-142z" />
-<glyph unicode="&#xf09b;" d="M1536 640q0 -251 -146.5 -451.5t-378.5 -277.5q-27 -5 -39.5 7t-12.5 30v211q0 97 -52 142q57 6 102.5 18t94 39t81 66.5t53 105t20.5 150.5q0 121 -79 206q37 91 -8 204q-28 9 -81 -11t-92 -44l-38 -24q-93 26 -192 26t-192 -26q-16 11 -42.5 27t-83.5 38.5t-86 13.5 q-44 -113 -7 -204q-79 -85 -79 -206q0 -85 20.5 -150t52.5 -105t80.5 -67t94 -39t102.5 -18q-40 -36 -49 -103q-21 -10 -45 -15t-57 -5t-65.5 21.5t-55.5 62.5q-19 32 -48.5 52t-49.5 24l-20 3q-21 0 -29 -4.5t-5 -11.5t9 -14t13 -12l7 -5q22 -10 43.5 -38t31.5 -51l10 -23 q13 -38 44 -61.5t67 -30t69.5 -7t55.5 3.5l23 4q0 -38 0.5 -89t0.5 -54q0 -18 -13 -30t-40 -7q-232 77 -378.5 277.5t-146.5 451.5q0 209 103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf09c;" horiz-adv-x="1664" d="M1664 960v-256q0 -26 -19 -45t-45 -19h-64q-26 0 -45 19t-19 45v256q0 106 -75 181t-181 75t-181 -75t-75 -181v-192h96q40 0 68 -28t28 -68v-576q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v576q0 40 28 68t68 28h672v192q0 185 131.5 316.5t316.5 131.5 t316.5 -131.5t131.5 -316.5z" />
-<glyph unicode="&#xf09d;" horiz-adv-x="1920" d="M1760 1408q66 0 113 -47t47 -113v-1216q0 -66 -47 -113t-113 -47h-1600q-66 0 -113 47t-47 113v1216q0 66 47 113t113 47h1600zM160 1280q-13 0 -22.5 -9.5t-9.5 -22.5v-224h1664v224q0 13 -9.5 22.5t-22.5 9.5h-1600zM1760 0q13 0 22.5 9.5t9.5 22.5v608h-1664v-608 q0 -13 9.5 -22.5t22.5 -9.5h1600zM256 128v128h256v-128h-256zM640 128v128h384v-128h-384z" />
-<glyph unicode="&#xf09e;" horiz-adv-x="1408" d="M384 192q0 -80 -56 -136t-136 -56t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM896 69q2 -28 -17 -48q-18 -21 -47 -21h-135q-25 0 -43 16.5t-20 41.5q-22 229 -184.5 391.5t-391.5 184.5q-25 2 -41.5 20t-16.5 43v135q0 29 21 47q17 17 43 17h5q160 -13 306 -80.5 t259 -181.5q114 -113 181.5 -259t80.5 -306zM1408 67q2 -27 -18 -47q-18 -20 -46 -20h-143q-26 0 -44.5 17.5t-19.5 42.5q-12 215 -101 408.5t-231.5 336t-336 231.5t-408.5 102q-25 1 -42.5 19.5t-17.5 43.5v143q0 28 20 46q18 18 44 18h3q262 -13 501.5 -120t425.5 -294 q187 -186 294 -425.5t120 -501.5z" />
-<glyph unicode="&#xf0a0;" d="M1040 320q0 -33 -23.5 -56.5t-56.5 -23.5t-56.5 23.5t-23.5 56.5t23.5 56.5t56.5 23.5t56.5 -23.5t23.5 -56.5zM1296 320q0 -33 -23.5 -56.5t-56.5 -23.5t-56.5 23.5t-23.5 56.5t23.5 56.5t56.5 23.5t56.5 -23.5t23.5 -56.5zM1408 160v320q0 13 -9.5 22.5t-22.5 9.5 h-1216q-13 0 -22.5 -9.5t-9.5 -22.5v-320q0 -13 9.5 -22.5t22.5 -9.5h1216q13 0 22.5 9.5t9.5 22.5zM178 640h1180l-157 482q-4 13 -16 21.5t-26 8.5h-782q-14 0 -26 -8.5t-16 -21.5zM1536 480v-320q0 -66 -47 -113t-113 -47h-1216q-66 0 -113 47t-47 113v320q0 25 16 75 l197 606q17 53 63 86t101 33h782q55 0 101 -33t63 -86l197 -606q16 -50 16 -75z" />
-<glyph unicode="&#xf0a1;" horiz-adv-x="1792" d="M1664 896q53 0 90.5 -37.5t37.5 -90.5t-37.5 -90.5t-90.5 -37.5v-384q0 -52 -38 -90t-90 -38q-417 347 -812 380q-58 -19 -91 -66t-31 -100.5t40 -92.5q-20 -33 -23 -65.5t6 -58t33.5 -55t48 -50t61.5 -50.5q-29 -58 -111.5 -83t-168.5 -11.5t-132 55.5q-7 23 -29.5 87.5 t-32 94.5t-23 89t-15 101t3.5 98.5t22 110.5h-122q-66 0 -113 47t-47 113v192q0 66 47 113t113 47h480q435 0 896 384q52 0 90 -38t38 -90v-384zM1536 292v954q-394 -302 -768 -343v-270q377 -42 768 -341z" />
-<glyph unicode="&#xf0a2;" horiz-adv-x="1664" d="M848 -160q0 16 -16 16q-59 0 -101.5 42.5t-42.5 101.5q0 16 -16 16t-16 -16q0 -73 51.5 -124.5t124.5 -51.5q16 0 16 16zM183 128h1298q-164 181 -246.5 411.5t-82.5 484.5q0 256 -320 256t-320 -256q0 -254 -82.5 -484.5t-246.5 -411.5zM1664 128q0 -52 -38 -90t-90 -38 h-448q0 -106 -75 -181t-181 -75t-181 75t-75 181h-448q-52 0 -90 38t-38 90q190 161 287 397.5t97 498.5q0 165 96 262t264 117q-8 18 -8 37q0 40 28 68t68 28t68 -28t28 -68q0 -19 -8 -37q168 -20 264 -117t96 -262q0 -262 97 -498.5t287 -397.5z" />
-<glyph unicode="&#xf0a3;" d="M1376 640l138 -135q30 -28 20 -70q-12 -41 -52 -51l-188 -48l53 -186q12 -41 -19 -70q-29 -31 -70 -19l-186 53l-48 -188q-10 -40 -51 -52q-12 -2 -19 -2q-31 0 -51 22l-135 138l-135 -138q-28 -30 -70 -20q-41 11 -51 52l-48 188l-186 -53q-41 -12 -70 19q-31 29 -19 70 l53 186l-188 48q-40 10 -52 51q-10 42 20 70l138 135l-138 135q-30 28 -20 70q12 41 52 51l188 48l-53 186q-12 41 19 70q29 31 70 19l186 -53l48 188q10 41 51 51q41 12 70 -19l135 -139l135 139q29 30 70 19q41 -10 51 -51l48 -188l186 53q41 12 70 -19q31 -29 19 -70 l-53 -186l188 -48q40 -10 52 -51q10 -42 -20 -70z" />
-<glyph unicode="&#xf0a4;" horiz-adv-x="1792" d="M256 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1664 768q0 51 -39 89.5t-89 38.5h-576q0 20 15 48.5t33 55t33 68t15 84.5q0 67 -44.5 97.5t-115.5 30.5q-24 0 -90 -139q-24 -44 -37 -65q-40 -64 -112 -145q-71 -81 -101 -106 q-69 -57 -140 -57h-32v-640h32q72 0 167 -32t193.5 -64t179.5 -32q189 0 189 167q0 26 -5 56q30 16 47.5 52.5t17.5 73.5t-18 69q53 50 53 119q0 25 -10 55.5t-25 47.5h331q52 0 90 38t38 90zM1792 769q0 -105 -75.5 -181t-180.5 -76h-169q-4 -62 -37 -119q3 -21 3 -43 q0 -101 -60 -178q1 -139 -85 -219.5t-227 -80.5q-133 0 -322 69q-164 59 -223 59h-288q-53 0 -90.5 37.5t-37.5 90.5v640q0 53 37.5 90.5t90.5 37.5h288q10 0 21.5 4.5t23.5 14t22.5 18t24 22.5t20.5 21.5t19 21.5t14 17q65 74 100 129q13 21 33 62t37 72t40.5 63t55 49.5 t69.5 17.5q125 0 206.5 -67t81.5 -189q0 -68 -22 -128h374q104 0 180 -76t76 -179z" />
-<glyph unicode="&#xf0a5;" horiz-adv-x="1792" d="M1376 128h32v640h-32q-35 0 -67.5 12t-62.5 37t-50 46t-49 54q-2 3 -3.5 4.5t-4 4.5t-4.5 5q-72 81 -112 145q-14 22 -38 68q-1 3 -10.5 22.5t-18.5 36t-20 35.5t-21.5 30.5t-18.5 11.5q-71 0 -115.5 -30.5t-44.5 -97.5q0 -43 15 -84.5t33 -68t33 -55t15 -48.5h-576 q-50 0 -89 -38.5t-39 -89.5q0 -52 38 -90t90 -38h331q-15 -17 -25 -47.5t-10 -55.5q0 -69 53 -119q-18 -32 -18 -69t17.5 -73.5t47.5 -52.5q-4 -24 -4 -56q0 -85 48.5 -126t135.5 -41q84 0 183 32t194 64t167 32zM1664 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45 t45 -19t45 19t19 45zM1792 768v-640q0 -53 -37.5 -90.5t-90.5 -37.5h-288q-59 0 -223 -59q-190 -69 -317 -69q-142 0 -230 77.5t-87 217.5l1 5q-61 76 -61 178q0 22 3 43q-33 57 -37 119h-169q-105 0 -180.5 76t-75.5 181q0 103 76 179t180 76h374q-22 60 -22 128 q0 122 81.5 189t206.5 67q38 0 69.5 -17.5t55 -49.5t40.5 -63t37 -72t33 -62q35 -55 100 -129q2 -3 14 -17t19 -21.5t20.5 -21.5t24 -22.5t22.5 -18t23.5 -14t21.5 -4.5h288q53 0 90.5 -37.5t37.5 -90.5z" />
-<glyph unicode="&#xf0a6;" d="M1280 -64q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1408 700q0 189 -167 189q-26 0 -56 -5q-16 30 -52.5 47.5t-73.5 17.5t-69 -18q-50 53 -119 53q-25 0 -55.5 -10t-47.5 -25v331q0 52 -38 90t-90 38q-51 0 -89.5 -39t-38.5 -89v-576 q-20 0 -48.5 15t-55 33t-68 33t-84.5 15q-67 0 -97.5 -44.5t-30.5 -115.5q0 -24 139 -90q44 -24 65 -37q64 -40 145 -112q81 -71 106 -101q57 -69 57 -140v-32h640v32q0 72 32 167t64 193.5t32 179.5zM1536 705q0 -133 -69 -322q-59 -164 -59 -223v-288q0 -53 -37.5 -90.5 t-90.5 -37.5h-640q-53 0 -90.5 37.5t-37.5 90.5v288q0 10 -4.5 21.5t-14 23.5t-18 22.5t-22.5 24t-21.5 20.5t-21.5 19t-17 14q-74 65 -129 100q-21 13 -62 33t-72 37t-63 40.5t-49.5 55t-17.5 69.5q0 125 67 206.5t189 81.5q68 0 128 -22v374q0 104 76 180t179 76 q105 0 181 -75.5t76 -180.5v-169q62 -4 119 -37q21 3 43 3q101 0 178 -60q139 1 219.5 -85t80.5 -227z" />
-<glyph unicode="&#xf0a7;" d="M1408 576q0 84 -32 183t-64 194t-32 167v32h-640v-32q0 -35 -12 -67.5t-37 -62.5t-46 -50t-54 -49q-9 -8 -14 -12q-81 -72 -145 -112q-22 -14 -68 -38q-3 -1 -22.5 -10.5t-36 -18.5t-35.5 -20t-30.5 -21.5t-11.5 -18.5q0 -71 30.5 -115.5t97.5 -44.5q43 0 84.5 15t68 33 t55 33t48.5 15v-576q0 -50 38.5 -89t89.5 -39q52 0 90 38t38 90v331q46 -35 103 -35q69 0 119 53q32 -18 69 -18t73.5 17.5t52.5 47.5q24 -4 56 -4q85 0 126 48.5t41 135.5zM1280 1344q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1536 580 q0 -142 -77.5 -230t-217.5 -87l-5 1q-76 -61 -178 -61q-22 0 -43 3q-54 -30 -119 -37v-169q0 -105 -76 -180.5t-181 -75.5q-103 0 -179 76t-76 180v374q-54 -22 -128 -22q-121 0 -188.5 81.5t-67.5 206.5q0 38 17.5 69.5t49.5 55t63 40.5t72 37t62 33q55 35 129 100 q3 2 17 14t21.5 19t21.5 20.5t22.5 24t18 22.5t14 23.5t4.5 21.5v288q0 53 37.5 90.5t90.5 37.5h640q53 0 90.5 -37.5t37.5 -90.5v-288q0 -59 59 -223q69 -190 69 -317z" />
-<glyph unicode="&#xf0a8;" d="M1280 576v128q0 26 -19 45t-45 19h-502l189 189q19 19 19 45t-19 45l-91 91q-18 18 -45 18t-45 -18l-362 -362l-91 -91q-18 -18 -18 -45t18 -45l91 -91l362 -362q18 -18 45 -18t45 18l91 91q18 18 18 45t-18 45l-189 189h502q26 0 45 19t19 45zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf0a9;" d="M1285 640q0 27 -18 45l-91 91l-362 362q-18 18 -45 18t-45 -18l-91 -91q-18 -18 -18 -45t18 -45l189 -189h-502q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h502l-189 -189q-19 -19 -19 -45t19 -45l91 -91q18 -18 45 -18t45 18l362 362l91 91q18 18 18 45zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf0aa;" d="M1284 641q0 27 -18 45l-362 362l-91 91q-18 18 -45 18t-45 -18l-91 -91l-362 -362q-18 -18 -18 -45t18 -45l91 -91q18 -18 45 -18t45 18l189 189v-502q0 -26 19 -45t45 -19h128q26 0 45 19t19 45v502l189 -189q19 -19 45 -19t45 19l91 91q18 18 18 45zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf0ab;" d="M1284 639q0 27 -18 45l-91 91q-18 18 -45 18t-45 -18l-189 -189v502q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-502l-189 189q-19 19 -45 19t-45 -19l-91 -91q-18 -18 -18 -45t18 -45l362 -362l91 -91q18 -18 45 -18t45 18l91 91l362 362q18 18 18 45zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf0ac;" d="M768 1408q209 0 385.5 -103t279.5 -279.5t103 -385.5t-103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103zM1042 887q-2 -1 -9.5 -9.5t-13.5 -9.5q2 0 4.5 5t5 11t3.5 7q6 7 22 15q14 6 52 12q34 8 51 -11 q-2 2 9.5 13t14.5 12q3 2 15 4.5t15 7.5l2 22q-12 -1 -17.5 7t-6.5 21q0 -2 -6 -8q0 7 -4.5 8t-11.5 -1t-9 -1q-10 3 -15 7.5t-8 16.5t-4 15q-2 5 -9.5 10.5t-9.5 10.5q-1 2 -2.5 5.5t-3 6.5t-4 5.5t-5.5 2.5t-7 -5t-7.5 -10t-4.5 -5q-3 2 -6 1.5t-4.5 -1t-4.5 -3t-5 -3.5 q-3 -2 -8.5 -3t-8.5 -2q15 5 -1 11q-10 4 -16 3q9 4 7.5 12t-8.5 14h5q-1 4 -8.5 8.5t-17.5 8.5t-13 6q-8 5 -34 9.5t-33 0.5q-5 -6 -4.5 -10.5t4 -14t3.5 -12.5q1 -6 -5.5 -13t-6.5 -12q0 -7 14 -15.5t10 -21.5q-3 -8 -16 -16t-16 -12q-5 -8 -1.5 -18.5t10.5 -16.5 q2 -2 1.5 -4t-3.5 -4.5t-5.5 -4t-6.5 -3.5l-3 -2q-11 -5 -20.5 6t-13.5 26q-7 25 -16 30q-23 8 -29 -1q-5 13 -41 26q-25 9 -58 4q6 1 0 15q-7 15 -19 12q3 6 4 17.5t1 13.5q3 13 12 23q1 1 7 8.5t9.5 13.5t0.5 6q35 -4 50 11q5 5 11.5 17t10.5 17q9 6 14 5.5t14.5 -5.5 t14.5 -5q14 -1 15.5 11t-7.5 20q12 -1 3 17q-5 7 -8 9q-12 4 -27 -5q-8 -4 2 -8q-1 1 -9.5 -10.5t-16.5 -17.5t-16 5q-1 1 -5.5 13.5t-9.5 13.5q-8 0 -16 -15q3 8 -11 15t-24 8q19 12 -8 27q-7 4 -20.5 5t-19.5 -4q-5 -7 -5.5 -11.5t5 -8t10.5 -5.5t11.5 -4t8.5 -3 q14 -10 8 -14q-2 -1 -8.5 -3.5t-11.5 -4.5t-6 -4q-3 -4 0 -14t-2 -14q-5 5 -9 17.5t-7 16.5q7 -9 -25 -6l-10 1q-4 0 -16 -2t-20.5 -1t-13.5 8q-4 8 0 20q1 4 4 2q-4 3 -11 9.5t-10 8.5q-46 -15 -94 -41q6 -1 12 1q5 2 13 6.5t10 5.5q34 14 42 7l5 5q14 -16 20 -25 q-7 4 -30 1q-20 -6 -22 -12q7 -12 5 -18q-4 3 -11.5 10t-14.5 11t-15 5q-16 0 -22 -1q-146 -80 -235 -222q7 -7 12 -8q4 -1 5 -9t2.5 -11t11.5 3q9 -8 3 -19q1 1 44 -27q19 -17 21 -21q3 -11 -10 -18q-1 2 -9 9t-9 4q-3 -5 0.5 -18.5t10.5 -12.5q-7 0 -9.5 -16t-2.5 -35.5 t-1 -23.5l2 -1q-3 -12 5.5 -34.5t21.5 -19.5q-13 -3 20 -43q6 -8 8 -9q3 -2 12 -7.5t15 -10t10 -10.5q4 -5 10 -22.5t14 -23.5q-2 -6 9.5 -20t10.5 -23q-1 0 -2.5 -1t-2.5 -1q3 -7 15.5 -14t15.5 -13q1 -3 2 -10t3 -11t8 -2q2 20 -24 62q-15 25 -17 29q-3 5 -5.5 15.5 t-4.5 14.5q2 0 6 -1.5t8.5 -3.5t7.5 -4t2 -3q-3 -7 2 -17.5t12 -18.5t17 -19t12 -13q6 -6 14 -19.5t0 -13.5q9 0 20 -10t17 -20q5 -8 8 -26t5 -24q2 -7 8.5 -13.5t12.5 -9.5l16 -8t13 -7q5 -2 18.5 -10.5t21.5 -11.5q10 -4 16 -4t14.5 2.5t13.5 3.5q15 2 29 -15t21 -21 q36 -19 55 -11q-2 -1 0.5 -7.5t8 -15.5t9 -14.5t5.5 -8.5q5 -6 18 -15t18 -15q6 4 7 9q-3 -8 7 -20t18 -10q14 3 14 32q-31 -15 -49 18q0 1 -2.5 5.5t-4 8.5t-2.5 8.5t0 7.5t5 3q9 0 10 3.5t-2 12.5t-4 13q-1 8 -11 20t-12 15q-5 -9 -16 -8t-16 9q0 -1 -1.5 -5.5t-1.5 -6.5 q-13 0 -15 1q1 3 2.5 17.5t3.5 22.5q1 4 5.5 12t7.5 14.5t4 12.5t-4.5 9.5t-17.5 2.5q-19 -1 -26 -20q-1 -3 -3 -10.5t-5 -11.5t-9 -7q-7 -3 -24 -2t-24 5q-13 8 -22.5 29t-9.5 37q0 10 2.5 26.5t3 25t-5.5 24.5q3 2 9 9.5t10 10.5q2 1 4.5 1.5t4.5 0t4 1.5t3 6q-1 1 -4 3 q-3 3 -4 3q7 -3 28.5 1.5t27.5 -1.5q15 -11 22 2q0 1 -2.5 9.5t-0.5 13.5q5 -27 29 -9q3 -3 15.5 -5t17.5 -5q3 -2 7 -5.5t5.5 -4.5t5 0.5t8.5 6.5q10 -14 12 -24q11 -40 19 -44q7 -3 11 -2t4.5 9.5t0 14t-1.5 12.5l-1 8v18l-1 8q-15 3 -18.5 12t1.5 18.5t15 18.5q1 1 8 3.5 t15.5 6.5t12.5 8q21 19 15 35q7 0 11 9q-1 0 -5 3t-7.5 5t-4.5 2q9 5 2 16q5 3 7.5 11t7.5 10q9 -12 21 -2q7 8 1 16q5 7 20.5 10.5t18.5 9.5q7 -2 8 2t1 12t3 12q4 5 15 9t13 5l17 11q3 4 0 4q18 -2 31 11q10 11 -6 20q3 6 -3 9.5t-15 5.5q3 1 11.5 0.5t10.5 1.5 q15 10 -7 16q-17 5 -43 -12zM879 10q206 36 351 189q-3 3 -12.5 4.5t-12.5 3.5q-18 7 -24 8q1 7 -2.5 13t-8 9t-12.5 8t-11 7q-2 2 -7 6t-7 5.5t-7.5 4.5t-8.5 2t-10 -1l-3 -1q-3 -1 -5.5 -2.5t-5.5 -3t-4 -3t0 -2.5q-21 17 -36 22q-5 1 -11 5.5t-10.5 7t-10 1.5t-11.5 -7 q-5 -5 -6 -15t-2 -13q-7 5 0 17.5t2 18.5q-3 6 -10.5 4.5t-12 -4.5t-11.5 -8.5t-9 -6.5t-8.5 -5.5t-8.5 -7.5q-3 -4 -6 -12t-5 -11q-2 4 -11.5 6.5t-9.5 5.5q2 -10 4 -35t5 -38q7 -31 -12 -48q-27 -25 -29 -40q-4 -22 12 -26q0 -7 -8 -20.5t-7 -21.5q0 -6 2 -16z" />
-<glyph unicode="&#xf0ad;" horiz-adv-x="1664" d="M384 64q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1028 484l-682 -682q-37 -37 -90 -37q-52 0 -91 37l-106 108q-38 36 -38 90q0 53 38 91l681 681q39 -98 114.5 -173.5t173.5 -114.5zM1662 919q0 -39 -23 -106q-47 -134 -164.5 -217.5 t-258.5 -83.5q-185 0 -316.5 131.5t-131.5 316.5t131.5 316.5t316.5 131.5q58 0 121.5 -16.5t107.5 -46.5q16 -11 16 -28t-16 -28l-293 -169v-224l193 -107q5 3 79 48.5t135.5 81t70.5 35.5q15 0 23.5 -10t8.5 -25z" />
-<glyph unicode="&#xf0ae;" horiz-adv-x="1792" d="M1024 128h640v128h-640v-128zM640 640h1024v128h-1024v-128zM1280 1152h384v128h-384v-128zM1792 320v-256q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v256q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 832v-256q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19 t-19 45v256q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 1344v-256q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v256q0 26 19 45t45 19h1664q26 0 45 -19t19 -45z" />
-<glyph unicode="&#xf0b0;" horiz-adv-x="1408" d="M1403 1241q17 -41 -14 -70l-493 -493v-742q0 -42 -39 -59q-13 -5 -25 -5q-27 0 -45 19l-256 256q-19 19 -19 45v486l-493 493q-31 29 -14 70q17 39 59 39h1280q42 0 59 -39z" />
-<glyph unicode="&#xf0b1;" horiz-adv-x="1792" d="M640 1280h512v128h-512v-128zM1792 640v-480q0 -66 -47 -113t-113 -47h-1472q-66 0 -113 47t-47 113v480h672v-160q0 -26 19 -45t45 -19h320q26 0 45 19t19 45v160h672zM1024 640v-128h-256v128h256zM1792 1120v-384h-1792v384q0 66 47 113t113 47h352v160q0 40 28 68 t68 28h576q40 0 68 -28t28 -68v-160h352q66 0 113 -47t47 -113z" />
-<glyph unicode="&#xf0b2;" d="M1283 995l-355 -355l355 -355l144 144q29 31 70 14q39 -17 39 -59v-448q0 -26 -19 -45t-45 -19h-448q-42 0 -59 40q-17 39 14 69l144 144l-355 355l-355 -355l144 -144q31 -30 14 -69q-17 -40 -59 -40h-448q-26 0 -45 19t-19 45v448q0 42 40 59q39 17 69 -14l144 -144 l355 355l-355 355l-144 -144q-19 -19 -45 -19q-12 0 -24 5q-40 17 -40 59v448q0 26 19 45t45 19h448q42 0 59 -40q17 -39 -14 -69l-144 -144l355 -355l355 355l-144 144q-31 30 -14 69q17 40 59 40h448q26 0 45 -19t19 -45v-448q0 -42 -39 -59q-13 -5 -25 -5q-26 0 -45 19z " />
-<glyph unicode="&#xf0c0;" horiz-adv-x="1920" d="M593 640q-162 -5 -265 -128h-134q-82 0 -138 40.5t-56 118.5q0 353 124 353q6 0 43.5 -21t97.5 -42.5t119 -21.5q67 0 133 23q-5 -37 -5 -66q0 -139 81 -256zM1664 3q0 -120 -73 -189.5t-194 -69.5h-874q-121 0 -194 69.5t-73 189.5q0 53 3.5 103.5t14 109t26.5 108.5 t43 97.5t62 81t85.5 53.5t111.5 20q10 0 43 -21.5t73 -48t107 -48t135 -21.5t135 21.5t107 48t73 48t43 21.5q61 0 111.5 -20t85.5 -53.5t62 -81t43 -97.5t26.5 -108.5t14 -109t3.5 -103.5zM640 1280q0 -106 -75 -181t-181 -75t-181 75t-75 181t75 181t181 75t181 -75 t75 -181zM1344 896q0 -159 -112.5 -271.5t-271.5 -112.5t-271.5 112.5t-112.5 271.5t112.5 271.5t271.5 112.5t271.5 -112.5t112.5 -271.5zM1920 671q0 -78 -56 -118.5t-138 -40.5h-134q-103 123 -265 128q81 117 81 256q0 29 -5 66q66 -23 133 -23q59 0 119 21.5t97.5 42.5 t43.5 21q124 0 124 -353zM1792 1280q0 -106 -75 -181t-181 -75t-181 75t-75 181t75 181t181 75t181 -75t75 -181z" />
-<glyph unicode="&#xf0c1;" horiz-adv-x="1664" d="M1456 320q0 40 -28 68l-208 208q-28 28 -68 28q-42 0 -72 -32q3 -3 19 -18.5t21.5 -21.5t15 -19t13 -25.5t3.5 -27.5q0 -40 -28 -68t-68 -28q-15 0 -27.5 3.5t-25.5 13t-19 15t-21.5 21.5t-18.5 19q-33 -31 -33 -73q0 -40 28 -68l206 -207q27 -27 68 -27q40 0 68 26 l147 146q28 28 28 67zM753 1025q0 40 -28 68l-206 207q-28 28 -68 28q-39 0 -68 -27l-147 -146q-28 -28 -28 -67q0 -40 28 -68l208 -208q27 -27 68 -27q42 0 72 31q-3 3 -19 18.5t-21.5 21.5t-15 19t-13 25.5t-3.5 27.5q0 40 28 68t68 28q15 0 27.5 -3.5t25.5 -13t19 -15 t21.5 -21.5t18.5 -19q33 31 33 73zM1648 320q0 -120 -85 -203l-147 -146q-83 -83 -203 -83q-121 0 -204 85l-206 207q-83 83 -83 203q0 123 88 209l-88 88q-86 -88 -208 -88q-120 0 -204 84l-208 208q-84 84 -84 204t85 203l147 146q83 83 203 83q121 0 204 -85l206 -207 q83 -83 83 -203q0 -123 -88 -209l88 -88q86 88 208 88q120 0 204 -84l208 -208q84 -84 84 -204z" />
-<glyph unicode="&#xf0c2;" horiz-adv-x="1920" d="M1920 384q0 -159 -112.5 -271.5t-271.5 -112.5h-1088q-185 0 -316.5 131.5t-131.5 316.5q0 132 71 241.5t187 163.5q-2 28 -2 43q0 212 150 362t362 150q158 0 286.5 -88t187.5 -230q70 62 166 62q106 0 181 -75t75 -181q0 -75 -41 -138q129 -30 213 -134.5t84 -239.5z " />
-<glyph unicode="&#xf0c3;" horiz-adv-x="1664" d="M1527 88q56 -89 21.5 -152.5t-140.5 -63.5h-1152q-106 0 -140.5 63.5t21.5 152.5l503 793v399h-64q-26 0 -45 19t-19 45t19 45t45 19h512q26 0 45 -19t19 -45t-19 -45t-45 -19h-64v-399zM748 813l-272 -429h712l-272 429l-20 31v37v399h-128v-399v-37z" />
-<glyph unicode="&#xf0c4;" horiz-adv-x="1792" d="M960 640q26 0 45 -19t19 -45t-19 -45t-45 -19t-45 19t-19 45t19 45t45 19zM1260 576l507 -398q28 -20 25 -56q-5 -35 -35 -51l-128 -64q-13 -7 -29 -7q-17 0 -31 8l-690 387l-110 -66q-8 -4 -12 -5q14 -49 10 -97q-7 -77 -56 -147.5t-132 -123.5q-132 -84 -277 -84 q-136 0 -222 78q-90 84 -79 207q7 76 56 147t131 124q132 84 278 84q83 0 151 -31q9 13 22 22l122 73l-122 73q-13 9 -22 22q-68 -31 -151 -31q-146 0 -278 84q-82 53 -131 124t-56 147q-5 59 15.5 113t63.5 93q85 79 222 79q145 0 277 -84q83 -52 132 -123t56 -148 q4 -48 -10 -97q4 -1 12 -5l110 -66l690 387q14 8 31 8q16 0 29 -7l128 -64q30 -16 35 -51q3 -36 -25 -56zM579 836q46 42 21 108t-106 117q-92 59 -192 59q-74 0 -113 -36q-46 -42 -21 -108t106 -117q92 -59 192 -59q74 0 113 36zM494 91q81 51 106 117t-21 108 q-39 36 -113 36q-100 0 -192 -59q-81 -51 -106 -117t21 -108q39 -36 113 -36q100 0 192 59zM672 704l96 -58v11q0 36 33 56l14 8l-79 47l-26 -26q-3 -3 -10 -11t-12 -12q-2 -2 -4 -3.5t-3 -2.5zM896 480l96 -32l736 576l-128 64l-768 -431v-113l-160 -96l9 -8q2 -2 7 -6 q4 -4 11 -12t11 -12l26 -26zM1600 64l128 64l-520 408l-177 -138q-2 -3 -13 -7z" />
-<glyph unicode="&#xf0c5;" horiz-adv-x="1792" d="M1696 1152q40 0 68 -28t28 -68v-1216q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v288h-544q-40 0 -68 28t-28 68v672q0 40 20 88t48 76l408 408q28 28 76 48t88 20h416q40 0 68 -28t28 -68v-328q68 40 128 40h416zM1152 939l-299 -299h299v299zM512 1323l-299 -299 h299v299zM708 676l316 316v416h-384v-416q0 -40 -28 -68t-68 -28h-416v-640h512v256q0 40 20 88t48 76zM1664 -128v1152h-384v-416q0 -40 -28 -68t-68 -28h-416v-640h896z" />
-<glyph unicode="&#xf0c6;" horiz-adv-x="1408" d="M1404 151q0 -117 -79 -196t-196 -79q-135 0 -235 100l-777 776q-113 115 -113 271q0 159 110 270t269 111q158 0 273 -113l605 -606q10 -10 10 -22q0 -16 -30.5 -46.5t-46.5 -30.5q-13 0 -23 10l-606 607q-79 77 -181 77q-106 0 -179 -75t-73 -181q0 -105 76 -181 l776 -777q63 -63 145 -63q64 0 106 42t42 106q0 82 -63 145l-581 581q-26 24 -60 24q-29 0 -48 -19t-19 -48q0 -32 25 -59l410 -410q10 -10 10 -22q0 -16 -31 -47t-47 -31q-12 0 -22 10l-410 410q-63 61 -63 149q0 82 57 139t139 57q88 0 149 -63l581 -581q100 -98 100 -235 z" />
-<glyph unicode="&#xf0c7;" d="M384 0h768v384h-768v-384zM1280 0h128v896q0 14 -10 38.5t-20 34.5l-281 281q-10 10 -34 20t-39 10v-416q0 -40 -28 -68t-68 -28h-576q-40 0 -68 28t-28 68v416h-128v-1280h128v416q0 40 28 68t68 28h832q40 0 68 -28t28 -68v-416zM896 928v320q0 13 -9.5 22.5t-22.5 9.5 h-192q-13 0 -22.5 -9.5t-9.5 -22.5v-320q0 -13 9.5 -22.5t22.5 -9.5h192q13 0 22.5 9.5t9.5 22.5zM1536 896v-928q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1344q0 40 28 68t68 28h928q40 0 88 -20t76 -48l280 -280q28 -28 48 -76t20 -88z" />
-<glyph unicode="&#xf0c8;" d="M1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
-<glyph unicode="&#xf0c9;" d="M1536 192v-128q0 -26 -19 -45t-45 -19h-1408q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1408q26 0 45 -19t19 -45zM1536 704v-128q0 -26 -19 -45t-45 -19h-1408q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1408q26 0 45 -19t19 -45zM1536 1216v-128q0 -26 -19 -45 t-45 -19h-1408q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1408q26 0 45 -19t19 -45z" />
-<glyph unicode="&#xf0ca;" horiz-adv-x="1792" d="M384 128q0 -80 -56 -136t-136 -56t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM384 640q0 -80 -56 -136t-136 -56t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM1792 224v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1216q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5 t22.5 9.5h1216q13 0 22.5 -9.5t9.5 -22.5zM384 1152q0 -80 -56 -136t-136 -56t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM1792 736v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1216q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1216q13 0 22.5 -9.5t9.5 -22.5z M1792 1248v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1216q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1216q13 0 22.5 -9.5t9.5 -22.5z" />
-<glyph unicode="&#xf0cb;" horiz-adv-x="1792" d="M381 -84q0 -80 -54.5 -126t-135.5 -46q-106 0 -172 66l57 88q49 -45 106 -45q29 0 50.5 14.5t21.5 42.5q0 64 -105 56l-26 56q8 10 32.5 43.5t42.5 54t37 38.5v1q-16 0 -48.5 -1t-48.5 -1v-53h-106v152h333v-88l-95 -115q51 -12 81 -49t30 -88zM383 543v-159h-362 q-6 36 -6 54q0 51 23.5 93t56.5 68t66 47.5t56.5 43.5t23.5 45q0 25 -14.5 38.5t-39.5 13.5q-46 0 -81 -58l-85 59q24 51 71.5 79.5t105.5 28.5q73 0 123 -41.5t50 -112.5q0 -50 -34 -91.5t-75 -64.5t-75.5 -50.5t-35.5 -52.5h127v60h105zM1792 224v-192q0 -13 -9.5 -22.5 t-22.5 -9.5h-1216q-13 0 -22.5 9.5t-9.5 22.5v192q0 14 9 23t23 9h1216q13 0 22.5 -9.5t9.5 -22.5zM384 1123v-99h-335v99h107q0 41 0.5 122t0.5 121v12h-2q-8 -17 -50 -54l-71 76l136 127h106v-404h108zM1792 736v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1216q-13 0 -22.5 9.5 t-9.5 22.5v192q0 14 9 23t23 9h1216q13 0 22.5 -9.5t9.5 -22.5zM1792 1248v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1216q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1216q13 0 22.5 -9.5t9.5 -22.5z" />
-<glyph unicode="&#xf0cc;" horiz-adv-x="1792" d="M1760 640q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-1728q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h1728zM483 704q-28 35 -51 80q-48 97 -48 188q0 181 134 309q133 127 393 127q50 0 167 -19q66 -12 177 -48q10 -38 21 -118q14 -123 14 -183q0 -18 -5 -45l-12 -3l-84 6 l-14 2q-50 149 -103 205q-88 91 -210 91q-114 0 -182 -59q-67 -58 -67 -146q0 -73 66 -140t279 -129q69 -20 173 -66q58 -28 95 -52h-743zM990 448h411q7 -39 7 -92q0 -111 -41 -212q-23 -55 -71 -104q-37 -35 -109 -81q-80 -48 -153 -66q-80 -21 -203 -21q-114 0 -195 23 l-140 40q-57 16 -72 28q-8 8 -8 22v13q0 108 -2 156q-1 30 0 68l2 37v44l102 2q15 -34 30 -71t22.5 -56t12.5 -27q35 -57 80 -94q43 -36 105 -57q59 -22 132 -22q64 0 139 27q77 26 122 86q47 61 47 129q0 84 -81 157q-34 29 -137 71z" />
-<glyph unicode="&#xf0cd;" d="M48 1313q-37 2 -45 4l-3 88q13 1 40 1q60 0 112 -4q132 -7 166 -7q86 0 168 3q116 4 146 5q56 0 86 2l-1 -14l2 -64v-9q-60 -9 -124 -9q-60 0 -79 -25q-13 -14 -13 -132q0 -13 0.5 -32.5t0.5 -25.5l1 -229l14 -280q6 -124 51 -202q35 -59 96 -92q88 -47 177 -47 q104 0 191 28q56 18 99 51q48 36 65 64q36 56 53 114q21 73 21 229q0 79 -3.5 128t-11 122.5t-13.5 159.5l-4 59q-5 67 -24 88q-34 35 -77 34l-100 -2l-14 3l2 86h84l205 -10q76 -3 196 10l18 -2q6 -38 6 -51q0 -7 -4 -31q-45 -12 -84 -13q-73 -11 -79 -17q-15 -15 -15 -41 q0 -7 1.5 -27t1.5 -31q8 -19 22 -396q6 -195 -15 -304q-15 -76 -41 -122q-38 -65 -112 -123q-75 -57 -182 -89q-109 -33 -255 -33q-167 0 -284 46q-119 47 -179 122q-61 76 -83 195q-16 80 -16 237v333q0 188 -17 213q-25 36 -147 39zM1536 -96v64q0 14 -9 23t-23 9h-1472 q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h1472q14 0 23 9t9 23z" />
-<glyph unicode="&#xf0ce;" horiz-adv-x="1664" d="M512 160v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM512 544v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1024 160v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23 v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM512 928v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1024 544v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1536 160v192 q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1024 928v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1536 544v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192 q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1536 928v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1664 1248v-1088q0 -66 -47 -113t-113 -47h-1344q-66 0 -113 47t-47 113v1088q0 66 47 113t113 47h1344q66 0 113 -47t47 -113 z" />
-<glyph unicode="&#xf0d0;" horiz-adv-x="1664" d="M1190 955l293 293l-107 107l-293 -293zM1637 1248q0 -27 -18 -45l-1286 -1286q-18 -18 -45 -18t-45 18l-198 198q-18 18 -18 45t18 45l1286 1286q18 18 45 18t45 -18l198 -198q18 -18 18 -45zM286 1438l98 -30l-98 -30l-30 -98l-30 98l-98 30l98 30l30 98zM636 1276 l196 -60l-196 -60l-60 -196l-60 196l-196 60l196 60l60 196zM1566 798l98 -30l-98 -30l-30 -98l-30 98l-98 30l98 30l30 98zM926 1438l98 -30l-98 -30l-30 -98l-30 98l-98 30l98 30l30 98z" />
-<glyph unicode="&#xf0d1;" horiz-adv-x="1792" d="M640 128q0 52 -38 90t-90 38t-90 -38t-38 -90t38 -90t90 -38t90 38t38 90zM256 640h384v256h-158q-13 0 -22 -9l-195 -195q-9 -9 -9 -22v-30zM1536 128q0 52 -38 90t-90 38t-90 -38t-38 -90t38 -90t90 -38t90 38t38 90zM1792 1216v-1024q0 -15 -4 -26.5t-13.5 -18.5 t-16.5 -11.5t-23.5 -6t-22.5 -2t-25.5 0t-22.5 0.5q0 -106 -75 -181t-181 -75t-181 75t-75 181h-384q0 -106 -75 -181t-181 -75t-181 75t-75 181h-64q-3 0 -22.5 -0.5t-25.5 0t-22.5 2t-23.5 6t-16.5 11.5t-13.5 18.5t-4 26.5q0 26 19 45t45 19v320q0 8 -0.5 35t0 38 t2.5 34.5t6.5 37t14 30.5t22.5 30l198 198q19 19 50.5 32t58.5 13h160v192q0 26 19 45t45 19h1024q26 0 45 -19t19 -45z" />
-<glyph unicode="&#xf0d2;" d="M1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103q-111 0 -218 32q59 93 78 164q9 34 54 211q20 -39 73 -67.5t114 -28.5q121 0 216 68.5t147 188.5t52 270q0 114 -59.5 214t-172.5 163t-255 63q-105 0 -196 -29t-154.5 -77t-109 -110.5t-67 -129.5t-21.5 -134 q0 -104 40 -183t117 -111q30 -12 38 20q2 7 8 31t8 30q6 23 -11 43q-51 61 -51 151q0 151 104.5 259.5t273.5 108.5q151 0 235.5 -82t84.5 -213q0 -170 -68.5 -289t-175.5 -119q-61 0 -98 43.5t-23 104.5q8 35 26.5 93.5t30 103t11.5 75.5q0 50 -27 83t-77 33 q-62 0 -105 -57t-43 -142q0 -73 25 -122l-99 -418q-17 -70 -13 -177q-206 91 -333 281t-127 423q0 209 103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf0d3;" d="M1248 1408q119 0 203.5 -84.5t84.5 -203.5v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-725q85 122 108 210q9 34 53 209q21 -39 73.5 -67t112.5 -28q181 0 295.5 147.5t114.5 373.5q0 84 -35 162.5t-96.5 139t-152.5 97t-197 36.5q-104 0 -194.5 -28.5t-153 -76.5 t-107.5 -109.5t-66.5 -128t-21.5 -132.5q0 -102 39.5 -180t116.5 -110q13 -5 23.5 0t14.5 19q10 44 15 61q6 23 -11 42q-50 62 -50 150q0 150 103.5 256.5t270.5 106.5q149 0 232.5 -81t83.5 -210q0 -168 -67.5 -286t-173.5 -118q-60 0 -97 43.5t-23 103.5q8 34 26.5 92.5 t29.5 102t11 74.5q0 49 -26.5 81.5t-75.5 32.5q-61 0 -103.5 -56.5t-42.5 -139.5q0 -72 24 -121l-98 -414q-24 -100 -7 -254h-183q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960z" />
-<glyph unicode="&#xf0d4;" d="M678 -57q0 -38 -10 -71h-380q-95 0 -171.5 56.5t-103.5 147.5q24 45 69 77.5t100 49.5t107 24t107 7q32 0 49 -2q6 -4 30.5 -21t33 -23t31 -23t32 -25.5t27.5 -25.5t26.5 -29.5t21 -30.5t17.5 -34.5t9.5 -36t4.5 -40.5zM385 294q-234 -7 -385 -85v433q103 -118 273 -118 q32 0 70 5q-21 -61 -21 -86q0 -67 63 -149zM558 805q0 -100 -43.5 -160.5t-140.5 -60.5q-51 0 -97 26t-78 67.5t-56 93.5t-35.5 104t-11.5 99q0 96 51.5 165t144.5 69q66 0 119 -41t84 -104t47 -130t16 -128zM1536 896v-736q0 -119 -84.5 -203.5t-203.5 -84.5h-468 q39 73 39 157q0 66 -22 122.5t-55.5 93t-72 71t-72 59.5t-55.5 54.5t-22 59.5q0 36 23 68t56 61.5t65.5 64.5t55.5 93t23 131t-26.5 145.5t-75.5 118.5q-6 6 -14 11t-12.5 7.5t-10 9.5t-10.5 17h135l135 64h-437q-138 0 -244.5 -38.5t-182.5 -133.5q0 126 81 213t207 87h960 q119 0 203.5 -84.5t84.5 -203.5v-96h-256v256h-128v-256h-256v-128h256v-256h128v256h256z" />
-<glyph unicode="&#xf0d5;" horiz-adv-x="1664" d="M876 71q0 21 -4.5 40.5t-9.5 36t-17.5 34.5t-21 30.5t-26.5 29.5t-27.5 25.5t-32 25.5t-31 23t-33 23t-30.5 21q-17 2 -50 2q-54 0 -106 -7t-108 -25t-98 -46t-69 -75t-27 -107q0 -68 35.5 -121.5t93 -84t120.5 -45.5t127 -15q59 0 112.5 12.5t100.5 39t74.5 73.5 t27.5 110zM756 933q0 60 -16.5 127.5t-47 130.5t-84 104t-119.5 41q-93 0 -144 -69t-51 -165q0 -47 11.5 -99t35.5 -104t56 -93.5t78 -67.5t97 -26q97 0 140.5 60.5t43.5 160.5zM625 1408h437l-135 -79h-135q71 -45 110 -126t39 -169q0 -74 -23 -131.5t-56 -92.5t-66 -64.5 t-56 -61t-23 -67.5q0 -26 16.5 -51t43 -48t58.5 -48t64 -55.5t58.5 -66t43 -85t16.5 -106.5q0 -160 -140 -282q-152 -131 -420 -131q-59 0 -119.5 10t-122 33.5t-108.5 58t-77 89t-30 121.5q0 61 37 135q32 64 96 110.5t145 71t155 36t150 13.5q-64 83 -64 149q0 12 2 23.5 t5 19.5t8 21.5t7 21.5q-40 -5 -70 -5q-149 0 -255.5 98t-106.5 246q0 140 95 250.5t234 141.5q94 20 187 20zM1664 1152v-128h-256v-256h-128v256h-256v128h256v256h128v-256h256z" />
-<glyph unicode="&#xf0d6;" horiz-adv-x="1920" d="M768 384h384v96h-128v448h-114l-148 -137l77 -80q42 37 55 57h2v-288h-128v-96zM1280 640q0 -70 -21 -142t-59.5 -134t-101.5 -101t-138 -39t-138 39t-101.5 101t-59.5 134t-21 142t21 142t59.5 134t101.5 101t138 39t138 -39t101.5 -101t59.5 -134t21 -142zM1792 384 v512q-106 0 -181 75t-75 181h-1152q0 -106 -75 -181t-181 -75v-512q106 0 181 -75t75 -181h1152q0 106 75 181t181 75zM1920 1216v-1152q0 -26 -19 -45t-45 -19h-1792q-26 0 -45 19t-19 45v1152q0 26 19 45t45 19h1792q26 0 45 -19t19 -45z" />
-<glyph unicode="&#xf0d7;" horiz-adv-x="1024" d="M1024 832q0 -26 -19 -45l-448 -448q-19 -19 -45 -19t-45 19l-448 448q-19 19 -19 45t19 45t45 19h896q26 0 45 -19t19 -45z" />
-<glyph unicode="&#xf0d8;" horiz-adv-x="1024" d="M1024 320q0 -26 -19 -45t-45 -19h-896q-26 0 -45 19t-19 45t19 45l448 448q19 19 45 19t45 -19l448 -448q19 -19 19 -45z" />
-<glyph unicode="&#xf0d9;" horiz-adv-x="640" d="M640 1088v-896q0 -26 -19 -45t-45 -19t-45 19l-448 448q-19 19 -19 45t19 45l448 448q19 19 45 19t45 -19t19 -45z" />
-<glyph unicode="&#xf0da;" horiz-adv-x="640" d="M576 640q0 -26 -19 -45l-448 -448q-19 -19 -45 -19t-45 19t-19 45v896q0 26 19 45t45 19t45 -19l448 -448q19 -19 19 -45z" />
-<glyph unicode="&#xf0db;" horiz-adv-x="1664" d="M160 0h608v1152h-640v-1120q0 -13 9.5 -22.5t22.5 -9.5zM1536 32v1120h-640v-1152h608q13 0 22.5 9.5t9.5 22.5zM1664 1248v-1216q0 -66 -47 -113t-113 -47h-1344q-66 0 -113 47t-47 113v1216q0 66 47 113t113 47h1344q66 0 113 -47t47 -113z" />
-<glyph unicode="&#xf0dc;" horiz-adv-x="1024" d="M1024 448q0 -26 -19 -45l-448 -448q-19 -19 -45 -19t-45 19l-448 448q-19 19 -19 45t19 45t45 19h896q26 0 45 -19t19 -45zM1024 832q0 -26 -19 -45t-45 -19h-896q-26 0 -45 19t-19 45t19 45l448 448q19 19 45 19t45 -19l448 -448q19 -19 19 -45z" />
-<glyph unicode="&#xf0dd;" horiz-adv-x="1024" d="M1024 448q0 -26 -19 -45l-448 -448q-19 -19 -45 -19t-45 19l-448 448q-19 19 -19 45t19 45t45 19h896q26 0 45 -19t19 -45z" />
-<glyph unicode="&#xf0de;" horiz-adv-x="1024" d="M1024 832q0 -26 -19 -45t-45 -19h-896q-26 0 -45 19t-19 45t19 45l448 448q19 19 45 19t45 -19l448 -448q19 -19 19 -45z" />
-<glyph unicode="&#xf0e0;" horiz-adv-x="1792" d="M1792 826v-794q0 -66 -47 -113t-113 -47h-1472q-66 0 -113 47t-47 113v794q44 -49 101 -87q362 -246 497 -345q57 -42 92.5 -65.5t94.5 -48t110 -24.5h1h1q51 0 110 24.5t94.5 48t92.5 65.5q170 123 498 345q57 39 100 87zM1792 1120q0 -79 -49 -151t-122 -123 q-376 -261 -468 -325q-10 -7 -42.5 -30.5t-54 -38t-52 -32.5t-57.5 -27t-50 -9h-1h-1q-23 0 -50 9t-57.5 27t-52 32.5t-54 38t-42.5 30.5q-91 64 -262 182.5t-205 142.5q-62 42 -117 115.5t-55 136.5q0 78 41.5 130t118.5 52h1472q65 0 112.5 -47t47.5 -113z" />
-<glyph unicode="&#xf0e1;" d="M349 911v-991h-330v991h330zM370 1217q1 -73 -50.5 -122t-135.5 -49h-2q-82 0 -132 49t-50 122q0 74 51.5 122.5t134.5 48.5t133 -48.5t51 -122.5zM1536 488v-568h-329v530q0 105 -40.5 164.5t-126.5 59.5q-63 0 -105.5 -34.5t-63.5 -85.5q-11 -30 -11 -81v-553h-329 q2 399 2 647t-1 296l-1 48h329v-144h-2q20 32 41 56t56.5 52t87 43.5t114.5 15.5q171 0 275 -113.5t104 -332.5z" />
-<glyph unicode="&#xf0e2;" d="M1536 640q0 -156 -61 -298t-164 -245t-245 -164t-298 -61q-172 0 -327 72.5t-264 204.5q-7 10 -6.5 22.5t8.5 20.5l137 138q10 9 25 9q16 -2 23 -12q73 -95 179 -147t225 -52q104 0 198.5 40.5t163.5 109.5t109.5 163.5t40.5 198.5t-40.5 198.5t-109.5 163.5 t-163.5 109.5t-198.5 40.5q-98 0 -188 -35.5t-160 -101.5l137 -138q31 -30 14 -69q-17 -40 -59 -40h-448q-26 0 -45 19t-19 45v448q0 42 40 59q39 17 69 -14l130 -129q107 101 244.5 156.5t284.5 55.5q156 0 298 -61t245 -164t164 -245t61 -298z" />
-<glyph unicode="&#xf0e3;" horiz-adv-x="1792" d="M1771 0q0 -53 -37 -90l-107 -108q-39 -37 -91 -37q-53 0 -90 37l-363 364q-38 36 -38 90q0 53 43 96l-256 256l-126 -126q-14 -14 -34 -14t-34 14q2 -2 12.5 -12t12.5 -13t10 -11.5t10 -13.5t6 -13.5t5.5 -16.5t1.5 -18q0 -38 -28 -68q-3 -3 -16.5 -18t-19 -20.5 t-18.5 -16.5t-22 -15.5t-22 -9t-26 -4.5q-40 0 -68 28l-408 408q-28 28 -28 68q0 13 4.5 26t9 22t15.5 22t16.5 18.5t20.5 19t18 16.5q30 28 68 28q10 0 18 -1.5t16.5 -5.5t13.5 -6t13.5 -10t11.5 -10t13 -12.5t12 -12.5q-14 14 -14 34t14 34l348 348q14 14 34 14t34 -14 q-2 2 -12.5 12t-12.5 13t-10 11.5t-10 13.5t-6 13.5t-5.5 16.5t-1.5 18q0 38 28 68q3 3 16.5 18t19 20.5t18.5 16.5t22 15.5t22 9t26 4.5q40 0 68 -28l408 -408q28 -28 28 -68q0 -13 -4.5 -26t-9 -22t-15.5 -22t-16.5 -18.5t-20.5 -19t-18 -16.5q-30 -28 -68 -28 q-10 0 -18 1.5t-16.5 5.5t-13.5 6t-13.5 10t-11.5 10t-13 12.5t-12 12.5q14 -14 14 -34t-14 -34l-126 -126l256 -256q43 43 96 43q52 0 91 -37l363 -363q37 -39 37 -91z" />
-<glyph unicode="&#xf0e4;" horiz-adv-x="1792" d="M384 384q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM576 832q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1004 351l101 382q6 26 -7.5 48.5t-38.5 29.5 t-48 -6.5t-30 -39.5l-101 -382q-60 -5 -107 -43.5t-63 -98.5q-20 -77 20 -146t117 -89t146 20t89 117q16 60 -6 117t-72 91zM1664 384q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1024 1024q0 53 -37.5 90.5 t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1472 832q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1792 384q0 -261 -141 -483q-19 -29 -54 -29h-1402q-35 0 -54 29 q-141 221 -141 483q0 182 71 348t191 286t286 191t348 71t348 -71t286 -191t191 -286t71 -348z" />
-<glyph unicode="&#xf0e5;" horiz-adv-x="1792" d="M896 1152q-204 0 -381.5 -69.5t-282 -187.5t-104.5 -255q0 -112 71.5 -213.5t201.5 -175.5l87 -50l-27 -96q-24 -91 -70 -172q152 63 275 171l43 38l57 -6q69 -8 130 -8q204 0 381.5 69.5t282 187.5t104.5 255t-104.5 255t-282 187.5t-381.5 69.5zM1792 640 q0 -174 -120 -321.5t-326 -233t-450 -85.5q-70 0 -145 8q-198 -175 -460 -242q-49 -14 -114 -22h-5q-15 0 -27 10.5t-16 27.5v1q-3 4 -0.5 12t2 10t4.5 9.5l6 9t7 8.5t8 9q7 8 31 34.5t34.5 38t31 39.5t32.5 51t27 59t26 76q-157 89 -247.5 220t-90.5 281q0 174 120 321.5 t326 233t450 85.5t450 -85.5t326 -233t120 -321.5z" />
-<glyph unicode="&#xf0e6;" horiz-adv-x="1792" d="M704 1152q-153 0 -286 -52t-211.5 -141t-78.5 -191q0 -82 53 -158t149 -132l97 -56l-35 -84q34 20 62 39l44 31l53 -10q78 -14 153 -14q153 0 286 52t211.5 141t78.5 191t-78.5 191t-211.5 141t-286 52zM704 1280q191 0 353.5 -68.5t256.5 -186.5t94 -257t-94 -257 t-256.5 -186.5t-353.5 -68.5q-86 0 -176 16q-124 -88 -278 -128q-36 -9 -86 -16h-3q-11 0 -20.5 8t-11.5 21q-1 3 -1 6.5t0.5 6.5t2 6l2.5 5t3.5 5.5t4 5t4.5 5t4 4.5q5 6 23 25t26 29.5t22.5 29t25 38.5t20.5 44q-124 72 -195 177t-71 224q0 139 94 257t256.5 186.5 t353.5 68.5zM1526 111q10 -24 20.5 -44t25 -38.5t22.5 -29t26 -29.5t23 -25q1 -1 4 -4.5t4.5 -5t4 -5t3.5 -5.5l2.5 -5t2 -6t0.5 -6.5t-1 -6.5q-3 -14 -13 -22t-22 -7q-50 7 -86 16q-154 40 -278 128q-90 -16 -176 -16q-271 0 -472 132q58 -4 88 -4q161 0 309 45t264 129 q125 92 192 212t67 254q0 77 -23 152q129 -71 204 -178t75 -230q0 -120 -71 -224.5t-195 -176.5z" />
-<glyph unicode="&#xf0e7;" horiz-adv-x="896" d="M885 970q18 -20 7 -44l-540 -1157q-13 -25 -42 -25q-4 0 -14 2q-17 5 -25.5 19t-4.5 30l197 808l-406 -101q-4 -1 -12 -1q-18 0 -31 11q-18 15 -13 39l201 825q4 14 16 23t28 9h328q19 0 32 -12.5t13 -29.5q0 -8 -5 -18l-171 -463l396 98q8 2 12 2q19 0 34 -15z" />
-<glyph unicode="&#xf0e8;" horiz-adv-x="1792" d="M1792 288v-320q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v320q0 40 28 68t68 28h96v192h-512v-192h96q40 0 68 -28t28 -68v-320q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v320q0 40 28 68t68 28h96v192h-512v-192h96q40 0 68 -28t28 -68v-320 q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v320q0 40 28 68t68 28h96v192q0 52 38 90t90 38h512v192h-96q-40 0 -68 28t-28 68v320q0 40 28 68t68 28h320q40 0 68 -28t28 -68v-320q0 -40 -28 -68t-68 -28h-96v-192h512q52 0 90 -38t38 -90v-192h96q40 0 68 -28t28 -68 z" />
-<glyph unicode="&#xf0e9;" horiz-adv-x="1664" d="M896 708v-580q0 -104 -76 -180t-180 -76t-180 76t-76 180q0 26 19 45t45 19t45 -19t19 -45q0 -50 39 -89t89 -39t89 39t39 89v580q33 11 64 11t64 -11zM1664 681q0 -13 -9.5 -22.5t-22.5 -9.5q-11 0 -23 10q-49 46 -93 69t-102 23q-68 0 -128 -37t-103 -97 q-7 -10 -17.5 -28t-14.5 -24q-11 -17 -28 -17q-18 0 -29 17q-4 6 -14.5 24t-17.5 28q-43 60 -102.5 97t-127.5 37t-127.5 -37t-102.5 -97q-7 -10 -17.5 -28t-14.5 -24q-11 -17 -29 -17q-17 0 -28 17q-4 6 -14.5 24t-17.5 28q-43 60 -103 97t-128 37q-58 0 -102 -23t-93 -69 q-12 -10 -23 -10q-13 0 -22.5 9.5t-9.5 22.5q0 5 1 7q45 183 172.5 319.5t298 204.5t360.5 68q140 0 274.5 -40t246.5 -113.5t194.5 -187t115.5 -251.5q1 -2 1 -7zM896 1408v-98q-42 2 -64 2t-64 -2v98q0 26 19 45t45 19t45 -19t19 -45z" />
-<glyph unicode="&#xf0ea;" horiz-adv-x="1792" d="M768 -128h896v640h-416q-40 0 -68 28t-28 68v416h-384v-1152zM1024 1312v64q0 13 -9.5 22.5t-22.5 9.5h-704q-13 0 -22.5 -9.5t-9.5 -22.5v-64q0 -13 9.5 -22.5t22.5 -9.5h704q13 0 22.5 9.5t9.5 22.5zM1280 640h299l-299 299v-299zM1792 512v-672q0 -40 -28 -68t-68 -28 h-960q-40 0 -68 28t-28 68v160h-544q-40 0 -68 28t-28 68v1344q0 40 28 68t68 28h1088q40 0 68 -28t28 -68v-328q21 -13 36 -28l408 -408q28 -28 48 -76t20 -88z" />
-<glyph unicode="&#xf0eb;" horiz-adv-x="1024" d="M736 960q0 -13 -9.5 -22.5t-22.5 -9.5t-22.5 9.5t-9.5 22.5q0 46 -54 71t-106 25q-13 0 -22.5 9.5t-9.5 22.5t9.5 22.5t22.5 9.5q50 0 99.5 -16t87 -54t37.5 -90zM896 960q0 72 -34.5 134t-90 101.5t-123 62t-136.5 22.5t-136.5 -22.5t-123 -62t-90 -101.5t-34.5 -134 q0 -101 68 -180q10 -11 30.5 -33t30.5 -33q128 -153 141 -298h228q13 145 141 298q10 11 30.5 33t30.5 33q68 79 68 180zM1024 960q0 -155 -103 -268q-45 -49 -74.5 -87t-59.5 -95.5t-34 -107.5q47 -28 47 -82q0 -37 -25 -64q25 -27 25 -64q0 -52 -45 -81q13 -23 13 -47 q0 -46 -31.5 -71t-77.5 -25q-20 -44 -60 -70t-87 -26t-87 26t-60 70q-46 0 -77.5 25t-31.5 71q0 24 13 47q-45 29 -45 81q0 37 25 64q-25 27 -25 64q0 54 47 82q-4 50 -34 107.5t-59.5 95.5t-74.5 87q-103 113 -103 268q0 99 44.5 184.5t117 142t164 89t186.5 32.5 t186.5 -32.5t164 -89t117 -142t44.5 -184.5z" />
-<glyph unicode="&#xf0ec;" horiz-adv-x="1792" d="M1792 352v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1376v-192q0 -13 -9.5 -22.5t-22.5 -9.5q-12 0 -24 10l-319 320q-9 9 -9 22q0 14 9 23l320 320q9 9 23 9q13 0 22.5 -9.5t9.5 -22.5v-192h1376q13 0 22.5 -9.5t9.5 -22.5zM1792 896q0 -14 -9 -23l-320 -320q-9 -9 -23 -9 q-13 0 -22.5 9.5t-9.5 22.5v192h-1376q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1376v192q0 14 9 23t23 9q12 0 24 -10l319 -319q9 -9 9 -23z" />
-<glyph unicode="&#xf0ed;" horiz-adv-x="1920" d="M1280 608q0 14 -9 23t-23 9h-224v352q0 13 -9.5 22.5t-22.5 9.5h-192q-13 0 -22.5 -9.5t-9.5 -22.5v-352h-224q-13 0 -22.5 -9.5t-9.5 -22.5q0 -14 9 -23l352 -352q9 -9 23 -9t23 9l351 351q10 12 10 24zM1920 384q0 -159 -112.5 -271.5t-271.5 -112.5h-1088 q-185 0 -316.5 131.5t-131.5 316.5q0 130 70 240t188 165q-2 30 -2 43q0 212 150 362t362 150q156 0 285.5 -87t188.5 -231q71 62 166 62q106 0 181 -75t75 -181q0 -76 -41 -138q130 -31 213.5 -135.5t83.5 -238.5z" />
-<glyph unicode="&#xf0ee;" horiz-adv-x="1920" d="M1280 672q0 14 -9 23l-352 352q-9 9 -23 9t-23 -9l-351 -351q-10 -12 -10 -24q0 -14 9 -23t23 -9h224v-352q0 -13 9.5 -22.5t22.5 -9.5h192q13 0 22.5 9.5t9.5 22.5v352h224q13 0 22.5 9.5t9.5 22.5zM1920 384q0 -159 -112.5 -271.5t-271.5 -112.5h-1088 q-185 0 -316.5 131.5t-131.5 316.5q0 130 70 240t188 165q-2 30 -2 43q0 212 150 362t362 150q156 0 285.5 -87t188.5 -231q71 62 166 62q106 0 181 -75t75 -181q0 -76 -41 -138q130 -31 213.5 -135.5t83.5 -238.5z" />
-<glyph unicode="&#xf0f0;" horiz-adv-x="1408" d="M384 192q0 -26 -19 -45t-45 -19t-45 19t-19 45t19 45t45 19t45 -19t19 -45zM1408 131q0 -121 -73 -190t-194 -69h-874q-121 0 -194 69t-73 190q0 68 5.5 131t24 138t47.5 132.5t81 103t120 60.5q-22 -52 -22 -120v-203q-58 -20 -93 -70t-35 -111q0 -80 56 -136t136 -56 t136 56t56 136q0 61 -35.5 111t-92.5 70v203q0 62 25 93q132 -104 295 -104t295 104q25 -31 25 -93v-64q-106 0 -181 -75t-75 -181v-89q-32 -29 -32 -71q0 -40 28 -68t68 -28t68 28t28 68q0 42 -32 71v89q0 52 38 90t90 38t90 -38t38 -90v-89q-32 -29 -32 -71q0 -40 28 -68 t68 -28t68 28t28 68q0 42 -32 71v89q0 68 -34.5 127.5t-93.5 93.5q0 10 0.5 42.5t0 48t-2.5 41.5t-7 47t-13 40q68 -15 120 -60.5t81 -103t47.5 -132.5t24 -138t5.5 -131zM1088 1024q0 -159 -112.5 -271.5t-271.5 -112.5t-271.5 112.5t-112.5 271.5t112.5 271.5t271.5 112.5 t271.5 -112.5t112.5 -271.5z" />
-<glyph unicode="&#xf0f1;" horiz-adv-x="1408" d="M1280 832q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1408 832q0 -62 -35.5 -111t-92.5 -70v-395q0 -159 -131.5 -271.5t-316.5 -112.5t-316.5 112.5t-131.5 271.5v132q-164 20 -274 128t-110 252v512q0 26 19 45t45 19q6 0 16 -2q17 30 47 48 t65 18q53 0 90.5 -37.5t37.5 -90.5t-37.5 -90.5t-90.5 -37.5q-33 0 -64 18v-402q0 -106 94 -181t226 -75t226 75t94 181v402q-31 -18 -64 -18q-53 0 -90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5q35 0 65 -18t47 -48q10 2 16 2q26 0 45 -19t19 -45v-512q0 -144 -110 -252 t-274 -128v-132q0 -106 94 -181t226 -75t226 75t94 181v395q-57 21 -92.5 70t-35.5 111q0 80 56 136t136 56t136 -56t56 -136z" />
-<glyph unicode="&#xf0f2;" horiz-adv-x="1792" d="M640 1152h512v128h-512v-128zM288 1152v-1280h-64q-92 0 -158 66t-66 158v832q0 92 66 158t158 66h64zM1408 1152v-1280h-1024v1280h128v160q0 40 28 68t68 28h576q40 0 68 -28t28 -68v-160h128zM1792 928v-832q0 -92 -66 -158t-158 -66h-64v1280h64q92 0 158 -66 t66 -158z" />
-<glyph unicode="&#xf0f3;" horiz-adv-x="1664" d="M848 -160q0 16 -16 16q-59 0 -101.5 42.5t-42.5 101.5q0 16 -16 16t-16 -16q0 -73 51.5 -124.5t124.5 -51.5q16 0 16 16zM1664 128q0 -52 -38 -90t-90 -38h-448q0 -106 -75 -181t-181 -75t-181 75t-75 181h-448q-52 0 -90 38t-38 90q190 161 287 397.5t97 498.5 q0 165 96 262t264 117q-8 18 -8 37q0 40 28 68t68 28t68 -28t28 -68q0 -19 -8 -37q168 -20 264 -117t96 -262q0 -262 97 -498.5t287 -397.5z" />
-<glyph unicode="&#xf0f4;" horiz-adv-x="1920" d="M1664 896q0 80 -56 136t-136 56h-64v-384h64q80 0 136 56t56 136zM0 128h1792q0 -106 -75 -181t-181 -75h-1280q-106 0 -181 75t-75 181zM1856 896q0 -159 -112.5 -271.5t-271.5 -112.5h-64v-32q0 -92 -66 -158t-158 -66h-704q-92 0 -158 66t-66 158v736q0 26 19 45 t45 19h1152q159 0 271.5 -112.5t112.5 -271.5z" />
-<glyph unicode="&#xf0f5;" horiz-adv-x="1408" d="M640 1472v-640q0 -61 -35.5 -111t-92.5 -70v-779q0 -52 -38 -90t-90 -38h-128q-52 0 -90 38t-38 90v779q-57 20 -92.5 70t-35.5 111v640q0 26 19 45t45 19t45 -19t19 -45v-416q0 -26 19 -45t45 -19t45 19t19 45v416q0 26 19 45t45 19t45 -19t19 -45v-416q0 -26 19 -45 t45 -19t45 19t19 45v416q0 26 19 45t45 19t45 -19t19 -45zM1408 1472v-1600q0 -52 -38 -90t-90 -38h-128q-52 0 -90 38t-38 90v512h-224q-13 0 -22.5 9.5t-9.5 22.5v800q0 132 94 226t226 94h256q26 0 45 -19t19 -45z" />
-<glyph unicode="&#xf0f6;" horiz-adv-x="1280" d="M1024 352v-64q0 -14 -9 -23t-23 -9h-704q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h704q14 0 23 -9t9 -23zM1024 608v-64q0 -14 -9 -23t-23 -9h-704q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h704q14 0 23 -9t9 -23zM128 0h1024v768h-416q-40 0 -68 28t-28 68v416h-512v-1280z M768 896h376q-10 29 -22 41l-313 313q-12 12 -41 22v-376zM1280 864v-896q0 -40 -28 -68t-68 -28h-1088q-40 0 -68 28t-28 68v1344q0 40 28 68t68 28h640q40 0 88 -20t76 -48l312 -312q28 -28 48 -76t20 -88z" />
-<glyph unicode="&#xf0f7;" horiz-adv-x="1408" d="M384 224v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M1152 224v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM896 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 992v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M1152 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM896 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 992v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 1248v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M1152 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM896 992v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 1248v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM1152 992v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M896 1248v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM1152 1248v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M896 -128h384v1536h-1152v-1536h384v224q0 13 9.5 22.5t22.5 9.5h320q13 0 22.5 -9.5t9.5 -22.5v-224zM1408 1472v-1664q0 -26 -19 -45t-45 -19h-1280q-26 0 -45 19t-19 45v1664q0 26 19 45t45 19h1280q26 0 45 -19t19 -45z" />
-<glyph unicode="&#xf0f8;" horiz-adv-x="1408" d="M384 224v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M1152 224v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM896 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM1152 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M896 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM1152 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M896 -128h384v1152h-256v-32q0 -40 -28 -68t-68 -28h-448q-40 0 -68 28t-28 68v32h-256v-1152h384v224q0 13 9.5 22.5t22.5 9.5h320q13 0 22.5 -9.5t9.5 -22.5v-224zM896 1056v320q0 13 -9.5 22.5t-22.5 9.5h-64q-13 0 -22.5 -9.5t-9.5 -22.5v-96h-128v96q0 13 -9.5 22.5 t-22.5 9.5h-64q-13 0 -22.5 -9.5t-9.5 -22.5v-320q0 -13 9.5 -22.5t22.5 -9.5h64q13 0 22.5 9.5t9.5 22.5v96h128v-96q0 -13 9.5 -22.5t22.5 -9.5h64q13 0 22.5 9.5t9.5 22.5zM1408 1088v-1280q0 -26 -19 -45t-45 -19h-1280q-26 0 -45 19t-19 45v1280q0 26 19 45t45 19h320 v288q0 40 28 68t68 28h448q40 0 68 -28t28 -68v-288h320q26 0 45 -19t19 -45z" />
-<glyph unicode="&#xf0f9;" horiz-adv-x="1920" d="M640 128q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM256 640h384v256h-158q-14 -2 -22 -9l-195 -195q-7 -12 -9 -22v-30zM1536 128q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5 t90.5 37.5t37.5 90.5zM1664 800v192q0 14 -9 23t-23 9h-224v224q0 14 -9 23t-23 9h-192q-14 0 -23 -9t-9 -23v-224h-224q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h224v-224q0 -14 9 -23t23 -9h192q14 0 23 9t9 23v224h224q14 0 23 9t9 23zM1920 1344v-1152 q0 -26 -19 -45t-45 -19h-192q0 -106 -75 -181t-181 -75t-181 75t-75 181h-384q0 -106 -75 -181t-181 -75t-181 75t-75 181h-128q-26 0 -45 19t-19 45t19 45t45 19v416q0 26 13 58t32 51l198 198q19 19 51 32t58 13h160v320q0 26 19 45t45 19h1152q26 0 45 -19t19 -45z" />
-<glyph unicode="&#xf0fa;" horiz-adv-x="1792" d="M1280 416v192q0 14 -9 23t-23 9h-224v224q0 14 -9 23t-23 9h-192q-14 0 -23 -9t-9 -23v-224h-224q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h224v-224q0 -14 9 -23t23 -9h192q14 0 23 9t9 23v224h224q14 0 23 9t9 23zM640 1152h512v128h-512v-128zM256 1152v-1280h-32 q-92 0 -158 66t-66 158v832q0 92 66 158t158 66h32zM1440 1152v-1280h-1088v1280h160v160q0 40 28 68t68 28h576q40 0 68 -28t28 -68v-160h160zM1792 928v-832q0 -92 -66 -158t-158 -66h-32v1280h32q92 0 158 -66t66 -158z" />
-<glyph unicode="&#xf0fb;" horiz-adv-x="1920" d="M1920 576q-1 -32 -288 -96l-352 -32l-224 -64h-64l-293 -352h69q26 0 45 -4.5t19 -11.5t-19 -11.5t-45 -4.5h-96h-160h-64v32h64v416h-160l-192 -224h-96l-32 32v192h32v32h128v8l-192 24v128l192 24v8h-128v32h-32v192l32 32h96l192 -224h160v416h-64v32h64h160h96 q26 0 45 -4.5t19 -11.5t-19 -11.5t-45 -4.5h-69l293 -352h64l224 -64l352 -32q261 -58 287 -93z" />
-<glyph unicode="&#xf0fc;" horiz-adv-x="1664" d="M640 640v384h-256v-256q0 -53 37.5 -90.5t90.5 -37.5h128zM1664 192v-192h-1152v192l128 192h-128q-159 0 -271.5 112.5t-112.5 271.5v320l-64 64l32 128h480l32 128h960l32 -192l-64 -32v-800z" />
-<glyph unicode="&#xf0fd;" d="M1280 192v896q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-320h-512v320q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-896q0 -26 19 -45t45 -19h128q26 0 45 19t19 45v320h512v-320q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1536 1120v-960 q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
-<glyph unicode="&#xf0fe;" d="M1280 576v128q0 26 -19 45t-45 19h-320v320q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-320h-320q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h320v-320q0 -26 19 -45t45 -19h128q26 0 45 19t19 45v320h320q26 0 45 19t19 45zM1536 1120v-960 q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
-<glyph unicode="&#xf100;" horiz-adv-x="1024" d="M627 160q0 -13 -10 -23l-50 -50q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23t10 23l466 466q10 10 23 10t23 -10l50 -50q10 -10 10 -23t-10 -23l-393 -393l393 -393q10 -10 10 -23zM1011 160q0 -13 -10 -23l-50 -50q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23 t10 23l466 466q10 10 23 10t23 -10l50 -50q10 -10 10 -23t-10 -23l-393 -393l393 -393q10 -10 10 -23z" />
-<glyph unicode="&#xf101;" horiz-adv-x="1024" d="M595 576q0 -13 -10 -23l-466 -466q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l393 393l-393 393q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l466 -466q10 -10 10 -23zM979 576q0 -13 -10 -23l-466 -466q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23 l393 393l-393 393q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l466 -466q10 -10 10 -23z" />
-<glyph unicode="&#xf102;" horiz-adv-x="1152" d="M1075 224q0 -13 -10 -23l-50 -50q-10 -10 -23 -10t-23 10l-393 393l-393 -393q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l466 466q10 10 23 10t23 -10l466 -466q10 -10 10 -23zM1075 608q0 -13 -10 -23l-50 -50q-10 -10 -23 -10t-23 10l-393 393l-393 -393 q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l466 466q10 10 23 10t23 -10l466 -466q10 -10 10 -23z" />
-<glyph unicode="&#xf103;" horiz-adv-x="1152" d="M1075 672q0 -13 -10 -23l-466 -466q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l393 -393l393 393q10 10 23 10t23 -10l50 -50q10 -10 10 -23zM1075 1056q0 -13 -10 -23l-466 -466q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23 t10 23l50 50q10 10 23 10t23 -10l393 -393l393 393q10 10 23 10t23 -10l50 -50q10 -10 10 -23z" />
-<glyph unicode="&#xf104;" horiz-adv-x="640" d="M627 992q0 -13 -10 -23l-393 -393l393 -393q10 -10 10 -23t-10 -23l-50 -50q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23t10 23l466 466q10 10 23 10t23 -10l50 -50q10 -10 10 -23z" />
-<glyph unicode="&#xf105;" horiz-adv-x="640" d="M595 576q0 -13 -10 -23l-466 -466q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l393 393l-393 393q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l466 -466q10 -10 10 -23z" />
-<glyph unicode="&#xf106;" horiz-adv-x="1152" d="M1075 352q0 -13 -10 -23l-50 -50q-10 -10 -23 -10t-23 10l-393 393l-393 -393q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l466 466q10 10 23 10t23 -10l466 -466q10 -10 10 -23z" />
-<glyph unicode="&#xf107;" horiz-adv-x="1152" d="M1075 800q0 -13 -10 -23l-466 -466q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l393 -393l393 393q10 10 23 10t23 -10l50 -50q10 -10 10 -23z" />
-<glyph unicode="&#xf108;" horiz-adv-x="1920" d="M1792 544v832q0 13 -9.5 22.5t-22.5 9.5h-1600q-13 0 -22.5 -9.5t-9.5 -22.5v-832q0 -13 9.5 -22.5t22.5 -9.5h1600q13 0 22.5 9.5t9.5 22.5zM1920 1376v-1088q0 -66 -47 -113t-113 -47h-544q0 -37 16 -77.5t32 -71t16 -43.5q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19 t-19 45q0 14 16 44t32 70t16 78h-544q-66 0 -113 47t-47 113v1088q0 66 47 113t113 47h1600q66 0 113 -47t47 -113z" />
-<glyph unicode="&#xf109;" horiz-adv-x="1920" d="M416 256q-66 0 -113 47t-47 113v704q0 66 47 113t113 47h1088q66 0 113 -47t47 -113v-704q0 -66 -47 -113t-113 -47h-1088zM384 1120v-704q0 -13 9.5 -22.5t22.5 -9.5h1088q13 0 22.5 9.5t9.5 22.5v704q0 13 -9.5 22.5t-22.5 9.5h-1088q-13 0 -22.5 -9.5t-9.5 -22.5z M1760 192h160v-96q0 -40 -47 -68t-113 -28h-1600q-66 0 -113 28t-47 68v96h160h1600zM1040 96q16 0 16 16t-16 16h-160q-16 0 -16 -16t16 -16h160z" />
-<glyph unicode="&#xf10a;" horiz-adv-x="1152" d="M640 128q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1024 288v960q0 13 -9.5 22.5t-22.5 9.5h-832q-13 0 -22.5 -9.5t-9.5 -22.5v-960q0 -13 9.5 -22.5t22.5 -9.5h832q13 0 22.5 9.5t9.5 22.5zM1152 1248v-1088q0 -66 -47 -113t-113 -47h-832 q-66 0 -113 47t-47 113v1088q0 66 47 113t113 47h832q66 0 113 -47t47 -113z" />
-<glyph unicode="&#xf10b;" horiz-adv-x="768" d="M464 128q0 33 -23.5 56.5t-56.5 23.5t-56.5 -23.5t-23.5 -56.5t23.5 -56.5t56.5 -23.5t56.5 23.5t23.5 56.5zM672 288v704q0 13 -9.5 22.5t-22.5 9.5h-512q-13 0 -22.5 -9.5t-9.5 -22.5v-704q0 -13 9.5 -22.5t22.5 -9.5h512q13 0 22.5 9.5t9.5 22.5zM480 1136 q0 16 -16 16h-160q-16 0 -16 -16t16 -16h160q16 0 16 16zM768 1152v-1024q0 -52 -38 -90t-90 -38h-512q-52 0 -90 38t-38 90v1024q0 52 38 90t90 38h512q52 0 90 -38t38 -90z" />
-<glyph unicode="&#xf10c;" d="M768 1184q-148 0 -273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273t-73 273t-198 198t-273 73zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103 t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf10d;" horiz-adv-x="1664" d="M768 576v-384q0 -80 -56 -136t-136 -56h-384q-80 0 -136 56t-56 136v704q0 104 40.5 198.5t109.5 163.5t163.5 109.5t198.5 40.5h64q26 0 45 -19t19 -45v-128q0 -26 -19 -45t-45 -19h-64q-106 0 -181 -75t-75 -181v-32q0 -40 28 -68t68 -28h224q80 0 136 -56t56 -136z M1664 576v-384q0 -80 -56 -136t-136 -56h-384q-80 0 -136 56t-56 136v704q0 104 40.5 198.5t109.5 163.5t163.5 109.5t198.5 40.5h64q26 0 45 -19t19 -45v-128q0 -26 -19 -45t-45 -19h-64q-106 0 -181 -75t-75 -181v-32q0 -40 28 -68t68 -28h224q80 0 136 -56t56 -136z" />
-<glyph unicode="&#xf10e;" horiz-adv-x="1664" d="M768 1216v-704q0 -104 -40.5 -198.5t-109.5 -163.5t-163.5 -109.5t-198.5 -40.5h-64q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h64q106 0 181 75t75 181v32q0 40 -28 68t-68 28h-224q-80 0 -136 56t-56 136v384q0 80 56 136t136 56h384q80 0 136 -56t56 -136zM1664 1216 v-704q0 -104 -40.5 -198.5t-109.5 -163.5t-163.5 -109.5t-198.5 -40.5h-64q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h64q106 0 181 75t75 181v32q0 40 -28 68t-68 28h-224q-80 0 -136 56t-56 136v384q0 80 56 136t136 56h384q80 0 136 -56t56 -136z" />
-<glyph unicode="&#xf110;" horiz-adv-x="1568" d="M496 192q0 -60 -42.5 -102t-101.5 -42q-60 0 -102 42t-42 102t42 102t102 42q59 0 101.5 -42t42.5 -102zM928 0q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM320 640q0 -66 -47 -113t-113 -47t-113 47t-47 113 t47 113t113 47t113 -47t47 -113zM1360 192q0 -46 -33 -79t-79 -33t-79 33t-33 79t33 79t79 33t79 -33t33 -79zM528 1088q0 -73 -51.5 -124.5t-124.5 -51.5t-124.5 51.5t-51.5 124.5t51.5 124.5t124.5 51.5t124.5 -51.5t51.5 -124.5zM992 1280q0 -80 -56 -136t-136 -56 t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM1536 640q0 -40 -28 -68t-68 -28t-68 28t-28 68t28 68t68 28t68 -28t28 -68zM1328 1088q0 -33 -23.5 -56.5t-56.5 -23.5t-56.5 23.5t-23.5 56.5t23.5 56.5t56.5 23.5t56.5 -23.5t23.5 -56.5z" />
-<glyph unicode="&#xf111;" d="M1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf112;" horiz-adv-x="1792" d="M1792 416q0 -166 -127 -451q-3 -7 -10.5 -24t-13.5 -30t-13 -22q-12 -17 -28 -17q-15 0 -23.5 10t-8.5 25q0 9 2.5 26.5t2.5 23.5q5 68 5 123q0 101 -17.5 181t-48.5 138.5t-80 101t-105.5 69.5t-133 42.5t-154 21.5t-175.5 6h-224v-256q0 -26 -19 -45t-45 -19t-45 19 l-512 512q-19 19 -19 45t19 45l512 512q19 19 45 19t45 -19t19 -45v-256h224q713 0 875 -403q53 -134 53 -333z" />
-<glyph unicode="&#xf113;" horiz-adv-x="1664" d="M640 320q0 -40 -12.5 -82t-43 -76t-72.5 -34t-72.5 34t-43 76t-12.5 82t12.5 82t43 76t72.5 34t72.5 -34t43 -76t12.5 -82zM1280 320q0 -40 -12.5 -82t-43 -76t-72.5 -34t-72.5 34t-43 76t-12.5 82t12.5 82t43 76t72.5 34t72.5 -34t43 -76t12.5 -82zM1440 320 q0 120 -69 204t-187 84q-41 0 -195 -21q-71 -11 -157 -11t-157 11q-152 21 -195 21q-118 0 -187 -84t-69 -204q0 -88 32 -153.5t81 -103t122 -60t140 -29.5t149 -7h168q82 0 149 7t140 29.5t122 60t81 103t32 153.5zM1664 496q0 -207 -61 -331q-38 -77 -105.5 -133t-141 -86 t-170 -47.5t-171.5 -22t-167 -4.5q-78 0 -142 3t-147.5 12.5t-152.5 30t-137 51.5t-121 81t-86 115q-62 123 -62 331q0 237 136 396q-27 82 -27 170q0 116 51 218q108 0 190 -39.5t189 -123.5q147 35 309 35q148 0 280 -32q105 82 187 121t189 39q51 -102 51 -218 q0 -87 -27 -168q136 -160 136 -398z" />
-<glyph unicode="&#xf114;" horiz-adv-x="1664" d="M1536 224v704q0 40 -28 68t-68 28h-704q-40 0 -68 28t-28 68v64q0 40 -28 68t-68 28h-320q-40 0 -68 -28t-28 -68v-960q0 -40 28 -68t68 -28h1216q40 0 68 28t28 68zM1664 928v-704q0 -92 -66 -158t-158 -66h-1216q-92 0 -158 66t-66 158v960q0 92 66 158t158 66h320 q92 0 158 -66t66 -158v-32h672q92 0 158 -66t66 -158z" />
-<glyph unicode="&#xf115;" horiz-adv-x="1920" d="M1781 605q0 35 -53 35h-1088q-40 0 -85.5 -21.5t-71.5 -52.5l-294 -363q-18 -24 -18 -40q0 -35 53 -35h1088q40 0 86 22t71 53l294 363q18 22 18 39zM640 768h768v160q0 40 -28 68t-68 28h-576q-40 0 -68 28t-28 68v64q0 40 -28 68t-68 28h-320q-40 0 -68 -28t-28 -68 v-853l256 315q44 53 116 87.5t140 34.5zM1909 605q0 -62 -46 -120l-295 -363q-43 -53 -116 -87.5t-140 -34.5h-1088q-92 0 -158 66t-66 158v960q0 92 66 158t158 66h320q92 0 158 -66t66 -158v-32h544q92 0 158 -66t66 -158v-160h192q54 0 99 -24.5t67 -70.5q15 -32 15 -68z " />
-<glyph unicode="&#xf116;" horiz-adv-x="1792" />
-<glyph unicode="&#xf117;" horiz-adv-x="1792" />
-<glyph unicode="&#xf118;" d="M1134 461q-37 -121 -138 -195t-228 -74t-228 74t-138 195q-8 25 4 48.5t38 31.5q25 8 48.5 -4t31.5 -38q25 -80 92.5 -129.5t151.5 -49.5t151.5 49.5t92.5 129.5q8 26 32 38t49 4t37 -31.5t4 -48.5zM640 896q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5 t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1152 896q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1408 640q0 130 -51 248.5t-136.5 204t-204 136.5t-248.5 51t-248.5 -51t-204 -136.5t-136.5 -204t-51 -248.5 t51 -248.5t136.5 -204t204 -136.5t248.5 -51t248.5 51t204 136.5t136.5 204t51 248.5zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf119;" d="M1134 307q8 -25 -4 -48.5t-37 -31.5t-49 4t-32 38q-25 80 -92.5 129.5t-151.5 49.5t-151.5 -49.5t-92.5 -129.5q-8 -26 -31.5 -38t-48.5 -4q-26 8 -38 31.5t-4 48.5q37 121 138 195t228 74t228 -74t138 -195zM640 896q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5 t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1152 896q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1408 640q0 130 -51 248.5t-136.5 204t-204 136.5t-248.5 51t-248.5 -51t-204 -136.5t-136.5 -204 t-51 -248.5t51 -248.5t136.5 -204t204 -136.5t248.5 -51t248.5 51t204 136.5t136.5 204t51 248.5zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf11a;" d="M1152 448q0 -26 -19 -45t-45 -19h-640q-26 0 -45 19t-19 45t19 45t45 19h640q26 0 45 -19t19 -45zM640 896q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1152 896q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5 t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1408 640q0 130 -51 248.5t-136.5 204t-204 136.5t-248.5 51t-248.5 -51t-204 -136.5t-136.5 -204t-51 -248.5t51 -248.5t136.5 -204t204 -136.5t248.5 -51t248.5 51t204 136.5t136.5 204t51 248.5zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf11b;" horiz-adv-x="1920" d="M832 448v128q0 14 -9 23t-23 9h-192v192q0 14 -9 23t-23 9h-128q-14 0 -23 -9t-9 -23v-192h-192q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h192v-192q0 -14 9 -23t23 -9h128q14 0 23 9t9 23v192h192q14 0 23 9t9 23zM1408 384q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5 t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1664 640q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1920 512q0 -212 -150 -362t-362 -150q-192 0 -338 128h-220q-146 -128 -338 -128q-212 0 -362 150 t-150 362t150 362t362 150h896q212 0 362 -150t150 -362z" />
-<glyph unicode="&#xf11c;" horiz-adv-x="1920" d="M384 368v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM512 624v-96q0 -16 -16 -16h-224q-16 0 -16 16v96q0 16 16 16h224q16 0 16 -16zM384 880v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM1408 368v-96q0 -16 -16 -16 h-864q-16 0 -16 16v96q0 16 16 16h864q16 0 16 -16zM768 624v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM640 880v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM1024 624v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16 h96q16 0 16 -16zM896 880v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM1280 624v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM1664 368v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM1152 880v-96 q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM1408 880v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM1664 880v-352q0 -16 -16 -16h-224q-16 0 -16 16v96q0 16 16 16h112v240q0 16 16 16h96q16 0 16 -16zM1792 128v896h-1664v-896 h1664zM1920 1024v-896q0 -53 -37.5 -90.5t-90.5 -37.5h-1664q-53 0 -90.5 37.5t-37.5 90.5v896q0 53 37.5 90.5t90.5 37.5h1664q53 0 90.5 -37.5t37.5 -90.5z" />
-<glyph unicode="&#xf11d;" horiz-adv-x="1792" d="M1664 491v616q-169 -91 -306 -91q-82 0 -145 32q-100 49 -184 76.5t-178 27.5q-173 0 -403 -127v-599q245 113 433 113q55 0 103.5 -7.5t98 -26t77 -31t82.5 -39.5l28 -14q44 -22 101 -22q120 0 293 92zM320 1280q0 -35 -17.5 -64t-46.5 -46v-1266q0 -14 -9 -23t-23 -9 h-64q-14 0 -23 9t-9 23v1266q-29 17 -46.5 46t-17.5 64q0 53 37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1792 1216v-763q0 -39 -35 -57q-10 -5 -17 -9q-218 -116 -369 -116q-88 0 -158 35l-28 14q-64 33 -99 48t-91 29t-114 14q-102 0 -235.5 -44t-228.5 -102 q-15 -9 -33 -9q-16 0 -32 8q-32 19 -32 56v742q0 35 31 55q35 21 78.5 42.5t114 52t152.5 49.5t155 19q112 0 209 -31t209 -86q38 -19 89 -19q122 0 310 112q22 12 31 17q31 16 62 -2q31 -20 31 -55z" />
-<glyph unicode="&#xf11e;" horiz-adv-x="1792" d="M832 536v192q-181 -16 -384 -117v-185q205 96 384 110zM832 954v197q-172 -8 -384 -126v-189q215 111 384 118zM1664 491v184q-235 -116 -384 -71v224q-20 6 -39 15q-5 3 -33 17t-34.5 17t-31.5 15t-34.5 15.5t-32.5 13t-36 12.5t-35 8.5t-39.5 7.5t-39.5 4t-44 2 q-23 0 -49 -3v-222h19q102 0 192.5 -29t197.5 -82q19 -9 39 -15v-188q42 -17 91 -17q120 0 293 92zM1664 918v189q-169 -91 -306 -91q-45 0 -78 8v-196q148 -42 384 90zM320 1280q0 -35 -17.5 -64t-46.5 -46v-1266q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v1266 q-29 17 -46.5 46t-17.5 64q0 53 37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1792 1216v-763q0 -39 -35 -57q-10 -5 -17 -9q-218 -116 -369 -116q-88 0 -158 35l-28 14q-64 33 -99 48t-91 29t-114 14q-102 0 -235.5 -44t-228.5 -102q-15 -9 -33 -9q-16 0 -32 8 q-32 19 -32 56v742q0 35 31 55q35 21 78.5 42.5t114 52t152.5 49.5t155 19q112 0 209 -31t209 -86q38 -19 89 -19q122 0 310 112q22 12 31 17q31 16 62 -2q31 -20 31 -55z" />
-<glyph unicode="&#xf120;" horiz-adv-x="1664" d="M585 553l-466 -466q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l393 393l-393 393q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l466 -466q10 -10 10 -23t-10 -23zM1664 96v-64q0 -14 -9 -23t-23 -9h-960q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h960q14 0 23 -9 t9 -23z" />
-<glyph unicode="&#xf121;" horiz-adv-x="1920" d="M617 137l-50 -50q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23t10 23l466 466q10 10 23 10t23 -10l50 -50q10 -10 10 -23t-10 -23l-393 -393l393 -393q10 -10 10 -23t-10 -23zM1208 1204l-373 -1291q-4 -13 -15.5 -19.5t-23.5 -2.5l-62 17q-13 4 -19.5 15.5t-2.5 24.5 l373 1291q4 13 15.5 19.5t23.5 2.5l62 -17q13 -4 19.5 -15.5t2.5 -24.5zM1865 553l-466 -466q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l393 393l-393 393q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l466 -466q10 -10 10 -23t-10 -23z" />
-<glyph unicode="&#xf122;" horiz-adv-x="1792" d="M640 454v-70q0 -42 -39 -59q-13 -5 -25 -5q-27 0 -45 19l-512 512q-19 19 -19 45t19 45l512 512q29 31 70 14q39 -17 39 -59v-69l-397 -398q-19 -19 -19 -45t19 -45zM1792 416q0 -58 -17 -133.5t-38.5 -138t-48 -125t-40.5 -90.5l-20 -40q-8 -17 -28 -17q-6 0 -9 1 q-25 8 -23 34q43 400 -106 565q-64 71 -170.5 110.5t-267.5 52.5v-251q0 -42 -39 -59q-13 -5 -25 -5q-27 0 -45 19l-512 512q-19 19 -19 45t19 45l512 512q29 31 70 14q39 -17 39 -59v-262q411 -28 599 -221q169 -173 169 -509z" />
-<glyph unicode="&#xf123;" horiz-adv-x="1664" d="M1186 579l257 250l-356 52l-66 10l-30 60l-159 322v-963l59 -31l318 -168l-60 355l-12 66zM1638 841l-363 -354l86 -500q5 -33 -6 -51.5t-34 -18.5q-17 0 -40 12l-449 236l-449 -236q-23 -12 -40 -12q-23 0 -34 18.5t-6 51.5l86 500l-364 354q-32 32 -23 59.5t54 34.5 l502 73l225 455q20 41 49 41q28 0 49 -41l225 -455l502 -73q45 -7 54 -34.5t-24 -59.5z" />
-<glyph unicode="&#xf124;" horiz-adv-x="1408" d="M1401 1187l-640 -1280q-17 -35 -57 -35q-5 0 -15 2q-22 5 -35.5 22.5t-13.5 39.5v576h-576q-22 0 -39.5 13.5t-22.5 35.5t4 42t29 30l1280 640q13 7 29 7q27 0 45 -19q15 -14 18.5 -34.5t-6.5 -39.5z" />
-<glyph unicode="&#xf125;" horiz-adv-x="1664" d="M557 256h595v595zM512 301l595 595h-595v-595zM1664 224v-192q0 -14 -9 -23t-23 -9h-224v-224q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v224h-864q-14 0 -23 9t-9 23v864h-224q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h224v224q0 14 9 23t23 9h192q14 0 23 -9t9 -23 v-224h851l246 247q10 9 23 9t23 -9q9 -10 9 -23t-9 -23l-247 -246v-851h224q14 0 23 -9t9 -23z" />
-<glyph unicode="&#xf126;" horiz-adv-x="1024" d="M288 64q0 40 -28 68t-68 28t-68 -28t-28 -68t28 -68t68 -28t68 28t28 68zM288 1216q0 40 -28 68t-68 28t-68 -28t-28 -68t28 -68t68 -28t68 28t28 68zM928 1088q0 40 -28 68t-68 28t-68 -28t-28 -68t28 -68t68 -28t68 28t28 68zM1024 1088q0 -52 -26 -96.5t-70 -69.5 q-2 -287 -226 -414q-68 -38 -203 -81q-128 -40 -169.5 -71t-41.5 -100v-26q44 -25 70 -69.5t26 -96.5q0 -80 -56 -136t-136 -56t-136 56t-56 136q0 52 26 96.5t70 69.5v820q-44 25 -70 69.5t-26 96.5q0 80 56 136t136 56t136 -56t56 -136q0 -52 -26 -96.5t-70 -69.5v-497 q54 26 154 57q55 17 87.5 29.5t70.5 31t59 39.5t40.5 51t28 69.5t8.5 91.5q-44 25 -70 69.5t-26 96.5q0 80 56 136t136 56t136 -56t56 -136z" />
-<glyph unicode="&#xf127;" horiz-adv-x="1664" d="M439 265l-256 -256q-10 -9 -23 -9q-12 0 -23 9q-9 10 -9 23t9 23l256 256q10 9 23 9t23 -9q9 -10 9 -23t-9 -23zM608 224v-320q0 -14 -9 -23t-23 -9t-23 9t-9 23v320q0 14 9 23t23 9t23 -9t9 -23zM384 448q0 -14 -9 -23t-23 -9h-320q-14 0 -23 9t-9 23t9 23t23 9h320 q14 0 23 -9t9 -23zM1648 320q0 -120 -85 -203l-147 -146q-83 -83 -203 -83q-121 0 -204 85l-334 335q-21 21 -42 56l239 18l273 -274q27 -27 68 -27.5t68 26.5l147 146q28 28 28 67q0 40 -28 68l-274 275l18 239q35 -21 56 -42l336 -336q84 -86 84 -204zM1031 1044l-239 -18 l-273 274q-28 28 -68 28q-39 0 -68 -27l-147 -146q-28 -28 -28 -67q0 -40 28 -68l274 -274l-18 -240q-35 21 -56 42l-336 336q-84 86 -84 204q0 120 85 203l147 146q83 83 203 83q121 0 204 -85l334 -335q21 -21 42 -56zM1664 960q0 -14 -9 -23t-23 -9h-320q-14 0 -23 9 t-9 23t9 23t23 9h320q14 0 23 -9t9 -23zM1120 1504v-320q0 -14 -9 -23t-23 -9t-23 9t-9 23v320q0 14 9 23t23 9t23 -9t9 -23zM1527 1353l-256 -256q-11 -9 -23 -9t-23 9q-9 10 -9 23t9 23l256 256q10 9 23 9t23 -9q9 -10 9 -23t-9 -23z" />
-<glyph unicode="&#xf128;" horiz-adv-x="1024" d="M704 280v-240q0 -16 -12 -28t-28 -12h-240q-16 0 -28 12t-12 28v240q0 16 12 28t28 12h240q16 0 28 -12t12 -28zM1020 880q0 -54 -15.5 -101t-35 -76.5t-55 -59.5t-57.5 -43.5t-61 -35.5q-41 -23 -68.5 -65t-27.5 -67q0 -17 -12 -32.5t-28 -15.5h-240q-15 0 -25.5 18.5 t-10.5 37.5v45q0 83 65 156.5t143 108.5q59 27 84 56t25 76q0 42 -46.5 74t-107.5 32q-65 0 -108 -29q-35 -25 -107 -115q-13 -16 -31 -16q-12 0 -25 8l-164 125q-13 10 -15.5 25t5.5 28q160 266 464 266q80 0 161 -31t146 -83t106 -127.5t41 -158.5z" />
-<glyph unicode="&#xf129;" horiz-adv-x="640" d="M640 192v-128q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h64v384h-64q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h384q26 0 45 -19t19 -45v-576h64q26 0 45 -19t19 -45zM512 1344v-192q0 -26 -19 -45t-45 -19h-256q-26 0 -45 19t-19 45v192 q0 26 19 45t45 19h256q26 0 45 -19t19 -45z" />
-<glyph unicode="&#xf12a;" horiz-adv-x="640" d="M512 288v-224q0 -26 -19 -45t-45 -19h-256q-26 0 -45 19t-19 45v224q0 26 19 45t45 19h256q26 0 45 -19t19 -45zM542 1344l-28 -768q-1 -26 -20.5 -45t-45.5 -19h-256q-26 0 -45.5 19t-20.5 45l-28 768q-1 26 17.5 45t44.5 19h320q26 0 44.5 -19t17.5 -45z" />
-<glyph unicode="&#xf12b;" d="M897 167v-167h-248l-159 252l-24 42q-8 9 -11 21h-3l-9 -21q-10 -20 -25 -44l-155 -250h-258v167h128l197 291l-185 272h-137v168h276l139 -228q2 -4 23 -42q8 -9 11 -21h3q3 9 11 21l25 42l140 228h257v-168h-125l-184 -267l204 -296h109zM1534 846v-206h-514l-3 27 q-4 28 -4 46q0 64 26 117t65 86.5t84 65t84 54.5t65 54t26 64q0 38 -29.5 62.5t-70.5 24.5q-51 0 -97 -39q-14 -11 -36 -38l-105 92q26 37 63 66q83 65 188 65q110 0 178 -59.5t68 -158.5q0 -56 -24.5 -103t-62 -76.5t-81.5 -58.5t-82 -50.5t-65.5 -51.5t-30.5 -63h232v80 h126z" />
-<glyph unicode="&#xf12c;" d="M897 167v-167h-248l-159 252l-24 42q-8 9 -11 21h-3l-9 -21q-10 -20 -25 -44l-155 -250h-258v167h128l197 291l-185 272h-137v168h276l139 -228q2 -4 23 -42q8 -9 11 -21h3q3 9 11 21l25 42l140 228h257v-168h-125l-184 -267l204 -296h109zM1536 -50v-206h-514l-4 27 q-3 45 -3 46q0 64 26 117t65 86.5t84 65t84 54.5t65 54t26 64q0 38 -29.5 62.5t-70.5 24.5q-51 0 -97 -39q-14 -11 -36 -38l-105 92q26 37 63 66q80 65 188 65q110 0 178 -59.5t68 -158.5q0 -66 -34.5 -118.5t-84 -86t-99.5 -62.5t-87 -63t-41 -73h232v80h126z" />
-<glyph unicode="&#xf12d;" horiz-adv-x="1920" d="M896 128l336 384h-768l-336 -384h768zM1909 1205q15 -34 9.5 -71.5t-30.5 -65.5l-896 -1024q-38 -44 -96 -44h-768q-38 0 -69.5 20.5t-47.5 54.5q-15 34 -9.5 71.5t30.5 65.5l896 1024q38 44 96 44h768q38 0 69.5 -20.5t47.5 -54.5z" />
-<glyph unicode="&#xf12e;" horiz-adv-x="1664" d="M1664 438q0 -81 -44.5 -135t-123.5 -54q-41 0 -77.5 17.5t-59 38t-56.5 38t-71 17.5q-110 0 -110 -124q0 -39 16 -115t15 -115v-5q-22 0 -33 -1q-34 -3 -97.5 -11.5t-115.5 -13.5t-98 -5q-61 0 -103 26.5t-42 83.5q0 37 17.5 71t38 56.5t38 59t17.5 77.5q0 79 -54 123.5 t-135 44.5q-84 0 -143 -45.5t-59 -127.5q0 -43 15 -83t33.5 -64.5t33.5 -53t15 -50.5q0 -45 -46 -89q-37 -35 -117 -35q-95 0 -245 24q-9 2 -27.5 4t-27.5 4l-13 2q-1 0 -3 1q-2 0 -2 1v1024q2 -1 17.5 -3.5t34 -5t21.5 -3.5q150 -24 245 -24q80 0 117 35q46 44 46 89 q0 22 -15 50.5t-33.5 53t-33.5 64.5t-15 83q0 82 59 127.5t144 45.5q80 0 134 -44.5t54 -123.5q0 -41 -17.5 -77.5t-38 -59t-38 -56.5t-17.5 -71q0 -57 42 -83.5t103 -26.5q64 0 180 15t163 17v-2q-1 -2 -3.5 -17.5t-5 -34t-3.5 -21.5q-24 -150 -24 -245q0 -80 35 -117 q44 -46 89 -46q22 0 50.5 15t53 33.5t64.5 33.5t83 15q82 0 127.5 -59t45.5 -143z" />
-<glyph unicode="&#xf130;" horiz-adv-x="1152" d="M1152 832v-128q0 -221 -147.5 -384.5t-364.5 -187.5v-132h256q26 0 45 -19t19 -45t-19 -45t-45 -19h-640q-26 0 -45 19t-19 45t19 45t45 19h256v132q-217 24 -364.5 187.5t-147.5 384.5v128q0 26 19 45t45 19t45 -19t19 -45v-128q0 -185 131.5 -316.5t316.5 -131.5 t316.5 131.5t131.5 316.5v128q0 26 19 45t45 19t45 -19t19 -45zM896 1216v-512q0 -132 -94 -226t-226 -94t-226 94t-94 226v512q0 132 94 226t226 94t226 -94t94 -226z" />
-<glyph unicode="&#xf131;" horiz-adv-x="1408" d="M271 591l-101 -101q-42 103 -42 214v128q0 26 19 45t45 19t45 -19t19 -45v-128q0 -53 15 -113zM1385 1193l-361 -361v-128q0 -132 -94 -226t-226 -94q-55 0 -109 19l-96 -96q97 -51 205 -51q185 0 316.5 131.5t131.5 316.5v128q0 26 19 45t45 19t45 -19t19 -45v-128 q0 -221 -147.5 -384.5t-364.5 -187.5v-132h256q26 0 45 -19t19 -45t-19 -45t-45 -19h-640q-26 0 -45 19t-19 45t19 45t45 19h256v132q-125 13 -235 81l-254 -254q-10 -10 -23 -10t-23 10l-82 82q-10 10 -10 23t10 23l1234 1234q10 10 23 10t23 -10l82 -82q10 -10 10 -23 t-10 -23zM1005 1325l-621 -621v512q0 132 94 226t226 94q102 0 184.5 -59t116.5 -152z" />
-<glyph unicode="&#xf132;" horiz-adv-x="1280" d="M1088 576v640h-448v-1137q119 63 213 137q235 184 235 360zM1280 1344v-768q0 -86 -33.5 -170.5t-83 -150t-118 -127.5t-126.5 -103t-121 -77.5t-89.5 -49.5t-42.5 -20q-12 -6 -26 -6t-26 6q-16 7 -42.5 20t-89.5 49.5t-121 77.5t-126.5 103t-118 127.5t-83 150 t-33.5 170.5v768q0 26 19 45t45 19h1152q26 0 45 -19t19 -45z" />
-<glyph unicode="&#xf133;" horiz-adv-x="1664" d="M128 -128h1408v1024h-1408v-1024zM512 1088v288q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-288q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM1280 1088v288q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-288q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM1664 1152v-1280 q0 -52 -38 -90t-90 -38h-1408q-52 0 -90 38t-38 90v1280q0 52 38 90t90 38h128v96q0 66 47 113t113 47h64q66 0 113 -47t47 -113v-96h384v96q0 66 47 113t113 47h64q66 0 113 -47t47 -113v-96h128q52 0 90 -38t38 -90z" />
-<glyph unicode="&#xf134;" horiz-adv-x="1408" d="M512 1344q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1408 1376v-320q0 -16 -12 -25q-8 -7 -20 -7q-4 0 -7 1l-448 96q-11 2 -18 11t-7 20h-256v-102q111 -23 183.5 -111t72.5 -203v-800q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19t-19 45v800 q0 106 62.5 190.5t161.5 114.5v111h-32q-59 0 -115 -23.5t-91.5 -53t-66 -66.5t-40.5 -53.5t-14 -24.5q-17 -35 -57 -35q-16 0 -29 7q-23 12 -31.5 37t3.5 49q5 10 14.5 26t37.5 53.5t60.5 70t85 67t108.5 52.5q-25 42 -25 86q0 66 47 113t113 47t113 -47t47 -113 q0 -33 -14 -64h302q0 11 7 20t18 11l448 96q3 1 7 1q12 0 20 -7q12 -9 12 -25z" />
-<glyph unicode="&#xf135;" horiz-adv-x="1664" d="M1440 1088q0 40 -28 68t-68 28t-68 -28t-28 -68t28 -68t68 -28t68 28t28 68zM1664 1376q0 -249 -75.5 -430.5t-253.5 -360.5q-81 -80 -195 -176l-20 -379q-2 -16 -16 -26l-384 -224q-7 -4 -16 -4q-12 0 -23 9l-64 64q-13 14 -8 32l85 276l-281 281l-276 -85q-3 -1 -9 -1 q-14 0 -23 9l-64 64q-17 19 -5 39l224 384q10 14 26 16l379 20q96 114 176 195q188 187 358 258t431 71q14 0 24 -9.5t10 -22.5z" />
-<glyph unicode="&#xf136;" horiz-adv-x="1792" d="M1745 763l-164 -763h-334l178 832q13 56 -15 88q-27 33 -83 33h-169l-204 -953h-334l204 953h-286l-204 -953h-334l204 953l-153 327h1276q101 0 189.5 -40.5t147.5 -113.5q60 -73 81 -168.5t0 -194.5z" />
-<glyph unicode="&#xf137;" d="M909 141l102 102q19 19 19 45t-19 45l-307 307l307 307q19 19 19 45t-19 45l-102 102q-19 19 -45 19t-45 -19l-454 -454q-19 -19 -19 -45t19 -45l454 -454q19 -19 45 -19t45 19zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5 t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf138;" d="M717 141l454 454q19 19 19 45t-19 45l-454 454q-19 19 -45 19t-45 -19l-102 -102q-19 -19 -19 -45t19 -45l307 -307l-307 -307q-19 -19 -19 -45t19 -45l102 -102q19 -19 45 -19t45 19zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5 t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf139;" d="M1165 397l102 102q19 19 19 45t-19 45l-454 454q-19 19 -45 19t-45 -19l-454 -454q-19 -19 -19 -45t19 -45l102 -102q19 -19 45 -19t45 19l307 307l307 -307q19 -19 45 -19t45 19zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5 t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf13a;" d="M813 237l454 454q19 19 19 45t-19 45l-102 102q-19 19 -45 19t-45 -19l-307 -307l-307 307q-19 19 -45 19t-45 -19l-102 -102q-19 -19 -19 -45t19 -45l454 -454q19 -19 45 -19t45 19zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5 t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf13b;" horiz-adv-x="1408" d="M1130 939l16 175h-884l47 -534h612l-22 -228l-197 -53l-196 53l-13 140h-175l22 -278l362 -100h4v1l359 99l50 544h-644l-15 181h674zM0 1408h1408l-128 -1438l-578 -162l-574 162z" />
-<glyph unicode="&#xf13c;" horiz-adv-x="1792" d="M275 1408h1505l-266 -1333l-804 -267l-698 267l71 356h297l-29 -147l422 -161l486 161l68 339h-1208l58 297h1209l38 191h-1208z" />
-<glyph unicode="&#xf13d;" horiz-adv-x="1792" d="M960 1280q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1792 352v-352q0 -22 -20 -30q-8 -2 -12 -2q-13 0 -23 9l-93 93q-119 -143 -318.5 -226.5t-429.5 -83.5t-429.5 83.5t-318.5 226.5l-93 -93q-9 -9 -23 -9q-4 0 -12 2q-20 8 -20 30v352 q0 14 9 23t23 9h352q22 0 30 -20q8 -19 -7 -35l-100 -100q67 -91 189.5 -153.5t271.5 -82.5v647h-192q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h192v163q-58 34 -93 92.5t-35 128.5q0 106 75 181t181 75t181 -75t75 -181q0 -70 -35 -128.5t-93 -92.5v-163h192q26 0 45 -19 t19 -45v-128q0 -26 -19 -45t-45 -19h-192v-647q149 20 271.5 82.5t189.5 153.5l-100 100q-15 16 -7 35q8 20 30 20h352q14 0 23 -9t9 -23z" />
-<glyph unicode="&#xf13e;" horiz-adv-x="1152" d="M1056 768q40 0 68 -28t28 -68v-576q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v576q0 40 28 68t68 28h32v320q0 185 131.5 316.5t316.5 131.5t316.5 -131.5t131.5 -316.5q0 -26 -19 -45t-45 -19h-64q-26 0 -45 19t-19 45q0 106 -75 181t-181 75t-181 -75t-75 -181 v-320h736z" />
-<glyph unicode="&#xf140;" d="M1024 640q0 -106 -75 -181t-181 -75t-181 75t-75 181t75 181t181 75t181 -75t75 -181zM1152 640q0 159 -112.5 271.5t-271.5 112.5t-271.5 -112.5t-112.5 -271.5t112.5 -271.5t271.5 -112.5t271.5 112.5t112.5 271.5zM1280 640q0 -212 -150 -362t-362 -150t-362 150 t-150 362t150 362t362 150t362 -150t150 -362zM1408 640q0 130 -51 248.5t-136.5 204t-204 136.5t-248.5 51t-248.5 -51t-204 -136.5t-136.5 -204t-51 -248.5t51 -248.5t136.5 -204t204 -136.5t248.5 -51t248.5 51t204 136.5t136.5 204t51 248.5zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf141;" horiz-adv-x="1408" d="M384 800v-192q0 -40 -28 -68t-68 -28h-192q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h192q40 0 68 -28t28 -68zM896 800v-192q0 -40 -28 -68t-68 -28h-192q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h192q40 0 68 -28t28 -68zM1408 800v-192q0 -40 -28 -68t-68 -28h-192 q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h192q40 0 68 -28t28 -68z" />
-<glyph unicode="&#xf142;" horiz-adv-x="384" d="M384 288v-192q0 -40 -28 -68t-68 -28h-192q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h192q40 0 68 -28t28 -68zM384 800v-192q0 -40 -28 -68t-68 -28h-192q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h192q40 0 68 -28t28 -68zM384 1312v-192q0 -40 -28 -68t-68 -28h-192 q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h192q40 0 68 -28t28 -68z" />
-<glyph unicode="&#xf143;" d="M512 256q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM863 162q-13 232 -177 396t-396 177q-14 1 -24 -9t-10 -23v-128q0 -13 8.5 -22t21.5 -10q154 -11 264 -121t121 -264q1 -13 10 -21.5t22 -8.5h128q13 0 23 10 t9 24zM1247 161q-5 154 -56 297.5t-139.5 260t-205 205t-260 139.5t-297.5 56q-14 1 -23 -9q-10 -10 -10 -23v-128q0 -13 9 -22t22 -10q204 -7 378 -111.5t278.5 -278.5t111.5 -378q1 -13 10 -22t22 -9h128q13 0 23 10q11 9 9 23zM1536 1120v-960q0 -119 -84.5 -203.5 t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
-<glyph unicode="&#xf144;" d="M768 1408q209 0 385.5 -103t279.5 -279.5t103 -385.5t-103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103zM1152 585q32 18 32 55t-32 55l-544 320q-31 19 -64 1q-32 -19 -32 -56v-640q0 -37 32 -56 q16 -8 32 -8q17 0 32 9z" />
-<glyph unicode="&#xf145;" horiz-adv-x="1792" d="M1024 1084l316 -316l-572 -572l-316 316zM813 105l618 618q19 19 19 45t-19 45l-362 362q-18 18 -45 18t-45 -18l-618 -618q-19 -19 -19 -45t19 -45l362 -362q18 -18 45 -18t45 18zM1702 742l-907 -908q-37 -37 -90.5 -37t-90.5 37l-126 126q56 56 56 136t-56 136 t-136 56t-136 -56l-125 126q-37 37 -37 90.5t37 90.5l907 906q37 37 90.5 37t90.5 -37l125 -125q-56 -56 -56 -136t56 -136t136 -56t136 56l126 -125q37 -37 37 -90.5t-37 -90.5z" />
-<glyph unicode="&#xf146;" d="M1280 576v128q0 26 -19 45t-45 19h-896q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h896q26 0 45 19t19 45zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5 t84.5 -203.5z" />
-<glyph unicode="&#xf147;" horiz-adv-x="1408" d="M1152 736v-64q0 -14 -9 -23t-23 -9h-832q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h832q14 0 23 -9t9 -23zM1280 288v832q0 66 -47 113t-113 47h-832q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832q66 0 113 47t47 113zM1408 1120v-832q0 -119 -84.5 -203.5 t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h832q119 0 203.5 -84.5t84.5 -203.5z" />
-<glyph unicode="&#xf148;" horiz-adv-x="1024" d="M1018 933q-18 -37 -58 -37h-192v-864q0 -14 -9 -23t-23 -9h-704q-21 0 -29 18q-8 20 4 35l160 192q9 11 25 11h320v640h-192q-40 0 -58 37q-17 37 9 68l320 384q18 22 49 22t49 -22l320 -384q27 -32 9 -68z" />
-<glyph unicode="&#xf149;" horiz-adv-x="1024" d="M32 1280h704q13 0 22.5 -9.5t9.5 -23.5v-863h192q40 0 58 -37t-9 -69l-320 -384q-18 -22 -49 -22t-49 22l-320 384q-26 31 -9 69q18 37 58 37h192v640h-320q-14 0 -25 11l-160 192q-13 14 -4 34q9 19 29 19z" />
-<glyph unicode="&#xf14a;" d="M685 237l614 614q19 19 19 45t-19 45l-102 102q-19 19 -45 19t-45 -19l-467 -467l-211 211q-19 19 -45 19t-45 -19l-102 -102q-19 -19 -19 -45t19 -45l358 -358q19 -19 45 -19t45 19zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5 t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
-<glyph unicode="&#xf14b;" d="M404 428l152 -152l-52 -52h-56v96h-96v56zM818 818q14 -13 -3 -30l-291 -291q-17 -17 -30 -3q-14 13 3 30l291 291q17 17 30 3zM544 128l544 544l-288 288l-544 -544v-288h288zM1152 736l92 92q28 28 28 68t-28 68l-152 152q-28 28 -68 28t-68 -28l-92 -92zM1536 1120 v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
-<glyph unicode="&#xf14c;" d="M1280 608v480q0 26 -19 45t-45 19h-480q-42 0 -59 -39q-17 -41 14 -70l144 -144l-534 -534q-19 -19 -19 -45t19 -45l102 -102q19 -19 45 -19t45 19l534 534l144 -144q18 -19 45 -19q12 0 25 5q39 17 39 59zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960 q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
-<glyph unicode="&#xf14d;" d="M1005 435l352 352q19 19 19 45t-19 45l-352 352q-30 31 -69 14q-40 -17 -40 -59v-160q-119 0 -216 -19.5t-162.5 -51t-114 -79t-76.5 -95.5t-44.5 -109t-21.5 -111.5t-5 -110.5q0 -181 167 -404q10 -12 25 -12q7 0 13 3q22 9 19 33q-44 354 62 473q46 52 130 75.5 t224 23.5v-160q0 -42 40 -59q12 -5 24 -5q26 0 45 19zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
-<glyph unicode="&#xf14e;" d="M640 448l256 128l-256 128v-256zM1024 1039v-542l-512 -256v542zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103 t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf150;" d="M1145 861q18 -35 -5 -66l-320 -448q-19 -27 -52 -27t-52 27l-320 448q-23 31 -5 66q17 35 57 35h640q40 0 57 -35zM1280 160v960q0 13 -9.5 22.5t-22.5 9.5h-960q-13 0 -22.5 -9.5t-9.5 -22.5v-960q0 -13 9.5 -22.5t22.5 -9.5h960q13 0 22.5 9.5t9.5 22.5zM1536 1120 v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
-<glyph unicode="&#xf151;" d="M1145 419q-17 -35 -57 -35h-640q-40 0 -57 35q-18 35 5 66l320 448q19 27 52 27t52 -27l320 -448q23 -31 5 -66zM1280 160v960q0 13 -9.5 22.5t-22.5 9.5h-960q-13 0 -22.5 -9.5t-9.5 -22.5v-960q0 -13 9.5 -22.5t22.5 -9.5h960q13 0 22.5 9.5t9.5 22.5zM1536 1120v-960 q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
-<glyph unicode="&#xf152;" d="M1088 640q0 -33 -27 -52l-448 -320q-31 -23 -66 -5q-35 17 -35 57v640q0 40 35 57q35 18 66 -5l448 -320q27 -19 27 -52zM1280 160v960q0 14 -9 23t-23 9h-960q-14 0 -23 -9t-9 -23v-960q0 -14 9 -23t23 -9h960q14 0 23 9t9 23zM1536 1120v-960q0 -119 -84.5 -203.5 t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
-<glyph unicode="&#xf153;" horiz-adv-x="1024" d="M976 229l35 -159q3 -12 -3 -22.5t-17 -14.5l-5 -1q-4 -2 -10.5 -3.5t-16 -4.5t-21.5 -5.5t-25.5 -5t-30 -5t-33.5 -4.5t-36.5 -3t-38.5 -1q-234 0 -409 130.5t-238 351.5h-95q-13 0 -22.5 9.5t-9.5 22.5v113q0 13 9.5 22.5t22.5 9.5h66q-2 57 1 105h-67q-14 0 -23 9 t-9 23v114q0 14 9 23t23 9h98q67 210 243.5 338t400.5 128q102 0 194 -23q11 -3 20 -15q6 -11 3 -24l-43 -159q-3 -13 -14 -19.5t-24 -2.5l-4 1q-4 1 -11.5 2.5l-17.5 3.5t-22.5 3.5t-26 3t-29 2.5t-29.5 1q-126 0 -226 -64t-150 -176h468q16 0 25 -12q10 -12 7 -26 l-24 -114q-5 -26 -32 -26h-488q-3 -37 0 -105h459q15 0 25 -12q9 -12 6 -27l-24 -112q-2 -11 -11 -18.5t-20 -7.5h-387q48 -117 149.5 -185.5t228.5 -68.5q18 0 36 1.5t33.5 3.5t29.5 4.5t24.5 5t18.5 4.5l12 3l5 2q13 5 26 -2q12 -7 15 -21z" />
-<glyph unicode="&#xf154;" horiz-adv-x="1024" d="M1020 399v-367q0 -14 -9 -23t-23 -9h-956q-14 0 -23 9t-9 23v150q0 13 9.5 22.5t22.5 9.5h97v383h-95q-14 0 -23 9.5t-9 22.5v131q0 14 9 23t23 9h95v223q0 171 123.5 282t314.5 111q185 0 335 -125q9 -8 10 -20.5t-7 -22.5l-103 -127q-9 -11 -22 -12q-13 -2 -23 7 q-5 5 -26 19t-69 32t-93 18q-85 0 -137 -47t-52 -123v-215h305q13 0 22.5 -9t9.5 -23v-131q0 -13 -9.5 -22.5t-22.5 -9.5h-305v-379h414v181q0 13 9 22.5t23 9.5h162q14 0 23 -9.5t9 -22.5z" />
-<glyph unicode="&#xf155;" horiz-adv-x="1024" d="M978 351q0 -153 -99.5 -263.5t-258.5 -136.5v-175q0 -14 -9 -23t-23 -9h-135q-13 0 -22.5 9.5t-9.5 22.5v175q-66 9 -127.5 31t-101.5 44.5t-74 48t-46.5 37.5t-17.5 18q-17 21 -2 41l103 135q7 10 23 12q15 2 24 -9l2 -2q113 -99 243 -125q37 -8 74 -8q81 0 142.5 43 t61.5 122q0 28 -15 53t-33.5 42t-58.5 37.5t-66 32t-80 32.5q-39 16 -61.5 25t-61.5 26.5t-62.5 31t-56.5 35.5t-53.5 42.5t-43.5 49t-35.5 58t-21 66.5t-8.5 78q0 138 98 242t255 134v180q0 13 9.5 22.5t22.5 9.5h135q14 0 23 -9t9 -23v-176q57 -6 110.5 -23t87 -33.5 t63.5 -37.5t39 -29t15 -14q17 -18 5 -38l-81 -146q-8 -15 -23 -16q-14 -3 -27 7q-3 3 -14.5 12t-39 26.5t-58.5 32t-74.5 26t-85.5 11.5q-95 0 -155 -43t-60 -111q0 -26 8.5 -48t29.5 -41.5t39.5 -33t56 -31t60.5 -27t70 -27.5q53 -20 81 -31.5t76 -35t75.5 -42.5t62 -50 t53 -63.5t31.5 -76.5t13 -94z" />
-<glyph unicode="&#xf156;" horiz-adv-x="898" d="M898 1066v-102q0 -14 -9 -23t-23 -9h-168q-23 -144 -129 -234t-276 -110q167 -178 459 -536q14 -16 4 -34q-8 -18 -29 -18h-195q-16 0 -25 12q-306 367 -498 571q-9 9 -9 22v127q0 13 9.5 22.5t22.5 9.5h112q132 0 212.5 43t102.5 125h-427q-14 0 -23 9t-9 23v102 q0 14 9 23t23 9h413q-57 113 -268 113h-145q-13 0 -22.5 9.5t-9.5 22.5v133q0 14 9 23t23 9h832q14 0 23 -9t9 -23v-102q0 -14 -9 -23t-23 -9h-233q47 -61 64 -144h171q14 0 23 -9t9 -23z" />
-<glyph unicode="&#xf157;" horiz-adv-x="1027" d="M603 0h-172q-13 0 -22.5 9t-9.5 23v330h-288q-13 0 -22.5 9t-9.5 23v103q0 13 9.5 22.5t22.5 9.5h288v85h-288q-13 0 -22.5 9t-9.5 23v104q0 13 9.5 22.5t22.5 9.5h214l-321 578q-8 16 0 32q10 16 28 16h194q19 0 29 -18l215 -425q19 -38 56 -125q10 24 30.5 68t27.5 61 l191 420q8 19 29 19h191q17 0 27 -16q9 -14 1 -31l-313 -579h215q13 0 22.5 -9.5t9.5 -22.5v-104q0 -14 -9.5 -23t-22.5 -9h-290v-85h290q13 0 22.5 -9.5t9.5 -22.5v-103q0 -14 -9.5 -23t-22.5 -9h-290v-330q0 -13 -9.5 -22.5t-22.5 -9.5z" />
-<glyph unicode="&#xf158;" horiz-adv-x="1280" d="M1043 971q0 100 -65 162t-171 62h-320v-448h320q106 0 171 62t65 162zM1280 971q0 -193 -126.5 -315t-326.5 -122h-340v-118h505q14 0 23 -9t9 -23v-128q0 -14 -9 -23t-23 -9h-505v-192q0 -14 -9.5 -23t-22.5 -9h-167q-14 0 -23 9t-9 23v192h-224q-14 0 -23 9t-9 23v128 q0 14 9 23t23 9h224v118h-224q-14 0 -23 9t-9 23v149q0 13 9 22.5t23 9.5h224v629q0 14 9 23t23 9h539q200 0 326.5 -122t126.5 -315z" />
-<glyph unicode="&#xf159;" horiz-adv-x="1792" d="M514 341l81 299h-159l75 -300q1 -1 1 -3t1 -3q0 1 0.5 3.5t0.5 3.5zM630 768l35 128h-292l32 -128h225zM822 768h139l-35 128h-70zM1271 340l78 300h-162l81 -299q0 -1 0.5 -3.5t1.5 -3.5q0 1 0.5 3t0.5 3zM1382 768l33 128h-297l34 -128h230zM1792 736v-64q0 -14 -9 -23 t-23 -9h-213l-164 -616q-7 -24 -31 -24h-159q-24 0 -31 24l-166 616h-209l-167 -616q-7 -24 -31 -24h-159q-11 0 -19.5 7t-10.5 17l-160 616h-208q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h175l-33 128h-142q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h109l-89 344q-5 15 5 28 q10 12 26 12h137q26 0 31 -24l90 -360h359l97 360q7 24 31 24h126q24 0 31 -24l98 -360h365l93 360q5 24 31 24h137q16 0 26 -12q10 -13 5 -28l-91 -344h111q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-145l-34 -128h179q14 0 23 -9t9 -23z" />
-<glyph unicode="&#xf15a;" horiz-adv-x="1280" d="M1167 896q18 -182 -131 -258q117 -28 175 -103t45 -214q-7 -71 -32.5 -125t-64.5 -89t-97 -58.5t-121.5 -34.5t-145.5 -15v-255h-154v251q-80 0 -122 1v-252h-154v255q-18 0 -54 0.5t-55 0.5h-200l31 183h111q50 0 58 51v402h16q-6 1 -16 1v287q-13 68 -89 68h-111v164 l212 -1q64 0 97 1v252h154v-247q82 2 122 2v245h154v-252q79 -7 140 -22.5t113 -45t82.5 -78t36.5 -114.5zM952 351q0 36 -15 64t-37 46t-57.5 30.5t-65.5 18.5t-74 9t-69 3t-64.5 -1t-47.5 -1v-338q8 0 37 -0.5t48 -0.5t53 1.5t58.5 4t57 8.5t55.5 14t47.5 21t39.5 30 t24.5 40t9.5 51zM881 827q0 33 -12.5 58.5t-30.5 42t-48 28t-55 16.5t-61.5 8t-58 2.5t-54 -1t-39.5 -0.5v-307q5 0 34.5 -0.5t46.5 0t50 2t55 5.5t51.5 11t48.5 18.5t37 27t27 38.5t9 51z" />
-<glyph unicode="&#xf15b;" horiz-adv-x="1280" d="M1280 768v-800q0 -40 -28 -68t-68 -28h-1088q-40 0 -68 28t-28 68v1344q0 40 28 68t68 28h544v-544q0 -40 28 -68t68 -28h544zM1277 896h-509v509q82 -15 132 -65l312 -312q50 -50 65 -132z" />
-<glyph unicode="&#xf15c;" horiz-adv-x="1280" d="M1024 160v64q0 14 -9 23t-23 9h-704q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h704q14 0 23 9t9 23zM1024 416v64q0 14 -9 23t-23 9h-704q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h704q14 0 23 9t9 23zM1280 768v-800q0 -40 -28 -68t-68 -28h-1088q-40 0 -68 28 t-28 68v1344q0 40 28 68t68 28h544v-544q0 -40 28 -68t68 -28h544zM1277 896h-509v509q82 -15 132 -65l312 -312q50 -50 65 -132z" />
-<glyph unicode="&#xf15d;" horiz-adv-x="1664" d="M1191 1128h177l-72 218l-12 47q-2 16 -2 20h-4l-3 -20q0 -1 -3.5 -18t-7.5 -29zM736 96q0 -12 -10 -24l-319 -319q-10 -9 -23 -9q-12 0 -23 9l-320 320q-15 16 -7 35q8 20 30 20h192v1376q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-1376h192q14 0 23 -9t9 -23zM1572 -23 v-233h-584v90l369 529q12 18 21 27l11 9v3q-2 0 -6.5 -0.5t-7.5 -0.5q-12 -3 -30 -3h-232v-115h-120v229h567v-89l-369 -530q-6 -8 -21 -26l-11 -11v-2l14 2q9 2 30 2h248v119h121zM1661 874v-106h-288v106h75l-47 144h-243l-47 -144h75v-106h-287v106h70l230 662h162 l230 -662h70z" />
-<glyph unicode="&#xf15e;" horiz-adv-x="1664" d="M1191 104h177l-72 218l-12 47q-2 16 -2 20h-4l-3 -20q0 -1 -3.5 -18t-7.5 -29zM736 96q0 -12 -10 -24l-319 -319q-10 -9 -23 -9q-12 0 -23 9l-320 320q-15 16 -7 35q8 20 30 20h192v1376q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-1376h192q14 0 23 -9t9 -23zM1661 -150 v-106h-288v106h75l-47 144h-243l-47 -144h75v-106h-287v106h70l230 662h162l230 -662h70zM1572 1001v-233h-584v90l369 529q12 18 21 27l11 9v3q-2 0 -6.5 -0.5t-7.5 -0.5q-12 -3 -30 -3h-232v-115h-120v229h567v-89l-369 -530q-6 -8 -21 -26l-11 -10v-3l14 3q9 1 30 1h248 v119h121z" />
-<glyph unicode="&#xf160;" horiz-adv-x="1792" d="M736 96q0 -12 -10 -24l-319 -319q-10 -9 -23 -9q-12 0 -23 9l-320 320q-15 16 -7 35q8 20 30 20h192v1376q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-1376h192q14 0 23 -9t9 -23zM1792 -32v-192q0 -14 -9 -23t-23 -9h-832q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h832 q14 0 23 -9t9 -23zM1600 480v-192q0 -14 -9 -23t-23 -9h-640q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h640q14 0 23 -9t9 -23zM1408 992v-192q0 -14 -9 -23t-23 -9h-448q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h448q14 0 23 -9t9 -23zM1216 1504v-192q0 -14 -9 -23t-23 -9h-256 q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h256q14 0 23 -9t9 -23z" />
-<glyph unicode="&#xf161;" horiz-adv-x="1792" d="M1216 -32v-192q0 -14 -9 -23t-23 -9h-256q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h256q14 0 23 -9t9 -23zM736 96q0 -12 -10 -24l-319 -319q-10 -9 -23 -9q-12 0 -23 9l-320 320q-15 16 -7 35q8 20 30 20h192v1376q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-1376h192 q14 0 23 -9t9 -23zM1408 480v-192q0 -14 -9 -23t-23 -9h-448q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h448q14 0 23 -9t9 -23zM1600 992v-192q0 -14 -9 -23t-23 -9h-640q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h640q14 0 23 -9t9 -23zM1792 1504v-192q0 -14 -9 -23t-23 -9h-832 q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h832q14 0 23 -9t9 -23z" />
-<glyph unicode="&#xf162;" d="M1346 223q0 63 -44 116t-103 53q-52 0 -83 -37t-31 -94t36.5 -95t104.5 -38q50 0 85 27t35 68zM736 96q0 -12 -10 -24l-319 -319q-10 -9 -23 -9q-12 0 -23 9l-320 320q-15 16 -7 35q8 20 30 20h192v1376q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-1376h192q14 0 23 -9t9 -23 zM1486 165q0 -62 -13 -121.5t-41 -114t-68 -95.5t-98.5 -65.5t-127.5 -24.5q-62 0 -108 16q-24 8 -42 15l39 113q15 -7 31 -11q37 -13 75 -13q84 0 134.5 58.5t66.5 145.5h-2q-21 -23 -61.5 -37t-84.5 -14q-106 0 -173 71.5t-67 172.5q0 105 72 178t181 73q123 0 205 -94.5 t82 -252.5zM1456 882v-114h-469v114h167v432q0 7 0.5 19t0.5 17v16h-2l-7 -12q-8 -13 -26 -31l-62 -58l-82 86l192 185h123v-654h165z" />
-<glyph unicode="&#xf163;" d="M1346 1247q0 63 -44 116t-103 53q-52 0 -83 -37t-31 -94t36.5 -95t104.5 -38q50 0 85 27t35 68zM736 96q0 -12 -10 -24l-319 -319q-10 -9 -23 -9q-12 0 -23 9l-320 320q-15 16 -7 35q8 20 30 20h192v1376q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-1376h192q14 0 23 -9 t9 -23zM1456 -142v-114h-469v114h167v432q0 7 0.5 19t0.5 17v16h-2l-7 -12q-8 -13 -26 -31l-62 -58l-82 86l192 185h123v-654h165zM1486 1189q0 -62 -13 -121.5t-41 -114t-68 -95.5t-98.5 -65.5t-127.5 -24.5q-62 0 -108 16q-24 8 -42 15l39 113q15 -7 31 -11q37 -13 75 -13 q84 0 134.5 58.5t66.5 145.5h-2q-21 -23 -61.5 -37t-84.5 -14q-106 0 -173 71.5t-67 172.5q0 105 72 178t181 73q123 0 205 -94.5t82 -252.5z" />
-<glyph unicode="&#xf164;" horiz-adv-x="1664" d="M256 192q0 26 -19 45t-45 19q-27 0 -45.5 -19t-18.5 -45q0 -27 18.5 -45.5t45.5 -18.5q26 0 45 18.5t19 45.5zM416 704v-640q0 -26 -19 -45t-45 -19h-288q-26 0 -45 19t-19 45v640q0 26 19 45t45 19h288q26 0 45 -19t19 -45zM1600 704q0 -86 -55 -149q15 -44 15 -76 q3 -76 -43 -137q17 -56 0 -117q-15 -57 -54 -94q9 -112 -49 -181q-64 -76 -197 -78h-36h-76h-17q-66 0 -144 15.5t-121.5 29t-120.5 39.5q-123 43 -158 44q-26 1 -45 19.5t-19 44.5v641q0 25 18 43.5t43 20.5q24 2 76 59t101 121q68 87 101 120q18 18 31 48t17.5 48.5 t13.5 60.5q7 39 12.5 61t19.5 52t34 50q19 19 45 19q46 0 82.5 -10.5t60 -26t40 -40.5t24 -45t12 -50t5 -45t0.5 -39q0 -38 -9.5 -76t-19 -60t-27.5 -56q-3 -6 -10 -18t-11 -22t-8 -24h277q78 0 135 -57t57 -135z" />
-<glyph unicode="&#xf165;" horiz-adv-x="1664" d="M256 960q0 -26 -19 -45t-45 -19q-27 0 -45.5 19t-18.5 45q0 27 18.5 45.5t45.5 18.5q26 0 45 -18.5t19 -45.5zM416 448v640q0 26 -19 45t-45 19h-288q-26 0 -45 -19t-19 -45v-640q0 -26 19 -45t45 -19h288q26 0 45 19t19 45zM1545 597q55 -61 55 -149q-1 -78 -57.5 -135 t-134.5 -57h-277q4 -14 8 -24t11 -22t10 -18q18 -37 27 -57t19 -58.5t10 -76.5q0 -24 -0.5 -39t-5 -45t-12 -50t-24 -45t-40 -40.5t-60 -26t-82.5 -10.5q-26 0 -45 19q-20 20 -34 50t-19.5 52t-12.5 61q-9 42 -13.5 60.5t-17.5 48.5t-31 48q-33 33 -101 120q-49 64 -101 121 t-76 59q-25 2 -43 20.5t-18 43.5v641q0 26 19 44.5t45 19.5q35 1 158 44q77 26 120.5 39.5t121.5 29t144 15.5h17h76h36q133 -2 197 -78q58 -69 49 -181q39 -37 54 -94q17 -61 0 -117q46 -61 43 -137q0 -32 -15 -76z" />
-<glyph unicode="&#xf166;" d="M919 233v157q0 50 -29 50q-17 0 -33 -16v-224q16 -16 33 -16q29 0 29 49zM1103 355h66v34q0 51 -33 51t-33 -51v-34zM532 621v-70h-80v-423h-74v423h-78v70h232zM733 495v-367h-67v40q-39 -45 -76 -45q-33 0 -42 28q-6 16 -6 54v290h66v-270q0 -24 1 -26q1 -15 15 -15 q20 0 42 31v280h67zM985 384v-146q0 -52 -7 -73q-12 -42 -53 -42q-35 0 -68 41v-36h-67v493h67v-161q32 40 68 40q41 0 53 -42q7 -21 7 -74zM1236 255v-9q0 -29 -2 -43q-3 -22 -15 -40q-27 -40 -80 -40q-52 0 -81 38q-21 27 -21 86v129q0 59 20 86q29 38 80 38t78 -38 q21 -28 21 -86v-76h-133v-65q0 -51 34 -51q24 0 30 26q0 1 0.5 7t0.5 16.5v21.5h68zM785 1079v-156q0 -51 -32 -51t-32 51v156q0 52 32 52t32 -52zM1318 366q0 177 -19 260q-10 44 -43 73.5t-76 34.5q-136 15 -412 15q-275 0 -411 -15q-44 -5 -76.5 -34.5t-42.5 -73.5 q-20 -87 -20 -260q0 -176 20 -260q10 -43 42.5 -73t75.5 -35q137 -15 412 -15t412 15q43 5 75.5 35t42.5 73q20 84 20 260zM563 1017l90 296h-75l-51 -195l-53 195h-78l24 -69t23 -69q35 -103 46 -158v-201h74v201zM852 936v130q0 58 -21 87q-29 38 -78 38q-51 0 -78 -38 q-21 -29 -21 -87v-130q0 -58 21 -87q27 -38 78 -38q49 0 78 38q21 27 21 87zM1033 816h67v370h-67v-283q-22 -31 -42 -31q-15 0 -16 16q-1 2 -1 26v272h-67v-293q0 -37 6 -55q11 -27 43 -27q36 0 77 45v-40zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960 q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
-<glyph unicode="&#xf167;" d="M971 292v-211q0 -67 -39 -67q-23 0 -45 22v301q22 22 45 22q39 0 39 -67zM1309 291v-46h-90v46q0 68 45 68t45 -68zM343 509h107v94h-312v-94h105v-569h100v569zM631 -60h89v494h-89v-378q-30 -42 -57 -42q-18 0 -21 21q-1 3 -1 35v364h-89v-391q0 -49 8 -73 q12 -37 58 -37q48 0 102 61v-54zM1060 88v197q0 73 -9 99q-17 56 -71 56q-50 0 -93 -54v217h-89v-663h89v48q45 -55 93 -55q54 0 71 55q9 27 9 100zM1398 98v13h-91q0 -51 -2 -61q-7 -36 -40 -36q-46 0 -46 69v87h179v103q0 79 -27 116q-39 51 -106 51q-68 0 -107 -51 q-28 -37 -28 -116v-173q0 -79 29 -116q39 -51 108 -51q72 0 108 53q18 27 21 54q2 9 2 58zM790 1011v210q0 69 -43 69t-43 -69v-210q0 -70 43 -70t43 70zM1509 260q0 -234 -26 -350q-14 -59 -58 -99t-102 -46q-184 -21 -555 -21t-555 21q-58 6 -102.5 46t-57.5 99 q-26 112 -26 350q0 234 26 350q14 59 58 99t103 47q183 20 554 20t555 -20q58 -7 102.5 -47t57.5 -99q26 -112 26 -350zM511 1536h102l-121 -399v-271h-100v271q-14 74 -61 212q-37 103 -65 187h106l71 -263zM881 1203v-175q0 -81 -28 -118q-37 -51 -106 -51q-67 0 -105 51 q-28 38 -28 118v175q0 80 28 117q38 51 105 51q69 0 106 -51q28 -37 28 -117zM1216 1365v-499h-91v55q-53 -62 -103 -62q-46 0 -59 37q-8 24 -8 75v394h91v-367q0 -33 1 -35q3 -22 21 -22q27 0 57 43v381h91z" />
-<glyph unicode="&#xf168;" horiz-adv-x="1408" d="M597 869q-10 -18 -257 -456q-27 -46 -65 -46h-239q-21 0 -31 17t0 36l253 448q1 0 0 1l-161 279q-12 22 -1 37q9 15 32 15h239q40 0 66 -45zM1403 1511q11 -16 0 -37l-528 -934v-1l336 -615q11 -20 1 -37q-10 -15 -32 -15h-239q-42 0 -66 45l-339 622q18 32 531 942 q25 45 64 45h241q22 0 31 -15z" />
-<glyph unicode="&#xf169;" d="M685 771q0 1 -126 222q-21 34 -52 34h-184q-18 0 -26 -11q-7 -12 1 -29l125 -216v-1l-196 -346q-9 -14 0 -28q8 -13 24 -13h185q31 0 50 36zM1309 1268q-7 12 -24 12h-187q-30 0 -49 -35l-411 -729q1 -2 262 -481q20 -35 52 -35h184q18 0 25 12q8 13 -1 28l-260 476v1 l409 723q8 16 0 28zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
-<glyph unicode="&#xf16a;" horiz-adv-x="1792" d="M1280 640q0 37 -30 54l-512 320q-31 20 -65 2q-33 -18 -33 -56v-640q0 -38 33 -56q16 -8 31 -8q20 0 34 10l512 320q30 17 30 54zM1792 640q0 -96 -1 -150t-8.5 -136.5t-22.5 -147.5q-16 -73 -69 -123t-124 -58q-222 -25 -671 -25t-671 25q-71 8 -124.5 58t-69.5 123 q-14 65 -21.5 147.5t-8.5 136.5t-1 150t1 150t8.5 136.5t22.5 147.5q16 73 69 123t124 58q222 25 671 25t671 -25q71 -8 124.5 -58t69.5 -123q14 -65 21.5 -147.5t8.5 -136.5t1 -150z" />
-<glyph unicode="&#xf16b;" horiz-adv-x="1792" d="M402 829l494 -305l-342 -285l-490 319zM1388 274v-108l-490 -293v-1l-1 1l-1 -1v1l-489 293v108l147 -96l342 284v2l1 -1l1 1v-2l343 -284zM554 1418l342 -285l-494 -304l-338 270zM1390 829l338 -271l-489 -319l-343 285zM1239 1418l489 -319l-338 -270l-494 304z" />
-<glyph unicode="&#xf16c;" horiz-adv-x="1408" d="M928 135v-151l-707 -1v151zM1169 481v-701l-1 -35v-1h-1132l-35 1h-1v736h121v-618h928v618h120zM241 393l704 -65l-13 -150l-705 65zM309 709l683 -183l-39 -146l-683 183zM472 1058l609 -360l-77 -130l-609 360zM832 1389l398 -585l-124 -85l-399 584zM1285 1536 l121 -697l-149 -26l-121 697z" />
-<glyph unicode="&#xf16d;" d="M1362 110v648h-135q20 -63 20 -131q0 -126 -64 -232.5t-174 -168.5t-240 -62q-197 0 -337 135.5t-140 327.5q0 68 20 131h-141v-648q0 -26 17.5 -43.5t43.5 -17.5h1069q25 0 43 17.5t18 43.5zM1078 643q0 124 -90.5 211.5t-218.5 87.5q-127 0 -217.5 -87.5t-90.5 -211.5 t90.5 -211.5t217.5 -87.5q128 0 218.5 87.5t90.5 211.5zM1362 1003v165q0 28 -20 48.5t-49 20.5h-174q-29 0 -49 -20.5t-20 -48.5v-165q0 -29 20 -49t49 -20h174q29 0 49 20t20 49zM1536 1211v-1142q0 -81 -58 -139t-139 -58h-1142q-81 0 -139 58t-58 139v1142q0 81 58 139 t139 58h1142q81 0 139 -58t58 -139z" />
-<glyph unicode="&#xf16e;" d="M1248 1408q119 0 203.5 -84.5t84.5 -203.5v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960zM698 640q0 88 -62 150t-150 62t-150 -62t-62 -150t62 -150t150 -62t150 62t62 150zM1262 640q0 88 -62 150 t-150 62t-150 -62t-62 -150t62 -150t150 -62t150 62t62 150z" />
-<glyph unicode="&#xf170;" d="M768 914l201 -306h-402zM1133 384h94l-459 691l-459 -691h94l104 160h522zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf171;" horiz-adv-x="1408" d="M815 677q8 -63 -50.5 -101t-111.5 -6q-39 17 -53.5 58t-0.5 82t52 58q36 18 72.5 12t64 -35.5t27.5 -67.5zM926 698q-14 107 -113 164t-197 13q-63 -28 -100.5 -88.5t-34.5 -129.5q4 -91 77.5 -155t165.5 -56q91 8 152 84t50 168zM1165 1240q-20 27 -56 44.5t-58 22 t-71 12.5q-291 47 -566 -2q-43 -7 -66 -12t-55 -22t-50 -43q30 -28 76 -45.5t73.5 -22t87.5 -11.5q228 -29 448 -1q63 8 89.5 12t72.5 21.5t75 46.5zM1222 205q-8 -26 -15.5 -76.5t-14 -84t-28.5 -70t-58 -56.5q-86 -48 -189.5 -71.5t-202 -22t-201.5 18.5q-46 8 -81.5 18 t-76.5 27t-73 43.5t-52 61.5q-25 96 -57 292l6 16l18 9q223 -148 506.5 -148t507.5 148q21 -6 24 -23t-5 -45t-8 -37zM1403 1166q-26 -167 -111 -655q-5 -30 -27 -56t-43.5 -40t-54.5 -31q-252 -126 -610 -88q-248 27 -394 139q-15 12 -25.5 26.5t-17 35t-9 34t-6 39.5 t-5.5 35q-9 50 -26.5 150t-28 161.5t-23.5 147.5t-22 158q3 26 17.5 48.5t31.5 37.5t45 30t46 22.5t48 18.5q125 46 313 64q379 37 676 -50q155 -46 215 -122q16 -20 16.5 -51t-5.5 -54z" />
-<glyph unicode="&#xf172;" d="M848 666q0 43 -41 66t-77 1q-43 -20 -42.5 -72.5t43.5 -70.5q39 -23 81 4t36 72zM928 682q8 -66 -36 -121t-110 -61t-119 40t-56 113q-2 49 25.5 93t72.5 64q70 31 141.5 -10t81.5 -118zM1100 1073q-20 -21 -53.5 -34t-53 -16t-63.5 -8q-155 -20 -324 0q-44 6 -63 9.5 t-52.5 16t-54.5 32.5q13 19 36 31t40 15.5t47 8.5q198 35 408 1q33 -5 51 -8.5t43 -16t39 -31.5zM1142 327q0 7 5.5 26.5t3 32t-17.5 16.5q-161 -106 -365 -106t-366 106l-12 -6l-5 -12q26 -154 41 -210q47 -81 204 -108q249 -46 428 53q34 19 49 51.5t22.5 85.5t12.5 71z M1272 1020q9 53 -8 75q-43 55 -155 88q-216 63 -487 36q-132 -12 -226 -46q-38 -15 -59.5 -25t-47 -34t-29.5 -54q8 -68 19 -138t29 -171t24 -137q1 -5 5 -31t7 -36t12 -27t22 -28q105 -80 284 -100q259 -28 440 63q24 13 39.5 23t31 29t19.5 40q48 267 80 473zM1536 1120 v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
-<glyph unicode="&#xf173;" horiz-adv-x="1024" d="M390 1408h219v-388h364v-241h-364v-394q0 -136 14 -172q13 -37 52 -60q50 -31 117 -31q117 0 232 76v-242q-102 -48 -178 -65q-77 -19 -173 -19q-105 0 -186 27q-78 25 -138 75q-58 51 -79 105q-22 54 -22 161v539h-170v217q91 30 155 84q64 55 103 132q39 78 54 196z " />
-<glyph unicode="&#xf174;" d="M1123 127v181q-88 -56 -174 -56q-51 0 -88 23q-29 17 -39 45q-11 30 -11 129v295h274v181h-274v291h-164q-11 -90 -40 -147t-78 -99q-48 -40 -116 -63v-163h127v-404q0 -78 17 -121q17 -42 59 -78q43 -37 104 -57q62 -20 140 -20q67 0 129 14q57 13 134 49zM1536 1120 v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
-<glyph unicode="&#xf175;" horiz-adv-x="768" d="M765 237q8 -19 -5 -35l-350 -384q-10 -10 -23 -10q-14 0 -24 10l-355 384q-13 16 -5 35q9 19 29 19h224v1248q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-1248h224q21 0 29 -19z" />
-<glyph unicode="&#xf176;" horiz-adv-x="768" d="M765 1043q-9 -19 -29 -19h-224v-1248q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v1248h-224q-21 0 -29 19t5 35l350 384q10 10 23 10q14 0 24 -10l355 -384q13 -16 5 -35z" />
-<glyph unicode="&#xf177;" horiz-adv-x="1792" d="M1792 736v-192q0 -14 -9 -23t-23 -9h-1248v-224q0 -21 -19 -29t-35 5l-384 350q-10 10 -10 23q0 14 10 24l384 354q16 14 35 6q19 -9 19 -29v-224h1248q14 0 23 -9t9 -23z" />
-<glyph unicode="&#xf178;" horiz-adv-x="1792" d="M1728 643q0 -14 -10 -24l-384 -354q-16 -14 -35 -6q-19 9 -19 29v224h-1248q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h1248v224q0 21 19 29t35 -5l384 -350q10 -10 10 -23z" />
-<glyph unicode="&#xf179;" horiz-adv-x="1408" d="M1393 321q-39 -125 -123 -250q-129 -196 -257 -196q-49 0 -140 32q-86 32 -151 32q-61 0 -142 -33q-81 -34 -132 -34q-152 0 -301 259q-147 261 -147 503q0 228 113 374q112 144 284 144q72 0 177 -30q104 -30 138 -30q45 0 143 34q102 34 173 34q119 0 213 -65 q52 -36 104 -100q-79 -67 -114 -118q-65 -94 -65 -207q0 -124 69 -223t158 -126zM1017 1494q0 -61 -29 -136q-30 -75 -93 -138q-54 -54 -108 -72q-37 -11 -104 -17q3 149 78 257q74 107 250 148q1 -3 2.5 -11t2.5 -11q0 -4 0.5 -10t0.5 -10z" />
-<glyph unicode="&#xf17a;" horiz-adv-x="1664" d="M682 530v-651l-682 94v557h682zM682 1273v-659h-682v565zM1664 530v-786l-907 125v661h907zM1664 1408v-794h-907v669z" />
-<glyph unicode="&#xf17b;" horiz-adv-x="1408" d="M493 1053q16 0 27.5 11.5t11.5 27.5t-11.5 27.5t-27.5 11.5t-27 -11.5t-11 -27.5t11 -27.5t27 -11.5zM915 1053q16 0 27 11.5t11 27.5t-11 27.5t-27 11.5t-27.5 -11.5t-11.5 -27.5t11.5 -27.5t27.5 -11.5zM103 869q42 0 72 -30t30 -72v-430q0 -43 -29.5 -73t-72.5 -30 t-73 30t-30 73v430q0 42 30 72t73 30zM1163 850v-666q0 -46 -32 -78t-77 -32h-75v-227q0 -43 -30 -73t-73 -30t-73 30t-30 73v227h-138v-227q0 -43 -30 -73t-73 -30q-42 0 -72 30t-30 73l-1 227h-74q-46 0 -78 32t-32 78v666h918zM931 1255q107 -55 171 -153.5t64 -215.5 h-925q0 117 64 215.5t172 153.5l-71 131q-7 13 5 20q13 6 20 -6l72 -132q95 42 201 42t201 -42l72 132q7 12 20 6q12 -7 5 -20zM1408 767v-430q0 -43 -30 -73t-73 -30q-42 0 -72 30t-30 73v430q0 43 30 72.5t72 29.5q43 0 73 -29.5t30 -72.5z" />
-<glyph unicode="&#xf17c;" d="M663 1125q-11 -1 -15.5 -10.5t-8.5 -9.5q-5 -1 -5 5q0 12 19 15h10zM750 1111q-4 -1 -11.5 6.5t-17.5 4.5q24 11 32 -2q3 -6 -3 -9zM399 684q-4 1 -6 -3t-4.5 -12.5t-5.5 -13.5t-10 -13q-7 -10 -1 -12q4 -1 12.5 7t12.5 18q1 3 2 7t2 6t1.5 4.5t0.5 4v3t-1 2.5t-3 2z M1254 325q0 18 -55 42q4 15 7.5 27.5t5 26t3 21.5t0.5 22.5t-1 19.5t-3.5 22t-4 20.5t-5 25t-5.5 26.5q-10 48 -47 103t-72 75q24 -20 57 -83q87 -162 54 -278q-11 -40 -50 -42q-31 -4 -38.5 18.5t-8 83.5t-11.5 107q-9 39 -19.5 69t-19.5 45.5t-15.5 24.5t-13 15t-7.5 7 q-14 62 -31 103t-29.5 56t-23.5 33t-15 40q-4 21 6 53.5t4.5 49.5t-44.5 25q-15 3 -44.5 18t-35.5 16q-8 1 -11 26t8 51t36 27q37 3 51 -30t4 -58q-11 -19 -2 -26.5t30 -0.5q13 4 13 36v37q-5 30 -13.5 50t-21 30.5t-23.5 15t-27 7.5q-107 -8 -89 -134q0 -15 -1 -15 q-9 9 -29.5 10.5t-33 -0.5t-15.5 5q1 57 -16 90t-45 34q-27 1 -41.5 -27.5t-16.5 -59.5q-1 -15 3.5 -37t13 -37.5t15.5 -13.5q10 3 16 14q4 9 -7 8q-7 0 -15.5 14.5t-9.5 33.5q-1 22 9 37t34 14q17 0 27 -21t9.5 -39t-1.5 -22q-22 -15 -31 -29q-8 -12 -27.5 -23.5 t-20.5 -12.5q-13 -14 -15.5 -27t7.5 -18q14 -8 25 -19.5t16 -19t18.5 -13t35.5 -6.5q47 -2 102 15q2 1 23 7t34.5 10.5t29.5 13t21 17.5q9 14 20 8q5 -3 6.5 -8.5t-3 -12t-16.5 -9.5q-20 -6 -56.5 -21.5t-45.5 -19.5q-44 -19 -70 -23q-25 -5 -79 2q-10 2 -9 -2t17 -19 q25 -23 67 -22q17 1 36 7t36 14t33.5 17.5t30 17t24.5 12t17.5 2.5t8.5 -11q0 -2 -1 -4.5t-4 -5t-6 -4.5t-8.5 -5t-9 -4.5t-10 -5t-9.5 -4.5q-28 -14 -67.5 -44t-66.5 -43t-49 -1q-21 11 -63 73q-22 31 -25 22q-1 -3 -1 -10q0 -25 -15 -56.5t-29.5 -55.5t-21 -58t11.5 -63 q-23 -6 -62.5 -90t-47.5 -141q-2 -18 -1.5 -69t-5.5 -59q-8 -24 -29 -3q-32 31 -36 94q-2 28 4 56q4 19 -1 18l-4 -5q-36 -65 10 -166q5 -12 25 -28t24 -20q20 -23 104 -90.5t93 -76.5q16 -15 17.5 -38t-14 -43t-45.5 -23q8 -15 29 -44.5t28 -54t7 -70.5q46 24 7 92 q-4 8 -10.5 16t-9.5 12t-2 6q3 5 13 9.5t20 -2.5q46 -52 166 -36q133 15 177 87q23 38 34 30q12 -6 10 -52q-1 -25 -23 -92q-9 -23 -6 -37.5t24 -15.5q3 19 14.5 77t13.5 90q2 21 -6.5 73.5t-7.5 97t23 70.5q15 18 51 18q1 37 34.5 53t72.5 10.5t60 -22.5zM626 1152 q3 17 -2.5 30t-11.5 15q-9 2 -9 -7q2 -5 5 -6q10 0 7 -15q-3 -20 8 -20q3 0 3 3zM1045 955q-2 8 -6.5 11.5t-13 5t-14.5 5.5q-5 3 -9.5 8t-7 8t-5.5 6.5t-4 4t-4 -1.5q-14 -16 7 -43.5t39 -31.5q9 -1 14.5 8t3.5 20zM867 1168q0 11 -5 19.5t-11 12.5t-9 3q-14 -1 -7 -7l4 -2 q14 -4 18 -31q0 -3 8 2zM921 1401q0 2 -2.5 5t-9 7t-9.5 6q-15 15 -24 15q-9 -1 -11.5 -7.5t-1 -13t-0.5 -12.5q-1 -4 -6 -10.5t-6 -9t3 -8.5q4 -3 8 0t11 9t15 9q1 1 9 1t15 2t9 7zM1486 60q20 -12 31 -24.5t12 -24t-2.5 -22.5t-15.5 -22t-23.5 -19.5t-30 -18.5 t-31.5 -16.5t-32 -15.5t-27 -13q-38 -19 -85.5 -56t-75.5 -64q-17 -16 -68 -19.5t-89 14.5q-18 9 -29.5 23.5t-16.5 25.5t-22 19.5t-47 9.5q-44 1 -130 1q-19 0 -57 -1.5t-58 -2.5q-44 -1 -79.5 -15t-53.5 -30t-43.5 -28.5t-53.5 -11.5q-29 1 -111 31t-146 43q-19 4 -51 9.5 t-50 9t-39.5 9.5t-33.5 14.5t-17 19.5q-10 23 7 66.5t18 54.5q1 16 -4 40t-10 42.5t-4.5 36.5t10.5 27q14 12 57 14t60 12q30 18 42 35t12 51q21 -73 -32 -106q-32 -20 -83 -15q-34 3 -43 -10q-13 -15 5 -57q2 -6 8 -18t8.5 -18t4.5 -17t1 -22q0 -15 -17 -49t-14 -48 q3 -17 37 -26q20 -6 84.5 -18.5t99.5 -20.5q24 -6 74 -22t82.5 -23t55.5 -4q43 6 64.5 28t23 48t-7.5 58.5t-19 52t-20 36.5q-121 190 -169 242q-68 74 -113 40q-11 -9 -15 15q-3 16 -2 38q1 29 10 52t24 47t22 42q8 21 26.5 72t29.5 78t30 61t39 54q110 143 124 195 q-12 112 -16 310q-2 90 24 151.5t106 104.5q39 21 104 21q53 1 106 -13.5t89 -41.5q57 -42 91.5 -121.5t29.5 -147.5q-5 -95 30 -214q34 -113 133 -218q55 -59 99.5 -163t59.5 -191q8 -49 5 -84.5t-12 -55.5t-20 -22q-10 -2 -23.5 -19t-27 -35.5t-40.5 -33.5t-61 -14 q-18 1 -31.5 5t-22.5 13.5t-13.5 15.5t-11.5 20.5t-9 19.5q-22 37 -41 30t-28 -49t7 -97q20 -70 1 -195q-10 -65 18 -100.5t73 -33t85 35.5q59 49 89.5 66.5t103.5 42.5q53 18 77 36.5t18.5 34.5t-25 28.5t-51.5 23.5q-33 11 -49.5 48t-15 72.5t15.5 47.5q1 -31 8 -56.5 t14.5 -40.5t20.5 -28.5t21 -19t21.5 -13t16.5 -9.5z" />
-<glyph unicode="&#xf17d;" d="M1024 36q-42 241 -140 498h-2l-2 -1q-16 -6 -43 -16.5t-101 -49t-137 -82t-131 -114.5t-103 -148l-15 11q184 -150 418 -150q132 0 256 52zM839 643q-21 49 -53 111q-311 -93 -673 -93q-1 -7 -1 -21q0 -124 44 -236.5t124 -201.5q50 89 123.5 166.5t142.5 124.5t130.5 81 t99.5 48l37 13q4 1 13 3.5t13 4.5zM732 855q-120 213 -244 378q-138 -65 -234 -186t-128 -272q302 0 606 80zM1416 536q-210 60 -409 29q87 -239 128 -469q111 75 185 189.5t96 250.5zM611 1277q-1 0 -2 -1q1 1 2 1zM1201 1132q-185 164 -433 164q-76 0 -155 -19 q131 -170 246 -382q69 26 130 60.5t96.5 61.5t65.5 57t37.5 40.5zM1424 647q-3 232 -149 410l-1 -1q-9 -12 -19 -24.5t-43.5 -44.5t-71 -60.5t-100 -65t-131.5 -64.5q25 -53 44 -95q2 -6 6.5 -17.5t7.5 -16.5q36 5 74.5 7t73.5 2t69 -1.5t64 -4t56.5 -5.5t48 -6.5t36.5 -6 t25 -4.5zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf17e;" d="M1173 473q0 50 -19.5 91.5t-48.5 68.5t-73 49t-82.5 34t-87.5 23l-104 24q-30 7 -44 10.5t-35 11.5t-30 16t-16.5 21t-7.5 30q0 77 144 77q43 0 77 -12t54 -28.5t38 -33.5t40 -29t48 -12q47 0 75.5 32t28.5 77q0 55 -56 99.5t-142 67.5t-182 23q-68 0 -132 -15.5 t-119.5 -47t-89 -87t-33.5 -128.5q0 -61 19 -106.5t56 -75.5t80 -48.5t103 -32.5l146 -36q90 -22 112 -36q32 -20 32 -60q0 -39 -40 -64.5t-105 -25.5q-51 0 -91.5 16t-65 38.5t-45.5 45t-46 38.5t-54 16q-50 0 -75.5 -30t-25.5 -75q0 -92 122 -157.5t291 -65.5 q73 0 140 18.5t122.5 53.5t88.5 93.5t33 131.5zM1536 256q0 -159 -112.5 -271.5t-271.5 -112.5q-130 0 -234 80q-77 -16 -150 -16q-143 0 -273.5 55.5t-225 150t-150 225t-55.5 273.5q0 73 16 150q-80 104 -80 234q0 159 112.5 271.5t271.5 112.5q130 0 234 -80 q77 16 150 16q143 0 273.5 -55.5t225 -150t150 -225t55.5 -273.5q0 -73 -16 -150q80 -104 80 -234z" />
-<glyph unicode="&#xf180;" horiz-adv-x="1664" d="M1483 512l-587 -587q-52 -53 -127.5 -53t-128.5 53l-587 587q-53 53 -53 128t53 128l587 587q53 53 128 53t128 -53l265 -265l-398 -399l-188 188q-42 42 -99 42q-59 0 -100 -41l-120 -121q-42 -40 -42 -99q0 -58 42 -100l406 -408q30 -28 67 -37l6 -4h28q60 0 99 41 l619 619l2 -3q53 -53 53 -128t-53 -128zM1406 1138l120 -120q14 -15 14 -36t-14 -36l-730 -730q-17 -15 -37 -15v0q-4 0 -6 1q-18 2 -30 14l-407 408q-14 15 -14 36t14 35l121 120q13 15 35 15t36 -15l252 -252l574 575q15 15 36 15t36 -15z" />
-<glyph unicode="&#xf181;" d="M704 192v1024q0 14 -9 23t-23 9h-480q-14 0 -23 -9t-9 -23v-1024q0 -14 9 -23t23 -9h480q14 0 23 9t9 23zM1376 576v640q0 14 -9 23t-23 9h-480q-14 0 -23 -9t-9 -23v-640q0 -14 9 -23t23 -9h480q14 0 23 9t9 23zM1536 1344v-1408q0 -26 -19 -45t-45 -19h-1408 q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h1408q26 0 45 -19t19 -45z" />
-<glyph unicode="&#xf182;" horiz-adv-x="1280" d="M1280 480q0 -40 -28 -68t-68 -28q-51 0 -80 43l-227 341h-45v-132l247 -411q9 -15 9 -33q0 -26 -19 -45t-45 -19h-192v-272q0 -46 -33 -79t-79 -33h-160q-46 0 -79 33t-33 79v272h-192q-26 0 -45 19t-19 45q0 18 9 33l247 411v132h-45l-227 -341q-29 -43 -80 -43 q-40 0 -68 28t-28 68q0 29 16 53l256 384q73 107 176 107h384q103 0 176 -107l256 -384q16 -24 16 -53zM864 1280q0 -93 -65.5 -158.5t-158.5 -65.5t-158.5 65.5t-65.5 158.5t65.5 158.5t158.5 65.5t158.5 -65.5t65.5 -158.5z" />
-<glyph unicode="&#xf183;" horiz-adv-x="1024" d="M1024 832v-416q0 -40 -28 -68t-68 -28t-68 28t-28 68v352h-64v-912q0 -46 -33 -79t-79 -33t-79 33t-33 79v464h-64v-464q0 -46 -33 -79t-79 -33t-79 33t-33 79v912h-64v-352q0 -40 -28 -68t-68 -28t-68 28t-28 68v416q0 80 56 136t136 56h640q80 0 136 -56t56 -136z M736 1280q0 -93 -65.5 -158.5t-158.5 -65.5t-158.5 65.5t-65.5 158.5t65.5 158.5t158.5 65.5t158.5 -65.5t65.5 -158.5z" />
-<glyph unicode="&#xf184;" d="M773 234l350 473q16 22 24.5 59t-6 85t-61.5 79q-40 26 -83 25.5t-73.5 -17.5t-54.5 -45q-36 -40 -96 -40q-59 0 -95 40q-24 28 -54.5 45t-73.5 17.5t-84 -25.5q-46 -31 -60.5 -79t-6 -85t24.5 -59zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103 t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf185;" horiz-adv-x="1792" d="M1472 640q0 117 -45.5 223.5t-123 184t-184 123t-223.5 45.5t-223.5 -45.5t-184 -123t-123 -184t-45.5 -223.5t45.5 -223.5t123 -184t184 -123t223.5 -45.5t223.5 45.5t184 123t123 184t45.5 223.5zM1748 363q-4 -15 -20 -20l-292 -96v-306q0 -16 -13 -26q-15 -10 -29 -4 l-292 94l-180 -248q-10 -13 -26 -13t-26 13l-180 248l-292 -94q-14 -6 -29 4q-13 10 -13 26v306l-292 96q-16 5 -20 20q-5 17 4 29l180 248l-180 248q-9 13 -4 29q4 15 20 20l292 96v306q0 16 13 26q15 10 29 4l292 -94l180 248q9 12 26 12t26 -12l180 -248l292 94 q14 6 29 -4q13 -10 13 -26v-306l292 -96q16 -5 20 -20q5 -16 -4 -29l-180 -248l180 -248q9 -12 4 -29z" />
-<glyph unicode="&#xf186;" d="M1262 233q-54 -9 -110 -9q-182 0 -337 90t-245 245t-90 337q0 192 104 357q-201 -60 -328.5 -229t-127.5 -384q0 -130 51 -248.5t136.5 -204t204 -136.5t248.5 -51q144 0 273.5 61.5t220.5 171.5zM1465 318q-94 -203 -283.5 -324.5t-413.5 -121.5q-156 0 -298 61 t-245 164t-164 245t-61 298q0 153 57.5 292.5t156 241.5t235.5 164.5t290 68.5q44 2 61 -39q18 -41 -15 -72q-86 -78 -131.5 -181.5t-45.5 -218.5q0 -148 73 -273t198 -198t273 -73q118 0 228 51q41 18 72 -13q14 -14 17.5 -34t-4.5 -38z" />
-<glyph unicode="&#xf187;" horiz-adv-x="1792" d="M1088 704q0 26 -19 45t-45 19h-256q-26 0 -45 -19t-19 -45t19 -45t45 -19h256q26 0 45 19t19 45zM1664 896v-960q0 -26 -19 -45t-45 -19h-1408q-26 0 -45 19t-19 45v960q0 26 19 45t45 19h1408q26 0 45 -19t19 -45zM1728 1344v-256q0 -26 -19 -45t-45 -19h-1536 q-26 0 -45 19t-19 45v256q0 26 19 45t45 19h1536q26 0 45 -19t19 -45z" />
-<glyph unicode="&#xf188;" horiz-adv-x="1664" d="M1632 576q0 -26 -19 -45t-45 -19h-224q0 -171 -67 -290l208 -209q19 -19 19 -45t-19 -45q-18 -19 -45 -19t-45 19l-198 197q-5 -5 -15 -13t-42 -28.5t-65 -36.5t-82 -29t-97 -13v896h-128v-896q-51 0 -101.5 13.5t-87 33t-66 39t-43.5 32.5l-15 14l-183 -207 q-20 -21 -48 -21q-24 0 -43 16q-19 18 -20.5 44.5t15.5 46.5l202 227q-58 114 -58 274h-224q-26 0 -45 19t-19 45t19 45t45 19h224v294l-173 173q-19 19 -19 45t19 45t45 19t45 -19l173 -173h844l173 173q19 19 45 19t45 -19t19 -45t-19 -45l-173 -173v-294h224q26 0 45 -19 t19 -45zM1152 1152h-640q0 133 93.5 226.5t226.5 93.5t226.5 -93.5t93.5 -226.5z" />
-<glyph unicode="&#xf189;" horiz-adv-x="1920" d="M1917 1016q23 -64 -150 -294q-24 -32 -65 -85q-78 -100 -90 -131q-17 -41 14 -81q17 -21 81 -82h1l1 -1l1 -1l2 -2q141 -131 191 -221q3 -5 6.5 -12.5t7 -26.5t-0.5 -34t-25 -27.5t-59 -12.5l-256 -4q-24 -5 -56 5t-52 22l-20 12q-30 21 -70 64t-68.5 77.5t-61 58 t-56.5 15.5q-3 -1 -8 -3.5t-17 -14.5t-21.5 -29.5t-17 -52t-6.5 -77.5q0 -15 -3.5 -27.5t-7.5 -18.5l-4 -5q-18 -19 -53 -22h-115q-71 -4 -146 16.5t-131.5 53t-103 66t-70.5 57.5l-25 24q-10 10 -27.5 30t-71.5 91t-106 151t-122.5 211t-130.5 272q-6 16 -6 27t3 16l4 6 q15 19 57 19l274 2q12 -2 23 -6.5t16 -8.5l5 -3q16 -11 24 -32q20 -50 46 -103.5t41 -81.5l16 -29q29 -60 56 -104t48.5 -68.5t41.5 -38.5t34 -14t27 5q2 1 5 5t12 22t13.5 47t9.5 81t0 125q-2 40 -9 73t-14 46l-6 12q-25 34 -85 43q-13 2 5 24q17 19 38 30q53 26 239 24 q82 -1 135 -13q20 -5 33.5 -13.5t20.5 -24t10.5 -32t3.5 -45.5t-1 -55t-2.5 -70.5t-1.5 -82.5q0 -11 -1 -42t-0.5 -48t3.5 -40.5t11.5 -39t22.5 -24.5q8 -2 17 -4t26 11t38 34.5t52 67t68 107.5q60 104 107 225q4 10 10 17.5t11 10.5l4 3l5 2.5t13 3t20 0.5l288 2 q39 5 64 -2.5t31 -16.5z" />
-<glyph unicode="&#xf18a;" horiz-adv-x="1792" d="M675 252q21 34 11 69t-45 50q-34 14 -73 1t-60 -46q-22 -34 -13 -68.5t43 -50.5t74.5 -2.5t62.5 47.5zM769 373q8 13 3.5 26.5t-17.5 18.5q-14 5 -28.5 -0.5t-21.5 -18.5q-17 -31 13 -45q14 -5 29 0.5t22 18.5zM943 266q-45 -102 -158 -150t-224 -12 q-107 34 -147.5 126.5t6.5 187.5q47 93 151.5 139t210.5 19q111 -29 158.5 -119.5t2.5 -190.5zM1255 426q-9 96 -89 170t-208.5 109t-274.5 21q-223 -23 -369.5 -141.5t-132.5 -264.5q9 -96 89 -170t208.5 -109t274.5 -21q223 23 369.5 141.5t132.5 264.5zM1563 422 q0 -68 -37 -139.5t-109 -137t-168.5 -117.5t-226 -83t-270.5 -31t-275 33.5t-240.5 93t-171.5 151t-65 199.5q0 115 69.5 245t197.5 258q169 169 341.5 236t246.5 -7q65 -64 20 -209q-4 -14 -1 -20t10 -7t14.5 0.5t13.5 3.5l6 2q139 59 246 59t153 -61q45 -63 0 -178 q-2 -13 -4.5 -20t4.5 -12.5t12 -7.5t17 -6q57 -18 103 -47t80 -81.5t34 -116.5zM1489 1046q42 -47 54.5 -108.5t-6.5 -117.5q-8 -23 -29.5 -34t-44.5 -4q-23 8 -34 29.5t-4 44.5q20 63 -24 111t-107 35q-24 -5 -45 8t-25 37q-5 24 8 44.5t37 25.5q60 13 119 -5.5t101 -65.5z M1670 1209q87 -96 112.5 -222.5t-13.5 -241.5q-9 -27 -34 -40t-52 -4t-40 34t-5 52q28 82 10 172t-80 158q-62 69 -148 95.5t-173 8.5q-28 -6 -52 9.5t-30 43.5t9.5 51.5t43.5 29.5q123 26 244 -11.5t208 -134.5z" />
-<glyph unicode="&#xf18b;" d="M1133 -34q-171 -94 -368 -94q-196 0 -367 94q138 87 235.5 211t131.5 268q35 -144 132.5 -268t235.5 -211zM638 1394v-485q0 -252 -126.5 -459.5t-330.5 -306.5q-181 215 -181 495q0 187 83.5 349.5t229.5 269.5t325 137zM1536 638q0 -280 -181 -495 q-204 99 -330.5 306.5t-126.5 459.5v485q179 -30 325 -137t229.5 -269.5t83.5 -349.5z" />
-<glyph unicode="&#xf18c;" horiz-adv-x="1408" d="M1402 433q-32 -80 -76 -138t-91 -88.5t-99 -46.5t-101.5 -14.5t-96.5 8.5t-86.5 22t-69.5 27.5t-46 22.5l-17 10q-113 -228 -289.5 -359.5t-384.5 -132.5q-19 0 -32 13t-13 32t13 31.5t32 12.5q173 1 322.5 107.5t251.5 294.5q-36 -14 -72 -23t-83 -13t-91 2.5t-93 28.5 t-92 59t-84.5 100t-74.5 146q114 47 214 57t167.5 -7.5t124.5 -56.5t88.5 -77t56.5 -82q53 131 79 291q-7 -1 -18 -2.5t-46.5 -2.5t-69.5 0.5t-81.5 10t-88.5 23t-84 42.5t-75 65t-54.5 94.5t-28.5 127.5q70 28 133.5 36.5t112.5 -1t92 -30t73.5 -50t56 -61t42 -63t27.5 -56 t16 -39.5l4 -16q12 122 12 195q-8 6 -21.5 16t-49 44.5t-63.5 71.5t-54 93t-33 112.5t12 127t70 138.5q73 -25 127.5 -61.5t84.5 -76.5t48 -85t20.5 -89t-0.5 -85.5t-13 -76.5t-19 -62t-17 -42l-7 -15q1 -5 1 -50.5t-1 -71.5q3 7 10 18.5t30.5 43t50.5 58t71 55.5t91.5 44.5 t112 14.5t132.5 -24q-2 -78 -21.5 -141.5t-50 -104.5t-69.5 -71.5t-81.5 -45.5t-84.5 -24t-80 -9.5t-67.5 1t-46.5 4.5l-17 3q-23 -147 -73 -283q6 7 18 18.5t49.5 41t77.5 52.5t99.5 42t117.5 20t129 -23.5t137 -77.5z" />
-<glyph unicode="&#xf18d;" horiz-adv-x="1280" d="M1259 283v-66q0 -85 -57.5 -144.5t-138.5 -59.5h-57l-260 -269v269h-529q-81 0 -138.5 59.5t-57.5 144.5v66h1238zM1259 609v-255h-1238v255h1238zM1259 937v-255h-1238v255h1238zM1259 1077v-67h-1238v67q0 84 57.5 143.5t138.5 59.5h846q81 0 138.5 -59.5t57.5 -143.5z " />
-<glyph unicode="&#xf18e;" d="M1152 640q0 -14 -9 -23l-320 -320q-9 -9 -23 -9q-13 0 -22.5 9.5t-9.5 22.5v192h-352q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h352v192q0 14 9 23t23 9q12 0 24 -10l319 -319q9 -9 9 -23zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198 t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf190;" d="M1152 736v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-352v-192q0 -14 -9 -23t-23 -9q-12 0 -24 10l-319 319q-9 9 -9 23t9 23l320 320q9 9 23 9q13 0 22.5 -9.5t9.5 -22.5v-192h352q13 0 22.5 -9.5t9.5 -22.5zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198 t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf191;" d="M1024 960v-640q0 -26 -19 -45t-45 -19q-20 0 -37 12l-448 320q-27 19 -27 52t27 52l448 320q17 12 37 12q26 0 45 -19t19 -45zM1280 160v960q0 13 -9.5 22.5t-22.5 9.5h-960q-13 0 -22.5 -9.5t-9.5 -22.5v-960q0 -13 9.5 -22.5t22.5 -9.5h960q13 0 22.5 9.5t9.5 22.5z M1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
-<glyph unicode="&#xf192;" d="M1024 640q0 -106 -75 -181t-181 -75t-181 75t-75 181t75 181t181 75t181 -75t75 -181zM768 1184q-148 0 -273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273t-73 273t-198 198t-273 73zM1536 640q0 -209 -103 -385.5t-279.5 -279.5 t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf193;" horiz-adv-x="1664" d="M1023 349l102 -204q-58 -179 -210 -290t-339 -111q-156 0 -288.5 77.5t-210 210t-77.5 288.5q0 181 104.5 330t274.5 211l17 -131q-122 -54 -195 -165.5t-73 -244.5q0 -185 131.5 -316.5t316.5 -131.5q126 0 232.5 65t165 175.5t49.5 236.5zM1571 249l58 -114l-256 -128 q-13 -7 -29 -7q-40 0 -57 35l-239 477h-472q-24 0 -42.5 16.5t-21.5 40.5l-96 779q-2 16 6 42q14 51 57 82.5t97 31.5q66 0 113 -47t47 -113q0 -69 -52 -117.5t-120 -41.5l37 -289h423v-128h-407l16 -128h455q40 0 57 -35l228 -455z" />
-<glyph unicode="&#xf194;" d="M1254 899q16 85 -21 132q-52 65 -187 45q-17 -3 -41 -12.5t-57.5 -30.5t-64.5 -48.5t-59.5 -70t-44.5 -91.5q80 7 113.5 -16t26.5 -99q-5 -52 -52 -143q-43 -78 -71 -99q-44 -32 -87 14q-23 24 -37.5 64.5t-19 73t-10 84t-8.5 71.5q-23 129 -34 164q-12 37 -35.5 69 t-50.5 40q-57 16 -127 -25q-54 -32 -136.5 -106t-122.5 -102v-7q16 -8 25.5 -26t21.5 -20q21 -3 54.5 8.5t58 10.5t41.5 -30q11 -18 18.5 -38.5t15 -48t12.5 -40.5q17 -46 53 -187q36 -146 57 -197q42 -99 103 -125q43 -12 85 -1.5t76 31.5q131 77 250 237 q104 139 172.5 292.5t82.5 226.5zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
-<glyph unicode="&#xf195;" horiz-adv-x="1152" d="M1152 704q0 -191 -94.5 -353t-256.5 -256.5t-353 -94.5h-160q-14 0 -23 9t-9 23v611l-215 -66q-3 -1 -9 -1q-10 0 -19 6q-13 10 -13 26v128q0 23 23 31l233 71v93l-215 -66q-3 -1 -9 -1q-10 0 -19 6q-13 10 -13 26v128q0 23 23 31l233 71v250q0 14 9 23t23 9h160 q14 0 23 -9t9 -23v-181l375 116q15 5 28 -5t13 -26v-128q0 -23 -23 -31l-393 -121v-93l375 116q15 5 28 -5t13 -26v-128q0 -23 -23 -31l-393 -121v-487q188 13 318 151t130 328q0 14 9 23t23 9h160q14 0 23 -9t9 -23z" />
-<glyph unicode="&#xf196;" horiz-adv-x="1408" d="M1152 736v-64q0 -14 -9 -23t-23 -9h-352v-352q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v352h-352q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h352v352q0 14 9 23t23 9h64q14 0 23 -9t9 -23v-352h352q14 0 23 -9t9 -23zM1280 288v832q0 66 -47 113t-113 47h-832 q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832q66 0 113 47t47 113zM1408 1120v-832q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h832q119 0 203.5 -84.5t84.5 -203.5z" />
-<glyph unicode="&#xf197;" horiz-adv-x="1792" />
-<glyph unicode="&#xf198;" horiz-adv-x="1792" />
-<glyph unicode="&#xf199;" horiz-adv-x="1792" />
-<glyph unicode="&#xf19a;" horiz-adv-x="1792" />
-<glyph unicode="&#xf19b;" horiz-adv-x="1792" />
-<glyph unicode="&#xf19c;" horiz-adv-x="1792" />
-<glyph unicode="&#xf19d;" horiz-adv-x="1792" />
-<glyph unicode="&#xf19e;" horiz-adv-x="1792" />
-<glyph unicode="&#xf500;" horiz-adv-x="1792" />
-</font>
-</defs></svg> \ No newline at end of file
diff --git a/user_guide_src/source/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.ttf b/user_guide_src/source/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.ttf
deleted file mode 100644
index e89738de5..000000000
--- a/user_guide_src/source/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.ttf
+++ /dev/null
Binary files differ
diff --git a/user_guide_src/source/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.woff b/user_guide_src/source/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.woff
deleted file mode 100644
index 8c1748aab..000000000
--- a/user_guide_src/source/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.woff
+++ /dev/null
Binary files differ
diff --git a/user_guide_src/source/_themes/sphinx_rtd_theme/static/images/ci-icon.ico b/user_guide_src/source/_themes/sphinx_rtd_theme/static/images/ci-icon.ico
deleted file mode 100644
index c4246f8bf..000000000
--- a/user_guide_src/source/_themes/sphinx_rtd_theme/static/images/ci-icon.ico
+++ /dev/null
Binary files differ
diff --git a/user_guide_src/source/_themes/sphinx_rtd_theme/static/js/oldtheme.js b/user_guide_src/source/_themes/sphinx_rtd_theme/static/js/oldtheme.js
deleted file mode 100644
index 60520cc3a..000000000
--- a/user_guide_src/source/_themes/sphinx_rtd_theme/static/js/oldtheme.js
+++ /dev/null
@@ -1,47 +0,0 @@
-$( document ).ready(function() {
- // Shift nav in mobile when clicking the menu.
- $(document).on('click', "[data-toggle='wy-nav-top']", function() {
- $("[data-toggle='wy-nav-shift']").toggleClass("shift");
- $("[data-toggle='rst-versions']").toggleClass("shift");
- });
- // Close menu when you click a link.
- $(document).on('click', ".wy-menu-vertical .current ul li a", function() {
- $("[data-toggle='wy-nav-shift']").removeClass("shift");
- $("[data-toggle='rst-versions']").toggleClass("shift");
- });
- $(document).on('click', "[data-toggle='rst-current-version']", function() {
- $("[data-toggle='rst-versions']").toggleClass("shift-up");
- });
- // Make tables responsive
- $("table.docutils:not(.field-list)").wrap("<div class='wy-table-responsive'></div>");
-});
-
-window.SphinxRtdTheme = (function (jquery) {
- var stickyNav = (function () {
- var navBar,
- win,
- stickyNavCssClass = 'stickynav',
- applyStickNav = function () {
- if (navBar.height() <= win.height()) {
- navBar.addClass(stickyNavCssClass);
- } else {
- navBar.removeClass(stickyNavCssClass);
- }
- },
- enable = function () {
- applyStickNav();
- win.on('resize', applyStickNav);
- },
- init = function () {
- navBar = jquery('nav.wy-nav-side:first');
- win = jquery(window);
- };
- jquery(init);
- return {
- enable : enable
- };
- }());
- return {
- StickyNav : stickyNav
- };
-}($));
diff --git a/user_guide_src/source/_themes/sphinx_rtd_theme/static/js/theme.js b/user_guide_src/source/_themes/sphinx_rtd_theme/static/js/theme.js
deleted file mode 100644
index 911dad29b..000000000
--- a/user_guide_src/source/_themes/sphinx_rtd_theme/static/js/theme.js
+++ /dev/null
@@ -1,134 +0,0 @@
-$(document).ready(function () {
- // Shift nav in mobile when clicking the menu.
- $(document).on('click', "[data-toggle='wy-nav-top']", function () {
- $("[data-toggle='wy-nav-shift']").toggleClass("shift");
- $("[data-toggle='rst-versions']").toggleClass("shift");
- });
- // Close menu when you click a link.
- $(document).on('click', ".wy-menu-vertical .current ul li a", function () {
- $("[data-toggle='wy-nav-shift']").removeClass("shift");
- $("[data-toggle='rst-versions']").toggleClass("shift");
- });
- $(document).on('click', "[data-toggle='rst-current-version']", function () {
- $("[data-toggle='rst-versions']").toggleClass("shift-up");
- });
- // Make tables responsive
- $("table.docutils:not(.field-list)").wrap("<div class='wy-table-responsive'></div>");
- // ---
- // START DOC MODIFICATION BY RUFNEX
- // v1.0 04.02.2015
- // Add ToogleButton to get FullWidth-View by Johannes Gamperl codeigniter.de
-
- $('#openToc').click(function () {
- $('#nav').slideToggle();
- });
- $('#closeMe').click(function () {
- if (getCookie('ciNav') != 'yes') {
- setCookie('ciNav', 'yes', 365);
- } else {
- setCookie('ciNav', 'no', 365);
- }
- tocFlip();
- });
- var tocFlip = function(){
- if (getCookie('ciNav') == 'yes') {
- $('#nav2').show();
- $('#topMenu').remove();
- $('body').css({ background: 'none' });
- $('.wy-nav-content-wrap').css({ background: 'none', 'margin-left': 0 });
- $('.wy-breadcrumbs').append('<div style="float:right;"><div style="float:left;" id="topMenu">' + $('.wy-form').parent().html() + '</div></div>');
- $('.wy-nav-side').toggle();
- } else {
- $('#topMenu').remove();
- $('#nav').hide();
- $('#nav2').hide();
- $('body').css({ background: '#edf0f2;' });
- $('.wy-nav-content-wrap').css({ background: 'none repeat scroll 0 0 #fcfcfc;', 'margin-left': '300px' });
- $('.wy-nav-side').show();
- }
- };
- if (getCookie('ciNav') == 'yes')
- {
- tocFlip();
- //$('#nav').slideToggle();
- }
- // END MODIFICATION ---
-
-});
-
-// Rufnex Cookie functions
-function setCookie(cname, cvalue, exdays) {
- // expire the old cookie if existed to avoid multiple cookies with the same name
- if (getCookie(cname)) {
- document.cookie = cname + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT";
- }
- var d = new Date();
- d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
- var expires = "expires=" + d.toGMTString();
- document.cookie = cname + "=" + cvalue + "; " + expires + "; path=/";
-}
-function getCookie(cname) {
- var name = cname + "=";
- var ca = document.cookie.split(';');
- for (var i = 0; i < ca.length; i++) {
- var c = ca[i];
- while (c.charAt(0) == ' ')
- c = c.substring(1);
- if (c.indexOf(name) == 0) {
- return c.substring(name.length, c.length);
- }
- }
- return '';
-}
-// End
-
-// resize window
-$(window).on('resize', function(){
- // show side nav on small screens when pulldown is enabled
- if (getCookie('ciNav') == 'yes' && $(window).width() <= 768) { // 768px is the tablet size defined by the theme
- $('.wy-nav-side').show();
- }
- // changing css with jquery seems to override the default css media query
- // change margin
- else if (getCookie('ciNav') == 'no' && $(window).width() <= 768) {
- $('.wy-nav-content-wrap').css({'margin-left': 0});
- }
- // hide side nav on large screens when pulldown is enabled
- else if (getCookie('ciNav') == 'yes' && $(window).width() > 768) {
- $('.wy-nav-side').hide();
- }
- // change margin
- else if (getCookie('ciNav') == 'no' && $(window).width() > 768) {
- $('.wy-nav-content-wrap').css({'margin-left': '300px'});
- }
-});
-
-window.SphinxRtdTheme = (function (jquery) {
- var stickyNav = (function () {
- var navBar,
- win,
- stickyNavCssClass = 'stickynav',
- applyStickNav = function () {
- if (navBar.height() <= win.height()) {
- navBar.addClass(stickyNavCssClass);
- } else {
- navBar.removeClass(stickyNavCssClass);
- }
- },
- enable = function () {
- applyStickNav();
- win.on('resize', applyStickNav);
- },
- init = function () {
- navBar = jquery('nav.wy-nav-side:first');
- win = jquery(window);
- };
- jquery(init);
- return {
- enable: enable
- };
- }());
- return {
- StickyNav: stickyNav
- };
-}($));
diff --git a/user_guide_src/source/_themes/sphinx_rtd_theme/theme.conf b/user_guide_src/source/_themes/sphinx_rtd_theme/theme.conf
deleted file mode 100644
index 5814ac963..000000000
--- a/user_guide_src/source/_themes/sphinx_rtd_theme/theme.conf
+++ /dev/null
@@ -1,8 +0,0 @@
-[theme]
-inherit = basic
-stylesheet = css/citheme.css
-
-[options]
-typekit_id = hiw1hhg
-analytics_id =
-sticky_navigation = False
diff --git a/user_guide_src/source/_themes/sphinx_rtd_theme/versions.html b/user_guide_src/source/_themes/sphinx_rtd_theme/versions.html
deleted file mode 100644
index 8b3eb79d2..000000000
--- a/user_guide_src/source/_themes/sphinx_rtd_theme/versions.html
+++ /dev/null
@@ -1,37 +0,0 @@
-{% if READTHEDOCS %}
-{# Add rst-badge after rst-versions for small badge style. #}
- <div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions">
- <span class="rst-current-version" data-toggle="rst-current-version">
- <span class="fa fa-book"> Read the Docs</span>
- v: {{ current_version }}
- <span class="fa fa-caret-down"></span>
- </span>
- <div class="rst-other-versions">
- <dl>
- <dt>Versions</dt>
- {% for slug, url in versions %}
- <dd><a href="{{ url }}">{{ slug }}</a></dd>
- {% endfor %}
- </dl>
- <dl>
- <dt>Downloads</dt>
- {% for type, url in downloads %}
- <dd><a href="{{ url }}">{{ type }}</a></dd>
- {% endfor %}
- </dl>
- <dl>
- <dt>On Read the Docs</dt>
- <dd>
- <a href="//{{ PRODUCTION_DOMAIN }}/projects/{{ slug }}/?fromdocs={{ slug }}">Project Home</a>
- </dd>
- <dd>
- <a href="//{{ PRODUCTION_DOMAIN }}/builds/{{ slug }}/?fromdocs={{ slug }}">Builds</a>
- </dd>
- </dl>
- <hr/>
- Free document hosting provided by <a href="http://www.readthedocs.org">Read the Docs</a>.
-
- </div>
- </div>
-{% endif %}
-
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
deleted file mode 100644
index 6a99f8ddf..000000000
--- a/user_guide_src/source/changelog.rst
+++ /dev/null
@@ -1,3747 +0,0 @@
-##########
-Change Log
-##########
-
-Version 3.1.13
-==============
-
-Release Date: Mar 3, 2022
-
-Bug fixes for 3.1.13
-====================
-
-- Fixed a bug (#6107) - :doc:`Session Library <libraries/sessions>` broke for PHP 5 due to a misnamed polyfill interface.
-
-Version 3.1.12
-==============
-
-Release Date: Mar 3, 2022
-
-- **Security**
-
- - Fixed a possible session fixation vulnerability where ``session.use_strict_mode`` wasn't enforced on PHP 7+.
-
-- General Changes
-
- - Improved logging of error conditions in :doc:`CAPTCHA Helper <helpers/captcha_helper>` function :php:func:`create_captcha()`.
- - Added ``AUTO_INCREMENT`` support for Oracle 12.1+ to :doc:`Database Forge <database/forge>`.
- - Added ``FULL [OUTER] JOIN`` support to :doc:`Query Builder <database/query_builder>`.
- - Added support for detecting WebP image type to :doc:`File Uploading Library <libraries/file_uploading>`.
- - Added method :doc:`Database Library <database/index>` method ``trans_active()`` to expose transaction state.
- - Updated :doc:`Database Library <database/index>` 'pdo' driver to attempt to free resources in order to allow connections to be closed.
- - Added ``SameSite=Strict`` attribute to the CSRF cookie sent by the :doc:`Security Class <libraries/security>`.
- - Added ``$config['cookie_samesite']`` option and ``$samesite`` parameter to :doc:`Input Library <libraries/input>` method ``set_cookie()``.
- - Added ``SameSite`` support through ``$config['sess_samesite']`` option to the :doc:`Session Library <libraries/sessions>`.
- - Added a wrapper class around :doc:`Session <libraries/sessions>` drivers to deal with compatibility between PHP 8.1 and older versions.
- - Updated a lot of code for PHP 8.0 and 8.1 compatibility.
-
-Bug fixes for 3.1.12
-====================
-
-- Fixed a bug (#5834) - :doc:`Query Builder <database/query_builder>` method ``count_all_results()`` triggered an SQL error for queries with a ``HAVING`` clause.
-- Fixed a bug (#5840) - :doc:`Cache Library <libraries/caching>` 'redis' driver triggered an ``E_DEPRECATED`` warning about ``sRemove()`` with phpRedis 5.
-- Fixed a bug (#5857) - :doc:`Session <libraries/sessions>` data could be corrupted after a concurrent request write with the 'files' driver due to a filesize cache being incorrect.
-- Fixed a bug (#5861) - :doc:`Cache Library <libraries/caching>` 'redis' driver would always use phpRedis 5 ``del()`` due to an incorrect version check.
-- Fixed a bug (#5879) - :doc:`Profiler Library <general/profiling>` triggered an ``E_DEPRECATED`` warning on PHP 7.4+.
-- Fixed a bug (#5901) - :doc:`Database Library <database/index>` methods ``list_fields()`` and ``field_data()`` ignored the configured table schema on PostgreSQL.
-- Fixed a bug (#5906) - :doc:`Database Library <database/index>` 'postgre' driver couldn't use the failover feature without a ``$config['dsn']``.
-- Fixed a bug (#5903) - :doc:`common function <general/common_functions>` :php:func:`set_status_header()` didn't recognize 'HTTP/2.0' as a valid ``$_SERVER['SERVER_PROTOCOL']``.
-- Fixed a bug (#6013) - :doc:`Session <libraries/sessions>` flashdata didn't work on PHP 8.
-- Fixed a bug (#6006) - ``is_callable()`` change in PHP 8 broke :doc:`Migrations <libraries/migration>`, a part of :doc:`XML-RPC <libraries/xmlrpc>` and an edge case in 404 detection logic.
-- Fixed a bug (#5729) - :doc:`Query Builder <database/query_builder>` possibly not detecting ``NOT BETWEEN`` expression.
-
-Version 3.1.11
-==============
-
-Release Date: Sep 19, 2019
-
-- General Changes
-
- - Changed ``CI_Log`` to append ``PHP_EOL`` instead of ``\n`` at the end of log messages.
- - Improved performance in :doc:`Cache Library <libraries/caching>` 'redis' driver with non-scalar variables.
- - Altered the :doc:`Session Library <libraries/sessions>` 'files' driver to log error and trigger a session start failure instead of throwing an ``Exception`` in case of unusable ``$config['sess_save_path']``.
- - Updated the :doc:`Session <libraries/sessions>` and :doc:`Cache <libraries/caching>` libraries' 'redis' driver to work with phpRedis 5.
-
-Bug fixes for 3.1.11
---------------------
-
-- Fixed a bug (#5681) - :doc:`Database Forge <database/forge>` method ``modify_column()`` produced erroneous SQL for ``DEFAULT`` attribute changes under PostgreSQL, Firebird.
-- Fixed a bug (#5692) - :doc:`Database Forge <database/forge>` didn't handle column nullability with the 'oci8', 'pdo/oci' drivers.
-- Fixed a bug (#5701) - :doc:`Database <database/index>` driver 'pdo/pgsql' produced incorrect DSNs when constructing from a configuration array.
-- Fixed a bug (#5708) - :doc:`Session Library <libraries/sessions>` 'redis' driver too often failed with locking-related errors that could've been avoided.
-- Fixed a bug (#5703) - :doc:`Session Library <libraries/sessions>` triggered an ``E_WARNING`` message about changing ``session.save_path`` during an active session when it fails to obtain a lock.
-- Fixed a bug where :doc:`Session Library <libraries/sessions>` 'database' driver didn't trigger a failure if it can't obtain a lock.
-- Fixed a bug (#5755) - :doc:`Form Validation Library <libraries/form_validation>` rule **valid_url** accepted digit-only domains due to a PHP bug.
-- Fixed a bug (#5753) - :doc:`Cache Library <libraries/caching>` 'redis' driver methods ``increment()``, ``decrement()`` ignored their ``$offset`` parameter.
-- Fixed a bug (#5779) - :doc:`Session Library <libraries/sessions>` 'redis' only attempted to validate session IDs in case the connection to Redis failed.
-- Fixed a bug (#5774) - :doc:`Database Results <database/results>` method ``custom_result_object()`` didn't properly handle empty result sets, triggering ``E_WARNING`` messages on PHP 7.2+.
-- Fixed a bug (#5788) - :doc:`Database Results <database/results>` method ``field_data()`` triggered an ``E_NOTICE`` error with PDO when a field type is not recognized by PHP.
-- Fixed a bug (#5796) - :doc:`Query Builder <database/query_builder>` method ``list_tables()`` triggered an SQL syntax error under MySQL when the database schema is a numeric string.
-- Fixed a bug where :doc:`Security Class <libraries/security>` would trigger an ``E_WARNING`` if CSRF inputs are arrays instead of strings.
-
-Version 3.1.10
-==============
-
-Release Date: Jan 16, 2019
-
-- General Changes
-
- - Added 'ssl_verify' support to the 'pdo/mysql' :doc:`Database <database/index>` driver.
- - Renamed :doc:`Inflector Helper <helpers/inflector_helper>` function ``is_countable()`` to :php:func:`word_is_countable()` due to the former colliding with one introduced in PHP 7.3.0.
-
-Bug fixes for 3.1.10
---------------------
-
-- Fixed a bug (#5526) - :doc:`Session Library <libraries/sessions>` had a syntax error in its 'memcached' driver.
-- Fixed a bug (#5542) - :doc:`Database Forge <database/forge>` method ``modify_column()`` always made fields ``NOT NULL`` when attempting to modify their nullable property under PostgreSQL.
-- Fixed a bug (#5561) - :doc:`Database Library <database/index>` didn't allow SSL connection configuration with only the 'ssl_verify' option when using the 'mysqli' driver.
-- Fixed a bug (#5545) - :doc:`Session Library <libraries/sessions>` crashed due to a caching-related error with the 'files' driver.
-- Fixed a bug (#5571) - :doc:`XML-RPC Library <libraries/xmlrpc>` had a typo that triggered an ``E_WARNING`` message on PHP 7.2.
-- Fixed a bug (#5587) - :doc:`Database Forge <database/forge>` method ``create_table()`` generated an ``E_WARNING`` message.
-- Fixed a bug (#5590) - :doc:`Form Validation Library <libraries/form_validation>` rule **valid_base64** didn't have a default error message.
-- Fixed a bug (#5624) - :doc:`Database Library <database/index>` methods ``list_fields()``, ``field_exists()`` returned incorrect results after tables are modified.
-- Fixed a bug (#5627) - :doc:`Database <database/index>` driver 'mysqli' triggered an ``E_WARNING`` message if there's no ``'port'`` specified in the database configuration.
-- Fixed a bug (#5651) - :doc:`Database Caching <database/caching>` could try to delete non-existent cache files due to a race condition.
-- Fixed a bug (#5652) - :doc:`CAPTCHA Helper <helpers/captcha_helper>` function :php:func:`create_captcha()` didn't comply with CSS standards.
-- Fixed a bug (#5605) - :doc:`Form Validation Library <libraries/form_validation>` didn't nullify array inputs that are expected to be strings.
-
-Version 3.1.9
-=============
-
-Release Date: Jun 12, 2018
-
-- **Security**
-
- - Updated :doc:`URL Helper <helpers/url_helper>` function :php:func:`auto_link()` to add ``rel="noopener"`` to generated links in order to prevent tab hijacking.
- - Fixed a possible session fixation vulnerability where the :doc:`Session Library <libraries/sessions>` enabled ``session.use_strict_mode`` but it didn't actually do anything (thanks to Aamer Shah, Prasanna Kumar).
-
-- General Changes
-
- - Updated :doc:`Query Builder <database/query_builder>` method ``limit()`` to allow ``0`` values.
- - Updated :doc:`Email Library <libraries/email>` and :doc:`Form Validation Library <libraries/form_validation>` to discard the results of failed ``idn_to_ascii()`` calls while validating e-mail addresses.
-
-Bug fixes for 3.1.9
--------------------
-
-- Fixed a regression (#5448) - :doc:`Query Builder <database/query_builder>` methods ``like()``, ``or_like()`` (and siblings) didn't apply *dbprefix* or identifier escaping.
-- Fixed a regression (#5462) - :doc:`Query Builder <database/query_builder>` methods ``like()``, ``or_like()`` (and siblings) produced incorrect SQL syntax when used with ``'before'`` as the third parameter.
-- Fixed a bug (#5516) - :doc:`HTML Helper <helpers/html_helper>` functions :php:func:`img()`, :php:func:`link_tag()` would output results with double slashes if a prefix slash was included in their path inputs.
-
-Version 3.1.8
-=============
-
-Release Date: Mar 22, 2018
-
-- **Security**
-
- - Updated :doc:`Security Library <libraries/security>` method ``xss_clean()`` to also filter JavaScript tag functions.
- - Fixed a bug where :doc:`Security Library <libraries/security>` method ``xss_clean()`` didn't check for parentheses around JavaScript's ``document``.
-
-- General Changes
-
- - Updated :doc:`Email Library <libraries/email>` to always negotiate between TLS 1.0, 1.1, 1.2 when possible (PHP 5.6+) for SMTP connections.
- - Updated :doc:`Database Library <database/index>` method ``version()`` to exclude suffixes to the main version numbers with the 'postgre' driver.
-
-Bug fixes for 3.1.8
--------------------
-
-- Fixed a bug where :doc:`Form Validation Library <libraries/form_validation>`, :doc:`Email Library <libraries/email>` tried to use ``INTL_IDNA_VARIANT_UTS46`` when it was undeclared.
-- Fixed a bug where :doc:`Query Builder <database/query_builder>` methods ``where()``, ``having()`` treated values passed to them as arbitrary SQL.
-- Fixed a bug (#5423) - :doc:`Database Library <database/index>` method ``insert_id()`` failed due to incorrect server version parsing with the 'postgre' driver.
-- Fixed a bug (#5425) - :doc:`XML-RPC Library <libraries/xmlrpc>` produced an error message related to ``count()`` on PHP 7.2.
-- Fixed a bug (#5434) - :doc:`Image Manipulation Library <libraries/image_lib>` attempted to ``chmod()`` while rendering images with the ``dynamic_output`` option.
-- Fixed a bug (#5435) - :doc:`Database Results <database/results>` method ``field_data()`` hid info about one field if ``limit()`` was previously used with the 'oci8' driver.
-
-Version 3.1.7
-=============
-
-Release Date: Jan 13, 2018
-
-- General Changes
-
- - Updated :doc:`Form Validation Library <libraries/form_validation>` rule ``valid_email`` to use ``INTL_IDNA_VARIANT_UTS46`` for non-ASCII domain names.
- - Updated :doc:`Email Library <libraries/email>` to use ``INTL_IDNA_VARIANT_UTS46`` for non-ASCII domain names.
- - Updated :doc:`Loader Library <libraries/loader>` method ``model()`` to log both ``CI_Model`` class loading and individual models' initialization.
- - Updated :doc:`Pagination Library <libraries/pagination>` to preserve previously set attributes while calling ``initialize()``.
- - Updated :doc:`Cache Library <libraries/caching>` to automatically add items to cache on ``increment()``, ``decrement()`` calls for missing keys.
- - Deprecated usage of :doc:`CAPTCHA Helper <helpers/captcha_helper>` function :php:func:`create_captcha()` with parameters other than ``$data``.
-
-Bug fixes for 3.1.7
--------------------
-
-- Fixed a regression (#5276) - :doc:`Database Utilities <database/utilities>` method ``backup()`` generated incorrect ``INSERT`` statements with the 'mysqli' driver.
-- Fixed a regression where :doc:`Database Results <database/results>` method ``field_data()`` returned incorrect type names.
-- Fixed a bug (#5278) - :doc:`URL Helper <helpers/url_helper>` function :php:func:`auto_link()` didn't detect trailing slashes in URLs.
-- Fixed a regression (#5282) - :doc:`Query Builder <database/query_builder>` method ``count_all_results()`` breaks ``ORDER BY`` clauses for subsequent queries.
-- Fixed a bug (#5279) - :doc:`Query Builder <database/query_builder>` didn't account for already escaped identifiers while applying database name prefixes.
-- Fixed a bug (#5331) - :doc:`URL Helper <helpers/url_helper>` function :php:func:`auto_link()` converted e-mail addresses starting with 'www.' to both "url" and "email" links.
-- Fixed a bug where ``$config['allow_get_array']`` defaulted to ``FALSE`` if it didn't exist in the config file.
-- Fixed a bug (#5379) - :doc:`Session Library <libraries/sessions>` would incorrectly fail to obtain a lock that it already has on PHP 7 with the 'memcached' driver.
-
-Version 3.1.6
-=============
-
-Release Date: Sep 25, 2017
-
-- **Security**
-
- - Fixed a potential object injection in :doc:`Cache Library <libraries/caching>` 'apc' driver when ``save()`` is used with ``$raw = TRUE`` (thanks to Tomas Bortoli).
-
-- General Changes
-
- - Deprecated :doc:`Cache Library Library <libraries/caching>` driver 'apc'.
- - Updated the :doc:`Session Library <libraries/sessions>` 'redis', 'memcached' drivers to reduce the potential of a locking race conditions.
-
-
-Bug fixes for 3.1.6
--------------------
-
-- Fixed a bug (#5164) - :doc:`Loader Library <libraries/loader>` method ``library()`` ignored requests to load libraries previously assigned to super-object properties named differently than the library name.
-- Fixed a bug (#5168) - :doc:`Query Builder <database/query_builder>` method ``count_all_results()`` produced erroneous queries on Microsoft SQL Server when ``ORDER BY`` clauses are cached.
-- Fixed a bug (#5128) - :doc:`Profiler <general/profiling>` didn't wrap ``$_SESSION`` and configuration arrays in ``<pre>`` tags.
-- Fixed a bug (#5183) - :doc:`Database Library <database/index>` method ``is_write_type()`` didn't return TRUE for ``MERGE`` statements.
-- Fixed a bug where :doc:`Image Manipulation Library <libraries/image_lib>` didn't escape image source paths passed to NetPBM as shell arguments.
-- Fixed a bug (#5236) - :doc:`Query Builder <database/query_builder>` methods ``limit()``, ``offset()`` break SQL Server 2005, 2008 queries with ``"<tablename>".*`` in the ``SELECT`` clause.
-- Fixed a bug (#5243) - :doc:`Database Library <database/index>` method ``version()`` didn't work with the 'pdo/dblib' driver.
-- Fixed a bug (#5246) - :doc:`Database transactions <database/transactions>` status wasn't reset unless ``trans_complete()`` was called.
-- Fixed a bug (#5260) - :doc:`Database Utilities <database/utilities>` method ``backup()`` generated incorrect ``INSERT`` statements with the 'mysqli' driver.
-- Fixed a bug where :doc:`Database Results <database/results>` method ``field_data()`` didn't parse field types with the 'mysqli' driver.
-
-Version 3.1.5
-=============
-
-Release Date: Jun 19, 2017
-
-- **Security**
-
- - :doc:`Form Validation Library <libraries/form_validation>` rule ``valid_email`` could be bypassed if ``idn_to_ascii()`` is available.
-
-- General Changes
-
- - Updated :doc:`Form Helper <helpers/form_helper>` function :php:func:`form_label()` to accept HTML attributes as a string.
-
-Bug fixes for 3.1.5
--------------------
-
-- Fixed a bug (#5070) - :doc:`Email Library <libraries/email>` didn't properly detect 7-bit encoding.
-- Fixed a bug (#5084) - :doc:`XML-RPC Library <libraries/xmlrpc>` errored because of a variable name typo.
-- Fixed a bug (#5108) - :doc:`Inflector Helper <helpers/inflector_helper>` function :php:func:`singular()` didn't properly handle 'quizzes'.
-- Fixed a regression (#5131) - private controller methods triggered PHP errors instead of a 404 response.
-- Fixed a bug (#5150) - :doc:`Database Forge <database/forge>` method ``modify_column()`` triggered an error while renaming columns with the 'oci8', 'pdo/oci' drivers.
-- Fixed a bug (#5155) - :doc:`Query Builder <database/query_builder>` method ``count_all_results()`` returned incorrect result for queries using ``LIMIT``, ``OFFSET``.
-
-Version 3.1.4
-=============
-
-Release Date: Mar 20, 2017
-
-- **Security**
-
- - Fixed a header injection vulnerability in :doc:`common function <general/common_functions>` :php:func:`set_status_header()` under Apache (thanks to Guillermo Caminer from `Flowgate <https://flowgate.net/>`_).
- - Fixed byte-safety issues in :doc:`Encrypt Library <libraries/encrypt>` (DEPRECATED) when ``mbstring.func_overload`` is enabled.
- - Fixed byte-safety issues in :doc:`Encryption Library <libraries/encryption>` when ``mbstring.func_overload`` is enabled.
- - Fixed byte-safety issues in :doc:`compatibility functions <general/compatibility_functions>` ``password_hash()``, ``hash_pbkdf2()`` when ``mbstring.func_overload`` is enabled.
- - Updated :doc:`Encrypt Library <libraries/encrypt>` (DEPRECATED) to call ``mcrypt_create_iv()`` with ``MCRYPT_DEV_URANDOM``.
-
-- General Changes
-
- - Updated the :doc:`Image Manipulation Library <libraries/image_lib>` to work-around an issue with some JPEGs when using GD.
-
-Bug fixes for 3.1.4
--------------------
-
-- Fixed a regression (#4975) - :doc:`Loader Library <libraries/loader>` couldn't handle objects passed as view variables.
-- Fixed a bug (#4977) - :doc:`Loader Library <libraries/loader>` method ``helper()`` could accept any character as a filename extension separator.
-- Fixed a regression where the :doc:`Session Library <libraries/sessions>` would fail on a ``session_regenerate_id(TRUE)`` call with the 'database' driver.
-- Fixed a bug (#4987) - :doc:`Query Builder <database/query_builder>` caching didn't keep track of table aliases.
-- Fixed a bug where :doc:`Text Helper <helpers/text_helper>` function ``ascii_to_entities()`` wasn't byte-safe when ``mbstring.func_overload`` is enabled.
-- Fixed a bug where ``CI_Log``, ``CI_Output``, ``CI_Email`` and ``CI_Zip`` didn't handle strings in a byte-safe manner when ``mbstring.func_overload`` is enabled.
-- Fixed a bug where :doc:`Session Library <libraries/sessions>` didn't read session data in a byte-safe manner when ``mbstring.func_overload`` is enabled.
-- Fixed a bug (#4990) - :doc:`Profiler <general/profiling>` didn't close ``<pre>`` tags it generated.
-- Fixed a bug (#4990) - :doc:`Profiler <general/profiling>` didn't HTML-escape quotes for ``$_SESSION`` variables.
-- Fixed a bug where :doc:`Input Library <libraries/input>` method ``set_cookie()`` didn't allow its *httponly* and *secure* parameters to be overriden to ``FALSE``.
-- Fixed a bug (#5006) - :doc:`common function <general/common_functions>` :php:func:`get_mimes()` didn't load *application/config/mimes.php* if an environment specific config exists.
-- Fixed a bug (#5006) - :doc:`common function <general/common_functions>` :php:func:`remove_invisible_characters()` didn't remove URL-encoded ``0x7F``.
-- Fixed a bug (#4815) - :doc:`Database Library <database/index>` stripped URL-encoded sequences while escaping strings with the 'mssql' driver.
-- Fixed a bug (#5044) - :doc:`HTML Helper <helpers/html_helper>` function :php:func:`img()` didn't accept ``data:`` URI schemes for the image source.
-- Fixed a bug (#5050) - :doc:`Database Library <database/index>` tried to access an undefined property in a number of error handling cases.
-- Fixed a bug (#5057) - :doc:`Database <database/index>` driver 'postgre' didn't actually apply extra options (such as 'connect_timeout') to its DSN.
-
-Version 3.1.3
-=============
-
-Release Date: Jan 09, 2017
-
-- **Security**
-
- - Fixed an XSS vulnerability in :doc:`Security Library <libraries/security>` method ``xss_clean()``.
- - Fixed a possible file inclusion vulnerability in :doc:`Loader Library <libraries/loader>` method ``vars()``.
- - Fixed a possible remote code execution vulnerability in the :doc:`Email Library <libraries/email>` when 'mail' or 'sendmail' are used (thanks to Paul Buonopane from `NamePros <https://www.namepros.com/>`_).
- - Added protection against timing side-channel attacks in :doc:`Security Library <libraries/security>` method ``csrf_verify()``.
- - Added protection against BREACH attacks targeting the CSRF token field generated by :doc:`Form Helper <helpers/form_helper>` function :php:func:`form_open()`.
-
-- General Changes
-
- - Deprecated ``$config['allow_get_array']``.
- - Deprecated ``$config['standardize_newlines']``.
- - Deprecated :doc:`Date Helper <helpers/date_helper>` function :php:func:`nice_date()`.
-
-Bug fixes for 3.1.3
--------------------
-
-- Fixed a bug (#4886) - :doc:`Database Library <database/index>` didn't differentiate bind markers inside double-quoted strings in queries.
-- Fixed a bug (#4890) - :doc:`XML-RPC Library <libraries/xmlrpc>` didn't work on PHP 7.
-- Fixed a regression (#4887) - :doc:`File Uploading Library <libraries/file_uploading>` triggered fatal errors due to numerous PHP distribution channels (XAMPP and cPanel confirmed) explicitly disabling ext/fileinfo by default.
-- Fixed a bug (#4679) - :doc:`Input Library <libraries/input>` method ``ip_address()`` didn't properly resolve ``$config['proxy_ips']`` IPv6 addresses.
-- Fixed a bug (#4902) - :doc:`Image Manipulation Library <libraries/image_lib>` processing via ImageMagick didn't work.
-- Fixed a bug (#4905) - :doc:`Loader Library <libraries/loader>` didn't take into account possible user-provided directory paths when loading helpers.
-- Fixed a bug (#4916) - :doc:`Session Library <libraries/sessions>` with ``sess_match_ip`` enabled was unusable for IPv6 clients when using the 'database' driver on MySQL 5.7.5+.
-- Fixed a bug (#4917) - :doc:`Date Helper <helpers/date_helper>` function :php:func:`nice_date()` didn't handle YYYYMMDD inputs properly.
-- Fixed a bug (#4923) - :doc:`Session Library <libraries/sessions>` could execute an erroneous SQL query with the 'database' driver, if the lock attempt times out.
-- Fixed a bug (#4927) - :doc:`Output Library <libraries/output>` method ``get_header()`` returned the first matching header, regardless of whether it would be replaced by a second ``set_header()`` call.
-- Fixed a bug (#4844) - :doc:`Email Library <libraries/email>` didn't apply ``escapeshellarg()`` to the while passing the Sendmail ``-f`` parameter through ``popen()``.
-- Fixed a bug (#4928) - the bootstrap file didn't check if *config/constants.php* exists before trying to load it.
-- Fixed a bug (#4937) - :doc:`Image Manipulation Library <libraries/image_lib>` method ``initialize()`` didn't translate *new_image* inputs to absolute paths.
-- Fixed a bug (#4941) - :doc:`Query Builder <database/query_builder>` method ``order_by()`` didn't work with 'RANDOM' under the 'pdo/sqlite' driver.
-- Fixed a regression (#4892) - :doc:`Query Builder <database/query_builder>` method ``update_batch()`` didn't properly handle identifier escaping.
-- Fixed a bug (#4953) - :doc:`Database Forge <database/forge>` method ``create_table()`` didn't update an internal tables list cache if it exists but is empty.
-- Fixed a bug (#4958) - :doc:`Query Builder <database/query_builder>` method ``count_all_results()`` didn't take into account cached ``ORDER BY`` clauses.
-- Fixed a bug (#4804) - :doc:`Query Builder <database/query_builder>` method ``insert_batch()`` could fail if the input array pointer was modified.
-- Fixed a bug (#4962) - :doc:`Database Force <database/forge>` method ``alter_table()`` would fail with the 'oci8' driver.
-- Fixed a bug (#4457) - :doc:`Image Manipulation Library <libraries/image_lib>` method ``get_image_properties()`` didn't detect invalid images.
-- Fixed a bug (#4765) - :doc:`Email Library <libraries/email>` didn't send the ``User-Agent`` header without a prior call to ``clear()``.
-
-Version 3.1.2
-=============
-
-Release Date: Oct 28, 2016
-
-- **Security**
-
- - Fixed a number of new vulnerabilities in :doc:`Security Library <libraries/security>` method ``xss_clean()``.
-
-- General Changes
-
- - Allowed PHP 4-style constructors (``Matching_name::Matching_name()`` methods) to be used as routes, if there's a ``__construct()`` to override them.
-
-Bug fixes for 3.1.2
--------------------
-
-- Fixed a regression (#4874) - :doc:`Session Library <libraries/sessions>` didn't take into account ``session.hash_bits_per_character`` when validating session IDs.
-- Fixed a bug (#4871) - :doc:`Query Builder <database/query_builder>` method ``update_batch()`` didn't properly handle identifier escaping.
-- Fixed a bug (#4884) - :doc:`Query Builder <database/query_builder>` didn't properly parse field names ending in 'is' when used inside WHERE and HAVING statements.
-- Fixed a bug where ``CI_Log``, ``CI_Output``, ``CI_Email`` and ``CI_Zip`` didn't handle strings in a byte-safe manner when ``mbstring.func_overload`` is enabled.
-
-Version 3.1.1
-=============
-
-Release Date: Oct 22, 2016
-
-- **Security**
-
- - Fixed a flaw in :doc:`Security Library <libraries/security>` method ``entity_decode()`` (used by ``xss_clean()``) that affects HTML 5 entities when using PHP 5.3.
-
-- General Changes
-
- - Added ``E_PARSE`` to the list of error levels detected by the shutdown handler.
- - Updated :doc:`Inflector Helper <helpers/inflector_helper>` ``is_countable()`` with more words.
- - Updated :doc:`common function <general/common_functions>` :php:func:`set_status_header()` with new status codes from IETF RFCs
- `2817 <https://tools.ietf.org/html/rfc2817>`_ (426)
- and `6585 <https://tools.ietf.org/html/rfc6585>`_ (428, 429, 431, 511).
-
-Bug fixes for 3.1.1
--------------------
-
-- Fixed a bug (#4732) - :doc:`Session Library <libraries/sessions>` triggered errors while writing data for a newly-created sessions with the 'memcached' driver.
-- Fixed a regression (#4736) - :doc:`Image Manipulation Library <libraries/image_lib>` processing via ImageMagick didn't work.
-- Fixed a bug (#4737) - :doc:`Query Builder <database/query_builder>` didn't add an ``OFFSET`` when ``LIMIT`` is zero or unused.
-- Fixed a regression (#4739) - :doc:`Email Library <libraries/email>` doesn't properly separate attachment bodies from headers.
-- Fixed a bug (#4754) - :doc:`Unit Testing Library <libraries/unit_testing>` method ``result()`` didn't translate ``res_datatype``.
-- Fixed a bug (#4759) - :doc:`Form Validation <libraries/form_validation>`, :doc:`Trackback <libraries/trackback>` and :doc:`XML-RPC <libraries/xmlrpc>` libraries treated URI schemes in a case-sensitive manner.
-- Fixed a bug (#4762) - :doc:`Cache Library <libraries/caching>` 'file' driver method ``get_metadata()`` checked TTL time against ``mtime`` instead of the cache item's creation time.
-- Fixed a bug where :doc:`File Uploading Library <libraries/file_uploading>` generated error messages on PHP 7.1.
-- Fixed a bug (#4780) - :doc:`compatibility function <general/compatibility_functions>` ``hex2bin()`` didn't reject inputs of type "resource".
-- Fixed a bug (#4787) - :doc:`Form Validation Library <libraries/form_validation>` method ``valid_email()`` triggered ``E_WARNING`` when input emails have empty domain names.
-- Fixed a bug (#4805) - :doc:`Database <database/index>` driver 'mysqli' didn't use the ``MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT`` flag properly.
-- Fixed a bug (#4808) - :doc:`Database <database/index>` method ``is_write_type()`` only looked at the first line of a queries using ``RETURNING`` with the 'postgre', 'pdo/pgsql', 'odbc' and 'pdo/odbc' drivers.
-- Fixed a bug where :doc:`Query Builder <database/query_builder>` method ``insert_batch()`` tried to execute an unsupported SQL query with the 'ibase' and 'pdo/firebird' drivers.
-- Fixed a bug (#4809) - :doc:`Database <database/index>` driver 'pdo/mysql' didn't turn off ``AUTOCOMMIT`` when starting a transaction.
-- Fixed a bug (#4822) - :doc:`CAPTCHA Helper <helpers/captcha_helper>` didn't clear expired PNG images.
-- Fixed a bug (#4823) - :doc:`Session Library <libraries/sessions>` 'files' driver could enter an infinite loop if ``mbstring.func_overload`` is enabled.
-- Fixed a bug (#4851) - :doc:`Database Forge <database/forge>` didn't quote schema names passed to its ``create_database()`` method.
-- Fixed a bug (#4863) - :doc:`HTML Table Library <libraries/table>` method ``set_caption()`` was missing method chaining support.
-- Fixed a bug (#4843) - :doc:`XML-RPC Library <libraries/xmlrpc>` client class didn't set a read/write socket timeout.
-- Fixed a bug (#4865) - uncaught exceptions didn't set the HTTP Response status code to 500 unless ``display_errors`` was turned On.
-- Fixed a bug (#4830) - :doc:`Session Library <libraries/sessions>` didn't take into account the new session INI settings in PHP 7.1.
-
-Version 3.1.0
-=============
-
-Release Date: July 26, 2016
-
-- **Security**
-
- - Fixed an SQL injection in the 'odbc' database driver.
- - Updated :php:func:`set_realpath()` :doc:`Path Helper <helpers/path_helper>` function to filter-out ``php://`` wrapper inputs.
- - Officially dropped any kind of support for PHP 5.2.x and anything under 5.3.7.
-
-- General Changes
-
- - Updated :doc:`Image Manipulation Library <libraries/image_lib>` to validate *width* and *height* configuration values.
- - Updated :doc:`Encryption Library <libraries/encryption>` to always prefer ``random_bytes()`` when it is available.
- - Updated :doc:`Session Library <libraries/sessions>` to log 'debug' messages when using fallbacks to *session.save_path* (php.ini) or 'sess_use_database', 'sess_table_name' settings.
- - Added a 'LONGTEXT' to 'STRING' alias to :doc:`Database Forge <database/forge>` for the 'cubrid', 'pdo/cubrid' drivers.
- - Added 'TINYINT', 'MEDIUMINT', 'INT' and 'BIGINT' aliases to 'NUMBER' to :doc:`Database Forge <database/forge>` for the 'oci8', 'pdo/oci' drivers.
-
- - :php:func:`password_hash()` :doc:`compatibility function <general/compatibility_functions>` changes:
-
- - Changed salt-generation logic to prefer ``random_bytes()`` when it is available.
- - Changed salt-generation logic to prefer direct access to */dev/urandom* over ``openssl_random_pseudo_bytes()``.
- - Changed salt-generation logic to error if ``openssl_random_pseudo_bytes()`` sets its ``$crypto_strong`` flag to FALSE.
-
-Bug fixes for 3.1.0
--------------------
-
-- Fixed a bug where :doc:`Image Manipulation Library <libraries/image_lib>` didn't escape image source paths passed to ImageMagick as shell arguments.
-- Fixed a bug (#861) - :doc:`Database Forge <database/forge>` method ``create_table()`` incorrectly accepts field width constraints for MSSQL/SQLSRV integer-type columns.
-- Fixed a bug (#4562) - :doc:`Cache Library <libraries/caching>` didn't check if ``Memcached::quit()`` is available before calling it.
-- Fixed a bug (#4563) - :doc:`Input Library <libraries/input>` method ``request_headers()`` ignores ``$xss_clean`` parameter value after first call.
-- Fixed a bug (#4605) - :doc:`Config Library <libraries/config>` method ``site_url()`` stripped trailing slashes from relative URIs passed to it.
-- Fixed a bug (#4613) - :doc:`Email Library <libraries/email>` failed to send multiple emails via SMTP due to "already authenticated" errors when keep-alive is enabled.
-- Fixed a bug (#4633) - :doc:`Form Validation Library <libraries/form_validation>` ignored multiple "callback" rules for empty, non-required fields.
-- Fixed a bug (#4637) - :doc:`Database <database/index>` method ``error()`` returned ``FALSE`` with the 'oci8' driver if there was no error.
-- Fixed a bug (#4647) - :doc:`Query Builder <database/query_builder>` method ``count_all_results()`` doesn't take into account ``GROUP BY`` clauses while deciding whether to do a subquery or not.
-- Fixed a bug where :doc:`Session Library <libraries/sessions>` 'redis' driver didn't properly detect if a connection is properly closed on PHP 5.x.
-- Fixed a bug (#4583) - :doc:`Email Library <libraries/email>` didn't properly handle inline attachments in HTML emails.
-- Fixed a bug where :doc:`Database <database/index>` method ``db_select()`` didn't clear metadata cached for the previously used database.
-- Fixed a bug (#4675) - :doc:`File Helper <helpers/file_helper>` function :php:func:`delete_files()` treated symbolic links as regular directories.
-- Fixed a bug (#4674) - :doc:`Database <database/index>` driver 'dblib' triggered E_WARNING messages while connecting.
-- Fixed a bug (#4678) - :doc:`Database Forge <database/forge>` tried to use unsupported ``IF NOT EXISTS`` clause when creating tables on Oracle.
-- Fixed a bug (#4691) - :doc:`File Uploading Library <libraries/file_uploading>` method ``data()`` returns wrong 'raw_name' when the filename extension is also contained in the raw filename.
-- Fixed a bug (#4679) - :doc:`Input Library <libraries/input>` method ``ip_address()`` errors with a matching ``$config['proxy_ips']`` IPv6 address.
-- Fixed a bug (#4695) - :doc:`User Agent Library <libraries/user_agent>` didn't load the *config/user_agents.php* file when there's no ``User-Agent`` HTTP request header.
-- Fixed a bug (#4713) - :doc:`Query Builder <database/query_builder>` methods ``insert_batch()``, ``update_batch()`` could return wrong affected rows count.
-- Fixed a bug (#4712) - :doc:`Email Library <libraries/email>` doesn't sent ``RSET`` to SMTP servers after a failure and while using keep-alive.
-- Fixed a bug (#4724) - :doc:`Common function <general/common_functions>` :php:func:`is_https()` compared the ``X-Forwarded-Proto`` HTTP header case-sensitively.
-- Fixed a bug (#4725) - :doc:`Common function <general/common_functions>` :php:func:`remove_invisible_characters()` searched case-sensitively for URL-encoded characters.
-
-Version 3.0.6
-=============
-
-Release Date: March 21, 2016
-
-- General Changes
-
- - Added a destructor to :doc:`Cache Library <libraries/caching>` 'memcached' driver to ensure that Memcache(d) connections are properly closed.
- - Deprecated :doc:`Form Validation Library <libraries/form_validation>` method ``prep_for_form()``.
-
-Bug fixes for 3.0.6
--------------------
-
-- Fixed a bug (#4516) - :doc:`Form Validation Library <libraries/form_validation>` always accepted empty array inputs.
-- Fixed a bug where :doc:`Session Library <libraries/sessions>` allowed accessing ``$_SESSION`` values as class properties but ``isset()`` didn't work on them.
-- Fixed a bug where :doc:`Form Validation Library <libraries/form_validation>` modified the ``$_POST`` array when the data being validated was actually provided via ``set_data()``.
-- Fixed a bug (#4539) - :doc:`Migration Library <libraries/migration>` applied migrations before validating that all migrations within the requested version range are valid.
-- Fixed a bug (#4539) - :doc:`Migration Library <libraries/migration>` triggered failures for migrations that are out of the requested version range.
-
-Version 3.0.5
-=============
-
-Release Date: March 11, 2016
-
-- Core
-
- - Changed :doc:`Loader Library <libraries/loader>` to allow ``$autoload['drivers']`` assigning with custom property names.
- - Changed :doc:`Loader Library <libraries/loader>` to ignore variables prefixed with '_ci_' when loading views.
-
-- General Changes
-
- - Updated the :doc:`Session Library <libraries/sessions>` to produce friendlier error messages on failures with drivers other than 'files'.
-
-- :doc:`Query Builder <database/query_builder>`
-
- - Added a ``$batch_size`` parameter to the ``insert_batch()`` method (defaults to 100).
- - Added a ``$batch_size`` parameter to the ``update_batch()`` method (defaults to 100).
-
-Bug fixes for 3.0.5
--------------------
-
-- Fixed a bug (#4391) - :doc:`Email Library <libraries/email>` method ``reply_to()`` didn't apply Q-encoding.
-- Fixed a bug (#4384) - :doc:`Pagination Library <libraries/pagination>` ignored (possible) *cur_page* configuration value.
-- Fixed a bug (#4395) - :doc:`Query Builder <database/query_builder>` method ``count_all_results()`` still fails if an ``ORDER BY`` condition is used.
-- Fixed a bug (#4399) - :doc:`Query Builder <database/query_builder>` methods ``insert_batch()``, ``update_batch()`` produced confusing error messages when called with no data and *db_debug* is enabled.
-- Fixed a bug (#4401) - :doc:`Query Builder <database/query_builder>` breaks ``WHERE`` and ``HAVING`` conditions that use ``IN()`` with strings containing a closing parenthesis.
-- Fixed a regression in :doc:`Form Helper <helpers/form_helper>` functions :php:func:`set_checkbox()`, :php:func:`set_radio()` where "checked" inputs aren't recognized after a form submit.
-- Fixed a bug (#4407) - :doc:`Text Helper <helpers/text_helper>` function :php:func:`word_censor()` doesn't work under PHP 7 if there's no custom replacement provided.
-- Fixed a bug (#4415) - :doc:`Form Validation Library <libraries/form_validation>` rule **valid_url** didn't accept URLs with IPv6 addresses enclosed in square brackets under PHP 5 (upstream bug).
-- Fixed a bug (#4427) - :doc:`CAPTCHA Helper <helpers/captcha_helper>` triggers an error if the provided character pool is too small.
-- Fixed a bug (#4430) - :doc:`File Uploading Library <libraries/file_uploading>` option **file_ext_tolower** didn't work.
-- Fixed a bug (#4431) - :doc:`Query Builder <database/query_builder>` method ``join()`` discarded opening parentheses.
-- Fixed a bug (#4424) - :doc:`Session Library <libraries/sessions>` triggered a PHP warning when writing a newly created session with the 'redis' driver.
-- Fixed a bug (#4437) - :doc:`Inflector Helper <helpers/inflector_helper>` function :php:func:`humanize()` didn't escape its ``$separator`` parameter while using it in a regular expression.
-- Fixed a bug where :doc:`Session Library <libraries/sessions>` didn't properly handle its locks' statuses with the 'memcached' driver.
-- Fixed a bug where :doc:`Session Library <libraries/sessions>` triggered a PHP warning when writing a newly created session with the 'memcached' driver.
-- Fixed a bug (#4449) - :doc:`Query Builder <database/query_builder>` method ``join()`` breaks conditions containing ``IS NULL``, ``IS NOT NULL``.
-- Fixed a bug (#4491) - :doc:`Session Library <libraries/sessions>` didn't clean-up internal variables for emulated locks with the 'redis' driver.
-- Fixed a bug where :doc:`Session Library <libraries/sessions>` didn't clean-up internal variables for emulated locks with the 'memcached' driver.
-- Fixed a bug where :doc:`Database <database/index>` transactions didn't work with the 'ibase' driver.
-- Fixed a bug (#4475) - :doc:`Security Library <libraries/security>` method ``strip_image_tags()`` preserves only the first URL character from non-quoted *src* attributes.
-- Fixed a bug where :doc:`Profiler Library <general/profiling>` didn't apply ``htmlspecialchars()`` to all displayed inputs.
-- Fixed a bug (#4277) - :doc:`Cache Library <libraries/caching>` triggered fatal errors if accessing the Memcache(d) and/or Redis driver and they are not available on the system.
-- Fixed a bug where :doc:`Cache Library <libraries/caching>` method ``is_supported()`` logged an error message when it returns ``FALSE`` for the APC and Wincache drivers.
-
-Version 3.0.4
-=============
-
-Release Date: January 13, 2016
-
-- General Changes
-
- - Updated :doc:`Security Library <libraries/security>` method ``get_random_bytes()`` to use PHP 7's ``random_bytes()`` function when possible.
- - Updated :doc:`Encryption Library <libraries/security>` method ``create_key()`` to use PHP 7's ``random_bytes()`` function when possible.
-
-- :doc:`Database <database/index>`
-
- - Added support for ``OFFSET-FETCH`` with Oracle 12c for the 'oci8' and 'pdo/oci' drivers.
- - Added support for the new ``MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT`` constant from `PHP 5.6.16 <https://secure.php.net/ChangeLog-5.php#5.6.16>`_ for the 'mysqli' driver.
-
-Bug fixes for 3.0.4
--------------------
-
-- Fixed a bug (#4212) - :doc:`Query Builder <database/query_builder>` method ``count_all_results()`` could fail if an ``ORDER BY`` condition is used.
-- Fixed a bug where :doc:`Form Helper <helpers/form_helper>` functions :php:func:`set_checkbox()`, :php:func:`set_radio()` didn't "uncheck" inputs on a submitted form if the default state is "checked".
-- Fixed a bug (#4217) - :doc:`Config Library <libraries/config>` method ``base_url()`` didn't use proper formatting for IPv6 when it falls back to ``$_SERVER['SERVER_ADDR']``.
-- Fixed a bug where :doc:`CAPTCHA Helper <helpers/captcha_helper>` entered an infinite loop while generating a random string.
-- Fixed a bug (#4223) - :doc:`Database <database/index>` method ``simple_query()`` blindly executes queries without checking if the connection was initialized properly.
-- Fixed a bug (#4244) - :doc:`Email Library <libraries/email>` could improperly use "unsafe" US-ASCII characters during Quoted-printable encoding.
-- Fixed a bug (#4245) - :doc:`Database Forge <database/forge>` couldn't properly handle ``SET`` and ``ENUM`` type fields with string values.
-- Fixed a bug (#4283) - :doc:`String Helper <helpers/string_helper>` function :php:func:`alternator()` couldn't be called without arguments.
-- Fixed a bug (#4306) - :doc:`Database <database/index>` method ``version()`` didn't work properly with the 'mssql' driver.
-- Fixed a bug (#4039) - :doc:`Session Library <libraries/sessions>` could generate multiple (redundant) warnings in case of a read failure with the 'files' driver, due to a bug in PHP.
-- Fixed a bug where :doc:`Session Library <libraries/sessions>` didn't have proper error handling on PHP 5 (due to a PHP bug).
-- Fixed a bug (#4312) - :doc:`Form Validation Library <libraries/form_validation>` didn't provide error feedback for failed validation on empty requests.
-- Fixed a bug where :doc:`Database <database/index>` method `version()` returned banner text instead of only the version number with the 'oci8' and 'pdo/oci' drivers.
-- Fixed a bug (#4331) - :doc:`Database <database/index>` method ``error()`` didn't really work for connection errors with the 'mysqli' driver.
-- Fixed a bug (#4343) - :doc:`Email Library <libraries/email>` failing with a *"More than one 'from' person"* message when using *sendmail*.
-- Fixed a bug (#4350) - :doc:`Loader Library <libraries/loader>` method ``model()`` logic directly instantiated the ``CI_Model`` or ``MY_Model`` classes.
-- Fixed a bug (#4337) - :doc:`Database <database/index>` method ``query()`` didn't return a result set for queries with the ``RETURNING`` statement on PostgreSQL.
-- Fixed a bug (#4362) - :doc:`Session Library <libraries/sessions>` doesn't properly maintain its state after ID regeneration with the 'redis' and 'memcached' drivers on PHP 7.
-- Fixed a bug (#4349) - :doc:`Database <database/index>` drivers 'mysql', 'mysqli', 'pdo/mysql' discard other ``sql_mode`` flags when "stricton" is enabled.
-- Fixed a bug (#4349) - :doc:`Database <database/index>` drivers 'mysql', 'mysqli', 'pdo/mysql' don't turn off ``STRICT_TRANS_TABLES`` on MySQL 5.7+ when "stricton" is disabled.
-- Fixed a bug (#4374) - :doc:`Session Library <libraries/sessions>` with the 'database' driver could be affected by userspace :doc:`Query Builder <database/query_builder>` conditions.
-
-Version 3.0.3
-=============
-
-Release Date: October 31, 2015
-
-- **Security**
-
- - Fixed an XSS attack vector in :doc:`Security Library <libraries/security>` method ``xss_clean()``.
- - Changed :doc:`Config Library <libraries/config>` method ``base_url()`` to fallback to ``$_SERVER['SERVER_ADDR']`` when ``$config['base_url']`` is empty in order to avoid *Host* header injections.
- - Changed :doc:`CAPTCHA Helper <helpers/captcha_helper>` to use the operating system's PRNG when possible.
-
-- :doc:`Database <database/index>`
-
- - Optimized :doc:`Database Utility <database/utilities>` method ``csv_from_result()`` for speed with larger result sets.
- - Added proper return values to :doc:`Database Transactions <database/transactions>` method ``trans_start()``.
-
-Bug fixes for 3.0.3
--------------------
-
-- Fixed a bug (#4170) - :doc:`Database <database/index>` method ``insert_id()`` could return an identity from the wrong scope with the 'sqlsrv' driver.
-- Fixed a bug (#4179) - :doc:`Session Library <libraries/sessions>` doesn't properly maintain its state after ID regeneration with the 'database' driver on PHP 7.
-- Fixed a bug (#4173) - :doc:`Database Forge <database/forge>` method ``add_key()`` didn't allow creation of non-PRIMARY composite keys after the "bugfix" for #3968.
-- Fixed a bug (#4171) - :doc:`Database Transactions <database/transactions>` didn't work with nesting in methods ``trans_begin()``, ``trans_commit()``, ``trans_rollback()``.
-- Fixed a bug where :doc:`Database Transaction <database/transactions>` methods ``trans_begin()``, ``trans_commit()``, ``trans_rollback()`` ignored failures.
-- Fixed a bug where all :doc:`Database Transaction <database/transactions>` methods returned TRUE while transactions are actually disabled.
-- Fixed a bug where :doc:`common function <general/common_functions>` :php:func:`html_escape()` modified keys of its array inputs.
-- Fixed a bug (#4192) - :doc:`Email Library <libraries/email>` wouldn't always have proper Quoted-printable encoding due to a bug in PHP's own ``mb_mime_encodeheader()`` function.
-
-Version 3.0.2
-=============
-
-Release Date: October 8, 2015
-
-- **Security**
-
- - Fixed a number of XSS attack vectors in :doc:`Security Library <libraries/security>` method ``xss_clean()`` (thanks to Frans Rosén from `Detectify <https://detectify.com/>`_).
-
-- General Changes
-
- - Updated the *application/config/constants.php* file to check if constants aren't already defined before doing that.
- - Changed :doc:`Loader Library <libraries/loader>` method ``model()`` to only apply ``ucfirst()`` and not ``strtolower()`` to the requested class name.
- - Changed :doc:`Config Library <libraries/config>` methods ``base_url()``, ``site_url()`` to allow protocol-relative URLs by passing an empty string as the protocol.
-
-Bug fixes for 3.0.2
--------------------
-
-- Fixed a bug (#2284) - :doc:`Database <database/index>` method ``protect_identifiers()`` breaks when :doc:`Query Builder <database/query_builder>` isn't enabled.
-- Fixed a bug (#4052) - :doc:`Routing <general/routing>` with anonymous functions didn't work for routes that don't use regular expressions.
-- Fixed a bug (#4056) - :doc:`Input Library <libraries/input>` method ``get_request_header()`` could not return a value unless ``request_headers()`` was called beforehand.
-- Fixed a bug where the :doc:`Database Class <database/index>` entered an endless loop if it fails to connect with the 'sqlsrv' driver.
-- Fixed a bug (#4065) - :doc:`Database <database/index>` method ``protect_identifiers()`` treats a traling space as an alias separator if the input doesn't contain ' AS '.
-- Fixed a bug (#4066) - :doc:`Cache Library <libraries/caching>` couldn't fallback to a backup driver if the primary one is Memcache(d) or Redis.
-- Fixed a bug (#4073) - :doc:`Email Library <libraries/email>` method ``send()`` could return TRUE in case of an actual failure when an SMTP command fails.
-- Fixed a bug (#4086) - :doc:`Query Builder <database/query_builder>` didn't apply *dbprefix* to LIKE conditions if the pattern included spaces.
-- Fixed a bug (#4091) - :doc:`Cache Library <libraries/caching>` 'file' driver could be tricked into accepting empty cache item IDs.
-- Fixed a bug (#4093) - :doc:`Query Builder <database/query_builder>` modified string values containing 'AND', 'OR' while compiling WHERE conditions.
-- Fixed a bug (#4096) - :doc:`Query Builder <database/query_builder>` didn't apply *dbprefix* when compiling BETWEEN conditions.
-- Fixed a bug (#4105) - :doc:`Form Validation Library <libraries/form_validation>` didn't allow pipe characters inside "bracket parameters" when using a string ruleset.
-- Fixed a bug (#4109) - :doc:`Routing <general/routing>` to *default_controller* didn't work when *enable_query_strings* is set to TRUE.
-- Fixed a bug (#4044) - :doc:`Cache Library <libraries/caching>` 'redis' driver didn't catch ``RedisException`` that could be thrown during authentication.
-- Fixed a bug (#4120) - :doc:`Database <database/index>` method ``error()`` didn't return error info when called after ``query()`` with the 'mssql' driver.
-- Fixed a bug (#4116) - :doc:`Pagination Library <libraries/pagination>` set the wrong page number on the "data-ci-pagination-page" attribute in generated links.
-- Fixed a bug where :doc:`Pagination Library <libraries/pagination>` added the 'rel="start"' attribute to the first displayed link even if it's not actually linking the first page.
-- Fixed a bug (#4137) - :doc:`Error Handling <general/errors>` breaks for the new ``Error`` exceptions under PHP 7.
-- Fixed a bug (#4126) - :doc:`Form Validation Library <libraries/form_validation>` method ``reset_validation()`` discarded validation rules from config files.
-
-Version 3.0.1
-=============
-
-Release Date: August 7, 2015
-
-- Core
-
- - Added DoS mitigation to :php:func:`hash_pbkdf2()` :doc:`compatibility function <general/compatibility_functions>`.
-
-- Database
-
- - Added ``list_fields()`` support for SQLite ('sqlite3' and 'pdo_sqlite' drivers).
- - Added SSL connection support for the 'mysqli' and 'pdo_mysql' drivers.
-
-- Libraries
-
- - :doc:`File Uploading Library <libraries/file_uploading>` changes:
-
- - Changed method ``set_error()`` to accept a custom log level (defaults to 'error').
- - Errors "no_file_selected", "file_partial", "stopped_by_extension", "no_file_types", "invalid_filetype", "bad_filename" are now logged at the 'debug' level.
- - Errors "file_exceeds_limit", "file_exceeds_form_limit", "invalid_filesize", "invalid_dimensions" are now logged at the 'info' level.
-
- - Added 'is_resource' to the available expectations in :doc:`Unit Testing Library <libraries/unit_testing>`.
-
-- Helpers
-
- - Added Unicode support to :doc:`URL Helper <helpers/url_helper>` function :php:func:`url_title()`.
- - Added support for passing the "extra" parameter as an array to all :doc:`Form Helper <helpers/form_helper>` functions that use it.
-
-- Core
-
- - Added support for defining a list of specific query parameters in ``$config['cache_query_string']`` for the :doc:`Output Library <libraries/output>`.
- - Added class existence and inheritance checks to ``CI_Loader::model()`` in order to ease debugging in case of name collisions.
-
-Bug fixes for 3.0.1
--------------------
-
-- Fixed a bug (#3733) - Autoloading of libraries with aliases didn't work, although it was advertised to.
-- Fixed a bug (#3744) - Redis :doc:`Caching <libraries/caching>` driver didn't handle authentication failures properly.
-- Fixed a bug (#3761) - :doc:`URL Helper <helpers/url_helper>` function :php:func:`anchor()` didn't work with array inputs.
-- Fixed a bug (#3773) - ``db_select()`` didn't work for MySQL with the PDO :doc:`Database <database/index>` driver.
-- Fixed a bug (#3771) - :doc:`Form Validation Library <libraries/form_validation>` was looking for a 'form_validation\_' prefix when trying to translate field name labels.
-- Fixed a bug (#3787) - :doc:`FTP Library <libraries/ftp>` method ``delete_dir()`` failed when the target has subdirectories.
-- Fixed a bug (#3801) - :doc:`Output Library <libraries/output>` method ``_display_cache()`` incorrectly looked for the last modified time of a directory instead of the cache file.
-- Fixed a bug (#3816) - :doc:`Form Validation Library <libraries/form_validation>` treated empty string values as non-existing ones.
-- Fixed a bug (#3823) - :doc:`Session Library <libraries/sessions>` drivers Redis and Memcached didn't properly handle locks that are blocking the request for more than 30 seconds.
-- Fixed a bug (#3846) - :doc:`Image Manipulation Library <libraries/image_lib>` method `image_mirror_gd()` didn't properly initialize its variables.
-- Fixed a bug (#3854) - `field_data()` didn't work properly with the Oracle (OCI8) database driver.
-- Fixed a bug in the :doc:`Database Utility Class <database/utilities>` method ``csv_from_result()`` didn't work with a whitespace CSV delimiter.
-- Fixed a bug (#3890) - :doc:`Input Library <libraries/input>` method ``get_request_header()`` treated header names as case-sensitive.
-- Fixed a bug (#3903) - :doc:`Form Validation Library <libraries/form_validation>` ignored "unnamed" closure validation rules.
-- Fixed a bug (#3904) - :doc:`Form Validation Library <libraries/form_validation>` ignored "named" callback rules when the field is empty and there's no 'required' rule.
-- Fixed a bug (#3922) - :doc:`Email <libraries/email>` and :doc:`XML-RPC <libraries/xmlrpc>` libraries could enter an infinite loop due to `PHP bug #39598 <https://bugs.php.net/bug.php?id=39598>`_.
-- Fixed a bug (#3913) - :doc:`Cache Library <libraries/caching>` didn't work with the direct ``$this->cache->$driver_name->method()`` syntax with Redis and Memcache(d).
-- Fixed a bug (#3932) - :doc:`Query Builder <database/query_builder>` didn't properly compile WHERE and HAVING conditions for field names that end with "and", "or".
-- Fixed a bug in :doc:`Query Builder <database/query_builder>` where ``delete()`` didn't properly work on multiple tables with a WHERE condition previously set via ``where()``.
-- Fixed a bug (#3952) - :doc:`Database <database/index>` method ``list_fields()`` didn't work with SQLite3.
-- Fixed a bug (#3955) - :doc:`Cache Library <libraries/caching>` methods ``increment()`` and ``decrement()`` ignored the 'key_prefix' setting.
-- Fixed a bug (#3963) - :doc:`Unit Testing Library <libraries/unit_testing>` wrongly tried to translate filenames, line numbers and notes values in test results.
-- Fixed a bug (#3965) - :doc:`File Uploading Library <libraries/file_uploading>` ignored the "encrypt_name" setting when "overwrite" is enabled.
-- Fixed a bug (#3968) - :doc:`Database Forge <database/forge>` method ``add_key()`` didn't treat array inputs as composite keys unless it's a PRIMARY KEY.
-- Fixed a bug (#3715) - :doc:`Pagination Library <libraries/pagination>` could generate broken link when a protocol-relative base URL is used.
-- Fixed a bug (#3828) - :doc:`Output Library <libraries/output>` method ``delete_cache()`` couldn't delete index page caches.
-- Fixed a bug (#3704) - :doc:`Database <database/index>` method ``stored_procedure()`` in the 'oci8' driver didn't properly bind parameters.
-- Fixed a bug (#3778) - :doc:`Download Helper <helpers/download_helper>` function :php:func:`force_download()` incorrectly sent a *Pragma* response header.
-- Fixed a bug (#3752) - ``$routing['directory']`` overrides were not properly handled and always resulted in a 404 "Not Found" error.
-- Fixed a bug (#3279) - :doc:`Query Builder <database/query_builder>` methods ``update()`` and ``get_compiled_update()`` did double escaping on the table name if it was provided via ``from()``.
-- Fixed a bug (#3991) - ``$config['rewrite_short_tags']`` never worked due to ``function_exists('eval')`` always returning FALSE.
-- Fixed a bug where the :doc:`File Uploading Library <libraries/file_uploading>` library will not properly configure its maximum file size unless the input value is of type integer.
-- Fixed a bug (#4000) - :doc:`Pagination Library <libraries/pagination>` didn't enable "rel" attributes by default if no attributes-related config options were used.
-- Fixed a bug (#4004) - :doc:`URI Class <libraries/uri>` didn't properly parse the request URI if it contains a colon followed by a digit.
-- Fixed a bug in :doc:`Query Builder <database/query_builder>` where the ``$escape`` parameter for some methods only affected field names.
-- Fixed a bug (#4012) - :doc:`Query Builder <database/query_builder>` methods ``where_in()``, ``or_where_in()``, ``where_not_in()``, ``or_where_not_in()`` didn't take into account previously cached WHERE conditions when query cache is in use.
-- Fixed a bug (#4015) - :doc:`Email Library <libraries/email>` method ``set_header()`` didn't support method chaining, although it was advertised.
-- Fixed a bug (#4027) - :doc:`Routing <general/routing>` with HTTP verbs only worked if the route request method was declared in all-lowercase letters.
-- Fixed a bug (#4026) - :doc:`Database Transactions <database/transactions>` always rollback if any previous ``query()`` call fails.
-- Fixed a bug (#4023) - :doc:`String Helper <helpers/string_helper>` function ``increment_string()`` didn't escape its ``$separator`` parameter.
-
-Version 3.0.0
-=============
-
-Release Date: March 30, 2015
-
-- License
-
- - CodeIgniter has been relicensed with the `MIT License <http://opensource.org/licenses/MIT>`_, eliminating its old proprietary licensing.
-
-- General Changes
-
- - PHP 5.1.6 is no longer supported. CodeIgniter now requires PHP 5.2.4 and recommends PHP 5.4+ or newer to be used.
- - Changed filenaming convention (class file names now must be Ucfirst and everything else in lowercase).
- - Changed the default database driver to 'mysqli' (the old 'mysql' driver is DEPRECATED).
- - ``$_SERVER['CI_ENV']`` can now be set to control the ``ENVIRONMENT`` constant.
- - Added an optional backtrace to php-error template.
- - Added Android to the list of user agents.
- - Added Windows 7, Windows 8, Windows 8.1, Android, Blackberry, iOS and PlayStation 3 to the list of user platforms.
- - Added Fennec (Firefox for mobile) to the list of mobile user agents.
- - Ability to log certain error types, not all under a threshold.
- - Added support for pem, p10, p12, p7a, p7c, p7m, p7r, p7s, crt, crl, der, kdb, rsa, cer, sst, csr Certs to mimes.php.
- - Added support for pgp, gpg, zsh and cdr files to mimes.php.
- - Added support for 3gp, 3g2, mp4, wmv, f4v, vlc Video files to mimes.php.
- - Added support for m4a, aac, m4u, xspf, au, ac3, flac, ogg, wma Audio files to mimes.php.
- - Added support for kmz and kml (Google Earth) files to mimes.php.
- - Added support for ics Calendar files to mimes.php.
- - Added support for rar, jar and 7zip archives to mimes.php.
- - Updated support for xml ('application/xml') and xsl ('application/xml', 'text/xsl') files in mimes.php.
- - Updated support for doc files in mimes.php.
- - Updated support for docx files in mimes.php.
- - Updated support for php files in mimes.php.
- - Updated support for zip files in mimes.php.
- - Updated support for csv files in mimes.php.
- - Added Romanian, Greek, Vietnamese and Cyrilic characters in *application/config/foreign_characters.php*.
- - Changed logger to only chmod when file is first created.
- - Removed previously deprecated SHA1 Library.
- - Removed previously deprecated use of ``$autoload['core']`` in *application/config/autoload.php*.
- Only entries in ``$autoload['libraries']`` are auto-loaded now.
- - Removed previously deprecated EXT constant.
- - Updated all classes to be written in PHP 5 style, with visibility declarations and no ``var`` usage for properties.
- - Added an Exception handler.
- - Moved error templates to *application/views/errors/* and made the path configurable via ``$config['error_views_path']``.
- - Added support non-HTML error templates for CLI applications.
- - Moved the Log class to *application/core/*
- - Global config files are loaded first, then environment ones. Environment config keys overwrite base ones, allowing to only set the keys we want changed per environment.
- - Changed detection of ``$view_folder`` so that if it's not found in the current path, it will now also be searched for under the application folder.
- - Path constants BASEPATH, APPPATH and VIEWPATH are now (internally) defined as absolute paths.
- - Updated email validation methods to use ``filter_var()`` instead of PCRE.
- - Changed environment defaults to report all errors in *development* and only fatal ones in *testing*, *production* but only display them in *development*.
- - Updated *ip_address* database field lengths from 16 to 45 for supporting IPv6 address on :doc:`Trackback Library <libraries/trackback>` and :doc:`Captcha Helper <helpers/captcha_helper>`.
- - Removed *cheatsheets* and *quick_reference* PDFs from the documentation.
- - Added availability checks where usage of dangerous functions like ``eval()`` and ``exec()`` is required.
- - Added support for changing the file extension of log files using ``$config['log_file_extension']``.
- - Added support for turning newline standardization on/off via ``$config['standardize_newlines']`` and set it to FALSE by default.
- - Added configuration setting ``$config['composer_autoload']`` to enable loading of a `Composer <https://getcomposer.org>`_ auto-loader.
- - Removed the automatic conversion of 'programmatic characters' to HTML entities from the :doc:`URI Library <libraries/uri>`.
- - Changed log messages that say a class or file was loaded to "info" level instead of "debug", so that they don't pollute log files when ``$config['log_threshold']`` is set to 2 (debug).
-
-- Helpers
-
- - :doc:`Date Helper <helpers/date_helper>` changes include:
-
- - Added an optional third parameter to :php:func:`timespan()` that constrains the number of time units displayed.
- - Added an optional parameter to :php:func:`timezone_menu()` that allows more attributes to be added to the generated select tag.
- - Added function :php:func:`date_range()` that generates a list of dates between a specified period.
- - Deprecated ``standard_date()``, which now just uses the native ``date()`` with `DateTime constants <http://php.net/manual/en/class.datetime.php#datetime.constants.types>`_.
- - Changed :php:func:`now()` to work with all timezone strings supported by PHP.
- - Changed :php:func:`days_in_month()` to use the native ``cal_days_in_month()`` PHP function, if available.
-
- - :doc:`URL Helper <helpers/url_helper>` changes include:
-
- - Deprecated *separator* options **dash** and **underscore** for function :php:func:`url_title()` (they are only aliases for '-' and '_' respectively).
- - :php:func:`url_title()` will now trim extra dashes from beginning and end.
- - :php:func:`anchor_popup()` will now fill the *href* attribute with the URL and its JS code will return FALSE instead.
- - Added JS window name support to the :php:func:`anchor_popup()` function.
- - Added support for menubar attribute to the :php:func:`anchor_popup()`.
- - Added support (auto-detection) for HTTP/1.1 response codes 303, 307 in :php:func:`redirect()`.
- - Changed :php:func:`redirect()` to choose the **refresh** method only on IIS servers, instead of all servers on Windows (when **auto** is used).
- - Changed :php:func:`anchor()`, :php:func:`anchor_popup()`, and :php:func:`redirect()` to support protocol-relative URLs (e.g. *//ellislab.com/codeigniter*).
-
- - :doc:`HTML Helper <helpers/html_helper>` changes include:
-
- - Added more doctypes.
- - Changed application and environment config files to be loaded in a cascade-like manner.
- - Changed :php:func:`doctype()` to cache and only load once the doctypes array.
- - Deprecated functions ``nbs()`` and ``br()``, which are just aliases for the native ``str_repeat()`` with ``&nbsp;`` and ``<br />`` respectively.
-
- - :doc:`Inflector Helper <helpers/inflector_helper>` changes include:
-
- - Changed :php:func:`humanize()` to allow passing an input separator as its second parameter.
- - Changed :php:func:`humanize()` and :php:func:`underscore()` to utilize `mbstring <http://php.net/mbstring>`_, if available.
- - Changed :php:func:`plural()` and :php:func:`singular()` to avoid double pluralization and support more words.
-
- - :doc:`Download Helper <helpers/download_helper>` changes include:
-
- - Added an optional third parameter to :php:func:`force_download()` that enables/disables sending the actual file MIME type in the Content-Type header (disabled by default).
- - Added a work-around in :php:func:`force_download()` for a bug Android <= 2.1, where the filename extension needs to be in uppercase.
- - Added support for reading from an existing file path by passing NULL as the second parameter to :php:func:`force_download()` (useful for large files and/or safely transmitting binary data).
-
- - :doc:`Form Helper <helpers/form_helper>` changes include:
-
- - :php:func:`form_dropdown()` will now also take an array for unity with other form helpers.
- - :php:func:`form_prep()` is now DEPRECATED and only acts as an alias for :doc:`common function <general/common_functions>` :php:func:`html_escape()`.
- - :php:func:`set_value()` will now also accept a third argument, allowing to turn off HTML escaping of the value.
-
- - :doc:`Security Helper <helpers/security_helper>` changes include:
-
- - :php:func:`do_hash()` now uses PHP's native ``hash()`` function (supporting more algorithms) and is deprecated.
- - :php:func:`strip_image_tags()` is now an alias for the same method in the :doc:`Security Library <libraries/security>`.
-
- - :doc:`Smiley Helper <helpers/smiley_helper>` changes include:
-
- - Deprecated the whole helper as too specific for CodeIgniter.
- - Removed previously deprecated function ``js_insert_smiley()``.
- - Changed application and environment config files to be loaded in a cascade-like manner.
- - The smileys array is now cached and loaded only once.
-
- - :doc:`File Helper <helpers/file_helper>` changes include:
-
- - :php:func:`set_realpath()` can now also handle file paths as opposed to just directories.
- - Added an optional paramater to :php:func:`delete_files()` to enable it to skip deleting files such as *.htaccess* and *index.html*.
- - Deprecated function ``read_file()`` - it's just an alias for PHP's native ``file_get_contents()``.
-
- - :doc:`String Helper <helpers/string_helper>` changes include:
-
- - Deprecated function ``repeater()`` - it's just an alias for PHP's native ``str_repeat()``.
- - Deprecated function ``trim_slashes()`` - it's just an alias for PHP's native ``trim()`` (with a slash as its second argument).
- - Deprecated randomization type options **unique** and **encrypt** for funcion :php:func:`random_string()` (they are only aliases for **md5** and **sha1** respectively).
-
- - :doc:`CAPTCHA Helper <helpers/captcha_helper>` changes include:
-
- - Added *word_length* and *pool* options to allow customization of the generated word.
- - Added *colors* configuration to allow customization for the *background*, *border*, *text* and *grid* colors.
- - Added *filename* to the returned array elements.
- - Updated to use `imagepng()` in case that `imagejpeg()` isn't available.
- - Added **font_size** option to allow customization of font size.
- - Added **img_id** option to set id attribute of captcha image.
-
- - :doc:`Text Helper <helpers/text_helper>` changes include:
-
- - Changed the default tag for use in :php:func:`highlight_phrase()` to ``<mark>`` (formerly ``<strong>``).
- - Changed :php:func:`character_limiter()`, :php:func:`word_wrap()` and :php:func:`ellipsize()` to utilize `mbstring <http://php.net/mbstring>`_ or `iconv <http://php.net/iconv>`_, if available.
-
- - :doc:`Directory Helper <helpers/directory_helper>` :php:func:`directory_map()` will now append ``DIRECTORY_SEPARATOR`` to directory names in the returned array.
- - :doc:`Array Helper <helpers/array_helper>` :php:func:`element()` and :php:func:`elements()` now return NULL instead of FALSE when the required elements don't exist.
- - :doc:`Language Helper <helpers/language_helper>` :php:func:`lang()` now accepts an optional list of additional HTML attributes.
- - Deprecated the :doc:`Email Helper <helpers/email_helper>` as its ``valid_email()``, ``send_email()`` functions are now only aliases for PHP native functions ``filter_var()`` and ``mail()`` respectively.
-
-- Database
-
- - DEPRECATED the 'mysql', 'sqlite', 'mssql' and 'pdo/dblib' (also known as 'pdo/mssql' or 'pdo/sybase') drivers.
- - Added **dsn** configuration setting for drivers that support DSN strings (PDO, PostgreSQL, Oracle, ODBC, CUBRID).
- - Added **schema** configuration setting (defaults to *public*) for drivers that might need it (currently used by PostgreSQL and ODBC).
- - Added **save_queries** configuration setting to *application/config/database.php* (defaults to ``TRUE``).
- - Removed **autoinit** configuration setting as it doesn't make sense to instantiate the database class but not connect to the database.
- - Added subdrivers support (currently only used by PDO).
- - Added an optional database name parameter to ``db_select()``.
- - Removed ``protect_identifiers()`` and renamed internal method ``_protect_identifiers()`` to it instead - it was just an alias.
- - Renamed internal method ``_escape_identifiers()`` to ``escape_identifiers()``.
- - Updated ``escape_identifiers()`` to accept an array of fields as well as strings.
- - MySQL and MySQLi drivers now require at least MySQL version 5.1.
- - Added a ``$persistent`` parameter to ``db_connect()`` and changed ``db_pconnect()`` to be an alias for ``db_connect(TRUE)``.
- - ``db_set_charset()`` now only requires one parameter (collation was only needed due to legacy support for MySQL versions prior to 5.1).
- - ``db_select()`` will now always (if required by the driver) be called by ``db_connect()`` instead of only when initializing.
- - Replaced the ``_error_message()`` and ``_error_number()`` methods with ``error()``, which returns an array containing the last database error code and message.
- - Improved ``version()`` implementation so that drivers that have a native function to get the version number don't have to be defined in the core ``DB_driver`` class.
- - Added capability for packages to hold *config/database.php* config files.
- - Added MySQL client compression support.
- - Added encrypted connections support (for *mysql*, *sqlsrv* and PDO with *sqlsrv*).
- - Removed :doc:`Loader Class <libraries/loader>` from Database error tracing to better find the likely culprit.
- - Added support for SQLite3 database driver.
- - Added Interbase/Firebird database support via the *ibase* driver.
- - Added ODBC support for ``create_database()``, ``drop_database()`` and ``drop_table()`` in :doc:`Database Forge <database/forge>`.
- - Added support to binding arrays as ``IN()`` sets in ``query()``.
-
- - :doc:`Query Builder <database/query_builder>` changes include:
-
- - Renamed the Active Record class to Query Builder to remove confusion with the Active Record design pattern.
- - Added the ability to insert objects with ``insert_batch()``.
- - Added new methods that return the SQL string of queries without executing them: ``get_compiled_select()``, ``get_compiled_insert()``, ``get_compiled_update()``, ``get_compiled_delete()``.
- - Added an optional parameter that allows to disable escaping (useful for custom fields) for methods ``join()``, ``order_by()``, ``where_in()``, ``or_where_in()``, ``where_not_in()``, ``or_where_not_in()``, ``insert()``, ``insert_batch()``.
- - Added support for ``join()`` with multiple conditions.
- - Added support for *USING* in ``join()``.
- - Added support for *EXISTS* in ``where()``.
- - Added seed values support for random ordering with ``order_by(seed, 'RANDOM')``.
- - Changed ``limit()`` to ignore NULL values instead of always casting to integer.
- - Changed ``offset()`` to ignore empty values instead of always casting to integer.
- - Methods ``insert_batch()`` and ``update_batch()`` now return an integer representing the number of rows affected by them.
- - Methods ``where()``, ``or_where()``, ``having()`` and ``or_having()`` now convert trailing ``=`` and ``<>``, ``!=`` SQL operators to ``IS NULL`` and ``IS NOT NULL`` respectively when the supplied comparison value is ``NULL``.
- - Added method chaining support to ``reset_query()``, ``start_cache()``, ``stop_cache()`` and ``flush_cache()``.
- - Added an optional second parameter to ``count_all_results()`` to disable resetting of QB values.
-
- - :doc:`Database Results <database/results>` changes include:
-
- - Added a constructor to the ``DB_result`` class and moved all driver-specific properties and logic out of the base ``DB_driver`` class to allow better abstraction.
- - Added method ``unbuffered_row()`` for fetching a row without prefetching the whole result (consume less memory).
- - Renamed former method ``_data_seek()`` to ``data_seek()`` and made it public.
-
- - Improved support for the MySQLi driver, including:
-
- - OOP style usage of the PHP extension is now used, instead of the procedural aliases.
- - Server version checking is now done via ``mysqli::$server_info`` instead of running an SQL query.
- - Added persistent connections support for PHP >= 5.3.
- - Added support for configuring socket pipe connections.
- - Added support for ``backup()`` in :doc:`Database Utilities <database/utilities>`.
- - Changed methods ``trans_begin()``, ``trans_commit()`` and ``trans_rollback()`` to use the PHP API instead of sending queries.
-
- - Improved support of the PDO driver, including:
-
- - Added support for ``create_database()``, ``drop_database()`` and ``drop_table()`` in :doc:`Database Forge <database/forge>`.
- - Added support for ``list_fields()`` in :doc:`Database Results <database/results>`.
- - Subdrivers are now isolated from each other instead of being in one large class.
-
- - Improved support of the PostgreSQL driver, including:
-
- - ``pg_version()`` is now used to get the database version number, when possible.
- - Added ``db_set_charset()`` support.
- - Added support for ``optimize_table()`` in :doc:`Database Utilities <database/utilities>` (rebuilds table indexes).
- - Added boolean data type support in ``escape()``.
- - Added ``update_batch()`` support.
- - Removed ``limit()`` and ``order_by()`` support for *UPDATE* and *DELETE* queries as PostgreSQL does not support those features.
- - Added a work-around for dead persistent connections to be re-created after a database restart.
- - Changed ``db_connect()`` to include the (new) **schema** value into Postgre's **search_path** session variable.
- - ``pg_escape_literal()`` is now used for escaping strings, if available.
-
- - Improved support of the CUBRID driver, including:
-
- - Added DSN string support.
- - Added persistent connections support.
- - Improved ``list_databases()`` in :doc:`Database Utility <database/utilities>` (until now only the currently used database was returned).
-
- - Improved support of the MSSQL and SQLSRV drivers, including:
-
- - Added random ordering support.
- - Added support for ``optimize_table()`` in :doc:`Database Utility <database/utilities>`.
- - Added escaping with *QUOTE_IDENTIFIER* setting detection.
- - Added port handling support for UNIX-based systems (MSSQL driver).
- - Added *OFFSET* support for SQL Server 2005 and above.
- - Added ``db_set_charset()`` support (MSSQL driver).
- - Added a *scrollable* property to enable configuration of the cursor to use (SQLSRV driver).
- - Added support and auto-detection for the ``SQLSRV_CURSOR_CLIENT_BUFFERED`` scrollable cursor flag (SQLSRV driver).
- - Changed default behavior to not use ``SQLSRV_CURSOR_STATIC`` due to performance issues (SQLSRV driver).
-
- - Improved support of the Oracle (OCI8) driver, including:
-
- - Added DSN string support (Easy Connect and TNS).
- - Added support for ``drop_table()`` in :doc:`Database Forge <database/forge>`.
- - Added support for ``list_databases()`` in :doc:`Database Utilities <database/utilities>`.
- - Generally improved for speed and cleaned up all of its components.
- - ``num_rows()`` is now only called explicitly by the developer and no longer re-executes statements.
-
- - Improved support of the SQLite driver, including:
-
- - Added support for ``replace()`` in :doc:`Query Builder <database/query_builder>`.
- - Added support for ``drop_table()`` in :doc:`Database Forge <database/forge>`.
-
- - :doc:`Database Forge <database/forge>` changes include:
-
- - Added an optional second parameter to ``drop_table()`` that allows adding the **IF EXISTS** condition, which is no longer the default.
- - Added support for passing a custom database object to the loader.
- - Added support for passing custom table attributes (such as ``ENGINE`` for MySQL) to ``create_table()``.
- - Added support for usage of the *FIRST* clause in ``add_column()`` for MySQL and CUBRID.
- - Added partial support for field comments (MySQL, PostgreSQL, Oracle).
- - Deprecated ``add_column()``'s third method. *AFTER* clause should now be added to the field definition array instead.
- - Overall improved support for all of the drivers.
-
- - :doc:`Database Utility <database/utilities>` changes include:
-
- - Added support for passing a custom database object to the loader.
- - Modified the class to no longer extend :doc:`Database Forge <database/forge>`, which has been a deprecated behavior for awhile.
- - Overall improved support for all of the drivers.
- - Added *foreign_key_checks* option to MySQL/MySQLi backup, allowing statement to disable/re-enable foreign key checks to be inserted into the backup output.
-
-- Libraries
-
- - Added a new :doc:`Encryption Library <libraries/encryption>` to replace the old, largely insecure :doc:`Encrypt Library <libraries/encrypt>`.
-
- - :doc:`Encrypt Library <libraries/encrypt>` changes include:
-
- - Deprecated the library in favor of the new :doc:`Encryption Library <libraries/encryption>`.
- - Added support for hashing algorithms other than SHA1 and MD5.
- - Removed previously deprecated ``sha1()`` method.
-
- - :doc:`Session Library <libraries/sessions>` changes include:
-
- - Completely re-written the library to use self-contained drivers via ``$config['sess_driver']``.
- - Added 'files', 'database', 'redis' and 'memcached' drivers (using 'files' by default).
- - Added ``$config['sess_save_path']`` setting to specify where the session data is stored, depending on the driver.
- - Dropped support for storing session data in cookies (which renders ``$config['sess_encrypt_cookie']`` useless and is therefore also removed).
- - Dropped official support for storing session data in databases other than MySQL and PostgreSQL.
- - Changed table structure for the 'database' driver.
- - Added a new **tempdata** feature that allows setting userdata items with expiration time (``mark_as_temp()``, ``tempdata()``, ``set_tempdata()``, ``unset_tempdata()``).
- - Changed method ``keep_flashdata()`` to also accept an array of keys.
- - Changed methods ``userdata()``, ``flashdata()`` to return an array of all userdata/flashdata when no parameter is passed.
- - Deprecated method ``all_userdata()`` - it is now just an alias for ``userdata()`` with no parameters.
- - Added method ``has_userdata()`` that verifies the existence of a userdata item.
- - Added *debug* level log messages for key events in the session validation process.
- - Dropped support for the *sess_match_useragent* option.
-
- - :doc:`File Uploading Library <libraries/file_uploading>` changes include:
-
- - Added method chaining support.
- - Added support for using array notation in file field names.
- - Added **max_filename_increment** and **file_ext_tolower** configuration settings.
- - Added **min_width** and **min_height** configuration settings for images.
- - Added **mod_mime_fix** configuration setting to disable suffixing multiple file extensions with an underscore.
- - Added the possibility pass **allowed_types** as an array.
- - Added an ``$index`` parameter to the method ``data()``.
- - Added a ``$reset`` parameter to method ``initialize()``.
- - Removed method ``clean_file_name()`` and its usage in favor of :doc:`Security Library <libraries/security>`'s ``sanitize_filename()``.
- - Removed method ``mimes_types()``.
- - Changed ``CI_Upload::_prep_filename()`` to simply replace all (but the last) dots in the filename with underscores, instead of suffixing them.
-
- - :doc:`Calendar Library <libraries/calendar>` changes include:
-
- - Added method chaining support.
- - Added configuration to generate days of other months instead of blank cells.
- - Added auto-configuration for *next_prev_url* if it is empty and *show_prev_next* is set to TRUE.
- - Added support for templating via an array in addition to the encoded string.
- - Changed method ``get_total_days()`` to be an alias for :doc:`Date Helper <helpers/date_helper>` :php:func:`days_in_month()`.
-
- - :doc:`Cart Library <libraries/cart>` changes include:
-
- - Deprecated the library as too specific for CodeIgniter.
- - Added method ``remove()`` to remove a cart item, updating with quantity of 0 seemed like a hack but has remained to retain compatibility.
- - Added method ``get_item()`` to enable retrieving data for a single cart item.
- - Added unicode support for product names.
- - Added support for disabling product name strictness via the ``$product_name_safe`` property.
- - Changed ``insert()`` method to auto-increment quantity for an item when inserted twice instead of resetting it.
- - Changed ``update()`` method to support updating all properties attached to an item and not to require 'qty'.
-
- - :doc:`Image Manipulation Library <libraries/image_lib>` changes include:
-
- - The ``initialize()`` method now only sets existing class properties.
- - Added support for 3-length hex color values for *wm_font_color* and *wm_shadow_color* properties, as well as validation for them.
- - Class properties *wm_font_color*, *wm_shadow_color* and *wm_use_drop_shadow* are now protected, to avoid breaking the ``text_watermark()`` method if they are set manually after initialization.
- - If property *maintain_ratio* is set to TRUE, ``image_reproportion()`` now doesn't need both width and height to be specified.
- - Property *maintain_ratio* is now taken into account when resizing images using ImageMagick library.
- - Added support for maintaining transparency for PNG images when watermarking.
- - Added a **file_permissions** setting.
-
- - :doc:`Form Validation Library <libraries/form_validation>` changes include:
-
- - Added method ``error_array()`` to return all error messages as an array.
- - Added method ``set_data()`` to set an alternative data array to be validated instead of the default ``$_POST``.
- - Added method ``reset_validation()`` which resets internal validation variables in case of multiple validation routines.
- - Added support for setting error delimiters in the config file via ``$config['error_prefix']`` and ``$config['error_suffix']``.
- - Internal method ``_execute()`` now considers input data to be invalid if a specified rule is not found.
- - Removed method ``is_numeric()`` as it exists as a native PHP function and ``_execute()`` will find and use that (the **is_numeric** rule itself is deprecated since 1.6.1).
- - Native PHP functions used as rules can now accept an additional parameter, other than the data itself.
- - Updated method ``set_rules()`` to accept an array of rules as well as a string.
- - Fields that have empty rules set no longer run through validation (and therefore are not considered erroneous).
- - Added rule **differs** to check if the value of a field differs from the value of another field.
- - Added rule **valid_url**.
- - Added rule **in_list** to check if the value of a field is within a given list.
- - Added support for named parameters in error messages.
- - :doc:`Language <libraries/language>` line keys must now be prefixed with **form_validation_**.
- - Added rule **alpha_numeric_spaces**.
- - Added support for custom error messages per field rule.
- - Added support for callable rules when they are passed as an array.
- - Added support for non-ASCII domains in **valid_email** rule, depending on the Intl extension.
- - Changed the debug message about an error message not being set to include the rule name it is about.
-
- - :doc:`Caching Library <libraries/caching>` changes include:
-
- - Added Wincache driver.
- - Added Redis driver.
- - Added a *key_prefix* option for cache IDs.
- - Updated driver ``is_supported()`` methods to log at the "debug" level.
- - Added option to store raw values instead of CI-formatted ones (APC, Memcache).
- - Added atomic increment/decrement feature via ``increment()``, ``decrement()``.
-
- - :doc:`E-mail Library <libraries/email>` changes include:
-
- - Added a custom filename parameter to ``attach()`` as ``$this->email->attach($filename, $disposition, $newname)``.
- - Added possibility to send attachment as buffer string in ``attach()`` as ``$this->email->attach($buffer, $disposition, $newname, $mime)``.
- - Added possibility to attach remote files by passing a URL.
- - Added method ``attachment_cid()`` to enable embedding inline attachments into HTML.
- - Added dsn (delivery status notification) option.
- - Renamed method ``_set_header()`` to ``set_header()`` and made it public to enable adding custom headers.
- - Successfully sent emails will automatically clear the parameters.
- - Added a *return_path* parameter to the ``from()`` method.
- - Removed the second parameter (character limit) from internal method ``_prep_quoted_printable()`` as it is never used.
- - Internal method ``_prep_quoted_printable()`` will now utilize the native ``quoted_printable_encode()``, ``imap_8bit()`` functions (if available) when CRLF is set to "\r\n".
- - Default charset now relies on the global ``$config['charset']`` setting.
- - Removed unused protected method ``_get_ip()`` (:doc:`Input Library <libraries/input>`'s ``ip_address()`` should be used anyway).
- - Internal method ``_prep_q_encoding()`` now utilizes PHP's *mbstring* and *iconv* extensions (when available) and no longer has a second (``$from``) argument.
- - Added an optional parameter to ``print_debugger()`` to allow specifying which parts of the message should be printed ('headers', 'subject', 'body').
- - Added SMTP keepalive option to avoid opening the connection for each ``send()`` call. Accessible as ``$smtp_keepalive``.
- - Public method ``set_header()`` now filters the input by removing all "\\r" and "\\n" characters.
- - Added support for non-ASCII domains in ``valid_email()``, depending on the Intl extension.
-
- - :doc:`Pagination Library <libraries/pagination>` changes include:
-
- - Deprecated usage of the "anchor_class" setting (use the new "attributes" setting instead).
- - Added method chaining support to ``initialize()`` method.
- - Added support for the anchor "rel" attribute.
- - Added support for setting custom attributes.
- - Added support for language translations of the *first_link*, *next_link*, *prev_link* and *last_link* values.
- - Added support for ``$config['num_links'] = 0`` configuration.
- - Added ``$config['reuse_query_string']`` to allow automatic repopulation of query string arguments, combined with normal URI segments.
- - Added ``$config['use_global_url_suffix']`` to allow overriding the library 'suffix' value with that of the global ``$config['url_suffix']`` setting.
- - Removed the default ``&nbsp;`` from a number of the configuration variables.
-
- - :doc:`Profiler Library <general/profiling>` changes include:
-
- - Database object names are now being displayed.
- - The sum of all queries running times in seconds is now being displayed.
- - Added support for displaying the HTTP DNT ("Do Not Track") header.
- - Added support for displaying ``$_FILES``.
-
- - :doc:`Migration Library <libraries/migration>` changes include:
-
- - Added support for timestamp-based migrations (enabled by default).
- - Added ``$config['migration_type']`` to allow switching between *sequential* and *timestamp* migrations.
-
- - :doc:`XML-RPC Library <libraries/xmlrpc>` changes include:
-
- - Added the ability to use a proxy.
- - Added Basic HTTP authentication support.
-
- - :doc:`User Agent Library <libraries/user_agent>` changes include:
-
- - Added check to detect if robots are pretending to be mobile clients (helps with e.g. Google indexing mobile website versions).
- - Added method ``parse()`` to allow parsing a custom user-agent string, different from the current visitor's.
-
- - :doc:`HTML Table Library <libraries/table>` changes include:
-
- - Added method chaining support.
- - Added support for setting table class defaults in a config file.
-
- - :doc:`Zip Library <libraries/zip>` changes include:
-
- - Method ``read_file()`` can now also alter the original file path/name while adding files to an archive.
- - Added support for changing the compression level.
-
- - :doc:`Trackback Library <libraries/trackback>` method ``receive()`` will now utilize ``iconv()`` if it is available but ``mb_convert_encoding()`` is not.
-
-- Core
-
- - :doc:`Routing <general/routing>` changes include:
-
- - Added support for multiple levels of controller directories.
- - Added support for per-directory *default_controller* and *404_override* classes.
- - Added possibility to route requests using HTTP verbs.
- - Added possibility to route requests using callbacks.
- - Added a new reserved route (*translate_uri_dashes*) to allow usage of dashes in the controller and method URI segments.
- - Deprecated methods ``fetch_directory()``, ``fetch_class()`` and ``fetch_method()`` in favor of their respective public properties.
- - Removed method ``_set_overrides()`` and moved its logic to the class constructor.
-
- - :doc:`URI Library <libraries/uri>` changes include:
-
- - Added conditional PCRE UTF-8 support to the "invalid URI characters" check and removed the ``preg_quote()`` call from it to allow more flexibility.
- - Renamed method ``_filter_uri()`` to ``filter_uri()``.
- - Changed method ``filter_uri()`` to accept by reference and removed its return value.
- - Changed private methods to protected so that MY_URI can override them.
- - Renamed internal method ``_parse_cli_args()`` to ``_parse_argv()``.
- - Renamed internal method ``_detect_uri()`` to ``_parse_request_uri()``.
- - Changed ``_parse_request_uri()`` to accept absolute URIs for compatibility with HTTP/1.1 as per `RFC2616 <http://www.ietf.org/rfc/rfc2616.txt>`.
- - Added protected method ``_parse_query_string()`` to URI paths in the the **QUERY_STRING** value, like ``_parse_request_uri()`` does.
- - Changed URI string detection logic to always default to **REQUEST_URI** unless configured otherwise or under CLI.
- - Removed methods ``_remove_url_suffix()``, ``_explode_segments()`` and moved their logic into ``_set_uri_string()``.
- - Removed method ``_fetch_uri_string()`` and moved its logic into the class constructor.
- - Removed method ``_reindex_segments()``.
-
- - :doc:`Loader Library <libraries/loader>` changes include:
-
- - Added method chaining support.
- - Added method ``get_vars()`` to the Loader to retrieve all variables loaded with ``$this->load->vars()``.
- - ``_ci_autoloader()`` is now a protected method.
- - Added autoloading of drivers with ``$autoload['drivers']``.
- - ``$config['rewrite_short_tags']`` now has no effect when using PHP 5.4 as ``<?=`` will always be available.
- - Changed method ``config()`` to return whatever ``CI_Config::load()`` returns instead of always being void.
- - Added support for library and model aliasing on autoload.
- - Changed method ``is_loaded()`` to ask for the (case sensitive) library name instead of its instance name.
- - Removed ``$_base_classes`` property and unified all class data in ``$_ci_classes`` instead.
- - Added method ``clear_vars()`` to allow clearing the cached variables for views.
-
- - :doc:`Input Library <libraries/input>` changes include:
-
- - Deprecated the ``$config['global_xss_filtering']`` setting.
- - Added ``method()`` to retrieve ``$_SERVER['REQUEST_METHOD']``.
- - Added support for arrays and network addresses (e.g. 192.168.1.1/24) for use with the *proxy_ips* setting.
- - Added method ``input_stream()`` to aid in using **php://input** stream data such as one passed via PUT, DELETE and PATCH requests.
- - Changed method ``valid_ip()`` to use PHP's native ``filter_var()`` function.
- - Changed internal method ``_sanitize_globals()`` to skip enforcing reversal of *register_globals* in PHP 5.4+, where this functionality no longer exists.
- - Changed methods ``get()``, ``post()``, ``get_post()``, ``cookie()``, ``server()``, ``user_agent()`` to return NULL instead of FALSE when no value is found.
- - Changed default value of the ``$xss_clean`` parameter to NULL for all methods that utilize it, the default value is now determined by the ``$config['global_xss_filtering']`` setting.
- - Added method ``post_get()`` and changed ``get_post()`` to search in GET data first. Both methods' names now properly match their GET/POST data search priorities.
- - Changed method ``_fetch_from_array()`` to parse array notation in field name.
- - Changed method ``_fetch_from_array()`` to allow retrieving multiple fields at once.
- - Added an option for ``_clean_input_keys()`` to return FALSE instead of terminating the whole script.
- - Deprecated the ``is_cli_request()`` method, it is now an alias for the new :php:func:`is_cli()` common function.
- - Added an ``$xss_clean`` parameter to method ``user_agent()`` and removed the ``$user_agent`` property.
- - Added property ``$raw_input_stream`` to access **php://input** data.
-
- - :doc:`Common functions <general/common_functions>` changes include:
-
- - Added function :php:func:`get_mimes()` to return the *application/config/mimes.php* array.
- - Added support for HTTP code 303 ("See Other") in :php:func:`set_status_header()`.
- - Removed redundant conditional to determine HTTP server protocol in :php:func:`set_status_header()`.
- - Renamed ``_exception_handler()`` to ``_error_handler()`` and replaced it with a real exception handler.
- - Changed ``_error_handler()`` to respect php.ini *display_errors* setting.
- - Added function :php:func:`is_https()` to check if a secure connection is used.
- - Added function :php:func:`is_cli()` to replace the ``CI_Input::is_cli_request()`` method.
- - Added function :php:func:`function_usable()` to work around a bug in `Suhosin <http://www.hardened-php.net/suhosin/>`.
- - Removed the third (`$php_error`) argument from function :php:func:`log_message()`.
- - Changed internal function ``load_class()`` to accept a constructor parameter instead of (previously unused) class name prefix.
- - Removed default parameter value of :php:func:`is_php()`.
- - Added a second argument ``$double_encode`` to :php:func:`html_escape()`.
- - Changed function :php:func:`config_item()` to return NULL instead of FALSE when no value is found.
- - Changed function :php:func:`set_status_header()` to return immediately when run under CLI.
-
- - :doc:`Output Library <libraries/output>` changes include:
-
- - Added a second argument to method ``set_content_type()`` that allows setting the document charset as well.
- - Added methods ``get_content_type()`` and ``get_header()``.
- - Added method ``delete_cache()``.
- - Added configuration option ``$config['cache_query_string']`` to enable taking the query string into account when caching.
- - Changed caching behavior to compress the output before storing it, if ``$config['compress_output']`` is enabled.
-
- - :doc:`Config Library <libraries/config>` changes include:
-
- - Changed ``site_url()`` method to accept an array as well.
- - Removed internal method ``_assign_to_config()`` and moved its implementation to *CodeIgniter.php* instead.
- - ``item()`` now returns NULL instead of FALSE when the required config item doesn't exist.
- - Added an optional second parameter to both ``base_url()`` and ``site_url()`` that allows enforcing of a protocol different than the one in the *base_url* configuration setting.
- - Added HTTP "Host" header character validation to prevent cache poisoning attacks when ``base_url`` auto-detection is used.
-
- - :doc:`Security Library <libraries/security>` changes include:
-
- - Added ``$config['csrf_regeneration']``, which makes CSRF token regeneration optional.
- - Added ``$config['csrf_exclude_uris']``, allowing for exclusion of URIs from the CSRF protection (regular expressions are supported).
- - Added method ``strip_image_tags()``.
- - Added method ``get_random_bytes()`` and switched CSRF & XSS token generation to use it.
- - Modified method ``sanitize_filename()`` to read a public ``$filename_bad_chars`` property for getting the invalid characters list.
- - Return status code of 403 instead of a 500 if CSRF protection is enabled but a token is missing from a request.
-
- - :doc:`Language Library <libraries/language>` changes include:
-
- - Changed method ``load()`` to filter the language name with ``ctype_alpha()``.
- - Changed method ``load()`` to also accept an array of language files.
- - Added an optional second parameter to method ``line()`` to disable error logging for line keys that were not found.
- - Language files are now loaded in a cascading style with the one in **system/** always loaded and overridden afterwards, if another one is found.
-
- - :doc:`Hooks Library <general/hooks>` changes include:
-
- - Added support for closure hooks (or anything that ``is_callable()`` returns TRUE for).
- - Renamed method ``_call_hook()`` to ``call_hook()``.
- - Class instances are now stored in order to maintain their state.
-
- - UTF-8 Library changes include:
-
- - ``UTF8_ENABLED`` now requires only one of `Multibyte String <http://php.net/mbstring>`_ or `iconv <http://php.net/iconv>`_ to be available instead of both.
- - Changed method ``clean_string()`` to utilize ``mb_convert_encoding()`` if it is available.
- - Renamed method ``_is_ascii()`` to ``is_ascii()`` and made it public.
-
- - Log Library changes include:
-
- - Added a ``$config['log_file_permissions']`` setting.
- - Changed the library constructor to try to create the **log_path** directory if it doesn't exist.
- - Added support for microseconds ("u" date format character) in ``$config['log_date_format']``.
-
- - Added :doc:`compatibility layers <general/compatibility_functions>` for:
-
- - `Multibyte String <http://php.net/mbstring>`_ (limited support).
- - `Hash <http://php.net/hash>`_ (``hash_equals()``, ``hash_pbkdf2()``).
- - `Password Hashing <http://php.net/password>`_.
- - `Standard Functions ``array_column()``, ``array_replace()``, ``array_replace_recursive()``, ``hex2bin()``, ``quoted_printable_encode()``.
-
- - Removed ``CI_CORE`` boolean constant from *CodeIgniter.php* (no longer Reactor and Core versions).
- - Added support for HTTP-Only cookies with new config option *cookie_httponly* (default FALSE).
- - ``$config['time_reference']`` now supports all timezone strings supported by PHP.
- - Fatal PHP errors are now also passed to ``_error_handler()``, so they can be logged.
-
-
-Bug fixes for 3.0
------------------
-
-- Fixed a bug where ``unlink()`` raised an error if cache file did not exist when you try to delete it.
-- Fixed a bug (#181) - a typo in the form validation language file.
-- Fixed a bug (#159, #163) - :doc:`Query Builder <database/query_builder>` nested transactions didn't work properly due to ``$_trans_depth`` not being incremented.
-- Fixed a bug (#737, #75) - :doc:`Pagination <libraries/pagination>` anchor class was not set properly when using initialize method.
-- Fixed a bug (#419) - :doc:`URL Helper <helpers/url_helper>` :php:func:`auto_link()` didn't recognize URLs that come after a word boundary.
-- Fixed a bug (#724) - :doc:`Form Validation Library <libraries/form_validation>` rule **is_unique** didn't check if a database connection exists.
-- Fixed a bug (#647) - :doc:`Zip Library <libraries/zip>` internal method ``_get_mod_time()`` didn't suppress possible "stat failed" errors generated by ``filemtime()``.
-- Fixed a bug (#157, #174) - :doc:`Image Manipulation Library <libraries/image_lib>` method ``clear()`` didn't completely clear properties.
-- Fixed a bug where :doc:`Database Forge <database/forge>` method ``create_table()`` with PostgreSQL database could lead to fetching the whole table.
-- Fixed a bug (#795) - :doc:`Form Helper <helpers/form_helper>` :php:func:`form_open()` didn't add the default form *method* and *accept-charset* when an empty array is passed to it.
-- Fixed a bug (#797) - :doc:`Date Helper <helpers/date_helper>` :php:func:`timespan()` was using incorrect seconds for year and month.
-- Fixed a bug in :doc:`Cart Library <libraries/cart>` method ``contents()`` where if called without a TRUE (or equal) parameter, it would fail due to a typo.
-- Fixed a bug (#406) - SQLSRV DB driver not returning resource on ``db_pconnect()``.
-- Fixed a bug in :doc:`Image Manipulation Library <libraries/image_lib>` method ``gd_loaded()`` where it was possible for the script execution to end or a PHP E_WARNING message to be emitted.
-- Fixed a bug in the :doc:`Pagination library <libraries/pagination>` where when use_page_numbers=TRUE previous link and page 1 link did not have the same url.
-- Fixed a bug (#561) - errors in :doc:`XML-RPC Library <libraries/xmlrpc>` were not properly escaped.
-- Fixed a bug (#904) - :doc:`Loader Library <libraries/loader>` method ``initialize()`` caused a PHP Fatal error to be triggered if error level E_STRICT is used.
-- Fixed a hosting edge case where an empty ``$_SERVER['HTTPS']`` variable would evaluate to 'on'.
-- Fixed a bug (#154) - :doc:`Session Library <libraries/sessions>` method ``sess_update()`` caused the session to be destroyed on pages where multiple AJAX requests were executed at once.
-- Fixed a possible bug in :doc:`Input Libary <libraries/input>` method ``is_ajax_request()`` where some clients might not send the X-Requested-With HTTP header value exactly as 'XmlHttpRequest'.
-- Fixed a bug (#1039) - :doc:`Database Utilities <database/utilities>` internal method ``_backup()`` method failed for the 'mysql' driver due to a table name not being escaped.
-- Fixed a bug (#1070) - ``CI_DB_driver::initialize()`` didn't set a character set if a database is not selected.
-- Fixed a bug (#177) - :doc:`Form Validation Library <libraries/form_validation>` method ``set_value()`` didn't set the default value if POST data is NULL.
-- Fixed a bug (#68, #414) - :Oracle's ``escape_str()`` didn't properly escape LIKE wild characters.
-- Fixed a bug (#81) - ODBC's ``list_fields()`` and ``field_data()`` methods skipped the first column due to ``odbc_field_*()`` functions' index starting at 1 instead of 0.
-- Fixed a bug (#129) - ODBC's ``num_rows()`` method returned -1 in some cases, due to not all subdrivers supporting the ``odbc_num_rows()`` function.
-- Fixed a bug (#153) - E_NOTICE being generated by ``getimagesize()`` in the :doc:`File Uploading Library <libraries/file_uploading>`.
-- Fixed a bug (#611) - SQLSRV's error handling methods used to issue warnings when there's no actual error.
-- Fixed a bug (#1036) - ``is_write_type()`` method in the :doc:`Database Library <database/index>` didn't return TRUE for RENAME queries.
-- Fixed a bug in PDO's ``_version()`` method where it used to return the client version as opposed to the server one.
-- Fixed a bug in PDO's ``insert_id()`` method where it could've failed if it's used with Postgre versions prior to 8.1.
-- Fixed a bug in CUBRID's ``affected_rows()`` method where a connection resource was passed to ``cubrid_affected_rows()`` instead of a result.
-- Fixed a bug (#638) - ``db_set_charset()`` ignored its arguments and always used the configured charset instead.
-- Fixed a bug (#413) - Oracle's error handling methods used to only return connection-related errors.
-- Fixed a bug (#1101) - :doc:`Database Result <database/results>` method ``field_data()`` for 'mysql', 'mysqli' drivers was implemented as if it was handling a DESCRIBE result instead of the actual result set.
-- Fixed a bug in Oracle's :doc:`Database Forge <database/forge>` method ``_create_table()`` where it failed with AUTO_INCREMENT as it's not supported.
-- Fixed a bug (#1080) - when using the SMTP protocol, :doc:`Email Library <libraries/email>` method ``send()`` was returning TRUE even if the connection/authentication against the server failed.
-- Fixed a bug (#306) - ODBC's ``insert_id()`` method was calling non-existent function ``odbc_insert_id()``, which resulted in a fatal error.
-- Fixed a bug in Oracle's :doc:`Database Result <database/results>` implementation where the cursor ID passed to it was always NULL.
-- Fixed a bug (#64) - Regular expression in *DB_query_builder.php* failed to handle queries containing SQL bracket delimiters in the JOIN condition.
-- Fixed a bug in the :doc:`Session Library <libraries/sessions>` where a PHP E_NOTICE error was triggered by ``_unserialize()`` due to results from databases such as MSSQL and Oracle being space-padded on the right.
-- Fixed a bug (#501) - :doc:`Form Validation Library <libraries/form_validation>` method ``set_rules()`` depended on ``count($_POST)`` instead of actually checking if the request method 'POST' before aborting.
-- Fixed a bug (#136) - PostgreSQL and MySQL's ``escape_str()`` method didn't properly escape LIKE wild characters.
-- Fixed a bug in :doc:`Loader Library <libraries/loader>` method ``library()`` where some PHP versions wouldn't execute the class constructor.
-- Fixed a bug (#88) - An unexisting property was used for configuration of the Memcache cache driver.
-- Fixed a bug (#14) - :doc:`Database Forge <database/forge>` method ``create_database()`` didn't utilize the configured database character set.
-- Fixed a bug (#23, #1238) - :doc:`Database Caching <database/caching>` method ``delete_all()`` used to delete .htaccess and index.html files, which is a potential security risk.
-- Fixed a bug in :doc:`Trackback Library <libraries/trackback>` method ``validate_url()`` where it didn't actually do anything, due to input not being passed by reference.
-- Fixed a bug (#11, #183, #863) - :doc:`Form Validation Library <libraries/form_validation>` method ``_execute()`` silently continued to the next rule, if a rule method/function is not found.
-- Fixed a bug (#122) - routed URI string was being reported incorrectly in sub-directories.
-- Fixed a bug (#1241) - :doc:`Zip Library <libraries/zip>` method ``read_dir()`` wasn't compatible with Windows.
-- Fixed a bug (#306) - ODBC driver didn't have an ``_insert_batch()`` method, which resulted in fatal error being triggered when ``insert_batch()`` is used with it.
-- Fixed a bug in MSSQL and SQLSrv's ``_truncate()`` where the TABLE keyword was missing.
-- Fixed a bug in PDO's ``trans_commit()`` method where it failed due to an erroneous property name.
-- Fixed a bug (#798) - :doc:`Query Builder <database/query_builder>` method ``update()`` used to ignore LIKE conditions that were set with ``like()``.
-- Fixed a bug in Oracle's and MSSQL's ``delete()`` methods where an erroneous SQL statement was generated when used with ``limit()``.
-- Fixed a bug in SQLSRV's ``delete()`` method where ``like()`` and ``limit()`` conditions were ignored.
-- Fixed a bug (#1265) - Database connections were always closed, regardless of the 'pconnect' option value.
-- Fixed a bug (#128) - :doc:`Language Library <libraries/language>` did not correctly keep track of loaded language files.
-- Fixed a bug (#1349) - :doc:`File Uploading Library <libraries/file_uploading>` method ``get_extension()`` returned the original filename when it didn't have an actual extension.
-- Fixed a bug (#1273) - :doc:`Query Builder <database/query_builder>` method ``set_update_batch()`` generated an E_NOTICE message.
-- Fixed a bug (#44, #110) - :doc:`File Uploading Library <libraries/file_uploading>` method ``clean_file_name()`` didn't clear '!' and '#' characters.
-- Fixed a bug (#121) - :doc:`Database Results <database/results>` method ``row()`` returned an array when there's no actual result to be returned.
-- Fixed a bug (#319) - SQLSRV's ``affected_rows()`` method failed due to a scrollable cursor being created for write-type queries.
-- Fixed a bug (#356) - :doc:`Database <database/index>` driver 'postgre' didn't have an ``_update_batch()`` method, which resulted in fatal error being triggered when ``update_batch()`` is used with it.
-- Fixed a bug (#784, #862) - :doc:`Database Forge <database/forge>` method ``create_table()`` failed on SQLSRV/MSSQL when used with 'IF NOT EXISTS'.
-- Fixed a bug (#1419) - :doc:`Driver Library <general/creating_drivers>` had a static variable that was causing an error.
-- Fixed a bug (#1411) - the :doc:`Email Library <libraries/email>` used its own short list of MIMEs instead the one from *config/mimes.php*.
-- Fixed a bug where php.ini setting *magic_quotes_runtime* wasn't turned off for PHP 5.3 (where it is indeed deprecated, but not non-existent).
-- Fixed a bug (#666) - :doc:`Output Library <libraries/output>` method ``set_content_type()`` didn't set the document charset.
-- Fixed a bug (#784, #861) - :doc:`Database Forge <database/forge>` method ``create_table()`` used to accept constraints for MSSQL/SQLSRV integer-type columns.
-- Fixed a bug (#706) - SQLSRV/MSSSQL :doc:`Database <database/index>` drivers didn't escape field names.
-- Fixed a bug (#1452) - :doc:`Query Builder <database/query_builder>` method ``protect_identifiers()`` didn't properly detect identifiers with spaces in their names.
-- Fixed a bug where :doc:`Query Builder <database/query_builder>` method ``protect_identifiers()`` ignored its extra arguments when the value passed to it is an array.
-- Fixed a bug where :doc:`Query Builder <database/query_builder>` internal method ``_has_operator()`` didn't detect BETWEEN.
-- Fixed a bug where :doc:`Query Builder <database/query_builder>` method ``join()`` failed with identifiers containing dashes.
-- Fixed a bug (#1264) - :doc:`Database Forge <database/forge>` and :doc:`Database Utilities <database/utilities>` didn't update/reset the databases and tables list cache when a table or a database is created, dropped or renamed.
-- Fixed a bug (#7) - :doc:`Query Builder <database/query_builder>` method ``join()`` only escaped one set of conditions.
-- Fixed a bug (#1321) - ``CI_Exceptions`` couldn't find the *errors/* directory in some cases.
-- Fixed a bug (#1202) - :doc:`Encrypt Library <libraries/encrypt>` ``encode_from_legacy()`` didn't set back the encrypt mode on failure.
-- Fixed a bug (#145) - :doc:`Database Class <database/index>` method ``compile_binds()`` failed when the bind marker was present in a literal string within the query.
-- Fixed a bug in :doc:`Query Builder <database/query_builder>` method ``protect_identifiers()`` where if passed along with the field names, operators got escaped as well.
-- Fixed a bug (#10) - :doc:`URI Library <libraries/uri>` internal method ``_detect_uri()`` failed with paths containing a colon.
-- Fixed a bug (#1387) - :doc:`Query Builder <database/query_builder>` method ``from()`` didn't escape table aliases.
-- Fixed a bug (#520) - :doc:`Date Helper <helpers/date_helper>` function :php:func:``nice_date()`` failed when the optional second parameter is not passed.
-- Fixed a bug (#318) - :doc:`Profiling Library <general/profiling>` setting *query_toggle_count* was not settable as described in the manual.
-- Fixed a bug (#938) - :doc:`Config Library <libraries/config>` method ``site_url()`` added a question mark to the URL string when query strings are enabled even if it already existed.
-- Fixed a bug (#999) - :doc:`Config Library <libraries/config>` method ``site_url()`` always appended ``$config['url_suffix']`` to the end of the URL string, regardless of whether a query string exists in it.
-- Fixed a bug where :doc:`URL Helper <helpers/url_helper>` function :php:func:`anchor_popup()` ignored the attributes argument if it is not an array.
-- Fixed a bug (#1328) - :doc:`Form Validation Library <libraries/form_validation>` didn't properly check the type of the form fields before processing them.
-- Fixed a bug (#79) - :doc:`Form Validation Library <libraries/form_validation>` didn't properly validate array fields that use associative keys or have custom indexes.
-- Fixed a bug (#427) - :doc:`Form Validation Library <libraries/form_validation>` method ``strip_image_tags()`` was an alias to a non-existent method.
-- Fixed a bug (#1545) - :doc:`Query Builder <database/query_builder>` method ``limit()`` wasn't executed properly under Oracle.
-- Fixed a bug (#1551) - :doc:`Date Helper <helpers/date_helper>` function :php:func:`standard_date()` didn't properly format *W3C* and *ATOM* standard dates.
-- Fixed a bug where :doc:`Query Builder <database/query_builder>` method ``join()`` escaped literal values as if they were fields.
-- Fixed a bug (#135) - PHP Error logging was impossible without the errors being displayed.
-- Fixed a bug (#1613) - :doc:`Form Helper <helpers/form_helper>` functions :php:func:`form_multiselect()`, :php:func:`form_dropdown()` didn't properly handle empty array option groups.
-- Fixed a bug (#1605) - :doc:`Pagination Library <libraries/pagination>` produced incorrect *previous* and *next* link values.
-- Fixed a bug in SQLSRV's ``affected_rows()`` method where an erroneous function name was used.
-- Fixed a bug (#1000) - Change syntax of ``$view_file`` to ``$_ci_view_file`` to prevent being overwritten by application.
-- Fixed a bug (#1757) - :doc:`Directory Helper <helpers/directory_helper>` function :php:func:`directory_map()` was skipping files and directories named '0'.
-- Fixed a bug (#1789) - :doc:`Database Library <database/index>` method ``escape_str()`` escaped quote characters in LIKE conditions twice under MySQL.
-- Fixed a bug (#395) - :doc:`Unit Testing Library <libraries/unit_testing>` method ``result()`` didn't properly check array result columns when called from ``report()``.
-- Fixed a bug (#1692) - :doc:`Database Class <database/index>` method ``display_error()`` didn't properly trace the possible error source on Windows systems.
-- Fixed a bug (#1745) - :doc:`Database Class <database/index>` method ``is_write_type()`` didn't return TRUE for LOAD queries.
-- Fixed a bug (#1765) - :doc:`Database Class <database/index>` didn't properly detect connection errors for the 'mysqli' driver.
-- Fixed a bug (#1257) - :doc:`Query Builder <database/query_builder>` used to (unnecessarily) group FROM clause contents, which breaks certain queries and is invalid for some databases.
-- Fixed a bug (#1709) - :doc:`Email <libraries/email>` headers were broken when using long email subjects and \r\n as CRLF.
-- Fixed a bug where ``MB_ENABLED`` constant was only declared if ``UTF8_ENABLED`` was set to TRUE.
-- Fixed a bug where the :doc:`Session Library <libraries/sessions>` accepted cookies with *last_activity* values being in the future.
-- Fixed a bug (#1897) - :doc:`Email Library <libraries/email>` triggered PHP E_WARNING errors when *mail* protocol used and ``to()`` is never called.
-- Fixed a bug (#1409) - :doc:`Email Library <libraries/email>` didn't properly handle multibyte characters when applying Q-encoding to headers.
-- Fixed a bug where :doc:`Email Library <libraries/email>` ignored its *wordwrap* setting while handling alternative messages.
-- Fixed a bug (#1476, #1909) - :doc:`Pagination Library <libraries/pagination>` didn't take into account actual routing when determining the current page.
-- Fixed a bug (#1766) - :doc:`Query Builder <database/query_builder>` didn't always take into account the *dbprefix* setting.
-- Fixed a bug (#779) - :doc:`URI Class <libraries/uri>` didn't always trim slashes from the *uri_string* as shown in the documentation.
-- Fixed a bug (#134) - :doc:`Database Caching <database/caching>` method ``delete_cache()`` didn't work in some cases due to *cachedir* not being initialized properly.
-- Fixed a bug (#191) - :doc:`Loader Library <libraries/loader>` ignored attempts for (re)loading databases to ``get_instance()->db`` even when the old database connection is dead.
-- Fixed a bug (#1255) - :doc:`User Agent Library <libraries/user_agent>` method ``is_referral()`` only checked if ``$_SERVER['HTTP_REFERER']`` exists.
-- Fixed a bug (#1146) - :doc:`Download Helper <helpers/download_helper>` function :php:func:`force_download()` incorrectly sent *Cache-Control* directives *pre-check* and *post-check* to Internet Explorer.
-- Fixed a bug (#1811) - :doc:`URI Library <libraries/uri>` didn't properly cache segments for ``uri_to_assoc()`` and ``ruri_to_assoc()``.
-- Fixed a bug (#1506) - :doc:`Form Helpers <helpers/form_helper>` set empty *name* attributes.
-- Fixed a bug (#59) - :doc:`Query Builder <database/query_builder>` method ``count_all_results()`` ignored the DISTINCT clause.
-- Fixed a bug (#1624) - :doc:`Form Validation Library <libraries/form_validation>` rule **matches** didn't property handle array field names.
-- Fixed a bug (#1630) - :doc:`Form Helper <helpers/form_helper>` function :php:func:`set_value()` didn't escape HTML entities.
-- Fixed a bug (#142) - :doc:`Form Helper <helpers/form_helper>` function :php:func:`form_dropdown()` didn't escape HTML entities in option values.
-- Fixed a bug (#50) - :doc:`Session Library <libraries/sessions>` unnecessarily stripped slashed from serialized data, making it impossible to read objects in a namespace.
-- Fixed a bug (#658) - :doc:`Routing <general/routing>` wildcard **:any** didn't work as advertised and matched multiple URI segments instead of all characters within a single segment.
-- Fixed a bug (#1938) - :doc:`Email Library <libraries/email>` removed multiple spaces inside a pre-formatted plain text message.
-- Fixed a bug (#122) - :doc:`URI Library <libraries/uri>` method ``ruri_string()`` didn't include a directory if one is used.
-- Fixed a bug - :doc:`Routing Library <general/routing>` didn't properly handle *default_controller* in a subdirectory when a method is also specified.
-- Fixed a bug (#953) - :doc:`post_controller_constructor hook <general/hooks>` wasn't called with a *404_override*.
-- Fixed a bug (#1220) - :doc:`Profiler Library <general/profiling>` didn't display information for database objects that are instantiated inside models.
-- Fixed a bug (#1978) - :doc:`Directory Helper <helpers/directory_helper>` function :php:func:`directory_map()`'s return array didn't make a distinction between directories and file indexes when a directory with a numeric name is present.
-- Fixed a bug (#777) - :doc:`Loader Library <libraries/loader>` didn't look for helper extensions in added package paths.
-- Fixed a bug (#18) - :doc:`APC Cache <libraries/caching>` driver didn't (un)serialize data, resulting in failure to store objects.
-- Fixed a bug (#188) - :doc:`Unit Testing Library <libraries/unit_testing>` filled up logs with error messages for non-existing language keys.
-- Fixed a bug (#113) - :doc:`Form Validation Library <libraries/form_validation>` didn't properly handle empty fields that were specified as an array.
-- Fixed a bug (#2061) - :doc:`Routing Class <general/routing>` didn't properly sanitize directory, controller and function triggers with **enable_query_strings** set to TRUE.
-- Fixed a bug - SQLSRV didn't support ``escape_like_str()`` or escaping an array of values.
-- Fixed a bug - :doc:`Database Results <database/results>` method ``list_fields()`` didn't reset its field pointer for the 'mysql', 'mysqli' and 'mssql' drivers.
-- Fixed a bug (#2211) - :doc:`Migration Library <libraries/migration>` extensions couldn't execute ``CI_Migration::__construct()``.
-- Fixed a bug (#2255) - :doc:`Email Library <libraries/email>` didn't apply *smtp_timeout* to socket reads and writes.
-- Fixed a bug (#2239) - :doc:`Email Library <libraries/email>` improperly handled the Subject when used with *bcc_batch_mode* resulting in E_WARNING messages and an empty Subject.
-- Fixed a bug (#2234) - :doc:`Query Builder <database/query_builder>` didn't reset JOIN cache for write-type queries.
-- Fixed a bug (#2298) - :doc:`Database Results <database/results>` method ``next_row()`` kept returning the last row, allowing for infinite loops.
-- Fixed a bug (#2236, #2639) - :doc:`Form Helper <helpers/form_helper>` functions :php:func:`set_value()`, :php:func:`set_select()`, :php:func:`set_radio()`, :php:func:`set_checkbox()` didn't parse array notation for keys if the rule was not present in the :doc:`Form Validation Library <libraries/form_validation>`.
-- Fixed a bug (#2353) - :doc:`Query Builder <database/query_builder>` erroneously prefixed literal strings with **dbprefix**.
-- Fixed a bug (#78) - :doc:`Cart Library <libraries/cart>` didn't allow non-English letters in product names.
-- Fixed a bug (#77) - :doc:`Database Class <database/index>` didn't properly handle the transaction "test mode" flag.
-- Fixed a bug (#2380) - :doc:`URI Routing <general/routing>` method ``fetch_method()`` returned 'index' if the requested method name matches its controller name.
-- Fixed a bug (#2388) - :doc:`Email Library <libraries/email>` used to ignore attachment errors, resulting in broken emails being sent.
-- Fixed a bug (#2498) - :doc:`Form Validation Library <libraries/form_validation>` rule **valid_base64** only checked characters instead of actual validity.
-- Fixed a bug (#2425) - OCI8 :doc:`database <database/index>` driver method ``stored_procedure()`` didn't log an error unless **db_debug** was set to TRUE.
-- Fixed a bug (#2490) - :doc:`Database Class <database/queries>` method ``query()`` returning boolean instead of a result object for PostgreSQL-specific *INSERT INTO ... RETURNING* statements.
-- Fixed a bug (#249) - :doc:`Cache Library <libraries/caching>` didn't properly handle Memcache(d) configurations with missing options.
-- Fixed a bug (#180) - :php:func:`config_item()` didn't take into account run-time configuration changes.
-- Fixed a bug (#2551) - :doc:`Loader Library <libraries/loader>` method ``library()`` didn't properly check if a class that is being loaded already exists.
-- Fixed a bug (#2560) - :doc:`Form Helper <helpers/form_helper>` function :php:func:`form_open()` set the 'method="post"' attribute only if the passed attributes equaled an empty string.
-- Fixed a bug (#2585) - :doc:`Query Builder <database/query_builder>` methods ``min()``, ``max()``, ``avg()``, ``sum()`` didn't escape field names.
-- Fixed a bug (#2590) - :doc:`Common function <general/common_functions>` :php:func:`log_message()` didn't actually cache the ``CI_Log`` class instance.
-- Fixed a bug (#2609) - :doc:`Common function <general/common_functions>` :php:func:`get_config()` optional argument was only effective on first function call. Also, it can now add items, in addition to updating existing items.
-- Fixed a bug in the 'postgre' :doc:`database <database/index>` driver where the connection ID wasn't passed to ``pg_escape_string()``.
-- Fixed a bug (#33) - Script execution was terminated when an invalid cookie key was encountered.
-- Fixed a bug (#2691) - nested :doc:`database <database/index>` transactions could end in a deadlock when an error is encountered with *db_debug* set to TRUE.
-- Fixed a bug (#2515) - ``_exception_handler()`` used to send the 200 "OK" HTTP status code and didn't stop script exection even on fatal errors.
-- Fixed a bug - Redis :doc:`Caching <libraries/caching>` driver didn't handle connection failures properly.
-- Fixed a bug (#2756) - :doc:`Database Class <database/index>` executed the MySQL-specific `SET SESSION sql_mode` query for all drivers when the 'stricton' option is set.
-- Fixed a bug (#2579) - :doc:`Query Builder <database/query_builder>` "no escape" functionality didn't work properly with query cache.
-- Fixed a bug (#2237) - :doc:`Parser Library <libraries/parser>` failed if the same tag pair is used more than once within a template.
-- Fixed a bug (#2143) - :doc:`Form Validation Library <libraries/form_validation>` didn't check for rule groups named in a *controller/method* manner when trying to load from a config file.
-- Fixed a bug (#2762) - :doc:`Hooks Class <general/hooks>` didn't properly check if the called class/function exists.
-- Fixed a bug (#148) - :doc:`Input Library <libraries/input>` internal method ``_clean_input_data()`` assumed that it data is URL-encoded, stripping certain character sequences from it.
-- Fixed a bug (#346) - with ``$config['global_xss_filtering']`` turned on, the ``$_GET``, ``$_POST``, ``$_COOKIE`` and ``$_SERVER`` superglobals were overwritten during initialization time, resulting in XSS filtering being either performed twice or there was no possible way to get the original data, even though options for this do exist.
-- Fixed an edge case (#555) - :doc:`User Agent Library <libraries/user_agent>` reported an incorrect version Opera 10+ due to a non-standard user-agent string.
-- Fixed a bug (#133) - :doc:`Text Helper <helpers/text_helper>` :php:func:`ascii_to_entities()` stripped the last character if it happens to be in the extended ASCII group.
-- Fixed a bug (#2822) - ``fwrite()`` was used incorrectly throughout the whole framework, allowing incomplete writes when writing to a network stream and possibly a few other edge cases.
-- Fixed a bug where :doc:`User Agent Library <libraries/user_agent>` methods ``accept_charset()`` and ``accept_lang()`` didn't properly parse HTTP headers that contain spaces.
-- Fixed a bug where *default_controller* was called instad of triggering a 404 error if the current route is in a controller directory.
-- Fixed a bug (#2737) - :doc:`XML-RPC Library <libraries/xmlrpc>` used objects as array keys, which triggered E_NOTICE messages.
-- Fixed a bug (#2771) - :doc:`Security Library <libraries/security>` method ``xss_clean()`` didn't take into account HTML5 entities.
-- Fixed a bug (#2856) - ODBC method ``affected_rows()`` passed an incorrect value to ``odbc_num_rows()``.
-- Fixed a bug (#43) :doc:`Image Manipulation Library <libraries/image_lib>` method ``text_watermark()`` didn't properly determine watermark placement.
-- Fixed a bug where :doc:`HTML Table Library <libraries/table>` ignored its *auto_heading* setting if headings were not already set.
-- Fixed a bug (#2364) - :doc:`Pagination Library <libraries/pagination>` appended the query string (if used) multiple times when there are successive calls to ``create_links()`` with no ``initialize()`` in between them.
-- Partially fixed a bug (#261) - UTF-8 class method ``clean_string()`` generating log messages and/or not producing the desired result due to an upstream bug in iconv.
-- Fixed a bug where ``CI_Xmlrpcs::parseRequest()`` could fail if ``$HTTP_RAW_POST_DATA`` is not populated.
-- Fixed a bug in :doc:`Zip Library <libraries/zip>` internal method ``_get_mod_time()`` where it was not parsing result returned by ``filemtime()``.
-- Fixed a bug (#3161) - :doc:`Cache Library <libraries/caching>` methods `increment()`, `decrement()` didn't auto-create non-existent items when using redis and/or file storage.
-- Fixed a bug (#3189) - :doc:`Parser Library <libraries/parser>` used double replacement on ``key->value`` pairs, exposing a potential template injection vulnerability.
-- Fixed a bug (#3573) - :doc:`Email Library <libraries/email>` violated `RFC5321 <https://tools.ietf.org/rfc/rfc5321.txt>`_ by sending 'localhost.localdomain' as a hostname.
-- Fixed a bug (#3572) - ``CI_Security::_remove_evil_attributes()`` failed for large-sized inputs due to *pcre.backtrack_limit* and didn't properly match HTML tags.
-
-Version 2.2.3
-=============
-
-Release Date: July 14, 2015
-
-- Security
-
- - Removed a fallback to ``mysql_escape_string()`` in the 'mysql' database driver (``escape_str()`` method) when there's no active database connection.
-
-Version 2.2.2
-=============
-
-Release Date: April 15, 2015
-
-- General Changes
-
- - Added HTTP "Host" header character validation to prevent cache poisoning attacks when *base_url* auto-detection is used.
- - Added *FSCommand* and *seekSegmentTime* to the "evil attributes" list in ``CI_Security::xss_clean()``.
-
-Bug fixes for 2.2.2
--------------------
-
-- Fixed a bug (#3665) - ``CI_Security::entity_decode()`` triggered warnings under some circumstances.
-
-Version 2.2.1
-=============
-
-Release Date: January 22, 2015
-
-- General Changes
-
- - Improved security in ``xss_clean()``.
- - Updated timezones in :doc:`Date Helper <helpers/date_helper>`.
-
-Bug fixes for 2.2.1
--------------------
-
-- Fixed a bug (#3094) - Internal method ``CI_Input::_clean_input_data()`` breaks encrypted session cookies.
-- Fixed a bug (#2268) - :doc:`Security Library <libraries/security>` method ``xss_clean()`` didn't properly match JavaScript events.
-- Fixed a bug (#3309) - :doc:`Security Library <libraries/security>` method ``xss_clean()`` used an overly-invasive pattern to strip JS event handlers.
-- Fixed a bug (#2771) - :doc:`Security Library <libraries/security>` method ``xss_clean()`` didn't take into account HTML5 entities.
-- Fixed a bug (#73) - :doc:`Security Library <libraries/security>` method ``sanitize_filename()`` could be tricked by an XSS attack.
-- Fixed a bug (#2681) - :doc:`Security Library <libraries/security>` method ``entity_decode()`` used the ``PREG_REPLACE_EVAL`` flag, which is deprecated since PHP 5.5.
-- Fixed a bug (#3302) - Internal function ``get_config()`` triggered an E_NOTICE message on PHP 5.6.
-- Fixed a bug (#2508) - :doc:`Config Library <libraries/config>` didn't properly detect if the current request is via HTTPS.
-- Fixed a bug (#3314) - SQLSRV :doc:`Database driver <database/index>`'s method ``count_all()`` didn't escape the supplied table name.
-- Fixed a bug (#3404) - MySQLi :doc:`Database driver <database/index>`'s method ``escape_str()`` had a wrong fallback to ``mysql_escape_string()`` when there was no active connection.
-- Fixed a bug in the :doc:`Session Library <libraries/sessions>` where session ID regeneration occurred during AJAX requests.
-
-Version 2.2.0
-=============
-
-Release Date: June 2, 2014
-
-- General Changes
-
- - Security: :doc:`Encrypt Library <libraries/encrypt>` method ``xor_encode()`` has been removed. The Encrypt Class now requires the Mcrypt extension to be installed.
- - Security: The :doc:`Session Library <libraries/sessions>` now uses HMAC authentication instead of a simple MD5 checksum.
-
-Bug fixes for 2.2.0
--------------------
-
-- Fixed an edge case (#2583) in the :doc:`Email Library <libraries/email>` where `Suhosin <http://www.hardened-php.net/suhosin/>` blocked messages sent via ``mail()`` due to trailing newspaces in headers.
-- Fixed a bug (#696) - make ``oci_execute()`` calls inside ``num_rows()`` non-committing, since they are only there to reset which row is next in line for oci_fetch calls and thus don't need to be committed.
-- Fixed a bug (#2689) - :doc:`Database Force <database/forge>` methods ``create_table()``, ``drop_table()`` and ``rename_table()`` produced broken SQL for tge 'sqlsrv' driver.
-- Fixed a bug (#2427) - PDO :doc:`Database driver <database/index>` didn't properly check for query failures.
-- Fixed a bug in the :doc:`Session Library <libraries/sessions>` where authentication was not performed for encrypted cookies.
-
-Version 2.1.4
-=============
-
-Release Date: July 8, 2013
-
-- General Changes
-
- - Improved security in ``xss_clean()``.
-
-Bug fixes for 2.1.4
--------------------
-
-- Fixed a bug (#1936) - :doc:`Migration Library <libraries/migration>` method ``latest()`` had a typo when retrieving language values.
-- Fixed a bug (#2021) - :doc:`Migration Library <libraries/migration>` configuration file was mistakenly using Windows style line feeds.
-- Fixed a bug (#1273) - ``E_NOTICE`` being generated by :doc:`Query Builder <database/query_builder>`'s ``set_update_batch()`` method.
-- Fixed a bug (#2337) - :doc:`Email Library <libraries/email>` method ``print_debugger()`` didn't apply ``htmlspecialchars()`` to headers.
-
-Version 2.1.3
-=============
-
-Release Date: October 8, 2012
-
-- Core
-
- - :doc:`Common function <general/common_functions>` ``is_loaded()`` now returns a reference.
-
-Bug fixes for 2.1.3
--------------------
-
-- Fixed a bug (#1543) - File-based :doc:`Caching <libraries/caching>` method ``get_metadata()`` used a non-existent array key to look for the TTL value.
-- Fixed a bug (#1314) - :doc:`Session Library <libraries/sessions>` method ``sess_destroy()`` didn't destroy the userdata array.
-- Fixed a bug (#804) - :doc:`Profiler library <general/profiling>` was trying to handle objects as strings in some cases, resulting in *E_WARNING* messages being issued by ``htmlspecialchars()``.
-- Fixed a bug (#1699) - :doc:`Migration Library <libraries/migration>` ignored the ``$config['migration_path']`` setting.
-- Fixed a bug (#227) - :doc:`Input Library <libraries/input>` allowed unconditional spoofing of HTTP clients' IP addresses through the *HTTP_CLIENT_IP* header.
-- Fixed a bug (#907) - :doc:`Input Library <libraries/input>` ignored *HTTP_X_CLUSTER_CLIENT_IP* and *HTTP_X_CLIENT_IP* headers when checking for proxies.
-- Fixed a bug (#940) - ``csrf_verify()`` used to set the CSRF cookie while processing a POST request with no actual POST data, which resulted in validating a request that should be considered invalid.
-- Fixed a bug (#499) - :doc:`Security Library <libraries/security>` where a CSRF cookie was created even if ``$config['csrf_protection']`` is set to FALSE.
-- Fixed a bug (#1715) - :doc:`Input Library <libraries/input>` triggered ``csrf_verify()`` on CLI requests.
-- Fixed a bug (#751) - :doc:`Query Builder <database/query_builder>` didn't properly handle cached field escaping overrides.
-- Fixed a bug (#2004) - :doc:`Query Builder <database/query_builder>` didn't properly merge cached calls with non-cache ones.
-
-Version 2.1.2
-=============
-
-Release Date: June 29, 2012
-
-- General Changes
-
- - Improved security in ``xss_clean()``.
-
-Version 2.1.1
-=============
-
-Release Date: June 12, 2012
-
-- General Changes
-
- - Fixed support for docx, xlsx files in mimes.php.
-
-- Libraries
-
- - Further improved MIME type detection in the :doc:`File Uploading Library <libraries/file_uploading>`.
- - Added support for IPv6 to the :doc:`Input Library <libraries/input>`.
- - Added support for the IP format parameter to the :doc:`Form Validation Library <libraries/form_validation>`.
-
-- Helpers
-
- - ``url_title()`` performance and output improved. You can now use any string as the word delimiter, but 'dash' and 'underscore' are still supported.
-
-Bug fixes for 2.1.1
--------------------
-
-- Fixed a bug (#697) - A wrong array key was used in the :doc:`File Uploading Library <libraries/file_uploading>` to check for mime-types.
-- Fixed a bug - ``form_open()`` compared $action against ``site_url()`` instead of ``base_url()``.
-- Fixed a bug - ``CI_Upload::_file_mime_type()`` could've failed if ``mime_content_type()`` is used for the detection and returns FALSE.
-- Fixed a bug (#538) - Windows paths were ignored when using the :doc:`Image Manipulation Library <libraries/image_lib>` to create a new file.
-- Fixed a bug - When database caching was enabled, $this->db->query() checked the cache before binding variables which resulted in cached queries never being found.
-- Fixed a bug - CSRF cookie value was allowed to be any (non-empty) string before being written to the output, making code injection a risk.
-- Fixed a bug (#726) - PDO put a 'dbname' argument in its connection string regardless of the database platform in use, which made it impossible to use SQLite.
-- Fixed a bug - ``CI_DB_pdo_driver::num_rows()`` was not returning properly value with SELECT queries, cause it was relying on ``PDOStatement::rowCount()``.
-- Fixed a bug (#1059) - ``CI_Image_lib::clear()`` was not correctly clearing all necessary object properties, namely width and height.
-
-Version 2.1.0
-=============
-
-Release Date: November 14, 2011
-
-- General Changes
-
- - Callback validation rules can now accept parameters like any other
- validation rule.
- - Added html_escape() to :doc:`Common
- functions <general/common_functions>` to escape HTML output
- for preventing XSS.
-
-- Helpers
-
- - Added increment_string() to :doc:`String
- Helper <helpers/string_helper>` to turn "foo" into "foo-1"
- or "foo-1" into "foo-2".
- - Altered form helper - made action on form_open_multipart helper
- function call optional. Fixes (#65)
- - url_title() will now trim extra dashes from beginning and end.
- - Improved speed of :doc:`String Helper <helpers/string_helper>`'s random_string() method
-
-- Database
-
- - Added a `CUBRID <http://www.cubrid.org/>`_ driver to the :doc:`Database
- Driver <database/index>`. Thanks to the CUBRID team for
- supplying this patch.
- - Added a PDO driver to the :doc:`Database Driver <database/index>`.
- - Typecast limit and offset in the :doc:`Database
- Driver <database/queries>` to integers to avoid possible
- injection.
- - Added additional option 'none' for the optional third argument for
- $this->db->like() in the :doc:`Database
- Driver <database/query_builder>`.
- - Added $this->db->insert_batch() support to the OCI8 (Oracle) driver.
- - Added failover if the main connections in the config should fail
-
-- Libraries
-
- - Changed ``$this->cart->insert()`` in the :doc:`Cart
- Library <libraries/cart>` to return the Row ID if a single
- item was inserted successfully.
- - Added support to set an optional parameter in your callback rules
- of validation using the :doc:`Form Validation
- Library <libraries/form_validation>`.
- - Added a :doc:`Migration library <libraries/migration>` to assist with applying
- incremental updates to your database schema.
- - Driver children can be located in any package path.
- - Added max_filename_increment config setting for Upload library.
- - Added ``is_unique`` to the :doc:`Form Validation library <libraries/form_validation>`.
- - Added $config['use_page_numbers'] to the :doc:`Pagination library <libraries/pagination>`, which enables real page numbers in the URI.
- - Added TLS and SSL Encryption for SMTP.
-
-- Core
-
- - Changed private functions in CI_URI to protected so MY_URI can
- override them.
- - Removed CI_CORE boolean constant from CodeIgniter.php (no longer Reactor and Core versions).
-
-Bug fixes for 2.1.0
--------------------
-
-- Fixed #378 Robots identified as regular browsers by the User Agent
- class.
-- If a config class was loaded first then a library with the same name
- is loaded, the config would be ignored.
-- Fixed a bug (Reactor #19) where 1) the 404_override route was being
- ignored in some cases, and 2) auto-loaded libraries were not
- available to the 404_override controller when a controller existed
- but the requested method did not.
-- Fixed a bug (Reactor #89) where MySQL export would fail if the table
- had hyphens or other non alphanumeric/underscore characters.
-- Fixed a bug (#105) that stopped query errors from being logged unless database debugging was enabled
-- Fixed a bug (#160) - Removed unneeded array copy in the file cache
- driver.
-- Fixed a bug (#150) - field_data() now correctly returns column
- length.
-- Fixed a bug (#8) - load_class() now looks for core classes in
- APPPATH first, allowing them to be replaced.
-- Fixed a bug (#24) - ODBC database driver called incorrect parent in __construct().
-- Fixed a bug (#85) - OCI8 (Oracle) database escape_str() function did not escape correct.
-- Fixed a bug (#344) - Using schema found in :doc:`Saving Session Data to a Database <libraries/sessions>`, system would throw error "user_data does not have a default value" when deleting then creating a session.
-- Fixed a bug (#112) - OCI8 (Oracle) driver didn't pass the configured database character set when connecting.
-- Fixed a bug (#182) - OCI8 (Oracle) driver used to re-execute the statement whenever num_rows() is called.
-- Fixed a bug (#82) - WHERE clause field names in the DB update_string() method were not escaped, resulting in failed queries in some cases.
-- Fixed a bug (#89) - Fix a variable type mismatch in DB display_error() where an array is expected, but a string could be set instead.
-- Fixed a bug (#467) - Suppress warnings generated from get_magic_quotes_gpc() (deprecated in PHP 5.4)
-- Fixed a bug (#484) - First time _csrf_set_hash() is called, hash is never set to the cookie (in Security.php).
-- Fixed a bug (#60) - Added _file_mime_type() method to the :doc:`File Uploading Library <libraries/file_uploading>` in order to fix a possible MIME-type injection.
-- Fixed a bug (#537) - Support for all wav type in browser.
-- Fixed a bug (#576) - Using ini_get() function to detect if apc is enabled or not.
-- Fixed invalid date time format in :doc:`Date helper <helpers/date_helper>` and :doc:`XMLRPC library <libraries/xmlrpc>`.
-- Fixed a bug (#200) - MySQL queries would be malformed after calling db->count_all() then db->get().
-
-Version 2.0.3
-=============
-
-Release Date: August 20, 2011
-
-- Security
-
- - An improvement was made to the MySQL and MySQLi drivers to prevent
- exposing a potential vector for SQL injection on sites using
- multi-byte character sets in the database client connection.
- An incompatibility in PHP versions < 5.2.3 and MySQL < 5.0.7 with
- *mysql_set_charset()* creates a situation where using multi-byte
- character sets on these environments may potentially expose a SQL
- injection attack vector. Latin-1, UTF-8, and other "low ASCII"
- character sets are unaffected on all environments.
-
- If you are running or considering running a multi-byte character
- set for your database connection, please pay close attention to
- the server environment you are deploying on to ensure you are not
- vulnerable.
-
-- General Changes
-
- - Fixed a bug where there was a misspelling within a code comment in
- the index.php file.
- - Added Session Class userdata to the output profiler. Additionally,
- added a show/hide toggle on HTTP Headers, Session Data and Config
- Variables.
- - Removed internal usage of the EXT constant.
- - Visual updates to the welcome_message view file and default error
- templates. Thanks to `danijelb <https://bitbucket.org/danijelb>`_
- for the pull request.
- - Added insert_batch() function to the PostgreSQL database driver.
- Thanks to epallerols for the patch.
- - Added "application/x-csv" to mimes.php.
- - Fixed a bug where :doc:`Email library <libraries/email>`
- attachments with a "." in the name would using invalid MIME-types.
-
-- Helpers
-
- - Added an optional third parameter to heading() which allows adding
- html attributes to the rendered heading tag.
- - form_open() now only adds a hidden (Cross-site Reference Forgery)
- protection field when the form's action is internal and is set to
- the post method. (Reactor #165)
- - Re-worked plural() and singular() functions in the :doc:`Inflector
- helper <helpers/inflector_helper>` to support considerably
- more words.
-
-- Libraries
-
- - Altered Session to use a longer match against the user_agent
- string. See upgrade notes if using database sessions.
- - Added $this->db->set_dbprefix() to the :doc:`Database
- Driver <database/queries>`.
- - Changed $this->cart->insert() in the :doc:`Cart
- Library <libraries/cart>` to return the Row ID if a single
- item was inserted successfully.
- - Added $this->load->get_var() to the :doc:`Loader
- library <libraries/loader>` to retrieve global vars set with
- $this->load->view() and $this->load->vars().
- - Changed $this->db->having() to insert quotes using escape() rather
- than escape_str().
-
-Bug fixes for 2.0.3
--------------------
-
-- Added ENVIRONMENT to reserved constants. (Reactor #196)
-- Changed server check to ensure SCRIPT_NAME is defined. (Reactor #57)
-- Removed APPPATH.'third_party' from the packages autoloader to negate
- needless file stats if no packages exist or if the developer does not
- load any other packages by default.
-- Fixed a bug (Reactor #231) where Sessions Library database table
- example SQL did not contain an index on last_activity. See :doc:`Upgrade
- Notes <installation/upgrade_203>`.
-- Fixed a bug (Reactor #229) where the Sessions Library example SQL in
- the documentation contained incorrect SQL.
-- Fixed a bug (Core #340) where when passing in the second parameter to
- $this->db->select(), column names in subsequent queries would not be
- properly escaped.
-- Fixed issue #199 - Attributes passed as string does not include a
- space between it and the opening tag.
-- Fixed a bug where the method $this->cart->total_items() from :doc:`Cart
- Library <libraries/cart>` now returns the sum of the quantity
- of all items in the cart instead of your total count.
-- Fixed a bug where not setting 'null' when adding fields in db_forge
- for mysql and mysqli drivers would default to NULL instead of NOT
- NULL as the docs suggest.
-- Fixed a bug where using $this->db->select_max(),
- $this->db->select_min(), etc could throw notices. Thanks to w43l for
- the patch.
-- Replace checks for STDIN with php_sapi_name() == 'cli' which on the
- whole is more reliable. This should get parameters in crontab
- working.
-
-Version 2.0.2
-=============
-
-Release Date: April 7, 2011
-Hg Tag: v2.0.2
-
-- General changes
-
- - The :doc:`Security library <./libraries/security>` was moved to
- the core and is now loaded automatically. Please remove your
- loading calls.
- - The CI_SHA class is now deprecated. All supported versions of PHP
- provide a sha1() function.
- - constants.php will now be loaded from the environment folder if
- available.
- - Added language key error logging
- - Made Environment Support optional. Comment out or delete the
- constant to stop environment checks.
- - Added Environment Support for Hooks.
- - Added CI\_ Prefix to the :doc:`Cache driver <libraries/caching>`.
- - Added :doc:`CLI usage <./general/cli>` documentation.
-
-- Helpers
-
- - Removed the previously deprecated dohash() from the :doc:`Security
- helper <./helpers/security_helper>`; use do_hash() instead.
- - Changed the 'plural' function so that it doesn't ruin the
- captalization of your string. It also take into consideration
- acronyms which are all caps.
-
-- Database
-
- - $this->db->count_all_results() will now return an integer
- instead of a string.
-
-Bug fixes for 2.0.2
--------------------
-
-- Fixed a bug (Reactor #145) where the Output Library had
- parse_exec_vars set to protected.
-- Fixed a bug (Reactor #80) where is_really_writable would create an
- empty file when on Windows or with safe_mode enabled.
-- Fixed various bugs with User Guide.
-- Added is_cli_request() method to documentation for :doc:`Input
- class <libraries/input>`.
-- Added form_validation_lang entries for decimal, less_than and
- greater_than.
-- Fixed issue #153 Escape Str Bug in MSSQL driver.
-- Fixed issue #172 Google Chrome 11 posts incorrectly when action is empty.
-
-Version 2.0.1
-=============
-
-Release Date: March 15, 2011
-Hg Tag: v2.0.1
-
-- General changes
-
- - Added $config['cookie_secure'] to the config file to allow
- requiring a secure (HTTPS) in order to set cookies.
- - Added the constant CI_CORE to help differentiate between Core:
- TRUE and Reactor: FALSE.
- - Added an ENVIRONMENT constant in index.php, which affects PHP
- error reporting settings, and optionally, which configuration
- files are loaded (see below). Read more on the :doc:`Handling
- Environments <general/environments>` page.
- - Added support for
- :ref:`environment-specific <config-environments>`
- configuration files.
-
-- Libraries
-
- - Added decimal, less_than and greater_than rules to the :doc:`Form
- validation Class <libraries/form_validation>`.
- - :doc:`Input Class <libraries/input>` methods post() and get()
- will now return a full array if the first argument is not
- provided.
- - Secure cookies can now be made with the set_cookie() helper and
- :doc:`Input Class <libraries/input>` method.
- - Added set_content_type() to :doc:`Output
- Class <libraries/output>` to set the output Content-Type
- HTTP header based on a MIME Type or a config/mimes.php array key.
- - :doc:`Output Class <libraries/output>` will now support method
- chaining.
-
-- Helpers
-
- - Changed the logic for form_open() in :doc:`Form
- helper <helpers/form_helper>`. If no value is passed it will
- submit to the current URL.
-
-Bug fixes for 2.0.1
--------------------
-
-- CLI requests can now be run from any folder, not just when CD'ed next
- to index.php.
-- Fixed issue #41: Added audio/mp3 mime type to mp3.
-- Fixed a bug (Core #329) where the file caching driver referenced the
- incorrect cache directory.
-- Fixed a bug (Reactor #69) where the SHA1 library was named
- incorrectly.
-
-.. _2.0.0-changelog:
-
-Version 2.0.0
-=============
-
-Release Date: January 28, 2011
-Hg Tag: v2.0.0
-
-- General changes
-
- - PHP 4 support is removed. CodeIgniter now requires PHP 5.1.6.
- - Scaffolding, having been deprecated for a number of versions, has
- been removed.
- - Plugins have been removed, in favor of Helpers. The CAPTCHA plugin
- has been converted to a Helper and
- :doc:`documented <./helpers/captcha_helper>`. The JavaScript
- calendar plugin was removed due to the ready availability of great
- JavaScript calendars, particularly with jQuery.
- - Added new special Library type:
- :doc:`Drivers <./general/drivers>`.
- - Added full query-string support. See the config file for details.
- - Moved the application folder outside of the system folder.
- - Moved system/cache and system/logs directories to the application
- directory.
- - Added routing overrides to the main index.php file, enabling the
- normal routing to be overridden on a per "index" file basis.
- - Added the ability to set config values (or override config values)
- directly from data set in the main index.php file. This allows a
- single application to be used with multiple front controllers,
- each having its own config values.
- - Added $config['directory_trigger'] to the config file so that a
- controller sub-directory can be specified when running _GET
- strings instead of URI segments.
- - Added ability to set "Package" paths - specific paths where the
- Loader and Config classes should try to look first for a requested
- file. This allows distribution of sub-applications with their own
- libraries, models, config files, etc. in a single "package"
- directory. See the :doc:`Loader class <libraries/loader>`
- documentation for more details.
- - In-development code is now hosted at BitBucket .
- - Removed the deprecated Validation Class.
- - Added CI\_ Prefix to all core classes.
- - Package paths can now be set in application/config/autoload.php.
- - :doc:`Upload library <libraries/file_uploading>` file_name can
- now be set without an extension, the extension will be taken from
- the uploaded file instead of the given name.
- - In :doc:`Database Forge <database/forge>` the name can be omitted
- from $this->dbforge->modify_column()'s 2nd param if you aren't
- changing the name.
- - $config['base_url'] is now empty by default and will guess what
- it should be.
- - Enabled full Command Line Interface compatibility with
- config['uri_protocol'] = 'CLI';.
-
-- Libraries
-
- - Added a :doc:`Cache driver <libraries/caching>` with APC,
- memcached, and file-based support.
- - Added $prefix, $suffix and $first_url properties to :doc:`Pagination
- library <./libraries/pagination>`.
- - Added the ability to suppress first, previous, next, last, and
- page links by setting their values to FALSE in the :doc:`Pagination
- library <./libraries/pagination>`.
- - Added :doc:`Security library <./libraries/security>`, which now
- contains the xss_clean function, filename_security function and
- other security related functions.
- - Added CSRF (Cross-site Reference Forgery) protection to the
- :doc:`Security library <./libraries/security>`.
- - Added $parse_exec_vars property to Output library.
- - Added ability to enable / disable individual sections of the
- :doc:`Profiler <general/profiling>`
- - Added a wildcard option $config['allowed_types'] = '\*' to the
- :doc:`File Uploading Class <./libraries/file_uploading>`.
- - Added an 'object' config variable to the XML-RPC Server library so
- that one can specify the object to look for requested methods,
- instead of assuming it is in the $CI superobject.
- - Added "is_object" into the list of unit tests capable of being
- run.
- - Table library will generate an empty cell with a blank string, or
- NULL value.
- - Added ability to set tag attributes for individual cells in the
- Table library
- - Added a parse_string() method to the :doc:`Parser
- Class <libraries/parser>`.
- - Added HTTP headers and Config information to the
- :doc:`Profiler <general/profiling>` output.
- - Added Chrome and Flock to the list of detectable browsers by
- browser() in the :doc:`User Agent Class <libraries/user_agent>`.
- - The :doc:`Unit Test Class <libraries/unit_testing>` now has an
- optional "notes" field available to it, and allows for discrete
- display of test result items using
- $this->unit->set_test_items().
- - Added a $xss_clean class variable to the XMLRPC library, enabling
- control over the use of the Security library's xss_clean()
- method.
- - Added a download() method to the :doc:`FTP
- library <libraries/ftp>`
- - Changed do_xss_clean() to return FALSE if the uploaded file
- fails XSS checks.
- - Added stripslashes() and trim()ing of double quotes from $_FILES
- type value to standardize input in Upload library.
- - Added a second parameter (boolean) to
- $this->zip->read_dir('/path/to/directory', FALSE) to remove the
- preceding trail of empty folders when creating a Zip archive. This
- example would contain a zip with "directory" and all of its
- contents.
- - Added ability in the Image Library to handle PNG transparency for
- resize operations when using the GD lib.
- - Modified the Session class to prevent use if no encryption key is
- set in the config file.
- - Added a new config item to the Session class
- sess_expire_on_close to allow sessions to auto-expire when the
- browser window is closed.
- - Improved performance of the Encryption library on servers where
- Mcrypt is available.
- - Changed the default encryption mode in the Encryption library to
- CBC.
- - Added an encode_from_legacy() method to provide a way to
- transition encrypted data from CodeIgniter 1.x to CodeIgniter 2.x.
- Please see the :doc:`upgrade
- instructions <./installation/upgrade_200>` for details.
- - Altered Form_Validation library to allow for method chaining on
- set_rules(), set_message() and set_error_delimiters()
- functions.
- - Altered Email Library to allow for method chaining.
- - Added request_headers(), get_request_header() and
- is_ajax_request() to the input class.
- - Altered :doc:`User agent library <libraries/user_agent>` so that
- is_browser(), is_mobile() and is_robot() can optionally check
- for a specific browser or mobile device.
- - Altered :doc:`Input library <libraries/input>` so that post() and
- get() will return all POST and GET items (respectively) if there
- are no parameters passed in.
-
-- Database
-
- - :doc:`database configuration <./database/configuration>`.
- - Added autoinit value to :doc:`database
- configuration <./database/configuration>`.
- - Added stricton value to :doc:`database
- configuration <./database/configuration>`.
- - Added database_exists() to the :doc:`Database Utilities
- Class <database/utilities>`.
- - Semantic change to db->version() function to allow a list of
- exceptions for databases with functions to return version string
- instead of specially formed SQL queries. Currently this list only
- includes Oracle and SQLite.
- - Fixed a bug where driver specific table identifier protection
- could lead to malformed queries in the field_data() functions.
- - Fixed a bug where an undefined class variable was referenced in
- database drivers.
- - Modified the database errors to show the filename and line number
- of the problematic query.
- - Removed the following deprecated functions: orwhere, orlike,
- groupby, orhaving, orderby, getwhere.
- - Removed deprecated _drop_database() and _create_database()
- functions from the db utility drivers.
- - Improved dbforge create_table() function for the Postgres driver.
-
-- Helpers
-
- - Added convert_accented_characters() function to :doc:`text
- helper <./helpers/text_helper>`.
- - Added accept-charset to the list of inserted attributes of
- form_open() in the :doc:`Form Helper <helpers/form_helper>`.
- - Deprecated the dohash() function in favour of do_hash() for
- naming consistency.
- - Non-backwards compatible change made to get_dir_file_info() in
- the :doc:`File Helper <helpers/file_helper>`. No longer recurses
- by default so as to encourage responsible use (this function can
- cause server performance issues when used without caution).
- - Modified the second parameter of directory_map() in the
- :doc:`Directory Helper <helpers/directory_helper>` to accept an
- integer to specify recursion depth.
- - Modified delete_files() in the :doc:`File
- Helper <helpers/file_helper>` to return FALSE on failure.
- - Added an optional second parameter to byte_format() in the
- :doc:`Number Helper <helpers/number_helper>` to allow for decimal
- precision.
- - Added alpha, and sha1 string types to random_string() in the
- :doc:`String Helper <helpers/string_helper>`.
- - Modified prep_url() so as to not prepend \http:// if the supplied
- string already has a scheme.
- - Modified get_file_info in the file helper, changing filectime()
- to filemtime() for dates.
- - Modified smiley_js() to add optional third parameter to return
- only the javascript with no script tags.
- - The img() function of the :doc:`HTML
- helper <./helpers/html_helper>` will now generate an empty
- string as an alt attribute if one is not provided.
- - If CSRF is enabled in the application config file, form_open()
- will automatically insert it as a hidden field.
- - Added sanitize_filename() into the :doc:`Security
- helper <./helpers/security_helper>`.
- - Added ellipsize() to the :doc:`Text
- Helper <./helpers/text_helper>`
- - Added elements() to the :doc:`Array
- Helper <./helpers/array_helper>`
-
-- Other Changes
-
- - Added an optional second parameter to show_404() to disable
- logging.
- - Updated loader to automatically apply the sub-class prefix as an
- option when loading classes. Class names can be prefixed with the
- standard "CI\_" or the same prefix as the subclass prefix, or no
- prefix at all.
- - Increased randomness with is_really_writable() to avoid file
- collisions when hundreds or thousands of requests occur at once.
- - Switched some DIR_WRITE_MODE constant uses to FILE_WRITE_MODE
- where files and not directories are being operated on.
- - get_mime_by_extension() is now case insensitive.
- - Added "default" to the list :doc:`Reserved
- Names <general/reserved_names>`.
- - Added 'application/x-msdownload' for .exe files and
- 'application/x-gzip-compressed' for .tgz files to
- config/mimes.php.
- - Updated the output library to no longer compress output or send
- content-length headers if the server runs with
- zlib.output_compression enabled.
- - Eliminated a call to is_really_writable() on each request unless
- it is really needed (Output caching)
- - Documented append_output() in the :doc:`Output
- Class <libraries/output>`.
- - Documented a second argument in the decode() function for the
- :doc:`Encrypt Class <libraries/encrypt>`.
- - Documented db->close().
- - Updated the router to support a default route with any number of
- segments.
- - Moved _remove_invisible_characters() function from the
- :doc:`Security Library <libraries/security>` to :doc:`common
- functions. <general/common_functions>`
- - Added audio/mpeg3 as a valid mime type for MP3.
-
-Bug fixes for 2.0.0
--------------------
-
-- Fixed a bug where you could not change the User-Agent when sending
- email.
-- Fixed a bug where the Output class would send incorrect cached output
- for controllers implementing their own _output() method.
-- Fixed a bug where a failed query would not have a saved query
- execution time causing errors in the Profiler
-- Fixed a bug that was writing log entries when multiple identical
- helpers and plugins were loaded.
-- Fixed assorted user guide typos or examples (#10693, #8951, #7825,
- #8660, #7883, #6771, #10656).
-- Fixed a language key in the profiler: "profiler_no_memory_usage"
- to "profiler_no_memory".
-- Fixed an error in the Zip library that didn't allow downloading on
- PHP 4 servers.
-- Fixed a bug in the Form Validation library where fields passed as
- rule parameters were not being translated (#9132)
-- Modified inflector helper to properly pluralize words that end in
- 'ch' or 'sh'
-- Fixed a bug in xss_clean() that was not allowing hyphens in query
- strings of submitted URLs.
-- Fixed bugs in get_dir_file_info() and get_file_info() in the
- File Helper with recursion, and file paths on Windows.
-- Fixed a bug where Active Record override parameter would not let you
- disable Active Record if it was enabled in your database config file.
-- Fixed a bug in reduce_double_slashes() in the String Helper to
- properly remove duplicate leading slashes (#7585)
-- Fixed a bug in values_parsing() of the XML-RPC library which
- prevented NULL variables typed as 'string' from being handled
- properly.
-- Fixed a bug were form_open_multipart() didn't accept string
- attribute arguments (#10930).
-- Fixed a bug (#10470) where get_mime_by_extension() was case
- sensitive.
-- Fixed a bug where some error messages for the SQLite and Oracle
- drivers would not display.
-- Fixed a bug where files created with the Zip Library would result in
- file creation dates of 1980.
-- Fixed a bug in the Session library that would result in PHP error
- when attempting to store values with objects.
-- Fixed a bug where extending the Controller class would result in a
- fatal PHP error.
-- Fixed a PHP Strict Standards Error in the index.php file.
-- Fixed a bug where getimagesize() was being needlessly checked on
- non-image files in is_allowed_type().
-- Fixed a bug in the Encryption library where an empty key was not
- triggering an error.
-- Fixed a bug in the Email library where CC and BCC recipients were not
- reset when using the clear() method (#109).
-- Fixed a bug in the URL Helper where prep_url() could cause a PHP
- error on PHP versions < 5.1.2.
-- Added a log message in core/output if the cache directory config
- value was not found.
-- Fixed a bug where multiple libraries could not be loaded by passing
- an array to load->library()
-- Fixed a bug in the html helper where too much white space was
- rendered between the src and alt tags in the img() function.
-- Fixed a bug in the profilers _compile_queries() function.
-- Fixed a bug in the date helper where the DATE_ISO8601 variable was
- returning an incorrectly formatted date string.
-
-Version 1.7.2
-=============
-
-Release Date: September 11, 2009
-Hg Tag: v1.7.2
-
-- Libraries
-
- - Added a new :doc:`Cart Class <libraries/cart>`.
- - Added the ability to pass $config['file_name'] for the :doc:`File
- Uploading Class <libraries/file_uploading>` and rename the
- uploaded file.
- - Changed order of listed user-agents so Safari would more
- accurately report itself. (#6844)
-
-- Database
-
- - Switched from using gettype() in escape() to is\_* methods, since
- future PHP versions might change its output.
- - Updated all database drivers to handle arrays in escape_str()
- - Added escape_like_str() method for escaping strings to be used
- in LIKE conditions
- - Updated Active Record to utilize the new LIKE escaping mechanism.
- - Added reconnect() method to DB drivers to try to keep alive /
- reestablish a connection after a long idle.
- - Modified MSSQL driver to use mssql_get_last_message() for error
- messages.
-
-- Helpers
-
- - Added form_multiselect() to the :doc:`Form
- helper <helpers/form_helper>`.
- - Modified form_hidden() in the :doc:`Form
- helper <helpers/form_helper>` to accept multi-dimensional
- arrays.
- - Modified form_prep() in the :doc:`Form
- helper <helpers/form_helper>` to keep track of prepped
- fields to avoid multiple prep/mutation from subsequent calls which
- can occur when using Form Validation and form helper functions to
- output form fields.
- - Modified directory_map() in the :doc:`Directory
- helper <helpers/directory_helper>` to allow the inclusion of
- hidden files, and to return FALSE on failure to read directory.
- - Modified the :doc:`Smiley helper <helpers/smiley_helper>` to work
- with multiple fields and insert the smiley at the last known
- cursor position.
-
-- General
-
- - Compatible with PHP 5.3.0.
- - Modified :doc:`show_error() <general/errors>` to allow sending
- of HTTP server response codes.
- - Modified :doc:`show_404() <general/errors>` to send 404 status
- code, removing non-CGI compatible header() statement from
- error_404.php template.
- - Added set_status_header() to the :doc:`Common
- functions <general/common_functions>` to allow use when the
- Output class is unavailable.
- - Added is_php() to :doc:`Common
- functions <general/common_functions>` to facilitate PHP
- version comparisons.
- - Added 2 CodeIgniter "cheatsheets" (thanks to DesignFellow.com for
- this contribution).
-
-Bug fixes for 1.7.2
--------------------
-
-- Fixed assorted user guide typos or examples (#6743, #7214, #7516,
- #7287, #7852, #8224, #8324, #8349).
-- Fixed a bug in the Form Validation library where multiple callbacks
- weren't working (#6110)
-- doctype helper default value was missing a "1".
-- Fixed a bug in the language class when outputting an error for an
- unfound file.
-- Fixed a bug in the Calendar library where the shortname was output
- for "May".
-- Fixed a bug with ORIG_PATH_INFO that was allowing URIs of just a
- slash through.
-- Fixed a fatal error in the Oracle and ODBC drivers (#6752)
-- Fixed a bug where xml_from_result() was checking for a nonexistent
- method.
-- Fixed a bug where Database Forge's add_column and modify_column
- were not looping through when sent multiple fields.
-- Fixed a bug where the File Helper was using '/' instead of the
- DIRECTORY_SEPARATOR constant.
-- Fixed a bug to prevent PHP errors when attempting to use sendmail on
- servers that have manually disabled the PHP popen() function.
-- Fixed a bug that would cause PHP errors in XML-RPC data if the PHP
- data type did not match the specified XML-RPC type.
-- Fixed a bug in the XML-RPC class with parsing dateTime.iso8601 data
- types.
-- Fixed a case sensitive string replacement in xss_clean()
-- Fixed a bug in form_textarea() where form data was not prepped
- correctly.
-- Fixed a bug in form_prep() causing it to not preserve entities in
- the user's original input when called back into a form element
-- Fixed a bug in _protect_identifiers() where the swap prefix
- ($swap_pre) was not being observed.
-- Fixed a bug where the 400 status header sent with the 'disallowed URI
- characters' was not compatible with CGI environments.
-- Fixed a bug in the typography class where heading tags could have
- paragraph tags inserted when using auto_typography().
-
-Version 1.7.1
-=============
-
-Release Date: February 10, 2009
-Hg Tag: 1.7.1
-
-- Libraries
-
- - Fixed an arbitrary script execution security flaw (#6068) in the
- Form Validation library (thanks to hkk)
- - Changed default current page indicator in the Pagination library
- to use <strong> instead of <b>
- - A "HTTP/1.1 400 Bad Request" header is now sent when disallowed
- characters are encountered.
- - Added <big>, <small>, <q>, and <tt> to the Typography parser's
- inline elements.
- - Added more accurate error reporting for the Email library when
- using sendmail.
- - Removed a strict type check from the rotate() function of the
- :doc:`Image Manipulation Class <libraries/image_lib>`.
- - Added enhanced error checking in file saving in the Image library
- when using the GD lib.
- - Added an additional newline between multipart email headers and
- the MIME message text for better compatibility with a variety of
- MUAs.
- - Made modest improvements to efficiency and accuracy of
- explode_name() in the Image lib.
-
-- Database
-
- - Added where_in to the list of expected arguments received by
- delete().
-
-- Helpers
-
- - Added the ability to have optgroups in form_dropdown() within the
- :doc:`form helper <helpers/form_helper>`.
- - Added a doctype() function to the :doc:`HTML
- helper <helpers/html_helper>`.
- - Added ability to force lowercase for url_title() in the :doc:`URL
- helper <helpers/url_helper>`.
- - Changed the default "type" of form_button() to "button" from
- "submit" in the :doc:`form helper <helpers/form_helper>`.
- - Changed redirect() in the URL helper to allow redirections to URLs
- outside of the CI site.
- - Updated get_cookie() to try to fetch the cookie using the global
- cookie prefix if the requested cookie name doesn't exist.
-
-- Other Changes
-
- - Improved security in xss_clean() to help prevent attacks
- targeting Internet Explorer.
- - Added 'application/msexcel' to config/mimes.php for .xls files.
- - Added 'proxy_ips' config item to whitelist reverse proxy servers
- from which to trust the HTTP_X_FORWARDED_FOR header to to
- determine the visitor's IP address.
- - Improved accuracy of Upload::is_allowed_filetype() for images
- (#6715)
-
-Bug fixes for 1.7.1
--------------------
-
-- Database
-
- - Fixed a bug when doing 'random' on order_by() (#5706).
- - Fixed a bug where adding a primary key through Forge could fail
- (#5731).
- - Fixed a bug when using DB cache on multiple databases (#5737).
- - Fixed a bug where TRUNCATE was not considered a "write" query
- (#6619).
- - Fixed a bug where csv_from_result() was checking for a
- nonexistent method.
- - Fixed a bug _protect_identifiers() where it was improperly
- removing all pipe symbols from items
-
-- Fixed assorted user guide typos or examples (#5998, #6093, #6259,
- #6339, #6432, #6521).
-- Fixed a bug in the MySQLi driver when no port is specified
-- Fixed a bug (#5702), in which the field label was not being fetched
- properly, when "matching" one field to another.
-- Fixed a bug in which identifers were not being escaped properly when
- reserved characters were used.
-- Fixed a bug with the regular expression used to protect submitted
- paragraph tags in auto typography.
-- Fixed a bug where double dashes within tag attributes were being
- converted to em dash entities.
-- Fixed a bug where double spaces within tag attributes were being
- converted to non-breaking space entities.
-- Fixed some accuracy issues with curly quotes in
- Typography::format_characters()
-- Changed a few docblock comments to reflect actual return values.
-- Fixed a bug with high ascii characters in subject and from email
- headers.
-- Fixed a bug in xss_clean() where whitespace following a validated
- character entity would not be preserved.
-- Fixed a bug where HTML comments and <pre> tags were being parsed in
- Typography::auto_typography().
-- Fixed a bug with non-breaking space cleanup in
- Typography::auto_typography().
-- Fixed a bug in database escaping where a compound statement (ie:
- SUM()) wasn't handled correctly with database prefixes.
-- Fixed a bug when an opening quote is preceded by a paragraph tag and
- immediately followed by another tag.
-- Fixed a bug in the Text Helper affecting some locales where
- word_censor() would not work on words beginning or ending with an
- accented character.
-- Fixed a bug in the Text Helper character limiter where the provided
- limit intersects the last word of the string.
-- Fixed a bug (#6342) with plural() in the Inflection helper with words
- ending in "y".
-- Fixed bug (#6517) where Routed URI segments returned by
- URI::rsegment() method were incorrect for the default controller.
-- Fixed a bug (#6706) in the Security Helper where xss_clean() was
- using a deprecated second argument.
-- Fixed a bug in the URL helper url_title() function where trailing
- periods were allowed at the end of a URL.
-- Fixed a bug (#6669) in the Email class when CRLF's are used for the
- newline character with headers when used with the "mail" protocol.
-- Fixed a bug (#6500) where URI::A_filter_uri() was exit()ing an
- error instead of using show_error().
-- Fixed a bug (#6592) in the File Helper where get_dir_file_info()
- where recursion was not occurring properly.
-- Tweaked Typography::auto_typography() for some edge-cases.
-
-Version 1.7
-===========
-
-Release Date: October 23, 2008
-Hg Tag: 1.7.0
-
-- Libraries
-
- - Added a new :doc:`Form Validation
- Class <libraries/form_validation>`. It simplifies setting
- rules and field names, supports arrays as field names, allows
- groups of validation rules to be saved in a config file, and adds
- some helper functions for use in view files. **Please note that
- the old Validation class is now deprecated**. We will leave it in
- the library folder for some time so that existing applications
- that use it will not break, but you are encouraged to migrate to
- the new version.
- - Updated the :doc:`Sessions class <libraries/sessions>` so that
- any custom data being saved gets stored to a database rather than
- the session cookie (assuming you are using a database to store
- session data), permitting much more data to be saved.
- - Added the ability to store libraries in subdirectories within
- either the main "libraries" or the local application "libraries"
- folder. Please see the :doc:`Loader class <libraries/loader>` for
- more info.
- - Added the ability to assign library objects to your own variable
- names when you use $this->load->library(). Please see the :doc:`Loader
- class <libraries/loader>` for more info.
- - Added controller class/method info to :doc:`Profiler
- class <general/profiling>` and support for multiple database
- connections.
- - Improved the "auto typography" feature and moved it out of the
- helper into its own :doc:`Typography
- Class <libraries/typography>`.
- - Improved performance and accuracy of xss_clean(), including
- reduction of false positives on image/file tests.
- - Improved :doc:`Parser class <./libraries/parser>` to allow
- multiple calls to the parse() function. The output of each is
- appended in the output.
- - Added max_filename option to set a file name length limit in the
- :doc:`File Upload Class <libraries/file_uploading>`.
- - Added set_status_header() function to :doc:`Output
- class <libraries/output>`.
- - Modified :doc:`Pagination <libraries/pagination>` class to only
- output the "First" link when the link for page one would not be
- shown.
- - Added support for mb_strlen in the :doc:`Form
- Validation <libraries/form_validation>` class so that
- multi-byte languages will calculate string lengths properly.
-
-- Database
-
- - Improved Active Record class to allow full path column and table
- names: hostname.database.table.column. Also improved the alias
- handling.
- - Improved how table and column names are escaped and prefixed. It
- now honors full path names when adding prefixes and escaping.
- - Added Active Record caching feature to "update" and "delete"
- functions.
- - Added removal of non-printing control characters in escape_str()
- of DB drivers that do not have native PHP escaping mechanisms
- (mssql, oci8, odbc), to avoid potential SQL errors, and possible
- sources of SQL injection.
- - Added port support to MySQL, MySQLi, and MS SQL database drivers.
- - Added driver name variable in each DB driver, based on bug report
- #4436.
-
-- Helpers
-
- - Added several new "setting" functions to the :doc:`Form
- helper <helpers/form_helper>` that allow POST data to be
- retrieved and set into forms. These are intended to be used on
- their own, or with the new :doc:`Form Validation
- Class <libraries/form_validation>`.
- - Added current_url() and uri_segments() to :doc:`URL
- helper <helpers/url_helper>`.
- - Altered auto_link() in the :doc:`URL
- helper <helpers/url_helper>` so that email addresses with
- "+" included will be linked.
- - Added meta() function to :doc:`HTML
- helper <helpers/html_helper>`.
- - Improved accuracy of calculations in :doc:`Number
- helper <helpers/number_helper>`.
- - Removed added newlines ("\\n") from most form and html helper
- functions.
- - Tightened up validation in the :doc:`Date
- helper <helpers/date_helper>` function human_to_unix(),
- and eliminated the POSIX regex.
- - Updated :doc:`Date helper <helpers/date_helper>` to match the
- world's current time zones and offsets.
- - Modified url_title() in the :doc:`URL
- helper <helpers/url_helper>` to remove characters and digits
- that are part of character entities, to allow dashes, underscores,
- and periods regardless of the $separator, and to allow uppercase
- characters.
- - Added support for arbitrary attributes in anchor_popup() of the
- :doc:`URL helper <helpers/url_helper>`.
-
-- Other Changes
-
- - Added :doc:`PHP Style Guide <./general/styleguide>` to docs.
- - Added sanitization in xss_clean() for a deprecated HTML tag that
- could be abused in user input in Internet Explorer.
- - Added a few openxml document mime types, and an additional mobile
- agent to mimes.php and user_agents.php respectively.
- - Added a file lock check during caching, before trying to write to
- the file.
- - Modified Cookie key cleaning to unset a few troublesome key names
- that can be present in certain environments, preventing CI from
- halting execution.
- - Changed the output of the profiler to use style attribute rather
- than clear, and added the id "codeigniter_profiler" to the
- container div.
-
-Bug fixes for 1.7.0
--------------------
-
-- Fixed bug in xss_clean() that could remove some desirable tag
- attributes.
-- Fixed assorted user guide typos or examples (#4807, #4812, #4840,
- #4862, #4864, #4899, #4930, #5006, #5071, #5158, #5229, #5254,
- #5351).
-- Fixed an edit from 1.6.3 that made the $robots array in
- user_agents.php go poof.
-- Fixed a bug in the :doc:`Email library <libraries/email>` with
- quoted-printable encoding improperly encoding space and tab
- characters.
-- Modified XSS sanitization to no longer add semicolons after &[single
- letter], such as in M&M's, B&B, etc.
-- Modified XSS sanitization to no longer strip XHTML image tags of
- closing slashes.
-- Fixed a bug in the Session class when database sessions are used
- where upon session update all userdata would be errantly written to
- the session cookie.
-- Fixed a bug (#4536) in backups with the MySQL driver where some
- legacy code was causing certain characters to be double escaped.
-- Fixed a routing bug (#4661) that occurred when the default route
- pointed to a subfolder.
-- Fixed the spelling of "Dhaka" in the timezone_menu() function of the
- :doc:`Date helper. <helpers/date_helper>`
-- Fixed the spelling of "raspberry" in config/smileys.php.
-- Fixed incorrect parenthesis in form_open() function (#5135).
-- Fixed a bug that was ignoring case when comparing controller methods
- (#4560).
-- Fixed a bug (#4615) that was not setting SMTP authorization settings
- when using the initialize function.
-- Fixed a bug in highlight_code() in the :doc:`Text
- helper <helpers/text_helper>` that would leave a stray </span>
- in certain cases.
-- Fixed Oracle bug (#3306) that was preventing multiple queries in one
- action.
-- Fixed ODBC bug that was ignoring connection params due to its use of
- a constructor.
-- Fixed a DB driver bug with num_rows() that would cause an error with
- the Oracle driver.
-- Fixed MS SQL bug (#4915). Added brackets around database name in MS
- SQL driver when selecting the database, in the event that reserved
- characters are used in the name.
-- Fixed a DB caching bug (4718) in which the path was incorrect when no
- URI segments were present.
-- Fixed Image_lib class bug #4562. A path was not defined for NetPBM.
-- Fixed Image_lib class bug #4532. When cropping an image with
- identical height/width settings on output, a copy is made.
-- Fixed DB_driver bug (4900), in which a database error was not being
- logged correctly.
-- Fixed DB backup bug in which field names were not being escaped.
-- Fixed a DB Active Record caching bug in which multiple calls to
- cached data were not being honored.
-- Fixed a bug in the Session class that was disallowing slashes in the
- serialized array.
-- Fixed a Form Validation bug in which the "isset" error message was
- being trigged by the "required" rule.
-- Fixed a spelling error in a Loader error message.
-- Fixed a bug (5050) with IP validation with empty segments.
-- Fixed a bug in which the parser was being greedy if multiple
- identical sets of tags were encountered.
-
-Version 1.6.3
-=============
-
-Release Date: June 26, 2008
-Hg Tag: v1.6.3
-
-Version 1.6.3 is a security and maintenance release and is recommended
-for all users.
-
-- Database
-
- - Modified MySQL/MySQLi Forge class to give explicit names to keys
- - Added ability to set multiple column non-primary keys to the
- :doc:`Forge class <database/forge>`
- - Added ability to set additional database config values in :doc:`DSN
- connections <database/connecting>` via the query string.
-
-- Libraries
-
- - Set the mime type check in the :doc:`Upload
- class <libraries/file_uploading>` to reference the global
- mimes variable.
- - Added support for query strings to the :doc:`Pagination
- class <libraries/pagination>`, automatically detected or
- explicitly declared.
- - Added get_post() to the :doc:`Input class <libraries/input>`.
- - Documented get() in the :doc:`Input class <libraries/input>`.
- - Added the ability to automatically output language items as form
- labels in the :doc:`Language class <libraries/language>`.
-
-- Helpers
-
- - Added a :doc:`Language helper <helpers/language_helper>`.
- - Added a :doc:`Number helper <helpers/number_helper>`.
- - :doc:`Form helper <helpers/form_helper>` refactored to allow
- form_open() and form_fieldset() to accept arrays or strings as
- arguments.
-
-- Other changes
-
- - Improved security in xss_clean().
- - Removed an unused Router reference in _display_cache().
- - Added ability to :doc:`use xss_clean() to test
- images <libraries/input>` for XSS, useful for upload
- security.
- - Considerably expanded list of mobile user-agents in
- config/user_agents.php.
- - Charset information in the userguide has been moved above title
- for internationalization purposes (#4614).
- - Added "Using Associative Arrays In a Request Parameter" example to
- the :doc:`XMLRPC userguide page <libraries/xmlrpc>`.
- - Removed maxlength and size as automatically added attributes of
- form_input() in the :doc:`form helper <helpers/form_helper>`.
- - Documented the language file use of byte_format() in the :doc:`number
- helper <helpers/number_helper>`.
-
-Bug fixes for 1.6.3
--------------------
-
-- Added a language key for valid_emails in validation_lang.php.
-- Amended fixes for bug (#3419) with parsing DSN database connections.
-- Moved the _has_operator() function (#4535) into DB_driver from
- DB_active_rec.
-- Fixed a syntax error in upload_lang.php.
-- Fixed a bug (#4542) with a regular expression in the Image library.
-- Fixed a bug (#4561) where orhaving() wasn't properly passing values.
-- Removed some unused variables from the code (#4563).
-- Fixed a bug where having() was not adding an = into the statement
- (#4568).
-- Fixed assorted user guide typos or examples (#4574, #4706).
-- Added quoted-printable headers to Email class when the multi-part
- override is used.
-- Fixed a double opening <p> tag in the index pages of each system
- directory.
-
-Version 1.6.2
-=============
-
-Release Date: May 13, 2008
-Hg Tag: 1.6.2
-
-- Active Record
-
- - Added the ability to prevent escaping in having() clauses.
- - Added rename_table() into :doc:`DBForge <./database/forge>`.
- - Fixed a bug that wasn't allowing escaping to be turned off if the
- value of a query was NULL.
- - DB Forge is now assigned to any models that exist after loading
- (#3457).
-
-- Database
-
- - Added :doc:`Strict Mode <./database/transactions>` to database
- transactions.
- - Escape behaviour in where() clauses has changed; values in those
- with the "FALSE" argument are no longer escaped (ie: quoted).
-
-- Config
-
- - Added 'application/vnd.ms-powerpoint' to list of mime types.
- - Added 'audio/mpg' to list of mime types.
- - Added new user-modifiable file constants.php containing file mode
- and fopen constants.
- - Added the ability to set CRLF settings via config in the
- :doc:`Email <libraries/email>` class.
-
-- Libraries
-
- - Added increased security for filename handling in the Upload
- library.
- - Added increased security for sessions for client-side data
- tampering.
- - The MySQLi forge class is now in sync with MySQL forge.
- - Added the ability to set CRLF settings via config in the
- :doc:`Email <libraries/email>` class.
- - :doc:`Unit Testing <libraries/unit_testing>` results are now
- colour coded, and a change was made to the default template of
- results.
- - Added a valid_emails rule to the Validation class.
- - The :doc:`Zip class <libraries/zip>` now exits within download().
- - The :doc:`Zip class <libraries/zip>` has undergone a substantial
- re-write for speed and clarity (thanks stanleyxu for the hard work
- and code contribution in bug report #3425!)
-
-- Helpers
-
- - Added a Compatibility
- Helper for using some common
- PHP 5 functions safely in applications that might run on PHP 4
- servers (thanks Seppo for the hard work and code contribution!)
- - Added form_button() in the :doc:`Form
- helper <helpers/form_helper>`.
- - Changed the radio() and checkbox() functions to default to not
- checked by default.
- - Added the ability to include an optional HTTP Response Code in the
- redirect() function of the :doc:`URL
- Helper <helpers/url_helper>`.
- - Modified img() in the :doc:`HTML Helper <helpers/html_helper>` to
- remove an unneeded space (#4208).
- - Modified anchor() in the :doc:`URL helper <helpers/url_helper>`
- to no longer add a default title= attribute (#4209).
- - The :doc:`Download helper <helpers/download_helper>` now exits
- within force_download().
- - Added get_dir_file_info(), get_file_info(), and
- get_mime_by_extension() to the :doc:`File
- Helper <helpers/file_helper>`.
- - Added symbolic_permissions() and octal_permissions() to the
- :doc:`File helper <helpers/file_helper>`.
-
-- Plugins
-
- - Modified captcha generation to first look for the function
- imagecreatetruecolor, and fallback to imagecreate if it isn't
- available (#4226).
-
-- Other Changes
-
- - Added ability for :doc:`xss_clean() <libraries/input>` to accept
- arrays.
- - Removed closing PHP tags from all PHP files to avoid accidental
- output and potential 'cannot modify headers' errors.
- - Removed "scripts" from the auto-load search path. Scripts were
- deprecated in Version 1.4.1 (September 21, 2006). If you still
- need to use them for legacy reasons, they must now be manually
- loaded in each Controller.
- - Added a :doc:`Reserved Names <general/reserved_names>` page to
- the userguide, and migrated reserved controller names into it.
- - Added a :doc:`Common Functions <general/common_functions>` page
- to the userguide for globally available functions.
- - Improved security and performance of xss_clean().
-
-Bugfixes for 1.6.2
-------------------
-
-- Fixed a bug where SET queries were not being handled as "write"
- queries.
-- Fixed a bug (#3191) with ORIG_PATH_INFO URI parsing.
-- Fixed a bug in DB Forge, when inserting an id field (#3456).
-- Fixed a bug in the table library that could cause identically
- constructed rows to be dropped (#3459).
-- Fixed DB Driver and MySQLi result driver checking for resources
- instead of objects (#3461).
-- Fixed an AR_caching error where it wasn't tracking table aliases
- (#3463).
-- Fixed a bug in AR compiling, where select statements with arguments
- got incorrectly escaped (#3478).
-- Fixed an incorrect documentation of $this->load->language (#3520).
-- Fixed bugs (#3523, #4350) in get_filenames() with recursion and
- problems with Windows when $include_path is used.
-- Fixed a bug (#4153) in the XML-RPC class preventing dateTime.iso8601
- from being used.
-- Fixed an AR bug with or_where_not_in() (#4171).
-- Fixed a bug with :doc:`xss_clean() <libraries/input>` that would
- add semicolons to GET URI variable strings.
-- Fixed a bug (#4206) in the Directory Helper where the directory
- resource was not being closed, and minor improvements.
-- Fixed a bug in the FTP library where delete_dir() was not working
- recursively (#4215).
-- Fixed a Validation bug when set_rules() is used with a non-array
- field name and rule (#4220).
-- Fixed a bug (#4223) where DB caching would not work for returned DB
- objects or multiple DB connections.
-- Fixed a bug in the Upload library that might output the same error
- twice (#4390).
-- Fixed an AR bug when joining with a table alias and table prefix
- (#4400).
-- Fixed a bug in the DB class testing the $params argument.
-- Fixed a bug in the Table library where the integer 0 in cell data
- would be displayed as a blank cell.
-- Fixed a bug in link_tag() of the :doc:`URL
- helper <helpers/url_helper>` where a key was passed instead of
- a value.
-- Fixed a bug in DB_result::row() that prevented it from returning
- individual fields with MySQL NULL values.
-- Fixed a bug where SMTP emails were not having dot transformation
- performed on lines that begin with a dot.
-- Fixed a bug in display_error() in the DB driver that was
- instantiating new Language and Exception objects, and not using the
- error heading.
-- Fixed a bug (#4413) where a URI containing slashes only e.g.
- '\http://example.com/index.php?//' would result in PHP errors
-- Fixed an array to string conversion error in the Validation library
- (#4425)
-- Fixed bug (#4451, #4299, #4339) where failed transactions will not
- rollback when debug mode is enabled.
-- Fixed a bug (#4506) with overlay_watermark() in the Image library
- preventing support for PNG-24s with alpha transparency
-- Fixed assorted user guide typos (#3453, #4364, #4379, #4399, #4408,
- #4412, #4448, #4488).
-
-Version 1.6.1
-=============
-
-Release Date: February 12, 2008
-Hg Tag: 1.6.1
-
-- Active Record
-
- - Added :ref:`Active Record
- Caching <ar-caching>`.
- - Made Active Record fully database-prefix aware.
-
-- Database drivers
-
- - Added support for setting client character set and collation for
- MySQLi.
-
-- Core Changes
-
- - Modified xss_clean() to be more intelligent with its handling of
- URL encoded strings.
- - Added $_SERVER, $_FILES, $_ENV, and $_SESSION to sanitization
- of globals.
- - Added a :doc:`Path Helper <./helpers/path_helper>`.
- - Simplified _reindex_segments() in the URI class.
- - Escaped the '-' in the default 'permitted_uri_chars' config
- item, to prevent errors if developers just try to add additional
- characters to the end of the default expression.
- - Modified method calling to controllers to show a 404 when a
- private or protected method is accessed via a URL.
- - Modified framework initiated 404s to log the controller and method
- for invalid requests.
-
-- Helpers
-
- - Modified get_filenames() in the File Helper to return FALSE if
- the $source_dir is not readable.
-
-Bugfixes for 1.6.1
-------------------
-
-- Deprecated is_numeric as a validation rule. Use of numeric and
- integer are preferred.
-- Fixed bug (#3379) in DBForge with SQLite for table creation.
-- Made Active Record fully database prefix aware (#3384).
-- Fixed a bug where DBForge was outputting invalid SQL in Postgres by
- adding brackets around the tables in FROM.
-- Changed the behaviour of Active Record's update() to make the WHERE
- clause optional (#3395).
-- Fixed a bug (#3396) where certain POST variables would cause a PHP
- warning.
-- Fixed a bug in query binding (#3402).
-- Changed order of SQL keywords in the Profiler $highlight array so OR
- would not be highlighted before ORDER BY.
-- Fixed a bug (#3404) where the MySQLi driver was testing if
- $this->conn_id was a resource instead of an object.
-- Fixed a bug (#3419) connecting to a database via a DSN string.
-- Fixed a bug (#3445) where the routed segment array was not re-indexed
- to begin with 1 when the default controller is used.
-- Fixed assorted user guide typos.
-
-Version 1.6.0
-=============
-
-Release Date: January 30, 2008
-
-- DBForge
-
- - Added :doc:`DBForge <./database/forge>` to the database tools.
- - Moved create_database() and drop_database() into
- :doc:`DBForge <./database/forge>`.
- - Added add_field(), add_key(), create_table(), drop_table(),
- add_column(), drop_column(), modify_column() into
- :doc:`DBForge <./database/forge>`.
-
-- Active Record
-
- - Added protect_identifiers() in :doc:`Active
- Record <./database/query_builder>`.
- - All AR queries are backticked if appropriate to the database.
- - Added where_in(), or_where_in(), where_not_in(),
- or_where_not_in(), not_like() and or_not_like() to :doc:`Active
- Record <./database/query_builder>`.
- - Added support for limit() into update() and delete() statements in
- :doc:`Active Record <./database/query_builder>`.
- - Added empty_table() and truncate_table() to :doc:`Active
- Record <./database/query_builder>`.
- - Added the ability to pass an array of tables to the delete()
- statement in :doc:`Active Record <./database/query_builder>`.
- - Added count_all_results() function to :doc:`Active
- Record <./database/query_builder>`.
- - Added select_max(), select_min(), select_avg() and
- select_sum() to :doc:`Active Record <./database/query_builder>`.
- - Added the ability to use aliases with joins in :doc:`Active
- Record <./database/query_builder>`.
- - Added a third parameter to Active Record's like() clause to
- control where the wildcard goes.
- - Added a third parameter to set() in :doc:`Active
- Record <./database/query_builder>` that withholds escaping
- data.
- - Changed the behaviour of variables submitted to the where() clause
- with no values to auto set "IS NULL"
-
-- Other Database Related
-
- - MySQL driver now requires MySQL 4.1+
- - Added $this->DB->save_queries variable to DB driver, enabling
- queries to get saved or not. Previously they were always saved.
- - Added $this->db->dbprefix() to manually add database prefixes.
- - Added 'random' as an order_by() option , and removed "rand()" as
- a listed option as it was MySQL only.
- - Added a check for NULL fields in the MySQL database backup
- utility.
- - Added "constrain_by_prefix" parameter to db->list_table()
- function. If set to TRUE it will limit the result to only table
- names with the current prefix.
- - Deprecated from Active Record; getwhere() for get_where();
- groupby() for group_by(); havingor() for having_or(); orderby()
- for order_by; orwhere() for or_where(); and orlike() for
- or_like().
- - Modified csv_from_result() to output CSV data more in the spirit
- of basic rules of RFC 4180.
- - Added 'char_set' and 'dbcollat' database configuration settings,
- to explicitly set the client communication properly.
- - Removed 'active_r' configuration setting and replaced with a
- global $active_record setting, which is more in harmony with the
- global nature of the behavior (#1834).
-
-- Core changes
-
- - Added ability to load multiple views, whose content will be
- appended to the output in the order loaded.
- - Added the ability to :doc:`auto-load <./general/autoloader>`
- :doc:`Models <./general/models>`.
- - Reorganized the URI and Routes classes for better clarity.
- - Added Compat.php to allow function overrides for older versions of
- PHP or PHP environments missing certain extensions / libraries
- - Added memory usage, GET, URI string data, and individual query
- execution time to Profiler output.
- - Deprecated Scaffolding.
- - Added is_really_writable() to Common.php to provide a
- cross-platform reliable method of testing file/folder writability.
-
-- Libraries
-
- - Changed the load protocol of Models to allow for extension.
- - Strengthened the Encryption library to help protect against man in
- the middle attacks when MCRYPT_MODE_CBC mode is used.
- - Added Flashdata variables, session_id regeneration and
- configurable session update times to the :doc:`Session
- class. <./libraries/sessions>`
- - Removed 'last_visit' from the Session class.
- - Added a language entry for valid_ip validation error.
- - Modified prep_for_form() in the Validation class to accept
- arrays, adding support for POST array validation (via callbacks
- only)
- - Added an "integer" rule into the Validation library.
- - Added valid_base64() to the Validation library.
- - Documented clear() in the :doc:`Image
- Processing <./libraries/image_lib>` library.
- - Changed the behaviour of custom callbacks so that they no longer
- trigger the "required" rule.
- - Modified Upload class $_FILES error messages to be more precise.
- - Moved the safe mode and auth checks for the Email library into the
- constructor.
- - Modified variable names in _ci_load() method of Loader class to
- avoid conflicts with view variables.
- - Added a few additional mime type variations for CSV.
- - Enabled the 'system' methods for the XML-RPC Server library,
- except for 'system.multicall' which is still disabled.
-
-- Helpers & Plugins
-
- - Added link_tag() to the :doc:`HTML
- helper. <./helpers/html_helper>`
- - Added img() to the :doc:`HTML helper. <./helpers/html_helper>`
- - Added ability to :doc:`"extend" Helpers <./general/helpers>`.
- - Added an :doc:`email helper <./helpers/email_helper>` into core
- helpers.
- - Added strip_quotes() function to :doc:`string
- helper <./helpers/string_helper>`.
- - Added reduce_multiples() function to :doc:`string
- helper <./helpers/string_helper>`.
- - Added quotes_to_entities() function to :doc:`string
- helper <./helpers/string_helper>`.
- - Added form_fieldset(), form_fieldset_close(), form_label(),
- and form_reset() function to :doc:`form
- helper <./helpers/form_helper>`.
- - Added support for external urls in form_open().
- - Removed support for db_backup in MySQLi due to incompatible
- functions.
- - Javascript Calendar plugin now uses the months and days from the
- calendar language file, instead of hard-coded values,
- internationalizing it.
-
-- Documentation Changes
-
- - Added Writing Documentation section
- for the community to use in writing their own documentation.
- - Added titles to all user manual pages.
- - Added attributes into <html> of userguide for valid html.
- - Added :doc:`Zip Encoding Class <libraries/zip>`
- to the table of contents of the userguide.
- - Moved part of the userguide menu javascript to an external file.
- - Documented distinct() in :doc:`Active
- Record <./database/query_builder>`.
- - Documented the timezones() function in the :doc:`Date
- Helper <./helpers/date_helper>`.
- - Documented unset_userdata in the :doc:`Session
- class <./libraries/sessions>`.
- - Documented 2 config options to the :doc:`Database
- configuration <./database/configuration>` page.
-
-Bug fixes for Version 1.6.0
----------------------------
-
-- Fixed a bug (#1813) preventing using $CI->db in the same application
- with returned database objects.
-- Fixed a bug (#1842) where the $this->uri->rsegments array would not
- include the 'index' method if routed to the controller without an
- implicit method.
-- Fixed a bug (#1872) where word_limiter() was not retaining
- whitespace.
-- Fixed a bug (#1890) in csv_from_result() where content that
- included the delimiter would break the file.
-- Fixed a bug (#2542)in the clean_email() method of the Email class to
- allow for non-numeric / non-sequential array keys.
-- Fixed a bug (#2545) in _html_entity_decode_callback() when
- 'global_xss_filtering' is enabled.
-- Fixed a bug (#2668) in the :doc:`parser class <./libraries/parser>`
- where numeric data was ignored.
-- Fixed a bug (#2679) where the "previous" pagination link would get
- drawn on the first page.
-- Fixed a bug (#2702) in _object_to_array that broke some types of
- inserts and updates.
-- Fixed a bug (#2732) in the SQLite driver for PHP 4.
-- Fixed a bug (#2754) in Pagination to scan for non-positive
- num_links.
-- Fixed a bug (#2762) in the :doc:`Session
- library <./libraries/sessions>` where user agent matching would
- fail on user agents ending with a space.
-- Fixed a bug (#2784) $field_names[] vs $Ffield_names[] in postgres
- and sqlite drivers.
-- Fixed a bug (#2810) in the typography helper causing extraneous
- paragraph tags when string contains tags.
-- Fixed a bug (#2849) where arguments passed to a subfolder controller
- method would be incorrectly shifted, dropping the 3rd segment value.
-- Fixed a bug (#2858) which referenced a wrong variable in the Image
- class.
-- Fixed a bug (#2875)when loading plugin files as _plugin. and not
- _pi.
-- Fixed a bug (#2912) in get_filenames() in the :doc:`File
- Helper <helpers/file_helper>` where the array wasn't cleared
- after each call.
-- Fixed a bug (#2974) in highlight_phrase() that caused an error with
- slashes.
-- Fixed a bug (#3003) in the Encryption Library to support modes other
- than MCRYPT_MODE_ECB
-- Fixed a bug (#3015) in the :doc:`User Agent
- library <./libraries/user_agent>` where more than 2 languages
- where not reported with languages().
-- Fixed a bug (#3017) in the :doc:`Email <./libraries/email>` library
- where some timezones were calculated incorrectly.
-- Fixed a bug (#3024) in which master_dim wasn't getting reset by
- clear() in the Image library.
-- Fixed a bug (#3156) in Text Helper highlight_code() causing PHP tags
- to be handled incorrectly.
-- Fixed a bug (#3166) that prevented num_rows from working in Oracle.
-- Fixed a bug (#3175) preventing certain libraries from working
- properly when autoloaded in PHP 4.
-- Fixed a bug (#3267) in the Typography Helper where unordered list was
- listed "un.
-- Fixed a bug (#3268) where the Router could leave '/' as the path.
-- Fixed a bug (#3279) where the Email class was sending the wrong
- Content-Transfer-Encoding for some character sets.
-- Fixed a bug (#3284) where the rsegment array would not be set
- properly if the requested URI contained more segments than the routed
- URI.
-- Removed extraneous load of $CFG in _display_cache() of the Output
- class (#3285).
-- Removed an extraneous call to loading models (#3286).
-- Fixed a bug (#3310) with sanitization of globals in the Input class
- that could unset CI's global variables.
-- Fixed a bug (#3314) which would cause the top level path to be
- deleted in delete_files() of the File helper.
-- Fixed a bug (#3328) where the smiley helper might return an undefined
- variable.
-- Fixed a bug (#3330) in the FTP class where a comparison wasn't
- getting made.
-- Removed an unused parameter from Profiler (#3332).
-- Fixed a bug in database driver where num_rows property wasn't
- getting updated.
-- Fixed a bug in the :doc:`upload
- library <./libraries/file_uploading>` when allowed_files
- wasn't defined.
-- Fixed a bug in word_wrap() of the Text Helper that incorrectly
- referenced an object.
-- Fixed a bug in Validation where valid_ip() wasn't called properly.
-- Fixed a bug in Validation where individual error messages for
- checkboxes wasn't supported.
-- Fixed a bug in captcha calling an invalid PHP function.
-- Fixed a bug in the cookie helper "set_cookie" function. It was not
- honoring the config settings.
-- Fixed a bug that was making validation callbacks required even when
- not set as such.
-- Fixed a bug in the XML-RPC library so if a type is specified, a more
- intelligent decision is made as to the default type.
-- Fixed an example of comma-separated emails in the email library
- documentation.
-- Fixed an example in the Calendar library for Showing Next/Previous
- Month Links.
-- Fixed a typo in the database language file.
-- Fixed a typo in the image language file "suppor" to "support".
-- Fixed an example for XML RPC.
-- Fixed an example of accept_charset() in the :doc:`User Agent
- Library <./libraries/user_agent>`.
-- Fixed a typo in the docblock comments that had CodeIgniter spelled
- CodeIgnitor.
-- Fixed a typo in the :doc:`String Helper <./helpers/string_helper>`
- (uniquid changed to uniqid).
-- Fixed typos in the email Language class
- (email_attachment_unredable, email_filed_smtp_login), and FTP
- Class (ftp_unable_to_remame).
-- Added a stripslashes() into the Upload Library.
-- Fixed a series of grammatical and spelling errors in the language
- files.
-- Fixed assorted user guide typos.
-
-Version 1.5.4
-=============
-
-Release Date: July 12, 2007
-
-- Added :doc:`custom Language files <./libraries/language>` to the
- :doc:`autoload <./general/autoloader>` options.
-- Added stripslashes() to the _clean_input_data() function in the
- :doc:`Input class <./libraries/input>` when magic quotes is on so
- that data will always be un-slashed within the framework.
-- Added array to string into the :doc:`profiler <general/profiling>`.
-- Added some additional mime types in application/config/mimes.php.
-- Added filename_security() method to :doc:`Input
- library <./libraries/input>`.
-- Added some additional arguments to the :doc:`Inflection
- helper <./helpers/inflector_helper>` singular() to compensate
- for words ending in "s". Also added a force parameter to pluralize().
-- Added $config['charset'] to the config file. Default value is
- 'UTF-8', used in some string handling functions.
-- Fixed MSSQL insert_id().
-- Fixed a logic error in the DB trans_status() function. It was
- incorrectly returning TRUE on failure and FALSE on success.
-- Fixed a bug that was allowing multiple load attempts on extended
- classes.
-- Fixed a bug in the bootstrap file that was incorrectly attempting to
- discern the full server path even when it was explicity set by the
- user.
-- Fixed a bug in the escape_str() function in the MySQL driver.
-- Fixed a typo in the :doc:`Calendar library <./libraries/calendar>`
-- Fixed a typo in rpcs.php library
-- Fixed a bug in the :doc:`Zip library <./libraries/zip>`, providing
- PC Zip file compatibility with Mac OS X
-- Fixed a bug in router that was ignoring the scaffolding route for
- optimization
-- Fixed an IP validation bug.
-- Fixed a bug in display of POST keys in the
- :doc:`Profiler <./general/profiling>` output
-- Fixed a bug in display of queries with characters that would be
- interpreted as HTML in the :doc:`Profiler <./general/profiling>`
- output
-- Fixed a bug in display of Email class print debugger with characters
- that would be interpreted as HTML in the debugging output
-- Fixed a bug in the Content-Transfer-Encoding of HTML emails with the
- quoted-printable MIME type
-- Fixed a bug where one could unset certain PHP superglobals by setting
- them via GET or POST data
-- Fixed an undefined function error in the insert_id() function of the
- PostgreSQL driver
-- Fixed various doc typos.
-- Documented two functions from the :doc:`String
- helper <./helpers/string_helper>` that were missing from the
- user guide: trim_slashes() and reduce_double_slashes().
-- Docs now validate to XHTML 1 transitional
-- Updated the XSS Filtering to take into account the IE expression()
- ability and improved certain deletions to prevent possible exploits
-- Modified the Router so that when Query Strings are Enabled, the
- controller trigger and function trigger values are sanitized for
- filename include security.
-- Modified the is_image() method in the Upload library to take into
- account Windows IE 6/7 eccentricities when dealing with MIMEs
-- Modified XSS Cleaning routine to be more performance friendly and
- compatible with PHP 5.2's new PCRE backtrack and recursion limits.
-- Modified the :doc:`URL Helper <./helpers/url_helper>` to type cast
- the $title as a string in case a numeric value is supplied
-- Modified Form Helper form_dropdown() to type cast the keys and
- values of the options array as strings, allowing numeric values to be
- properly set as 'selected'
-- Deprecated the use if is_numeric() in various places since it allows
- periods. Due to compatibility problems with ctype_digit(), making it
- unreliable in some installations, the following regular expression
- was used instead: preg_match("/[^0-9]/", $n)
-- Deprecated: APPVER has been deprecated and replaced with CI_VERSION
- for clarity.
-
-Version 1.5.3
-=============
-
-Release Date: April 15, 2007
-
-- Added array to string into the profiler
-- Code Igniter references updated to CodeIgniter
-- pMachine references updated to EllisLab
-- Fixed a bug in the repeater function of :doc:`string
- helper <./helpers/string_helper>`.
-- Fixed a bug in ODBC driver
-- Fixed a bug in result_array() that was returning an empty array when
- no result is produced.
-- Fixed a bug in the redirect function of the :doc:`url
- helper <./helpers/url_helper>`.
-- Fixed an undefined variable in Loader
-- Fixed a version bug in the Postgres driver
-- Fixed a bug in the textarea function of the form helper for use with
- strings
-- Fixed doc typos.
-
-Version 1.5.2
-=============
-
-Release Date: February 13, 2007
-
-- Added subversion information
- to the :doc:`downloads <installation/downloads>` page.
-- Added support for captions in the :doc:`Table
- Library <./libraries/table>`
-- Fixed a bug in the
- :doc:`download_helper <helpers/download_helper>` that was causing
- Internet Explorer to load rather than download
-- Fixed a bug in the Active Record Join function that was not taking
- table prefixes into consideration.
-- Removed unescaped variables in error messages of Input and Router
- classes
-- Fixed a bug in the Loader that was causing errors on Libraries loaded
- twice. A debug message is now silently made in the log.
-- Fixed a bug in the :doc:`form helper <helpers/form_helper>` that
- gave textarea a value attribute
-- Fixed a bug in the :doc:`Image Library <libraries/image_lib>` that
- was ignoring resizing the same size image
-- Fixed some doc typos.
-
-Version 1.5.1
-=============
-
-Release Date: November 23, 2006
-
-- Added support for submitting arrays of libraries in the
- $this->load->library function.
-- Added support for naming custom library files in lower or uppercase.
-- Fixed a bug related to output buffering.
-- Fixed a bug in the active record class that was not resetting query
- data after a completed query.
-- Fixed a bug that was suppressing errors in controllers.
-- Fixed a problem that can cause a loop to occur when the config file
- is missing.
-- Fixed a bug that occurred when multiple models were loaded with the
- third parameter set to TRUE.
-- Fixed an oversight that was not unsetting globals properly in the
- input sanitize function.
-- Fixed some bugs in the Oracle DB driver.
-- Fixed an incorrectly named variable in the MySQLi result driver.
-- Fixed some doc typos.
-
-Version 1.5.0.1
-===============
-
-Release Date: October 31, 2006
-
-- Fixed a problem in which duplicate attempts to load helpers and
- classes were not being stopped.
-- Fixed a bug in the word_wrap() helper function.
-- Fixed an invalid color Hex number in the Profiler class.
-- Fixed a corrupted image in the user guide.
-
-Version 1.5.0
-=============
-
-Release Date: October 30, 2006
-
-- Added :doc:`DB utility class <./database/utilities>`, permitting DB
- backups, CVS or XML files from DB results, and various other
- functions.
-- Added :doc:`Database Caching Class <./database/caching>`.
-- Added :doc:`transaction support <./database/transactions>` to the
- database classes.
-- Added :doc:`Profiler Class <./general/profiling>` which generates a
- report of Benchmark execution times, queries, and POST data at the
- bottom of your pages.
-- Added :doc:`User Agent Library <./libraries/user_agent>` which
- allows browsers, robots, and mobile devises to be identified.
-- Added :doc:`HTML Table Class <./libraries/table>` , enabling tables
- to be generated from arrays or database results.
-- Added :doc:`Zip Encoding Library <./libraries/zip>`.
-- Added :doc:`FTP Library <./libraries/ftp>`.
-- Added the ability to :doc:`extend
- libraries <./general/creating_libraries>` and :doc:`extend core
- classes <./general/core_classes>`, in addition to being able to
- replace them.
-- Added support for storing :doc:`models within
- sub-folders <./general/models>`.
-- Added :doc:`Download Helper <./helpers/download_helper>`.
-- Added :doc:`simple_query() <./database/queries>` function to the
- database classes
-- Added :doc:`standard_date() <./helpers/date_helper>` function to
- the Date Helper.
-- Added :doc:`$query->free_result() <./database/results>` to database
- class.
-- Added :doc:`$query->list_fields() <./database/metadata>` function to
- database class
-- Added :doc:`$this->db->platform() <./database/helpers>` function
-- Added new :doc:`File Helper <./helpers/file_helper>`:
- get_filenames()
-- Added new helper: :doc:`Smiley Helper <./helpers/smiley_helper>`
-- Added support for <ul> and <ol> lists in the :doc:`HTML
- Helper <./helpers/html_helper>`
-- Added the ability to rewrite :doc:`short
- tags <./general/alternative_php>` on-the-fly, converting them
- to standard PHP statements, for those servers that do not support
- short tags. This allows the cleaner syntax to be used regardless of
- whether it's supported by the server.
-- Added the ability to :doc:`rename or relocate the "application"
- folder <./general/managing_apps>`.
-- Added more thorough initialization in the upload class so that all
- class variables are reset.
-- Added "is_numeric" to validation, which uses the native PHP
- is_numeric function.
-- Improved the URI handler to make it more reliable when the
- $config['uri_protocol'] item is set to AUTO.
-- Moved most of the functions in the Controller class into the Loader
- class, allowing fewer reserved function names for controllers when
- running under PHP 5.
-- Updated the DB Result class to return an empty array when
- $query->result() doesn't produce a result.
-- Updated the input->cookie() and input->post() functions in :doc:`Input
- Class <./libraries/input>` to permit arrays contained cookies
- that are arrays to be run through the XSS filter.
-- Documented three functions from the Validation
- class that were missing from the user
- guide: set_select(), set_radio(), and set_checkbox().
-- Fixed a bug in the Email class related to SMTP Helo data.
-- Fixed a bug in the word wrapping helper and function in the email
- class.
-- Fixed a bug in the validation class.
-- Fixed a bug in the typography helper that was incorrectly wrapping
- block level elements in paragraph tags.
-- Fixed a problem in the form_prep() function that was double encoding
- entities.
-- Fixed a bug that affects some versions of PHP when output buffering
- is nested.
-- Fixed a bug that caused CI to stop working when the PHP magic
- __get() or __set() functions were used within models or
- controllers.
-- Fixed a pagination bug that was permitting negative values in the
- URL.
-- Fixed an oversight in which the Loader class was not allowed to be
- extended.
-- Changed _get_config() to get_config() since the function is not a
- private one.
-- **Deprecated "init" folder**. Initialization happens automatically
- now. :doc:`Please see documentation <./general/creating_libraries>`.
-- **Deprecated** $this->db->field_names() USE
- $this->db->list_fields()
-- **Deprecated** the $config['log_errors'] item from the config.php
- file. Instead, $config['log_threshold'] can be set to "0" to turn it
- off.
-
-Version 1.4.1
-=============
-
-Release Date: September 21, 2006
-
-- Added a new feature that passes URI segments directly to your
- function calls as parameters. See the
- :doc:`Controllers <general/controllers>` page for more info.
-- Added support for a function named _output(), which when used in
- your controllers will received the final rendered output from the
- output class. More info in the :doc:`Controllers <general/controllers>`
- page.
-- Added several new functions in the :doc:`URI
- Class <./libraries/uri>` to let you retrieve and manipulate URI
- segments that have been re-routed using the :doc:`URI
- Routing <general/routing>` feature. Previously, the URI class did not
- permit you to access any re-routed URI segments, but now it does.
-- Added :doc:`$this->output->set_header() <./libraries/output>`
- function, which allows you to set server headers.
-- Updated plugins, helpers, and language classes to allow your
- application folder to contain its own plugins, helpers, and language
- folders. Previously they were always treated as global for your
- entire installation. If your application folder contains any of these
- resources they will be used *instead* the global ones.
-- Added :doc:`Inflector helper <./helpers/inflector_helper>`.
-- Added element() function in the :doc:`array
- helper <./helpers/array_helper>`.
-- Added RAND() to active record orderby() function.
-- Added delete_cookie() and get_cookie() to :doc:`Cookie
- helper <./helpers/cookie_helper>`, even though the input class
- has a cookie fetching function.
-- Added Oracle database driver (still undergoing testing so it might
- have some bugs).
-- Added the ability to combine pseudo-variables and php variables in
- the template parser class.
-- Added output compression option to the config file.
-- Removed the is_numeric test from the db->escape() function.
-- Fixed a MySQLi bug that was causing error messages not to contain
- proper error data.
-- Fixed a bug in the email class which was causing it to ignore
- explicitly set alternative headers.
-- Fixed a bug that was causing a PHP error when the Exceptions class
- was called within the get_config() function since it was causing
- problems.
-- Fixed an oversight in the cookie helper in which the config file
- cookie settings were not being honored.
-- Fixed an oversight in the upload class. An item mentioned in the 1.4
- changelog was missing.
-- Added some code to allow email attachments to be reset when sending
- batches of email.
-- Deprecated the application/scripts folder. It will continue to work
- for legacy users, but it is recommended that you create your own
- :doc:`libraries <./general/libraries>` or
- :doc:`models <./general/models>` instead. It was originally added
- before CI had user libraries or models, but it's not needed anymore.
-- Deprecated the $autoload['core'] item from the autoload.php file.
- Instead, please now use: $autoload['libraries']
-- Deprecated the following database functions:
- $this->db->smart_escape_str() and $this->db->fields().
-
-Version 1.4.0
-=============
-
-Release Date: September 17, 2006
-
-- Added :doc:`Hooks <./general/hooks>` feature, enabling you to tap
- into and modify the inner workings of the framework without hacking
- the core files.
-- Added the ability to organize controller files :doc:`into
- sub-folders <general/controllers>`. Kudos to Marco for
- suggesting this (and the next two) feature.
-- Added regular expressions support for :doc:`routing
- rules <./general/routing>`.
-- Added the ability to :doc:`remap function
- calls <./general/controllers>` within your controllers.
-- Added the ability to :doc:`replace core system
- classes <./general/core_classes>` with your own classes.
-- Added support for % character in URL.
-- Added the ability to supply full URLs using the
- :doc:`anchor() <./helpers/url_helper>` helper function.
-- Added mode parameter to :doc:`file_write() <./helpers/file_helper>`
- helper.
-- Added support for changing the port number in the :doc:`Postgres
- driver <./database/configuration>`.
-- Moved the list of "allowed URI characters" out of the Router class
- and into the config file.
-- Moved the MIME type array out of the Upload class and into its own
- file in the application/config/ folder.
-- Updated the Upload class to allow the upload field name to be set
- when calling :doc:`do_upload() <./libraries/file_uploading>`.
-- Updated the :doc:`Config Library <./libraries/config>` to be able to
- load config files silently, and to be able to assign config files to
- their own index (to avoid collisions if you use multiple config
- files).
-- Updated the URI Protocol code to allow more options so that URLs will
- work more reliably in different environments.
-- Updated the form_open() helper to allow the GET method to be used.
-- Updated the MySQLi execute() function with some code to help prevent
- lost connection errors.
-- Updated the SQLite Driver to check for object support before
- attempting to return results as objects. If unsupported it returns an
- array.
-- Updated the Models loader function to allow multiple loads of the
- same model.
-- Updated the MS SQL driver so that single quotes are escaped.
-- Updated the Postgres and ODBC drivers for better compatibility.
-- Removed a strtolower() call that was changing URL segments to lower
- case.
-- Removed some references that were interfering with PHP 4.4.1
- compatibility.
-- Removed backticks from Postgres class since these are not needed.
-- Renamed display() to _display() in the Output class to make it clear
- that it's a private function.
-- Deprecated the hash() function due to a naming conflict with a native
- PHP function with the same name. Please use dohash() instead.
-- Fixed an bug that was preventing the input class from unsetting GET
- variables.
-- Fixed a router bug that was making it too greedy when matching end
- segments.
-- Fixed a bug that was preventing multiple discrete database calls.
-- Fixed a bug in which loading a language file was producing a "file
- contains no data" message.
-- Fixed a session bug caused by the XSS Filtering feature inadvertently
- changing the case of certain words.
-- Fixed some missing prefixes when using the database prefix feature.
-- Fixed a typo in the Calendar class (cal_november).
-- Fixed a bug in the form_checkbox() helper.
-- Fixed a bug that was allowing the second segment of the URI to be
- identical to the class name.
-- Fixed an evaluation bug in the database initialization function.
-- Fixed a minor bug in one of the error messages in the language class.
-- Fixed a bug in the date helper timespan function.
-- Fixed an undefined variable in the DB Driver class.
-- Fixed a bug in which dollar signs used as binding replacement values
- in the DB class would be treated as RegEx back-references.
-- Fixed a bug in the set_hash() function which was preventing MD5 from
- being used.
-- Fixed a couple bugs in the Unit Testing class.
-- Fixed an incorrectly named variable in the Validation class.
-- Fixed an incorrectly named variable in the URI class.
-- Fixed a bug in the config class that was preventing the base URL from
- being called properly.
-- Fixed a bug in the validation class that was not permitting callbacks
- if the form field was empty.
-- Fixed a problem that was preventing scaffolding from working properly
- with MySQLi.
-- Fixed some MS SQL bugs.
-- Fixed some doc typos.
-
-Version 1.3.3
-=============
-
-Release Date: June 1, 2006
-
-- Models do **not** connect automatically to the database as of this
- version. :doc:`More info here <./general/models>`.
-- Updated the Sessions class to utilize the active record class when
- running session related queries. Previously the queries assumed MySQL
- syntax.
-- Updated alternator() function to re-initialize when called with no
- arguments, allowing multiple calls.
-- Fixed a bug in the active record "having" function.
-- Fixed a problem in the validation class which was making checkboxes
- be ignored when required.
-- Fixed a bug in the word_limiter() helper function. It was cutting
- off the fist word.
-- Fixed a bug in the xss_clean function due to a PHP bug that affects
- some versions of html_entity_decode.
-- Fixed a validation bug that was preventing rules from being set twice
- in one controller.
-- Fixed a calendar bug that was not letting it use dynamically loaded
- languages.
-- Fixed a bug in the active record class when using WHERE clauses with
- LIKE
-- Fixed a bug in the hash() security helper.
-- Fixed some typos.
-
-Version 1.3.2
-=============
-
-Release Date: April 17, 2006
-
-- Changed the behavior of the validation class such that if a
- "required" rule is NOT explicitly stated for a field then all other
- tests get ignored.
-- Fixed a bug in the Controller class that was causing it to look in
- the local "init" folder instead of the main system one.
-- Fixed a bug in the init_pagination file. The $config item was not
- being set correctly.
-- Fixed a bug in the auto typography helper that was causing
- inconsistent behavior.
-- Fixed a couple bugs in the Model class.
-- Fixed some documentation typos and errata.
-
-Version 1.3.1
-=============
-
-Release Date: April 11, 2006
-
-- Added a :doc:`Unit Testing Library <./libraries/unit_testing>`.
-- Added the ability to pass objects to the **insert()** and
- **update()** database functions. This feature enables you to (among
- other things) use your :doc:`Model class <./general/models>`
- variables to run queries with. See the Models page for details.
-- Added the ability to pass objects to the :doc:`view loading
- function <./general/views>`: $this->load->view('my_view',
- $object);
-- Added getwhere function to :doc:`Active Record
- class <./database/query_builder>`.
-- Added count_all function to :doc:`Active Record
- class <./database/query_builder>`.
-- Added language file for scaffolding and fixed a scaffolding bug that
- occurs when there are no rows in the specified table.
-- Added :doc:`$this->db->last_query() <./database/queries>`, which
- allows you to view your last query that was run.
-- Added a new mime type to the upload class for better compatibility.
-- Changed how cache files are read to prevent PHP errors if the cache
- file contains an XML tag, which PHP wants to interpret as a short
- tag.
-- Fixed a bug in a couple of the active record functions (where and
- orderby).
-- Fixed a bug in the image library when realpath() returns false.
-- Fixed a bug in the Models that was preventing libraries from being
- used within them.
-- Fixed a bug in the "exact_length" function of the validation class.
-- Fixed some typos in the user guide
-
-Version 1.3
-===========
-
-Release Date: April 3, 2006
-
-- Added support for :doc:`Models <general/models>`.
-- Redesigned the database libraries to support additional RDBMs
- (Postgres, MySQLi, etc.).
-- Redesigned the :doc:`Active Record class <./database/query_builder>`
- to enable more varied types of queries with simpler syntax, and
- advanced features like JOINs.
-- Added a feature to the database class that lets you run :doc:`custom
- function calls <./database/call_function>`.
-- Added support for :doc:`private functions <general/controllers>` in your
- controllers. Any controller function name that starts with an
- underscore will not be served by a URI request.
-- Added the ability to pass your own initialization parameters to your
- :doc:`custom core libraries <general/creating_libraries>` when using
- $this->load->library()
-- Added support for running standard :doc:`query string URLs <general/urls>`.
- These can be optionally enabled in your config file.
-- Added the ability to :doc:`specify a "suffix" <general/urls>`, which will be
- appended to your URLs. For example, you could add .html to your URLs,
- making them appear static. This feature is enabled in your config
- file.
-- Added a new error template for use with native PHP errors.
-- Added "alternator" function in the :doc:`string
- helpers <./helpers/string_helper>`.
-- Removed slashing from the input class. After much debate we decided
- to kill this feature.
-- Change the commenting style in the scripts to the PEAR standard so
- that IDEs and tools like phpDocumenter can harvest the comments.
-- Added better class and function name-spacing to avoid collisions with
- user developed classes. All CodeIgniter classes are now prefixed with
- CI\_ and all controller methods are prefixed with _ci to avoid
- controller collisions. A list of reserved function names can be
- :doc:`found here <general/controllers>`.
-- Redesigned how the "CI" super object is referenced, depending on
- whether PHP 4 or 5 is being run, since PHP 5 allows a more graceful
- way to manage objects that utilizes a bit less resources.
-- Deprecated: $this->db->use_table() has been deprecated. Please read
- the :doc:`Active Record <./database/query_builder>` page for
- information.
-- Deprecated: $this->db->smart_escape_str() has been deprecated.
- Please use this instead: $this->db->escape()
-- Fixed a bug in the exception handler which was preventing some PHP
- errors from showing up.
-- Fixed a typo in the URI class. $this->total_segment() should be
- plural: $this->total_segments()
-- Fixed some typos in the default calendar template
-- Fixed some typos in the user guide
-
-Version 1.2
-===========
-
-Release Date: March 21, 2006
-
-- Redesigned some internal aspects of the framework to resolve scoping
- problems that surfaced during the beta tests. The problem was most
- notable when instantiating classes in your constructors, particularly
- if those classes in turn did work in their constructors.
-- Added a global function named
- :doc:`get_instance() <general/ancillary_classes>` allowing the main
- CodeIgniter object to be accessible throughout your own classes.
-- Added new :doc:`File Helper <./helpers/file_helper>`:
- delete_files()
-- Added new :doc:`URL Helpers <./helpers/url_helper>`: base_url(),
- index_page()
-- Added the ability to create your own :doc:`core
- libraries <general/creating_libraries>` and store them in your local
- application directory.
-- Added an overwrite option to the :doc:`Upload
- class <./libraries/file_uploading>`, enabling files to be
- overwritten rather than having the file name appended.
-- Added Javascript Calendar plugin.
-- Added search feature to user guide. Note: This is done using Google,
- which at the time of this writing has not crawled all the pages of
- the docs.
-- Updated the parser class so that it allows tag pars within other tag
- pairs.
-- Fixed a bug in the DB "where" function.
-- Fixed a bug that was preventing custom config files to be
- auto-loaded.
-- Fixed a bug in the mysql class bind feature that prevented question
- marks in the replacement data.
-- Fixed some bugs in the xss_clean function
-
-Version Beta 1.1
-================
-
-Release Date: March 10, 2006
-
-- Added a :doc:`Calendaring class <./libraries/calendar>`.
-- Added support for running :doc:`multiple
- applications <general/managing_apps>` that share a common CodeIgniter
- backend.
-- Moved the "uri protocol" variable from the index.php file into the
- config.php file
-- Fixed a problem that was preventing certain function calls from
- working within constructors.
-- Fixed a problem that was preventing the $this->load->library function
- from working in constructors.
-- Fixed a bug that occurred when the session class was loaded using the
- auto-load routine.
-- Fixed a bug that can happen with PHP versions that do not support the
- E_STRICT constant
-- Fixed a data type error in the form_radio function (form helper)
-- Fixed a bug that was preventing the xss_clean function from being
- called from the validation class.
-- Fixed the cookie related config names, which were incorrectly
- specified as $conf rather than $config
-- Fixed a pagination problem in the scaffolding.
-- Fixed a bug in the mysql class "where" function.
-- Fixed a regex problem in some code that trimmed duplicate slashes.
-- Fixed a bug in the br() function in the HTML helper
-- Fixed a syntax mistake in the form_dropdown function in the Form
- Helper.
-- Removed the "style" attributes form the form helpers.
-- Updated the documentation. Added "next/previous" links to each page
- and fixed various typos.
-
-Version Beta 1.0
-================
-
-Release Date: February 28, 2006
-
-First publicly released version.
diff --git a/user_guide_src/source/conf.py b/user_guide_src/source/conf.py
deleted file mode 100644
index 0f3e1b943..000000000
--- a/user_guide_src/source/conf.py
+++ /dev/null
@@ -1,263 +0,0 @@
-# -*- coding: utf-8 -*-
-#
-# CodeIgniter documentation build configuration file, created by
-# sphinx-quickstart on Sun Aug 28 07:24:38 2011.
-#
-# This file is execfile()d with the current directory set to its containing dir.
-#
-# Note that not all possible configuration values are present in this
-# autogenerated file.
-#
-# All configuration values have a default; values that are commented out
-# serve to show the default.
-
-import sys, os
-
-# If extensions (or modules to document with autodoc) are in another directory,
-# add these directories to sys.path here. If the directory is relative to the
-# documentation root, use os.path.abspath to make it absolute, like shown here.
-#sys.path.insert(0, os.path.abspath('.'))
-
-# -- General configuration -----------------------------------------------------
-
-# If your documentation needs a minimal Sphinx version, state it here.
-#needs_sphinx = '1.0'
-
-# Add any Sphinx extension module names here, as strings. They can be extensions
-# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
-extensions = ['sphinx.ext.ifconfig', 'sphinxcontrib.phpdomain']
-
-# Add any paths that contain templates here, relative to this directory.
-templates_path = ['_templates']
-
-# The suffix of source filenames.
-source_suffix = '.rst'
-
-# The encoding of source files.
-#source_encoding = 'utf-8-sig'
-
-# The master toctree document.
-master_doc = 'index'
-
-# General information about the project.
-project = u'CodeIgniter'
-copyright = u'2019 - 2022, CodeIgniter Foundation'
-
-# The version info for the project you're documenting, acts as replacement for
-# |version| and |release|, also used in various other places throughout the
-# built documents.
-#
-# The short X.Y version.
-version = '3.1.13-dev'
-# The full version, including alpha/beta/rc tags.
-release = '3.1.13-dev'
-
-# The language for content autogenerated by Sphinx. Refer to documentation
-# for a list of supported languages.
-#language = None
-
-# There are two options for replacing |today|: either, you set today to some
-# non-false value, then it is used:
-#today = ''
-# Else, today_fmt is used as the format for a strftime call.
-#today_fmt = '%B %d, %Y'
-
-# List of patterns, relative to source directory, that match files and
-# directories to ignore when looking for source files.
-exclude_patterns = []
-
-# The reST default role (used for this markup: `text`) to use for all documents.
-#default_role = None
-
-# If true, '()' will be appended to :php:func: etc. cross-reference text.
-#add_function_parentheses = True
-
-# If true, the current module name will be prepended to all description
-# unit titles (such as .. php:function::).
-#add_module_names = True
-
-# If true, sectionauthor and moduleauthor directives will be shown in the
-# output. They are ignored by default.
-#show_authors = False
-
-# The name of the Pygments (syntax highlighting) style to use.
-pygments_style = 'trac'
-highlight_language = 'ci'
-
-# A list of ignored prefixes for module index sorting.
-#modindex_common_prefix = []
-
-
-# -- Options for HTML output ---------------------------------------------------
-
-# The theme to use for HTML and HTML Help pages. See the documentation for
-# a list of builtin themes.
-#
-html_theme = 'sphinx_rtd_theme'
-
-# Theme options are theme-specific and customize the look and feel of a theme
-# further. For a list of options available for each theme, see the
-# documentation.
-#
-# Specifying a few options; just a starting point & we can play with it.
-html_theme_options = {
-
-}
-
-# Add any paths that contain custom themes here, relative to this directory.
-html_theme_path = ["./_themes"]
-
-# The name for this set of Sphinx documents. If None, it defaults to
-# "<project> v<release> documentation".
-#html_title = None
-
-# A shorter title for the navigation bar. Default is the same as html_title.
-#html_short_title = None
-
-# The name of an image file (relative to this directory) to place at the top
-# of the sidebar.
-#html_logo = None
-
-# The name of an image file (within the static path) to use as favicon of the
-# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
-# pixels large.
-html_favicon = 'images/ci-icon.ico'
-
-# Add any paths that contain custom static files (such as style sheets) here,
-# relative to this directory. They are copied after the builtin static files,
-# so a file named "default.css" will overwrite the builtin "default.css".
-#html_static_path = ['_static']
-
-# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
-# using the given strftime format.
-html_last_updated_fmt = '%b %d, %Y'
-
-# If true, SmartyPants will be used to convert quotes and dashes to
-# typographically correct entities.
-#html_use_smartypants = True
-
-# Custom sidebar templates, maps document names to template names.
-#html_sidebars = {}
-
-# Additional templates that should be rendered to pages, maps page names to
-# template names.
-#html_additional_pages = {}
-
-# If false, no module index is generated.
-#html_domain_indices = True
-
-# If false, no index is generated.
-#html_use_index = True
-
-# If true, the index is split into individual pages for each letter.
-#html_split_index = False
-
-# If true, links to the reST sources are added to the pages.
-#html_show_sourcelink = True
-
-# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
-#html_show_sphinx = True
-
-# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
-#html_show_copyright = True
-
-# If true, an OpenSearch description file will be output, and all pages will
-# contain a <link> tag referring to it. The value of this option must be the
-# base URL from which the finished HTML is served.
-#html_use_opensearch = ''
-
-# This is the file name suffix for HTML files (e.g. ".xhtml").
-#html_file_suffix = None
-
-# Output file base name for HTML help builder.
-htmlhelp_basename = 'CodeIgniterdoc'
-
-html_copy_source = False
-
-# -- Options for LaTeX output --------------------------------------------------
-
-# The paper size ('letter' or 'a4').
-#latex_paper_size = 'letter'
-
-# The font size ('10pt', '11pt' or '12pt').
-#latex_font_size = '10pt'
-
-# Grouping the document tree into LaTeX files. List of tuples
-# (source start file, target name, title, author, documentclass [howto/manual]).
-latex_documents = [
- ('index', 'CodeIgniter.tex', u'CodeIgniter Documentation',
- u'British Columbia Institute of Technology', 'manual'),
-]
-
-# The name of an image file (relative to this directory) to place at the top of
-# the title page.
-#latex_logo = None
-
-# For "manual" documents, if this is true, then toplevel headings are parts,
-# not chapters.
-#latex_use_parts = False
-
-# If true, show page references after internal links.
-#latex_show_pagerefs = False
-
-# If true, show URL addresses after external links.
-#latex_show_urls = False
-
-# Additional stuff for the LaTeX preamble.
-#latex_preamble = ''
-
-# Documents to append as an appendix to all manuals.
-#latex_appendices = []
-
-# If false, no module index is generated.
-#latex_domain_indices = True
-
-
-# -- Options for manual page output --------------------------------------------
-
-# One entry per manual page. List of tuples
-# (source start file, name, description, authors, manual section).
-man_pages = [
- ('index', 'codeigniter', u'CodeIgniter Documentation',
- [u'British Columbia Institute of Technology'], 1)
-]
-
-
-# -- Options for Epub output ---------------------------------------------------
-
-# Bibliographic Dublin Core info.
-epub_title = u'CodeIgniter'
-epub_author = u'British Columbia Institute of Technology'
-epub_publisher = u'British Columbia Institute of Technology'
-epub_copyright = u'2014 - 2019, British Columbia Institute of Technology'
-
-# The language of the text. It defaults to the language option
-# or en if the language is not set.
-#epub_language = ''
-
-# The scheme of the identifier. Typical schemes are ISBN or URL.
-#epub_scheme = ''
-
-# The unique identifier of the text. This can be a ISBN number
-# or the project homepage.
-#epub_identifier = ''
-
-# A unique identification for the text.
-#epub_uid = ''
-
-# HTML files that should be inserted before the pages created by sphinx.
-# The format is a list of tuples containing the path and title.
-#epub_pre_files = []
-
-# HTML files shat should be inserted after the pages created by sphinx.
-# The format is a list of tuples containing the path and title.
-#epub_post_files = []
-
-# A list of files that should not be packed into the epub file.
-#epub_exclude_files = []
-
-# The depth of the table of contents in toc.ncx.
-#epub_tocdepth = 3
-
-# Allow duplicate toc entries.
-#epub_tocdup = True
diff --git a/user_guide_src/source/contributing/index.rst b/user_guide_src/source/contributing/index.rst
deleted file mode 100644
index be776ec1f..000000000
--- a/user_guide_src/source/contributing/index.rst
+++ /dev/null
@@ -1,159 +0,0 @@
-###########################
-Contributing to CodeIgniter
-###########################
-
-.. toctree::
- :titlesonly:
-
- ../documentation/index
- ../DCO
-
-CodeIgniter is a community driven project and accepts contributions of code
-and documentation from the community. These contributions are made in the form
-of Issues or `Pull Requests <https://help.github.com/articles/using-pull-requests/>`_
-on the `CodeIgniter repository <https://github.com/bcit-ci/CodeIgniter>`_ on GitHub.
-
-Issues are a quick way to point out a bug. If you find a bug or documentation
-error in CodeIgniter then please check a few things first:
-
-- There is not already an open Issue
-- The issue has already been fixed (check the develop branch, or look for
- closed Issues)
-- Is it something really obvious that you fix it yourself?
-
-Reporting issues is helpful but an even better approach is to send a Pull
-Request, which is done by "Forking" the main repository and committing to your
-own copy. This will require you to use the version control system called Git.
-
-*******
-Support
-*******
-
-Please note that GitHub is not for general support questions! If you are
-having trouble using a feature of CodeIgniter, ask for help on our
-`forums <http://forum.codeigniter.com/>`_ instead.
-
-If you are not sure whether you are using something correctly or if you
-have found a bug, again - please ask on the forums first.
-
-********
-Security
-********
-
-Did you find a security issue in CodeIgniter?
-
-Please *don't* disclose it publicly, but e-mail us at security@codeigniter.com,
-or report it via our page on `HackerOne <https://hackerone.com/codeigniter>`_.
-
-If you've found a critical vulnerability, we'd be happy to credit you in our
-`ChangeLog <../changelog>`.
-
-****************************
-Tips for a Good Issue Report
-****************************
-
-Use a descriptive subject line (eg parser library chokes on commas) rather than a vague one (eg. your code broke).
-
-Address a single issue in a report.
-
-Identify the CodeIgniter version (eg 3.0-develop) and the component if you know it (eg. parser library)
-
-Explain what you expected to happen, and what did happen.
-Include error messages and stacktrace, if any.
-
-Include short code segments if they help to explain.
-Use a pastebin or dropbox facility to include longer segments of code or screenshots - do not include them in the issue report itself.
-This means setting a reasonable expiry for those, until the issue is resolved or closed.
-
-If you know how to fix the issue, you can do so in your own fork & branch, and submit a pull request.
-The issue report information above should be part of that.
-
-If your issue report can describe the steps to reproduce the problem, that is great.
-If you can include a unit test that reproduces the problem, that is even better, as it gives whoever is fixing
-it a clearer target!
-
-
-**********
-Guidelines
-**********
-
-Before we look into how, here are the guidelines. If your Pull Requests fail
-to pass these guidelines it will be declined and you will need to re-submit
-when you’ve made the changes. This might sound a bit tough, but it is required
-for us to maintain quality of the code-base.
-
-PHP Style
-=========
-
-All code must meet the `Style Guide
-<https://codeigniter.com/userguide3/general/styleguide.html>`_, which is
-essentially the `Allman indent style
-<https://en.wikipedia.org/wiki/Indent_style#Allman_style>`_, underscores and
-readable operators. This makes certain that all code is the same format as the
-existing code and means it will be as readable as possible.
-
-Documentation
-=============
-
-If you change anything that requires a change to documentation then you will
-need to add it. New classes, methods, parameters, changing default values, etc
-are all things that will require a change to documentation. The change-log
-must also be updated for every change. Also PHPDoc blocks must be maintained.
-
-Compatibility
-=============
-
-CodeIgniter recommends PHP 5.6 or newer to be used, but it should be
-compatible with PHP 5.3.7 so all code supplied must stick to this
-requirement. If PHP 5.4 (and above) functions or features are used then
-there must be a fallback for PHP 5.3.7.
-
-Branching
-=========
-
-CodeIgniter uses the `Git-Flow
-<http://nvie.com/posts/a-successful-git-branching-model/>`_ branching model
-which requires all pull requests to be sent to the "develop" branch. This is
-where the next planned version will be developed. The "master" branch will
-always contain the latest stable version and is kept clean so a "hotfix" (e.g:
-an emergency security patch) can be applied to master to create a new version,
-without worrying about other features holding it up. For this reason all
-commits need to be made to "develop" and any sent to "master" will be closed
-automatically. If you have multiple changes to submit, please place all
-changes into their own branch on your fork.
-
-One thing at a time: A pull request should only contain one change. That does
-not mean only one commit, but one change - however many commits it took. The
-reason for this is that if you change X and Y but send a pull request for both
-at the same time, we might really want X but disagree with Y, meaning we
-cannot merge the request. Using the Git-Flow branching model you can create
-new branches for both of these features and send two requests.
-
-Signing
-=======
-You must sign your work, certifying that you either wrote the work or
-otherwise have the right to pass it on to an open source project. git makes
-this trivial as you merely have to use `--signoff` on your commits to your
-CodeIgniter fork.
-
-.. code-block:: bash
-
- git commit --signoff
-
-or simply
-
-.. code-block:: bash
-
- git commit -s
-
-This will sign your commits with the information setup in your git config, e.g.
-
- Signed-off-by: John Q Public <john.public@example.com>
-
-If you are using Tower there is a "Sign-Off" checkbox in the commit window. You
-could even alias git commit to use the -s flag so you don’t have to think about
-it.
-
-By signing your work in this manner, you certify to a "Developer's Certificate
-of Origin". The current version of this certificate is in the :doc:`/DCO` file
-in the root of this documentation.
diff --git a/user_guide_src/source/database/caching.rst b/user_guide_src/source/database/caching.rst
deleted file mode 100644
index d73120a93..000000000
--- a/user_guide_src/source/database/caching.rst
+++ /dev/null
@@ -1,162 +0,0 @@
-######################
-Database Caching Class
-######################
-
-The Database Caching Class permits you to cache your queries as text
-files for reduced database load.
-
-.. important:: This class is initialized automatically by the database
- driver when caching is enabled. Do NOT load this class manually.
-
-.. important:: Not all query result functions are available when you
- use caching. Please read this page carefully.
-
-Enabling Caching
-================
-
-Caching is enabled in three steps:
-
-- Create a writable directory on your server where the cache files can
- be stored.
-- Set the path to your cache folder in your
- application/config/database.php file.
-- Enable the caching feature, either globally by setting the preference
- in your application/config/database.php file, or manually as
- described below.
-
-Once enabled, caching will happen automatically whenever a page is
-loaded that contains database queries.
-
-How Does Caching Work?
-======================
-
-CodeIgniter's query caching system happens dynamically when your pages
-are viewed. When caching is enabled, the first time a web page is
-loaded, the query result object will be serialized and stored in a text
-file on your server. The next time the page is loaded the cache file
-will be used instead of accessing your database. Your database usage can
-effectively be reduced to zero for any pages that have been cached.
-
-Only read-type (SELECT) queries can be cached, since these are the only
-type of queries that produce a result. Write-type (INSERT, UPDATE, etc.)
-queries, since they don't generate a result, will not be cached by the
-system.
-
-Cache files DO NOT expire. Any queries that have been cached will remain
-cached until you delete them. The caching system permits you clear
-caches associated with individual pages, or you can delete the entire
-collection of cache files. Typically you'll want to use the housekeeping
-functions described below to delete cache files after certain events
-take place, like when you've added new information to your database.
-
-Will Caching Improve Your Site's Performance?
-=============================================
-
-Getting a performance gain as a result of caching depends on many
-factors. If you have a highly optimized database under very little load,
-you probably won't see a performance boost. If your database is under
-heavy use you probably will see an improved response, assuming your
-file-system is not overly taxed. Remember that caching simply changes
-how your information is retrieved, shifting it from being a database
-operation to a file-system one.
-
-In some clustered server environments, for example, caching may be
-detrimental since file-system operations are so intense. On single
-servers in shared environments, caching will probably be beneficial.
-Unfortunately there is no single answer to the question of whether you
-should cache your database. It really depends on your situation.
-
-How are Cache Files Stored?
-===========================
-
-CodeIgniter places the result of EACH query into its own cache file.
-Sets of cache files are further organized into sub-folders corresponding
-to your controller functions. To be precise, the sub-folders are named
-identically to the first two segments of your URI (the controller class
-name and function name).
-
-For example, let's say you have a controller called blog with a function
-called comments that contains three queries. The caching system will
-create a cache folder called blog+comments, into which it will write
-three cache files.
-
-If you use dynamic queries that change based on information in your URI
-(when using pagination, for example), each instance of the query will
-produce its own cache file. It's possible, therefore, to end up with
-many times more cache files than you have queries.
-
-Managing your Cache Files
-=========================
-
-Since cache files do not expire, you'll need to build deletion routines
-into your application. For example, let's say you have a blog that
-allows user commenting. Whenever a new comment is submitted you'll want
-to delete the cache files associated with the controller function that
-serves up your comments. You'll find two delete functions described
-below that help you clear data.
-
-Not All Database Functions Work with Caching
-============================================
-
-Lastly, we need to point out that the result object that is cached is a
-simplified version of the full result object. For that reason, some of
-the query result functions are not available for use.
-
-The following functions ARE NOT available when using a cached result
-object:
-
-- num_fields()
-- field_names()
-- field_data()
-- free_result()
-
-Also, the two database resources (result_id and conn_id) are not
-available when caching, since result resources only pertain to run-time
-operations.
-
-******************
-Function Reference
-******************
-
-$this->db->cache_on() / $this->db->cache_off()
-================================================
-
-Manually enables/disables caching. This can be useful if you want to
-keep certain queries from being cached. Example::
-
- // Turn caching on
- $this->db->cache_on();
- $query = $this->db->query("SELECT * FROM mytable");
-
- // Turn caching off for this one query
- $this->db->cache_off();
- $query = $this->db->query("SELECT * FROM members WHERE member_id = '$current_user'");
-
- // Turn caching back on
- $this->db->cache_on();
- $query = $this->db->query("SELECT * FROM another_table");
-
-$this->db->cache_delete()
-==========================
-
-Deletes the cache files associated with a particular page. This is
-useful if you need to clear caching after you update your database.
-
-The caching system saves your cache files to folders that correspond to
-the URI of the page you are viewing. For example, if you are viewing a
-page at example.com/index.php/blog/comments, the caching system will put
-all cache files associated with it in a folder called blog+comments. To
-delete those particular cache files you will use::
-
- $this->db->cache_delete('blog', 'comments');
-
-If you do not use any parameters the current URI will be used when
-determining what should be cleared.
-
-$this->db->cache_delete_all()
-===============================
-
-Clears all existing cache files. Example::
-
- $this->db->cache_delete_all();
-
diff --git a/user_guide_src/source/database/call_function.rst b/user_guide_src/source/database/call_function.rst
deleted file mode 100644
index 83fc870d0..000000000
--- a/user_guide_src/source/database/call_function.rst
+++ /dev/null
@@ -1,39 +0,0 @@
-#####################
-Custom Function Calls
-#####################
-
-$this->db->call_function();
-============================
-
-This function enables you to call PHP database functions that are not
-natively included in CodeIgniter, in a platform independent manner. For
-example, let's say you want to call the mysql_get_client_info()
-function, which is **not** natively supported by CodeIgniter. You could
-do so like this::
-
- $this->db->call_function('get_client_info');
-
-You must supply the name of the function, **without** the mysql\_
-prefix, in the first parameter. The prefix is added automatically based
-on which database driver is currently being used. This permits you to
-run the same function on different database platforms. Obviously not all
-function calls are identical between platforms, so there are limits to
-how useful this function can be in terms of portability.
-
-Any parameters needed by the function you are calling will be added to
-the second parameter.
-
-::
-
- $this->db->call_function('some_function', $param1, $param2, etc..);
-
-Often, you will either need to supply a database connection ID or a
-database result ID. The connection ID can be accessed using::
-
- $this->db->conn_id;
-
-The result ID can be accessed from within your result object, like this::
-
- $query = $this->db->query("SOME QUERY");
-
- $query->result_id; \ No newline at end of file
diff --git a/user_guide_src/source/database/configuration.rst b/user_guide_src/source/database/configuration.rst
deleted file mode 100644
index a9bf7dcb6..000000000
--- a/user_guide_src/source/database/configuration.rst
+++ /dev/null
@@ -1,207 +0,0 @@
-######################
-Database Configuration
-######################
-
-CodeIgniter has a config file that lets you store your database
-connection values (username, password, database name, etc.). The config
-file is located at application/config/database.php. You can also set
-database connection values for specific
-:doc:`environments <../libraries/config>` by placing **database.php**
-in the respective environment config folder.
-
-The config settings are stored in a multi-dimensional array with this
-prototype::
-
- $db['default'] = array(
- 'dsn' => '',
- 'hostname' => 'localhost',
- 'username' => 'root',
- 'password' => '',
- 'database' => 'database_name',
- 'dbdriver' => 'mysqli',
- 'dbprefix' => '',
- 'pconnect' => TRUE,
- 'db_debug' => TRUE,
- 'cache_on' => FALSE,
- 'cachedir' => '',
- 'char_set' => 'utf8',
- 'dbcollat' => 'utf8_general_ci',
- 'swap_pre' => '',
- 'encrypt' => FALSE,
- 'compress' => FALSE,
- 'stricton' => FALSE,
- 'failover' => array()
- );
-
-Some database drivers (such as PDO, PostgreSQL, Oracle, ODBC) might
-require a full DSN string to be provided. If that is the case, you
-should use the 'dsn' configuration setting, as if you're using the
-driver's underlying native PHP extension, like this::
-
- // PDO
- $db['default']['dsn'] = 'pgsql:host=localhost;port=5432;dbname=database_name';
-
- // Oracle
- $db['default']['dsn'] = '//localhost/XE';
-
-.. note:: If you do not specify a DSN string for a driver that requires it, CodeIgniter
- will try to build it with the rest of the provided settings.
-
-.. note:: If you provide a DSN string and it is missing some valid settings (e.g. the
- database character set), which are present in the rest of the configuration
- fields, CodeIgniter will append them.
-
-You can also specify failovers for the situation when the main connection cannot connect for some reason.
-These failovers can be specified by setting the failover for a connection like this::
-
- $db['default']['failover'] = array(
- array(
- 'hostname' => 'localhost1',
- 'username' => '',
- 'password' => '',
- 'database' => '',
- 'dbdriver' => 'mysqli',
- 'dbprefix' => '',
- 'pconnect' => TRUE,
- 'db_debug' => TRUE,
- 'cache_on' => FALSE,
- 'cachedir' => '',
- 'char_set' => 'utf8',
- 'dbcollat' => 'utf8_general_ci',
- 'swap_pre' => '',
- 'encrypt' => FALSE,
- 'compress' => FALSE,
- 'stricton' => FALSE
- ),
- array(
- 'hostname' => 'localhost2',
- 'username' => '',
- 'password' => '',
- 'database' => '',
- 'dbdriver' => 'mysqli',
- 'dbprefix' => '',
- 'pconnect' => TRUE,
- 'db_debug' => TRUE,
- 'cache_on' => FALSE,
- 'cachedir' => '',
- 'char_set' => 'utf8',
- 'dbcollat' => 'utf8_general_ci',
- 'swap_pre' => '',
- 'encrypt' => FALSE,
- 'compress' => FALSE,
- 'stricton' => FALSE
- )
- );
-
-You can specify as many failovers as you like.
-
-The reason we use a multi-dimensional array rather than a more simple
-one is to permit you to optionally store multiple sets of connection
-values. If, for example, you run multiple environments (development,
-production, test, etc.) under a single installation, you can set up a
-connection group for each, then switch between groups as needed. For
-example, to set up a "test" environment you would do this::
-
- $db['test'] = array(
- 'dsn' => '',
- 'hostname' => 'localhost',
- 'username' => 'root',
- 'password' => '',
- 'database' => 'database_name',
- 'dbdriver' => 'mysqli',
- 'dbprefix' => '',
- 'pconnect' => TRUE,
- 'db_debug' => TRUE,
- 'cache_on' => FALSE,
- 'cachedir' => '',
- 'char_set' => 'utf8',
- 'dbcollat' => 'utf8_general_ci',
- 'swap_pre' => '',
- 'compress' => FALSE,
- 'encrypt' => FALSE,
- 'stricton' => FALSE,
- 'failover' => array()
- );
-
-Then, to globally tell the system to use that group you would set this
-variable located in the config file::
-
- $active_group = 'test';
-
-.. note:: The name 'test' is arbitrary. It can be anything you want. By
- default we've used the word "default" for the primary connection,
- but it too can be renamed to something more relevant to your project.
-
-Query Builder
--------------
-
-The :doc:`Query Builder Class <query_builder>` is globally enabled or
-disabled by setting the $query_builder variable in the database
-configuration file to TRUE/FALSE (boolean). The default setting is TRUE.
-If you are not using the
-query builder class, setting it to FALSE will utilize fewer resources
-when the database classes are initialized.
-
-::
-
- $query_builder = TRUE;
-
-.. note:: that some CodeIgniter classes such as Sessions require Query
- Builder to be enabled to access certain functionality.
-
-Explanation of Values:
-----------------------
-
-====================== ===========================================================================================================
- Name Config Description
-====================== ===========================================================================================================
-**dsn** The DSN connect string (an all-in-one configuration sequence).
-**hostname** The hostname of your database server. Often this is 'localhost'.
-**username** The username used to connect to the database.
-**password** The password used to connect to the database.
-**database** The name of the database you want to connect to.
-**dbdriver** The database type. ie: mysqli, postgre, odbc, etc. Must be specified in lower case.
-**dbprefix** An optional table prefix which will added to the table name when running
- :doc:`Query Builder <query_builder>` queries. This permits multiple CodeIgniter
- installations to share one database.
-**pconnect** TRUE/FALSE (boolean) - Whether to use a persistent connection.
-**db_debug** TRUE/FALSE (boolean) - Whether database errors should be displayed.
-**cache_on** TRUE/FALSE (boolean) - Whether database query caching is enabled,
- see also :doc:`Database Caching Class <caching>`.
-**cachedir** The absolute server path to your database query cache directory.
-**char_set** The character set used in communicating with the database.
-**dbcollat** The character collation used in communicating with the database
-
- .. note:: Only used in the 'mysql' and 'mysqli' drivers.
-
-**swap_pre** A default table prefix that should be swapped with dbprefix. This is useful for distributed
- applications where you might run manually written queries, and need the prefix to still be
- customizable by the end user.
-**schema** The database schema, defaults to 'public'. Used by PostgreSQL and ODBC drivers.
-**encrypt** Whether or not to use an encrypted connection.
-
- - 'mysql' (deprecated), 'sqlsrv' and 'pdo/sqlsrv' drivers accept TRUE/FALSE
- - 'mysqli' and 'pdo/mysql' drivers accept an array with the following options:
-
- - 'ssl_key' - Path to the private key file
- - 'ssl_cert' - Path to the public key certificate file
- - 'ssl_ca' - Path to the certificate authority file
- - 'ssl_capath' - Path to a directory containing trusted CA certificates in PEM format
- - 'ssl_cipher' - List of *allowed* ciphers to be used for the encryption, separated by colons (':')
- - 'ssl_verify' - TRUE/FALSE; Whether to verify the server certificate or not ('mysqli' only)
-
-**compress** Whether or not to use client compression (MySQL only).
-**stricton** TRUE/FALSE (boolean) - Whether to force "Strict Mode" connections, good for ensuring strict SQL
- while developing an application.
-**port** The database port number. To use this value you have to add a line to the database config array.
- ::
-
- $db['default']['port'] = 5432;
-
-====================== ===========================================================================================================
-
-.. note:: Depending on what database platform you are using (MySQL, PostgreSQL,
- etc.) not all values will be needed. For example, when using SQLite you
- will not need to supply a username or password, and the database name
- will be the path to your database file. The information above assumes
- you are using MySQL.
diff --git a/user_guide_src/source/database/connecting.rst b/user_guide_src/source/database/connecting.rst
deleted file mode 100644
index 9b8117076..000000000
--- a/user_guide_src/source/database/connecting.rst
+++ /dev/null
@@ -1,155 +0,0 @@
-###########################
-Connecting to your Database
-###########################
-
-There are two ways to connect to a database:
-
-Automatically Connecting
-========================
-
-The "auto connect" feature will load and instantiate the database class
-with every page load. To enable "auto connecting", add the word database
-to the library array, as indicated in the following file:
-
-application/config/autoload.php
-
-Manually Connecting
-===================
-
-If only some of your pages require database connectivity you can
-manually connect to your database by adding this line of code in any
-function where it is needed, or in your class constructor to make the
-database available globally in that class.
-
-::
-
- $this->load->database();
-
-If the above function does **not** contain any information in the first
-parameter it will connect to the group specified in your database config
-file. For most people, this is the preferred method of use.
-
-Available Parameters
---------------------
-
-#. The database connection values, passed either as an array or a DSN
- string.
-#. TRUE/FALSE (boolean). Whether to return the connection ID (see
- Connecting to Multiple Databases below).
-#. TRUE/FALSE (boolean). Whether to enable the Query Builder class. Set
- to TRUE by default.
-
-Manually Connecting to a Database
----------------------------------
-
-The first parameter of this function can **optionally** be used to
-specify a particular database group from your config file, or you can
-even submit connection values for a database that is not specified in
-your config file. Examples:
-
-To choose a specific group from your config file you can do this::
-
- $this->load->database('group_name');
-
-Where group_name is the name of the connection group from your config
-file.
-
-To connect manually to a desired database you can pass an array of
-values::
-
- $config['hostname'] = 'localhost';
- $config['username'] = 'myusername';
- $config['password'] = 'mypassword';
- $config['database'] = 'mydatabase';
- $config['dbdriver'] = 'mysqli';
- $config['dbprefix'] = '';
- $config['pconnect'] = FALSE;
- $config['db_debug'] = TRUE;
- $config['cache_on'] = FALSE;
- $config['cachedir'] = '';
- $config['char_set'] = 'utf8';
- $config['dbcollat'] = 'utf8_general_ci';
- $this->load->database($config);
-
-For information on each of these values please see the :doc:`configuration
-page <configuration>`.
-
-.. note:: For the PDO driver, you should use the $config['dsn'] setting
- instead of 'hostname' and 'database':
-
- |
- | $config['dsn'] = 'mysql:host=localhost;dbname=mydatabase';
-
-Or you can submit your database values as a Data Source Name. DSNs must
-have this prototype::
-
- $dsn = 'dbdriver://username:password@hostname/database';
- $this->load->database($dsn);
-
-To override default config values when connecting with a DSN string, add
-the config variables as a query string.
-
-::
-
- $dsn = 'dbdriver://username:password@hostname/database?char_set=utf8&dbcollat=utf8_general_ci&cache_on=true&cachedir=/path/to/cache';
- $this->load->database($dsn);
-
-Connecting to Multiple Databases
-================================
-
-If you need to connect to more than one database simultaneously you can
-do so as follows::
-
- $DB1 = $this->load->database('group_one', TRUE);
- $DB2 = $this->load->database('group_two', TRUE);
-
-Note: Change the words "group_one" and "group_two" to the specific
-group names you are connecting to (or you can pass the connection values
-as indicated above).
-
-By setting the second parameter to TRUE (boolean) the function will
-return the database object.
-
-.. note:: When you connect this way, you will use your object name to issue
- commands rather than the syntax used throughout this guide. In other
- words, rather than issuing commands with:
-
- |
- | $this->db->query();
- | $this->db->result();
- | etc...
- |
- | You will instead use:
- |
- | $DB1->query();
- | $DB1->result();
- | etc...
-
-.. note:: You don't need to create separate database configurations if you
- only need to use a different database on the same connection. You
- can switch to a different database when you need to, like this:
-
- | $this->db->db_select($database2_name);
-
-Reconnecting / Keeping the Connection Alive
-===========================================
-
-If the database server's idle timeout is exceeded while you're doing
-some heavy PHP lifting (processing an image, for instance), you should
-consider pinging the server by using the reconnect() method before
-sending further queries, which can gracefully keep the connection alive
-or re-establish it.
-
-::
-
- $this->db->reconnect();
-
-Manually closing the Connection
-===============================
-
-While CodeIgniter intelligently takes care of closing your database
-connections, you can explicitly close the connection.
-
-::
-
- $this->db->close(); \ No newline at end of file
diff --git a/user_guide_src/source/database/db_driver_reference.rst b/user_guide_src/source/database/db_driver_reference.rst
deleted file mode 100644
index da33662b0..000000000
--- a/user_guide_src/source/database/db_driver_reference.rst
+++ /dev/null
@@ -1,446 +0,0 @@
-###################
-DB Driver Reference
-###################
-
-This is the platform-independent base DB implementation class.
-This class will not be called directly. Rather, the adapter
-class for the specific database will extend and instantiate it.
-
-The how-to material for this has been split over several articles.
-This article is intended to be a reference for them.
-
-.. important:: Not all methods are supported by all database drivers,
- some of them may fail (and return FALSE) if the underlying
- driver does not support them.
-
-.. php:class:: CI_DB_driver
-
- .. php:method:: initialize()
-
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Initialize database settings, establish a connection to
- the database.
-
- .. php:method:: db_connect($persistent = TRUE)
-
- :param bool $persistent: Whether to establish a persistent connection or a regular one
- :returns: Database connection resource/object or FALSE on failure
- :rtype: mixed
-
- Establish a connection with the database.
-
- .. note:: The returned value depends on the underlying
- driver in use. For example, a ``mysqli`` instance
- will be returned with the 'mysqli' driver.
-
- .. php:method:: db_pconnect()
-
- :returns: Database connection resource/object or FALSE on failure
- :rtype: mixed
-
- Establish a persistent connection with the database.
-
- .. note:: This method is just an alias for ``db_connect(TRUE)``.
-
- .. php:method:: reconnect()
-
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Keep / reestablish the database connection if no queries
- have been sent for a length of time exceeding the
- server's idle timeout.
-
- .. php:method:: db_select([$database = ''])
-
- :param string $database: Database name
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Select / switch the current database.
-
- .. php:method:: db_set_charset($charset)
-
- :param string $charset: Character set name
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Set client character set.
-
- .. php:method:: platform()
-
- :returns: Platform name
- :rtype: string
-
- The name of the platform in use (mysql, mssql, etc...).
-
- .. php:method:: version()
-
- :returns: The version of the database being used
- :rtype: string
-
- Database version number.
-
- .. php:method:: query($sql[, $binds = FALSE[, $return_object = NULL]])
-
- :param string $sql: The SQL statement to execute
- :param array $binds: An array of binding data
- :param bool $return_object: Whether to return a result object or not
- :returns: TRUE for successful "write-type" queries, CI_DB_result instance (method chaining) on "query" success, FALSE on failure
- :rtype: mixed
-
- Execute an SQL query.
-
- Accepts an SQL string as input and returns a result object
- upon successful execution of a "read" type query.
-
- Returns:
-
- - Boolean TRUE upon successful execution of a "write type" queries
- - Boolean FALSE upon failure
- - ``CI_DB_result`` object for "read type" queries
-
- .. note: If 'db_debug' setting is set to TRUE, an error
- page will be displayed instead of returning FALSE
- on failures and script execution will stop.
-
- .. php:method:: simple_query($sql)
-
- :param string $sql: The SQL statement to execute
- :returns: Whatever the underlying driver's "query" function returns
- :rtype: mixed
-
- A simplified version of the ``query()`` method, appropriate
- for use when you don't need to get a result object or to
- just send a query to the database and not care for the result.
-
- .. php:method:: affected_rows()
-
- :returns: Number of rows affected
- :rtype: int
-
- Returns the number of rows *changed* by the last executed query.
-
- Useful for checking how much rows were created, updated or deleted
- during the last executed query.
-
- .. php:method:: trans_strict([$mode = TRUE])
-
- :param bool $mode: Strict mode flag
- :rtype: void
-
- Enable/disable transaction "strict" mode.
-
- When strict mode is enabled, if you are running multiple
- groups of transactions and one group fails, all subsequent
- groups will be rolled back.
-
- If strict mode is disabled, each group is treated
- autonomously, meaning a failure of one group will not
- affect any others.
-
- .. php:method:: trans_off()
-
- :rtype: void
-
- Disables transactions at run-time.
-
- .. php:method:: trans_start([$test_mode = FALSE])
-
- :param bool $test_mode: Test mode flag
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Start a transaction.
-
- .. php:method:: trans_complete()
-
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Complete Transaction.
-
- .. php:method:: trans_status()
-
- :returns: TRUE if the transaction succeeded, FALSE if it failed
- :rtype: bool
-
- Lets you retrieve the transaction status flag to
- determine if it has failed.
-
- .. php:method:: trans_active()
-
- :returns: TRUE if a transaction is active, FALSE if not
- :rtype: bool
-
- Determines if a transaction is currently active.
-
- .. php:method:: compile_binds($sql, $binds)
-
- :param string $sql: The SQL statement
- :param array $binds: An array of binding data
- :returns: The updated SQL statement
- :rtype: string
-
- Compiles an SQL query with the bind values passed for it.
-
- .. php:method:: is_write_type($sql)
-
- :param string $sql: The SQL statement
- :returns: TRUE if the SQL statement is of "write type", FALSE if not
- :rtype: bool
-
- Determines if a query is of a "write" type (such as
- INSERT, UPDATE, DELETE) or "read" type (i.e. SELECT).
-
- .. php:method:: elapsed_time([$decimals = 6])
-
- :param int $decimals: The number of decimal places
- :returns: The aggregate query elapsed time, in microseconds
- :rtype: string
-
- Calculate the aggregate query elapsed time.
-
- .. php:method:: total_queries()
-
- :returns: The total number of queries executed
- :rtype: int
-
- Returns the total number of queries that have been
- executed so far.
-
- .. php:method:: last_query()
-
- :returns: The last query executed
- :rtype: string
-
- Returns the last query that was executed.
-
- .. php:method:: escape($str)
-
- :param mixed $str: The value to escape, or an array of multiple ones
- :returns: The escaped value(s)
- :rtype: mixed
-
- Escapes input data based on type, including boolean and
- NULLs.
-
- .. php:method:: escape_str($str[, $like = FALSE])
-
- :param mixed $str: A string value or array of multiple ones
- :param bool $like: Whether or not the string will be used in a LIKE condition
- :returns: The escaped string(s)
- :rtype: mixed
-
- Escapes string values.
-
- .. warning:: The returned strings do NOT include quotes
- around them.
-
- .. php:method:: escape_like_str($str)
-
- :param mixed $str: A string value or array of multiple ones
- :returns: The escaped string(s)
- :rtype: mixed
-
- Escape LIKE strings.
-
- Similar to ``escape_str()``, but will also escape the ``%``
- and ``_`` wildcard characters, so that they don't cause
- false-positives in LIKE conditions.
-
- .. important:: The ``escape_like_str()`` method uses '!' (exclamation mark)
- to escape special characters for *LIKE* conditions. Because this
- method escapes partial strings that you would wrap in quotes
- yourself, it cannot automatically add the ``ESCAPE '!'``
- condition for you, and so you'll have to manually do that.
-
-
- .. php:method:: primary($table)
-
- :param string $table: Table name
- :returns: The primary key name, FALSE if none
- :rtype: string
-
- Retrieves the primary key of a table.
-
- .. note:: If the database platform does not support primary
- key detection, the first column name may be assumed
- as the primary key.
-
- .. php:method:: count_all([$table = ''])
-
- :param string $table: Table name
- :returns: Row count for the specified table
- :rtype: int
-
- Returns the total number of rows in a table, or 0 if no
- table was provided.
-
- .. php:method:: list_tables([$constrain_by_prefix = FALSE])
-
- :param bool $constrain_by_prefix: TRUE to match table names by the configured dbprefix
- :returns: Array of table names or FALSE on failure
- :rtype: array
-
- Gets a list of the tables in the current database.
-
- .. php:method:: table_exists($table_name)
-
- :param string $table_name: The table name
- :returns: TRUE if that table exists, FALSE if not
- :rtype: bool
-
- Determine if a particular table exists.
-
- .. php:method:: list_fields($table)
-
- :param string $table: The table name
- :returns: Array of field names or FALSE on failure
- :rtype: array
-
- Gets a list of the field names in a table.
-
- .. php:method:: field_exists($field_name, $table_name)
-
- :param string $table_name: The table name
- :param string $field_name: The field name
- :returns: TRUE if that field exists in that table, FALSE if not
- :rtype: bool
-
- Determine if a particular field exists.
-
- .. php:method:: field_data($table)
-
- :param string $table: The table name
- :returns: Array of field data items or FALSE on failure
- :rtype: array
-
- Gets a list containing field data about a table.
-
- .. php:method:: escape_identifiers($item)
-
- :param mixed $item: The item or array of items to escape
- :returns: The input item(s), escaped
- :rtype: mixed
-
- Escape SQL identifiers, such as column, table and names.
-
- .. php:method:: insert_string($table, $data)
-
- :param string $table: The target table
- :param array $data: An associative array of key/value pairs
- :returns: The SQL INSERT statement, as a string
- :rtype: string
-
- Generate an INSERT statement string.
-
- .. php:method:: update_string($table, $data, $where)
-
- :param string $table: The target table
- :param array $data: An associative array of key/value pairs
- :param mixed $where: The WHERE statement conditions
- :returns: The SQL UPDATE statement, as a string
- :rtype: string
-
- Generate an UPDATE statement string.
-
- .. php:method:: call_function($function)
-
- :param string $function: Function name
- :returns: The function result
- :rtype: string
-
- Runs a native PHP function , using a platform agnostic
- wrapper.
-
- .. php:method:: cache_set_path([$path = ''])
-
- :param string $path: Path to the cache directory
- :rtype: void
-
- Sets the directory path to use for caching storage.
-
- .. php:method:: cache_on()
-
- :returns: TRUE if caching is on, FALSE if not
- :rtype: bool
-
- Enable database results caching.
-
- .. php:method:: cache_off()
-
- :returns: TRUE if caching is on, FALSE if not
- :rtype: bool
-
- Disable database results caching.
-
- .. php:method:: cache_delete([$segment_one = ''[, $segment_two = '']])
-
- :param string $segment_one: First URI segment
- :param string $segment_two: Second URI segment
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Delete the cache files associated with a particular URI.
-
- .. php:method:: cache_delete_all()
-
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Delete all cache files.
-
- .. php:method:: close()
-
- :rtype: void
-
- Close the DB Connection.
-
- .. php:method:: display_error([$error = ''[, $swap = ''[, $native = FALSE]]])
-
- :param string $error: The error message
- :param string $swap: Any "swap" values
- :param bool $native: Whether to localize the message
- :rtype: void
-
- :returns: Displays the DB error screensends the application/views/errors/error_db.php template
- :rtype: string
-
- Display an error message and stop script execution.
-
- The message is displayed using the
- *application/views/errors/error_db.php* template.
-
- .. php:method:: protect_identifiers($item[, $prefix_single = FALSE[, $protect_identifiers = NULL[, $field_exists = TRUE]]])
-
- :param string $item: The item to work with
- :param bool $prefix_single: Whether to apply the dbprefix even if the input item is a single identifier
- :param bool $protect_identifiers: Whether to quote identifiers
- :param bool $field_exists: Whether the supplied item contains a field name or not
- :returns: The modified item
- :rtype: string
-
- Takes a column or table name (optionally with an alias)
- and applies the configured *dbprefix* to it.
-
- Some logic is necessary in order to deal with
- column names that include the path.
-
- Consider a query like this::
-
- SELECT * FROM hostname.database.table.column AS c FROM hostname.database.table
-
- Or a query with aliasing::
-
- SELECT m.member_id, m.member_name FROM members AS m
-
- Since the column name can include up to four segments
- (host, DB, table, column) or also have an alias prefix,
- we need to do a bit of work to figure this out and
- insert the table prefix (if it exists) in the proper
- position, and escape only the correct identifiers.
-
- This method is used extensively by the Query Builder class.
diff --git a/user_guide_src/source/database/examples.rst b/user_guide_src/source/database/examples.rst
deleted file mode 100644
index 5fd7fccfa..000000000
--- a/user_guide_src/source/database/examples.rst
+++ /dev/null
@@ -1,119 +0,0 @@
-##################################
-Database Quick Start: Example Code
-##################################
-
-The following page contains example code showing how the database class
-is used. For complete details please read the individual pages
-describing each function.
-
-Initializing the Database Class
-===============================
-
-The following code loads and initializes the database class based on
-your :doc:`configuration <configuration>` settings::
-
- $this->load->database();
-
-Once loaded the class is ready to be used as described below.
-
-Note: If all your pages require database access you can connect
-automatically. See the :doc:`connecting <connecting>` page for details.
-
-Standard Query With Multiple Results (Object Version)
-=====================================================
-
-::
-
- $query = $this->db->query('SELECT name, title, email FROM my_table');
-
- foreach ($query->result() as $row)
- {
- echo $row->title;
- echo $row->name;
- echo $row->email;
- }
-
- echo 'Total Results: ' . $query->num_rows();
-
-The above result() function returns an array of **objects**. Example:
-$row->title
-
-Standard Query With Multiple Results (Array Version)
-====================================================
-
-::
-
- $query = $this->db->query('SELECT name, title, email FROM my_table');
-
- foreach ($query->result_array() as $row)
- {
- echo $row['title'];
- echo $row['name'];
- echo $row['email'];
- }
-
-The above result_array() function returns an array of standard array
-indexes. Example: $row['title']
-
-Standard Query With Single Result
-=================================
-
-::
-
- $query = $this->db->query('SELECT name FROM my_table LIMIT 1');
- $row = $query->row();
- echo $row->name;
-
-The above row() function returns an **object**. Example: $row->name
-
-Standard Query With Single Result (Array version)
-=================================================
-
-::
-
- $query = $this->db->query('SELECT name FROM my_table LIMIT 1');
- $row = $query->row_array();
- echo $row['name'];
-
-The above row_array() function returns an **array**. Example:
-$row['name']
-
-Standard Insert
-===============
-
-::
-
- $sql = "INSERT INTO mytable (title, name) VALUES (".$this->db->escape($title).", ".$this->db->escape($name).")";
- $this->db->query($sql);
- echo $this->db->affected_rows();
-
-Query Builder Query
-===================
-
-The :doc:`Query Builder Pattern <query_builder>` gives you a simplified
-means of retrieving data::
-
- $query = $this->db->get('table_name');
-
- foreach ($query->result() as $row)
- {
- echo $row->title;
- }
-
-The above get() function retrieves all the results from the supplied
-table. The :doc:`Query Builder <query_builder>` class contains a full
-compliment of functions for working with data.
-
-Query Builder Insert
-====================
-
-::
-
- $data = array(
- 'title' => $title,
- 'name' => $name,
- 'date' => $date
- );
-
- $this->db->insert('mytable', $data); // Produces: INSERT INTO mytable (title, name, date) VALUES ('{$title}', '{$name}', '{$date}')
-
diff --git a/user_guide_src/source/database/forge.rst b/user_guide_src/source/database/forge.rst
deleted file mode 100644
index c6cacb1b0..000000000
--- a/user_guide_src/source/database/forge.rst
+++ /dev/null
@@ -1,412 +0,0 @@
-####################
-Database Forge Class
-####################
-
-The Database Forge Class contains methods that help you manage your
-database.
-
-.. contents:: Table of Contents
- :depth: 3
-
-****************************
-Initializing the Forge Class
-****************************
-
-.. important:: In order to initialize the Forge class, your database
- driver must already be running, since the forge class relies on it.
-
-Load the Forge Class as follows::
-
- $this->load->dbforge()
-
-You can also pass another database object to the DB Forge loader, in case
-the database you want to manage isn't the default one::
-
- $this->myforge = $this->load->dbforge($this->other_db, TRUE);
-
-In the above example, we're passing a custom database object as the first
-parameter and then tell it to return the dbforge object, instead of
-assigning it directly to ``$this->dbforge``.
-
-.. note:: Both of the parameters can be used individually, just pass an empty
- value as the first one if you wish to skip it.
-
-Once initialized you will access the methods using the ``$this->dbforge``
-object::
-
- $this->dbforge->some_method();
-
-*******************************
-Creating and Dropping Databases
-*******************************
-
-**$this->dbforge->create_database('db_name')**
-
-Permits you to create the database specified in the first parameter.
-Returns TRUE/FALSE based on success or failure::
-
- if ($this->dbforge->create_database('my_db'))
- {
- echo 'Database created!';
- }
-
-**$this->dbforge->drop_database('db_name')**
-
-Permits you to drop the database specified in the first parameter.
-Returns TRUE/FALSE based on success or failure::
-
- if ($this->dbforge->drop_database('my_db'))
- {
- echo 'Database deleted!';
- }
-
-
-****************************
-Creating and Dropping Tables
-****************************
-
-There are several things you may wish to do when creating tables. Add
-fields, add keys to the table, alter columns. CodeIgniter provides a
-mechanism for this.
-
-Adding fields
-=============
-
-Fields are created via an associative array. Within the array you must
-include a 'type' key that relates to the datatype of the field. For
-example, INT, VARCHAR, TEXT, etc. Many datatypes (for example VARCHAR)
-also require a 'constraint' key.
-
-::
-
- $fields = array(
- 'users' => array(
- 'type' => 'VARCHAR',
- 'constraint' => '100',
- ),
- );
- // will translate to "users VARCHAR(100)" when the field is added.
-
-
-Additionally, the following key/values can be used:
-
-- unsigned/true : to generate "UNSIGNED" in the field definition.
-- default/value : to generate a default value in the field definition.
-- null/true : to generate "NULL" in the field definition. Without this,
- the field will default to "NOT NULL".
-- auto_increment/true : generates an auto_increment flag on the
- field. Note that the field type must be a type that supports this,
- such as integer.
-- unique/true : to generate a unique key for the field definition.
-
-::
-
- $fields = array(
- 'blog_id' => array(
- 'type' => 'INT',
- 'constraint' => 5,
- 'unsigned' => TRUE,
- 'auto_increment' => TRUE
- ),
- 'blog_title' => array(
- 'type' => 'VARCHAR',
- 'constraint' => '100',
- 'unique' => TRUE,
- ),
- 'blog_author' => array(
- 'type' =>'VARCHAR',
- 'constraint' => '100',
- 'default' => 'King of Town',
- ),
- 'blog_description' => array(
- 'type' => 'TEXT',
- 'null' => TRUE,
- ),
- );
-
-
-After the fields have been defined, they can be added using
-``$this->dbforge->add_field($fields);`` followed by a call to the
-``create_table()`` method.
-
-**$this->dbforge->add_field()**
-
-The add fields method will accept the above array.
-
-
-Passing strings as fields
--------------------------
-
-If you know exactly how you want a field to be created, you can pass the
-string into the field definitions with add_field()
-
-::
-
- $this->dbforge->add_field("label varchar(100) NOT NULL DEFAULT 'default label'");
-
-
-.. note:: Passing raw strings as fields cannot be followed by ``add_key()`` calls on those fields.
-
-.. note:: Multiple calls to add_field() are cumulative.
-
-Creating an id field
---------------------
-
-There is a special exception for creating id fields. A field with type
-id will automatically be assigned as an INT(9) auto_incrementing
-Primary Key.
-
-::
-
- $this->dbforge->add_field('id');
- // gives id INT(9) NOT NULL AUTO_INCREMENT
-
-
-Adding Keys
-===========
-
-Generally speaking, you'll want your table to have Keys. This is
-accomplished with $this->dbforge->add_key('field'). An optional second
-parameter set to TRUE will make it a primary key. Note that add_key()
-must be followed by a call to create_table().
-
-Multiple column non-primary keys must be sent as an array. Sample output
-below is for MySQL.
-
-::
-
- $this->dbforge->add_key('blog_id', TRUE);
- // gives PRIMARY KEY `blog_id` (`blog_id`)
-
- $this->dbforge->add_key('blog_id', TRUE);
- $this->dbforge->add_key('site_id', TRUE);
- // gives PRIMARY KEY `blog_id_site_id` (`blog_id`, `site_id`)
-
- $this->dbforge->add_key('blog_name');
- // gives KEY `blog_name` (`blog_name`)
-
- $this->dbforge->add_key(array('blog_name', 'blog_label'));
- // gives KEY `blog_name_blog_label` (`blog_name`, `blog_label`)
-
-
-Creating a table
-================
-
-After fields and keys have been declared, you can create a new table
-with
-
-::
-
- $this->dbforge->create_table('table_name');
- // gives CREATE TABLE table_name
-
-
-An optional second parameter set to TRUE adds an "IF NOT EXISTS" clause
-into the definition
-
-::
-
- $this->dbforge->create_table('table_name', TRUE);
- // gives CREATE TABLE IF NOT EXISTS table_name
-
-You could also pass optional table attributes, such as MySQL's ``ENGINE``::
-
- $attributes = array('ENGINE' => 'InnoDB');
- $this->dbforge->create_table('table_name', FALSE, $attributes);
- // produces: CREATE TABLE `table_name` (...) ENGINE = InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci
-
-.. note:: Unless you specify the ``CHARACTER SET`` and/or ``COLLATE`` attributes,
- ``create_table()`` will always add them with your configured *char_set*
- and *dbcollat* values, as long as they are not empty (MySQL only).
-
-
-Dropping a table
-================
-
-Execute a DROP TABLE statement and optionally add an IF EXISTS clause.
-
-::
-
- // Produces: DROP TABLE table_name
- $this->dbforge->drop_table('table_name');
-
- // Produces: DROP TABLE IF EXISTS table_name
- $this->dbforge->drop_table('table_name',TRUE);
-
-
-Renaming a table
-================
-
-Executes a TABLE rename
-
-::
-
- $this->dbforge->rename_table('old_table_name', 'new_table_name');
- // gives ALTER TABLE old_table_name RENAME TO new_table_name
-
-
-****************
-Modifying Tables
-****************
-
-Adding a Column to a Table
-==========================
-
-**$this->dbforge->add_column()**
-
-The ``add_column()`` method is used to modify an existing table. It
-accepts the same field array as above, and can be used for an unlimited
-number of additional fields.
-
-::
-
- $fields = array(
- 'preferences' => array('type' => 'TEXT')
- );
- $this->dbforge->add_column('table_name', $fields);
- // Executes: ALTER TABLE table_name ADD preferences TEXT
-
-If you are using MySQL or CUBIRD, then you can take advantage of their
-AFTER and FIRST clauses to position the new column.
-
-Examples::
-
- // Will place the new column after the `another_field` column:
- $fields = array(
- 'preferences' => array('type' => 'TEXT', 'after' => 'another_field')
- );
-
- // Will place the new column at the start of the table definition:
- $fields = array(
- 'preferences' => array('type' => 'TEXT', 'first' => TRUE)
- );
-
-
-Dropping a Column From a Table
-==============================
-
-**$this->dbforge->drop_column()**
-
-Used to remove a column from a table.
-
-::
-
- $this->dbforge->drop_column('table_name', 'column_to_drop');
-
-
-
-Modifying a Column in a Table
-=============================
-
-**$this->dbforge->modify_column()**
-
-The usage of this method is identical to ``add_column()``, except it
-alters an existing column rather than adding a new one. In order to
-change the name you can add a "name" key into the field defining array.
-
-::
-
- $fields = array(
- 'old_name' => array(
- 'name' => 'new_name',
- 'type' => 'TEXT',
- ),
- );
- $this->dbforge->modify_column('table_name', $fields);
- // gives ALTER TABLE table_name CHANGE old_name new_name TEXT
-
-
-***************
-Class Reference
-***************
-
-.. php:class:: CI_DB_forge
-
- .. php:method:: add_column($table[, $field = array()[, $_after = NULL]])
-
- :param string $table: Table name to add the column to
- :param array $field: Column definition(s)
- :param string $_after: Column for AFTER clause (deprecated)
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Adds a column to a table. Usage: See `Adding a Column to a Table`_.
-
- .. php:method:: add_field($field)
-
- :param array $field: Field definition to add
- :returns: CI_DB_forge instance (method chaining)
- :rtype: CI_DB_forge
-
- Adds a field to the set that will be used to create a table. Usage: See `Adding fields`_.
-
- .. php:method:: add_key($key[, $primary = FALSE])
-
- :param array $key: Name of a key field
- :param bool $primary: Set to TRUE if it should be a primary key or a regular one
- :returns: CI_DB_forge instance (method chaining)
- :rtype: CI_DB_forge
-
- Adds a key to the set that will be used to create a table. Usage: See `Adding Keys`_.
-
- .. php:method:: create_database($db_name)
-
- :param string $db_name: Name of the database to create
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Creates a new database. Usage: See `Creating and Dropping Databases`_.
-
- .. php:method:: create_table($table[, $if_not_exists = FALSE[, array $attributes = array()]])
-
- :param string $table: Name of the table to create
- :param string $if_not_exists: Set to TRUE to add an 'IF NOT EXISTS' clause
- :param string $attributes: An associative array of table attributes
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Creates a new table. Usage: See `Creating a table`_.
-
- .. php:method:: drop_column($table, $column_name)
-
- :param string $table: Table name
- :param string $column_name: The column name to drop
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Drops a column from a table. Usage: See `Dropping a Column From a Table`_.
-
- .. php:method:: drop_database($db_name)
-
- :param string $db_name: Name of the database to drop
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Drops a database. Usage: See `Creating and Dropping Databases`_.
-
- .. php:method:: drop_table($table_name[, $if_exists = FALSE])
-
- :param string $table: Name of the table to drop
- :param string $if_exists: Set to TRUE to add an 'IF EXISTS' clause
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Drops a table. Usage: See `Dropping a table`_.
-
- .. php:method:: modify_column($table, $field)
-
- :param string $table: Table name
- :param array $field: Column definition(s)
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Modifies a table column. Usage: See `Modifying a Column in a Table`_.
-
- .. php:method:: rename_table($table_name, $new_table_name)
-
- :param string $table: Current of the table
- :param string $new_table_name: New name of the table
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Renames a table. Usage: See `Renaming a table`_.
diff --git a/user_guide_src/source/database/helpers.rst b/user_guide_src/source/database/helpers.rst
deleted file mode 100644
index 2d997a9e0..000000000
--- a/user_guide_src/source/database/helpers.rst
+++ /dev/null
@@ -1,100 +0,0 @@
-####################
-Query Helper Methods
-####################
-
-Information From Executing a Query
-==================================
-
-**$this->db->insert_id()**
-
-The insert ID number when performing database inserts.
-
-.. note:: If using the PDO driver with PostgreSQL, or using the Interbase
- driver, this function requires a $name parameter, which specifies the
- appropriate sequence to check for the insert id.
-
-**$this->db->affected_rows()**
-
-Displays the number of affected rows, when doing "write" type queries
-(insert, update, etc.).
-
-.. note:: In MySQL "DELETE FROM TABLE" returns 0 affected rows. The database
- class has a small hack that allows it to return the correct number of
- affected rows. By default this hack is enabled but it can be turned off
- in the database driver file.
-
-**$this->db->last_query()**
-
-Returns the last query that was run (the query string, not the result).
-Example::
-
- $str = $this->db->last_query();
-
- // Produces: SELECT * FROM sometable....
-
-
-.. note:: Disabling the **save_queries** setting in your database
- configuration will render this function useless.
-
-Information About Your Database
-===============================
-
-**$this->db->count_all()**
-
-Permits you to determine the number of rows in a particular table.
-Submit the table name in the first parameter. Example::
-
- echo $this->db->count_all('my_table');
-
- // Produces an integer, like 25
-
-**$this->db->platform()**
-
-Outputs the database platform you are running (MySQL, MS SQL, Postgres,
-etc...)::
-
- echo $this->db->platform();
-
-**$this->db->version()**
-
-Outputs the database version you are running::
-
- echo $this->db->version();
-
-Making Your Queries Easier
-==========================
-
-**$this->db->insert_string()**
-
-This function simplifies the process of writing database inserts. It
-returns a correctly formatted SQL insert string. Example::
-
- $data = array('name' => $name, 'email' => $email, 'url' => $url);
-
- $str = $this->db->insert_string('table_name', $data);
-
-The first parameter is the table name, the second is an associative
-array with the data to be inserted. The above example produces::
-
- INSERT INTO table_name (name, email, url) VALUES ('Rick', 'rick@example.com', 'example.com')
-
-.. note:: Values are automatically escaped, producing safer queries.
-
-**$this->db->update_string()**
-
-This function simplifies the process of writing database updates. It
-returns a correctly formatted SQL update string. Example::
-
- $data = array('name' => $name, 'email' => $email, 'url' => $url);
-
- $where = "author_id = 1 AND status = 'active'";
-
- $str = $this->db->update_string('table_name', $data, $where);
-
-The first parameter is the table name, the second is an associative
-array with the data to be updated, and the third parameter is the
-"where" clause. The above example produces::
-
- UPDATE table_name SET name = 'Rick', email = 'rick@example.com', url = 'example.com' WHERE author_id = 1 AND status = 'active'
-
-.. note:: Values are automatically escaped, producing safer queries. \ No newline at end of file
diff --git a/user_guide_src/source/database/index.rst b/user_guide_src/source/database/index.rst
deleted file mode 100644
index 2fb50f9be..000000000
--- a/user_guide_src/source/database/index.rst
+++ /dev/null
@@ -1,25 +0,0 @@
-##################
-Database Reference
-##################
-
-CodeIgniter comes with a full-featured and very fast abstracted database
-class that supports both traditional structures and Query Builder
-patterns. The database functions offer clear, simple syntax.
-
-.. toctree::
- :titlesonly:
-
- Quick Start: Usage Examples <examples>
- Database Configuration <configuration>
- Connecting to a Database <connecting>
- Running Queries <queries>
- Generating Query Results <results>
- Query Helper Functions <helpers>
- Query Builder Class <query_builder>
- Transactions <transactions>
- Getting MetaData <metadata>
- Custom Function Calls <call_function>
- Query Caching <caching>
- Database Manipulation with Database Forge <forge>
- Database Utilities Class <utilities>
- Database Driver Reference <db_driver_reference> \ No newline at end of file
diff --git a/user_guide_src/source/database/metadata.rst b/user_guide_src/source/database/metadata.rst
deleted file mode 100644
index b8be809b6..000000000
--- a/user_guide_src/source/database/metadata.rst
+++ /dev/null
@@ -1,130 +0,0 @@
-#################
-Database Metadata
-#################
-
-**************
-Table MetaData
-**************
-
-These functions let you fetch table information.
-
-List the Tables in Your Database
-================================
-
-**$this->db->list_tables();**
-
-Returns an array containing the names of all the tables in the database
-you are currently connected to. Example::
-
- $tables = $this->db->list_tables();
-
- foreach ($tables as $table)
- {
- echo $table;
- }
-
-
-Determine If a Table Exists
-===========================
-
-**$this->db->table_exists();**
-
-Sometimes it's helpful to know whether a particular table exists before
-running an operation on it. Returns a boolean TRUE/FALSE. Usage example::
-
- if ($this->db->table_exists('table_name'))
- {
- // some code...
- }
-
-.. note:: Replace *table_name* with the name of the table you are looking for.
-
-
-**************
-Field MetaData
-**************
-
-List the Fields in a Table
-==========================
-
-**$this->db->list_fields()**
-
-Returns an array containing the field names. This query can be called
-two ways:
-
-1. You can supply the table name and call it from the $this->db->
-object::
-
- $fields = $this->db->list_fields('table_name');
-
- foreach ($fields as $field)
- {
- echo $field;
- }
-
-2. You can gather the field names associated with any query you run by
-calling the function from your query result object::
-
- $query = $this->db->query('SELECT * FROM some_table');
-
- foreach ($query->list_fields() as $field)
- {
- echo $field;
- }
-
-
-Determine If a Field is Present in a Table
-==========================================
-
-**$this->db->field_exists()**
-
-Sometimes it's helpful to know whether a particular field exists before
-performing an action. Returns a boolean TRUE/FALSE. Usage example::
-
- if ($this->db->field_exists('field_name', 'table_name'))
- {
- // some code...
- }
-
-.. note:: Replace *field_name* with the name of the column you are looking
- for, and replace *table_name* with the name of the table you are
- looking for.
-
-
-Retrieve Field Metadata
-=======================
-
-**$this->db->field_data()**
-
-Returns an array of objects containing field information.
-
-Sometimes it's helpful to gather the field names or other metadata, like
-the column type, max length, etc.
-
-.. note:: Not all databases provide meta-data.
-
-Usage example::
-
- $fields = $this->db->field_data('table_name');
-
- foreach ($fields as $field)
- {
- echo $field->name;
- echo $field->type;
- echo $field->max_length;
- echo $field->primary_key;
- }
-
-If you have run a query already you can use the result object instead of
-supplying the table name::
-
- $query = $this->db->query("YOUR QUERY");
- $fields = $query->field_data();
-
-The following data is available from this function if supported by your
-database:
-
-- name - column name
-- max_length - maximum length of the column
-- primary_key - 1 if the column is a primary key
-- type - the type of the column
diff --git a/user_guide_src/source/database/queries.rst b/user_guide_src/source/database/queries.rst
deleted file mode 100644
index 710ababb0..000000000
--- a/user_guide_src/source/database/queries.rst
+++ /dev/null
@@ -1,176 +0,0 @@
-#######
-Queries
-#######
-
-************
-Query Basics
-************
-
-Regular Queries
-===============
-
-To submit a query, use the **query** function::
-
- $this->db->query('YOUR QUERY HERE');
-
-The query() function returns a database result **object** when "read"
-type queries are run, which you can use to :doc:`show your
-results <results>`. When "write" type queries are run it simply
-returns TRUE or FALSE depending on success or failure. When retrieving
-data you will typically assign the query to your own variable, like
-this::
-
- $query = $this->db->query('YOUR QUERY HERE');
-
-Simplified Queries
-==================
-
-The **simple_query** method is a simplified version of the
-$this->db->query() method. It DOES
-NOT return a database result set, nor does it set the query timer, or
-compile bind data, or store your query for debugging. It simply lets you
-submit a query. Most users will rarely use this function.
-
-It returns whatever the database drivers' "execute" function returns.
-That typically is TRUE/FALSE on success or failure for write type queries
-such as INSERT, DELETE or UPDATE statements (which is what it really
-should be used for) and a resource/object on success for queries with
-fetchable results.
-
-::
-
- if ($this->db->simple_query('YOUR QUERY'))
- {
- echo "Success!";
- }
- else
- {
- echo "Query failed!";
- }
-
-.. note:: PostgreSQL's ``pg_exec()`` function (for example) always
- returns a resource on success, even for write type queries.
- So take that in mind if you're looking for a boolean value.
-
-***************************************
-Working with Database prefixes manually
-***************************************
-
-If you have configured a database prefix and would like to prepend it to
-a table name for use in a native SQL query for example, then you can use
-the following::
-
- $this->db->dbprefix('tablename'); // outputs prefix_tablename
-
-
-If for any reason you would like to change the prefix programatically
-without needing to create a new connection, you can use this method::
-
- $this->db->set_dbprefix('newprefix_');
- $this->db->dbprefix('tablename'); // outputs newprefix_tablename
-
-
-**********************
-Protecting identifiers
-**********************
-
-In many databases it is advisable to protect table and field names - for
-example with backticks in MySQL. **Query Builder queries are
-automatically protected**, however if you need to manually protect an
-identifier you can use::
-
- $this->db->protect_identifiers('table_name');
-
-.. important:: Although the Query Builder will try its best to properly
- quote any field and table names that you feed it, note that it
- is NOT designed to work with arbitrary user input. DO NOT feed it
- with unsanitized user data.
-
-This function will also add a table prefix to your table, assuming you
-have a prefix specified in your database config file. To enable the
-prefixing set TRUE (boolean) via the second parameter::
-
- $this->db->protect_identifiers('table_name', TRUE);
-
-
-****************
-Escaping Queries
-****************
-
-It's a very good security practice to escape your data before submitting
-it into your database. CodeIgniter has three methods that help you do
-this:
-
-#. **$this->db->escape()** This function determines the data type so
- that it can escape only string data. It also automatically adds
- single quotes around the data so you don't have to:
- ::
-
- $sql = "INSERT INTO table (title) VALUES(".$this->db->escape($title).")";
-
-#. **$this->db->escape_str()** This function escapes the data passed to
- it, regardless of type. Most of the time you'll use the above
- function rather than this one. Use the function like this:
- ::
-
- $sql = "INSERT INTO table (title) VALUES('".$this->db->escape_str($title)."')";
-
-#. **$this->db->escape_like_str()** This method should be used when
- strings are to be used in LIKE conditions so that LIKE wildcards
- ('%', '\_') in the string are also properly escaped.
-
-::
-
- $search = '20% raise';
- $sql = "SELECT id FROM table WHERE column LIKE '%" .
- $this->db->escape_like_str($search)."%' ESCAPE '!'";
-
-.. important:: The ``escape_like_str()`` method uses '!' (exclamation mark)
- to escape special characters for *LIKE* conditions. Because this
- method escapes partial strings that you would wrap in quotes
- yourself, it cannot automatically add the ``ESCAPE '!'``
- condition for you, and so you'll have to manually do that.
-
-
-**************
-Query Bindings
-**************
-
-Bindings enable you to simplify your query syntax by letting the system
-put the queries together for you. Consider the following example::
-
- $sql = "SELECT * FROM some_table WHERE id = ? AND status = ? AND author = ?";
- $this->db->query($sql, array(3, 'live', 'Rick'));
-
-The question marks in the query are automatically replaced with the
-values in the array in the second parameter of the query function.
-
-Binding also work with arrays, which will be transformed to IN sets::
-
- $sql = "SELECT * FROM some_table WHERE id IN ? AND status = ? AND author = ?";
- $this->db->query($sql, array(array(3, 6), 'live', 'Rick'));
-
-The resulting query will be::
-
- SELECT * FROM some_table WHERE id IN (3,6) AND status = 'live' AND author = 'Rick'
-
-The secondary benefit of using binds is that the values are
-automatically escaped, producing safer queries. You don't have to
-remember to manually escape data; the engine does it automatically for
-you.
-
-***************
-Handling Errors
-***************
-
-**$this->db->error();**
-
-If you need to get the last error that has occurred, the error() method
-will return an array containing its code and message. Here's a quick
-example::
-
- if ( ! $this->db->simple_query('SELECT `example_field` FROM `example_table`'))
- {
- $error = $this->db->error(); // Has keys 'code' and 'message'
- }
-
diff --git a/user_guide_src/source/database/query_builder.rst b/user_guide_src/source/database/query_builder.rst
deleted file mode 100644
index 83721c8b5..000000000
--- a/user_guide_src/source/database/query_builder.rst
+++ /dev/null
@@ -1,1571 +0,0 @@
-###################
-Query Builder Class
-###################
-
-CodeIgniter gives you access to a Query Builder class. This pattern
-allows information to be retrieved, inserted, and updated in your
-database with minimal scripting. In some cases only one or two lines
-of code are necessary to perform a database action.
-CodeIgniter does not require that each database table be its own class
-file. It instead provides a more simplified interface.
-
-Beyond simplicity, a major benefit to using the Query Builder features
-is that it allows you to create database independent applications, since
-the query syntax is generated by each database adapter. It also allows
-for safer queries, since the values are escaped automatically by the
-system.
-
-.. note:: If you intend to write your own queries you can disable this
- class in your database config file, allowing the core database library
- and adapter to utilize fewer resources.
-
-.. contents::
- :local:
- :depth: 1
-
-**************
-Selecting Data
-**************
-
-The following functions allow you to build SQL **SELECT** statements.
-
-**$this->db->get()**
-
-Runs the selection query and returns the result. Can be used by itself
-to retrieve all records from a table::
-
- $query = $this->db->get('mytable'); // Produces: SELECT * FROM mytable
-
-The second and third parameters enable you to set a limit and offset
-clause::
-
- $query = $this->db->get('mytable', 10, 20);
-
- // Executes: SELECT * FROM mytable LIMIT 20, 10
- // (in MySQL. Other databases have slightly different syntax)
-
-You'll notice that the above function is assigned to a variable named
-$query, which can be used to show the results::
-
- $query = $this->db->get('mytable');
-
- foreach ($query->result() as $row)
- {
- echo $row->title;
- }
-
-Please visit the :doc:`result functions <results>` page for a full
-discussion regarding result generation.
-
-**$this->db->get_compiled_select()**
-
-Compiles the selection query just like **$this->db->get()** but does not *run*
-the query. This method simply returns the SQL query as a string.
-
-Example::
-
- $sql = $this->db->get_compiled_select('mytable');
- echo $sql;
-
- // Prints string: SELECT * FROM mytable
-
-The second parameter enables you to set whether or not the query builder query
-will be reset (by default it will be reset, just like when using `$this->db->get()`)::
-
- echo $this->db->limit(10,20)->get_compiled_select('mytable', FALSE);
-
- // Prints string: SELECT * FROM mytable LIMIT 20, 10
- // (in MySQL. Other databases have slightly different syntax)
-
- echo $this->db->select('title, content, date')->get_compiled_select();
-
- // Prints string: SELECT title, content, date FROM mytable LIMIT 20, 10
-
-The key thing to notice in the above example is that the second query did not
-utilize **$this->db->from()** and did not pass a table name into the first
-parameter. The reason for this outcome is because the query has not been
-executed using **$this->db->get()** which resets values or reset directly
-using **$this->db->reset_query()**.
-
-**$this->db->get_where()**
-
-Identical to the above function except that it permits you to add a
-"where" clause in the second parameter, instead of using the db->where()
-function::
-
- $query = $this->db->get_where('mytable', array('id' => $id), $limit, $offset);
-
-Please read the about the where function below for more information.
-
-.. note:: get_where() was formerly known as getwhere(), which has been removed
-
-**$this->db->select()**
-
-Permits you to write the SELECT portion of your query::
-
- $this->db->select('title, content, date');
- $query = $this->db->get('mytable');
-
- // Executes: SELECT title, content, date FROM mytable
-
-.. note:: If you are selecting all (\*) from a table you do not need to
- use this function. When omitted, CodeIgniter assumes that you wish
- to select all fields and automatically adds 'SELECT \*'.
-
-``$this->db->select()`` accepts an optional second parameter. If you set it
-to FALSE, CodeIgniter will not try to protect your field or table names.
-This is useful if you need a compound select statement where automatic
-escaping of fields may break them.
-
-::
-
- $this->db->select('(SELECT SUM(payments.amount) FROM payments WHERE payments.invoice_id=4) AS amount_paid', FALSE);
- $query = $this->db->get('mytable');
-
-**$this->db->select_max()**
-
-Writes a ``SELECT MAX(field)`` portion for your query. You can optionally
-include a second parameter to rename the resulting field.
-
-::
-
- $this->db->select_max('age');
- $query = $this->db->get('members'); // Produces: SELECT MAX(age) as age FROM members
-
- $this->db->select_max('age', 'member_age');
- $query = $this->db->get('members'); // Produces: SELECT MAX(age) as member_age FROM members
-
-
-**$this->db->select_min()**
-
-Writes a "SELECT MIN(field)" portion for your query. As with
-select_max(), You can optionally include a second parameter to rename
-the resulting field.
-
-::
-
- $this->db->select_min('age');
- $query = $this->db->get('members'); // Produces: SELECT MIN(age) as age FROM members
-
-
-**$this->db->select_avg()**
-
-Writes a "SELECT AVG(field)" portion for your query. As with
-select_max(), You can optionally include a second parameter to rename
-the resulting field.
-
-::
-
- $this->db->select_avg('age');
- $query = $this->db->get('members'); // Produces: SELECT AVG(age) as age FROM members
-
-
-**$this->db->select_sum()**
-
-Writes a "SELECT SUM(field)" portion for your query. As with
-select_max(), You can optionally include a second parameter to rename
-the resulting field.
-
-::
-
- $this->db->select_sum('age');
- $query = $this->db->get('members'); // Produces: SELECT SUM(age) as age FROM members
-
-**$this->db->from()**
-
-Permits you to write the FROM portion of your query::
-
- $this->db->select('title, content, date');
- $this->db->from('mytable');
- $query = $this->db->get(); // Produces: SELECT title, content, date FROM mytable
-
-.. note:: As shown earlier, the FROM portion of your query can be specified
- in the $this->db->get() function, so use whichever method you prefer.
-
-**$this->db->join()**
-
-Permits you to write the JOIN portion of your query::
-
- $this->db->select('*');
- $this->db->from('blogs');
- $this->db->join('comments', 'comments.id = blogs.id');
- $query = $this->db->get();
-
- // Produces:
- // SELECT * FROM blogs JOIN comments ON comments.id = blogs.id
-
-Multiple function calls can be made if you need several joins in one
-query.
-
-If you need a specific type of JOIN you can specify it via the third
-parameter of the function. Options are: left, right, outer, inner, left
-outer, right outer and full outer.
-
-::
-
- $this->db->join('comments', 'comments.id = blogs.id', 'left');
- // Produces: LEFT JOIN comments ON comments.id = blogs.id
-
-*************************
-Looking for Specific Data
-*************************
-
-**$this->db->where()**
-
-This function enables you to set **WHERE** clauses using one of four
-methods:
-
-.. note:: All values passed to this function are escaped automatically,
- producing safer queries.
-
-#. **Simple key/value method:**
-
- ::
-
- $this->db->where('name', $name); // Produces: WHERE name = 'Joe'
-
- Notice that the equal sign is added for you.
-
- If you use multiple function calls they will be chained together with
- AND between them:
-
- ::
-
- $this->db->where('name', $name);
- $this->db->where('title', $title);
- $this->db->where('status', $status);
- // WHERE name = 'Joe' AND title = 'boss' AND status = 'active'
-
-#. **Custom key/value method:**
-
- You can include an operator in the first parameter in order to
- control the comparison:
-
- ::
-
- $this->db->where('name !=', $name);
- $this->db->where('id <', $id); // Produces: WHERE name != 'Joe' AND id < 45
-
-#. **Associative array method:**
-
- ::
-
- $array = array('name' => $name, 'title' => $title, 'status' => $status);
- $this->db->where($array);
- // Produces: WHERE name = 'Joe' AND title = 'boss' AND status = 'active'
-
- You can include your own operators using this method as well:
-
- ::
-
- $array = array('name !=' => $name, 'id <' => $id, 'date >' => $date);
- $this->db->where($array);
-
-#. **Custom string:**
- You can write your own clauses manually::
-
- $where = "name='Joe' AND status='boss' OR status='active'";
- $this->db->where($where);
-
-
-``$this->db->where()`` accepts an optional third parameter. If you set it to
-FALSE, CodeIgniter will not try to protect your field or table names.
-
-::
-
- $this->db->where('MATCH (field) AGAINST ("value")', NULL, FALSE);
-
-**$this->db->or_where()**
-
-This function is identical to the one above, except that multiple
-instances are joined by OR::
-
- $this->db->where('name !=', $name);
- $this->db->or_where('id >', $id); // Produces: WHERE name != 'Joe' OR id > 50
-
-.. note:: or_where() was formerly known as orwhere(), which has been
- removed.
-
-**$this->db->where_in()**
-
-Generates a WHERE field IN ('item', 'item') SQL query joined with AND if
-appropriate
-
-::
-
- $names = array('Frank', 'Todd', 'James');
- $this->db->where_in('username', $names);
- // Produces: WHERE username IN ('Frank', 'Todd', 'James')
-
-
-**$this->db->or_where_in()**
-
-Generates a WHERE field IN ('item', 'item') SQL query joined with OR if
-appropriate
-
-::
-
- $names = array('Frank', 'Todd', 'James');
- $this->db->or_where_in('username', $names);
- // Produces: OR username IN ('Frank', 'Todd', 'James')
-
-**$this->db->where_not_in()**
-
-Generates a WHERE field NOT IN ('item', 'item') SQL query joined with
-AND if appropriate
-
-::
-
- $names = array('Frank', 'Todd', 'James');
- $this->db->where_not_in('username', $names);
- // Produces: WHERE username NOT IN ('Frank', 'Todd', 'James')
-
-
-**$this->db->or_where_not_in()**
-
-Generates a WHERE field NOT IN ('item', 'item') SQL query joined with OR
-if appropriate
-
-::
-
- $names = array('Frank', 'Todd', 'James');
- $this->db->or_where_not_in('username', $names);
- // Produces: OR username NOT IN ('Frank', 'Todd', 'James')
-
-************************
-Looking for Similar Data
-************************
-
-**$this->db->like()**
-
-This method enables you to generate **LIKE** clauses, useful for doing
-searches.
-
-.. note:: All values passed to this method are escaped automatically.
-
-#. **Simple key/value method:**
-
- ::
-
- $this->db->like('title', 'match');
- // Produces: WHERE `title` LIKE '%match%' ESCAPE '!'
-
- If you use multiple method calls they will be chained together with
- AND between them::
-
- $this->db->like('title', 'match');
- $this->db->like('body', 'match');
- // WHERE `title` LIKE '%match%' ESCAPE '!' AND `body` LIKE '%match% ESCAPE '!'
-
- If you want to control where the wildcard (%) is placed, you can use
- an optional third argument. Your options are 'before', 'after', 'none' and
- 'both' (which is the default).
-
- ::
-
- $this->db->like('title', 'match', 'before'); // Produces: WHERE `title` LIKE '%match' ESCAPE '!'
- $this->db->like('title', 'match', 'after'); // Produces: WHERE `title` LIKE 'match%' ESCAPE '!'
- $this->db->like('title', 'match', 'none'); // Produces: WHERE `title` LIKE 'match' ESCAPE '!'
- $this->db->like('title', 'match', 'both'); // Produces: WHERE `title` LIKE '%match%' ESCAPE '!'
-
-#. **Associative array method:**
-
- ::
-
- $array = array('title' => $match, 'page1' => $match, 'page2' => $match);
- $this->db->like($array);
- // WHERE `title` LIKE '%match%' ESCAPE '!' AND `page1` LIKE '%match%' ESCAPE '!' AND `page2` LIKE '%match%' ESCAPE '!'
-
-
-**$this->db->or_like()**
-
-This method is identical to the one above, except that multiple
-instances are joined by OR::
-
- $this->db->like('title', 'match'); $this->db->or_like('body', $match);
- // WHERE `title` LIKE '%match%' ESCAPE '!' OR `body` LIKE '%match%' ESCAPE '!'
-
-.. note:: ``or_like()`` was formerly known as ``orlike()``, which has been removed.
-
-**$this->db->not_like()**
-
-This method is identical to ``like()``, except that it generates
-NOT LIKE statements::
-
- $this->db->not_like('title', 'match'); // WHERE `title` NOT LIKE '%match% ESCAPE '!'
-
-**$this->db->or_not_like()**
-
-This method is identical to ``not_like()``, except that multiple
-instances are joined by OR::
-
- $this->db->like('title', 'match');
- $this->db->or_not_like('body', 'match');
- // WHERE `title` LIKE '%match% OR `body` NOT LIKE '%match%' ESCAPE '!'
-
-**$this->db->group_by()**
-
-Permits you to write the GROUP BY portion of your query::
-
- $this->db->group_by("title"); // Produces: GROUP BY title
-
-You can also pass an array of multiple values as well::
-
- $this->db->group_by(array("title", "date")); // Produces: GROUP BY title, date
-
-.. note:: group_by() was formerly known as groupby(), which has been
- removed.
-
-**$this->db->distinct()**
-
-Adds the "DISTINCT" keyword to a query
-
-::
-
- $this->db->distinct();
- $this->db->get('table'); // Produces: SELECT DISTINCT * FROM table
-
-**$this->db->having()**
-
-Permits you to write the HAVING portion of your query. There are 2
-possible syntaxes, 1 argument or 2::
-
- $this->db->having('user_id = 45'); // Produces: HAVING user_id = 45
- $this->db->having('user_id', 45); // Produces: HAVING user_id = 45
-
-You can also pass an array of multiple values as well::
-
- $this->db->having(array('title =' => 'My Title', 'id <' => $id));
- // Produces: HAVING title = 'My Title', id < 45
-
-
-If you are using a database that CodeIgniter escapes queries for, you
-can prevent escaping content by passing an optional third argument, and
-setting it to FALSE.
-
-::
-
- $this->db->having('user_id', 45); // Produces: HAVING `user_id` = 45 in some databases such as MySQL
- $this->db->having('user_id', 45, FALSE); // Produces: HAVING user_id = 45
-
-
-**$this->db->or_having()**
-
-Identical to having(), only separates multiple clauses with "OR".
-
-****************
-Ordering results
-****************
-
-**$this->db->order_by()**
-
-Lets you set an ORDER BY clause.
-
-The first parameter contains the name of the column you would like to order by.
-
-The second parameter lets you set the direction of the result.
-Options are **ASC**, **DESC** AND **RANDOM**.
-
-::
-
- $this->db->order_by('title', 'DESC');
- // Produces: ORDER BY `title` DESC
-
-You can also pass your own string in the first parameter::
-
- $this->db->order_by('title DESC, name ASC');
- // Produces: ORDER BY `title` DESC, `name` ASC
-
-Or multiple function calls can be made if you need multiple fields.
-
-::
-
- $this->db->order_by('title', 'DESC');
- $this->db->order_by('name', 'ASC');
- // Produces: ORDER BY `title` DESC, `name` ASC
-
-If you choose the **RANDOM** direction option, then the first parameters will
-be ignored, unless you specify a numeric seed value.
-
-::
-
- $this->db->order_by('title', 'RANDOM');
- // Produces: ORDER BY RAND()
-
- $this->db->order_by(42, 'RANDOM');
- // Produces: ORDER BY RAND(42)
-
-.. note:: order_by() was formerly known as orderby(), which has been
- removed.
-
-.. note:: Random ordering is not currently supported in Oracle and
- will default to ASC instead.
-
-****************************
-Limiting or Counting Results
-****************************
-
-**$this->db->limit()**
-
-Lets you limit the number of rows you would like returned by the query::
-
- $this->db->limit(10); // Produces: LIMIT 10
-
-The second parameter lets you set a result offset.
-
-::
-
- $this->db->limit(10, 20); // Produces: LIMIT 20, 10 (in MySQL. Other databases have slightly different syntax)
-
-**$this->db->count_all_results()**
-
-Permits you to determine the number of rows in a particular Active
-Record query. Queries will accept Query Builder restrictors such as
-``where()``, ``or_where()``, ``like()``, ``or_like()``, etc. Example::
-
- echo $this->db->count_all_results('my_table'); // Produces an integer, like 25
- $this->db->like('title', 'match');
- $this->db->from('my_table');
- echo $this->db->count_all_results(); // Produces an integer, like 17
-
-However, this method also resets any field values that you may have passed
-to ``select()``. If you need to keep them, you can pass ``FALSE`` as the
-second parameter::
-
- echo $this->db->count_all_results('my_table', FALSE);
-
-**$this->db->count_all()**
-
-Permits you to determine the number of rows in a particular table.
-Submit the table name in the first parameter. Example::
-
- echo $this->db->count_all('my_table'); // Produces an integer, like 25
-
-**************
-Query grouping
-**************
-
-Query grouping allows you to create groups of WHERE clauses by enclosing them in parentheses. This will allow
-you to create queries with complex WHERE clauses. Nested groups are supported. Example::
-
- $this->db->select('*')->from('my_table')
- ->group_start()
- ->where('a', 'a')
- ->or_group_start()
- ->where('b', 'b')
- ->where('c', 'c')
- ->group_end()
- ->group_end()
- ->where('d', 'd')
- ->get();
-
- // Generates:
- // SELECT * FROM (`my_table`) WHERE ( `a` = 'a' OR ( `b` = 'b' AND `c` = 'c' ) ) AND `d` = 'd'
-
-.. note:: groups need to be balanced, make sure every group_start() is matched by a group_end().
-
-**$this->db->group_start()**
-
-Starts a new group by adding an opening parenthesis to the WHERE clause of the query.
-
-**$this->db->or_group_start()**
-
-Starts a new group by adding an opening parenthesis to the WHERE clause of the query, prefixing it with 'OR'.
-
-**$this->db->not_group_start()**
-
-Starts a new group by adding an opening parenthesis to the WHERE clause of the query, prefixing it with 'NOT'.
-
-**$this->db->or_not_group_start()**
-
-Starts a new group by adding an opening parenthesis to the WHERE clause of the query, prefixing it with 'OR NOT'.
-
-**$this->db->group_end()**
-
-Ends the current group by adding an closing parenthesis to the WHERE clause of the query.
-
-**************
-Inserting Data
-**************
-
-**$this->db->insert()**
-
-Generates an insert string based on the data you supply, and runs the
-query. You can either pass an **array** or an **object** to the
-function. Here is an example using an array::
-
- $data = array(
- 'title' => 'My title',
- 'name' => 'My Name',
- 'date' => 'My date'
- );
-
- $this->db->insert('mytable', $data);
- // Produces: INSERT INTO mytable (title, name, date) VALUES ('My title', 'My name', 'My date')
-
-The first parameter will contain the table name, the second is an
-associative array of values.
-
-Here is an example using an object::
-
- /*
- class Myclass {
- public $title = 'My Title';
- public $content = 'My Content';
- public $date = 'My Date';
- }
- */
-
- $object = new Myclass;
- $this->db->insert('mytable', $object);
- // Produces: INSERT INTO mytable (title, content, date) VALUES ('My Title', 'My Content', 'My Date')
-
-The first parameter will contain the table name, the second is an
-object.
-
-.. note:: All values are escaped automatically producing safer queries.
-
-**$this->db->get_compiled_insert()**
-
-Compiles the insertion query just like $this->db->insert() but does not
-*run* the query. This method simply returns the SQL query as a string.
-
-Example::
-
- $data = array(
- 'title' => 'My title',
- 'name' => 'My Name',
- 'date' => 'My date'
- );
-
- $sql = $this->db->set($data)->get_compiled_insert('mytable');
- echo $sql;
-
- // Produces string: INSERT INTO mytable (`title`, `name`, `date`) VALUES ('My title', 'My name', 'My date')
-
-The second parameter enables you to set whether or not the query builder query
-will be reset (by default it will be--just like $this->db->insert())::
-
- echo $this->db->set('title', 'My Title')->get_compiled_insert('mytable', FALSE);
-
- // Produces string: INSERT INTO mytable (`title`) VALUES ('My Title')
-
- echo $this->db->set('content', 'My Content')->get_compiled_insert();
-
- // Produces string: INSERT INTO mytable (`title`, `content`) VALUES ('My Title', 'My Content')
-
-The key thing to notice in the above example is that the second query did not
-utilize `$this->db->from()` nor did it pass a table name into the first
-parameter. The reason this worked is because the query has not been executed
-using `$this->db->insert()` which resets values or reset directly using
-`$this->db->reset_query()`.
-
-.. note:: This method doesn't work for batched inserts.
-
-**$this->db->insert_batch()**
-
-Generates an insert string based on the data you supply, and runs the
-query. You can either pass an **array** or an **object** to the
-function. Here is an example using an array::
-
- $data = array(
- array(
- 'title' => 'My title',
- 'name' => 'My Name',
- 'date' => 'My date'
- ),
- array(
- 'title' => 'Another title',
- 'name' => 'Another Name',
- 'date' => 'Another date'
- )
- );
-
- $this->db->insert_batch('mytable', $data);
- // Produces: INSERT INTO mytable (title, name, date) VALUES ('My title', 'My name', 'My date'), ('Another title', 'Another name', 'Another date')
-
-The first parameter will contain the table name, the second is an
-associative array of values.
-
-.. note:: All values are escaped automatically producing safer queries.
-
-*************
-Updating Data
-*************
-
-**$this->db->replace()**
-
-This method executes a REPLACE statement, which is basically the SQL
-standard for (optional) DELETE + INSERT, using *PRIMARY* and *UNIQUE*
-keys as the determining factor.
-In our case, it will save you from the need to implement complex
-logics with different combinations of ``select()``, ``update()``,
-``delete()`` and ``insert()`` calls.
-
-Example::
-
- $data = array(
- 'title' => 'My title',
- 'name' => 'My Name',
- 'date' => 'My date'
- );
-
- $this->db->replace('table', $data);
-
- // Executes: REPLACE INTO mytable (title, name, date) VALUES ('My title', 'My name', 'My date')
-
-In the above example, if we assume that the *title* field is our primary
-key, then if a row containing 'My title' as the *title* value, that row
-will be deleted with our new row data replacing it.
-
-Usage of the ``set()`` method is also allowed and all fields are
-automatically escaped, just like with ``insert()``.
-
-**$this->db->set()**
-
-This function enables you to set values for inserts or updates.
-
-**It can be used instead of passing a data array directly to the insert
-or update functions:**
-
-::
-
- $this->db->set('name', $name);
- $this->db->insert('mytable'); // Produces: INSERT INTO mytable (`name`) VALUES ('{$name}')
-
-If you use multiple function called they will be assembled properly
-based on whether you are doing an insert or an update::
-
- $this->db->set('name', $name);
- $this->db->set('title', $title);
- $this->db->set('status', $status);
- $this->db->insert('mytable');
-
-**set()** will also accept an optional third parameter (``$escape``), that
-will prevent data from being escaped if set to FALSE. To illustrate the
-difference, here is ``set()`` used both with and without the escape
-parameter.
-
-::
-
- $this->db->set('field', 'field+1', FALSE);
- $this->db->where('id', 2);
- $this->db->update('mytable'); // gives UPDATE mytable SET field = field+1 WHERE id = 2
-
- $this->db->set('field', 'field+1');
- $this->db->where('id', 2);
- $this->db->update('mytable'); // gives UPDATE `mytable` SET `field` = 'field+1' WHERE `id` = 2
-
-You can also pass an associative array to this function::
-
- $array = array(
- 'name' => $name,
- 'title' => $title,
- 'status' => $status
- );
-
- $this->db->set($array);
- $this->db->insert('mytable');
-
-Or an object::
-
- /*
- class Myclass {
- public $title = 'My Title';
- public $content = 'My Content';
- public $date = 'My Date';
- }
- */
-
- $object = new Myclass;
- $this->db->set($object);
- $this->db->insert('mytable');
-
-**$this->db->update()**
-
-Generates an update string and runs the query based on the data you
-supply. You can pass an **array** or an **object** to the function. Here
-is an example using an array::
-
- $data = array(
- 'title' => $title,
- 'name' => $name,
- 'date' => $date
- );
-
- $this->db->where('id', $id);
- $this->db->update('mytable', $data);
- // Produces:
- //
- // UPDATE mytable
- // SET title = '{$title}', name = '{$name}', date = '{$date}'
- // WHERE id = $id
-
-Or you can supply an object::
-
- /*
- class Myclass {
- public $title = 'My Title';
- public $content = 'My Content';
- public $date = 'My Date';
- }
- */
-
- $object = new Myclass;
- $this->db->where('id', $id);
- $this->db->update('mytable', $object);
- // Produces:
- //
- // UPDATE `mytable`
- // SET `title` = '{$title}', `name` = '{$name}', `date` = '{$date}'
- // WHERE id = `$id`
-
-.. note:: All values are escaped automatically producing safer queries.
-
-You'll notice the use of the $this->db->where() function, enabling you
-to set the WHERE clause. You can optionally pass this information
-directly into the update function as a string::
-
- $this->db->update('mytable', $data, "id = 4");
-
-Or as an array::
-
- $this->db->update('mytable', $data, array('id' => $id));
-
-You may also use the $this->db->set() function described above when
-performing updates.
-
-**$this->db->update_batch()**
-
-Generates an update string based on the data you supply, and runs the query.
-You can either pass an **array** or an **object** to the function.
-Here is an example using an array::
-
- $data = array(
- array(
- 'title' => 'My title' ,
- 'name' => 'My Name 2' ,
- 'date' => 'My date 2'
- ),
- array(
- 'title' => 'Another title' ,
- 'name' => 'Another Name 2' ,
- 'date' => 'Another date 2'
- )
- );
-
- $this->db->update_batch('mytable', $data, 'title');
-
- // Produces:
- // UPDATE `mytable` SET `name` = CASE
- // WHEN `title` = 'My title' THEN 'My Name 2'
- // WHEN `title` = 'Another title' THEN 'Another Name 2'
- // ELSE `name` END,
- // `date` = CASE
- // WHEN `title` = 'My title' THEN 'My date 2'
- // WHEN `title` = 'Another title' THEN 'Another date 2'
- // ELSE `date` END
- // WHERE `title` IN ('My title','Another title')
-
-The first parameter will contain the table name, the second is an associative
-array of values, the third parameter is the where key.
-
-.. note:: All values are escaped automatically producing safer queries.
-
-.. note:: ``affected_rows()`` won't give you proper results with this method,
- due to the very nature of how it works. Instead, ``update_batch()``
- returns the number of rows affected.
-
-**$this->db->get_compiled_update()**
-
-This works exactly the same way as ``$this->db->get_compiled_insert()`` except
-that it produces an UPDATE SQL string instead of an INSERT SQL string.
-
-For more information view documentation for `$this->db->get_compiled_insert()`.
-
-.. note:: This method doesn't work for batched updates.
-
-*************
-Deleting Data
-*************
-
-**$this->db->delete()**
-
-Generates a delete SQL string and runs the query.
-
-::
-
- $this->db->delete('mytable', array('id' => $id)); // Produces: // DELETE FROM mytable // WHERE id = $id
-
-The first parameter is the table name, the second is the where clause.
-You can also use the where() or or_where() functions instead of passing
-the data to the second parameter of the function::
-
- $this->db->where('id', $id);
- $this->db->delete('mytable');
-
- // Produces:
- // DELETE FROM mytable
- // WHERE id = $id
-
-
-An array of table names can be passed into delete() if you would like to
-delete data from more than 1 table.
-
-::
-
- $tables = array('table1', 'table2', 'table3');
- $this->db->where('id', '5');
- $this->db->delete($tables);
-
-
-If you want to delete all data from a table, you can use the truncate()
-function, or empty_table().
-
-**$this->db->empty_table()**
-
-Generates a delete SQL string and runs the
-query.::
-
- $this->db->empty_table('mytable'); // Produces: DELETE FROM mytable
-
-**$this->db->truncate()**
-
-Generates a truncate SQL string and runs the query.
-
-::
-
- $this->db->from('mytable');
- $this->db->truncate();
-
- // or
-
- $this->db->truncate('mytable');
-
- // Produce:
- // TRUNCATE mytable
-
-.. note:: If the TRUNCATE command isn't available, truncate() will
- execute as "DELETE FROM table".
-
-**$this->db->get_compiled_delete()**
-
-This works exactly the same way as ``$this->db->get_compiled_insert()`` except
-that it produces a DELETE SQL string instead of an INSERT SQL string.
-
-For more information view documentation for $this->db->get_compiled_insert().
-
-***************
-Method Chaining
-***************
-
-Method chaining allows you to simplify your syntax by connecting
-multiple functions. Consider this example::
-
- $query = $this->db->select('title')
- ->where('id', $id)
- ->limit(10, 20)
- ->get('mytable');
-
-.. _ar-caching:
-
-*********************
-Query Builder Caching
-*********************
-
-While not "true" caching, Query Builder enables you to save (or "cache")
-certain parts of your queries for reuse at a later point in your
-script's execution. Normally, when an Query Builder call is completed,
-all stored information is reset for the next call. With caching, you can
-prevent this reset, and reuse information easily.
-
-Cached calls are cumulative. If you make 2 cached select() calls, and
-then 2 uncached select() calls, this will result in 4 select() calls.
-There are three Caching functions available:
-
-**$this->db->start_cache()**
-
-This function must be called to begin caching. All Query Builder queries
-of the correct type (see below for supported queries) are stored for
-later use.
-
-**$this->db->stop_cache()**
-
-This function can be called to stop caching.
-
-**$this->db->flush_cache()**
-
-This function deletes all items from the Query Builder cache.
-
-An example of caching
----------------------
-
-Here's a usage example::
-
- $this->db->start_cache();
- $this->db->select('field1');
- $this->db->stop_cache();
- $this->db->get('tablename');
- //Generates: SELECT `field1` FROM (`tablename`)
-
- $this->db->select('field2');
- $this->db->get('tablename');
- //Generates: SELECT `field1`, `field2` FROM (`tablename`)
-
- $this->db->flush_cache();
- $this->db->select('field2');
- $this->db->get('tablename');
- //Generates: SELECT `field2` FROM (`tablename`)
-
-
-.. note:: The following statements can be cached: select, from, join,
- where, like, group_by, having, order_by
-
-
-***********************
-Resetting Query Builder
-***********************
-
-**$this->db->reset_query()**
-
-Resetting Query Builder allows you to start fresh with your query without
-executing it first using a method like $this->db->get() or $this->db->insert().
-Just like the methods that execute a query, this will *not* reset items you've
-cached using `Query Builder Caching`_.
-
-This is useful in situations where you are using Query Builder to generate SQL
-(ex. ``$this->db->get_compiled_select()``) but then choose to, for instance,
-run the query::
-
- // Note that the second parameter of the get_compiled_select method is FALSE
- $sql = $this->db->select(array('field1','field2'))
- ->where('field3',5)
- ->get_compiled_select('mytable', FALSE);
-
- // ...
- // Do something crazy with the SQL code... like add it to a cron script for
- // later execution or something...
- // ...
-
- $data = $this->db->get()->result_array();
-
- // Would execute and return an array of results of the following query:
- // SELECT field1, field1 from mytable where field3 = 5;
-
-.. note:: Double calls to ``get_compiled_select()`` while you're using the
- Query Builder Caching functionality and NOT resetting your queries
- will results in the cache being merged twice. That in turn will
- i.e. if you're caching a ``select()`` - select the same field twice.
-
-***************
-Class Reference
-***************
-
-.. php:class:: CI_DB_query_builder
-
- .. php:method:: reset_query()
-
- :returns: CI_DB_query_builder instance (method chaining)
- :rtype: CI_DB_query_builder
-
- Resets the current Query Builder state. Useful when you want
- to build a query that can be cancelled under certain conditions.
-
- .. php:method:: start_cache()
-
- :returns: CI_DB_query_builder instance (method chaining)
- :rtype: CI_DB_query_builder
-
- Starts the Query Builder cache.
-
- .. php:method:: stop_cache()
-
- :returns: CI_DB_query_builder instance (method chaining)
- :rtype: CI_DB_query_builder
-
- Stops the Query Builder cache.
-
- .. php:method:: flush_cache()
-
- :returns: CI_DB_query_builder instance (method chaining)
- :rtype: CI_DB_query_builder
-
- Empties the Query Builder cache.
-
- .. php:method:: set_dbprefix([$prefix = ''])
-
- :param string $prefix: The new prefix to use
- :returns: The DB prefix in use
- :rtype: string
-
- Sets the database prefix, without having to reconnect.
-
- .. php:method:: dbprefix([$table = ''])
-
- :param string $table: The table name to prefix
- :returns: The prefixed table name
- :rtype: string
-
- Prepends a database prefix, if one exists in configuration.
-
- .. php:method:: count_all_results([$table = '', [$reset = TRUE]])
-
- :param string $table: Table name
- :param bool $reset: Whether to reset values for SELECTs
- :returns: Number of rows in the query result
- :rtype: int
-
- Generates a platform-specific query string that counts
- all records returned by an Query Builder query.
-
- .. php:method:: get([$table = ''[, $limit = NULL[, $offset = NULL]]])
-
- :param string $table: The table to query
- :param int $limit: The LIMIT clause
- :param int $offset: The OFFSET clause
- :returns: CI_DB_result instance (method chaining)
- :rtype: CI_DB_result
-
- Compiles and runs SELECT statement based on the already
- called Query Builder methods.
-
- .. php:method:: get_where([$table = ''[, $where = NULL[, $limit = NULL[, $offset = NULL]]]])
-
- :param mixed $table: The table(s) to fetch data from; string or array
- :param string $where: The WHERE clause
- :param int $limit: The LIMIT clause
- :param int $offset: The OFFSET clause
- :returns: CI_DB_result instance (method chaining)
- :rtype: CI_DB_result
-
- Same as ``get()``, but also allows the WHERE to be added directly.
-
- .. php:method:: select([$select = '*'[, $escape = NULL]])
-
- :param string $select: The SELECT portion of a query
- :param bool $escape: Whether to escape values and identifiers
- :returns: CI_DB_query_builder instance (method chaining)
- :rtype: CI_DB_query_builder
-
- Adds a SELECT clause to a query.
-
- .. php:method:: select_avg([$select = ''[, $alias = '']])
-
- :param string $select: Field to compute the average of
- :param string $alias: Alias for the resulting value name
- :returns: CI_DB_query_builder instance (method chaining)
- :rtype: CI_DB_query_builder
-
- Adds a SELECT AVG(field) clause to a query.
-
- .. php:method:: select_max([$select = ''[, $alias = '']])
-
- :param string $select: Field to compute the maximum of
- :param string $alias: Alias for the resulting value name
- :returns: CI_DB_query_builder instance (method chaining)
- :rtype: CI_DB_query_builder
-
- Adds a SELECT MAX(field) clause to a query.
-
- .. php:method:: select_min([$select = ''[, $alias = '']])
-
- :param string $select: Field to compute the minimum of
- :param string $alias: Alias for the resulting value name
- :returns: CI_DB_query_builder instance (method chaining)
- :rtype: CI_DB_query_builder
-
- Adds a SELECT MIN(field) clause to a query.
-
- .. php:method:: select_sum([$select = ''[, $alias = '']])
-
- :param string $select: Field to compute the sum of
- :param string $alias: Alias for the resulting value name
- :returns: CI_DB_query_builder instance (method chaining)
- :rtype: CI_DB_query_builder
-
- Adds a SELECT SUM(field) clause to a query.
-
- .. php:method:: distinct([$val = TRUE])
-
- :param bool $val: Desired value of the "distinct" flag
- :returns: CI_DB_query_builder instance (method chaining)
- :rtype: CI_DB_query_builder
-
- Sets a flag which tells the query builder to add
- a DISTINCT clause to the SELECT portion of the query.
-
- .. php:method:: from($from)
-
- :param mixed $from: Table name(s); string or array
- :returns: CI_DB_query_builder instance (method chaining)
- :rtype: CI_DB_query_builder
-
- Specifies the FROM clause of a query.
-
- .. php:method:: join($table, $cond[, $type = ''[, $escape = NULL]])
-
- :param string $table: Table name to join
- :param string $cond: The JOIN ON condition
- :param string $type: The JOIN type
- :param bool $escape: Whether to escape values and identifiers
- :returns: CI_DB_query_builder instance (method chaining)
- :rtype: CI_DB_query_builder
-
- Adds a JOIN clause to a query.
-
- .. php:method:: where($key[, $value = NULL[, $escape = NULL]])
-
- :param mixed $key: Name of field to compare, or associative array
- :param mixed $value: If a single key, compared to this value
- :param bool $escape: Whether to escape values and identifiers
- :returns: DB_query_builder instance
- :rtype: object
-
- Generates the WHERE portion of the query.
- Separates multiple calls with 'AND'.
-
- .. php:method:: or_where($key[, $value = NULL[, $escape = NULL]])
-
- :param mixed $key: Name of field to compare, or associative array
- :param mixed $value: If a single key, compared to this value
- :param bool $escape: Whether to escape values and identifiers
- :returns: DB_query_builder instance
- :rtype: object
-
- Generates the WHERE portion of the query.
- Separates multiple calls with 'OR'.
-
- .. php:method:: or_where_in([$key = NULL[, $values = NULL[, $escape = NULL]]])
-
- :param string $key: The field to search
- :param array $values: The values searched on
- :param bool $escape: Whether to escape values and identifiers
- :returns: DB_query_builder instance
- :rtype: object
-
- Generates a WHERE field IN('item', 'item') SQL query,
- joined with 'OR' if appropriate.
-
- .. php:method:: or_where_not_in([$key = NULL[, $values = NULL[, $escape = NULL]]])
-
- :param string $key: The field to search
- :param array $values: The values searched on
- :param bool $escape: Whether to escape values and identifiers
- :returns: DB_query_builder instance
- :rtype: object
-
- Generates a WHERE field NOT IN('item', 'item') SQL query,
- joined with 'OR' if appropriate.
-
- .. php:method:: where_in([$key = NULL[, $values = NULL[, $escape = NULL]]])
-
- :param string $key: Name of field to examine
- :param array $values: Array of target values
- :param bool $escape: Whether to escape values and identifiers
- :returns: DB_query_builder instance
- :rtype: object
-
- Generates a WHERE field IN('item', 'item') SQL query,
- joined with 'AND' if appropriate.
-
- .. php:method:: where_not_in([$key = NULL[, $values = NULL[, $escape = NULL]]])
-
- :param string $key: Name of field to examine
- :param array $values: Array of target values
- :param bool $escape: Whether to escape values and identifiers
- :returns: DB_query_builder instance
- :rtype: object
-
- Generates a WHERE field NOT IN('item', 'item') SQL query,
- joined with 'AND' if appropriate.
-
- .. php:method:: group_start()
-
- :returns: CI_DB_query_builder instance (method chaining)
- :rtype: CI_DB_query_builder
-
- Starts a group expression, using ANDs for the conditions inside it.
-
- .. php:method:: or_group_start()
-
- :returns: CI_DB_query_builder instance (method chaining)
- :rtype: CI_DB_query_builder
-
- Starts a group expression, using ORs for the conditions inside it.
-
- .. php:method:: not_group_start()
-
- :returns: CI_DB_query_builder instance (method chaining)
- :rtype: CI_DB_query_builder
-
- Starts a group expression, using AND NOTs for the conditions inside it.
-
- .. php:method:: or_not_group_start()
-
- :returns: CI_DB_query_builder instance (method chaining)
- :rtype: CI_DB_query_builder
-
- Starts a group expression, using OR NOTs for the conditions inside it.
-
- .. php:method:: group_end()
-
- :returns: DB_query_builder instance
- :rtype: object
-
- Ends a group expression.
-
- .. php:method:: like($field[, $match = ''[, $side = 'both'[, $escape = NULL]]])
-
- :param string $field: Field name
- :param string $match: Text portion to match
- :param string $side: Which side of the expression to put the '%' wildcard on
- :param bool $escape: Whether to escape values and identifiers
- :returns: CI_DB_query_builder instance (method chaining)
- :rtype: CI_DB_query_builder
-
- Adds a LIKE clause to a query, separating multiple calls with AND.
-
- .. php:method:: or_like($field[, $match = ''[, $side = 'both'[, $escape = NULL]]])
-
- :param string $field: Field name
- :param string $match: Text portion to match
- :param string $side: Which side of the expression to put the '%' wildcard on
- :param bool $escape: Whether to escape values and identifiers
- :returns: CI_DB_query_builder instance (method chaining)
- :rtype: CI_DB_query_builder
-
- Adds a LIKE clause to a query, separating multiple class with OR.
-
- .. php:method:: not_like($field[, $match = ''[, $side = 'both'[, $escape = NULL]]])
-
- :param string $field: Field name
- :param string $match: Text portion to match
- :param string $side: Which side of the expression to put the '%' wildcard on
- :param bool $escape: Whether to escape values and identifiers
- :returns: CI_DB_query_builder instance (method chaining)
- :rtype: CI_DB_query_builder
-
- Adds a NOT LIKE clause to a query, separating multiple calls with AND.
-
- .. php:method:: or_not_like($field[, $match = ''[, $side = 'both'[, $escape = NULL]]])
-
- :param string $field: Field name
- :param string $match: Text portion to match
- :param string $side: Which side of the expression to put the '%' wildcard on
- :param bool $escape: Whether to escape values and identifiers
- :returns: CI_DB_query_builder instance (method chaining)
- :rtype: CI_DB_query_builder
-
- Adds a NOT LIKE clause to a query, separating multiple calls with OR.
-
- .. php:method:: having($key[, $value = NULL[, $escape = NULL]])
-
- :param mixed $key: Identifier (string) or associative array of field/value pairs
- :param string $value: Value sought if $key is an identifier
- :param string $escape: Whether to escape values and identifiers
- :returns: CI_DB_query_builder instance (method chaining)
- :rtype: CI_DB_query_builder
-
- Adds a HAVING clause to a query, separating multiple calls with AND.
-
- .. php:method:: or_having($key[, $value = NULL[, $escape = NULL]])
-
- :param mixed $key: Identifier (string) or associative array of field/value pairs
- :param string $value: Value sought if $key is an identifier
- :param string $escape: Whether to escape values and identifiers
- :returns: CI_DB_query_builder instance (method chaining)
- :rtype: CI_DB_query_builder
-
- Adds a HAVING clause to a query, separating multiple calls with OR.
-
- .. php:method:: group_by($by[, $escape = NULL])
-
- :param mixed $by: Field(s) to group by; string or array
- :returns: CI_DB_query_builder instance (method chaining)
- :rtype: CI_DB_query_builder
-
- Adds a GROUP BY clause to a query.
-
- .. php:method:: order_by($orderby[, $direction = ''[, $escape = NULL]])
-
- :param string $orderby: Field to order by
- :param string $direction: The order requested - ASC, DESC or random
- :param bool $escape: Whether to escape values and identifiers
- :returns: CI_DB_query_builder instance (method chaining)
- :rtype: CI_DB_query_builder
-
- Adds an ORDER BY clause to a query.
-
- .. php:method:: limit($value[, $offset = 0])
-
- :param int $value: Number of rows to limit the results to
- :param int $offset: Number of rows to skip
- :returns: CI_DB_query_builder instance (method chaining)
- :rtype: CI_DB_query_builder
-
- Adds LIMIT and OFFSET clauses to a query.
-
- .. php:method:: offset($offset)
-
- :param int $offset: Number of rows to skip
- :returns: CI_DB_query_builder instance (method chaining)
- :rtype: CI_DB_query_builder
-
- Adds an OFFSET clause to a query.
-
- .. php:method:: set($key[, $value = ''[, $escape = NULL]])
-
- :param mixed $key: Field name, or an array of field/value pairs
- :param string $value: Field value, if $key is a single field
- :param bool $escape: Whether to escape values and identifiers
- :returns: CI_DB_query_builder instance (method chaining)
- :rtype: CI_DB_query_builder
-
- Adds field/value pairs to be passed later to ``insert()``,
- ``update()`` or ``replace()``.
-
- .. php:method:: insert([$table = ''[, $set = NULL[, $escape = NULL]]])
-
- :param string $table: Table name
- :param array $set: An associative array of field/value pairs
- :param bool $escape: Whether to escape values and identifiers
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Compiles and executes an INSERT statement.
-
- .. php:method:: insert_batch($table[, $set = NULL[, $escape = NULL[, $batch_size = 100]]])
-
- :param string $table: Table name
- :param array $set: Data to insert
- :param bool $escape: Whether to escape values and identifiers
- :param int $batch_size: Count of rows to insert at once
- :returns: Number of rows inserted or FALSE on failure
- :rtype: mixed
-
- Compiles and executes batch ``INSERT`` statements.
-
- .. note:: When more than ``$batch_size`` rows are provided, multiple
- ``INSERT`` queries will be executed, each trying to insert
- up to ``$batch_size`` rows.
-
- .. php:method:: set_insert_batch($key[, $value = ''[, $escape = NULL]])
-
- :param mixed $key: Field name or an array of field/value pairs
- :param string $value: Field value, if $key is a single field
- :param bool $escape: Whether to escape values and identifiers
- :returns: CI_DB_query_builder instance (method chaining)
- :rtype: CI_DB_query_builder
-
- Adds field/value pairs to be inserted in a table later via ``insert_batch()``.
-
- .. php:method:: update([$table = ''[, $set = NULL[, $where = NULL[, $limit = NULL]]]])
-
- :param string $table: Table name
- :param array $set: An associative array of field/value pairs
- :param string $where: The WHERE clause
- :param int $limit: The LIMIT clause
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Compiles and executes an UPDATE statement.
-
- .. php:method:: update_batch($table[, $set = NULL[, $value = NULL[, $batch_size = 100]]])
-
- :param string $table: Table name
- :param array $set: Field name, or an associative array of field/value pairs
- :param string $value: Field value, if $set is a single field
- :param int $batch_size: Count of conditions to group in a single query
- :returns: Number of rows updated or FALSE on failure
- :rtype: mixed
-
- Compiles and executes batch ``UPDATE`` statements.
-
- .. note:: When more than ``$batch_size`` field/value pairs are provided,
- multiple queries will be executed, each handling up to
- ``$batch_size`` field/value pairs.
-
- .. php:method:: set_update_batch($key[, $value = ''[, $escape = NULL]])
-
- :param mixed $key: Field name or an array of field/value pairs
- :param string $value: Field value, if $key is a single field
- :param bool $escape: Whether to escape values and identifiers
- :returns: CI_DB_query_builder instance (method chaining)
- :rtype: CI_DB_query_builder
-
- Adds field/value pairs to be updated in a table later via ``update_batch()``.
-
- .. php:method:: replace([$table = ''[, $set = NULL]])
-
- :param string $table: Table name
- :param array $set: An associative array of field/value pairs
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Compiles and executes a REPLACE statement.
-
- .. php:method:: delete([$table = ''[, $where = ''[, $limit = NULL[, $reset_data = TRUE]]]])
-
- :param mixed $table: The table(s) to delete from; string or array
- :param string $where: The WHERE clause
- :param int $limit: The LIMIT clause
- :param bool $reset_data: TRUE to reset the query "write" clause
- :returns: CI_DB_query_builder instance (method chaining) or FALSE on failure
- :rtype: mixed
-
- Compiles and executes a DELETE query.
-
- .. php:method:: truncate([$table = ''])
-
- :param string $table: Table name
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Executes a TRUNCATE statement on a table.
-
- .. note:: If the database platform in use doesn't support TRUNCATE,
- a DELETE statement will be used instead.
-
- .. php:method:: empty_table([$table = ''])
-
- :param string $table: Table name
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Deletes all records from a table via a DELETE statement.
-
- .. php:method:: get_compiled_select([$table = ''[, $reset = TRUE]])
-
- :param string $table: Table name
- :param bool $reset: Whether to reset the current QB values or not
- :returns: The compiled SQL statement as a string
- :rtype: string
-
- Compiles a SELECT statement and returns it as a string.
-
- .. php:method:: get_compiled_insert([$table = ''[, $reset = TRUE]])
-
- :param string $table: Table name
- :param bool $reset: Whether to reset the current QB values or not
- :returns: The compiled SQL statement as a string
- :rtype: string
-
- Compiles an INSERT statement and returns it as a string.
-
- .. php:method:: get_compiled_update([$table = ''[, $reset = TRUE]])
-
- :param string $table: Table name
- :param bool $reset: Whether to reset the current QB values or not
- :returns: The compiled SQL statement as a string
- :rtype: string
-
- Compiles an UPDATE statement and returns it as a string.
-
- .. php:method:: get_compiled_delete([$table = ''[, $reset = TRUE]])
-
- :param string $table: Table name
- :param bool $reset: Whether to reset the current QB values or not
- :returns: The compiled SQL statement as a string
- :rtype: string
-
- Compiles a DELETE statement and returns it as a string.
diff --git a/user_guide_src/source/database/results.rst b/user_guide_src/source/database/results.rst
deleted file mode 100644
index 6fea7c6be..000000000
--- a/user_guide_src/source/database/results.rst
+++ /dev/null
@@ -1,507 +0,0 @@
-########################
-Generating Query Results
-########################
-
-There are several ways to generate query results:
-
-.. contents::
- :local:
- :depth: 2
-
-*************
-Result Arrays
-*************
-
-**result()**
-
-This method returns the query result as an array of **objects**, or
-**an empty array** on failure. Typically you'll use this in a foreach
-loop, like this::
-
- $query = $this->db->query("YOUR QUERY");
-
- foreach ($query->result() as $row)
- {
- echo $row->title;
- echo $row->name;
- echo $row->body;
- }
-
-The above method is an alias of ``result_object()``.
-
-You can also pass a string to ``result()`` which represents a class to
-instantiate for each result object (note: this class must be loaded)
-
-::
-
- $query = $this->db->query("SELECT * FROM users;");
-
- foreach ($query->result('User') as $user)
- {
- echo $user->name; // access attributes
- echo $user->reverse_name(); // or methods defined on the 'User' class
- }
-
-**result_array()**
-
-This method returns the query result as a pure array, or an empty
-array when no result is produced. Typically you'll use this in a foreach
-loop, like this::
-
- $query = $this->db->query("YOUR QUERY");
-
- foreach ($query->result_array() as $row)
- {
- echo $row['title'];
- echo $row['name'];
- echo $row['body'];
- }
-
-***********
-Result Rows
-***********
-
-**row()**
-
-This method returns a single result row. If your query has more than
-one row, it returns only the first row. The result is returned as an
-**object**. Here's a usage example::
-
- $query = $this->db->query("YOUR QUERY");
-
- $row = $query->row();
-
- if (isset($row))
- {
- echo $row->title;
- echo $row->name;
- echo $row->body;
- }
-
-If you want a specific row returned you can submit the row number as a
-digit in the first parameter::
-
- $row = $query->row(5);
-
-You can also add a second String parameter, which is the name of a class
-to instantiate the row with::
-
- $query = $this->db->query("SELECT * FROM users LIMIT 1;");
- $row = $query->row(0, 'User');
-
- echo $row->name; // access attributes
- echo $row->reverse_name(); // or methods defined on the 'User' class
-
-**row_array()**
-
-Identical to the above ``row()`` method, except it returns an array.
-Example::
-
- $query = $this->db->query("YOUR QUERY");
-
- $row = $query->row_array();
-
- if (isset($row))
- {
- echo $row['title'];
- echo $row['name'];
- echo $row['body'];
- }
-
-If you want a specific row returned you can submit the row number as a
-digit in the first parameter::
-
- $row = $query->row_array(5);
-
-In addition, you can walk forward/backwards/first/last through your
-results using these variations:
-
- | **$row = $query->first_row()**
- | **$row = $query->last_row()**
- | **$row = $query->next_row()**
- | **$row = $query->previous_row()**
-
-By default they return an object unless you put the word "array" in the
-parameter:
-
- | **$row = $query->first_row('array')**
- | **$row = $query->last_row('array')**
- | **$row = $query->next_row('array')**
- | **$row = $query->previous_row('array')**
-
-.. note:: All the methods above will load the whole result into memory
- (prefetching). Use ``unbuffered_row()`` for processing large
- result sets.
-
-**unbuffered_row()**
-
-This method returns a single result row without prefetching the whole
-result in memory as ``row()`` does. If your query has more than one row,
-it returns the current row and moves the internal data pointer ahead.
-
-::
-
- $query = $this->db->query("YOUR QUERY");
-
- while ($row = $query->unbuffered_row())
- {
- echo $row->title;
- echo $row->name;
- echo $row->body;
- }
-
-You can optionally pass 'object' (default) or 'array' in order to specify
-the returned value's type::
-
- $query->unbuffered_row(); // object
- $query->unbuffered_row('object'); // object
- $query->unbuffered_row('array'); // associative array
-
-*********************
-Custom Result Objects
-*********************
-
-You can have the results returned as an instance of a custom class instead
-of a ``stdClass`` or array, as the ``result()`` and ``result_array()``
-methods allow. This requires that the class is already loaded into memory.
-The object will have all values returned from the database set as properties.
-If these have been declared and are non-public then you should provide a
-``__set()`` method to allow them to be set.
-
-Example::
-
- class User {
-
- public $id;
- public $email;
- public $username;
-
- protected $last_login;
-
- public function last_login($format)
- {
- return $this->last_login->format($format);
- }
-
- public function __set($name, $value)
- {
- if ($name === 'last_login')
- {
- $this->last_login = DateTime::createFromFormat('U', $value);
- }
- }
-
- public function __get($name)
- {
- if (isset($this->$name))
- {
- return $this->$name;
- }
- }
- }
-
-In addition to the two methods listed below, the following methods also can
-take a class name to return the results as: ``first_row()``, ``last_row()``,
-``next_row()``, and ``previous_row()``.
-
-**custom_result_object()**
-
-Returns the entire result set as an array of instances of the class requested.
-The only parameter is the name of the class to instantiate.
-
-Example::
-
- $query = $this->db->query("YOUR QUERY");
-
- $rows = $query->custom_result_object('User');
-
- foreach ($rows as $row)
- {
- echo $row->id;
- echo $row->email;
- echo $row->last_login('Y-m-d');
- }
-
-**custom_row_object()**
-
-Returns a single row from your query results. The first parameter is the row
-number of the results. The second parameter is the class name to instantiate.
-
-Example::
-
- $query = $this->db->query("YOUR QUERY");
-
- $row = $query->custom_row_object(0, 'User');
-
- if (isset($row))
- {
- echo $row->email; // access attributes
- echo $row->last_login('Y-m-d'); // access class methods
- }
-
-You can also use the ``row()`` method in exactly the same way.
-
-Example::
-
- $row = $query->custom_row_object(0, 'User');
-
-*********************
-Result Helper Methods
-*********************
-
-**num_rows()**
-
-The number of rows returned by the query. Note: In this example, $query
-is the variable that the query result object is assigned to::
-
- $query = $this->db->query('SELECT * FROM my_table');
-
- echo $query->num_rows();
-
-.. note:: Not all database drivers have a native way of getting the total
- number of rows for a result set. When this is the case, all of
- the data is prefetched and ``count()`` is manually called on the
- resulting array in order to achieve the same result.
-
-**num_fields()**
-
-The number of FIELDS (columns) returned by the query. Make sure to call
-the method using your query result object::
-
- $query = $this->db->query('SELECT * FROM my_table');
-
- echo $query->num_fields();
-
-**free_result()**
-
-It frees the memory associated with the result and deletes the result
-resource ID. Normally PHP frees its memory automatically at the end of
-script execution. However, if you are running a lot of queries in a
-particular script you might want to free the result after each query
-result has been generated in order to cut down on memory consumption.
-
-Example::
-
- $query = $this->db->query('SELECT title FROM my_table');
-
- foreach ($query->result() as $row)
- {
- echo $row->title;
- }
-
- $query->free_result(); // The $query result object will no longer be available
-
- $query2 = $this->db->query('SELECT name FROM some_table');
-
- $row = $query2->row();
- echo $row->name;
- $query2->free_result(); // The $query2 result object will no longer be available
-
-**data_seek()**
-
-This method sets the internal pointer for the next result row to be
-fetched. It is only useful in combination with ``unbuffered_row()``.
-
-It accepts a positive integer value, which defaults to 0 and returns
-TRUE on success or FALSE on failure.
-
-::
-
- $query = $this->db->query('SELECT `field_name` FROM `table_name`');
- $query->data_seek(5); // Skip the first 5 rows
- $row = $query->unbuffered_row();
-
-.. note:: Not all database drivers support this feature and will return FALSE.
- Most notably - you won't be able to use it with PDO.
-
-***************
-Class Reference
-***************
-
-.. php:class:: CI_DB_result
-
- .. php:method:: result([$type = 'object'])
-
- :param string $type: Type of requested results - array, object, or class name
- :returns: Array containing the fetched rows
- :rtype: array
-
- A wrapper for the ``result_array()``, ``result_object()``
- and ``custom_result_object()`` methods.
-
- Usage: see `Result Arrays`_.
-
- .. php:method:: result_array()
-
- :returns: Array containing the fetched rows
- :rtype: array
-
- Returns the query results as an array of rows, where each
- row is itself an associative array.
-
- Usage: see `Result Arrays`_.
-
- .. php:method:: result_object()
-
- :returns: Array containing the fetched rows
- :rtype: array
-
- Returns the query results as an array of rows, where each
- row is an object of type ``stdClass``.
-
- Usage: see `Result Arrays`_.
-
- .. php:method:: custom_result_object($class_name)
-
- :param string $class_name: Class name for the resulting rows
- :returns: Array containing the fetched rows
- :rtype: array
-
- Returns the query results as an array of rows, where each
- row is an instance of the specified class.
-
- .. php:method:: row([$n = 0[, $type = 'object']])
-
- :param int $n: Index of the query results row to be returned
- :param string $type: Type of the requested result - array, object, or class name
- :returns: The requested row or NULL if it doesn't exist
- :rtype: mixed
-
- A wrapper for the ``row_array()``, ``row_object() and
- ``custom_row_object()`` methods.
-
- Usage: see `Result Rows`_.
-
- .. php:method:: unbuffered_row([$type = 'object'])
-
- :param string $type: Type of the requested result - array, object, or class name
- :returns: Next row from the result set or NULL if it doesn't exist
- :rtype: mixed
-
- Fetches the next result row and returns it in the
- requested form.
-
- Usage: see `Result Rows`_.
-
- .. php:method:: row_array([$n = 0])
-
- :param int $n: Index of the query results row to be returned
- :returns: The requested row or NULL if it doesn't exist
- :rtype: array
-
- Returns the requested result row as an associative array.
-
- Usage: see `Result Rows`_.
-
- .. php:method:: row_object([$n = 0])
-
- :param int $n: Index of the query results row to be returned
- :returns: The requested row or NULL if it doesn't exist
- :rtype: stdClass
-
- Returns the requested result row as an object of type
- ``stdClass``.
-
- Usage: see `Result Rows`_.
-
- .. php:method:: custom_row_object($n, $type)
-
- :param int $n: Index of the results row to return
- :param string $class_name: Class name for the resulting row
- :returns: The requested row or NULL if it doesn't exist
- :rtype: $type
-
- Returns the requested result row as an instance of the
- requested class.
-
- .. php:method:: data_seek([$n = 0])
-
- :param int $n: Index of the results row to be returned next
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Moves the internal results row pointer to the desired offset.
-
- Usage: see `Result Helper Methods`_.
-
- .. php:method:: set_row($key[, $value = NULL])
-
- :param mixed $key: Column name or array of key/value pairs
- :param mixed $value: Value to assign to the column, $key is a single field name
- :rtype: void
-
- Assigns a value to a particular column.
-
- .. php:method:: next_row([$type = 'object'])
-
- :param string $type: Type of the requested result - array, object, or class name
- :returns: Next row of result set, or NULL if it doesn't exist
- :rtype: mixed
-
- Returns the next row from the result set.
-
- .. php:method:: previous_row([$type = 'object'])
-
- :param string $type: Type of the requested result - array, object, or class name
- :returns: Previous row of result set, or NULL if it doesn't exist
- :rtype: mixed
-
- Returns the previous row from the result set.
-
- .. php:method:: first_row([$type = 'object'])
-
- :param string $type: Type of the requested result - array, object, or class name
- :returns: First row of result set, or NULL if it doesn't exist
- :rtype: mixed
-
- Returns the first row from the result set.
-
- .. php:method:: last_row([$type = 'object'])
-
- :param string $type: Type of the requested result - array, object, or class name
- :returns: Last row of result set, or NULL if it doesn't exist
- :rtype: mixed
-
- Returns the last row from the result set.
-
- .. php:method:: num_rows()
-
- :returns: Number of rows in the result set
- :rtype: int
-
- Returns the number of rows in the result set.
-
- Usage: see `Result Helper Methods`_.
-
- .. php:method:: num_fields()
-
- :returns: Number of fields in the result set
- :rtype: int
-
- Returns the number of fields in the result set.
-
- Usage: see `Result Helper Methods`_.
-
- .. php:method:: field_data()
-
- :returns: Array containing field meta-data
- :rtype: array
-
- Generates an array of ``stdClass`` objects containing
- field meta-data.
-
- .. php:method:: free_result()
-
- :rtype: void
-
- Frees a result set.
-
- Usage: see `Result Helper Methods`_.
-
- .. php:method:: list_fields()
-
- :returns: Array of column names
- :rtype: array
-
- Returns an array containing the field names in the
- result set.
diff --git a/user_guide_src/source/database/transactions.rst b/user_guide_src/source/database/transactions.rst
deleted file mode 100644
index cfd6a566d..000000000
--- a/user_guide_src/source/database/transactions.rst
+++ /dev/null
@@ -1,127 +0,0 @@
-############
-Transactions
-############
-
-CodeIgniter's database abstraction allows you to use transactions with
-databases that support transaction-safe table types. In MySQL, you'll
-need to be running InnoDB or BDB table types rather than the more common
-MyISAM. Most other database platforms support transactions natively.
-
-If you are not familiar with transactions we recommend you find a good
-online resource to learn about them for your particular database. The
-information below assumes you have a basic understanding of
-transactions.
-
-CodeIgniter's Approach to Transactions
-======================================
-
-CodeIgniter utilizes an approach to transactions that is very similar to
-the process used by the popular database class ADODB. We've chosen that
-approach because it greatly simplifies the process of running
-transactions. In most cases all that is required are two lines of code.
-
-Traditionally, transactions have required a fair amount of work to
-implement since they demand that you keep track of your queries and
-determine whether to commit or rollback based on the success or failure
-of your queries. This is particularly cumbersome with nested queries. In
-contrast, we've implemented a smart transaction system that does all
-this for you automatically (you can also manage your transactions
-manually if you choose to, but there's really no benefit).
-
-Running Transactions
-====================
-
-To run your queries using transactions you will use the
-$this->db->trans_start() and $this->db->trans_complete() functions as
-follows::
-
- $this->db->trans_start();
- $this->db->query('AN SQL QUERY...');
- $this->db->query('ANOTHER QUERY...');
- $this->db->query('AND YET ANOTHER QUERY...');
- $this->db->trans_complete();
-
-You can run as many queries as you want between the start/complete
-functions and they will all be committed or rolled back based on success
-or failure of any given query.
-
-Strict Mode
-===========
-
-By default CodeIgniter runs all transactions in Strict Mode. When strict
-mode is enabled, if you are running multiple groups of transactions, if
-one group fails all groups will be rolled back. If strict mode is
-disabled, each group is treated independently, meaning a failure of one
-group will not affect any others.
-
-Strict Mode can be disabled as follows::
-
- $this->db->trans_strict(FALSE);
-
-Managing Errors
-===============
-
-If you have error reporting enabled in your config/database.php file
-you'll see a standard error message if the commit was unsuccessful. If
-debugging is turned off, you can manage your own errors like this::
-
- $this->db->trans_start();
- $this->db->query('AN SQL QUERY...');
- $this->db->query('ANOTHER QUERY...');
- $this->db->trans_complete();
-
- if ($this->db->trans_status() === FALSE)
- {
- // generate an error... or use the log_message() function to log your error
- }
-
-Disabling Transactions
-======================
-
-If you would like to disable transactions you can do so using
-``$this->db->trans_off()``::
-
- $this->db->trans_off();
-
- $this->db->trans_start();
- $this->db->query('AN SQL QUERY...');
- $this->db->trans_complete();
-
-When transactions are disabled, your queries will be auto-committed, just as
-they are when running queries without transactions, practically ignoring
-any calls to ``trans_start()``, ``trans_complete()``, etc.
-
-Test Mode
-=========
-
-You can optionally put the transaction system into "test mode", which
-will cause your queries to be rolled back -- even if the queries produce
-a valid result. To use test mode simply set the first parameter in the
-$this->db->trans_start() function to TRUE::
-
- $this->db->trans_start(TRUE); // Query will be rolled back
- $this->db->query('AN SQL QUERY...');
- $this->db->trans_complete();
-
-Running Transactions Manually
-=============================
-
-If you would like to run transactions manually you can do so as follows::
-
- $this->db->trans_begin();
-
- $this->db->query('AN SQL QUERY...');
- $this->db->query('ANOTHER QUERY...');
- $this->db->query('AND YET ANOTHER QUERY...');
-
- if ($this->db->trans_status() === FALSE)
- {
- $this->db->trans_rollback();
- }
- else
- {
- $this->db->trans_commit();
- }
-
-.. note:: Make sure to use $this->db->trans_begin() when running manual
- transactions, **NOT** $this->db->trans_start().
diff --git a/user_guide_src/source/database/utilities.rst b/user_guide_src/source/database/utilities.rst
deleted file mode 100644
index 114291f85..000000000
--- a/user_guide_src/source/database/utilities.rst
+++ /dev/null
@@ -1,316 +0,0 @@
-######################
-Database Utility Class
-######################
-
-The Database Utility Class contains methods that help you manage your
-database.
-
-.. contents::
- :local:
- :depth: 2
-
-******************************
-Initializing the Utility Class
-******************************
-
-.. important:: In order to initialize the Utility class, your database
- driver must already be running, since the utilities class relies on it.
-
-Load the Utility Class as follows::
-
- $this->load->dbutil();
-
-You can also pass another database object to the DB Utility loader, in case
-the database you want to manage isn't the default one::
-
- $this->myutil = $this->load->dbutil($this->other_db, TRUE);
-
-In the above example, we're passing a custom database object as the first
-parameter and then tell it to return the dbutil object, instead of
-assigning it directly to ``$this->dbutil``.
-
-.. note:: Both of the parameters can be used individually, just pass an empty
- value as the first one if you wish to skip it.
-
-Once initialized you will access the methods using the ``$this->dbutil``
-object::
-
- $this->dbutil->some_method();
-
-****************************
-Using the Database Utilities
-****************************
-
-Retrieve list of database names
-================================
-
-Returns an array of database names::
-
- $dbs = $this->dbutil->list_databases();
-
- foreach ($dbs as $db)
- {
- echo $db;
- }
-
-
-Determine If a Database Exists
-==============================
-
-Sometimes it's helpful to know whether a particular database exists.
-Returns a boolean TRUE/FALSE. Usage example::
-
- if ($this->dbutil->database_exists('database_name'))
- {
- // some code...
- }
-
-.. note:: Replace *database_name* with the name of the database you are
- looking for. This method is case sensitive.
-
-Optimize a Table
-================
-
-Permits you to optimize a table using the table name specified in the
-first parameter. Returns TRUE/FALSE based on success or failure::
-
- if ($this->dbutil->optimize_table('table_name'))
- {
- echo 'Success!';
- }
-
-.. note:: Not all database platforms support table optimization. It is
- mostly for use with MySQL.
-
-Repair a Table
-==============
-
-Permits you to repair a table using the table name specified in the
-first parameter. Returns TRUE/FALSE based on success or failure::
-
- if ($this->dbutil->repair_table('table_name'))
- {
- echo 'Success!';
- }
-
-.. note:: Not all database platforms support table repairs.
-
-Optimize a Database
-===================
-
-Permits you to optimize the database your DB class is currently
-connected to. Returns an array containing the DB status messages or
-FALSE on failure.
-
-::
-
- $result = $this->dbutil->optimize_database();
-
- if ($result !== FALSE)
- {
- print_r($result);
- }
-
-.. note:: Not all database platforms support database optimization. It
- it is mostly for use with MySQL.
-
-Export a Query Result as a CSV File
-===================================
-
-Permits you to generate a CSV file from a query result. The first
-parameter of the method must contain the result object from your
-query. Example::
-
- $this->load->dbutil();
-
- $query = $this->db->query("SELECT * FROM mytable");
-
- echo $this->dbutil->csv_from_result($query);
-
-The second, third, and fourth parameters allow you to set the delimiter
-newline, and enclosure characters respectively. By default commas are
-used as the delimiter, "\n" is used as a new line, and a double-quote
-is used as the enclosure. Example::
-
- $delimiter = ",";
- $newline = "\r\n";
- $enclosure = '"';
-
- echo $this->dbutil->csv_from_result($query, $delimiter, $newline, $enclosure);
-
-.. important:: This method will NOT write the CSV file for you. It
- simply creates the CSV layout. If you need to write the file
- use the :doc:`File Helper <../helpers/file_helper>`.
-
-Export a Query Result as an XML Document
-========================================
-
-Permits you to generate an XML file from a query result. The first
-parameter expects a query result object, the second may contain an
-optional array of config parameters. Example::
-
- $this->load->dbutil();
-
- $query = $this->db->query("SELECT * FROM mytable");
-
- $config = array (
- 'root' => 'root',
- 'element' => 'element',
- 'newline' => "\n",
- 'tab' => "\t"
- );
-
- echo $this->dbutil->xml_from_result($query, $config);
-
-.. important:: This method will NOT write the XML file for you. It
- simply creates the XML layout. If you need to write the file
- use the :doc:`File Helper <../helpers/file_helper>`.
-
-********************
-Backup Your Database
-********************
-
-Database Backup Notes
-=====================
-
-Permits you to backup your full database or individual tables. The
-backup data can be compressed in either Zip or Gzip format.
-
-.. note:: This feature is only available for MySQL and Interbase/Firebird databases.
-
-.. note:: For Interbase/Firebird databases, the backup file name is the only parameter.
-
- $this->dbutil->backup('db_backup_filename');
-
-.. note:: Due to the limited execution time and memory available to PHP,
- backing up very large databases may not be possible. If your database is
- very large you might need to backup directly from your SQL server via
- the command line, or have your server admin do it for you if you do not
- have root privileges.
-
-Usage Example
-=============
-
-::
-
- // Load the DB utility class
- $this->load->dbutil();
-
- // Backup your entire database and assign it to a variable
- $backup = $this->dbutil->backup();
-
- // Load the file helper and write the file to your server
- $this->load->helper('file');
- write_file('/path/to/mybackup.gz', $backup);
-
- // Load the download helper and send the file to your desktop
- $this->load->helper('download');
- force_download('mybackup.gz', $backup);
-
-Setting Backup Preferences
-==========================
-
-Backup preferences are set by submitting an array of values to the first
-parameter of the ``backup()`` method. Example::
-
- $prefs = array(
- 'tables' => array('table1', 'table2'), // Array of tables to backup.
- 'ignore' => array(), // List of tables to omit from the backup
- 'format' => 'txt', // gzip, zip, txt
- 'filename' => 'mybackup.sql', // File name - NEEDED ONLY WITH ZIP FILES
- 'add_drop' => TRUE, // Whether to add DROP TABLE statements to backup file
- 'add_insert' => TRUE, // Whether to add INSERT data to backup file
- 'newline' => "\n" // Newline character used in backup file
- );
-
- $this->dbutil->backup($prefs);
-
-Description of Backup Preferences
-=================================
-
-======================= ======================= ======================= ========================================================================
-Preference Default Value Options Description
-======================= ======================= ======================= ========================================================================
-**tables** empty array None An array of tables you want backed up. If left blank all tables will be
- exported.
-**ignore** empty array None An array of tables you want the backup routine to ignore.
-**format** gzip gzip, zip, txt The file format of the export file.
-**filename** the current date/time None The name of the backed-up file. The name is needed only if you are using
- zip compression.
-**add_drop** TRUE TRUE/FALSE Whether to include DROP TABLE statements in your SQL export file.
-**add_insert** TRUE TRUE/FALSE Whether to include INSERT statements in your SQL export file.
-**newline** "\\n" "\\n", "\\r", "\\r\\n" Type of newline to use in your SQL export file.
-**foreign_key_checks** TRUE TRUE/FALSE Whether output should keep foreign key checks enabled.
-======================= ======================= ======================= ========================================================================
-
-***************
-Class Reference
-***************
-
-.. php:class:: CI_DB_utility
-
- .. php:method:: backup([$params = array()])
-
- :param array $params: An associative array of options
- :returns: raw/(g)zipped SQL query string
- :rtype: string
-
- Perform a database backup, per user preferences.
-
- .. php:method:: database_exists($database_name)
-
- :param string $database_name: Database name
- :returns: TRUE if the database exists, FALSE otherwise
- :rtype: bool
-
- Check for the existence of a database.
-
- .. php:method:: list_databases()
-
- :returns: Array of database names found
- :rtype: array
-
- Retrieve a list of all the database names.
-
- .. php:method:: optimize_database()
-
- :returns: Array of optimization messages or FALSE on failure
- :rtype: array
-
- Optimizes the database.
-
- .. php:method:: optimize_table($table_name)
-
- :param string $table_name: Name of the table to optimize
- :returns: Array of optimization messages or FALSE on failure
- :rtype: array
-
- Optimizes a database table.
-
- .. php:method:: repair_table($table_name)
-
- :param string $table_name: Name of the table to repair
- :returns: Array of repair messages or FALSE on failure
- :rtype: array
-
- Repairs a database table.
-
- .. php:method:: csv_from_result($query[, $delim = ','[, $newline = "\n"[, $enclosure = '"']]])
-
- :param object $query: A database result object
- :param string $delim: The CSV field delimiter to use
- :param string $newline: The newline character to use
- :param string $enclosure: The enclosure delimiter to use
- :returns: The generated CSV file as a string
- :rtype: string
-
- Translates a database result object into a CSV document.
-
- .. php:method:: xml_from_result($query[, $params = array()])
-
- :param object $query: A database result object
- :param array $params: An associative array of preferences
- :returns: The generated XML document as a string
- :rtype: string
-
- Translates a database result object into an XML document.
diff --git a/user_guide_src/source/documentation/ELDocs.tmbundle.zip b/user_guide_src/source/documentation/ELDocs.tmbundle.zip
deleted file mode 100644
index f7a11b364..000000000
--- a/user_guide_src/source/documentation/ELDocs.tmbundle.zip
+++ /dev/null
Binary files differ
diff --git a/user_guide_src/source/documentation/index.rst b/user_guide_src/source/documentation/index.rst
deleted file mode 100644
index aaac33ecb..000000000
--- a/user_guide_src/source/documentation/index.rst
+++ /dev/null
@@ -1,202 +0,0 @@
-#################################
-Writing CodeIgniter Documentation
-#################################
-
-CodeIgniter uses Sphinx to generate its documentation in a variety of formats,
-using reStructuredText to handle the formatting. If you are familiar with
-Markdown or Textile, you will quickly grasp reStructuredText. The focus is
-on readability and user friendliness.
-While they can be quite technical, we always write for humans!
-
-A local table of contents should always be included, like the one below.
-It is created automatically by inserting the following:
-
-::
-
- .. contents::
- :local:
-
- .. raw:: html
-
- <div class="custom-index container"></div>
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-The <div> that is inserted as raw HTML is a hook for the documentation's
-JavaScript to dynamically add links to any function and method definitions
-contained in the current page.
-
-**************
-Tools Required
-**************
-
-To see the rendered HTML, ePub, PDF, etc., you will need to install Sphinx
-along with the PHP domain extension for Sphinx. The underlying requirement
-is to have Python installed. Lastly, you will install the CI Lexer for
-Pygments, so that code blocks can be properly highlighted.
-
-.. code-block:: bash
-
- easy_install "sphinx==1.2.3"
- easy_install "sphinxcontrib-phpdomain==0.1.3.post1"
-
-Then follow the directions in the README file in the :samp:`cilexer` folder
-inside the documentation repository to install the CI Lexer.
-
-
-
-*****************************************
-Page and Section Headings and Subheadings
-*****************************************
-
-Headings not only provide order and sections within a page, but they also
-are used to automatically build both the page and document table of contents.
-Headings are formed by using certain characters as underlines for a bit of
-text. Major headings, like page titles and section headings also use
-overlines. Other headings just use underlines, with the following hierarchy::
-
- # with overline for page titles
- * with overline for major sections
- = for subsections
- - for subsubsections
- ^ for subsubsubsections
- " for subsubsubsubsections (!)
-
-The :download:`TextMate ELDocs Bundle <./ELDocs.tmbundle.zip>` can help you
-create these with the following tab triggers::
-
- title->
-
- ##########
- Page Title
- ##########
-
- sec->
-
- *************
- Major Section
- *************
-
- sub->
-
- Subsection
- ==========
-
- sss->
-
- SubSubSection
- -------------
-
- ssss->
-
- SubSubSubSection
- ^^^^^^^^^^^^^^^^
-
- sssss->
-
- SubSubSubSubSection (!)
- """""""""""""""""""""""
-
-
-
-
-********************
-Method Documentation
-********************
-
-When documenting class methods for third party developers, Sphinx provides
-directives to assist and keep things simple.
-For example, consider the following ReST:
-
-.. code-block:: rst
-
- .. php:class:: Some_class
-
- .. php:method:: some_method ( $foo [, $bar [, $bat]])
-
- This function will perform some action. The ``$bar`` array must contain
- a something and something else, and along with ``$bat`` is an optional
- parameter.
-
- :param int $foo: the foo id to do something in
- :param mixed $bar: A data array that must contain a something and something else
- :param bool $bat: whether or not to do something
- :returns: FALSE on failure, TRUE if successful
- :rtype: bool
-
- ::
-
- $this->load->library('some_class');
-
- $bar = array(
- 'something' => 'Here is this parameter!',
- 'something_else' => 42
- );
-
- $bat = $this->some_class->should_do_something();
-
- if ($this->some_class->some_method(4, $bar, $bat) === FALSE)
- {
- show_error('An Error Occurred Doing Some Method');
- }
-
- .. note:: Here is something that you should be aware of when using some_method().
- For real.
-
- See also :meth:`Some_class::should_do_something`
-
-
- .. php:method:: should_do_something()
-
- :returns: Whether or not something should be done
- :rtype: bool
-
-
-It creates the following display:
-
-.. php:class:: Some_class
-
-
- .. php:method:: some_method ( $foo [, $bar [, $bat]])
-
- This function will perform some action. The ``$bar`` array must contain
- a something and something else, and along with ``$bat`` is an optional
- parameter.
-
- :param int $foo: the foo id to do something in
- :param mixed $bar: A data array that must contain a something and something else
- :param bool $bat: whether or not to do something
- :returns: FALSE on failure, TRUE if successful
- :rtype: bool
-
- ::
-
- $this->load->library('some_class');
-
- $bar = array(
- 'something' => 'Here is this parameter!',
- 'something_else' => 42
- );
-
- $bat = $this->some_class->should_do_something();
-
- if ($this->some_class->some_method(4, $bar, $bat) === FALSE)
- {
- show_error('An Error Occurred Doing Some Method');
- }
-
- .. note:: Here is something that you should be aware of when using some_method().
- For real.
-
- See also :meth:`Some_class::should_do_something`
-
-
- .. php:method:: should_do_something()
-
- :returns: Whether or not something should be done
- :rtype: bool
diff --git a/user_guide_src/source/general/alternative_php.rst b/user_guide_src/source/general/alternative_php.rst
deleted file mode 100644
index 418d2e6eb..000000000
--- a/user_guide_src/source/general/alternative_php.rst
+++ /dev/null
@@ -1,75 +0,0 @@
-###################################
-Alternate PHP Syntax for View Files
-###################################
-
-If you do not utilize CodeIgniter's :doc:`template
-engine <../libraries/parser>`, you'll be using pure PHP in your
-View files. To minimize the PHP code in these files, and to make it
-easier to identify the code blocks it is recommended that you use PHPs
-alternative syntax for control structures and short tag echo statements.
-If you are not familiar with this syntax, it allows you to eliminate the
-braces from your code, and eliminate "echo" statements.
-
-Automatic Short Tag Support
-===========================
-
-.. note:: If you find that the syntax described in this page does not
- work on your server it might be that "short tags" are disabled in your
- PHP ini file. CodeIgniter will optionally rewrite short tags on-the-fly,
- allowing you to use that syntax even if your server doesn't support it.
- This feature can be enabled in your *config/config.php* file.
-
-Please note that if you do use this feature, if PHP errors are
-encountered in your **view files**, the error message and line number
-will not be accurately shown. Instead, all errors will be shown as
-``eval()`` errors.
-
-Alternative Echos
-=================
-
-Normally to echo, or print out a variable you would do this::
-
- <?php echo $variable; ?>
-
-With the alternative syntax you can instead do it this way::
-
- <?=$variable?>
-
-Alternative Control Structures
-==============================
-
-Controls structures, like if, for, foreach, and while can be written in
-a simplified format as well. Here is an example using ``foreach``::
-
- <ul>
-
- <?php foreach ($todo as $item): ?>
-
- <li><?=$item?></li>
-
- <?php endforeach; ?>
-
- </ul>
-
-Notice that there are no braces. Instead, the end brace is replaced with
-``endforeach``. Each of the control structures listed above has a similar
-closing syntax: ``endif``, ``endfor``, ``endforeach``, and ``endwhile``
-
-Also notice that instead of using a semicolon after each structure
-(except the last one), there is a colon. This is important!
-
-Here is another example, using ``if``/``elseif``/``else``. Notice the colons::
-
- <?php if ($username === 'sally'): ?>
-
- <h3>Hi Sally</h3>
-
- <?php elseif ($username === 'joe'): ?>
-
- <h3>Hi Joe</h3>
-
- <?php else: ?>
-
- <h3>Hi unknown user</h3>
-
- <?php endif; ?> \ No newline at end of file
diff --git a/user_guide_src/source/general/ancillary_classes.rst b/user_guide_src/source/general/ancillary_classes.rst
deleted file mode 100644
index 4d6528aae..000000000
--- a/user_guide_src/source/general/ancillary_classes.rst
+++ /dev/null
@@ -1,80 +0,0 @@
-##########################
-Creating Ancillary Classes
-##########################
-
-In some cases you may want to develop classes that exist apart from your
-controllers but have the ability to utilize all of CodeIgniter's
-resources. This is easily possible as you'll see.
-
-get_instance()
-==============
-
-.. php:function:: get_instance()
-
- :returns: Reference to your controller's instance
- :rtype: CI_Controller
-
-**Any class that you instantiate within your controller methods can
-access CodeIgniter's native resources** simply by using the
-``get_instance()`` function. This function returns the main
-CodeIgniter object.
-
-Normally, to call any of the available methods, CodeIgniter requires
-you to use the ``$this`` construct::
-
- $this->load->helper('url');
- $this->load->library('session');
- $this->config->item('base_url');
- // etc.
-
-``$this``, however, only works within your controllers, your models,
-or your views. If you would like to use CodeIgniter's classes from
-within your own custom classes you can do so as follows:
-
-First, assign the CodeIgniter object to a variable::
-
- $CI =& get_instance();
-
-Once you've assigned the object to a variable, you'll use that variable
-*instead* of ``$this``::
-
- $CI =& get_instance();
-
- $CI->load->helper('url');
- $CI->load->library('session');
- $CI->config->item('base_url');
- // etc.
-
-If you'll be using ``get_instance()`` inside another class, then it would
-be better if you assign it to a property. This way, you won't need to call
-``get_instance()`` in every single method.
-
-Example::
-
- class Example {
-
- protected $CI;
-
- // We'll use a constructor, as you can't directly call a function
- // from a property definition.
- public function __construct()
- {
- // Assign the CodeIgniter super-object
- $this->CI =& get_instance();
- }
-
- public function foo()
- {
- $this->CI->load->helper('url');
- redirect();
- }
-
- public function bar()
- {
- $this->CI->config->item('base_url');
- }
- }
-
-In the above example, both methods ``foo()`` and ``bar()`` will work
-after you instantiate the Example class, without the need to call
-``get_instance()`` in each of them.
diff --git a/user_guide_src/source/general/autoloader.rst b/user_guide_src/source/general/autoloader.rst
deleted file mode 100644
index 2f1223e28..000000000
--- a/user_guide_src/source/general/autoloader.rst
+++ /dev/null
@@ -1,27 +0,0 @@
-######################
-Auto-loading Resources
-######################
-
-CodeIgniter comes with an "Auto-load" feature that permits libraries,
-helpers, and models to be initialized automatically every time the
-system runs. If you need certain resources globally throughout your
-application you should consider auto-loading them for convenience.
-
-The following items can be loaded automatically:
-
-- Classes found in the *libraries/* directory
-- Helper files found in the *helpers/* directory
-- Custom config files found in the *config/* directory
-- Language files found in the *system/language/* directory
-- Models found in the *models/* folder
-
-To autoload resources, open the **application/config/autoload.php**
-file and add the item you want loaded to the autoload array. You'll
-find instructions in that file corresponding to each type of item.
-
-.. note:: Do not include the file extension (.php) when adding items to
- the autoload array.
-
-Additionally, if you want CodeIgniter to use a `Composer <https://getcomposer.org/>`_
-auto-loader, just set ``$config['composer_autoload']`` to ``TRUE`` or
-a custom path in **application/config/config.php**. \ No newline at end of file
diff --git a/user_guide_src/source/general/caching.rst b/user_guide_src/source/general/caching.rst
deleted file mode 100644
index f499f6e93..000000000
--- a/user_guide_src/source/general/caching.rst
+++ /dev/null
@@ -1,71 +0,0 @@
-################
-Web Page Caching
-################
-
-CodeIgniter lets you cache your pages in order to achieve maximum
-performance.
-
-Although CodeIgniter is quite fast, the amount of dynamic information
-you display in your pages will correlate directly to the server
-resources, memory, and processing cycles utilized, which affect your
-page load speeds. By caching your pages, since they are saved in their
-fully rendered state, you can achieve performance that nears that of
-static web pages.
-
-How Does Caching Work?
-======================
-
-Caching can be enabled on a per-page basis, and you can set the length
-of time that a page should remain cached before being refreshed. When a
-page is loaded for the first time, the cache file will be written to
-your application/cache folder. On subsequent page loads the cache file
-will be retrieved and sent to the requesting user's browser. If it has
-expired, it will be deleted and refreshed before being sent to the
-browser.
-
-.. note: The Benchmark tag is not cached so you can still view your page
- load speed when caching is enabled.
-
-Enabling Caching
-================
-
-To enable caching, put the following tag in any of your controller
-methods::
-
- $this->output->cache($n);
-
-Where ``$n`` is the number of **minutes** you wish the page to remain
-cached between refreshes.
-
-The above tag can go anywhere within a method. It is not affected by
-the order that it appears, so place it wherever it seems most logical to
-you. Once the tag is in place, your pages will begin being cached.
-
-.. important:: Because of the way CodeIgniter stores content for output,
- caching will only work if you are generating display for your
- controller with a :doc:`view <./views>`.
-
-.. important:: If you change configuration options that might affect
- your output, you have to manually delete your cache files.
-
-.. note:: Before the cache files can be written you must set the file
- permissions on your *application/cache/* directory such that
- it is writable.
-
-Deleting Caches
-===============
-
-If you no longer wish to cache a file you can remove the caching tag and
-it will no longer be refreshed when it expires.
-
-.. note:: Removing the tag will not delete the cache immediately. It will
- have to expire normally.
-
-If you need to manually delete the cache, you can use the ``delete_cache()``
-method::
-
- // Deletes cache for the currently requested URI
- $this->output->delete_cache();
-
- // Deletes cache for /foo/bar
- $this->output->delete_cache('/foo/bar'); \ No newline at end of file
diff --git a/user_guide_src/source/general/cli.rst b/user_guide_src/source/general/cli.rst
deleted file mode 100644
index bfa30531b..000000000
--- a/user_guide_src/source/general/cli.rst
+++ /dev/null
@@ -1,78 +0,0 @@
-###################
-Running via the CLI
-###################
-
-As well as calling an applications :doc:`Controllers <./controllers>`
-via the URL in a browser they can also be loaded via the command-line
-interface (CLI).
-
-.. contents:: Page Contents
-
-What is the CLI?
-================
-
-The command-line interface is a text-based method of interacting with
-computers. For more information, check the `Wikipedia
-article <http://en.wikipedia.org/wiki/Command-line_interface>`_.
-
-Why run via the command-line?
-=============================
-
-There are many reasons for running CodeIgniter from the command-line,
-but they are not always obvious.
-
-- Run your cron-jobs without needing to use *wget* or *curl*
-- Make your cron-jobs inaccessible from being loaded in the URL by
- checking the return value of :php:func:`is_cli()`.
-- Make interactive "tasks" that can do things like set permissions,
- prune cache folders, run backups, etc.
-- Integrate with other applications in other languages. For example, a
- random C++ script could call one command and run code in your models!
-
-Let's try it: Hello World!
-==========================
-
-Let's create a simple controller so you can see it in action. Using your
-text editor, create a file called Tools.php, and put the following code
-in it::
-
- <?php
- class Tools extends CI_Controller {
-
- public function message($to = 'World')
- {
- echo "Hello {$to}!".PHP_EOL;
- }
- }
-
-Then save the file to your *application/controllers/* folder.
-
-Now normally you would visit the site using a URL similar to this::
-
- example.com/index.php/tools/message/to
-
-Instead, we are going to open the terminal in Mac/Linux or go to Run > "cmd"
-in Windows and navigate to our CodeIgniter project.
-
-.. code-block:: bash
-
- $ cd /path/to/project;
- $ php index.php tools message
-
-If you did it right, you should see *Hello World!* printed.
-
-.. code-block:: bash
-
- $ php index.php tools message "John Smith"
-
-Here we are passing it an argument in the same way that URL parameters
-work. "John Smith" is passed as an argument and the output is::
-
- Hello John Smith!
-
-That's it!
-==========
-
-That, in a nutshell, is all there is to know about controllers on the
-command line. Remember that this is just a normal controller, so routing
-and ``_remap()`` works fine.
diff --git a/user_guide_src/source/general/common_functions.rst b/user_guide_src/source/general/common_functions.rst
deleted file mode 100644
index 3e3e42264..000000000
--- a/user_guide_src/source/general/common_functions.rst
+++ /dev/null
@@ -1,188 +0,0 @@
-################
-Common Functions
-################
-
-CodeIgniter uses a few functions for its operation that are globally
-defined, and are available to you at any point. These do not require
-loading any libraries or helpers.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-.. php:function:: is_php($version)
-
- :param string $version: Version number
- :returns: TRUE if the running PHP version is at least the one specified or FALSE if not
- :rtype: bool
-
- Determines if the PHP version being used is greater than the
- supplied version number.
-
- Example::
-
- if (is_php('5.3'))
- {
- $str = quoted_printable_encode($str);
- }
-
- Returns boolean TRUE if the installed version of PHP is equal to or
- greater than the supplied version number. Returns FALSE if the installed
- version of PHP is lower than the supplied version number.
-
-.. php:function:: is_really_writable($file)
-
- :param string $file: File path
- :returns: TRUE if the path is writable, FALSE if not
- :rtype: bool
-
- ``is_writable()`` returns TRUE on Windows servers when you really can't
- write to the file as the OS reports to PHP as FALSE only if the
- read-only attribute is marked.
-
- This function determines if a file is actually writable by attempting
- to write to it first. Generally only recommended on platforms where
- this information may be unreliable.
-
- Example::
-
- if (is_really_writable('file.txt'))
- {
- echo "I could write to this if I wanted to";
- }
- else
- {
- echo "File is not writable";
- }
-
- .. note:: See also `PHP bug #54709 <https://bugs.php.net/bug.php?id=54709>`_ for more info.
-
-.. php:function:: config_item($key)
-
- :param string $key: Config item key
- :returns: Configuration key value or NULL if not found
- :rtype: mixed
-
- The :doc:`Config Library <../libraries/config>` is the preferred way of
- accessing configuration information, however ``config_item()`` can be used
- to retrieve single keys. See :doc:`Config Library <../libraries/config>`
- documentation for more information.
-
-.. :noindex: function:: show_error($message, $status_code[, $heading = 'An Error Was Encountered'])
-
- :param mixed $message: Error message
- :param int $status_code: HTTP Response status code
- :param string $heading: Error page heading
- :rtype: void
-
- This function calls ``CI_Exception::show_error()``. For more info,
- please see the :doc:`Error Handling <errors>` documentation.
-
-.. :noindex: function:: show_404([$page = ''[, $log_error = TRUE]])
-
- :param string $page: URI string
- :param bool $log_error: Whether to log the error
- :rtype: void
-
- This function calls ``CI_Exception::show_404()``. For more info,
- please see the :doc:`Error Handling <errors>` documentation.
-
-.. :noindex: function:: log_message($level, $message)
-
- :param string $level: Log level: 'error', 'debug' or 'info'
- :param string $message: Message to log
- :rtype: void
-
- This function is an alias for ``CI_Log::write_log()``. For more info,
- please see the :doc:`Error Handling <errors>` documentation.
-
-.. php:function:: set_status_header($code[, $text = ''])
-
- :param int $code: HTTP Response status code
- :param string $text: A custom message to set with the status code
- :rtype: void
-
- Permits you to manually set a server status header. Example::
-
- set_status_header(401);
- // Sets the header as: Unauthorized
-
- `See here <http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html>`_ for
- a full list of headers.
-
-.. php:function:: remove_invisible_characters($str[, $url_encoded = TRUE])
-
- :param string $str: Input string
- :param bool $url_encoded: Whether to remove URL-encoded characters as well
- :returns: Sanitized string
- :rtype: string
-
- This function prevents inserting NULL characters between ASCII
- characters, like Java\\0script.
-
- Example::
-
- remove_invisible_characters('Java\\0script');
- // Returns: 'Javascript'
-
-.. php:function:: html_escape($var)
-
- :param mixed $var: Variable to escape (string or array)
- :returns: HTML escaped string(s)
- :rtype: mixed
-
- This function acts as an alias for PHP's native ``htmlspecialchars()``
- function, with the advantage of being able to accept an array of strings.
-
- It is useful in preventing Cross Site Scripting (XSS).
-
-.. php:function:: get_mimes()
-
- :returns: An associative array of file types
- :rtype: array
-
- This function returns a *reference* to the MIMEs array from
- *application/config/mimes.php*.
-
-.. php:function:: is_https()
-
- :returns: TRUE if currently using HTTP-over-SSL, FALSE if not
- :rtype: bool
-
- Returns TRUE if a secure (HTTPS) connection is used and FALSE
- in any other case (including non-HTTP requests).
-
-.. php:function:: is_cli()
-
- :returns: TRUE if currently running under CLI, FALSE otherwise
- :rtype: bool
-
- Returns TRUE if the application is run through the command line
- and FALSE if not.
-
- .. note:: This function checks both if the ``PHP_SAPI`` value is 'cli'
- or if the ``STDIN`` constant is defined.
-
-.. php:function:: function_usable($function_name)
-
- :param string $function_name: Function name
- :returns: TRUE if the function can be used, FALSE if not
- :rtype: bool
-
- Returns TRUE if a function exists and is usable, FALSE otherwise.
-
- This function runs a ``function_exists()`` check and if the
- `Suhosin extension <http://www.hardened-php.net/suhosin/>` is loaded,
- checks if it doesn't disable the function being checked.
-
- It is useful if you want to check for the availability of functions
- such as ``eval()`` and ``exec()``, which are dangerous and might be
- disabled on servers with highly restrictive security policies.
-
- .. note:: This function was introduced because Suhosin terminated
- script execution, but this turned out to be a bug. A fix
- has been available for some time (version 0.9.34), but is
- unfortunately not released yet. \ No newline at end of file
diff --git a/user_guide_src/source/general/compatibility_functions.rst b/user_guide_src/source/general/compatibility_functions.rst
deleted file mode 100644
index 584968663..000000000
--- a/user_guide_src/source/general/compatibility_functions.rst
+++ /dev/null
@@ -1,232 +0,0 @@
-#######################
-Compatibility Functions
-#######################
-
-CodeIgniter provides a set of compatibility functions that enable
-you to use functions what are otherwise natively available in PHP,
-but only in higher versions or depending on a certain extension.
-
-Being custom implementations, these functions will also have some
-set of dependencies on their own, but are still useful if your
-PHP setup doesn't offer them natively.
-
-.. note:: Much like the :doc:`common functions <common_functions>`, the
- compatibility functions are always available, as long as
- their dependencies are met.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-****************
-Password Hashing
-****************
-
-This set of compatibility functions offers a "backport" of PHP's
-standard `Password Hashing extension <http://php.net/password>`_
-that is otherwise available only since PHP 5.5.
-
-Dependencies
-============
-
-- PHP 5.3.7
-- ``CRYPT_BLOWFISH`` support for ``crypt()``
-
-Constants
-=========
-
-- ``PASSWORD_BCRYPT``
-- ``PASSWORD_DEFAULT``
-
-Function reference
-==================
-
-.. php:function:: password_get_info($hash)
-
- :param string $hash: Password hash
- :returns: Information about the hashed password
- :rtype: array
-
- For more information, please refer to the `PHP manual for
- password_get_info() <http://php.net/password_get_info>`_.
-
-.. php:function:: password_hash($password, $algo[, $options = array()])
-
- :param string $password: Plain-text password
- :param int $algo: Hashing algorithm
- :param array $options: Hashing options
- :returns: Hashed password or FALSE on failure
- :rtype: string
-
- For more information, please refer to the `PHP manual for
- password_hash() <http://php.net/password_hash>`_.
-
- .. note:: Unless you provide your own (and valid) salt, this function
- has a further dependency on an available CSPRNG source. Each
- of the following would satisfy that:
- - ``mcrypt_create_iv()`` with ``MCRYPT_DEV_URANDOM``
- - ``openssl_random_pseudo_bytes()``
- - /dev/arandom
- - /dev/urandom
-
-.. php:function:: password_needs_rehash()
-
- :param string $hash: Password hash
- :param int $algo: Hashing algorithm
- :param array $options: Hashing options
- :returns: TRUE if the hash should be rehashed to match the given algorithm and options, FALSE otherwise
- :rtype: bool
-
- For more information, please refer to the `PHP manual for
- password_needs_rehash() <http://php.net/password_needs_rehash>`_.
-
-.. php:function:: password_verify($password, $hash)
-
- :param string $password: Plain-text password
- :param string $hash: Password hash
- :returns: TRUE if the password matches the hash, FALSE if not
- :rtype: bool
-
- For more information, please refer to the `PHP manual for
- password_verify() <http://php.net/password_verify>`_.
-
-*********************
-Hash (Message Digest)
-*********************
-
-This compatibility layer contains backports for the ``hash_equals()``
-and ``hash_pbkdf2()`` functions, which otherwise require PHP 5.6 and/or
-PHP 5.5 respectively.
-
-Dependencies
-============
-
-- None
-
-Function reference
-==================
-
-.. php:function:: hash_equals($known_string, $user_string)
-
- :param string $known_string: Known string
- :param string $user_string: User-supplied string
- :returns: TRUE if the strings match, FALSE otherwise
- :rtype: string
-
- For more information, please refer to the `PHP manual for
- hash_equals() <http://php.net/hash_equals>`_.
-
-.. php:function:: hash_pbkdf2($algo, $password, $salt, $iterations[, $length = 0[, $raw_output = FALSE]])
-
- :param string $algo: Hashing algorithm
- :param string $password: Password
- :param string $salt: Hash salt
- :param int $iterations: Number of iterations to perform during derivation
- :param int $length: Output string length
- :param bool $raw_output: Whether to return raw binary data
- :returns: Password-derived key or FALSE on failure
- :rtype: string
-
- For more information, please refer to the `PHP manual for
- hash_pbkdf2() <http://php.net/hash_pbkdf2>`_.
-
-****************
-Multibyte String
-****************
-
-This set of compatibility functions offers limited support for PHP's
-`Multibyte String extension <http://php.net/mbstring>`_. Because of
-the limited alternative solutions, only a few functions are available.
-
-.. note:: When a character set parameter is ommited,
- ``$config['charset']`` will be used.
-
-Dependencies
-============
-
-- `iconv <http://php.net/iconv>`_ extension
-
-.. important:: This dependency is optional and these functions will
- always be declared. If iconv is not available, they WILL
- fall-back to their non-mbstring versions.
-
-.. important:: Where a character set is supplied, it must be
- supported by iconv and in a format that it recognizes.
-
-.. note:: For you own dependency check on the actual mbstring
- extension, use the ``MB_ENABLED`` constant.
-
-Function reference
-==================
-
-.. php:function:: mb_strlen($str[, $encoding = NULL])
-
- :param string $str: Input string
- :param string $encoding: Character set
- :returns: Number of characters in the input string or FALSE on failure
- :rtype: string
-
- For more information, please refer to the `PHP manual for
- mb_strlen() <http://php.net/mb_strlen>`_.
-
-.. php:function:: mb_strpos($haystack, $needle[, $offset = 0[, $encoding = NULL]])
-
- :param string $haystack: String to search in
- :param string $needle: Part of string to search for
- :param int $offset: Search offset
- :param string $encoding: Character set
- :returns: Numeric character position of where $needle was found or FALSE if not found
- :rtype: mixed
-
- For more information, please refer to the `PHP manual for
- mb_strpos() <http://php.net/mb_strpos>`_.
-
-.. php:function:: mb_substr($str, $start[, $length = NULL[, $encoding = NULL]])
-
- :param string $str: Input string
- :param int $start: Position of first character
- :param int $length: Maximum number of characters
- :param string $encoding: Character set
- :returns: Portion of $str specified by $start and $length or FALSE on failure
- :rtype: string
-
- For more information, please refer to the `PHP manual for
- mb_substr() <http://php.net/mb_substr>`_.
-
-******************
-Standard Functions
-******************
-
-This set of compatibility functions offers support for a few
-standard functions in PHP that otherwise require a newer PHP version.
-
-Dependencies
-============
-
-- None
-
-Function reference
-==================
-
-.. php:function:: array_column(array $array, $column_key[, $index_key = NULL])
-
- :param array $array: Array to fetch results from
- :param mixed $column_key: Key of the column to return values from
- :param mixed $index_key: Key to use for the returned values
- :returns: An array of values representing a single column from the input array
- :rtype: array
-
- For more information, please refer to the `PHP manual for
- array_column() <http://php.net/array_column>`_.
-
-.. php:function:: hex2bin($data)
-
- :param array $data: Hexadecimal representation of data
- :returns: Binary representation of the given data
- :rtype: string
-
- For more information, please refer to the `PHP manual for hex2bin()
- <http://php.net/hex2bin>`_.
diff --git a/user_guide_src/source/general/controllers.rst b/user_guide_src/source/general/controllers.rst
deleted file mode 100644
index 14e583636..000000000
--- a/user_guide_src/source/general/controllers.rst
+++ /dev/null
@@ -1,340 +0,0 @@
-###########
-Controllers
-###########
-
-Controllers are the heart of your application, as they determine how
-HTTP requests should be handled.
-
-.. contents:: Page Contents
-
-What is a Controller?
-=====================
-
-**A Controller is simply a class file that is named in a way that can be
-associated with a URI.**
-
-Consider this URI::
-
- example.com/index.php/blog/
-
-In the above example, CodeIgniter would attempt to find a controller
-named Blog.php and load it.
-
-**When a controller's name matches the first segment of a URI, it will
-be loaded.**
-
-Let's try it: Hello World!
-==========================
-
-Let's create a simple controller so you can see it in action. Using your
-text editor, create a file called Blog.php, and put the following code
-in it::
-
- <?php
- class Blog extends CI_Controller {
-
- public function index()
- {
- echo 'Hello World!';
- }
- }
-
-Then save the file to your *application/controllers/* directory.
-
-.. important:: The file must be called 'Blog.php', with a capital 'B'.
-
-Now visit the your site using a URL similar to this::
-
- example.com/index.php/blog/
-
-If you did it right, you should see:
-
- Hello World!
-
-.. important:: Class names must start with an uppercase letter.
-
-This is valid::
-
- <?php
- class Blog extends CI_Controller {
-
- }
-
-This is **not** valid::
-
- <?php
- class blog extends CI_Controller {
-
- }
-
-Also, always make sure your controller extends the parent controller
-class so that it can inherit all its methods.
-
-Methods
-=======
-
-In the above example the method name is ``index()``. The "index" method
-is always loaded by default if the **second segment** of the URI is
-empty. Another way to show your "Hello World" message would be this::
-
- example.com/index.php/blog/index/
-
-**The second segment of the URI determines which method in the
-controller gets called.**
-
-Let's try it. Add a new method to your controller::
-
- <?php
- class Blog extends CI_Controller {
-
- public function index()
- {
- echo 'Hello World!';
- }
-
- public function comments()
- {
- echo 'Look at this!';
- }
- }
-
-Now load the following URL to see the comment method::
-
- example.com/index.php/blog/comments/
-
-You should see your new message.
-
-Passing URI Segments to your methods
-====================================
-
-If your URI contains more than two segments they will be passed to your
-method as parameters.
-
-For example, let's say you have a URI like this::
-
- example.com/index.php/products/shoes/sandals/123
-
-Your method will be passed URI segments 3 and 4 ("sandals" and "123")::
-
- <?php
- class Products extends CI_Controller {
-
- public function shoes($sandals, $id)
- {
- echo $sandals;
- echo $id;
- }
- }
-
-.. important:: If you are using the :doc:`URI Routing <routing>`
- feature, the segments passed to your method will be the re-routed
- ones.
-
-Defining a Default Controller
-=============================
-
-CodeIgniter can be told to load a default controller when a URI is not
-present, as will be the case when only your site root URL is requested.
-To specify a default controller, open your **application/config/routes.php**
-file and set this variable::
-
- $route['default_controller'] = 'blog';
-
-Where 'blog' is the name of the controller class you want used. If you now
-load your main index.php file without specifying any URI segments you'll
-see your "Hello World" message by default.
-
-For more information, please refer to the "Reserved Routes" section of the
-:doc:`URI Routing <routing>` documentation.
-
-Remapping Method Calls
-======================
-
-As noted above, the second segment of the URI typically determines which
-method in the controller gets called. CodeIgniter permits you to override
-this behavior through the use of the ``_remap()`` method::
-
- public function _remap()
- {
- // Some code here...
- }
-
-.. important:: If your controller contains a method named _remap(),
- it will **always** get called regardless of what your URI contains. It
- overrides the normal behavior in which the URI determines which method
- is called, allowing you to define your own method routing rules.
-
-The overridden method call (typically the second segment of the URI) will
-be passed as a parameter to the ``_remap()`` method::
-
- public function _remap($method)
- {
- if ($method === 'some_method')
- {
- $this->$method();
- }
- else
- {
- $this->default_method();
- }
- }
-
-Any extra segments after the method name are passed into ``_remap()`` as an
-optional second parameter. This array can be used in combination with
-PHP's `call_user_func_array() <http://php.net/call_user_func_array>`_
-to emulate CodeIgniter's default behavior.
-
-Example::
-
- public function _remap($method, $params = array())
- {
- $method = 'process_'.$method;
- if (method_exists($this, $method))
- {
- return call_user_func_array(array($this, $method), $params);
- }
- show_404();
- }
-
-Processing Output
-=================
-
-CodeIgniter has an output class that takes care of sending your final
-rendered data to the web browser automatically. More information on this
-can be found in the :doc:`Views <views>` and :doc:`Output Class
-<../libraries/output>` pages. In some cases, however, you might want to
-post-process the finalized data in some way and send it to the browser
-yourself. CodeIgniter permits you to add a method named ``_output()``
-to your controller that will receive the finalized output data.
-
-.. important:: If your controller contains a method named ``_output()``,
- it will **always** be called by the output class instead of
- echoing the finalized data directly. The first parameter of the
- method will contain the finalized output.
-
-Here is an example::
-
- public function _output($output)
- {
- echo $output;
- }
-
-.. note::
-
- Please note that your ``_output()`` method will receive the
- data in its finalized state. Benchmark and memory usage data
- will be rendered, cache files written (if you have caching
- enabled), and headers will be sent (if you use that
- :doc:`feature <../libraries/output>`) before it is handed off
- to the ``_output()`` method.
- To have your controller's output cached properly, its
- ``_output()`` method can use::
-
- if ($this->output->cache_expiration > 0)
- {
- $this->output->_write_cache($output);
- }
-
- If you are using this feature the page execution timer and
- memory usage stats might not be perfectly accurate since they
- will not take into account any further processing you do.
- For an alternate way to control output *before* any of the
- final processing is done, please see the available methods
- in the :doc:`Output Library <../libraries/output>`.
-
-Private methods
-===============
-
-In some cases you may want certain methods hidden from public access.
-In order to achieve this, simply declare the method as being private
-or protected and it will not be served via a URL request. For example,
-if you were to have a method like this::
-
- private function _utility()
- {
- // some code
- }
-
-Trying to access it via the URL, like this, will not work::
-
- example.com/index.php/blog/_utility/
-
-.. note:: Prefixing method names with an underscore will also prevent
- them from being called. This is a legacy feature that is left
- for backwards-compatibility.
-
-Organizing Your Controllers into Sub-directories
-================================================
-
-If you are building a large application you might want to hierarchically
-organize or structure your controllers into sub-directories. CodeIgniter
-permits you to do this.
-
-Simply create sub-directories under the main *application/controllers/*
-one and place your controller classes within them.
-
-.. note:: When using this feature the first segment of your URI must
- specify the folder. For example, let's say you have a controller located
- here::
-
- application/controllers/products/Shoes.php
-
- To call the above controller your URI will look something like this::
-
- example.com/index.php/products/shoes/show/123
-
-Each of your sub-directories may contain a default controller which will be
-called if the URL contains *only* the sub-directory. Simply put a controller
-in there that matches the name of your 'default_controller' as specified in
-your *application/config/routes.php* file.
-
-CodeIgniter also permits you to remap your URIs using its :doc:`URI
-Routing <routing>` feature.
-
-Class Constructors
-==================
-
-If you intend to use a constructor in any of your Controllers, you
-**MUST** place the following line of code in it::
-
- parent::__construct();
-
-The reason this line is necessary is because your local constructor will
-be overriding the one in the parent controller class so we need to
-manually call it.
-
-Example::
-
- <?php
- class Blog extends CI_Controller {
-
- public function __construct()
- {
- parent::__construct();
- // Your own constructor code
- }
- }
-
-Constructors are useful if you need to set some default values, or run a
-default process when your class is instantiated. Constructors can't
-return a value, but they can do some default work.
-
-Reserved method names
-=====================
-
-Since your controller classes will extend the main application
-controller you must be careful not to name your methods identically to
-the ones used by that class, otherwise your local functions will
-override them. See :doc:`Reserved Names <reserved_names>` for a full
-list.
-
-.. important:: You should also never have a method named identically
- to its class name. If you do, and there is no ``__construct()``
- method in the same class, then your e.g. ``Index::index()``
- method will be executed as a class constructor! This is a PHP4
- backwards-compatibility feature.
-
-That's it!
-==========
-
-That, in a nutshell, is all there is to know about controllers.
diff --git a/user_guide_src/source/general/core_classes.rst b/user_guide_src/source/general/core_classes.rst
deleted file mode 100644
index 9ccded75c..000000000
--- a/user_guide_src/source/general/core_classes.rst
+++ /dev/null
@@ -1,117 +0,0 @@
-############################
-Creating Core System Classes
-############################
-
-Every time CodeIgniter runs there are several base classes that are
-initialized automatically as part of the core framework. It is possible,
-however, to swap any of the core system classes with your own versions
-or even extend the core versions.
-
-**Most users will never have any need to do this, but the option to
-replace or extend them does exist for those who would like to
-significantly alter the CodeIgniter core.**
-
-.. note:: Messing with a core system class has a lot of implications, so
- make sure you know what you are doing before attempting it.
-
-System Class List
-=================
-
-The following is a list of the core system files that are invoked every
-time CodeIgniter runs:
-
-- Benchmark
-- Config
-- Controller
-- Exceptions
-- Hooks
-- Input
-- Language
-- Loader
-- Log
-- Output
-- Router
-- Security
-- URI
-- Utf8
-
-Replacing Core Classes
-======================
-
-To use one of your own system classes instead of a default one simply
-place your version inside your local *application/core/* directory::
-
- application/core/some_class.php
-
-If this directory does not exist you can create it.
-
-Any file named identically to one from the list above will be used
-instead of the one normally used.
-
-Please note that your class must use CI as a prefix. For example, if
-your file is named Input.php the class will be named::
-
- class CI_Input {
-
- }
-
-Extending Core Class
-====================
-
-If all you need to do is add some functionality to an existing library -
-perhaps add a method or two - then it's overkill to replace the entire
-library with your version. In this case it's better to simply extend the
-class. Extending a class is nearly identical to replacing a class with a
-couple exceptions:
-
-- The class declaration must extend the parent class.
-- Your new class name and filename must be prefixed with MY\_ (this
- item is configurable. See below.).
-
-For example, to extend the native Input class you'll create a file named
-application/core/MY_Input.php, and declare your class with::
-
- class MY_Input extends CI_Input {
-
- }
-
-.. note:: If you need to use a constructor in your class make sure you
- extend the parent constructor::
-
- class MY_Input extends CI_Input {
-
- public function __construct()
- {
- parent::__construct();
- // Your own constructor code
- }
- }
-
-**Tip:** Any functions in your class that are named identically to the
-methods in the parent class will be used instead of the native ones
-(this is known as "method overriding"). This allows you to substantially
-alter the CodeIgniter core.
-
-If you are extending the Controller core class, then be sure to extend
-your new class in your application controller's constructors.
-
-::
-
- class Welcome extends MY_Controller {
-
- public function index()
- {
- $this->load->view('welcome_message');
- }
- }
-
-Setting Your Own Prefix
------------------------
-
-To set your own sub-class prefix, open your
-*application/config/config.php* file and look for this item::
-
- $config['subclass_prefix'] = 'MY_';
-
-Please note that all native CodeIgniter libraries are prefixed
-with CI\_ so DO NOT use that as your prefix.
diff --git a/user_guide_src/source/general/creating_drivers.rst b/user_guide_src/source/general/creating_drivers.rst
deleted file mode 100644
index 63ac83902..000000000
--- a/user_guide_src/source/general/creating_drivers.rst
+++ /dev/null
@@ -1,25 +0,0 @@
-################
-Creating Drivers
-################
-
-Driver Directory and File Structure
-===================================
-
-Sample driver directory and file structure layout:
-
-- /application/libraries/Driver_name
-
- - Driver_name.php
- - drivers
-
- - Driver_name_subclass_1.php
- - Driver_name_subclass_2.php
- - Driver_name_subclass_3.php
-
-.. note:: In order to maintain compatibility on case-sensitive
- file systems, the Driver_name directory must be
- named in the format returned by ``ucfirst()``.
-
-.. note:: The Driver library's architecture is such that
- the subclasses don't extend and therefore don't inherit
- properties or methods of the main driver. \ No newline at end of file
diff --git a/user_guide_src/source/general/creating_libraries.rst b/user_guide_src/source/general/creating_libraries.rst
deleted file mode 100644
index 83742b619..000000000
--- a/user_guide_src/source/general/creating_libraries.rst
+++ /dev/null
@@ -1,260 +0,0 @@
-##################
-Creating Libraries
-##################
-
-When we use the term "Libraries" we are normally referring to the
-classes that are located in the libraries directory and described in the
-Class Reference of this user guide. In this case, however, we will
-instead describe how you can create your own libraries within your
-application/libraries directory in order to maintain separation between
-your local resources and the global framework resources.
-
-As an added bonus, CodeIgniter permits your libraries to extend native
-classes if you simply need to add some functionality to an existing
-library. Or you can even replace native libraries just by placing
-identically named versions in your *application/libraries* directory.
-
-In summary:
-
-- You can create entirely new libraries.
-- You can extend native libraries.
-- You can replace native libraries.
-
-The page below explains these three concepts in detail.
-
-.. note:: The Database classes can not be extended or replaced with your
- own classes. All other classes are able to be replaced/extended.
-
-Storage
-=======
-
-Your library classes should be placed within your *application/libraries*
-directory, as this is where CodeIgniter will look for them when they are
-initialized.
-
-Naming Conventions
-==================
-
-- File names must be capitalized. For example: Myclass.php
-- Class declarations must be capitalized. For example: class Myclass
-- Class names and file names must match.
-
-The Class File
-==============
-
-Classes should have this basic prototype::
-
- <?php
- defined('BASEPATH') OR exit('No direct script access allowed');
-
- class Someclass {
-
- public function some_method()
- {
- }
- }
-
-.. note:: We are using the name Someclass purely as an example.
-
-Using Your Class
-================
-
-From within any of your :doc:`Controller <controllers>` methods you
-can initialize your class using the standard::
-
- $this->load->library('someclass');
-
-Where *someclass* is the file name, without the ".php" file extension.
-You can submit the file name capitalized or lower case. CodeIgniter
-doesn't care.
-
-Once loaded you can access your class using the lower case version::
-
- $this->someclass->some_method();  // Object instances will always be lower case
-
-Passing Parameters When Initializing Your Class
-===============================================
-
-In the library loading method you can dynamically pass data as an
-array via the second parameter and it will be passed to your class
-constructor::
-
- $params = array('type' => 'large', 'color' => 'red');
-
- $this->load->library('someclass', $params);
-
-If you use this feature you must set up your class constructor to expect
-data::
-
- <?php defined('BASEPATH') OR exit('No direct script access allowed');
-
- class Someclass {
-
- public function __construct($params)
- {
- // Do something with $params
- }
- }
-
-You can also pass parameters stored in a config file. Simply create a
-config file named identically to the class file name and store it in
-your *application/config/* directory. Note that if you dynamically pass
-parameters as described above, the config file option will not be
-available.
-
-Utilizing CodeIgniter Resources within Your Library
-===================================================
-
-To access CodeIgniter's native resources within your library use the
-``get_instance()`` method. This method returns the CodeIgniter super
-object.
-
-Normally from within your controller methods you will call any of the
-available CodeIgniter methods using the ``$this`` construct::
-
- $this->load->helper('url');
- $this->load->library('session');
- $this->config->item('base_url');
- // etc.
-
-``$this``, however, only works directly within your controllers, your
-models, or your views. If you would like to use CodeIgniter's classes
-from within your own custom classes you can do so as follows:
-
-First, assign the CodeIgniter object to a variable::
-
- $CI =& get_instance();
-
-Once you've assigned the object to a variable, you'll use that variable
-*instead* of ``$this``::
-
- $CI =& get_instance();
-
- $CI->load->helper('url');
- $CI->load->library('session');
- $CI->config->item('base_url');
- // etc.
-
-.. note:: You'll notice that the above ``get_instance()`` function is being
- passed by reference::
-
- $CI =& get_instance();
-
- This is very important. Assigning by reference allows you to use the
- original CodeIgniter object rather than creating a copy of it.
-
-However, since a library is a class, it would be better if you
-take full advantage of the OOP principles. So, in order to
-be able to use the CodeIgniter super-object in all of the class
-methods, you're encouraged to assign it to a property instead::
-
- class Example_library {
-
- protected $CI;
-
- // We'll use a constructor, as you can't directly call a function
- // from a property definition.
- public function __construct()
- {
- // Assign the CodeIgniter super-object
- $this->CI =& get_instance();
- }
-
- public function foo()
- {
- $this->CI->load->helper('url');
- redirect();
- }
-
- public function bar()
- {
- echo $this->CI->config->item('base_url');
- }
-
- }
-
-Replacing Native Libraries with Your Versions
-=============================================
-
-Simply by naming your class files identically to a native library will
-cause CodeIgniter to use it instead of the native one. To use this
-feature you must name the file and the class declaration exactly the
-same as the native library. For example, to replace the native Email
-library you'll create a file named *application/libraries/Email.php*,
-and declare your class with::
-
- class CI_Email {
-
- }
-
-Note that most native classes are prefixed with CI\_.
-
-To load your library you'll see the standard loading method::
-
- $this->load->library('email');
-
-.. note:: At this time the Database classes can not be replaced with
- your own versions.
-
-Extending Native Libraries
-==========================
-
-If all you need to do is add some functionality to an existing library -
-perhaps add a method or two - then it's overkill to replace the entire
-library with your version. In this case it's better to simply extend the
-class. Extending a class is nearly identical to replacing a class with a
-couple exceptions:
-
-- The class declaration must extend the parent class.
-- Your new class name and filename must be prefixed with MY\_ (this
- item is configurable. See below.).
-
-For example, to extend the native Email class you'll create a file named
-*application/libraries/MY_Email.php*, and declare your class with::
-
- class MY_Email extends CI_Email {
-
- }
-
-If you need to use a constructor in your class make sure you
-extend the parent constructor::
-
- class MY_Email extends CI_Email {
-
- public function __construct($config = array())
- {
- parent::__construct($config);
- // Your own constructor code
- }
-
- }
-
-.. note:: Not all of the libraries have the same (or any) parameters
- in their constructor. Take a look at the library that you're
- extending first to see how it should be implemented.
-
-Loading Your Sub-class
-----------------------
-
-To load your sub-class you'll use the standard syntax normally used. DO
-NOT include your prefix. For example, to load the example above, which
-extends the Email class, you will use::
-
- $this->load->library('email');
-
-Once loaded you will use the class variable as you normally would for
-the class you are extending. In the case of the email class all calls
-will use::
-
- $this->email->some_method();
-
-Setting Your Own Prefix
------------------------
-
-To set your own sub-class prefix, open your
-*application/config/config.php* file and look for this item::
-
- $config['subclass_prefix'] = 'MY_';
-
-Please note that all native CodeIgniter libraries are prefixed with CI\_
-so DO NOT use that as your prefix.
diff --git a/user_guide_src/source/general/credits.rst b/user_guide_src/source/general/credits.rst
deleted file mode 100644
index d0f14b3bd..000000000
--- a/user_guide_src/source/general/credits.rst
+++ /dev/null
@@ -1,22 +0,0 @@
-#######
-Credits
-#######
-
-CodeIgniter was originally developed by `Rick Ellis <https://ellislab.com/>`_
-(CEO of `EllisLab, Inc. <https://ellislab.com/>`_). The framework was written for
-performance in the real world, with many of the class libraries, helpers, and
-sub-systems borrowed from the code-base of `ExpressionEngine
-<https://ellislab.com/expressionengine>`_.
-
-It was, for years, developed and maintained by EllisLab, the ExpressionEngine
-Development Team and a group of community members called the Reactor Team.
-
-In 2014, CodeIgniter was acquired by the `British Columbia Institute of Technology
-<http://www.bcit.ca/>`_ and was then officially announced as a community-maintained
-project.
-
-Bleeding edge development is spearheaded by the handpicked contributors
-of the Reactor Team.
-
-A hat tip goes to Ruby on Rails for inspiring us to create a PHP framework, and
-for bringing frameworks into the general consciousness of the web community. \ No newline at end of file
diff --git a/user_guide_src/source/general/drivers.rst b/user_guide_src/source/general/drivers.rst
deleted file mode 100644
index b64b0e75e..000000000
--- a/user_guide_src/source/general/drivers.rst
+++ /dev/null
@@ -1,40 +0,0 @@
-#########################
-Using CodeIgniter Drivers
-#########################
-
-Drivers are a special type of Library that has a parent class and any
-number of potential child classes. Child classes have access to the
-parent class, but not their siblings. Drivers provide an elegant syntax
-in your :doc:`controllers <controllers>` for libraries that benefit
-from or require being broken down into discrete classes.
-
-Drivers are found in the *system/libraries/* directory, in their own
-sub-directory which is identically named to the parent library class.
-Also inside that directory is a subdirectory named drivers, which
-contains all of the possible child class files.
-
-To use a driver you will initialize it within a controller using the
-following initialization method::
-
- $this->load->driver('class_name');
-
-Where class name is the name of the driver class you want to invoke. For
-example, to load a driver named "Some_parent" you would do this::
-
- $this->load->driver('some_parent');
-
-Methods of that class can then be invoked with::
-
- $this->some_parent->some_method();
-
-The child classes, the drivers themselves, can then be called directly
-through the parent class, without initializing them::
-
- $this->some_parent->child_one->some_method();
- $this->some_parent->child_two->another_method();
-
-Creating Your Own Drivers
-=========================
-
-Please read the section of the user guide that discusses how to :doc:`create
-your own drivers <creating_drivers>`. \ No newline at end of file
diff --git a/user_guide_src/source/general/environments.rst b/user_guide_src/source/general/environments.rst
deleted file mode 100644
index ac6f3235e..000000000
--- a/user_guide_src/source/general/environments.rst
+++ /dev/null
@@ -1,52 +0,0 @@
-##############################
-Handling Multiple Environments
-##############################
-
-Developers often desire different system behavior depending on whether
-an application is running in a development or production environment.
-For example, verbose error output is something that would be useful
-while developing an application, but it may also pose a security issue
-when "live".
-
-The ENVIRONMENT Constant
-========================
-
-By default, CodeIgniter comes with the environment constant set to use
-the value provided in ``$_SERVER['CI_ENV']``, otherwise defaults to
-'development'. At the top of index.php, you will see::
-
- define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'development');
-
-This server variable can be set in your .htaccess file, or Apache
-config using `SetEnv <https://httpd.apache.org/docs/2.2/mod/mod_env.html#setenv>`_.
-Alternative methods are available for nginx and other servers, or you can
-remove this logic entirely and set the constant based on the server's IP address.
-
-In addition to affecting some basic framework behavior (see the next
-section), you may use this constant in your own development to
-differentiate between which environment you are running in.
-
-Effects On Default Framework Behavior
-=====================================
-
-There are some places in the CodeIgniter system where the ENVIRONMENT
-constant is used. This section describes how default framework behavior
-is affected.
-
-Error Reporting
----------------
-
-Setting the ENVIRONMENT constant to a value of 'development' will cause
-all PHP errors to be rendered to the browser when they occur.
-Conversely, setting the constant to 'production' will disable all error
-output. Disabling error reporting in production is a :doc:`good security
-practice <security>`.
-
-Configuration Files
--------------------
-
-Optionally, you can have CodeIgniter load environment-specific
-configuration files. This may be useful for managing things like
-differing API keys across multiple environments. This is described in
-more detail in the environment section of the :doc:`Config Class
-<../libraries/config>` documentation. \ No newline at end of file
diff --git a/user_guide_src/source/general/errors.rst b/user_guide_src/source/general/errors.rst
deleted file mode 100644
index a1cc3517a..000000000
--- a/user_guide_src/source/general/errors.rst
+++ /dev/null
@@ -1,120 +0,0 @@
-##############
-Error Handling
-##############
-
-CodeIgniter lets you build error reporting into your applications using
-the functions described below. In addition, it has an error logging
-class that permits error and debugging messages to be saved as text
-files.
-
-.. note:: By default, CodeIgniter displays all PHP errors. You might
- wish to change this behavior once your development is complete. You'll
- find the error_reporting() function located at the top of your main
- index.php file. Disabling error reporting will NOT prevent log files
- from being written if there are errors.
-
-Unlike most systems in CodeIgniter, the error functions are simple
-procedural interfaces that are available globally throughout the
-application. This approach permits error messages to get triggered
-without having to worry about class/function scoping.
-
-CodeIgniter also returns a status code whenever a portion of the core
-calls ``exit()``. This exit status code is separate from the HTTP status
-code, and serves as a notice to other processes that may be watching of
-whether the script completed successfully, or if not, what kind of
-problem it encountered that caused it to abort. These values are
-defined in *application/config/constants.php*. While exit status codes
-are most useful in CLI settings, returning the proper code helps server
-software keep track of your scripts and the health of your application.
-
-The following functions let you generate errors:
-
-.. php:function:: show_error($message, $status_code, $heading = 'An Error Was Encountered')
-
- :param mixed $message: Error message
- :param int $status_code: HTTP Response status code
- :param string $heading: Error page heading
- :rtype: void
-
- This function will display the error message supplied to it using
- the error template appropriate to your execution::
-
- application/views/errors/html/error_general.php
-
- or:
-
- application/views/errors/cli/error_general.php
-
- The optional parameter ``$status_code`` determines what HTTP status
- code should be sent with the error. If ``$status_code`` is less
- than 100, the HTTP status code will be set to 500, and the exit
- status code will be set to ``$status_code + EXIT__AUTO_MIN``.
- If that value is larger than ``EXIT__AUTO_MAX``, or if
- ``$status_code`` is 100 or higher, the exit status code will be set
- to ``EXIT_ERROR``.
- You can check in *application/config/constants.php* for more detail.
-
-.. php:function:: show_404($page = '', $log_error = TRUE)
-
- :param string $page: URI string
- :param bool $log_error: Whether to log the error
- :rtype: void
-
- This function will display the 404 error message supplied to it
- using the error template appropriate to your execution::
-
- application/views/errors/html/error_404.php
-
- or:
-
- application/views/errors/cli/error_404.php
-
- The function expects the string passed to it to be the file path to
- the page that isn't found. The exit status code will be set to
- ``EXIT_UNKNOWN_FILE``.
- Note that CodeIgniter automatically shows 404 messages if
- controllers are not found.
-
- CodeIgniter automatically logs any ``show_404()`` calls. Setting the
- optional second parameter to FALSE will skip logging.
-
-.. php:function:: log_message($level, $message)
-
- :param string $level: Log level: 'error', 'debug' or 'info'
- :param string $message: Message to log
- :rtype: void
-
- This function lets you write messages to your log files. You must
- supply one of three "levels" in the first parameter, indicating what
- type of message it is (debug, error, info), with the message itself
- in the second parameter.
-
- Example::
-
- if ($some_var == '')
- {
- log_message('error', 'Some variable did not contain a value.');
- }
- else
- {
- log_message('debug', 'Some variable was correctly set');
- }
-
- log_message('info', 'The purpose of some variable is to provide some value.');
-
- There are three message types:
-
- #. Error Messages. These are actual errors, such as PHP errors or
- user errors.
- #. Debug Messages. These are messages that assist in debugging. For
- example, if a class has been initialized, you could log this as
- debugging info.
- #. Informational Messages. These are the lowest priority messages,
- simply giving information regarding some process.
-
- .. note:: In order for the log file to actually be written, the
- *logs/* directory must be writable. In addition, you must
- set the "threshold" for logging in
- *application/config/config.php*. You might, for example,
- only want error messages to be logged, and not the other
- two types. If you set it to zero logging will be disabled.
diff --git a/user_guide_src/source/general/helpers.rst b/user_guide_src/source/general/helpers.rst
deleted file mode 100644
index d171aa8ed..000000000
--- a/user_guide_src/source/general/helpers.rst
+++ /dev/null
@@ -1,145 +0,0 @@
-################
-Helper Functions
-################
-
-Helpers, as the name suggests, help you with tasks. Each helper file is
-simply a collection of functions in a particular category. There are **URL
-Helpers**, that assist in creating links, there are Form Helpers that help
-you create form elements, **Text Helpers** perform various text formatting
-routines, **Cookie Helpers** set and read cookies, File Helpers help you
-deal with files, etc.
-
-Unlike most other systems in CodeIgniter, Helpers are not written in an
-Object Oriented format. They are simple, procedural functions. Each
-helper function performs one specific task, with no dependence on other
-functions.
-
-CodeIgniter does not load Helper Files by default, so the first step in
-using a Helper is to load it. Once loaded, it becomes globally available
-in your :doc:`controller <../general/controllers>` and
-:doc:`views <../general/views>`.
-
-Helpers are typically stored in your **system/helpers**, or
-**application/helpers directory**. CodeIgniter will look first in your
-**application/helpers directory**. If the directory does not exist or the
-specified helper is not located there CI will instead look in your
-global *system/helpers/* directory.
-
-Loading a Helper
-================
-
-Loading a helper file is quite simple using the following method::
-
- $this->load->helper('name');
-
-Where **name** is the file name of the helper, without the .php file
-extension or the "helper" part.
-
-For example, to load the **URL Helper** file, which is named
-**url_helper.php**, you would do this::
-
- $this->load->helper('url');
-
-A helper can be loaded anywhere within your controller methods (or
-even within your View files, although that's not a good practice), as
-long as you load it before you use it. You can load your helpers in your
-controller constructor so that they become available automatically in
-any function, or you can load a helper in a specific function that needs
-it.
-
-.. note:: The Helper loading method above does not return a value, so
- don't try to assign it to a variable. Just use it as shown.
-
-Loading Multiple Helpers
-========================
-
-If you need to load more than one helper you can specify them in an
-array, like this::
-
- $this->load->helper(
- array('helper1', 'helper2', 'helper3')
- );
-
-Auto-loading Helpers
-====================
-
-If you find that you need a particular helper globally throughout your
-application, you can tell CodeIgniter to auto-load it during system
-initialization. This is done by opening the **application/config/autoload.php**
-file and adding the helper to the autoload array.
-
-Using a Helper
-==============
-
-Once you've loaded the Helper File containing the function you intend to
-use, you'll call it the way you would a standard PHP function.
-
-For example, to create a link using the ``anchor()`` function in one of
-your view files you would do this::
-
- <?php echo anchor('blog/comments', 'Click Here');?>
-
-Where "Click Here" is the name of the link, and "blog/comments" is the
-URI to the controller/method you wish to link to.
-
-"Extending" Helpers
-===================
-
-To "extend" Helpers, create a file in your **application/helpers/** folder
-with an identical name to the existing Helper, but prefixed with **MY\_**
-(this item is configurable. See below.).
-
-If all you need to do is add some functionality to an existing helper -
-perhaps add a function or two, or change how a particular helper
-function operates - then it's overkill to replace the entire helper with
-your version. In this case it's better to simply "extend" the Helper.
-
-.. note:: The term "extend" is used loosely since Helper functions are
- procedural and discrete and cannot be extended in the traditional
- programmatic sense. Under the hood, this gives you the ability to
- add to or or to replace the functions a Helper provides.
-
-For example, to extend the native **Array Helper** you'll create a file
-named **application/helpers/MY_array_helper.php**, and add or override
-functions::
-
- // any_in_array() is not in the Array Helper, so it defines a new function
- function any_in_array($needle, $haystack)
- {
- $needle = is_array($needle) ? $needle : array($needle);
-
- foreach ($needle as $item)
- {
- if (in_array($item, $haystack))
- {
- return TRUE;
- }
- }
-
- return FALSE;
- }
-
- // random_element() is included in Array Helper, so it overrides the native function
- function random_element($array)
- {
- shuffle($array);
- return array_pop($array);
- }
-
-Setting Your Own Prefix
------------------------
-
-The filename prefix for "extending" Helpers is the same used to extend
-libraries and core classes. To set your own prefix, open your
-**application/config/config.php** file and look for this item::
-
- $config['subclass_prefix'] = 'MY_';
-
-Please note that all native CodeIgniter libraries are prefixed with **CI\_**
-so DO NOT use that as your prefix.
-
-Now What?
-=========
-
-In the Table of Contents you'll find a list of all the available Helper
-Files. Browse each one to see what they do. \ No newline at end of file
diff --git a/user_guide_src/source/general/hooks.rst b/user_guide_src/source/general/hooks.rst
deleted file mode 100644
index 6cc3407a3..000000000
--- a/user_guide_src/source/general/hooks.rst
+++ /dev/null
@@ -1,127 +0,0 @@
-####################################
-Hooks - Extending the Framework Core
-####################################
-
-CodeIgniter's Hooks feature provides a means to tap into and modify the
-inner workings of the framework without hacking the core files. When
-CodeIgniter runs it follows a specific execution process, diagramed in
-the :doc:`Application Flow <../overview/appflow>` page. There may be
-instances, however, where you'd like to cause some action to take place
-at a particular stage in the execution process. For example, you might
-want to run a script right before your controllers get loaded, or right
-after, or you might want to trigger one of your own scripts in some
-other location.
-
-Enabling Hooks
-==============
-
-The hooks feature can be globally enabled/disabled by setting the
-following item in the **application/config/config.php** file::
-
- $config['enable_hooks'] = TRUE;
-
-Defining a Hook
-===============
-
-Hooks are defined in the **application/config/hooks.php** file.
-Each hook is specified as an array with this prototype::
-
- $hook['pre_controller'] = array(
- 'class' => 'MyClass',
- 'function' => 'Myfunction',
- 'filename' => 'Myclass.php',
- 'filepath' => 'hooks',
- 'params' => array('beer', 'wine', 'snacks')
- );
-
-**Notes:**
-
-The array index correlates to the name of the particular hook point you
-want to use. In the above example the hook point is pre_controller. A
-list of hook points is found below. The following items should be
-defined in your associative hook array:
-
-- **class** The name of the class you wish to invoke. If you prefer to
- use a procedural function instead of a class, leave this item blank.
-- **function** The function (or method) name you wish to call.
-- **filename** The file name containing your class/function.
-- **filepath** The name of the directory containing your script.
- Note:
- Your script must be located in a directory INSIDE your *application/*
- directory, so the file path is relative to that directory. For example,
- if your script is located in *application/hooks/*, you will simply use
- 'hooks' as your filepath. If your script is located in
- *application/hooks/utilities/* you will use 'hooks/utilities' as your
- filepath. No trailing slash.
-- **params** Any parameters you wish to pass to your script. This item
- is optional.
-
-You can also use lambda/anoymous functions (or closures) as hooks, with
-a simpler syntax::
-
- $hook['post_controller'] = function()
- {
- /* do something here */
- };
-
-Multiple Calls to the Same Hook
-===============================
-
-If want to use the same hook point with more than one script, simply
-make your array declaration multi-dimensional, like this::
-
- $hook['pre_controller'][] = array(
- 'class' => 'MyClass',
- 'function' => 'MyMethod',
- 'filename' => 'Myclass.php',
- 'filepath' => 'hooks',
- 'params' => array('beer', 'wine', 'snacks')
- );
-
- $hook['pre_controller'][] = array(
- 'class' => 'MyOtherClass',
- 'function' => 'MyOtherMethod',
- 'filename' => 'Myotherclass.php',
- 'filepath' => 'hooks',
- 'params' => array('red', 'yellow', 'blue')
- );
-
-Notice the brackets after each array index::
-
- $hook['pre_controller'][]
-
-This permits you to have the same hook point with multiple scripts. The
-order you define your array will be the execution order.
-
-Hook Points
-===========
-
-The following is a list of available hook points.
-
-- **pre_system**
- Called very early during system execution. Only the benchmark and
- hooks class have been loaded at this point. No routing or other
- processes have happened.
-- **pre_controller**
- Called immediately prior to any of your controllers being called.
- All base classes, routing, and security checks have been done.
-- **post_controller_constructor**
- Called immediately after your controller is instantiated, but prior
- to any method calls happening.
-- **post_controller**
- Called immediately after your controller is fully executed.
-- **display_override**
- Overrides the ``_display()`` method, used to send the finalized page
- to the web browser at the end of system execution. This permits you
- to use your own display methodology. Note that you will need to
- reference the CI superobject with ``$this->CI =& get_instance()`` and
- then the finalized data will be available by calling
- ``$this->CI->output->get_output()``.
-- **cache_override**
- Enables you to call your own method instead of the ``_display_cache()``
- method in the :doc:`Output Library <../libraries/output>`. This permits
- you to use your own cache display mechanism.
-- **post_system**
- Called after the final rendered page is sent to the browser, at the
- end of system execution after the finalized data is sent to the
- browser. \ No newline at end of file
diff --git a/user_guide_src/source/general/index.rst b/user_guide_src/source/general/index.rst
deleted file mode 100644
index 195c4a98a..000000000
--- a/user_guide_src/source/general/index.rst
+++ /dev/null
@@ -1,33 +0,0 @@
-##############
-General Topics
-##############
-
-.. toctree::
- :titlesonly:
-
- urls
- controllers
- reserved_names
- views
- models
- Helpers <helpers>
- libraries
- creating_libraries
- drivers
- creating_drivers
- core_classes
- ancillary_classes
- hooks
- autoloader
- common_functions
- compatibility_functions
- routing
- errors
- Caching <caching>
- profiling
- cli
- managing_apps
- environments
- alternative_php
- security
- PHP Style Guide <styleguide> \ No newline at end of file
diff --git a/user_guide_src/source/general/libraries.rst b/user_guide_src/source/general/libraries.rst
deleted file mode 100644
index 9bbda51bb..000000000
--- a/user_guide_src/source/general/libraries.rst
+++ /dev/null
@@ -1,32 +0,0 @@
-###########################
-Using CodeIgniter Libraries
-###########################
-
-All of the available libraries are located in your *system/libraries/*
-directory. In most cases, to use one of these classes involves initializing
-it within a :doc:`controller <controllers>` using the following
-initialization method::
-
- $this->load->library('class_name');
-
-Where 'class_name' is the name of the class you want to invoke. For
-example, to load the :doc:`Form Validation Library
-<../libraries/form_validation>` you would do this::
-
- $this->load->library('form_validation');
-
-Once initialized you can use it as indicated in the user guide page
-corresponding to that class.
-
-Additionally, multiple libraries can be loaded at the same time by
-passing an array of libraries to the load method.
-
-Example::
-
- $this->load->library(array('email', 'table'));
-
-Creating Your Own Libraries
-===========================
-
-Please read the section of the user guide that discusses how to
-:doc:`create your own libraries <creating_libraries>`. \ No newline at end of file
diff --git a/user_guide_src/source/general/managing_apps.rst b/user_guide_src/source/general/managing_apps.rst
deleted file mode 100644
index 4861ba71a..000000000
--- a/user_guide_src/source/general/managing_apps.rst
+++ /dev/null
@@ -1,61 +0,0 @@
-##########################
-Managing your Applications
-##########################
-
-By default it is assumed that you only intend to use CodeIgniter to
-manage one application, which you will build in your *application/*
-directory. It is possible, however, to have multiple sets of
-applications that share a single CodeIgniter installation, or even to
-rename or relocate your application directory.
-
-Renaming the Application Directory
-==================================
-
-If you would like to rename your application directory you may do so
-as long as you open your main index.php file and set its name using
-the ``$application_folder`` variable::
-
- $application_folder = 'application';
-
-Relocating your Application Directory
-=====================================
-
-It is possible to move your application directory to a different
-location on your server than your web root. To do so open
-your main index.php and set a *full server path* in the
-``$application_folder`` variable::
-
- $application_folder = '/path/to/your/application';
-
-Running Multiple Applications with one CodeIgniter Installation
-===============================================================
-
-If you would like to share a common CodeIgniter installation to manage
-several different applications simply put all of the directories located
-inside your application directory into their own sub-directory.
-
-For example, let's say you want to create two applications, named "foo"
-and "bar". You could structure your application directories like this::
-
- applications/foo/
- applications/foo/config/
- applications/foo/controllers/
- applications/foo/libraries/
- applications/foo/models/
- applications/foo/views/
- applications/bar/
- applications/bar/config/
- applications/bar/controllers/
- applications/bar/libraries/
- applications/bar/models/
- applications/bar/views/
-
-To select a particular application for use requires that you open your
-main index.php file and set the ``$application_folder`` variable. For
-example, to select the "foo" application for use you would do this::
-
- $application_folder = 'applications/foo';
-
-.. note:: Each of your applications will need its own index.php file
- which calls the desired application. The index.php file can be named
- anything you want. \ No newline at end of file
diff --git a/user_guide_src/source/general/models.rst b/user_guide_src/source/general/models.rst
deleted file mode 100644
index 0b20164e9..000000000
--- a/user_guide_src/source/general/models.rst
+++ /dev/null
@@ -1,167 +0,0 @@
-######
-Models
-######
-
-Models are **optionally** available for those who want to use a more
-traditional MVC approach.
-
-.. contents:: Page Contents
-
-What is a Model?
-================
-
-Models are PHP classes that are designed to work with information in
-your database. For example, let's say you use CodeIgniter to manage a
-blog. You might have a model class that contains functions to insert,
-update, and retrieve your blog data. Here is an example of what such a
-model class might look like::
-
- class Blog_model extends CI_Model {
-
- public $title;
- public $content;
- public $date;
-
- public function get_last_ten_entries()
- {
- $query = $this->db->get('entries', 10);
- return $query->result();
- }
-
- public function insert_entry()
- {
- $this->title = $_POST['title']; // please read the below note
- $this->content = $_POST['content'];
- $this->date = time();
-
- $this->db->insert('entries', $this);
- }
-
- public function update_entry()
- {
- $this->title = $_POST['title'];
- $this->content = $_POST['content'];
- $this->date = time();
-
- $this->db->update('entries', $this, array('id' => $_POST['id']));
- }
-
- }
-
-.. note:: The methods in the above example use the :doc:`Query Builder
- <../database/query_builder>` database methods.
-
-.. note:: For the sake of simplicity in this example we're using ``$_POST``
- directly. This is generally bad practice, and a more common approach
- would be to use the :doc:`Input Library <../libraries/input>`
- ``$this->input->post('title')``.
-
-Anatomy of a Model
-==================
-
-Model classes are stored in your **application/models/** directory.
-They can be nested within sub-directories if you want this type of
-organization.
-
-The basic prototype for a model class is this::
-
- class Model_name extends CI_Model {
-
- }
-
-Where **Model_name** is the name of your class. Class names **must** have
-the first letter capitalized with the rest of the name lowercase. Make
-sure your class extends the base Model class.
-
-The file name must match the class name. For example, if this is your class::
-
- class User_model extends CI_Model {
-
- }
-
-Your file will be this::
-
- application/models/User_model.php
-
-Loading a Model
-===============
-
-Your models will typically be loaded and called from within your
-:doc:`controller <controllers>` methods. To load a model you will use
-the following method::
-
- $this->load->model('model_name');
-
-If your model is located in a sub-directory, include the relative path
-from your models directory. For example, if you have a model located at
-*application/models/blog/Queries.php* you'll load it using::
-
- $this->load->model('blog/queries');
-
-Once loaded, you will access your model methods using an object with the
-same name as your class::
-
- $this->load->model('model_name');
-
- $this->model_name->method();
-
-If you would like your model assigned to a different object name you can
-specify it via the second parameter of the loading method::
-
- $this->load->model('model_name', 'foobar');
-
- $this->foobar->method();
-
-Here is an example of a controller, that loads a model, then serves a
-view::
-
- class Blog_controller extends CI_Controller {
-
- public function blog()
- {
- $this->load->model('blog');
-
- $data['query'] = $this->blog->get_last_ten_entries();
-
- $this->load->view('blog', $data);
- }
- }
-
-
-Auto-loading Models
-===================
-
-If you find that you need a particular model globally throughout your
-application, you can tell CodeIgniter to auto-load it during system
-initialization. This is done by opening the
-**application/config/autoload.php** file and adding the model to the
-autoload array.
-
-Connecting to your Database
-===========================
-
-When a model is loaded it does **NOT** connect automatically to your
-database. The following options for connecting are available to you:
-
-- You can connect using the standard database methods :doc:`described
- here <../database/connecting>`, either from within your
- Controller class or your Model class.
-- You can tell the model loading method to auto-connect by passing
- TRUE (boolean) via the third parameter, and connectivity settings,
- as defined in your database config file will be used::
-
- $this->load->model('model_name', '', TRUE);
-
-- You can manually pass database connectivity settings via the third
- parameter::
-
- $config['hostname'] = 'localhost';
- $config['username'] = 'myusername';
- $config['password'] = 'mypassword';
- $config['database'] = 'mydatabase';
- $config['dbdriver'] = 'mysqli';
- $config['dbprefix'] = '';
- $config['pconnect'] = FALSE;
- $config['db_debug'] = TRUE;
-
- $this->load->model('model_name', '', $config);
diff --git a/user_guide_src/source/general/profiling.rst b/user_guide_src/source/general/profiling.rst
deleted file mode 100644
index 2716d1781..000000000
--- a/user_guide_src/source/general/profiling.rst
+++ /dev/null
@@ -1,90 +0,0 @@
-##########################
-Profiling Your Application
-##########################
-
-The Profiler Class will display benchmark results, queries you have run,
-and ``$_POST`` data at the bottom of your pages. This information can be
-useful during development in order to help with debugging and
-optimization.
-
-Initializing the Class
-======================
-
-.. important:: This class does NOT need to be initialized. It is loaded
- automatically by the :doc:`Output Library <../libraries/output>`
- if profiling is enabled as shown below.
-
-Enabling the Profiler
-=====================
-
-To enable the profiler place the following line anywhere within your
-:doc:`Controller <controllers>` methods::
-
- $this->output->enable_profiler(TRUE);
-
-When enabled a report will be generated and inserted at the bottom of
-your pages.
-
-To disable the profiler you will use::
-
- $this->output->enable_profiler(FALSE);
-
-Setting Benchmark Points
-========================
-
-In order for the Profiler to compile and display your benchmark data you
-must name your mark points using specific syntax.
-
-Please read the information on setting Benchmark points in the
-:doc:`Benchmark Library <../libraries/benchmark>` page.
-
-Enabling and Disabling Profiler Sections
-========================================
-
-Each section of Profiler data can be enabled or disabled by setting a
-corresponding config variable to TRUE or FALSE. This can be done one of
-two ways. First, you can set application wide defaults with the
-*application/config/profiler.php* config file.
-
-Example::
-
- $config['config'] = FALSE;
- $config['queries'] = FALSE;
-
-In your controllers, you can override the defaults and config file
-values by calling the ``set_profiler_sections()`` method of the
-:doc:`Output Library <../libraries/output>`::
-
- $sections = array(
- 'config' => TRUE,
- 'queries' => TRUE
- );
-
- $this->output->set_profiler_sections($sections);
-
-Available sections and the array key used to access them are described
-in the table below.
-
-======================= =================================================================== ========
-Key Description Default
-======================= =================================================================== ========
-**benchmarks** Elapsed time of Benchmark points and total execution time TRUE
-**config** CodeIgniter Config variables TRUE
-**controller_info** The Controller class and method requested TRUE
-**get** Any GET data passed in the request TRUE
-**http_headers** The HTTP headers for the current request TRUE
-**memory_usage** Amount of memory consumed by the current request, in bytes TRUE
-**post** Any POST data passed in the request TRUE
-**queries** Listing of all database queries executed, including execution time TRUE
-**uri_string** The URI of the current request TRUE
-**session_data** Data stored in the current session TRUE
-**query_toggle_count** The number of queries after which the query block will default to 25
- hidden.
-======================= =================================================================== ========
-
-.. note:: Disabling the :doc:`save_queries </database/configuration>` setting in
- your database configuration will also effectively disable profiling for
- database queries and render the 'queries' setting above useless. You can
- optionally override this setting with ``$this->db->save_queries = TRUE;``.
- Without this setting you won't be able to view the queries or the
- `last_query <database/helpers>`. \ No newline at end of file
diff --git a/user_guide_src/source/general/requirements.rst b/user_guide_src/source/general/requirements.rst
deleted file mode 100644
index f2729f3d5..000000000
--- a/user_guide_src/source/general/requirements.rst
+++ /dev/null
@@ -1,21 +0,0 @@
-###################
-Server Requirements
-###################
-
-`PHP <http://php.net/>`_ version 5.6 or newer is recommended.
-
-It should work on 5.3.7 as well, but we strongly advise you NOT to run
-such old versions of PHP, because of potential security and performance
-issues, as well as missing features.
-
-A database is required for most web application programming.
-Currently supported databases are:
-
- - MySQL (5.1+) via the *mysql* (deprecated), *mysqli* and *pdo* drivers
- - Oracle via the *oci8* and *pdo* drivers
- - PostgreSQL via the *postgre* and *pdo* drivers
- - MS SQL via the *mssql*, *sqlsrv* (version 2005 and above only) and *pdo* drivers
- - SQLite via the *sqlite* (version 2), *sqlite3* (version 3) and *pdo* drivers
- - CUBRID via the *cubrid* and *pdo* drivers
- - Interbase/Firebird via the *ibase* and *pdo* drivers
- - ODBC via the *odbc* and *pdo* drivers (you should know that ODBC is actually an abstraction layer) \ No newline at end of file
diff --git a/user_guide_src/source/general/reserved_names.rst b/user_guide_src/source/general/reserved_names.rst
deleted file mode 100644
index 5d745cba6..000000000
--- a/user_guide_src/source/general/reserved_names.rst
+++ /dev/null
@@ -1,88 +0,0 @@
-##############
-Reserved Names
-##############
-
-In order to help out, CodeIgniter uses a series of function, method,
-class and variable names in its operation. Because of this, some names
-cannot be used by a developer. Following is a list of reserved names
-that cannot be used.
-
-Controller names
-----------------
-
-Since your controller classes will extend the main application
-controller you must be careful not to name your methods identically to
-the ones used by that class, otherwise your local methods will
-override them. The following is a list of reserved names. Do not name
-your controller any of these:
-
-- CI_Controller
-- Default
-- index
-
-Functions
----------
-
-- :php:func:`is_php()`
-- :php:func:`is_really_writable()`
-- ``load_class()``
-- ``is_loaded()``
-- ``get_config()``
-- :php:func:`config_item()`
-- :php:func:`show_error()`
-- :php:func:`show_404()`
-- :php:func:`log_message()`
-- :php:func:`set_status_header()`
-- :php:func:`get_mimes()`
-- :php:func:`html_escape()`
-- :php:func:`remove_invisible_characters()`
-- :php:func:`is_https()`
-- :php:func:`function_usable()`
-- :php:func:`get_instance()`
-- ``_error_handler()``
-- ``_exception_handler()``
-- ``_stringify_attributes()``
-
-Variables
----------
-
-- ``$config``
-- ``$db``
-- ``$lang``
-
-Constants
----------
-
-- ENVIRONMENT
-- FCPATH
-- SELF
-- BASEPATH
-- APPPATH
-- VIEWPATH
-- CI_VERSION
-- MB_ENABLED
-- ICONV_ENABLED
-- UTF8_ENABLED
-- FILE_READ_MODE
-- FILE_WRITE_MODE
-- DIR_READ_MODE
-- DIR_WRITE_MODE
-- FOPEN_READ
-- FOPEN_READ_WRITE
-- FOPEN_WRITE_CREATE_DESTRUCTIVE
-- FOPEN_READ_WRITE_CREATE_DESTRUCTIVE
-- FOPEN_WRITE_CREATE
-- FOPEN_READ_WRITE_CREATE
-- FOPEN_WRITE_CREATE_STRICT
-- FOPEN_READ_WRITE_CREATE_STRICT
-- SHOW_DEBUG_BACKTRACE
-- EXIT_SUCCESS
-- EXIT_ERROR
-- EXIT_CONFIG
-- EXIT_UNKNOWN_FILE
-- EXIT_UNKNOWN_CLASS
-- EXIT_UNKNOWN_METHOD
-- EXIT_USER_INPUT
-- EXIT_DATABASE
-- EXIT__AUTO_MIN
-- EXIT__AUTO_MAX \ No newline at end of file
diff --git a/user_guide_src/source/general/routing.rst b/user_guide_src/source/general/routing.rst
deleted file mode 100644
index 909289d8d..000000000
--- a/user_guide_src/source/general/routing.rst
+++ /dev/null
@@ -1,207 +0,0 @@
-###########
-URI Routing
-###########
-
-Typically there is a one-to-one relationship between a URL string and
-its corresponding controller class/method. The segments in a URI
-normally follow this pattern::
-
- example.com/class/function/id/
-
-In some instances, however, you may want to remap this relationship so
-that a different class/method can be called instead of the one
-corresponding to the URL.
-
-For example, let's say you want your URLs to have this prototype::
-
- example.com/product/1/
- example.com/product/2/
- example.com/product/3/
- example.com/product/4/
-
-Normally the second segment of the URL is reserved for the method
-name, but in the example above it instead has a product ID. To
-overcome this, CodeIgniter allows you to remap the URI handler.
-
-Setting your own routing rules
-==============================
-
-Routing rules are defined in your *application/config/routes.php* file.
-In it you'll see an array called ``$route`` that permits you to specify
-your own routing criteria. Routes can either be specified using wildcards
-or Regular Expressions.
-
-Wildcards
-=========
-
-A typical wildcard route might look something like this::
-
- $route['product/:num'] = 'catalog/product_lookup';
-
-In a route, the array key contains the URI to be matched, while the
-array value contains the destination it should be re-routed to. In the
-above example, if the literal word "product" is found in the first
-segment of the URL, and a number is found in the second segment, the
-"catalog" class and the "product_lookup" method are instead used.
-
-You can match literal values or you can use two wildcard types:
-
-**(:num)** will match a segment containing only numbers.
-**(:any)** will match a segment containing any character (except for '/', which is the segment delimiter).
-
-.. note:: Wildcards are actually aliases for regular expressions, with
- **:any** being translated to **[^/]+** and **:num** to **[0-9]+**,
- respectively.
-
-.. note:: Routes will run in the order they are defined. Higher routes
- will always take precedence over lower ones.
-
-.. note:: Route rules are not filters! Setting a rule of e.g.
- 'foo/bar/(:num)' will not prevent controller *Foo* and method
- *bar* to be called with a non-numeric value if that is a valid
- route.
-
-Examples
-========
-
-Here are a few routing examples::
-
- $route['journals'] = 'blogs';
-
-A URL containing the word "journals" in the first segment will be
-remapped to the "blogs" class.
-
-::
-
- $route['blog/joe'] = 'blogs/users/34';
-
-A URL containing the segments blog/joe will be remapped to the "blogs"
-class and the "users" method. The ID will be set to "34".
-
-::
-
- $route['product/(:any)'] = 'catalog/product_lookup';
-
-A URL with "product" as the first segment, and anything in the second
-will be remapped to the "catalog" class and the "product_lookup"
-method.
-
-::
-
- $route['product/(:num)'] = 'catalog/product_lookup_by_id/$1';
-
-A URL with "product" as the first segment, and a number in the second
-will be remapped to the "catalog" class and the
-"product_lookup_by_id" method passing in the match as a variable to
-the method.
-
-.. important:: Do not use leading/trailing slashes.
-
-Regular Expressions
-===================
-
-If you prefer you can use regular expressions to define your routing
-rules. Any valid regular expression is allowed, as are back-references.
-
-.. note:: If you use back-references you must use the dollar syntax
- rather than the double backslash syntax.
-
-A typical RegEx route might look something like this::
-
- $route['products/([a-z]+)/(\d+)'] = '$1/id_$2';
-
-In the above example, a URI similar to products/shirts/123 would instead
-call the "shirts" controller class and the "id_123" method.
-
-With regular expressions, you can also catch multiple segments at once.
-For example, if a user accesses a password protected area of your web
-application and you wish to be able to redirect them back to the same
-page after they log in, you may find this example useful::
-
- $route['login/(.+)'] = 'auth/login/$1';
-
-.. note:: In the above example, if the ``$1`` placeholder contains a
- slash, it will still be split into multiple parameters when
- passed to ``Auth::login()``.
-
-For those of you who don't know regular expressions and want to learn
-more about them, `regular-expressions.info <http://www.regular-expressions.info/>`_
-might be a good starting point.
-
-.. note:: You can also mix and match wildcards with regular expressions.
-
-Callbacks
-=========
-
-You can also use callbacks in place of the normal routing rules to process
-the back-references. Example::
-
- $route['products/([a-zA-Z]+)/edit/(\d+)'] = function ($product_type, $id)
- {
- return 'catalog/product_edit/' . strtolower($product_type) . '/' . $id;
- };
-
-Using HTTP verbs in routes
-==========================
-
-It is possible to use HTTP verbs (request method) to define your routing rules.
-This is particularly useful when building RESTful applications. You can use standard HTTP
-verbs (GET, PUT, POST, DELETE, PATCH) or a custom one such (e.g. PURGE). HTTP verb rules
-are case-insensitive. All you need to do is to add the verb as an array key to your route.
-Example::
-
- $route['products']['put'] = 'product/insert';
-
-In the above example, a PUT request to URI "products" would call the ``Product::insert()``
-controller method.
-
-::
-
- $route['products/(:num)']['DELETE'] = 'product/delete/$1';
-
-A DELETE request to URL with "products" as first the segment and a number in the second will be
-mapped to the ``Product::delete()`` method, passing the numeric value as the first parameter.
-
-Using HTTP verbs is of course, optional.
-
-Reserved Routes
-===============
-
-There are three reserved routes::
-
- $route['default_controller'] = 'welcome';
-
-This route points to the action that should be executed if the URI contains
-no data, which will be the case when people load your root URL.
-The setting accepts a **controller/method** value and ``index()`` would be
-the default method if you don't specify one. In the above example, it is
-``Welcome::index()`` that would be called.
-
-.. note:: You can NOT use a directory as a part of this setting!
-
-You are encouraged to always have a default route as otherwise a 404 page
-will appear by default.
-
-::
-
- $route['404_override'] = '';
-
-This route indicates which controller class should be loaded if the
-requested controller is not found. It will override the default 404
-error page. Same per-directory rules as with 'default_controller'
-apply here as well.
-
-It won't affect to the ``show_404()`` function, which will
-continue loading the default *error_404.php* file at
-*application/views/errors/error_404.php*.
-
-::
-
- $route['translate_uri_dashes'] = FALSE;
-
-As evident by the boolean value, this is not exactly a route. This
-option enables you to automatically replace dashes ('-') with
-underscores in the controller and method URI segments, thus saving you
-additional route entries if you need to do that.
-This is required, because the dash isn't a valid class or method name
-character and would cause a fatal error if you try to use it.
diff --git a/user_guide_src/source/general/security.rst b/user_guide_src/source/general/security.rst
deleted file mode 100644
index 744a2c934..000000000
--- a/user_guide_src/source/general/security.rst
+++ /dev/null
@@ -1,200 +0,0 @@
-########
-Security
-########
-
-This page describes some "best practices" regarding web security, and
-details CodeIgniter's internal security features.
-
-.. note:: If you came here looking for a security contact, please refer to
- our `Contribution Guide <../contributing/index>`.
-
-URI Security
-============
-
-CodeIgniter is fairly restrictive regarding which characters it allows
-in your URI strings in order to help minimize the possibility that
-malicious data can be passed to your application. URIs may only contain
-the following:
-
-- Alpha-numeric text (latin characters only)
-- Tilde: ~
-- Percent sign: %
-- Period: .
-- Colon: :
-- Underscore: \_
-- Dash: -
-- Space
-
-Register_globals
-================
-
-During system initialization all global variables that are found to exist
-in the ``$_GET``, ``$_POST``, ``$_REQUEST`` and ``$_COOKIE`` are unset.
-
-The unsetting routine is effectively the same as *register_globals = off*.
-
-display_errors
-==============
-
-In production environments, it is typically desirable to "disable" PHP's
-error reporting by setting the internal *display_errors* flag to a value
-of 0. This disables native PHP errors from being rendered as output,
-which may potentially contain sensitive information.
-
-Setting CodeIgniter's **ENVIRONMENT** constant in index.php to a value of
-**\'production\'** will turn off these errors. In development mode, it is
-recommended that a value of 'development' is used. More information
-about differentiating between environments can be found on the
-:doc:`Handling Environments <environments>` page.
-
-magic_quotes_runtime
-====================
-
-The *magic_quotes_runtime* directive is turned off during system
-initialization so that you don't have to remove slashes when retrieving
-data from your database.
-
-**************
-Best Practices
-**************
-
-Before accepting any data into your application, whether it be POST data
-from a form submission, COOKIE data, URI data, XML-RPC data, or even
-data from the SERVER array, you are encouraged to practice this three
-step approach:
-
-#. Validate the data to ensure it conforms to the correct type, length,
- size, etc.
-#. Filter the data as if it were tainted.
-#. Escape the data before submitting it into your database or outputting
- it to a browser.
-
-CodeIgniter provides the following functions and tips to assist you
-in this process:
-
-XSS Filtering
-=============
-
-CodeIgniter comes with a Cross Site Scripting filter. This filter
-looks for commonly used techniques to embed malicious JavaScript into
-your data, or other types of code that attempt to hijack cookies or
-do other malicious things. The XSS Filter is described
-:doc:`here <../libraries/security>`.
-
-.. note:: XSS filtering should *only be performed on output*. Filtering
- input data may modify the data in undesirable ways, including
- stripping special characters from passwords, which reduces
- security instead of improving it.
-
-CSRF protection
-===============
-
-CSRF stands for Cross-Site Request Forgery, which is the process of an
-attacker tricking their victim into unknowingly submitting a request.
-
-CodeIgniter provides CSRF protection out of the box, which will get
-automatically triggered for every non-GET HTTP request, but also needs
-you to create your submit forms in a certain way. This is explained in
-the :doc:`Security Library <../libraries/security>` documentation.
-
-Password handling
-=================
-
-It is *critical* that you handle passwords in your application properly.
-
-Unfortunately, many developers don't know how to do that, and the web is
-full of outdated or otherwise wrongful advices, which doesn't help.
-
-We would like to give you a list of combined do's and don'ts to help you
-with that. Please read below.
-
-- DO NOT store passwords in plain-text format.
-
- Always **hash** your passwords.
-
-- DO NOT use Base64 or similar encoding for storing passwords.
-
- This is as good as storing them in plain-text. Really. Do **hashing**,
- not *encoding*.
-
- Encoding, and encryption too, are two-way processes. Passwords are
- secrets that must only be known to their owner, and thus must work
- only in one direction. Hashing does that - there's *no* un-hashing or
- de-hashing, but there is decoding and decryption.
-
-- DO NOT use weak or broken hashing algorithms like MD5 or SHA1.
-
- These algorithms are old, proven to be flawed, and not designed for
- password hashing in the first place.
-
- Also, DON'T invent your own algorithms.
-
- Only use strong password hashing algorithms like BCrypt, which is used
- in PHP's own `Password Hashing <http://php.net/password>`_ functions.
-
- Please use them, even if you're not running PHP 5.5+, CodeIgniter
- provides them for you.
-
-- DO NOT ever display or send a password in plain-text format!
-
- Even to the password's owner, if you need a "Forgotten password"
- feature, just randomly generate a new, one-time (this is also important)
- password and send that instead.
-
-- DO NOT put unnecessary limits on your users' passwords.
-
- If you're using a hashing algorithm other than BCrypt (which has a limit
- of 72 characters), you should set a relatively high limit on password
- lengths in order to mitigate DoS attacks - say, 1024 characters.
-
- Other than that however, there's no point in forcing a rule that a
- password can only be up to a number of characters, or that it can't
- contain a certain set of special characters.
-
- Not only does this **reduce** security instead of improving it, but
- there's literally no reason to do it. No technical limitations and
- no (practical) storage constraints apply once you've hashed them, none!
-
-Validate input data
-===================
-
-CodeIgniter has a :doc:`Form Validation Library
-<../libraries/form_validation>` that assists you in
-validating, filtering, and prepping your data.
-
-Even if that doesn't work for your use case however, be sure to always
-validate and sanitize all input data. For example, if you expect a numeric
-string for an input variable, you can check for that with ``is_numeric()``
-or ``ctype_digit()``. Always try to narrow down your checks to a certain
-pattern.
-
-Have it in mind that this includes not only ``$_POST`` and ``$_GET``
-variables, but also cookies, the user-agent string and basically
-*all data that is not created directly by your own code*.
-
-
-Escape all data before database insertion
-=========================================
-
-Never insert information into your database without escaping it.
-Please see the section that discusses :doc:`database queries
-<../database/queries>` for more information.
-
-Hide your files
-===============
-
-Another good security practice is to only leave your *index.php*
-and "assets" (e.g. .js, css and image files) under your server's
-*webroot* directory (most commonly named "htdocs/"). These are
-the only files that you would need to be accessible from the web.
-
-Allowing your visitors to see anything else would potentially
-allow them to access sensitive data, execute scripts, etc.
-
-If you're not allowed to do that, you can try using a .htaccess
-file to restrict access to those resources.
-
-CodeIgniter will have an index.html file in all of its
-directories in an attempt to hide some of this data, but have
-it in mind that this is not enough to prevent a serious
-attacker.
diff --git a/user_guide_src/source/general/styleguide.rst b/user_guide_src/source/general/styleguide.rst
deleted file mode 100644
index 9b4a84e14..000000000
--- a/user_guide_src/source/general/styleguide.rst
+++ /dev/null
@@ -1,636 +0,0 @@
-###############
-PHP Style Guide
-###############
-
-
-The following page describes the coding styles adhered to when
-contributing to the development of CodeIgniter. There is no requirement
-to use these styles in your own CodeIgniter application, though they
-are recommended.
-
-.. contents:: Table of Contents
-
-File Format
-===========
-
-Files should be saved with Unicode (UTF-8) encoding. The BOM should
-*not* be used. Unlike UTF-16 and UTF-32, there's no byte order to
-indicate in a UTF-8 encoded file, and the BOM can have a negative side
-effect in PHP of sending output, preventing the application from being
-able to set its own headers. Unix line endings should be used (LF).
-
-Here is how to apply these settings in some of the more common text
-editors. Instructions for your text editor may vary; check your text
-editor's documentation.
-
-TextMate
-''''''''
-
-#. Open the Application Preferences
-#. Click Advanced, and then the "Saving" tab
-#. In "File Encoding", select "UTF-8 (recommended)"
-#. In "Line Endings", select "LF (recommended)"
-#. *Optional:* Check "Use for existing files as well" if you wish to
- modify the line endings of files you open to your new preference.
-
-BBEdit
-''''''
-
-#. Open the Application Preferences
-#. Select "Text Encodings" on the left.
-#. In "Default text encoding for new documents", select "Unicode (UTF-8,
- no BOM)"
-#. *Optional:* In "If file's encoding can't be guessed, use", select
- "Unicode (UTF-8, no BOM)"
-#. Select "Text Files" on the left.
-#. In "Default line breaks", select "Mac OS X and Unix (LF)"
-
-PHP Closing Tag
-===============
-
-The PHP closing tag on a PHP document **?>** is optional to the PHP
-parser. However, if used, any whitespace following the closing tag,
-whether introduced by the developer, user, or an FTP application, can
-cause unwanted output, PHP errors, or if the latter are suppressed,
-blank pages. For this reason, all PHP files MUST OMIT the PHP closing
-tag and end with a single empty line instead.
-
-File Naming
-===========
-
-Class files must be named in a Ucfirst-like manner, while any other file name
-(configurations, views, generic scripts, etc.) should be in all lowercase.
-
-**INCORRECT**::
-
- somelibrary.php
- someLibrary.php
- SOMELIBRARY.php
- Some_Library.php
-
- Application_config.php
- Application_Config.php
- applicationConfig.php
-
-**CORRECT**::
-
- Somelibrary.php
- Some_library.php
-
- applicationconfig.php
- application_config.php
-
-Furthermore, class file names should match the name of the class itself.
-For example, if you have a class named `Myclass`, then its filename must
-be **Myclass.php**.
-
-Class and Method Naming
-=======================
-
-Class names should always start with an uppercase letter. Multiple words
-should be separated with an underscore, and not CamelCased.
-
-**INCORRECT**::
-
- class superclass
- class SuperClass
-
-**CORRECT**::
-
- class Super_class
-
-::
-
- class Super_class {
-
- public function __construct()
- {
-
- }
- }
-
-Class methods should be entirely lowercased and named to clearly
-indicate their function, preferably including a verb. Try to avoid
-overly long and verbose names. Multiple words should be separated
-with an underscore.
-
-**INCORRECT**::
-
- function fileproperties() // not descriptive and needs underscore separator
- function fileProperties() // not descriptive and uses CamelCase
- function getfileproperties() // Better! But still missing underscore separator
- function getFileProperties() // uses CamelCase
- function get_the_file_properties_from_the_file() // wordy
-
-**CORRECT**::
-
- function get_file_properties() // descriptive, underscore separator, and all lowercase letters
-
-Variable Names
-==============
-
-The guidelines for variable naming are very similar to those used for
-class methods. Variables should contain only lowercase letters,
-use underscore separators, and be reasonably named to indicate their
-purpose and contents. Very short, non-word variables should only be used
-as iterators in for() loops.
-
-**INCORRECT**::
-
- $j = 'foo'; // single letter variables should only be used in for() loops
- $Str // contains uppercase letters
- $bufferedText // uses CamelCasing, and could be shortened without losing semantic meaning
- $groupid // multiple words, needs underscore separator
- $name_of_last_city_used // too long
-
-**CORRECT**::
-
- for ($j = 0; $j < 10; $j++)
- $str
- $buffer
- $group_id
- $last_city
-
-Commenting
-==========
-
-In general, code should be commented prolifically. It not only helps
-describe the flow and intent of the code for less experienced
-programmers, but can prove invaluable when returning to your own code
-months down the line. There is not a required format for comments, but
-the following are recommended.
-
-`DocBlock <http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_phpDocumentor.howto.pkg.html#basics.docblock>`_
-style comments preceding class, method, and property declarations so they can be
-picked up by IDEs::
-
- /**
- * Super Class
- *
- * @package Package Name
- * @subpackage Subpackage
- * @category Category
- * @author Author Name
- * @link http://example.com
- */
- class Super_class {
-
-::
-
- /**
- * Encodes string for use in XML
- *
- * @param string $str Input string
- * @return string
- */
- function xml_encode($str)
-
-::
-
- /**
- * Data for class manipulation
- *
- * @var array
- */
- public $data = array();
-
-Use single line comments within code, leaving a blank line between large
-comment blocks and code.
-
-::
-
- // break up the string by newlines
- $parts = explode("\n", $str);
-
- // A longer comment that needs to give greater detail on what is
- // occurring and why can use multiple single-line comments. Try to
- // keep the width reasonable, around 70 characters is the easiest to
- // read. Don't hesitate to link to permanent external resources
- // that may provide greater detail:
- //
- // http://example.com/information_about_something/in_particular/
-
- $parts = $this->foo($parts);
-
-Constants
-=========
-
-Constants follow the same guidelines as do variables, except constants
-should always be fully uppercase. *Always use CodeIgniter constants when
-appropriate, i.e. SLASH, LD, RD, PATH_CACHE, etc.*
-
-**INCORRECT**::
-
- myConstant // missing underscore separator and not fully uppercase
- N // no single-letter constants
- S_C_VER // not descriptive
- $str = str_replace('{foo}', 'bar', $str); // should use LD and RD constants
-
-**CORRECT**::
-
- MY_CONSTANT
- NEWLINE
- SUPER_CLASS_VERSION
- $str = str_replace(LD.'foo'.RD, 'bar', $str);
-
-TRUE, FALSE, and NULL
-=====================
-
-**TRUE**, **FALSE**, and **NULL** keywords should always be fully
-uppercase.
-
-**INCORRECT**::
-
- if ($foo == true)
- $bar = false;
- function foo($bar = null)
-
-**CORRECT**::
-
- if ($foo == TRUE)
- $bar = FALSE;
- function foo($bar = NULL)
-
-Logical Operators
-=================
-
-Use of the ``||`` "or" comparison operator is discouraged, as its clarity
-on some output devices is low (looking like the number 11, for instance).
-``&&`` is preferred over ``AND`` but either are acceptable, and a space should
-always precede and follow ``!``.
-
-**INCORRECT**::
-
- if ($foo || $bar)
- if ($foo AND $bar) // okay but not recommended for common syntax highlighting applications
- if (!$foo)
- if (! is_array($foo))
-
-**CORRECT**::
-
- if ($foo OR $bar)
- if ($foo && $bar) // recommended
- if ( ! $foo)
- if ( ! is_array($foo))
-
-
-Comparing Return Values and Typecasting
-=======================================
-
-Some PHP functions return FALSE on failure, but may also have a valid
-return value of "" or 0, which would evaluate to FALSE in loose
-comparisons. Be explicit by comparing the variable type when using these
-return values in conditionals to ensure the return value is indeed what
-you expect, and not a value that has an equivalent loose-type
-evaluation.
-
-Use the same stringency in returning and checking your own variables.
-Use **===** and **!==** as necessary.
-
-**INCORRECT**::
-
- // If 'foo' is at the beginning of the string, strpos will return a 0,
- // resulting in this conditional evaluating as TRUE
- if (strpos($str, 'foo') == FALSE)
-
-**CORRECT**::
-
- if (strpos($str, 'foo') === FALSE)
-
-**INCORRECT**::
-
- function build_string($str = "")
- {
- if ($str == "") // uh-oh! What if FALSE or the integer 0 is passed as an argument?
- {
-
- }
- }
-
-**CORRECT**::
-
- function build_string($str = "")
- {
- if ($str === "")
- {
-
- }
- }
-
-
-See also information regarding `typecasting
-<http://php.net/manual/en/language.types.type-juggling.php#language.types.typecasting>`_,
-which can be quite useful. Typecasting has a slightly different effect
-which may be desirable. When casting a variable as a string, for
-instance, NULL and boolean FALSE variables become empty strings, 0 (and
-other numbers) become strings of digits, and boolean TRUE becomes "1"::
-
- $str = (string) $str; // cast $str as a string
-
-Debugging Code
-==============
-
-Do not leave debugging code in your submissions, even when commented out.
-Things such as ``var_dump()``, ``print_r()``, ``die()``/``exit()`` should not be included
-in your code unless it serves a specific purpose other than debugging.
-
-Whitespace in Files
-===================
-
-No whitespace can precede the opening PHP tag or follow the closing PHP
-tag. Output is buffered, so whitespace in your files can cause output to
-begin before CodeIgniter outputs its content, leading to errors and an
-inability for CodeIgniter to send proper headers.
-
-Compatibility
-=============
-
-CodeIgniter recommends PHP 5.6 or newer to be used, but it should be
-compatible with PHP 5.3.7. Your code must either be compatible with this
-requirement, provide a suitable fallback, or be an optional feature that
-dies quietly without affecting a user's application.
-
-Additionally, do not use PHP functions that require non-default libraries
-to be installed unless your code contains an alternative method when the
-function is not available.
-
-One File per Class
-==================
-
-Use separate files for each class, unless the classes are *closely related*.
-An example of a CodeIgniter file that contains multiple classes is the
-Xmlrpc library file.
-
-Whitespace
-==========
-
-Use tabs for whitespace in your code, not spaces. This may seem like a
-small thing, but using tabs instead of whitespace allows the developer
-looking at your code to have indentation at levels that they prefer and
-customize in whatever application they use. And as a side benefit, it
-results in (slightly) more compact files, storing one tab character
-versus, say, four space characters.
-
-Line Breaks
-===========
-
-Files must be saved with Unix line breaks. This is more of an issue for
-developers who work in Windows, but in any case ensure that your text
-editor is setup to save files with Unix line breaks.
-
-Code Indenting
-==============
-
-Use Allman style indenting. With the exception of Class declarations,
-braces are always placed on a line by themselves, and indented at the
-same level as the control statement that "owns" them.
-
-**INCORRECT**::
-
- function foo($bar) {
- // ...
- }
-
- foreach ($arr as $key => $val) {
- // ...
- }
-
- if ($foo == $bar) {
- // ...
- } else {
- // ...
- }
-
- for ($i = 0; $i < 10; $i++)
- {
- for ($j = 0; $j < 10; $j++)
- {
- // ...
- }
- }
-
- try {
- // ...
- }
- catch() {
- // ...
- }
-
-**CORRECT**::
-
- function foo($bar)
- {
- // ...
- }
-
- foreach ($arr as $key => $val)
- {
- // ...
- }
-
- if ($foo == $bar)
- {
- // ...
- }
- else
- {
- // ...
- }
-
- for ($i = 0; $i < 10; $i++)
- {
- for ($j = 0; $j < 10; $j++)
- {
- // ...
- }
- }
-
- try
- {
- // ...
- }
- catch()
- {
- // ...
- }
-
-Bracket and Parenthetic Spacing
-===============================
-
-In general, parenthesis and brackets should not use any additional
-spaces. The exception is that a space should always follow PHP control
-structures that accept arguments with parenthesis (declare, do-while,
-elseif, for, foreach, if, switch, while), to help distinguish them from
-functions and increase readability.
-
-**INCORRECT**::
-
- $arr[ $foo ] = 'foo';
-
-**CORRECT**::
-
- $arr[$foo] = 'foo'; // no spaces around array keys
-
-**INCORRECT**::
-
- function foo ( $bar )
- {
-
- }
-
-**CORRECT**::
-
- function foo($bar) // no spaces around parenthesis in function declarations
- {
-
- }
-
-**INCORRECT**::
-
- foreach( $query->result() as $row )
-
-**CORRECT**::
-
- foreach ($query->result() as $row) // single space following PHP control structures, but not in interior parenthesis
-
-Localized Text
-==============
-
-CodeIgniter libraries should take advantage of corresponding language files
-whenever possible.
-
-**INCORRECT**::
-
- return "Invalid Selection";
-
-**CORRECT**::
-
- return $this->lang->line('invalid_selection');
-
-Private Methods and Variables
-=============================
-
-Methods and variables that are only accessed internally,
-such as utility and helper functions that your public methods use for
-code abstraction, should be prefixed with an underscore.
-
-::
-
- public function convert_text()
- private function _convert_text()
-
-PHP Errors
-==========
-
-Code must run error free and not rely on warnings and notices to be
-hidden to meet this requirement. For instance, never access a variable
-that you did not set yourself (such as ``$_POST`` array keys) without first
-checking to see that it ``isset()``.
-
-Make sure that your dev environment has error reporting enabled
-for ALL users, and that display_errors is enabled in the PHP
-environment. You can check this setting with::
-
- if (ini_get('display_errors') == 1)
- {
- exit "Enabled";
- }
-
-On some servers where *display_errors* is disabled, and you do not have
-the ability to change this in the php.ini, you can often enable it with::
-
- ini_set('display_errors', 1);
-
-.. note:: Setting the `display_errors
- <http://php.net/manual/en/errorfunc.configuration.php#ini.display-errors>`_
- setting with ``ini_set()`` at runtime is not identical to having
- it enabled in the PHP environment. Namely, it will not have any
- effect if the script has fatal errors.
-
-Short Open Tags
-===============
-
-Always use full PHP opening tags, in case a server does not have
-*short_open_tag* enabled.
-
-**INCORRECT**::
-
- <? echo $foo; ?>
-
- <?=$foo?>
-
-**CORRECT**::
-
- <?php echo $foo; ?>
-
-.. note:: PHP 5.4 will always have the **<?=** tag available.
-
-One Statement Per Line
-======================
-
-Never combine statements on one line.
-
-**INCORRECT**::
-
- $foo = 'this'; $bar = 'that'; $bat = str_replace($foo, $bar, $bag);
-
-**CORRECT**::
-
- $foo = 'this';
- $bar = 'that';
- $bat = str_replace($foo, $bar, $bag);
-
-Strings
-=======
-
-Always use single quoted strings unless you need variables parsed, and
-in cases where you do need variables parsed, use braces to prevent
-greedy token parsing. You may also use double-quoted strings if the
-string contains single quotes, so you do not have to use escape
-characters.
-
-**INCORRECT**::
-
- "My String" // no variable parsing, so no use for double quotes
- "My string $foo" // needs braces
- 'SELECT foo FROM bar WHERE baz = \'bag\'' // ugly
-
-**CORRECT**::
-
- 'My String'
- "My string {$foo}"
- "SELECT foo FROM bar WHERE baz = 'bag'"
-
-SQL Queries
-===========
-
-SQL keywords are always capitalized: SELECT, INSERT, UPDATE, WHERE,
-AS, JOIN, ON, IN, etc.
-
-Break up long queries into multiple lines for legibility, preferably
-breaking for each clause.
-
-**INCORRECT**::
-
- // keywords are lowercase and query is too long for
- // a single line (... indicates continuation of line)
- $query = $this->db->query("select foo, bar, baz, foofoo, foobar as raboof, foobaz from exp_pre_email_addresses
- ...where foo != 'oof' and baz != 'zab' order by foobaz limit 5, 100");
-
-**CORRECT**::
-
- $query = $this->db->query("SELECT foo, bar, baz, foofoo, foobar AS raboof, foobaz
- FROM exp_pre_email_addresses
- WHERE foo != 'oof'
- AND baz != 'zab'
- ORDER BY foobaz
- LIMIT 5, 100");
-
-Default Function Arguments
-==========================
-
-Whenever appropriate, provide function argument defaults, which helps
-prevent PHP errors with mistaken calls and provides common fallback
-values which can save a few lines of code. Example::
-
- function foo($bar = '', $baz = FALSE) \ No newline at end of file
diff --git a/user_guide_src/source/general/urls.rst b/user_guide_src/source/general/urls.rst
deleted file mode 100644
index b8a1b9f5b..000000000
--- a/user_guide_src/source/general/urls.rst
+++ /dev/null
@@ -1,100 +0,0 @@
-################
-CodeIgniter URLs
-################
-
-By default, URLs in CodeIgniter are designed to be search-engine and
-human friendly. Rather than using the standard "query string" approach
-to URLs that is synonymous with dynamic systems, CodeIgniter uses a
-**segment-based** approach::
-
- example.com/news/article/my_article
-
-.. note:: Query string URLs can be optionally enabled, as described
- below.
-
-URI Segments
-============
-
-The segments in the URL, in following with the Model-View-Controller
-approach, usually represent::
-
- example.com/class/function/ID
-
-#. The first segment represents the controller **class** that should be
- invoked.
-#. The second segment represents the class **function**, or method, that
- should be called.
-#. The third, and any additional segments, represent the ID and any
- variables that will be passed to the controller.
-
-The :doc:`URI Library <../libraries/uri>` and the :doc:`URL Helper
-<../helpers/url_helper>` contain functions that make it easy to work
-with your URI data. In addition, your URLs can be remapped using the
-:doc:`URI Routing <routing>` feature for more flexibility.
-
-Removing the index.php file
-===========================
-
-By default, the **index.php** file will be included in your URLs::
-
- example.com/index.php/news/article/my_article
-
-If your Apache server has *mod_rewrite* enabled, you can easily remove this
-file by using a .htaccess file with some simple rules. Here is an example
-of such a file, using the "negative" method in which everything is redirected
-except the specified items:
-
-.. code-block:: apache
-
- RewriteEngine On
- RewriteCond %{REQUEST_FILENAME} !-f
- RewriteCond %{REQUEST_FILENAME} !-d
- RewriteRule ^(.*)$ index.php/$1 [L]
-
-In the above example, any HTTP request other than those for existing
-directories and existing files is treated as a request for your index.php file.
-
-.. note:: These specific rules might not work for all server configurations.
-
-.. note:: Make sure to also exclude from the above rule any assets that you
- might need to be accessible from the outside world.
-
-Adding a URL Suffix
-===================
-
-In your **config/config.php** file you can specify a suffix that will be
-added to all URLs generated by CodeIgniter. For example, if a URL is
-this::
-
- example.com/index.php/products/view/shoes
-
-You can optionally add a suffix, like **.html,** making the page appear to
-be of a certain type::
-
- example.com/index.php/products/view/shoes.html
-
-Enabling Query Strings
-======================
-
-In some cases you might prefer to use query strings URLs::
-
- index.php?c=products&m=view&id=345
-
-CodeIgniter optionally supports this capability, which can be enabled in
-your **application/config.php** file. If you open your config file you'll
-see these items::
-
- $config['enable_query_strings'] = FALSE;
- $config['controller_trigger'] = 'c';
- $config['function_trigger'] = 'm';
-
-If you change "enable_query_strings" to TRUE this feature will become
-active. Your controllers and functions will then be accessible using the
-"trigger" words you've set to invoke your controllers and methods::
-
- index.php?c=controller&m=method
-
-.. note:: If you are using query strings you will have to build your own
- URLs, rather than utilizing the URL helpers (and other helpers
- that generate URLs, like some of the form helpers) as these are
- designed to work with segment based URLs. \ No newline at end of file
diff --git a/user_guide_src/source/general/views.rst b/user_guide_src/source/general/views.rst
deleted file mode 100644
index 2fc0cb2ca..000000000
--- a/user_guide_src/source/general/views.rst
+++ /dev/null
@@ -1,213 +0,0 @@
-#####
-Views
-#####
-
-A view is simply a web page, or a page fragment, like a header, footer,
-sidebar, etc. In fact, views can flexibly be embedded within other views
-(within other views, etc., etc.) if you need this type of hierarchy.
-
-Views are never called directly, they must be loaded by a
-:doc:`controller <controllers>`. Remember that in an MVC framework, the
-Controller acts as the traffic cop, so it is responsible for fetching a
-particular view. If you have not read the
-:doc:`Controllers <controllers>` page you should do so before
-continuing.
-
-Using the example controller you created in the
-:doc:`controller <controllers>` page, let's add a view to it.
-
-Creating a View
-===============
-
-Using your text editor, create a file called blogview.php, and put this
-in it::
-
- <html>
- <head>
- <title>My Blog</title>
- </head>
- <body>
- <h1>Welcome to my Blog!</h1>
- </body>
- </html>
-
-Then save the file in your *application/views/* directory.
-
-Loading a View
-==============
-
-To load a particular view file you will use the following method::
-
- $this->load->view('name');
-
-Where name is the name of your view file.
-
-.. note:: The .php file extension does not need to be specified
- unless you use something other than .php.
-
-Now, open the controller file you made earlier called Blog.php, and
-replace the echo statement with the view loading method::
-
- <?php
- class Blog extends CI_Controller {
-
- public function index()
- {
- $this->load->view('blogview');
- }
- }
-
-If you visit your site using the URL you did earlier you should see your
-new view. The URL was similar to this::
-
- example.com/index.php/blog/
-
-Loading multiple views
-======================
-
-CodeIgniter will intelligently handle multiple calls to
-``$this->load->view()`` from within a controller. If more than one call
-happens they will be appended together. For example, you may wish to
-have a header view, a menu view, a content view, and a footer view. That
-might look something like this::
-
- <?php
-
- class Page extends CI_Controller {
-
- public function index()
- {
- $data['page_title'] = 'Your title';
- $this->load->view('header');
- $this->load->view('menu');
- $this->load->view('content', $data);
- $this->load->view('footer');
- }
-
- }
-
-In the example above, we are using "dynamically added data", which you
-will see below.
-
-Storing Views within Sub-directories
-====================================
-
-Your view files can also be stored within sub-directories if you prefer
-that type of organization. When doing so you will need to include the
-directory name loading the view. Example::
-
- $this->load->view('directory_name/file_name');
-
-Adding Dynamic Data to the View
-===============================
-
-Data is passed from the controller to the view by way of an **array** or
-an **object** in the second parameter of the view loading method. Here
-is an example using an array::
-
- $data = array(
- 'title' => 'My Title',
- 'heading' => 'My Heading',
- 'message' => 'My Message'
- );
-
- $this->load->view('blogview', $data);
-
-And here's an example using an object::
-
- $data = new Someclass();
- $this->load->view('blogview', $data);
-
-.. note:: If you use an object, the class variables will be turned
- into array elements.
-
-Let's try it with your controller file. Open it add this code::
-
- <?php
- class Blog extends CI_Controller {
-
- public function index()
- {
- $data['title'] = "My Real Title";
- $data['heading'] = "My Real Heading";
-
- $this->load->view('blogview', $data);
- }
- }
-
-Now open your view file and change the text to variables that correspond
-to the array keys in your data::
-
- <html>
- <head>
- <title><?php echo $title;?></title>
- </head>
- <body>
- <h1><?php echo $heading;?></h1>
- </body>
- </html>
-
-Then load the page at the URL you've been using and you should see the
-variables replaced.
-
-Creating Loops
-==============
-
-The data array you pass to your view files is not limited to simple
-variables. You can pass multi dimensional arrays, which can be looped to
-generate multiple rows. For example, if you pull data from your database
-it will typically be in the form of a multi-dimensional array.
-
-Here's a simple example. Add this to your controller::
-
- <?php
- class Blog extends CI_Controller {
-
- public function index()
- {
- $data['todo_list'] = array('Clean House', 'Call Mom', 'Run Errands');
-
- $data['title'] = "My Real Title";
- $data['heading'] = "My Real Heading";
-
- $this->load->view('blogview', $data);
- }
- }
-
-Now open your view file and create a loop::
-
- <html>
- <head>
- <title><?php echo $title;?></title>
- </head>
- <body>
- <h1><?php echo $heading;?></h1>
-
- <h3>My Todo List</h3>
-
- <ul>
- <?php foreach ($todo_list as $item):?>
-
- <li><?php echo $item;?></li>
-
- <?php endforeach;?>
- </ul>
-
- </body>
- </html>
-
-.. note:: You'll notice that in the example above we are using PHP's
- alternative syntax. If you are not familiar with it you can read about
- it :doc:`here <alternative_php>`.
-
-Returning views as data
-=======================
-
-There is a third **optional** parameter lets you change the behavior of
-the method so that it returns data as a string rather than sending it
-to your browser. This can be useful if you want to process the data in
-some way. If you set the parameter to TRUE (boolean) it will return
-data. The default behavior is false, which sends it to your browser.
-Remember to assign it to a variable if you want the data returned::
-
- $string = $this->load->view('myfile', '', TRUE); \ No newline at end of file
diff --git a/user_guide_src/source/general/welcome.rst b/user_guide_src/source/general/welcome.rst
deleted file mode 100644
index b6f473c2b..000000000
--- a/user_guide_src/source/general/welcome.rst
+++ /dev/null
@@ -1,32 +0,0 @@
-######################
-Welcome to CodeIgniter
-######################
-
-CodeIgniter is an Application Development Framework - a toolkit - for
-people who build web sites using PHP. Its goal is to enable you to
-develop projects much faster than you could if you were writing code
-from scratch, by providing a rich set of libraries for commonly needed
-tasks, as well as a simple interface and logical structure to access
-these libraries. CodeIgniter lets you creatively focus on your project
-by minimizing the amount of code needed for a given task.
-
-***********************
-Who is CodeIgniter For?
-***********************
-
-CodeIgniter is right for you if:
-
-- You want a framework with a small footprint.
-- You need exceptional performance.
-- You need broad compatibility with standard hosting accounts that run
- a variety of PHP versions and configurations.
-- You want a framework that requires nearly zero configuration.
-- You want a framework that does not require you to use the command
- line.
-- You want a framework that does not require you to adhere to
- restrictive coding rules.
-- You are not interested in large-scale monolithic libraries like PEAR.
-- You do not want to be forced to learn a templating language (although
- a template parser is optionally available if you desire one).
-- You eschew complexity, favoring simple solutions.
-- You need clear, thorough documentation. \ No newline at end of file
diff --git a/user_guide_src/source/helpers/array_helper.rst b/user_guide_src/source/helpers/array_helper.rst
deleted file mode 100644
index d6b48773f..000000000
--- a/user_guide_src/source/helpers/array_helper.rst
+++ /dev/null
@@ -1,133 +0,0 @@
-############
-Array Helper
-############
-
-The Array Helper file contains functions that assist in working with
-arrays.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-Loading this Helper
-===================
-
-This helper is loaded using the following code::
-
- $this->load->helper('array');
-
-
-Available Functions
-===================
-
-The following functions are available:
-
-
-.. php:function:: element($item, $array[, $default = NULL])
-
- :param string $item: Item to fetch from the array
- :param array $array: Input array
- :param bool $default: What to return if the array isn't valid
- :returns: NULL on failure or the array item.
- :rtype: mixed
-
- Lets you fetch an item from an array. The function tests whether the
- array index is set and whether it has a value. If a value exists it is
- returned. If a value does not exist it returns NULL, or whatever you've
- specified as the default value via the third parameter.
-
- Example::
-
- $array = array(
- 'color' => 'red',
- 'shape' => 'round',
- 'size' => ''
- );
-
- echo element('color', $array); // returns "red"
- echo element('size', $array, 'foobar'); // returns "foobar"
-
-
-.. php:function:: elements($items, $array[, $default = NULL])
-
- :param string $item: Item to fetch from the array
- :param array $array: Input array
- :param bool $default: What to return if the array isn't valid
- :returns: NULL on failure or the array item.
- :rtype: mixed
-
- Lets you fetch a number of items from an array. The function tests
- whether each of the array indices is set. If an index does not exist it
- is set to NULL, or whatever you've specified as the default value via
- the third parameter.
-
- Example::
-
- $array = array(
- 'color' => 'red',
- 'shape' => 'round',
- 'radius' => '10',
- 'diameter' => '20'
- );
-
- $my_shape = elements(array('color', 'shape', 'height'), $array);
-
- The above will return the following array::
-
- array(
- 'color' => 'red',
- 'shape' => 'round',
- 'height' => NULL
- );
-
- You can set the third parameter to any default value you like.
- ::
-
- $my_shape = elements(array('color', 'shape', 'height'), $array, 'foobar');
-
- The above will return the following array::
-
- array(     
- 'color' => 'red',
- 'shape' => 'round',
- 'height' => 'foobar'
- );
-
- This is useful when sending the ``$_POST`` array to one of your Models.
- This prevents users from sending additional POST data to be entered into
- your tables.
-
- ::
-
- $this->load->model('post_model');
- $this->post_model->update(
- elements(array('id', 'title', 'content'), $_POST)
- );
-
- This ensures that only the id, title and content fields are sent to be
- updated.
-
-
-.. php:function:: random_element($array)
-
- :param array $array: Input array
- :returns: A random element from the array
- :rtype: mixed
-
- Takes an array as input and returns a random element from it.
-
- Usage example::
-
- $quotes = array(
- "I find that the harder I work, the more luck I seem to have. - Thomas Jefferson",
- "Don't stay in bed, unless you can make money in bed. - George Burns",
- "We didn't lose the game; we just ran out of time. - Vince Lombardi",
- "If everything seems under control, you're not going fast enough. - Mario Andretti",
- "Reality is merely an illusion, albeit a very persistent one. - Albert Einstein",
- "Chance favors the prepared mind - Louis Pasteur"
- );
-
- echo random_element($quotes); \ No newline at end of file
diff --git a/user_guide_src/source/helpers/captcha_helper.rst b/user_guide_src/source/helpers/captcha_helper.rst
deleted file mode 100644
index be1b20aaf..000000000
--- a/user_guide_src/source/helpers/captcha_helper.rst
+++ /dev/null
@@ -1,168 +0,0 @@
-##############
-CAPTCHA Helper
-##############
-
-The CAPTCHA Helper file contains functions that assist in creating
-CAPTCHA images.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-Loading this Helper
-===================
-
-This helper is loaded using the following code::
-
- $this->load->helper('captcha');
-
-Using the CAPTCHA helper
-========================
-
-Once loaded you can generate a CAPTCHA like this::
-
- $vals = array(
- 'word' => 'Random word',
- 'img_path' => './captcha/',
- 'img_url' => 'http://example.com/captcha/',
- 'font_path' => './path/to/fonts/texb.ttf',
- 'img_width' => '150',
- 'img_height' => 30,
- 'expiration' => 7200,
- 'word_length' => 8,
- 'font_size' => 16,
- 'img_id' => 'Imageid',
- 'pool' => '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',
-
- // White background and border, black text and red grid
- 'colors' => array(
- 'background' => array(255, 255, 255),
- 'border' => array(255, 255, 255),
- 'text' => array(0, 0, 0),
- 'grid' => array(255, 40, 40)
- )
- );
-
- $cap = create_captcha($vals);
- echo $cap['image'];
-
-- The captcha function requires the GD image library.
-- Only the **img_path** and **img_url** are required.
-- If a **word** is not supplied, the function will generate a random
- ASCII string. You might put together your own word library that you
- can draw randomly from.
-- If you do not specify a path to a TRUE TYPE font, the native ugly GD
- font will be used.
-- The "captcha" directory must be writable
-- The **expiration** (in seconds) signifies how long an image will remain
- in the captcha folder before it will be deleted. The default is two
- hours.
-- **word_length** defaults to 8, **pool** defaults to '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
-- **font_size** defaults to 16, the native GD font has a size limit. Specify a "true type" font for bigger sizes.
-- The **img_id** will be set as the "id" of the captcha image.
-- If any of the **colors** values is missing, it will be replaced by the default.
-
-Adding a Database
------------------
-
-In order for the captcha function to prevent someone from submitting,
-you will need to add the information returned from ``create_captcha()``
-to your database. Then, when the data from the form is submitted by
-the user you will need to verify that the data exists in the database
-and has not expired.
-
-Here is a table prototype::
-
- CREATE TABLE captcha (  
- captcha_id bigint(13) unsigned NOT NULL auto_increment,  
- captcha_time int(10) unsigned NOT NULL,  
- ip_address varchar(45) NOT NULL,  
- word varchar(20) NOT NULL,  
- PRIMARY KEY `captcha_id` (`captcha_id`),  
- KEY `word` (`word`)
- );
-
-Here is an example of usage with a database. On the page where the
-CAPTCHA will be shown you'll have something like this::
-
- $this->load->helper('captcha');
- $vals = array(     
- 'img_path' => './captcha/',     
- 'img_url' => 'http://example.com/captcha/'     
- );
-
- $cap = create_captcha($vals);
- $data = array(     
- 'captcha_time' => $cap['time'],     
- 'ip_address' => $this->input->ip_address(),     
- 'word' => $cap['word']     
- );
-
- $query = $this->db->insert_string('captcha', $data);
- $this->db->query($query);
-
- echo 'Submit the word you see below:';
- echo $cap['image'];
- echo '<input type="text" name="captcha" value="" />';
-
-Then, on the page that accepts the submission you'll have something like
-this::
-
- // First, delete old captchas
- $expiration = time() - 7200; // Two hour limit
- $this->db->where('captcha_time < ', $expiration)
- ->delete('captcha');
-
- // Then see if a captcha exists:
- $sql = 'SELECT COUNT(*) AS count FROM captcha WHERE word = ? AND ip_address = ? AND captcha_time > ?';
- $binds = array($_POST['captcha'], $this->input->ip_address(), $expiration);
- $query = $this->db->query($sql, $binds);
- $row = $query->row();
-
- if ($row->count == 0)
- {     
- echo 'You must submit the word that appears in the image.';
- }
-
-Available Functions
-===================
-
-The following functions are available:
-
-.. php:function:: create_captcha([$data = ''[, $img_path = ''[, $img_url = ''[, $font_path = '']]]])
-
- :param array $data: Array of data for the CAPTCHA
- :param string $img_path: Path to create the image in (DEPRECATED)
- :param string $img_url: URL to the CAPTCHA image folder (DEPRECATED)
- :param string $font_path: Server path to font (DEPRECATED)
- :returns: array('word' => $word, 'time' => $now, 'image' => $img)
- :rtype: array
-
- Takes an array of information to generate the CAPTCHA as input and
- creates the image to your specifications, returning an array of
- associative data about the image.
-
- ::
-
- array(
- 'image' => IMAGE TAG
- 'time' => TIMESTAMP (in microtime)
- 'word' => CAPTCHA WORD
- )
-
- The **image** is the actual image tag::
-
- <img src="http://example.com/captcha/12345.jpg" width="140" height="50" />
-
- The **time** is the micro timestamp used as the image name without the
- file extension. It will be a number like this: 1139612155.3422
-
- The **word** is the word that appears in the captcha image, which if not
- supplied to the function, will be a random string.
-
- .. note:: Usage of the ``$img_path``, ``$img_url`` and ``$font_path``
- parameters is DEPRECATED. Provide them in the ``$data`` array
- instead.
diff --git a/user_guide_src/source/helpers/cookie_helper.rst b/user_guide_src/source/helpers/cookie_helper.rst
deleted file mode 100644
index 2ad51e78c..000000000
--- a/user_guide_src/source/helpers/cookie_helper.rst
+++ /dev/null
@@ -1,79 +0,0 @@
-#############
-Cookie Helper
-#############
-
-The Cookie Helper file contains functions that assist in working with
-cookies.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-Loading this Helper
-===================
-
-This helper is loaded using the following code::
-
- $this->load->helper('cookie');
-
-Available Functions
-===================
-
-The following functions are available:
-
-
-.. php:function:: set_cookie($name[, $value = ''[, $expire = ''[, $domain = ''[, $path = '/'[, $prefix = ''[, $secure = NULL[, $httponly = NULL]]]]]]])
-
- :param mixed $name: Cookie name *or* associative array of all of the parameters available to this function
- :param string $value: Cookie value
- :param int $expire: Number of seconds until expiration
- :param string $domain: Cookie domain (usually: .yourdomain.com)
- :param string $path: Cookie path
- :param string $prefix: Cookie name prefix
- :param bool $secure: Whether to only send the cookie through HTTPS
- :param bool $httponly: Whether to hide the cookie from JavaScript
- :rtype: void
-
- This helper function gives you friendlier syntax to set browser
- cookies. Refer to the :doc:`Input Library <../libraries/input>` for
- a description of its use, as this function is an alias for
- ``CI_Input::set_cookie()``.
-
-.. php:function:: get_cookie($index[, $xss_clean = NULL])
-
- :param string $index: Cookie name
- :param bool $xss_clean: Whether to apply XSS filtering to the returned value
- :returns: The cookie value or NULL if not found
- :rtype: mixed
-
- This helper function gives you friendlier syntax to get browser
- cookies. Refer to the :doc:`Input Library <../libraries/input>` for
- detailed description of its use, as this function acts very
- similarly to ``CI_Input::cookie()``, except it will also prepend
- the ``$config['cookie_prefix']`` that you might've set in your
- *application/config/config.php* file.
-
-.. php:function:: delete_cookie($name[, $domain = ''[, $path = '/'[, $prefix = '']]])
-
- :param string $name: Cookie name
- :param string $domain: Cookie domain (usually: .yourdomain.com)
- :param string $path: Cookie path
- :param string $prefix: Cookie name prefix
- :rtype: void
-
- Lets you delete a cookie. Unless you've set a custom path or other
- values, only the name of the cookie is needed.
- ::
-
- delete_cookie('name');
-
- This function is otherwise identical to ``set_cookie()``, except that it
- does not have the value and expiration parameters. You can submit an
- array of values in the first parameter or you can set discrete
- parameters.
- ::
-
- delete_cookie($name, $domain, $path, $prefix);
diff --git a/user_guide_src/source/helpers/date_helper.rst b/user_guide_src/source/helpers/date_helper.rst
deleted file mode 100644
index 6bc6c2b05..000000000
--- a/user_guide_src/source/helpers/date_helper.rst
+++ /dev/null
@@ -1,440 +0,0 @@
-###########
-Date Helper
-###########
-
-The Date Helper file contains functions that help you work with dates.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-Loading this Helper
-===================
-
-This helper is loaded using the following code::
-
- $this->load->helper('date');
-
-Available Functions
-===================
-
-The following functions are available:
-
-
-.. php:function:: now([$timezone = NULL])
-
- :param string $timezone: Timezone
- :returns: UNIX timestamp
- :rtype: int
-
- Returns the current time as a UNIX timestamp, referenced either to your server's
- local time or any PHP supported timezone, based on the "time reference" setting
- in your config file. If you do not intend to set your master time reference to
- any other PHP supported timezone (which you'll typically do if you run a site
- that lets each user set their own timezone settings) there is no benefit to using
- this function over PHP's ``time()`` function.
- ::
-
- echo now('Australia/Victoria');
-
- If a timezone is not provided, it will return ``time()`` based on the
- **time_reference** setting.
-
-.. php:function:: mdate([$datestr = ''[, $time = '']])
-
- :param string $datestr: Date string
- :param int $time: UNIX timestamp
- :returns: MySQL-formatted date
- :rtype: string
-
- This function is identical to PHP's `date() <http://php.net/manual/en/function.date.php>`_
- function, except that it lets you use MySQL style date codes, where each
- code letter is preceded with a percent sign, e.g. `%Y %m %d`
-
- The benefit of doing dates this way is that you don't have to worry
- about escaping any characters that are not date codes, as you would
- normally have to do with the ``date()`` function.
-
- Example::
-
- $datestring = 'Year: %Y Month: %m Day: %d - %h:%i %a';
- $time = time();
- echo mdate($datestring, $time);
-
- If a timestamp is not included in the second parameter the current time
- will be used.
-
-.. php:function:: standard_date([$fmt = 'DATE_RFC822'[, $time = NULL]])
-
- :param string $fmt: Date format
- :param int $time: UNIX timestamp
- :returns: Formatted date or FALSE on invalid format
- :rtype: string
-
- Lets you generate a date string in one of several standardized formats.
-
- Example::
-
- $format = 'DATE_RFC822';
- $time = time();
- echo standard_date($format, $time);
-
- .. note:: This function is DEPRECATED. Use the native ``date()`` combined with
- `DateTime's format constants
- <https://secure.php.net/manual/en/class.datetime.php#datetime.constants.types>`_
- instead::
-
- echo date(DATE_RFC822, time());
-
- **Supported formats:**
-
- =============== ======================= ======================================
- Constant Description Example
- =============== ======================= ======================================
- DATE_ATOM Atom 2005-08-15T16:13:03+0000
- DATE_COOKIE HTTP Cookies Sun, 14 Aug 2005 16:13:03 UTC
- DATE_ISO8601 ISO-8601 2005-08-14T16:13:03+00:00
- DATE_RFC822 RFC 822 Sun, 14 Aug 05 16:13:03 UTC
- DATE_RFC850 RFC 850 Sunday, 14-Aug-05 16:13:03 UTC
- DATE_RFC1036 RFC 1036 Sunday, 14-Aug-05 16:13:03 UTC
- DATE_RFC1123 RFC 1123 Sun, 14 Aug 2005 16:13:03 UTC
- DATE_RFC2822 RFC 2822 Sun, 14 Aug 2005 16:13:03 +0000
- DATE_RSS RSS Sun, 14 Aug 2005 16:13:03 UTC
- DATE_W3C W3C 2005-08-14T16:13:03+0000
- =============== ======================= ======================================
-
-.. php:function:: local_to_gmt([$time = ''])
-
- :param int $time: UNIX timestamp
- :returns: UNIX timestamp
- :rtype: int
-
- Takes a UNIX timestamp as input and returns it as GMT.
-
- Example::
-
- $gmt = local_to_gmt(time());
-
-.. php:function:: gmt_to_local([$time = ''[, $timezone = 'UTC'[, $dst = FALSE]]])
-
- :param int $time: UNIX timestamp
- :param string $timezone: Timezone
- :param bool $dst: Whether DST is active
- :returns: UNIX timestamp
- :rtype: int
-
- Takes a UNIX timestamp (referenced to GMT) as input, and converts it to
- a localized timestamp based on the timezone and Daylight Saving Time
- submitted.
-
- Example::
-
- $timestamp = 1140153693;
- $timezone = 'UM8';
- $daylight_saving = TRUE;
- echo gmt_to_local($timestamp, $timezone, $daylight_saving);
-
-
- .. note:: For a list of timezones see the reference at the bottom of this page.
-
-.. php:function:: mysql_to_unix([$time = ''])
-
- :param string $time: MySQL timestamp
- :returns: UNIX timestamp
- :rtype: int
-
- Takes a MySQL Timestamp as input and returns it as a UNIX timestamp.
-
- Example::
-
- $unix = mysql_to_unix('20061124092345');
-
-.. php:function:: unix_to_human([$time = ''[, $seconds = FALSE[, $fmt = 'us']]])
-
- :param int $time: UNIX timestamp
- :param bool $seconds: Whether to show seconds
- :param string $fmt: format (us or euro)
- :returns: Formatted date
- :rtype: string
-
- Takes a UNIX timestamp as input and returns it in a human readable
- format with this prototype::
-
- YYYY-MM-DD HH:MM:SS AM/PM
-
- This can be useful if you need to display a date in a form field for
- submission.
-
- The time can be formatted with or without seconds, and it can be set to
- European or US format. If only the timestamp is submitted it will return
- the time without seconds formatted for the U.S.
-
- Examples::
-
- $now = time();
- echo unix_to_human($now); // U.S. time, no seconds
- echo unix_to_human($now, TRUE, 'us'); // U.S. time with seconds
- echo unix_to_human($now, TRUE, 'eu'); // Euro time with seconds
-
-.. php:function:: human_to_unix([$datestr = ''])
-
- :param int $datestr: Date string
- :returns: UNIX timestamp or FALSE on failure
- :rtype: int
-
- The opposite of the :php:func:`unix_to_time()` function. Takes a "human"
- time as input and returns it as a UNIX timestamp. This is useful if you
- accept "human" formatted dates submitted via a form. Returns boolean FALSE
- date string passed to it is not formatted as indicated above.
-
- Example::
-
- $now = time();
- $human = unix_to_human($now);
- $unix = human_to_unix($human);
-
-.. php:function:: nice_date([$bad_date = ''[, $format = FALSE]])
-
- :param int $bad_date: The terribly formatted date-like string
- :param string $format: Date format to return (same as PHP's ``date()`` function)
- :returns: Formatted date
- :rtype: string
-
- This function can take a number poorly-formed date formats and convert
- them into something useful. It also accepts well-formed dates.
-
- The function will return a UNIX timestamp by default. You can, optionally,
- pass a format string (the same type as the PHP ``date()`` function accepts)
- as the second parameter.
-
- Example::
-
- $bad_date = '199605';
- // Should Produce: 1996-05-01
- $better_date = nice_date($bad_date, 'Y-m-d');
-
- $bad_date = '9-11-2001';
- // Should Produce: 2001-09-11
- $better_date = nice_date($bad_date, 'Y-m-d');
-
- .. note:: This function is DEPRECATED. Use PHP's native `DateTime class
- <https://secure.php.net/datetime>`_ instead.
-
-.. php:function:: timespan([$seconds = 1[, $time = ''[, $units = '']]])
-
- :param int $seconds: Number of seconds
- :param string $time: UNIX timestamp
- :param int $units: Number of time units to display
- :returns: Formatted time difference
- :rtype: string
-
- Formats a UNIX timestamp so that is appears similar to this::
-
- 1 Year, 10 Months, 2 Weeks, 5 Days, 10 Hours, 16 Minutes
-
- The first parameter must contain a UNIX timestamp.
- The second parameter must contain a timestamp that is greater that the
- first timestamp.
- The thirdparameter is optional and limits the number of time units to display.
-
- If the second parameter empty, the current time will be used.
-
- The most common purpose for this function is to show how much time has
- elapsed from some point in time in the past to now.
-
- Example::
-
- $post_date = '1079621429';
- $now = time();
- $units = 2;
- echo timespan($post_date, $now, $units);
-
- .. note:: The text generated by this function is found in the following language
- file: `language/<your_lang>/date_lang.php`
-
-.. php:function:: days_in_month([$month = 0[, $year = '']])
-
- :param int $month: a numeric month
- :param int $year: a numeric year
- :returns: Count of days in the specified month
- :rtype: int
-
- Returns the number of days in a given month/year. Takes leap years into
- account.
-
- Example::
-
- echo days_in_month(06, 2005);
-
- If the second parameter is empty, the current year will be used.
-
- .. note:: This function will alias the native ``cal_days_in_month()``, if
- it is available.
-
-.. php:function:: date_range([$unix_start = ''[, $mixed = ''[, $is_unix = TRUE[, $format = 'Y-m-d']]]])
-
- :param int $unix_start: UNIX timestamp of the range start date
- :param int $mixed: UNIX timestamp of the range end date or interval in days
- :param bool $is_unix: set to FALSE if $mixed is not a timestamp
- :param string $format: Output date format, same as in ``date()``
- :returns: An array of dates
- :rtype: array
-
- Returns a list of dates within a specified period.
-
- Example::
-
- $range = date_range('2012-01-01', '2012-01-15');
- echo "First 15 days of 2012:";
- foreach ($range as $date)
- {
- echo $date."\n";
- }
-
-.. php:function:: timezones([$tz = ''])
-
- :param string $tz: A numeric timezone
- :returns: Hour difference from UTC
- :rtype: int
-
- Takes a timezone reference (for a list of valid timezones, see the
- "Timezone Reference" below) and returns the number of hours offset from
- UTC.
-
- Example::
-
- echo timezones('UM5');
-
-
- This function is useful when used with :php:func:`timezone_menu()`.
-
-.. php:function:: timezone_menu([$default = 'UTC'[, $class = ''[, $name = 'timezones'[, $attributes = '']]]])
-
- :param string $default: Timezone
- :param string $class: Class name
- :param string $name: Menu name
- :param mixed $attributes: HTML attributes
- :returns: HTML drop down menu with time zones
- :rtype: string
-
- Generates a pull-down menu of timezones, like this one:
-
- .. raw:: html
-
- <form action="#">
- <select name="timezones">
- <option value='UM12'>(UTC -12:00) Baker/Howland Island</option>
- <option value='UM11'>(UTC -11:00) Samoa Time Zone, Niue</option>
- <option value='UM10'>(UTC -10:00) Hawaii-Aleutian Standard Time, Cook Islands, Tahiti</option>
- <option value='UM95'>(UTC -9:30) Marquesas Islands</option>
- <option value='UM9'>(UTC -9:00) Alaska Standard Time, Gambier Islands</option>
- <option value='UM8'>(UTC -8:00) Pacific Standard Time, Clipperton Island</option>
- <option value='UM7'>(UTC -7:00) Mountain Standard Time</option>
- <option value='UM6'>(UTC -6:00) Central Standard Time</option>
- <option value='UM5'>(UTC -5:00) Eastern Standard Time, Western Caribbean Standard Time</option>
- <option value='UM45'>(UTC -4:30) Venezuelan Standard Time</option>
- <option value='UM4'>(UTC -4:00) Atlantic Standard Time, Eastern Caribbean Standard Time</option>
- <option value='UM35'>(UTC -3:30) Newfoundland Standard Time</option>
- <option value='UM3'>(UTC -3:00) Argentina, Brazil, French Guiana, Uruguay</option>
- <option value='UM2'>(UTC -2:00) South Georgia/South Sandwich Islands</option>
- <option value='UM1'>(UTC -1:00) Azores, Cape Verde Islands</option>
- <option value='UTC' selected='selected'>(UTC) Greenwich Mean Time, Western European Time</option>
- <option value='UP1'>(UTC +1:00) Central European Time, West Africa Time</option>
- <option value='UP2'>(UTC +2:00) Central Africa Time, Eastern European Time, Kaliningrad Time</option>
- <option value='UP3'>(UTC +3:00) Moscow Time, East Africa Time</option>
- <option value='UP35'>(UTC +3:30) Iran Standard Time</option>
- <option value='UP4'>(UTC +4:00) Azerbaijan Standard Time, Samara Time</option>
- <option value='UP45'>(UTC +4:30) Afghanistan</option>
- <option value='UP5'>(UTC +5:00) Pakistan Standard Time, Yekaterinburg Time</option>
- <option value='UP55'>(UTC +5:30) Indian Standard Time, Sri Lanka Time</option>
- <option value='UP575'>(UTC +5:45) Nepal Time</option>
- <option value='UP6'>(UTC +6:00) Bangladesh Standard Time, Bhutan Time, Omsk Time</option>
- <option value='UP65'>(UTC +6:30) Cocos Islands, Myanmar</option>
- <option value='UP7'>(UTC +7:00) Krasnoyarsk Time, Cambodia, Laos, Thailand, Vietnam</option>
- <option value='UP8'>(UTC +8:00) Australian Western Standard Time, Beijing Time, Irkutsk Time</option>
- <option value='UP875'>(UTC +8:45) Australian Central Western Standard Time</option>
- <option value='UP9'>(UTC +9:00) Japan Standard Time, Korea Standard Time, Yakutsk Time</option>
- <option value='UP95'>(UTC +9:30) Australian Central Standard Time</option>
- <option value='UP10'>(UTC +10:00) Australian Eastern Standard Time, Vladivostok Time</option>
- <option value='UP105'>(UTC +10:30) Lord Howe Island</option>
- <option value='UP11'>(UTC +11:00) Srednekolymsk Time, Solomon Islands, Vanuatu</option>
- <option value='UP115'>(UTC +11:30) Norfolk Island</option>
- <option value='UP12'>(UTC +12:00) Fiji, Gilbert Islands, Kamchatka Time, New Zealand Standard Time</option>
- <option value='UP1275'>(UTC +12:45) Chatham Islands Standard Time</option>
- <option value='UP13'>(UTC +13:00) Phoenix Islands Time, Tonga</option>
- <option value='UP14'>(UTC +14:00) Line Islands</option>
- </select>
- </form>
-
-
- This menu is useful if you run a membership site in which your users are
- allowed to set their local timezone value.
-
- The first parameter lets you set the "selected" state of the menu. For
- example, to set Pacific time as the default you will do this::
-
- echo timezone_menu('UM8');
-
- Please see the timezone reference below to see the values of this menu.
-
- The second parameter lets you set a CSS class name for the menu.
-
- The fourth parameter lets you set one or more attributes on the generated select tag.
-
- .. note:: The text contained in the menu is found in the following
- language file: `language/<your_lang>/date_lang.php`
-
-Timezone Reference
-==================
-
-The following table indicates each timezone and its location.
-
-Note some of the location lists have been abridged for clarity and formatting.
-
-=========== =====================================================================
-Time Zone Location
-=========== =====================================================================
-UM12 (UTC - 12:00) Baker/Howland Island
-UM11 (UTC - 11:00) Samoa Time Zone, Niue
-UM10 (UTC - 10:00) Hawaii-Aleutian Standard Time, Cook Islands
-UM95 (UTC - 09:30) Marquesas Islands
-UM9 (UTC - 09:00) Alaska Standard Time, Gambier Islands
-UM8 (UTC - 08:00) Pacific Standard Time, Clipperton Island
-UM7 (UTC - 07:00) Mountain Standard Time
-UM6 (UTC - 06:00) Central Standard Time
-UM5 (UTC - 05:00) Eastern Standard Time, Western Caribbean
-UM45 (UTC - 04:30) Venezuelan Standard Time
-UM4 (UTC - 04:00) Atlantic Standard Time, Eastern Caribbean
-UM35 (UTC - 03:30) Newfoundland Standard Time
-UM3 (UTC - 03:00) Argentina, Brazil, French Guiana, Uruguay
-UM2 (UTC - 02:00) South Georgia/South Sandwich Islands
-UM1 (UTC -1:00) Azores, Cape Verde Islands
-UTC (UTC) Greenwich Mean Time, Western European Time
-UP1 (UTC +1:00) Central European Time, West Africa Time
-UP2 (UTC +2:00) Central Africa Time, Eastern European Time
-UP3 (UTC +3:00) Moscow Time, East Africa Time
-UP35 (UTC +3:30) Iran Standard Time
-UP4 (UTC +4:00) Azerbaijan Standard Time, Samara Time
-UP45 (UTC +4:30) Afghanistan
-UP5 (UTC +5:00) Pakistan Standard Time, Yekaterinburg Time
-UP55 (UTC +5:30) Indian Standard Time, Sri Lanka Time
-UP575 (UTC +5:45) Nepal Time
-UP6 (UTC +6:00) Bangladesh Standard Time, Bhutan Time, Omsk Time
-UP65 (UTC +6:30) Cocos Islands, Myanmar
-UP7 (UTC +7:00) Krasnoyarsk Time, Cambodia, Laos, Thailand, Vietnam
-UP8 (UTC +8:00) Australian Western Standard Time, Beijing Time
-UP875 (UTC +8:45) Australian Central Western Standard Time
-UP9 (UTC +9:00) Japan Standard Time, Korea Standard Time, Yakutsk
-UP95 (UTC +9:30) Australian Central Standard Time
-UP10 (UTC +10:00) Australian Eastern Standard Time, Vladivostok Time
-UP105 (UTC +10:30) Lord Howe Island
-UP11 (UTC +11:00) Srednekolymsk Time, Solomon Islands, Vanuatu
-UP115 (UTC +11:30) Norfolk Island
-UP12 (UTC +12:00) Fiji, Gilbert Islands, Kamchatka, New Zealand
-UP1275 (UTC +12:45) Chatham Islands Standard Time
-UP13 (UTC +13:00) Phoenix Islands Time, Tonga
-UP14 (UTC +14:00) Line Islands
-=========== =====================================================================
diff --git a/user_guide_src/source/helpers/directory_helper.rst b/user_guide_src/source/helpers/directory_helper.rst
deleted file mode 100644
index b5f1093c1..000000000
--- a/user_guide_src/source/helpers/directory_helper.rst
+++ /dev/null
@@ -1,83 +0,0 @@
-################
-Directory Helper
-################
-
-The Directory Helper file contains functions that assist in working with
-directories.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-Loading this Helper
-===================
-
-This helper is loaded using the following code:
-
-::
-
- $this->load->helper('directory');
-
-Available Functions
-===================
-
-The following functions are available:
-
-
-.. php:function:: directory_map($source_dir[, $directory_depth = 0[, $hidden = FALSE]])
-
- :param string $source_dir: Path to the source directory
- :param int $directory_depth: Depth of directories to traverse (0 = fully recursive, 1 = current dir, etc)
- :param bool $hidden: Whether to include hidden directories
- :returns: An array of files
- :rtype: array
-
- Examples::
-
- $map = directory_map('./mydirectory/');
-
- .. note:: Paths are almost always relative to your main index.php file.
-
-
- Sub-folders contained within the directory will be mapped as well. If
- you wish to control the recursion depth, you can do so using the second
- parameter (integer). A depth of 1 will only map the top level directory::
-
- $map = directory_map('./mydirectory/', 1);
-
- By default, hidden files will not be included in the returned array. To
- override this behavior, you may set a third parameter to true (boolean)::
-
- $map = directory_map('./mydirectory/', FALSE, TRUE);
-
- Each folder name will be an array index, while its contained files will
- be numerically indexed. Here is an example of a typical array::
-
- Array (
- [libraries] => Array
- (
- [0] => benchmark.html
- [1] => config.html
- ["database/"] => Array
- (
- [0] => query_builder.html
- [1] => binds.html
- [2] => configuration.html
- [3] => connecting.html
- [4] => examples.html
- [5] => fields.html
- [6] => index.html
- [7] => queries.html
- )
- [2] => email.html
- [3] => file_uploading.html
- [4] => image_lib.html
- [5] => input.html
- [6] => language.html
- [7] => loader.html
- [8] => pagination.html
- [9] => uri.html
- ) \ No newline at end of file
diff --git a/user_guide_src/source/helpers/download_helper.rst b/user_guide_src/source/helpers/download_helper.rst
deleted file mode 100644
index 1a4065073..000000000
--- a/user_guide_src/source/helpers/download_helper.rst
+++ /dev/null
@@ -1,56 +0,0 @@
-###############
-Download Helper
-###############
-
-The Download Helper lets you download data to your desktop.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-Loading this Helper
-===================
-
-This helper is loaded using the following code::
-
- $this->load->helper('download');
-
-Available Functions
-===================
-
-The following functions are available:
-
-
-.. php:function:: force_download([$filename = ''[, $data = ''[, $set_mime = FALSE]]])
-
- :param string $filename: Filename
- :param mixed $data: File contents
- :param bool $set_mime: Whether to try to send the actual MIME type
- :rtype: void
-
- Generates server headers which force data to be downloaded to your
- desktop. Useful with file downloads. The first parameter is the **name
- you want the downloaded file to be named**, the second parameter is the
- file data.
-
- If you set the second parameter to NULL and ``$filename`` is an existing, readable
- file path, then its content will be read instead.
-
- If you set the third parameter to boolean TRUE, then the actual file MIME type
- (based on the filename extension) will be sent, so that if your browser has a
- handler for that type - it can use it.
-
- Example::
-
- $data = 'Here is some text!';
- $name = 'mytext.txt';
- force_download($name, $data);
-
- If you want to download an existing file from your server you'll need to
- do the following::
-
- // Contents of photo.jpg will be automatically read
- force_download('/path/to/photo.jpg', NULL); \ No newline at end of file
diff --git a/user_guide_src/source/helpers/email_helper.rst b/user_guide_src/source/helpers/email_helper.rst
deleted file mode 100644
index e0b2e4eab..000000000
--- a/user_guide_src/source/helpers/email_helper.rst
+++ /dev/null
@@ -1,75 +0,0 @@
-############
-Email Helper
-############
-
-The Email Helper provides some assistive functions for working with
-Email. For a more robust email solution, see CodeIgniter's :doc:`Email
-Class <../libraries/email>`.
-
-.. important:: The Email helper is DEPRECATED and is currently
- only kept for backwards compatibility.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-Loading this Helper
-===================
-
-This helper is loaded using the following code::
-
- $this->load->helper('email');
-
-Available Functions
-===================
-
-The following functions are available:
-
-
-.. php:function:: valid_email($email)
-
- :param string $email: E-mail address
- :returns: TRUE if a valid email is supplied, FALSE otherwise
- :rtype: bool
-
- Checks if the input is a correctly formatted e-mail address. Note that it
- doesn't actually prove that the address will be able to receive mail, but
- simply that it is a validly formed address.
-
- Example::
-
- if (valid_email('email@somesite.com'))
- {
- echo 'email is valid';
- }
- else
- {
- echo 'email is not valid';
- }
-
- .. note:: All that this function does is to use PHP's native ``filter_var()``::
-
- (bool) filter_var($email, FILTER_VALIDATE_EMAIL);
-
-.. php:function:: send_email($recipient, $subject, $message)
-
- :param string $recipient: E-mail address
- :param string $subject: Mail subject
- :param string $message: Message body
- :returns: TRUE if the mail was successfully sent, FALSE in case of an error
- :rtype: bool
-
- Sends an email using PHP's native `mail() <http://php.net/function.mail>`_
- function.
-
- .. note:: All that this function does is to use PHP's native ``mail``
-
- ::
-
- mail($recipient, $subject, $message);
-
- For a more robust email solution, see CodeIgniter's :doc:`Email Library
- <../libraries/email>`.
diff --git a/user_guide_src/source/helpers/file_helper.rst b/user_guide_src/source/helpers/file_helper.rst
deleted file mode 100644
index 833cddea4..000000000
--- a/user_guide_src/source/helpers/file_helper.rst
+++ /dev/null
@@ -1,202 +0,0 @@
-###########
-File Helper
-###########
-
-The File Helper file contains functions that assist in working with files.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-Loading this Helper
-===================
-
-This helper is loaded using the following code::
-
- $this->load->helper('file');
-
-Available Functions
-===================
-
-The following functions are available:
-
-
-.. php:function:: read_file($file)
-
- :param string $file: File path
- :returns: File contents or FALSE on failure
- :rtype: string
-
- Returns the data contained in the file specified in the path.
-
- Example::
-
- $string = read_file('./path/to/file.php');
-
- The path can be a relative or full server path. Returns FALSE (boolean) on failure.
-
- .. note:: The path is relative to your main site index.php file, NOT your
- controller or view files. CodeIgniter uses a front controller so paths
- are always relative to the main site index.
-
- .. note:: This function is DEPRECATED. Use the native ``file_get_contents()``
- instead.
-
- .. important:: If your server is running an **open_basedir** restriction this
- function might not work if you are trying to access a file above the
- calling script.
-
-.. php:function:: write_file($path, $data[, $mode = 'wb'])
-
- :param string $path: File path
- :param string $data: Data to write to file
- :param string $mode: ``fopen()`` mode
- :returns: TRUE if the write was successful, FALSE in case of an error
- :rtype: bool
-
- Writes data to the file specified in the path. If the file does not exist then the
- function will create it.
-
- Example::
-
- $data = 'Some file data';
- if ( ! write_file('./path/to/file.php', $data))
- {     
- echo 'Unable to write the file';
- }
- else
- {     
- echo 'File written!';
- }
-
- You can optionally set the write mode via the third parameter::
-
- write_file('./path/to/file.php', $data, 'r+');
-
- The default mode is 'wb'. Please see the `PHP user guide <http://php.net/manual/en/function.fopen.php>`_
- for mode options.
-
- .. note: In order for this function to write data to a file, its permissions must
- be set such that it is writable. If the file does not already exist,
- then the directory containing it must be writable.
-
- .. note:: The path is relative to your main site index.php file, NOT your
- controller or view files. CodeIgniter uses a front controller so paths
- are always relative to the main site index.
-
- .. note:: This function acquires an exclusive lock on the file while writing to it.
-
-.. php:function:: delete_files($path[, $del_dir = FALSE[, $htdocs = FALSE]])
-
- :param string $path: Directory path
- :param bool $del_dir: Whether to also delete directories
- :param bool $htdocs: Whether to skip deleting .htaccess and index page files
- :returns: TRUE on success, FALSE in case of an error
- :rtype: bool
-
- Deletes ALL files contained in the supplied path.
-
- Example::
-
- delete_files('./path/to/directory/');
-
- If the second parameter is set to TRUE, any directories contained within the supplied
- root path will be deleted as well.
-
- Example::
-
- delete_files('./path/to/directory/', TRUE);
-
- .. note:: The files must be writable or owned by the system in order to be deleted.
-
-.. php:function:: get_filenames($source_dir[, $include_path = FALSE])
-
- :param string $source_dir: Directory path
- :param bool $include_path: Whether to include the path as part of the filenames
- :returns: An array of file names
- :rtype: array
-
- Takes a server path as input and returns an array containing the names of all files
- contained within it. The file path can optionally be added to the file names by setting
- the second parameter to TRUE.
-
- Example::
-
- $controllers = get_filenames(APPPATH.'controllers/');
-
-.. php:function:: get_dir_file_info($source_dir, $top_level_only)
-
- :param string $source_dir: Directory path
- :param bool $top_level_only: Whether to look only at the specified directory (excluding sub-directories)
- :returns: An array containing info on the supplied directory's contents
- :rtype: array
-
- Reads the specified directory and builds an array containing the filenames, filesize,
- dates, and permissions. Sub-folders contained within the specified path are only read
- if forced by sending the second parameter to FALSE, as this can be an intensive
- operation.
-
- Example::
-
- $models_info = get_dir_file_info(APPPATH.'models/');
-
-.. php:function:: get_file_info($file[, $returned_values = array('name', 'server_path', 'size', 'date')])
-
- :param string $file: File path
- :param array $returned_values: What type of info to return
- :returns: An array containing info on the specified file or FALSE on failure
- :rtype: array
-
- Given a file and path, returns (optionally) the *name*, *path*, *size* and *date modified*
- information attributes for a file. Second parameter allows you to explicitly declare what
- information you want returned.
-
- Valid ``$returned_values`` options are: `name`, `size`, `date`, `readable`, `writeable`,
- `executable` and `fileperms`.
-
-.. php:function:: get_mime_by_extension($filename)
-
- :param string $filename: File name
- :returns: MIME type string or FALSE on failure
- :rtype: string
-
- Translates a filename extension into a MIME type based on *config/mimes.php*.
- Returns FALSE if it can't determine the type, or read the MIME config file.
-
- ::
-
- $file = 'somefile.png';
- echo $file.' is has a mime type of '.get_mime_by_extension($file);
-
- .. note:: This is not an accurate way of determining file MIME types, and
- is here strictly for convenience. It should not be used for security
- purposes.
-
-.. php:function:: symbolic_permissions($perms)
-
- :param int $perms: Permissions
- :returns: Symbolic permissions string
- :rtype: string
-
- Takes numeric permissions (such as is returned by ``fileperms()``) and returns
- standard symbolic notation of file permissions.
-
- ::
-
- echo symbolic_permissions(fileperms('./index.php')); // -rw-r--r--
-
-.. php:function:: octal_permissions($perms)
-
- :param int $perms: Permissions
- :returns: Octal permissions string
- :rtype: string
-
- Takes numeric permissions (such as is returned by ``fileperms()``) and returns
- a three character octal notation of file permissions.
-
- ::
-
- echo octal_permissions(fileperms('./index.php')); // 644 \ No newline at end of file
diff --git a/user_guide_src/source/helpers/form_helper.rst b/user_guide_src/source/helpers/form_helper.rst
deleted file mode 100644
index 5002a25e4..000000000
--- a/user_guide_src/source/helpers/form_helper.rst
+++ /dev/null
@@ -1,743 +0,0 @@
-###########
-Form Helper
-###########
-
-The Form Helper file contains functions that assist in working with
-forms.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-Loading this Helper
-===================
-
-This helper is loaded using the following code::
-
- $this->load->helper('form');
-
-Escaping field values
-=====================
-
-You may need to use HTML and characters such as quotes within your form
-elements. In order to do that safely, you'll need to use
-:doc:`common function <../general/common_functions>`
-:func:`html_escape()`.
-
-Consider the following example::
-
- $string = 'Here is a string containing "quoted" text.';
-
- <input type="text" name="myfield" value="<?php echo $string; ?>" />
-
-Since the above string contains a set of quotes, it will cause the form
-to break. The :php:func:`html_escape()` function converts HTML special
-characters so that it can be used safely::
-
- <input type="text" name="myfield" value="<?php echo html_escape($string); ?>" />
-
-.. note:: If you use any of the form helper functions listed on this page,
- the form values will be automatically escaped, so there is no need
- to call this function. Use it only if you are creating your own
- form elements.
-
-Available Functions
-===================
-
-The following functions are available:
-
-
-.. php:function:: form_open([$action = ''[, $attributes = ''[, $hidden = array()]]])
-
- :param string $action: Form action/target URI string
- :param array $attributes: HTML attributes
- :param array $hidden: An array of hidden fields' definitions
- :returns: An HTML form opening tag
- :rtype: string
-
- Creates an opening form tag with a base URL **built from your config preferences**.
- It will optionally let you add form attributes and hidden input fields, and
- will always add the `accept-charset` attribute based on the charset value in your
- config file.
-
- The main benefit of using this tag rather than hard coding your own HTML is that
- it permits your site to be more portable in the event your URLs ever change.
-
- Here's a simple example::
-
- echo form_open('email/send');
-
- The above example would create a form that points to your base URL plus the
- "email/send" URI segments, like this::
-
- <form method="post" accept-charset="utf-8" action="http://example.com/index.php/email/send">
-
- **Adding Attributes**
-
- Attributes can be added by passing an associative array to the second
- parameter, like this::
-
- $attributes = array('class' => 'email', 'id' => 'myform');
- echo form_open('email/send', $attributes);
-
- Alternatively, you can specify the second parameter as a string::
-
- echo form_open('email/send', 'class="email" id="myform"');
-
- The above examples would create a form similar to this::
-
- <form method="post" accept-charset="utf-8" action="http://example.com/index.php/email/send" class="email" id="myform">
-
- **Adding Hidden Input Fields**
-
- Hidden fields can be added by passing an associative array to the
- third parameter, like this::
-
- $hidden = array('username' => 'Joe', 'member_id' => '234');
- echo form_open('email/send', '', $hidden);
-
- You can skip the second parameter by passing any falsy value to it.
-
- The above example would create a form similar to this::
-
- <form method="post" accept-charset="utf-8" action="http://example.com/index.php/email/send">
- <input type="hidden" name="username" value="Joe" />
- <input type="hidden" name="member_id" value="234" />
-
-
-.. php:function:: form_open_multipart([$action = ''[, $attributes = array()[, $hidden = array()]]])
-
- :param string $action: Form action/target URI string
- :param array $attributes: HTML attributes
- :param array $hidden: An array of hidden fields' definitions
- :returns: An HTML multipart form opening tag
- :rtype: string
-
- This function is absolutely identical to :php:func:`form_open()` above,
- except that it adds a *multipart* attribute, which is necessary if you
- would like to use the form to upload files with.
-
-
-.. php:function:: form_hidden($name[, $value = ''])
-
- :param string $name: Field name
- :param string $value: Field value
- :returns: An HTML hidden input field tag
- :rtype: string
-
- Lets you generate hidden input fields. You can either submit a
- name/value string to create one field::
-
- form_hidden('username', 'johndoe');
- // Would produce: <input type="hidden" name="username" value="johndoe" />
-
- ... or you can submit an associative array to create multiple fields::
-
- $data = array(
- 'name' => 'John Doe',
- 'email' => 'john@example.com',
- 'url' => 'http://example.com'
- );
-
- echo form_hidden($data);
-
- /*
- Would produce:
- <input type="hidden" name="name" value="John Doe" />
- <input type="hidden" name="email" value="john@example.com" />
- <input type="hidden" name="url" value="http://example.com" />
- */
-
- You can also pass an associative array to the value field::
-
- $data = array(
- 'name' => 'John Doe',
- 'email' => 'john@example.com',
- 'url' => 'http://example.com'
- );
-
- echo form_hidden('my_array', $data);
-
- /*
- Would produce:
-
- <input type="hidden" name="my_array[name]" value="John Doe" />
- <input type="hidden" name="my_array[email]" value="john@example.com" />
- <input type="hidden" name="my_array[url]" value="http://example.com" />
- */
-
- If you want to create hidden input fields with extra attributes::
-
- $data = array(
- 'type' => 'hidden',
- 'name' => 'email',
- 'id' => 'hiddenemail',
- 'value' => 'john@example.com',
- 'class' => 'hiddenemail'
- );
-
- echo form_input($data);
-
- /*
- Would produce:
-
- <input type="hidden" name="email" value="john@example.com" id="hiddenemail" class="hiddenemail" />
- */
-
-.. php:function:: form_input([$data = ''[, $value = ''[, $extra = '']]])
-
- :param array $data: Field attributes data
- :param string $value: Field value
- :param mixed $extra: Extra attributes to be added to the tag either as an array or a literal string
- :returns: An HTML text input field tag
- :rtype: string
-
- Lets you generate a standard text input field. You can minimally pass
- the field name and value in the first and second parameter::
-
- echo form_input('username', 'johndoe');
-
- Or you can pass an associative array containing any data you wish your
- form to contain::
-
- $data = array(
- 'name' => 'username',
- 'id' => 'username',
- 'value' => 'johndoe',
- 'maxlength' => '100',
- 'size' => '50',
- 'style' => 'width:50%'
- );
-
- echo form_input($data);
-
- /*
- Would produce:
-
- <input type="text" name="username" value="johndoe" id="username" maxlength="100" size="50" style="width:50%" />
- */
-
- If you would like your form to contain some additional data, like
- JavaScript, you can pass it as a string in the third parameter::
-
- $js = 'onClick="some_function()"';
- echo form_input('username', 'johndoe', $js);
-
- Or you can pass it as an array::
-
- $js = array('onClick' => 'some_function();');
- echo form_input('username', 'johndoe', $js);
-
-.. php:function:: form_password([$data = ''[, $value = ''[, $extra = '']]])
-
- :param array $data: Field attributes data
- :param string $value: Field value
- :param mixed $extra: Extra attributes to be added to the tag either as an array or a literal string
- :returns: An HTML password input field tag
- :rtype: string
-
- This function is identical in all respects to the :php:func:`form_input()`
- function above except that it uses the "password" input type.
-
-
-.. php:function:: form_upload([$data = ''[, $value = ''[, $extra = '']]])
-
- :param array $data: Field attributes data
- :param string $value: Field value
- :param mixed $extra: Extra attributes to be added to the tag either as an array or a literal string
- :returns: An HTML file upload input field tag
- :rtype: string
-
- This function is identical in all respects to the :php:func:`form_input()`
- function above except that it uses the "file" input type, allowing it to
- be used to upload files.
-
-
-.. php:function:: form_textarea([$data = ''[, $value = ''[, $extra = '']]])
-
- :param array $data: Field attributes data
- :param string $value: Field value
- :param mixed $extra: Extra attributes to be added to the tag either as an array or a literal string
- :returns: An HTML textarea tag
- :rtype: string
-
- This function is identical in all respects to the :php:func:`form_input()`
- function above except that it generates a "textarea" type.
-
- .. note:: Instead of the *maxlength* and *size* attributes in the above example,
- you will instead specify *rows* and *cols*.
-
-.. php:function:: form_dropdown([$name = ''[, $options = array()[, $selected = array()[, $extra = '']]]])
-
- :param string $name: Field name
- :param array $options: An associative array of options to be listed
- :param array $selected: List of fields to mark with the *selected* attribute
- :param mixed $extra: Extra attributes to be added to the tag either as an array or a literal string
- :returns: An HTML dropdown select field tag
- :rtype: string
-
- Lets you create a standard drop-down field. The first parameter will
- contain the name of the field, the second parameter will contain an
- associative array of options, and the third parameter will contain the
- value you wish to be selected. You can also pass an array of multiple
- items through the third parameter, and CodeIgniter will create a
- multiple select for you.
-
- Example::
-
- $options = array(
- 'small' => 'Small Shirt',
- 'med' => 'Medium Shirt',
- 'large' => 'Large Shirt',
- 'xlarge' => 'Extra Large Shirt',
- );
-
- $shirts_on_sale = array('small', 'large');
- echo form_dropdown('shirts', $options, 'large');
-
- /*
- Would produce:
-
- <select name="shirts">
- <option value="small">Small Shirt</option>
- <option value="med">Medium Shirt</option>
- <option value="large" selected="selected">Large Shirt</option>
- <option value="xlarge">Extra Large Shirt</option>
- </select>
- */
-
- echo form_dropdown('shirts', $options, $shirts_on_sale);
-
- /*
- Would produce:
-
- <select name="shirts" multiple="multiple">
- <option value="small" selected="selected">Small Shirt</option>
- <option value="med">Medium Shirt</option>
- <option value="large" selected="selected">Large Shirt</option>
- <option value="xlarge">Extra Large Shirt</option>
- </select>
- */
-
- If you would like the opening <select> to contain additional data, like
- an id attribute or JavaScript, you can pass it as a string in the fourth
- parameter::
-
- $js = 'id="shirts" onChange="some_function();"';
- echo form_dropdown('shirts', $options, 'large', $js);
-
- Or you can pass it as an array::
-
- $js = array(
- 'id' => 'shirts',
- 'onChange' => 'some_function();'
- );
- echo form_dropdown('shirts', $options, 'large', $js);
-
- If the array passed as ``$options`` is a multidimensional array, then
- ``form_dropdown()`` will produce an <optgroup> with the array key as the
- label.
-
-
-.. php:function:: form_multiselect([$name = ''[, $options = array()[, $selected = array()[, $extra = '']]]])
-
- :param string $name: Field name
- :param array $options: An associative array of options to be listed
- :param array $selected: List of fields to mark with the *selected* attribute
- :param mixed $extra: Extra attributes to be added to the tag either as an array or a literal string
- :returns: An HTML dropdown multiselect field tag
- :rtype: string
-
- Lets you create a standard multiselect field. The first parameter will
- contain the name of the field, the second parameter will contain an
- associative array of options, and the third parameter will contain the
- value or values you wish to be selected.
-
- The parameter usage is identical to using :php:func:`form_dropdown()` above,
- except of course that the name of the field will need to use POST array
- syntax, e.g. foo[].
-
-
-.. php:function:: form_fieldset([$legend_text = ''[, $attributes = array()]])
-
- :param string $legend_text: Text to put in the <legend> tag
- :param array $attributes: Attributes to be set on the <fieldset> tag
- :returns: An HTML fieldset opening tag
- :rtype: string
-
- Lets you generate fieldset/legend fields.
-
- Example::
-
- echo form_fieldset('Address Information');
- echo "<p>fieldset content here</p>\n";
- echo form_fieldset_close();
-
- /*
- Produces:
-
- <fieldset>
- <legend>Address Information</legend>
- <p>fieldset content here</p>
- </fieldset>
- */
-
- Similar to other functions, you can submit an associative array in the
- second parameter if you prefer to set additional attributes::
-
- $attributes = array(
- 'id' => 'address_info',
- 'class' => 'address_info'
- );
-
- echo form_fieldset('Address Information', $attributes);
- echo "<p>fieldset content here</p>\n";
- echo form_fieldset_close();
-
- /*
- Produces:
-
- <fieldset id="address_info" class="address_info">
- <legend>Address Information</legend>
- <p>fieldset content here</p>
- </fieldset>
- */
-
-
-.. php:function:: form_fieldset_close([$extra = ''])
-
- :param string $extra: Anything to append after the closing tag, *as is*
- :returns: An HTML fieldset closing tag
- :rtype: string
-
-
- Produces a closing </fieldset> tag. The only advantage to using this
- function is it permits you to pass data to it which will be added below
- the tag. For example
-
- ::
-
- $string = '</div></div>';
- echo form_fieldset_close($string);
- // Would produce: </fieldset></div></div>
-
-
-.. php:function:: form_checkbox([$data = ''[, $value = ''[, $checked = FALSE[, $extra = '']]]])
-
- :param array $data: Field attributes data
- :param string $value: Field value
- :param bool $checked: Whether to mark the checkbox as being *checked*
- :param mixed $extra: Extra attributes to be added to the tag either as an array or a literal string
- :returns: An HTML checkbox input tag
- :rtype: string
-
- Lets you generate a checkbox field. Simple example::
-
- echo form_checkbox('newsletter', 'accept', TRUE);
- // Would produce: <input type="checkbox" name="newsletter" value="accept" checked="checked" />
-
- The third parameter contains a boolean TRUE/FALSE to determine whether
- the box should be checked or not.
-
- Similar to the other form functions in this helper, you can also pass an
- array of attributes to the function::
-
- $data = array(
- 'name' => 'newsletter',
- 'id' => 'newsletter',
- 'value' => 'accept',
- 'checked' => TRUE,
- 'style' => 'margin:10px'
- );
-
- echo form_checkbox($data);
- // Would produce: <input type="checkbox" name="newsletter" id="newsletter" value="accept" checked="checked" style="margin:10px" />
-
- Also as with other functions, if you would like the tag to contain
- additional data like JavaScript, you can pass it as a string in the
- fourth parameter::
-
- $js = 'onClick="some_function()"';
- echo form_checkbox('newsletter', 'accept', TRUE, $js);
-
- Or you can pass it as an array::
-
- $js = array('onClick' => 'some_function();');
- echo form_checkbox('newsletter', 'accept', TRUE, $js);
-
-
-.. php:function:: form_radio([$data = ''[, $value = ''[, $checked = FALSE[, $extra = '']]]])
-
- :param array $data: Field attributes data
- :param string $value: Field value
- :param bool $checked: Whether to mark the radio button as being *checked*
- :param mixed $extra: Extra attributes to be added to the tag either as an array or a literal string
- :returns: An HTML radio input tag
- :rtype: string
-
- This function is identical in all respects to the :php:func:`form_checkbox()`
- function above except that it uses the "radio" input type.
-
-
-.. php:function:: form_label([$label_text = ''[, $id = ''[, $attributes = array()]]])
-
- :param string $label_text: Text to put in the <label> tag
- :param string $id: ID of the form element that we're making a label for
- :param mixed $attributes: HTML attributes
- :returns: An HTML field label tag
- :rtype: string
-
- Lets you generate a <label>. Simple example::
-
- echo form_label('What is your Name', 'username');
- // Would produce: <label for="username">What is your Name</label>
-
- Similar to other functions, you can submit an associative array in the
- third parameter if you prefer to set additional attributes.
-
- Example::
-
- $attributes = array(
- 'class' => 'mycustomclass',
- 'style' => 'color: #000;'
- );
-
- echo form_label('What is your Name', 'username', $attributes);
- // Would produce: <label for="username" class="mycustomclass" style="color: #000;">What is your Name</label>
-
-
-.. php:function:: form_submit([$data = ''[, $value = ''[, $extra = '']]])
-
- :param string $data: Button name
- :param string $value: Button value
- :param mixed $extra: Extra attributes to be added to the tag either as an array or a literal string
- :returns: An HTML input submit tag
- :rtype: string
-
- Lets you generate a standard submit button. Simple example::
-
- echo form_submit('mysubmit', 'Submit Post!');
- // Would produce: <input type="submit" name="mysubmit" value="Submit Post!" />
-
- Similar to other functions, you can submit an associative array in the
- first parameter if you prefer to set your own attributes. The third
- parameter lets you add extra data to your form, like JavaScript.
-
-
-.. php:function:: form_reset([$data = ''[, $value = ''[, $extra = '']]])
-
- :param string $data: Button name
- :param string $value: Button value
- :param mixed $extra: Extra attributes to be added to the tag either as an array or a literal string
- :returns: An HTML input reset button tag
- :rtype: string
-
- Lets you generate a standard reset button. Use is identical to
- :func:`form_submit()`.
-
-
-.. php:function:: form_button([$data = ''[, $content = ''[, $extra = '']]])
-
- :param string $data: Button name
- :param string $content: Button label
- :param mixed $extra: Extra attributes to be added to the tag either as an array or a literal string
- :returns: An HTML button tag
- :rtype: string
-
- Lets you generate a standard button element. You can minimally pass the
- button name and content in the first and second parameter::
-
- echo form_button('name','content');
- // Would produce: <button name="name" type="button">Content</button>
-
- Or you can pass an associative array containing any data you wish your
- form to contain::
-
- $data = array(
- 'name' => 'button',
- 'id' => 'button',
- 'value' => 'true',
- 'type' => 'reset',
- 'content' => 'Reset'
- );
-
- echo form_button($data);
- // Would produce: <button name="button" id="button" value="true" type="reset">Reset</button>
-
- If you would like your form to contain some additional data, like
- JavaScript, you can pass it as a string in the third parameter::
-
- $js = 'onClick="some_function()"';
- echo form_button('mybutton', 'Click Me', $js);
-
-
-.. php:function:: form_close([$extra = ''])
-
- :param string $extra: Anything to append after the closing tag, *as is*
- :returns: An HTML form closing tag
- :rtype: string
-
- Produces a closing </form> tag. The only advantage to using this
- function is it permits you to pass data to it which will be added below
- the tag. For example::
-
- $string = '</div></div>';
- echo form_close($string);
- // Would produce: </form> </div></div>
-
-
-.. php:function:: set_value($field[, $default = ''[, $html_escape = TRUE]])
-
- :param string $field: Field name
- :param string $default: Default value
- :param bool $html_escape: Whether to turn off HTML escaping of the value
- :returns: Field value
- :rtype: string
-
- Permits you to set the value of an input form or textarea. You must
- supply the field name via the first parameter of the function. The
- second (optional) parameter allows you to set a default value for the
- form. The third (optional) parameter allows you to turn off HTML escaping
- of the value, in case you need to use this function in combination with
- i.e. :php:func:`form_input()` and avoid double-escaping.
-
- Example::
-
- <input type="text" name="quantity" value="<?php echo set_value('quantity', '0'); ?>" size="50" />
-
- The above form will show "0" when loaded for the first time.
-
- .. note:: If you've loaded the :doc:`Form Validation Library <../libraries/form_validation>` and
- have set a validation rule for the field name in use with this helper, then it will
- forward the call to the :doc:`Form Validation Library <../libraries/form_validation>`'s
- own ``set_value()`` method. Otherwise, this function looks in ``$_POST`` for the
- field value.
-
-.. php:function:: set_select($field[, $value = ''[, $default = FALSE]])
-
- :param string $field: Field name
- :param string $value: Value to check for
- :param string $default: Whether the value is also a default one
- :returns: 'selected' attribute or an empty string
- :rtype: string
-
- If you use a <select> menu, this function permits you to display the
- menu item that was selected.
-
- The first parameter must contain the name of the select menu, the second
- parameter must contain the value of each item, and the third (optional)
- parameter lets you set an item as the default (use boolean TRUE/FALSE).
-
- Example::
-
- <select name="myselect">
- <option value="one" <?php echo set_select('myselect', 'one', TRUE); ?> >One</option>
- <option value="two" <?php echo set_select('myselect', 'two'); ?> >Two</option>
- <option value="three" <?php echo set_select('myselect', 'three'); ?> >Three</option>
- </select>
-
-.. php:function:: set_checkbox($field[, $value = ''[, $default = FALSE]])
-
- :param string $field: Field name
- :param string $value: Value to check for
- :param string $default: Whether the value is also a default one
- :returns: 'checked' attribute or an empty string
- :rtype: string
-
- Permits you to display a checkbox in the state it was submitted.
-
- The first parameter must contain the name of the checkbox, the second
- parameter must contain its value, and the third (optional) parameter
- lets you set an item as the default (use boolean TRUE/FALSE).
-
- Example::
-
- <input type="checkbox" name="mycheck" value="1" <?php echo set_checkbox('mycheck', '1'); ?> />
- <input type="checkbox" name="mycheck" value="2" <?php echo set_checkbox('mycheck', '2'); ?> />
-
-.. php:function:: set_radio($field[, $value = ''[, $default = FALSE]])
-
- :param string $field: Field name
- :param string $value: Value to check for
- :param string $default: Whether the value is also a default one
- :returns: 'checked' attribute or an empty string
- :rtype: string
-
- Permits you to display radio buttons in the state they were submitted.
- This function is identical to the :php:func:`set_checkbox()` function above.
-
- Example::
-
- <input type="radio" name="myradio" value="1" <?php echo set_radio('myradio', '1', TRUE); ?> />
- <input type="radio" name="myradio" value="2" <?php echo set_radio('myradio', '2'); ?> />
-
- .. note:: If you are using the Form Validation class, you must always specify
- a rule for your field, even if empty, in order for the ``set_*()``
- functions to work. This is because if a Form Validation object is
- defined, the control for ``set_*()`` is handed over to a method of the
- class instead of the generic helper function.
-
-.. php:function:: form_error([$field = ''[, $prefix = ''[, $suffix = '']]])
-
- :param string $field: Field name
- :param string $prefix: Error opening tag
- :param string $suffix: Error closing tag
- :returns: HTML-formatted form validation error message(s)
- :rtype: string
-
- Returns a validation error message from the :doc:`Form Validation Library
- <../libraries/form_validation>`, associated with the specified field name.
- You can optionally specify opening and closing tag(s) to put around the error
- message.
-
- Example::
-
- // Assuming that the 'username' field value was incorrect:
- echo form_error('myfield', '<div class="error">', '</div>');
-
- // Would produce: <div class="error">Error message associated with the "username" field.</div>
-
-
-.. php:function:: validation_errors([$prefix = ''[, $suffix = '']])
-
- :param string $prefix: Error opening tag
- :param string $suffix: Error closing tag
- :returns: HTML-formatted form validation error message(s)
- :rtype: string
-
- Similarly to the :php:func:`form_error()` function, returns all validation
- error messages produced by the :doc:`Form Validation Library
- <../libraries/form_validation>`, with optional opening and closing tags
- around each of the messages.
-
- Example::
-
- echo validation_errors('<span class="error">', '</span>');
-
- /*
- Would produce, e.g.:
-
- <span class="error">The "email" field doesn't contain a valid e-mail address!</span>
- <span class="error">The "password" field doesn't match the "repeat_password" field!</span>
-
- */
-
-.. php:function:: form_prep($str)
-
- :param string $str: Value to escape
- :returns: Escaped value
- :rtype: string
-
- Allows you to safely use HTML and characters such as quotes within form
- elements without breaking out of the form.
-
- .. note:: If you use any of the form helper functions listed in this page the form
- values will be prepped automatically, so there is no need to call this
- function. Use it only if you are creating your own form elements.
-
- .. note:: This function is DEPRECATED and is just an alias for
- :doc:`common function <../general/common_functions>`
- :func:`html_escape()` - please use that instead.
diff --git a/user_guide_src/source/helpers/html_helper.rst b/user_guide_src/source/helpers/html_helper.rst
deleted file mode 100644
index 2c748bea0..000000000
--- a/user_guide_src/source/helpers/html_helper.rst
+++ /dev/null
@@ -1,407 +0,0 @@
-###########
-HTML Helper
-###########
-
-The HTML Helper file contains functions that assist in working with
-HTML.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-Loading this Helper
-===================
-
-This helper is loaded using the following code::
-
- $this->load->helper('html');
-
-Available Functions
-===================
-
-The following functions are available:
-
-
-.. php:function:: heading([$data = ''[, $h = '1'[, $attributes = '']]])
-
- :param string $data: Content
- :param string $h: Heading level
- :param mixed $attributes: HTML attributes
- :returns: HTML heading tag
- :rtype: string
-
- Lets you create HTML heading tags. The first parameter will contain the
- data, the second the size of the heading. Example::
-
- echo heading('Welcome!', 3);
-
- The above would produce: <h3>Welcome!</h3>
-
- Additionally, in order to add attributes to the heading tag such as HTML
- classes, ids or inline styles, a third parameter accepts either a string
- or an array::
-
- echo heading('Welcome!', 3, 'class="pink"');
- echo heading('How are you?', 4, array('id' => 'question', 'class' => 'green'));
-
- The above code produces:
-
- .. code-block:: html
-
- <h3 class="pink">Welcome!<h3>
- <h4 id="question" class="green">How are you?</h4>
-
-.. php:function:: img([$src = ''[, $index_page = FALSE[, $attributes = '']]])
-
- :param string $src: Image source data
- :param bool $index_page: Whether to treat $src as a routed URI string
- :param array $attributes: HTML attributes
- :returns: HTML image tag
- :rtype: string
-
- Lets you create HTML <img /> tags. The first parameter contains the
- image source. Example::
-
- echo img('images/picture.jpg'); // gives <img src="http://site.com/images/picture.jpg" />
-
- There is an optional second parameter that is a TRUE/FALSE value that
- specifics if the *src* should have the page specified by
- ``$config['index_page']`` added to the address it creates.
- Presumably, this would be if you were using a media controller::
-
- echo img('images/picture.jpg', TRUE); // gives <img src="http://site.com/index.php/images/picture.jpg" alt="" />
-
- Additionally, an associative array can be passed to the ``img()`` function
- for complete control over all attributes and values. If an *alt* attribute
- is not provided, CodeIgniter will generate an empty string.
-
- Example::
-
- $image_properties = array(
- 'src' => 'images/picture.jpg',
- 'alt' => 'Me, demonstrating how to eat 4 slices of pizza at one time',
- 'class' => 'post_images',
- 'width' => '200',
- 'height'=> '200',
- 'title' => 'That was quite a night',
- 'rel' => 'lightbox'
- );
-
- img($image_properties);
- // <img src="http://site.com/index.php/images/picture.jpg" alt="Me, demonstrating how to eat 4 slices of pizza at one time" class="post_images" width="200" height="200" title="That was quite a night" rel="lightbox" />
-
-.. php:function:: link_tag([$href = ''[, $rel = 'stylesheet'[, $type = 'text/css'[, $title = ''[, $media = ''[, $index_page = FALSE]]]]]])
-
- :param string $href: What are we linking to
- :param string $rel: Relation type
- :param string $type: Type of the related document
- :param string $title: Link title
- :param string $media: Media type
- :param bool $index_page: Whether to treat $src as a routed URI string
- :returns: HTML link tag
- :rtype: string
-
- Lets you create HTML <link /> tags. This is useful for stylesheet links,
- as well as other links. The parameters are *href*, with optional *rel*,
- *type*, *title*, *media* and *index_page*.
-
- *index_page* is a boolean value that specifies if the *href* should have
- the page specified by ``$config['index_page']`` added to the address it creates.
-
- Example::
-
- echo link_tag('css/mystyles.css');
- // gives <link href="http://site.com/css/mystyles.css" rel="stylesheet" type="text/css" />
-
- Further examples::
-
- echo link_tag('favicon.ico', 'shortcut icon', 'image/ico');
- // <link href="http://site.com/favicon.ico" rel="shortcut icon" type="image/ico" />
-
- echo link_tag('feed', 'alternate', 'application/rss+xml', 'My RSS Feed');
- // <link href="http://site.com/feed" rel="alternate" type="application/rss+xml" title="My RSS Feed" />
-
- Additionally, an associative array can be passed to the ``link()`` function
- for complete control over all attributes and values::
-
- $link = array(
- 'href' => 'css/printer.css',
- 'rel' => 'stylesheet',
- 'type' => 'text/css',
- 'media' => 'print'
- );
-
- echo link_tag($link);
- // <link href="http://site.com/css/printer.css" rel="stylesheet" type="text/css" media="print" />
-
-
-.. php:function:: ul($list[, $attributes = ''])
-
- :param array $list: List entries
- :param array $attributes: HTML attributes
- :returns: HTML-formatted unordered list
- :rtype: string
-
- Permits you to generate unordered HTML lists from simple or
- multi-dimensional arrays. Example::
-
- $list = array(
- 'red',
- 'blue',
- 'green',
- 'yellow'
- );
-
- $attributes = array(
- 'class' => 'boldlist',
- 'id' => 'mylist'
- );
-
- echo ul($list, $attributes);
-
- The above code will produce this:
-
- .. code-block:: html
-
- <ul class="boldlist" id="mylist">
- <li>red</li>
- <li>blue</li>
- <li>green</li>
- <li>yellow</li>
- </ul>
-
- Here is a more complex example, using a multi-dimensional array::
-
- $attributes = array(
- 'class' => 'boldlist',
- 'id' => 'mylist'
- );
-
- $list = array(
- 'colors' => array(
- 'red',
- 'blue',
- 'green'
- ),
- 'shapes' => array(
- 'round',
- 'square',
- 'circles' => array(
- 'ellipse',
- 'oval',
- 'sphere'
- )
- ),
- 'moods' => array(
- 'happy',
- 'upset' => array(
- 'defeated' => array(
- 'dejected',
- 'disheartened',
- 'depressed'
- ),
- 'annoyed',
- 'cross',
- 'angry'
- )
- )
- );
-
- echo ul($list, $attributes);
-
- The above code will produce this:
-
- .. code-block:: html
-
- <ul class="boldlist" id="mylist">
- <li>colors
- <ul>
- <li>red</li>
- <li>blue</li>
- <li>green</li>
- </ul>
- </li>
- <li>shapes
- <ul>
- <li>round</li>
- <li>suare</li>
- <li>circles
- <ul>
- <li>elipse</li>
- <li>oval</li>
- <li>sphere</li>
- </ul>
- </li>
- </ul>
- </li>
- <li>moods
- <ul>
- <li>happy</li>
- <li>upset
- <ul>
- <li>defeated
- <ul>
- <li>dejected</li>
- <li>disheartened</li>
- <li>depressed</li>
- </ul>
- </li>
- <li>annoyed</li>
- <li>cross</li>
- <li>angry</li>
- </ul>
- </li>
- </ul>
- </li>
- </ul>
-
-.. php:function:: ol($list, $attributes = '')
-
- :param array $list: List entries
- :param array $attributes: HTML attributes
- :returns: HTML-formatted ordered list
- :rtype: string
-
- Identical to :php:func:`ul()`, only it produces the <ol> tag for
- ordered lists instead of <ul>.
-
-.. php:function:: meta([$name = ''[, $content = ''[, $type = 'name'[, $newline = "\n"]]]])
-
- :param string $name: Meta name
- :param string $content: Meta content
- :param string $type: Meta type
- :param string $newline: Newline character
- :returns: HTML meta tag
- :rtype: string
-
- Helps you generate meta tags. You can pass strings to the function, or
- simple arrays, or multidimensional ones.
-
- Examples::
-
- echo meta('description', 'My Great site');
- // Generates: <meta name="description" content="My Great Site" />
-
- echo meta('Content-type', 'text/html; charset=utf-8', 'equiv');
- // Note the third parameter. Can be "equiv" or "name"
- // Generates: <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
-
- echo meta(array('name' => 'robots', 'content' => 'no-cache'));
- // Generates: <meta name="robots" content="no-cache" />
-
- $meta = array(
- array(
- 'name' => 'robots',
- 'content' => 'no-cache'
- ),
- array(
- 'name' => 'description',
- 'content' => 'My Great Site'
- ),
- array(
- 'name' => 'keywords',
- 'content' => 'love, passion, intrigue, deception'
- ),
- array(
- 'name' => 'robots',
- 'content' => 'no-cache'
- ),
- array(
- 'name' => 'Content-type',
- 'content' => 'text/html; charset=utf-8', 'type' => 'equiv'
- )
- );
-
- echo meta($meta);
- // Generates:
- // <meta name="robots" content="no-cache" />
- // <meta name="description" content="My Great Site" />
- // <meta name="keywords" content="love, passion, intrigue, deception" />
- // <meta name="robots" content="no-cache" />
- // <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
-
-
-.. php:function:: doctype([$type = 'xhtml1-strict'])
-
- :param string $type: Doctype name
- :returns: HTML DocType tag
- :rtype: string
-
- Helps you generate document type declarations, or DTD's. XHTML 1.0
- Strict is used by default, but many doctypes are available.
-
- Example::
-
- echo doctype(); // <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
- echo doctype('html4-trans'); // <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-
- The following is a list of doctype choices. These are configurable, and
- pulled from application/config/doctypes.php
-
- =============================== =================== ==================================================================================================================================================
- Document type Option Result
- =============================== =================== ==================================================================================================================================================
- XHTML 1.1 xhtml11 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
- XHTML 1.0 Strict xhtml1-strict <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- XHTML 1.0 Transitional xhtml1-trans <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- XHTML 1.0 Frameset xhtml1-frame <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
- XHTML Basic 1.1 xhtml-basic11 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">
- HTML 5 html5 <!DOCTYPE html>
- HTML 4 Strict html4-strict <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
- HTML 4 Transitional html4-trans <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- HTML 4 Frameset html4-frame <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
- MathML 1.01 mathml1 <!DOCTYPE math SYSTEM "http://www.w3.org/Math/DTD/mathml1/mathml.dtd">
- MathML 2.0 mathml2 <!DOCTYPE math PUBLIC "-//W3C//DTD MathML 2.0//EN" "http://www.w3.org/Math/DTD/mathml2/mathml2.dtd">
- SVG 1.0 svg10 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
- SVG 1.1 Full svg11 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
- SVG 1.1 Basic svg11-basic <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd">
- SVG 1.1 Tiny svg11-tiny <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
- XHTML+MathML+SVG (XHTML host) xhtml-math-svg-xh <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">
- XHTML+MathML+SVG (SVG host) xhtml-math-svg-sh <!DOCTYPE svg:svg PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">
- XHTML+RDFa 1.0 xhtml-rdfa-1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
- XHTML+RDFa 1.1 xhtml-rdfa-2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.1//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd">
- =============================== =================== ==================================================================================================================================================
-
-.. php:function:: br([$count = 1])
-
- :param int $count: Number of times to repeat the tag
- :returns: HTML line break tag
- :rtype: string
-
- Generates line break tags (<br />) based on the number you submit.
- Example::
-
- echo br(3);
-
- The above would produce:
-
- .. code-block:: html
-
- <br /><br /><br />
-
- .. note:: This function is DEPRECATED. Use the native ``str_repeat()``
- in combination with ``<br />`` instead.
-
-.. php:function:: nbs([$num = 1])
-
- :param int $num: Number of space entities to produce
- :returns: A sequence of non-breaking space HTML entities
- :rtype: string
-
- Generates non-breaking spaces (&nbsp;) based on the number you submit.
- Example::
-
- echo nbs(3);
-
- The above would produce:
-
- .. code-block:: html
-
- &nbsp;&nbsp;&nbsp;
-
- .. note:: This function is DEPRECATED. Use the native ``str_repeat()``
- in combination with ``&nbsp;`` instead.
diff --git a/user_guide_src/source/helpers/index.rst b/user_guide_src/source/helpers/index.rst
deleted file mode 100644
index f28c8e164..000000000
--- a/user_guide_src/source/helpers/index.rst
+++ /dev/null
@@ -1,9 +0,0 @@
-#######
-Helpers
-#######
-
-.. toctree::
- :glob:
- :titlesonly:
-
- * \ No newline at end of file
diff --git a/user_guide_src/source/helpers/inflector_helper.rst b/user_guide_src/source/helpers/inflector_helper.rst
deleted file mode 100644
index e3c014939..000000000
--- a/user_guide_src/source/helpers/inflector_helper.rst
+++ /dev/null
@@ -1,99 +0,0 @@
-################
-Inflector Helper
-################
-
-The Inflector Helper file contains functions that permits you to change
-**English** words to plural, singular, camel case, etc.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-Loading this Helper
-===================
-
-This helper is loaded using the following code::
-
- $this->load->helper('inflector');
-
-Available Functions
-===================
-
-The following functions are available:
-
-
-.. php:function:: singular($str)
-
- :param string $str: Input string
- :returns: A singular word
- :rtype: string
-
- Changes a plural word to singular. Example::
-
- echo singular('dogs'); // Prints 'dog'
-
-.. php:function:: plural($str)
-
- :param string $str: Input string
- :returns: A plural word
- :rtype: string
-
- Changes a singular word to plural. Example::
-
- echo plural('dog'); // Prints 'dogs'
-
-.. php:function:: camelize($str)
-
- :param string $str: Input string
- :returns: Camelized string
- :rtype: string
-
- Changes a string of words separated by spaces or underscores to camel
- case. Example::
-
- echo camelize('my_dog_spot'); // Prints 'myDogSpot'
-
-.. php:function:: underscore($str)
-
- :param string $str: Input string
- :returns: String containing underscores instead of spaces
- :rtype: string
-
- Takes multiple words separated by spaces and underscores them.
- Example::
-
- echo underscore('my dog spot'); // Prints 'my_dog_spot'
-
-.. php:function:: humanize($str[, $separator = '_'])
-
- :param string $str: Input string
- :param string $separator: Input separator
- :returns: Humanized string
- :rtype: string
-
- Takes multiple words separated by underscores and adds spaces between
- them. Each word is capitalized.
-
- Example::
-
- echo humanize('my_dog_spot'); // Prints 'My Dog Spot'
-
- To use dashes instead of underscores::
-
- echo humanize('my-dog-spot', '-'); // Prints 'My Dog Spot'
-
-.. php:function:: word_is_countable($word)
-
- :param string $word: Input string
- :returns: TRUE if the word is countable or FALSE if not
- :rtype: bool
-
- Checks if the given word has a plural version. Example::
-
- word_is_countable('equipment'); // Returns FALSE
-
- .. note:: This function used to be called ``is_countable()`` in
- in previous CodeIgniter versions.
diff --git a/user_guide_src/source/helpers/language_helper.rst b/user_guide_src/source/helpers/language_helper.rst
deleted file mode 100644
index cfbd6c057..000000000
--- a/user_guide_src/source/helpers/language_helper.rst
+++ /dev/null
@@ -1,46 +0,0 @@
-###############
-Language Helper
-###############
-
-The Language Helper file contains functions that assist in working with
-language files.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-Loading this Helper
-===================
-
-This helper is loaded using the following code::
-
- $this->load->helper('language');
-
-Available Functions
-===================
-
-The following functions are available:
-
-
-.. php:function:: lang($line[, $for = ''[, $attributes = array()]])
-
- :param string $line: Language line key
- :param string $for: HTML "for" attribute (ID of the element we're creating a label for)
- :param array $attributes: Any additional HTML attributes
- :returns: The language line; in an HTML label tag, if the ``$for`` parameter is not empty
- :rtype: string
-
- This function returns a line of text from a loaded language file with
- simplified syntax that may be more desirable for view files than
- ``CI_Lang::line()``.
-
- Examples::
-
- echo lang('language_key');
- // Outputs: Language line
-
- echo lang('language_key', 'form_item_id', array('class' => 'myClass'));
- // Outputs: <label for="form_item_id" class="myClass">Language line</label> \ No newline at end of file
diff --git a/user_guide_src/source/helpers/number_helper.rst b/user_guide_src/source/helpers/number_helper.rst
deleted file mode 100644
index 9d5e98cfb..000000000
--- a/user_guide_src/source/helpers/number_helper.rst
+++ /dev/null
@@ -1,52 +0,0 @@
-#############
-Number Helper
-#############
-
-The Number Helper file contains functions that help you work with
-numeric data.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-Loading this Helper
-===================
-
-This helper is loaded using the following code::
-
- $this->load->helper('number');
-
-Available Functions
-===================
-
-The following functions are available:
-
-
-.. php:function:: byte_format($num[, $precision = 1])
-
- :param mixed $num: Number of bytes
- :param int $precision: Floating point precision
- :returns: Formatted data size string
- :rtype: string
-
- Formats numbers as bytes, based on size, and adds the appropriate
- suffix. Examples::
-
- echo byte_format(456); // Returns 456 Bytes
- echo byte_format(4567); // Returns 4.5 KB
- echo byte_format(45678); // Returns 44.6 KB
- echo byte_format(456789); // Returns 447.8 KB
- echo byte_format(3456789); // Returns 3.3 MB
- echo byte_format(12345678912345); // Returns 1.8 GB
- echo byte_format(123456789123456789); // Returns 11,228.3 TB
-
- An optional second parameter allows you to set the precision of the
- result::
-
- echo byte_format(45678, 2); // Returns 44.61 KB
-
- .. note:: The text generated by this function is found in the following
- language file: *language/<your_lang>/number_lang.php* \ No newline at end of file
diff --git a/user_guide_src/source/helpers/path_helper.rst b/user_guide_src/source/helpers/path_helper.rst
deleted file mode 100644
index f46cbad44..000000000
--- a/user_guide_src/source/helpers/path_helper.rst
+++ /dev/null
@@ -1,53 +0,0 @@
-###########
-Path Helper
-###########
-
-The Path Helper file contains functions that permits you to work with
-file paths on the server.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-Loading this Helper
-===================
-
-This helper is loaded using the following code::
-
- $this->load->helper('path');
-
-Available Functions
-===================
-
-The following functions are available:
-
-
-.. php:function:: set_realpath($path[, $check_existance = FALSE])
-
- :param string $path: Path
- :param bool $check_existance: Whether to check if the path actually exists
- :returns: An absolute path
- :rtype: string
-
- This function will return a server path without symbolic links or
- relative directory structures. An optional second argument will
- cause an error to be triggered if the path cannot be resolved.
-
- Examples::
-
- $file = '/etc/php5/apache2/php.ini';
- echo set_realpath($file); // Prints '/etc/php5/apache2/php.ini'
-
- $non_existent_file = '/path/to/non-exist-file.txt';
- echo set_realpath($non_existent_file, TRUE); // Shows an error, as the path cannot be resolved
- echo set_realpath($non_existent_file, FALSE); // Prints '/path/to/non-exist-file.txt'
-
- $directory = '/etc/php5';
- echo set_realpath($directory); // Prints '/etc/php5/'
-
- $non_existent_directory = '/path/to/nowhere';
- echo set_realpath($non_existent_directory, TRUE); // Shows an error, as the path cannot be resolved
- echo set_realpath($non_existent_directory, FALSE); // Prints '/path/to/nowhere' \ No newline at end of file
diff --git a/user_guide_src/source/helpers/security_helper.rst b/user_guide_src/source/helpers/security_helper.rst
deleted file mode 100644
index 103880cf9..000000000
--- a/user_guide_src/source/helpers/security_helper.rst
+++ /dev/null
@@ -1,106 +0,0 @@
-###############
-Security Helper
-###############
-
-The Security Helper file contains security related functions.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-Loading this Helper
-===================
-
-This helper is loaded using the following code::
-
- $this->load->helper('security');
-
-Available Functions
-===================
-
-The following functions are available:
-
-
-.. php:function:: xss_clean($str[, $is_image = FALSE])
-
- :param string $str: Input data
- :param bool $is_image: Whether we're dealing with an image
- :returns: XSS-clean string
- :rtype: string
-
- Provides Cross Site Script Hack filtering.
-
- This function is an alias for ``CI_Input::xss_clean()``. For more info,
- please see the :doc:`Input Library <../libraries/input>` documentation.
-
-.. php:function:: sanitize_filename($filename)
-
- :param string $filename: Filename
- :returns: Sanitized file name
- :rtype: string
-
- Provides protection against directory traversal.
-
- This function is an alias for ``CI_Security::sanitize_filename()``.
- For more info, please see the :doc:`Security Library <../libraries/security>`
- documentation.
-
-
-.. php:function:: do_hash($str[, $type = 'sha1'])
-
- :param string $str: Input
- :param string $type: Algorithm
- :returns: Hex-formatted hash
- :rtype: string
-
- Permits you to create one way hashes suitable for encrypting
- passwords. Will use SHA1 by default.
-
- See `hash_algos() <http://php.net/function.hash_algos>`_
- for a full list of supported algorithms.
-
- Examples::
-
- $str = do_hash($str); // SHA1
- $str = do_hash($str, 'md5'); // MD5
-
- .. note:: This function was formerly named ``dohash()``, which has been
- removed in favor of ``do_hash()``.
-
- .. note:: This function is DEPRECATED. Use the native ``hash()`` instead.
-
-
-.. php:function:: strip_image_tags($str)
-
- :param string $str: Input string
- :returns: The input string with no image tags
- :rtype: string
-
- This is a security function that will strip image tags from a string.
- It leaves the image URL as plain text.
-
- Example::
-
- $string = strip_image_tags($string);
-
- This function is an alias for ``CI_Security::strip_image_tags()``. For
- more info, please see the :doc:`Security Library <../libraries/security>`
- documentation.
-
-
-.. php:function:: encode_php_tags($str)
-
- :param string $str: Input string
- :returns: Safely formatted string
- :rtype: string
-
- This is a security function that converts PHP tags to entities.
-
- .. note:: :php:func:`xss_clean()` does this automatically, if you use it.
-
- Example::
-
- $string = encode_php_tags($string); \ No newline at end of file
diff --git a/user_guide_src/source/helpers/smiley_helper.rst b/user_guide_src/source/helpers/smiley_helper.rst
deleted file mode 100644
index 3e7669942..000000000
--- a/user_guide_src/source/helpers/smiley_helper.rst
+++ /dev/null
@@ -1,169 +0,0 @@
-#############
-Smiley Helper
-#############
-
-The Smiley Helper file contains functions that let you manage smileys
-(emoticons).
-
-.. important:: The Smiley helper is DEPRECATED and should not be used.
- It is currently only kept for backwards compatibility.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-Loading this Helper
-===================
-
-This helper is loaded using the following code::
-
- $this->load->helper('smiley');
-
-Overview
-========
-
-The Smiley helper has a renderer that takes plain text smileys, like
-:-) and turns them into a image representation, like |smile!|
-
-It also lets you display a set of smiley images that when clicked will
-be inserted into a form field. For example, if you have a blog that
-allows user commenting you can show the smileys next to the comment
-form. Your users can click a desired smiley and with the help of some
-JavaScript it will be placed into the form field.
-
-Clickable Smileys Tutorial
-==========================
-
-Here is an example demonstrating how you might create a set of clickable
-smileys next to a form field. This example requires that you first
-download and install the smiley images, then create a controller and the
-View as described.
-
-.. important:: Before you begin, please `download the smiley images
- <https://ellislab.com/asset/ci_download_files/smileys.zip>`_
- and put them in a publicly accessible place on your server.
- This helper also assumes you have the smiley replacement array
- located at `application/config/smileys.php`
-
-The Controller
---------------
-
-In your **application/controllers/** directory, create a file called
-Smileys.php and place the code below in it.
-
-.. important:: Change the URL in the :php:func:`get_clickable_smileys()`
- function below so that it points to your smiley folder.
-
-You'll notice that in addition to the smiley helper, we are also using
-the :doc:`Table Class <../libraries/table>`::
-
- <?php
-
- class Smileys extends CI_Controller {
-
- public function index()
- {
- $this->load->helper('smiley');
- $this->load->library('table');
-
- $image_array = get_clickable_smileys('http://example.com/images/smileys/', 'comments');
- $col_array = $this->table->make_columns($image_array, 8);
-
- $data['smiley_table'] = $this->table->generate($col_array);
- $this->load->view('smiley_view', $data);
- }
-
- }
-
-In your **application/views/** directory, create a file called **smiley_view.php**
-and place this code in it::
-
- <html>
- <head>
- <title>Smileys</title>
- <?php echo smiley_js(); ?>
- </head>
- <body>
- <form name="blog">
- <textarea name="comments" id="comments" cols="40" rows="4"></textarea>
- </form>
- <p>Click to insert a smiley!</p>
- <?php echo $smiley_table; ?> </body> </html>
- When you have created the above controller and view, load it by visiting http://www.example.com/index.php/smileys/
- </body>
- </html>
-
-Field Aliases
--------------
-
-When making changes to a view it can be inconvenient to have the field
-id in the controller. To work around this, you can give your smiley
-links a generic name that will be tied to a specific id in your view.
-
-::
-
- $image_array = get_smiley_links("http://example.com/images/smileys/", "comment_textarea_alias");
-
-To map the alias to the field id, pass them both into the
-:func:`smiley_js()` function::
-
- $image_array = smiley_js("comment_textarea_alias", "comments");
-
-Available Functions
-===================
-
-.. php:function:: get_clickable_smileys($image_url[, $alias = ''[, $smileys = NULL]])
-
- :param string $image_url: URL path to the smileys directory
- :param string $alias: Field alias
- :returns: An array of ready to use smileys
- :rtype: array
-
- Returns an array containing your smiley images wrapped in a clickable
- link. You must supply the URL to your smiley folder and a field id or
- field alias.
-
- Example::
-
- $image_array = get_clickable_smileys('http://example.com/images/smileys/', 'comment');
-
-.. php:function:: smiley_js([$alias = ''[, $field_id = ''[, $inline = TRUE]]])
-
- :param string $alias: Field alias
- :param string $field_id: Field ID
- :param bool $inline: Whether we're inserting an inline smiley
- :returns: Smiley-enabling JavaScript code
- :rtype: string
-
- Generates the JavaScript that allows the images to be clicked and
- inserted into a form field. If you supplied an alias instead of an id
- when generating your smiley links, you need to pass the alias and
- corresponding form id into the function. This function is designed to be
- placed into the <head> area of your web page.
-
- Example::
-
- <?php echo smiley_js(); ?>
-
-.. php:function:: parse_smileys([$str = ''[, $image_url = ''[, $smileys = NULL]]])
-
- :param string $str: Text containing smiley codes
- :param string $image_url: URL path to the smileys directory
- :param array $smileys: An array of smileys
- :returns: Parsed smileys
- :rtype: string
-
- Takes a string of text as input and replaces any contained plain text
- smileys into the image equivalent. The first parameter must contain your
- string, the second must contain the URL to your smiley folder
-
- Example::
-
- $str = 'Here are some smileys: :-) ;-)';
- $str = parse_smileys($str, 'http://example.com/images/smileys/');
- echo $str;
-
-.. |smile!| image:: ../images/smile.gif \ No newline at end of file
diff --git a/user_guide_src/source/helpers/string_helper.rst b/user_guide_src/source/helpers/string_helper.rst
deleted file mode 100644
index f08f56b0b..000000000
--- a/user_guide_src/source/helpers/string_helper.rst
+++ /dev/null
@@ -1,226 +0,0 @@
-#############
-String Helper
-#############
-
-The String Helper file contains functions that assist in working with
-strings.
-
-.. important:: Please note that these functions are NOT intended, nor
- suitable to be used for any kind of security-related logic.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-Loading this Helper
-===================
-
-This helper is loaded using the following code::
-
- $this->load->helper('string');
-
-Available Functions
-===================
-
-The following functions are available:
-
-
-.. php:function:: random_string([$type = 'alnum'[, $len = 8]])
-
- :param string $type: Randomization type
- :param int $len: Output string length
- :returns: A random string
- :rtype: string
-
- Generates a random string based on the type and length you specify.
-
- The first parameter specifies the type of string, the second parameter
- specifies the length. The following choices are available:
-
- - **alpha**: A string with lower and uppercase letters only.
- - **alnum**: Alpha-numeric string with lower and uppercase characters.
- - **basic**: A random number based on ``mt_rand()``.
- - **numeric**: Numeric string.
- - **nozero**: Numeric string with no zeros.
- - **md5**: An encrypted random number based on ``md5()`` (fixed length of 32).
- - **sha1**: An encrypted random number based on ``sha1()`` (fixed length of 40).
-
- Usage example::
-
- echo random_string('alnum', 16);
-
- .. note:: Usage of this function is NOT suitable for password generation
- or other security-sensitive purposes. Please use
- `random_bytes() <https://secure.php.net/random_bytes>`_ instead.
-
- .. note:: Usage of the *unique* and *encrypt* types is DEPRECATED. They
- are just aliases for *md5* and *sha1* respectively.
-
-.. php:function:: increment_string($str[, $separator = '_'[, $first = 1]])
-
- :param string $str: Input string
- :param string $separator: Separator to append a duplicate number with
- :param int $first: Starting number
- :returns: An incremented string
- :rtype: string
-
- Increments a string by appending a number to it or increasing the
- number. Useful for creating "copies" or a file or duplicating database
- content which has unique titles or slugs.
-
- Usage example::
-
- echo increment_string('file', '_'); // "file_1"
- echo increment_string('file', '-', 2); // "file-2"
- echo increment_string('file_4'); // "file_5"
-
-
-.. php:function:: alternator($args)
-
- :param mixed $args: A variable number of arguments
- :returns: Alternated string(s)
- :rtype: mixed
-
- Allows two or more items to be alternated between, when cycling through
- a loop. Example::
-
- for ($i = 0; $i < 10; $i++)
- {     
- echo alternator('string one', 'string two');
- }
-
- You can add as many parameters as you want, and with each iteration of
- your loop the next item will be returned.
-
- ::
-
- for ($i = 0; $i < 10; $i++)
- {     
- echo alternator('one', 'two', 'three', 'four', 'five');
- }
-
- .. note:: To use multiple separate calls to this function simply call the
- function with no arguments to re-initialize.
-
-.. php:function:: repeater($data[, $num = 1])
-
- :param string $data: Input
- :param int $num: Number of times to repeat
- :returns: Repeated string
- :rtype: string
-
- Generates repeating copies of the data you submit. Example::
-
- $string = "\n";
- echo repeater($string, 30);
-
- The above would generate 30 newlines.
-
- .. note:: This function is DEPRECATED. Use the native ``str_repeat()``
- instead.
-
-
-.. php:function:: reduce_double_slashes($str)
-
- :param string $str: Input string
- :returns: A string with normalized slashes
- :rtype: string
-
- Converts double slashes in a string to a single slash, except those
- found in URL protocol prefixes (e.g. \http://).
-
- Example::
-
- $string = "http://example.com//index.php";
- echo reduce_double_slashes($string); // results in "http://example.com/index.php"
-
-
-.. php:function:: strip_slashes($data)
-
- :param mixed $data: Input string or an array of strings
- :returns: String(s) with stripped slashes
- :rtype: mixed
-
- Removes any slashes from an array of strings.
-
- Example::
-
- $str = array(
- 'question'  => 'Is your name O\'reilly?',
- 'answer' => 'No, my name is O\'connor.'
- );
-
- $str = strip_slashes($str);
-
- The above will return the following array::
-
- array(
- 'question'  => "Is your name O'reilly?",
- 'answer' => "No, my name is O'connor."
- );
-
- .. note:: For historical reasons, this function will also accept
- and handle string inputs. This however makes it just an
- alias for ``stripslashes()``.
-
-.. php:function:: trim_slashes($str)
-
- :param string $str: Input string
- :returns: Slash-trimmed string
- :rtype: string
-
- Removes any leading/trailing slashes from a string. Example::
-
- $string = "/this/that/theother/";
- echo trim_slashes($string); // results in this/that/theother
-
- .. note:: This function is DEPRECATED. Use the native ``trim()`` instead:
- |
- | trim($str, '/');
-
-.. php:function:: reduce_multiples($str[, $character = ''[, $trim = FALSE]])
-
- :param string $str: Text to search in
- :param string $character: Character to reduce
- :param bool $trim: Whether to also trim the specified character
- :returns: Reduced string
- :rtype: string
-
- Reduces multiple instances of a particular character occurring directly
- after each other. Example::
-
- $string = "Fred, Bill,, Joe, Jimmy";
- $string = reduce_multiples($string,","); //results in "Fred, Bill, Joe, Jimmy"
-
- If the third parameter is set to TRUE it will remove occurrences of the
- character at the beginning and the end of the string. Example::
-
- $string = ",Fred, Bill,, Joe, Jimmy,";
- $string = reduce_multiples($string, ", ", TRUE); //results in "Fred, Bill, Joe, Jimmy"
-
-.. php:function:: quotes_to_entities($str)
-
- :param string $str: Input string
- :returns: String with quotes converted to HTML entities
- :rtype: string
-
- Converts single and double quotes in a string to the corresponding HTML
- entities. Example::
-
- $string = "Joe's \"dinner\"";
- $string = quotes_to_entities($string); //results in "Joe&#39;s &quot;dinner&quot;"
-
-
-.. php:function:: strip_quotes($str)
-
- :param string $str: Input string
- :returns: String with quotes stripped
- :rtype: string
-
- Removes single and double quotes from a string. Example::
-
- $string = "Joe's \"dinner\"";
- $string = strip_quotes($string); //results in "Joes dinner"
diff --git a/user_guide_src/source/helpers/text_helper.rst b/user_guide_src/source/helpers/text_helper.rst
deleted file mode 100644
index ef47882fb..000000000
--- a/user_guide_src/source/helpers/text_helper.rst
+++ /dev/null
@@ -1,230 +0,0 @@
-###########
-Text Helper
-###########
-
-The Text Helper file contains functions that assist in working with
-text.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-Loading this Helper
-===================
-
-This helper is loaded using the following code::
-
- $this->load->helper('text');
-
-Available Functions
-===================
-
-The following functions are available:
-
-.. php:function:: word_limiter($str[, $limit = 100[, $end_char = '&#8230;']])
-
- :param string $str: Input string
- :param int $limit: Limit
- :param string $end_char: End character (usually an ellipsis)
- :returns: Word-limited string
- :rtype: string
-
- Truncates a string to the number of *words* specified. Example::
-
- $string = "Here is a nice text string consisting of eleven words.";
- $string = word_limiter($string, 4);
- // Returns: Here is a nice
-
- The third parameter is an optional suffix added to the string. By
- default it adds an ellipsis.
-
-
-.. php:function:: character_limiter($str[, $n = 500[, $end_char = '&#8230;']])
-
- :param string $str: Input string
- :param int $n: Number of characters
- :param string $end_char: End character (usually an ellipsis)
- :returns: Character-limited string
- :rtype: string
-
- Truncates a string to the number of *characters* specified. It
- maintains the integrity of words so the character count may be slightly
- more or less than what you specify.
-
- Example::
-
- $string = "Here is a nice text string consisting of eleven words.";
- $string = character_limiter($string, 20);
- // Returns: Here is a nice text string
-
- The third parameter is an optional suffix added to the string, if
- undeclared this helper uses an ellipsis.
-
- .. note:: If you need to truncate to an exact number of characters please
- see the :php:func:`ellipsize()` function below.
-
-.. php:function:: ascii_to_entities($str)
-
- :param string $str: Input string
- :returns: A string with ASCII values converted to entities
- :rtype: string
-
- Converts ASCII values to character entities, including high ASCII and MS
- Word characters that can cause problems when used in a web page, so that
- they can be shown consistently regardless of browser settings or stored
- reliably in a database. There is some dependence on your server's
- supported character sets, so it may not be 100% reliable in all cases,
- but for the most part it should correctly identify characters outside
- the normal range (like accented characters).
-
- Example::
-
- $string = ascii_to_entities($string);
-
-.. php:function::entities_to_ascii($str[, $all = TRUE])
-
- :param string $str: Input string
- :param bool $all: Whether to convert unsafe entities as well
- :returns: A string with HTML entities converted to ASCII characters
- :rtype: string
-
- This function does the opposite of :php:func:`ascii_to_entities()`.
- It turns character entities back into ASCII.
-
-.. php:function:: convert_accented_characters($str)
-
- :param string $str: Input string
- :returns: A string with accented characters converted
- :rtype: string
-
- Transliterates high ASCII characters to low ASCII equivalents. Useful
- when non-English characters need to be used where only standard ASCII
- characters are safely used, for instance, in URLs.
-
- Example::
-
- $string = convert_accented_characters($string);
-
- .. note:: This function uses a companion config file
- `application/config/foreign_chars.php` to define the to and
- from array for transliteration.
-
-.. php:function:: word_censor($str, $censored[, $replacement = ''])
-
- :param string $str: Input string
- :param array $censored: List of bad words to censor
- :param string $replacement: What to replace bad words with
- :returns: Censored string
- :rtype: string
-
- Enables you to censor words within a text string. The first parameter
- will contain the original string. The second will contain an array of
- words which you disallow. The third (optional) parameter can contain
- a replacement value for the words. If not specified they are replaced
- with pound signs: ####.
-
- Example::
-
- $disallowed = array('darn', 'shucks', 'golly', 'phooey');
- $string = word_censor($string, $disallowed, 'Beep!');
-
-.. php:function:: highlight_code($str)
-
- :param string $str: Input string
- :returns: String with code highlighted via HTML
- :rtype: string
-
- Colorizes a string of code (PHP, HTML, etc.). Example::
-
- $string = highlight_code($string);
-
- The function uses PHP's ``highlight_string()`` function, so the
- colors used are the ones specified in your php.ini file.
-
-
-.. php:function:: highlight_phrase($str, $phrase[, $tag_open = '<mark>'[, $tag_close = '</mark>']])
-
- :param string $str: Input string
- :param string $phrase: Phrase to highlight
- :param string $tag_open: Opening tag used for the highlight
- :param string $tag_close: Closing tag for the highlight
- :returns: String with a phrase highlighted via HTML
- :rtype: string
-
- Will highlight a phrase within a text string. The first parameter will
- contain the original string, the second will contain the phrase you wish
- to highlight. The third and fourth parameters will contain the
- opening/closing HTML tags you would like the phrase wrapped in.
-
- Example::
-
- $string = "Here is a nice text string about nothing in particular.";
- echo highlight_phrase($string, "nice text", '<span style="color:#990000;">', '</span>');
-
- The above code prints::
-
- Here is a <span style="color:#990000;">nice text</span> string about nothing in particular.
-
- .. note:: This function used to use the ``<strong>`` tag by default. Older browsers
- might not support the new HTML5 mark tag, so it is recommended that you
- insert the following CSS code into your stylesheet if you need to support
- such browsers::
-
- mark {
- background: #ff0;
- color: #000;
- };
-
-.. php:function:: word_wrap($str[, $charlim = 76])
-
- :param string $str: Input string
- :param int $charlim: Character limit
- :returns: Word-wrapped string
- :rtype: string
-
- Wraps text at the specified *character* count while maintaining
- complete words.
-
- Example::
-
- $string = "Here is a simple string of text that will help us demonstrate this function.";
- echo word_wrap($string, 25);
-
- // Would produce:
- // Here is a simple string
- // of text that will help us
- // demonstrate this
- // function.
-
-.. php:function:: ellipsize($str, $max_length[, $position = 1[, $ellipsis = '&hellip;']])
-
- :param string $str: Input string
- :param int $max_length: String length limit
- :param mixed $position: Position to split at (int or float)
- :param string $ellipsis: What to use as the ellipsis character
- :returns: Ellipsized string
- :rtype: string
-
- This function will strip tags from a string, split it at a defined
- maximum length, and insert an ellipsis.
-
- The first parameter is the string to ellipsize, the second is the number
- of characters in the final string. The third parameter is where in the
- string the ellipsis should appear from 0 - 1, left to right. For
- example. a value of 1 will place the ellipsis at the right of the
- string, .5 in the middle, and 0 at the left.
-
- An optional forth parameter is the kind of ellipsis. By default,
- &hellip; will be inserted.
-
- Example::
-
- $str = 'this_string_is_entirely_too_long_and_might_break_my_design.jpg';
- echo ellipsize($str, 32, .5);
-
- Produces::
-
- this_string_is_e&hellip;ak_my_design.jpg \ No newline at end of file
diff --git a/user_guide_src/source/helpers/typography_helper.rst b/user_guide_src/source/helpers/typography_helper.rst
deleted file mode 100644
index 89730b03d..000000000
--- a/user_guide_src/source/helpers/typography_helper.rst
+++ /dev/null
@@ -1,75 +0,0 @@
-#################
-Typography Helper
-#################
-
-The Typography Helper file contains functions that help your format text
-in semantically relevant ways.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-Loading this Helper
-===================
-
-This helper is loaded using the following code::
-
- $this->load->helper('typography');
-
-Available Functions
-===================
-
-The following functions are available:
-
-
-.. php:function:: auto_typography($str[, $reduce_linebreaks = FALSE])
-
- :param string $str: Input string
- :param bool $reduce_linebreaks: Whether to reduce multiple instances of double newlines to two
- :returns: HTML-formatted typography-safe string
- :rtype: string
-
- Formats text so that it is semantically and typographically correct
- HTML.
-
- This function is an alias for ``CI_Typography::auto_typography()``.
- For more info, please see the :doc:`Typography Library
- <../libraries/typography>` documentation.
-
- Usage example::
-
- $string = auto_typography($string);
-
- .. note:: Typographic formatting can be processor intensive, particularly if
- you have a lot of content being formatted. If you choose to use this
- function you may want to consider :doc:`caching <../general/caching>` your
- pages.
-
-
-.. php:function:: nl2br_except_pre($str)
-
- :param string $str: Input string
- :returns: String with HTML-formatted line breaks
- :rtype: string
-
- Converts newlines to <br /> tags unless they appear within <pre> tags.
- This function is identical to the native PHP ``nl2br()`` function,
- except that it ignores <pre> tags.
-
- Usage example::
-
- $string = nl2br_except_pre($string);
-
-.. php:function:: entity_decode($str, $charset = NULL)
-
- :param string $str: Input string
- :param string $charset: Character set
- :returns: String with decoded HTML entities
- :rtype: string
-
- This function is an alias for ``CI_Security::entity_decode()``.
- Fore more info, please see the :doc:`Security Library
- <../libraries/security>` documentation. \ No newline at end of file
diff --git a/user_guide_src/source/helpers/url_helper.rst b/user_guide_src/source/helpers/url_helper.rst
deleted file mode 100644
index e117d37c0..000000000
--- a/user_guide_src/source/helpers/url_helper.rst
+++ /dev/null
@@ -1,373 +0,0 @@
-##########
-URL Helper
-##########
-
-The URL Helper file contains functions that assist in working with URLs.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-Loading this Helper
-===================
-
-This helper is loaded using the following code::
-
- $this->load->helper('url');
-
-Available Functions
-===================
-
-The following functions are available:
-
-.. php:function:: site_url([$uri = ''[, $protocol = NULL]])
-
- :param string $uri: URI string
- :param string $protocol: Protocol, e.g. 'http' or 'https'
- :returns: Site URL
- :rtype: string
-
- Returns your site URL, as specified in your config file. The index.php
- file (or whatever you have set as your site **index_page** in your config
- file) will be added to the URL, as will any URI segments you pass to the
- function, plus the **url_suffix** as set in your config file.
-
- You are encouraged to use this function any time you need to generate a
- local URL so that your pages become more portable in the event your URL
- changes.
-
- Segments can be optionally passed to the function as a string or an
- array. Here is a string example::
-
- echo site_url('news/local/123');
-
- The above example would return something like:
- *http://example.com/index.php/news/local/123*
-
- Here is an example of segments passed as an array::
-
- $segments = array('news', 'local', '123');
- echo site_url($segments);
-
- This function is an alias for ``CI_Config::site_url()``. For more info,
- please see the :doc:`Config Library <../libraries/config>` documentation.
-
-.. php:function:: base_url($uri = '', $protocol = NULL)
-
- :param string $uri: URI string
- :param string $protocol: Protocol, e.g. 'http' or 'https'
- :returns: Base URL
- :rtype: string
-
- Returns your site base URL, as specified in your config file. Example::
-
- echo base_url();
-
- This function returns the same thing as :php:func:`site_url()`, without
- the *index_page* or *url_suffix* being appended.
-
- Also like :php:func:`site_url()`, you can supply segments as a string or
- an array. Here is a string example::
-
- echo base_url("blog/post/123");
-
- The above example would return something like:
- *http://example.com/blog/post/123*
-
- This is useful because unlike :php:func:`site_url()`, you can supply a
- string to a file, such as an image or stylesheet. For example::
-
- echo base_url("images/icons/edit.png");
-
- This would give you something like:
- *http://example.com/images/icons/edit.png*
-
- This function is an alias for ``CI_Config::base_url()``. For more info,
- please see the :doc:`Config Library <../libraries/config>` documentation.
-
-.. php:function:: current_url()
-
- :returns: The current URL
- :rtype: string
-
- Returns the full URL (including segments) of the page being currently
- viewed.
-
- .. note:: Calling this function is the same as doing this:
- |
- | site_url(uri_string());
-
-
-.. php:function:: uri_string()
-
- :returns: An URI string
- :rtype: string
-
- Returns the URI segments of any page that contains this function.
- For example, if your URL was this::
-
- http://some-site.com/blog/comments/123
-
- The function would return::
-
- blog/comments/123
-
- This function is an alias for ``CI_Config::uri_string()``. For more info,
- please see the :doc:`Config Library <../libraries/config>` documentation.
-
-
-.. php:function:: index_page()
-
- :returns: 'index_page' value
- :rtype: mixed
-
- Returns your site **index_page**, as specified in your config file.
- Example::
-
- echo index_page();
-
-.. php:function:: anchor($uri = '', $title = '', $attributes = '')
-
- :param string $uri: URI string
- :param string $title: Anchor title
- :param mixed $attributes: HTML attributes
- :returns: HTML hyperlink (anchor tag)
- :rtype: string
-
- Creates a standard HTML anchor link based on your local site URL.
-
- The first parameter can contain any segments you wish appended to the
- URL. As with the :php:func:`site_url()` function above, segments can
- be a string or an array.
-
- .. note:: If you are building links that are internal to your application
- do not include the base URL (\http://...). This will be added
- automatically from the information specified in your config file.
- Include only the URI segments you wish appended to the URL.
-
- The second segment is the text you would like the link to say. If you
- leave it blank, the URL will be used.
-
- The third parameter can contain a list of attributes you would like
- added to the link. The attributes can be a simple string or an
- associative array.
-
- Here are some examples::
-
- echo anchor('news/local/123', 'My News', 'title="News title"');
- // Prints: <a href="http://example.com/index.php/news/local/123" title="News title">My News</a>
-
- echo anchor('news/local/123', 'My News', array('title' => 'The best news!'));
- // Prints: <a href="http://example.com/index.php/news/local/123" title="The best news!">My News</a>
-
- echo anchor('', 'Click here');
- // Prints: <a href="http://example.com">Click Here</a>
-
-
-.. php:function:: anchor_popup($uri = '', $title = '', $attributes = FALSE)
-
- :param string $uri: URI string
- :param string $title: Anchor title
- :param mixed $attributes: HTML attributes
- :returns: Pop-up hyperlink
- :rtype: string
-
- Nearly identical to the :php:func:`anchor()` function except that it
- opens the URL in a new window. You can specify JavaScript window
- attributes in the third parameter to control how the window is opened.
- If the third parameter is not set it will simply open a new window with
- your own browser settings.
-
- Here is an example with attributes::
-
- $atts = array(
- 'width' => 800,
- 'height' => 600,
- 'scrollbars' => 'yes',
- 'status'      => 'yes',
- 'resizable'   => 'yes',
- 'screenx' => 0,
- 'screeny' => 0,
- 'window_name' => '_blank'
- );
-
- echo anchor_popup('news/local/123', 'Click Me!', $atts);
-
- .. note:: The above attributes are the function defaults so you only need to
- set the ones that are different from what you need. If you want the
- function to use all of its defaults simply pass an empty array in the
- third parameter:
- |
- | echo anchor_popup('news/local/123', 'Click Me!', array());
-
- .. note:: The **window_name** is not really an attribute, but an argument to
- the JavaScript `window.open() <http://www.w3schools.com/jsref/met_win_open.asp>`
- method, which accepts either a window name or a window target.
-
- .. note:: Any other attribute than the listed above will be parsed as an
- HTML attribute to the anchor tag.
-
-
-.. php:function:: mailto($email, $title = '', $attributes = '')
-
- :param string $email: E-mail address
- :param string $title: Anchor title
- :param mixed $attributes: HTML attributes
- :returns: A "mail to" hyperlink
- :rtype: string
-
- Creates a standard HTML e-mail link. Usage example::
-
- echo mailto('me@my-site.com', 'Click Here to Contact Me');
-
- As with the :php:func:`anchor()` tab above, you can set attributes using the
- third parameter::
-
- $attributes = array('title' => 'Mail me');
- echo mailto('me@my-site.com', 'Contact Me', $attributes);
-
-.. php:function:: safe_mailto($email, $title = '', $attributes = '')
-
- :param string $email: E-mail address
- :param string $title: Anchor title
- :param mixed $attributes: HTML attributes
- :returns: A spam-safe "mail to" hyperlink
- :rtype: string
-
- Identical to the :php:func:`mailto()` function except it writes an obfuscated
- version of the *mailto* tag using ordinal numbers written with JavaScript to
- help prevent the e-mail address from being harvested by spam bots.
-
-.. php:function:: auto_link($str, $type = 'both', $popup = FALSE)
-
- :param string $str: Input string
- :param string $type: Link type ('email', 'url' or 'both')
- :param bool $popup: Whether to create popup links
- :returns: Linkified string
- :rtype: string
-
- Automatically turns URLs and e-mail addresses contained in a string into
- links. Example::
-
- $string = auto_link($string);
-
- The second parameter determines whether URLs and e-mails are converted or
- just one or the other. Default behavior is both if the parameter is not
- specified. E-mail links are encoded as :php:func:`safe_mailto()` as shown
- above.
-
- Converts only URLs::
-
- $string = auto_link($string, 'url');
-
- Converts only e-mail addresses::
-
- $string = auto_link($string, 'email');
-
- The third parameter determines whether links are shown in a new window.
- The value can be TRUE or FALSE (boolean)::
-
- $string = auto_link($string, 'both', TRUE);
-
-
-.. php:function:: url_title($str, $separator = '-', $lowercase = FALSE)
-
- :param string $str: Input string
- :param string $separator: Word separator
- :param bool $lowercase: Whether to transform the output string to lower-case
- :returns: URL-formatted string
- :rtype: string
-
- Takes a string as input and creates a human-friendly URL string. This is
- useful if, for example, you have a blog in which you'd like to use the
- title of your entries in the URL. Example::
-
- $title = "What's wrong with CSS?";
- $url_title = url_title($title);
- // Produces: Whats-wrong-with-CSS
-
- The second parameter determines the word delimiter. By default dashes
- are used. Preferred options are: **-** (dash) or **_** (underscore)
-
- Example::
-
- $title = "What's wrong with CSS?";
- $url_title = url_title($title, 'underscore');
- // Produces: Whats_wrong_with_CSS
-
- .. note:: Old usage of 'dash' and 'underscore' as the second parameter
- is DEPRECATED.
-
- The third parameter determines whether or not lowercase characters are
- forced. By default they are not. Options are boolean TRUE/FALSE.
-
- Example::
-
- $title = "What's wrong with CSS?";
- $url_title = url_title($title, 'underscore', TRUE);
- // Produces: whats_wrong_with_css
-
-
-.. php:function:: prep_url($str = '')
-
- :param string $str: URL string
- :returns: Protocol-prefixed URL string
- :rtype: string
-
- This function will add \http:// in the event that a protocol prefix
- is missing from a URL.
-
- Pass the URL string to the function like this::
-
- $url = prep_url('example.com');
-
-
-.. php:function:: redirect($uri = '', $method = 'auto', $code = NULL)
-
- :param string $uri: URI string
- :param string $method: Redirect method ('auto', 'location' or 'refresh')
- :param string $code: HTTP Response code (usually 302 or 303)
- :rtype: void
-
- Does a "header redirect" to the URI specified. If you specify the full
- site URL that link will be built, but for local links simply providing
- the URI segments to the controller you want to direct to will create the
- link. The function will build the URL based on your config file values.
-
- The optional second parameter allows you to force a particular redirection
- method. The available methods are **auto**, **location** and **refresh**,
- with location being faster but less reliable on IIS servers.
- The default is **auto**, which will attempt to intelligently choose the
- method based on the server environment.
-
- The optional third parameter allows you to send a specific HTTP Response
- Code - this could be used for example to create 301 redirects for search
- engine purposes. The default Response Code is 302. The third parameter is
- *only* available with **location** redirects, and not *refresh*. Examples::
-
- if ($logged_in == FALSE)
- {      
- redirect('/login/form/');
- }
-
- // with 301 redirect
- redirect('/article/13', 'location', 301);
-
- .. note:: In order for this function to work it must be used before anything
- is outputted to the browser since it utilizes server headers.
-
- .. note:: For very fine grained control over headers, you should use the
- :doc:`Output Library </libraries/output>` ``set_header()`` method.
-
- .. note:: To IIS users: if you hide the `Server` HTTP header, the *auto*
- method won't detect IIS, in that case it is advised you explicitly
- use the **refresh** method.
-
- .. note:: When the **location** method is used, an HTTP status code of 303
- will *automatically* be selected when the page is currently accessed
- via POST and HTTP/1.1 is used.
-
- .. important:: This function will terminate script execution.
diff --git a/user_guide_src/source/helpers/xml_helper.rst b/user_guide_src/source/helpers/xml_helper.rst
deleted file mode 100644
index 903e925c2..000000000
--- a/user_guide_src/source/helpers/xml_helper.rst
+++ /dev/null
@@ -1,55 +0,0 @@
-##########
-XML Helper
-##########
-
-The XML Helper file contains functions that assist in working with XML
-data.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-Loading this Helper
-===================
-
-This helper is loaded using the following code
-
-::
-
- $this->load->helper('xml');
-
-Available Functions
-===================
-
-The following functions are available:
-
-.. php:function:: xml_convert($str[, $protect_all = FALSE])
-
- :param string $str: the text string to convert
- :param bool $protect_all: Whether to protect all content that looks like a potential entity instead of just numbered entities, e.g. &foo;
- :returns: XML-converted string
- :rtype: string
-
- Takes a string as input and converts the following reserved XML
- characters to entities:
-
- - Ampersands: &
- - Less than and greater than characters: < >
- - Single and double quotes: ' "
- - Dashes: -
-
- This function ignores ampersands if they are part of existing numbered
- character entities, e.g. &#123;. Example::
-
- $string = '<p>Here is a paragraph & an entity (&#123;).</p>';
- $string = xml_convert($string);
- echo $string;
-
- outputs:
-
- .. code-block:: html
-
- &lt;p&gt;Here is a paragraph &amp; an entity (&#123;).&lt;/p&gt; \ No newline at end of file
diff --git a/user_guide_src/source/images/appflowchart.gif b/user_guide_src/source/images/appflowchart.gif
deleted file mode 100644
index 422332c9e..000000000
--- a/user_guide_src/source/images/appflowchart.gif
+++ /dev/null
Binary files differ
diff --git a/user_guide_src/source/images/arrow.gif b/user_guide_src/source/images/arrow.gif
deleted file mode 100644
index 9e9c79a79..000000000
--- a/user_guide_src/source/images/arrow.gif
+++ /dev/null
Binary files differ
diff --git a/user_guide_src/source/images/ci-icon.ico b/user_guide_src/source/images/ci-icon.ico
deleted file mode 100644
index 7ecfce214..000000000
--- a/user_guide_src/source/images/ci-icon.ico
+++ /dev/null
Binary files differ
diff --git a/user_guide_src/source/images/ci_logo.jpg b/user_guide_src/source/images/ci_logo.jpg
deleted file mode 100644
index 3ae0eee07..000000000
--- a/user_guide_src/source/images/ci_logo.jpg
+++ /dev/null
Binary files differ
diff --git a/user_guide_src/source/images/ci_logo_flame.jpg b/user_guide_src/source/images/ci_logo_flame.jpg
deleted file mode 100644
index 17e9c586b..000000000
--- a/user_guide_src/source/images/ci_logo_flame.jpg
+++ /dev/null
Binary files differ
diff --git a/user_guide_src/source/images/file.gif b/user_guide_src/source/images/file.gif
deleted file mode 100644
index 8141e0357..000000000
--- a/user_guide_src/source/images/file.gif
+++ /dev/null
Binary files differ
diff --git a/user_guide_src/source/images/folder.gif b/user_guide_src/source/images/folder.gif
deleted file mode 100644
index fef31a60b..000000000
--- a/user_guide_src/source/images/folder.gif
+++ /dev/null
Binary files differ
diff --git a/user_guide_src/source/images/smile.gif b/user_guide_src/source/images/smile.gif
deleted file mode 100644
index bf0922504..000000000
--- a/user_guide_src/source/images/smile.gif
+++ /dev/null
Binary files differ
diff --git a/user_guide_src/source/index.rst b/user_guide_src/source/index.rst
deleted file mode 100644
index 615c27f3c..000000000
--- a/user_guide_src/source/index.rst
+++ /dev/null
@@ -1,122 +0,0 @@
-######################
-CodeIgniter User Guide
-######################
-
-- :doc:`License Agreement <license>`
-- :doc:`Change Log <changelog>`
-
-.. contents::
- :local:
- :depth: 2
-
-*******
-Welcome
-*******
-
-.. toctree::
- :titlesonly:
-
- general/welcome
-
-**********
-Basic Info
-**********
-
-- :doc:`general/requirements`
-- :doc:`general/credits`
-
-************
-Installation
-************
-.. toctree::
- :includehidden:
- :maxdepth: 2
- :titlesonly:
-
- installation/index
-
-************
-Introduction
-************
-
-.. toctree::
- :titlesonly:
-
- overview/index
-
-********
-Tutorial
-********
-
-.. toctree::
- :includehidden:
- :titlesonly:
-
- tutorial/index
-
-***************************
-Contributing to CodeIgniter
-***************************
-
-.. toctree::
- :glob:
- :titlesonly:
-
- contributing/index
-
-**************
-General Topics
-**************
-
-.. toctree::
- :glob:
- :titlesonly:
-
- general/index
-
-*****************
-Library Reference
-*****************
-
-.. toctree::
- :glob:
- :titlesonly:
-
- libraries/index
-
-******************
-Database Reference
-******************
-
-.. toctree::
- :glob:
- :titlesonly:
-
- database/index
-
-****************
-Helper Reference
-****************
-
-.. toctree::
- :glob:
- :titlesonly:
-
- helpers/index
-
-.. toctree::
- :glob:
- :titlesonly:
- :hidden:
-
- *
- overview/index
- general/requirements
- general/welcome
- installation/index
- general/index
- libraries/index
- database/index
- helpers/index
- tutorial/index
- general/credits
diff --git a/user_guide_src/source/installation/downloads.rst b/user_guide_src/source/installation/downloads.rst
deleted file mode 100644
index 061dc3b8a..000000000
--- a/user_guide_src/source/installation/downloads.rst
+++ /dev/null
@@ -1,50 +0,0 @@
-#######################
-Downloading CodeIgniter
-#######################
-
-- `CodeIgniter v3.1.13-dev (Current version) <https://codeload.github.com/bcit-ci/CodeIgniter/zip/3.1-stable>`_
-- `CodeIgniter v3.1.12 <https://codeload.github.com/bcit-ci/CodeIgniter/zip/3.1.12>`_
-- `CodeIgniter v3.1.11 <https://codeload.github.com/bcit-ci/CodeIgniter/zip/3.1.11>`_
-- `CodeIgniter v3.1.10 <https://codeload.github.com/bcit-ci/CodeIgniter/zip/3.1.10>`_
-- `CodeIgniter v3.1.9 <https://codeload.github.com/bcit-ci/CodeIgniter/zip/3.1.9>`_
-- `CodeIgniter v3.1.8 <https://codeload.github.com/bcit-ci/CodeIgniter/zip/3.1.8>`_
-- `CodeIgniter v3.1.7 <https://codeload.github.com/bcit-ci/CodeIgniter/zip/3.1.7>`_
-- `CodeIgniter v3.1.6 <https://codeload.github.com/bcit-ci/CodeIgniter/zip/3.1.6>`_
-- `CodeIgniter v3.1.5 <https://codeload.github.com/bcit-ci/CodeIgniter/zip/3.1.5>`_
-- `CodeIgniter v3.1.4 <https://codeload.github.com/bcit-ci/CodeIgniter/zip/3.1.4>`_
-- `CodeIgniter v3.1.3 <https://codeload.github.com/bcit-ci/CodeIgniter/zip/3.1.3>`_
-- `CodeIgniter v3.1.2 <https://codeload.github.com/bcit-ci/CodeIgniter/zip/3.1.2>`_
-- `CodeIgniter v3.1.1 <https://codeload.github.com/bcit-ci/CodeIgniter/zip/3.1.1>`_
-- `CodeIgniter v3.1.0 <https://codeload.github.com/bcit-ci/CodeIgniter/zip/3.1.0>`_
-- `CodeIgniter v3.0.6 <https://codeload.github.com/bcit-ci/CodeIgniter/zip/3.0.6>`_
-- `CodeIgniter v3.0.5 <https://codeload.github.com/bcit-ci/CodeIgniter/zip/3.0.5>`_
-- `CodeIgniter v3.0.4 <https://codeload.github.com/bcit-ci/CodeIgniter/zip/3.0.4>`_
-- `CodeIgniter v3.0.3 <https://codeload.github.com/bcit-ci/CodeIgniter/zip/3.0.3>`_
-- `CodeIgniter v3.0.2 <https://codeload.github.com/bcit-ci/CodeIgniter/zip/3.0.2>`_
-- `CodeIgniter v3.0.1 <https://codeload.github.com/bcit-ci/CodeIgniter/zip/3.0.1>`_
-- `CodeIgniter v3.0.0 <https://codeload.github.com/bcit-ci/CodeIgniter/zip/3.0.0>`_
-- `CodeIgniter v2.2.6 <https://codeload.github.com/bcit-ci/CodeIgniter/zip/2.2.6>`_
-- `CodeIgniter v2.2.5 <https://codeload.github.com/bcit-ci/CodeIgniter/zip/2.2.5>`_
-- `CodeIgniter v2.2.4 <https://codeload.github.com/bcit-ci/CodeIgniter/zip/2.2.4>`_
-- `CodeIgniter v2.2.3 <https://codeload.github.com/bcit-ci/CodeIgniter/zip/2.2.3>`_
-- `CodeIgniter v2.2.2 <https://codeload.github.com/bcit-ci/CodeIgniter/zip/2.2.2>`_
-- `CodeIgniter v2.2.1 <https://codeload.github.com/bcit-ci/CodeIgniter/zip/2.2.1>`_
-- `CodeIgniter v2.2.0 <https://codeload.github.com/bcit-ci/CodeIgniter/zip/2.2.0>`_
-- `CodeIgniter v2.1.4 <https://codeload.github.com/bcit-ci/CodeIgniter/zip/2.1.4>`_
-- `CodeIgniter v2.1.3 <https://codeload.github.com/bcit-ci/CodeIgniter/zip/2.1.3>`_
-- `CodeIgniter v2.1.2 <https://codeload.github.com/bcit-ci/CodeIgniter/zip/2.1.2>`_
-- `CodeIgniter v2.1.1 <https://codeload.github.com/bcit-ci/CodeIgniter/zip/2.1.1>`_
-- `CodeIgniter v2.1.0 <https://codeload.github.com/bcit-ci/CodeIgniter/zip/v2.1.0>`_
-
-******
-GitHub
-******
-
-`Git <http://git-scm.com/about>`_ is a distributed version control system.
-
-Public Git access is available at `GitHub <https://github.com/bcit-ci/CodeIgniter>`_.
-Please note that while every effort is made to keep this code base
-functional, we cannot guarantee the functionality of code taken from
-the develop branch.
-
-Beginning with version 2.0.3, stable versions are also available via `GitHub Releases <https://github.com/bcit-ci/CodeIgniter/releases>`_.
diff --git a/user_guide_src/source/installation/index.rst b/user_guide_src/source/installation/index.rst
deleted file mode 100644
index fbf6ecee1..000000000
--- a/user_guide_src/source/installation/index.rst
+++ /dev/null
@@ -1,57 +0,0 @@
-#########################
-Installation Instructions
-#########################
-
-CodeIgniter is installed in four steps:
-
-#. Unzip the package.
-#. Upload the CodeIgniter folders and files to your server. Normally the
- *index.php* file will be at your root.
-#. Open the *application/config/config.php* file with a text editor and
- set your base URL. If you intend to use encryption or sessions, set
- your encryption key.
-#. If you intend to use a database, open the
- *application/config/database.php* file with a text editor and set your
- database settings.
-
-If you wish to increase security by hiding the location of your
-CodeIgniter files you can rename the system and application folders to
-something more private. If you do rename them, you must open your main
-*index.php* file and set the ``$system_path`` and ``$application_folder``
-variables at the top of the file with the new name you've chosen.
-
-For the best security, both the system and any application folders
-should be placed above web root so that they are not directly accessible
-via a browser. By default, *.htaccess* files are included in each folder
-to help prevent direct access, but it is best to remove them from public
-access entirely in case the web server configuration changes or doesn't
-abide by the *.htaccess*.
-
-If you would like to keep your views public it is also possible to move
-the views folder out of your application folder.
-
-After moving them, open your main index.php file and set the
-``$system_path``, ``$application_folder`` and ``$view_folder`` variables,
-preferably with a full path, e.g. '*/www/MyUser/system*'.
-
-One additional measure to take in production environments is to disable
-PHP error reporting and any other development-only functionality. In
-CodeIgniter, this can be done by setting the ``ENVIRONMENT`` constant, which
-is more fully described on the :doc:`security
-page <../general/security>`.
-
-That's it!
-
-If you're new to CodeIgniter, please read the :doc:`Getting
-Started <../overview/getting_started>` section of the User Guide
-to begin learning how to build dynamic PHP applications. Enjoy!
-
-.. toctree::
- :hidden:
- :titlesonly:
-
- downloads
- self
- upgrading
- troubleshooting
-
diff --git a/user_guide_src/source/installation/troubleshooting.rst b/user_guide_src/source/installation/troubleshooting.rst
deleted file mode 100644
index cca290763..000000000
--- a/user_guide_src/source/installation/troubleshooting.rst
+++ /dev/null
@@ -1,18 +0,0 @@
-###############
-Troubleshooting
-###############
-
-If you find that no matter what you put in your URL only your default
-page is loading, it might be that your server does not support the
-REQUEST_URI variable needed to serve search-engine friendly URLs. As a
-first step, open your *application/config/config.php* file and look for
-the URI Protocol information. It will recommend that you try a couple
-alternate settings. If it still doesn't work after you've tried this
-you'll need to force CodeIgniter to add a question mark to your URLs. To
-do this open your *application/config/config.php* file and change this::
-
- $config['index_page'] = "index.php";
-
-To this::
-
- $config['index_page'] = "index.php?";
diff --git a/user_guide_src/source/installation/upgrade_120.rst b/user_guide_src/source/installation/upgrade_120.rst
deleted file mode 100644
index 76c510d66..000000000
--- a/user_guide_src/source/installation/upgrade_120.rst
+++ /dev/null
@@ -1,20 +0,0 @@
-####################################
-Upgrading From Beta 1.0 to Final 1.2
-####################################
-
-To upgrade to Version 1.2 please replace the following directories with
-the new versions:
-
-.. note:: If you have any custom developed files in these folders please
- make copies of them first.
-
-- drivers
-- helpers
-- init
-- language
-- libraries
-- plugins
-- scaffolding
-
-Please also replace your local copy of the user guide with the new
-version.
diff --git a/user_guide_src/source/installation/upgrade_130.rst b/user_guide_src/source/installation/upgrade_130.rst
deleted file mode 100644
index 6d6d4b9ac..000000000
--- a/user_guide_src/source/installation/upgrade_130.rst
+++ /dev/null
@@ -1,125 +0,0 @@
-#########################
-Upgrading from 1.2 to 1.3
-#########################
-
-.. note:: The instructions on this page assume you are running version
- 1.2. If you have not upgraded to that version please do so first.
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace the following directories in your "system" folder with the new
-versions:
-
-.. note:: If you have any custom developed files in these folders please
- make copies of them first.
-
-- application/**models**/ (new for 1.3)
-- codeigniter (new for 1.3)
-- drivers
-- helpers
-- init
-- language
-- libraries
-- plugins
-- scaffolding
-
-Step 2: Update your error files
-===============================
-
-Version 1.3 contains two new error templates located in
-application/errors, and for naming consistency the other error templates
-have been renamed.
-
-If you **have not** customized any of the error templates simply replace
-this folder:
-
-- application/errors/
-
-If you **have** customized your error templates, rename them as follows:
-
-- 404.php = error_404.php
-- error.php = error_general.php
-- error_db.php (new)
-- error_php.php (new)
-
-Step 3: Update your index.php file
-==================================
-
-Please open your main index.php file (located at your root). At the very
-bottom of the file, change this::
-
- require_once BASEPATH.'libraries/Front_controller'.EXT;
-
-To this::
-
- require_once BASEPATH.'codeigniter/CodeIgniter'.EXT;
-
-Step 4: Update your config.php file
-===================================
-
-Open your application/config/config.php file and add these new items::
-
-
- /*
- |------------------------------------------------
- | URL suffix
- |------------------------------------------------
- |
- | This option allows you to add a suffix to all URLs.
- | For example, if a URL is this:
- |
- | example.com/index.php/products/view/shoes
- |
- | You can optionally add a suffix, like ".html",
- | making the page appear to be of a certain type:
- |
- | example.com/index.php/products/view/shoes.html
- |
- */
- $config['url_suffix'] = "";
-
-
- /*
- |------------------------------------------------
- | Enable Query Strings
- |------------------------------------------------
- |
- | By default CodeIgniter uses search-engine and
- | human-friendly segment based URLs:
- |
- | example.com/who/what/where/
- |
- | You can optionally enable standard query string
- | based URLs:
- |
- | example.com?who=me&what=something&where=here
- |
- | Options are: TRUE or FALSE (boolean)
- |
- | The two other items let you set the query string "words"
- | that will invoke your controllers and functions:
- | example.com/index.php?c=controller&m=function
- |
- */
- $config['enable_query_strings'] = FALSE;
- $config['controller_trigger'] = 'c';
- $config['function_trigger'] = 'm';
-
-Step 5: Update your database.php file
-=====================================
-
-Open your application/config/database.php file and add these new items::
-
-
- $db['default']['dbprefix'] = "";
- $db['default']['active_r'] = TRUE;
-
-Step 6: Update your user guide
-==============================
-
-Please also replace your local copy of the user guide with the new
-version.
diff --git a/user_guide_src/source/installation/upgrade_131.rst b/user_guide_src/source/installation/upgrade_131.rst
deleted file mode 100644
index 8927c1b12..000000000
--- a/user_guide_src/source/installation/upgrade_131.rst
+++ /dev/null
@@ -1,30 +0,0 @@
-###########################
-Upgrading from 1.3 to 1.3.1
-###########################
-
-.. note:: The instructions on this page assume you are running version
- 1.3. If you have not upgraded to that version please do so first.
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace the following directories in your "system" folder with the new
-versions:
-
-.. note:: If you have any custom developed files in these folders please
- make copies of them first.
-
-- drivers
-- init/init_unit_test.php (new for 1.3.1)
-- language/
-- libraries
-- scaffolding
-
-Step 2: Update your user guide
-==============================
-
-Please also replace your local copy of the user guide with the new
-version.
diff --git a/user_guide_src/source/installation/upgrade_132.rst b/user_guide_src/source/installation/upgrade_132.rst
deleted file mode 100644
index 84b7cb4f7..000000000
--- a/user_guide_src/source/installation/upgrade_132.rst
+++ /dev/null
@@ -1,28 +0,0 @@
-#############################
-Upgrading from 1.3.1 to 1.3.2
-#############################
-
-.. note:: The instructions on this page assume you are running version
- 1.3.1. If you have not upgraded to that version please do so first.
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace the following directories in your "system" folder with the new
-versions:
-
-.. note:: If you have any custom developed files in these folders please
- make copies of them first.
-
-- drivers
-- init
-- libraries
-
-Step 2: Update your user guide
-==============================
-
-Please also replace your local copy of the user guide with the new
-version.
diff --git a/user_guide_src/source/installation/upgrade_133.rst b/user_guide_src/source/installation/upgrade_133.rst
deleted file mode 100644
index 4212e4588..000000000
--- a/user_guide_src/source/installation/upgrade_133.rst
+++ /dev/null
@@ -1,44 +0,0 @@
-#############################
-Upgrading from 1.3.2 to 1.3.3
-#############################
-
-.. note:: The instructions on this page assume you are running version
- 1.3.2. If you have not upgraded to that version please do so first.
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace the following directories in your "system" folder with the new
-versions:
-
-.. note:: If you have any custom developed files in these folders please
- make copies of them first.
-
-- codeigniter
-- drivers
-- helpers
-- init
-- libraries
-
-Step 2: Update your Models
-==========================
-
-If you are **NOT** using CodeIgniter's
-:doc:`Models <../general/models>` feature disregard this step.
-
-As of version 1.3.3, CodeIgniter does **not** connect automatically to
-your database when a model is loaded. This allows you greater
-flexibility in determining which databases you would like used with your
-models. If your application is not connecting to your database prior to
-a model being loaded you will have to update your code. There are
-several options for connecting, :doc:`as described
-here <../general/models>`.
-
-Step 3: Update your user guide
-==============================
-
-Please also replace your local copy of the user guide with the new
-version.
diff --git a/user_guide_src/source/installation/upgrade_140.rst b/user_guide_src/source/installation/upgrade_140.rst
deleted file mode 100644
index 987281fe1..000000000
--- a/user_guide_src/source/installation/upgrade_140.rst
+++ /dev/null
@@ -1,72 +0,0 @@
-#############################
-Upgrading from 1.3.3 to 1.4.0
-#############################
-
-.. note:: The instructions on this page assume you are running version
- 1.3.3. If you have not upgraded to that version please do so first.
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace the following directories in your "system" folder with the new
-versions:
-
-.. note:: If you have any custom developed files in these folders please
- make copies of them first.
-
-- application/config/**hooks.php**
-- application/config/**mimes.php**
-- codeigniter
-- drivers
-- helpers
-- init
-- language
-- libraries
-- scaffolding
-
-Step 2: Update your config.php file
-===================================
-
-Open your application/config/config.php file and add these new items::
-
-
-
- /*
- |--------------------------------------------------------------------------
- | Enable/Disable System Hooks
- |--------------------------------------------------------------------------
- |
- | If you would like to use the "hooks" feature you must enable it by
- | setting this variable to TRUE (boolean). See the user guide for details.
- |
- */
- $config['enable_hooks'] = FALSE;
-
-
- /*
- |--------------------------------------------------------------------------
- | Allowed URL Characters
- |--------------------------------------------------------------------------
- |
- | This lets you specify which characters are permitted within your URLs.
- | When someone tries to submit a URL with disallowed characters they will
- | get a warning message.
- |
- | As a security measure you are STRONGLY encouraged to restrict URLs to
- | as few characters as possible. By default only these are allowed: a-z 0-9~%.:_-
- |
- | Leave blank to allow all characters -- but only if you are insane.
- |
- | DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!!
- |
- */
- $config['permitted_uri_chars'] = 'a-z 0-9~%.:_-';
-
-Step 3: Update your user guide
-==============================
-
-Please also replace your local copy of the user guide with the new
-version.
diff --git a/user_guide_src/source/installation/upgrade_141.rst b/user_guide_src/source/installation/upgrade_141.rst
deleted file mode 100644
index c9c2ca461..000000000
--- a/user_guide_src/source/installation/upgrade_141.rst
+++ /dev/null
@@ -1,71 +0,0 @@
-#############################
-Upgrading from 1.4.0 to 1.4.1
-#############################
-
-.. note:: The instructions on this page assume you are running version
- 1.4.0. If you have not upgraded to that version please do so first.
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace the following directories in your "system" folder with the new
-versions:
-
-.. note:: If you have any custom developed files in these folders please
- make copies of them first.
-
-- codeigniter
-- drivers
-- helpers
-- libraries
-
-Step 2: Update your config.php file
-===================================
-
-Open your application/config/config.php file and add this new item::
-
-
-
- /*
- |--------------------------------------------------------------------------
- | Output Compression
- |--------------------------------------------------------------------------
- |
- | Enables Gzip output compression for faster page loads. When enabled,
- | the output class will test whether your server supports Gzip.
- | Even if it does, however, not all browsers support compression
- | so enable only if you are reasonably sure your visitors can handle it.
- |
- | VERY IMPORTANT: If you are getting a blank page when compression is enabled it
- | means you are prematurely outputting something to your browser. It could
- | even be a line of whitespace at the end of one of your scripts. For
- | compression to work, nothing can be sent before the output buffer is called
- | by the output class. Do not "echo" any values with compression enabled.
- |
- */
- $config['compress_output'] = FALSE;
-
-Step 3: Rename an Autoload Item
-===============================
-
-Open the following file: application/config/autoload.php
-
-Find this array item::
-
- $autoload['core'] = array();
-
-And rename it to this::
-
- $autoload['libraries'] = array();
-
-This change was made to improve clarity since some users were not sure
-that their own libraries could be auto-loaded.
-
-Step 4: Update your user guide
-==============================
-
-Please also replace your local copy of the user guide with the new
-version.
diff --git a/user_guide_src/source/installation/upgrade_150.rst b/user_guide_src/source/installation/upgrade_150.rst
deleted file mode 100644
index 527e4548d..000000000
--- a/user_guide_src/source/installation/upgrade_150.rst
+++ /dev/null
@@ -1,100 +0,0 @@
-#############################
-Upgrading from 1.4.1 to 1.5.0
-#############################
-
-.. note:: The instructions on this page assume you are running version
- 1.4.1. If you have not upgraded to that version please do so first.
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace these files and directories in your "system" folder with the new
-versions:
-
-- application/config/user_agents.php (new file for 1.5)
-- application/config/smileys.php (new file for 1.5)
-- codeigniter/
-- database/ (new folder for 1.5. Replaces the "drivers" folder)
-- helpers/
-- language/
-- libraries/
-- scaffolding/
-
-.. note:: If you have any custom developed files in these folders please
- make copies of them first.
-
-Step 2: Update your database.php file
-=====================================
-
-Open your application/config/database.php file and add these new items::
-
-
- $db['default']['cache_on'] = FALSE;
- $db['default']['cachedir'] = '';
-
-Step 3: Update your config.php file
-===================================
-
-Open your application/config/config.php file and ADD these new items::
-
-
- /*
- |--------------------------------------------------------------------------
- | Class Extension Prefix
- |--------------------------------------------------------------------------
- |
- | This item allows you to set the filename/classname prefix when extending
- | native libraries. For more information please see the user guide:
- |
- | https://codeigniter.com/userguide3/general/core_classes.html
- | https://codeigniter.com/userguide3/general/creating_libraries.html
- |
- */
- $config['subclass_prefix'] = 'MY_';
-
- /*
- |--------------------------------------------------------------------------
- | Rewrite PHP Short Tags
- |--------------------------------------------------------------------------
- |
- | If your PHP installation does not have short tag support enabled CI
- | can rewrite the tags on-the-fly, enabling you to utilize that syntax
- | in your view files. Options are TRUE or FALSE (boolean)
- |
- */
- $config['rewrite_short_tags'] = FALSE;
-
-In that same file REMOVE this item::
-
-
- /*
- |--------------------------------------------------------------------------
- | Enable/Disable Error Logging
- |--------------------------------------------------------------------------
- |
- | If you would like errors or debug messages logged set this variable to
- | TRUE (boolean). Note: You must set the file permissions on the "logs" folder
- | such that it is writable.
- |
- */
- $config['log_errors'] = FALSE;
-
-Error logging is now disabled simply by setting the threshold to zero.
-
-Step 4: Update your main index.php file
-=======================================
-
-If you are running a stock index.php file simply replace your version
-with the new one.
-
-If your index.php file has internal modifications, please add your
-modifications to the new file and use it.
-
-Step 5: Update your user guide
-==============================
-
-Please also replace your local copy of the user guide with the new
-version.
diff --git a/user_guide_src/source/installation/upgrade_152.rst b/user_guide_src/source/installation/upgrade_152.rst
deleted file mode 100644
index 781c907e1..000000000
--- a/user_guide_src/source/installation/upgrade_152.rst
+++ /dev/null
@@ -1,39 +0,0 @@
-#############################
-Upgrading from 1.5.0 to 1.5.2
-#############################
-
-.. note:: The instructions on this page assume you are running version
- 1.5.0 or 1.5.1. If you have not upgraded to that version please do so
- first.
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace these files and directories in your "system" folder with the new
-versions:
-
-- system/helpers/download_helper.php
-- system/helpers/form_helper.php
-- system/libraries/Table.php
-- system/libraries/User_agent.php
-- system/libraries/Exceptions.php
-- system/libraries/Input.php
-- system/libraries/Router.php
-- system/libraries/Loader.php
-- system/libraries/Image_lib.php
-- system/language/english/unit_test_lang.php
-- system/database/DB_active_rec.php
-- system/database/drivers/mysqli/mysqli_driver.php
-- codeigniter/
-
-.. note:: If you have any custom developed files in these folders please
- make copies of them first.
-
-Step 2: Update your user guide
-==============================
-
-Please also replace your local copy of the user guide with the new
-version.
diff --git a/user_guide_src/source/installation/upgrade_153.rst b/user_guide_src/source/installation/upgrade_153.rst
deleted file mode 100644
index e3d487be1..000000000
--- a/user_guide_src/source/installation/upgrade_153.rst
+++ /dev/null
@@ -1,28 +0,0 @@
-#############################
-Upgrading from 1.5.2 to 1.5.3
-#############################
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace these files and directories in your "system" folder with the new
-versions:
-
-- system/database/drivers
-- system/helpers
-- system/libraries/Input.php
-- system/libraries/Loader.php
-- system/libraries/Profiler.php
-- system/libraries/Table.php
-
-.. note:: If you have any custom developed files in these folders please
- make copies of them first.
-
-Step 2: Update your user guide
-==============================
-
-Please also replace your local copy of the user guide with the new
-version.
diff --git a/user_guide_src/source/installation/upgrade_154.rst b/user_guide_src/source/installation/upgrade_154.rst
deleted file mode 100644
index 1d2c51d4a..000000000
--- a/user_guide_src/source/installation/upgrade_154.rst
+++ /dev/null
@@ -1,56 +0,0 @@
-#############################
-Upgrading from 1.5.3 to 1.5.4
-#############################
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace these files and directories in your "system" folder with the new
-versions:
-
-- application/config/mimes.php
-- system/codeigniter
-- system/database
-- system/helpers
-- system/libraries
-- system/plugins
-
-.. note:: If you have any custom developed files in these folders please
- make copies of them first.
-
-Step 2: Add charset to your config.php
-======================================
-
-Add the following to application/config/config.php
-
-::
-
- /*
- |--------------------------------------------------------------------------
- | Default Character Set
- |--------------------------------------------------------------------------
- |
- | This determines which character set is used by default in various methods
- | that require a character set to be provided.
- |
- */
- $config['charset'] = "UTF-8";
-
-Step 3: Autoloading language files
-==================================
-
-If you want to autoload any language files, add this line to
-application/config/autoload.php
-
-::
-
- $autoload['language'] = array();
-
-Step 4: Update your user guide
-==============================
-
-Please also replace your local copy of the user guide with the new
-version.
diff --git a/user_guide_src/source/installation/upgrade_160.rst b/user_guide_src/source/installation/upgrade_160.rst
deleted file mode 100644
index e5d26611b..000000000
--- a/user_guide_src/source/installation/upgrade_160.rst
+++ /dev/null
@@ -1,87 +0,0 @@
-#############################
-Upgrading from 1.5.4 to 1.6.0
-#############################
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace these files and directories in your "system" folder with the new
-versions:
-
-- system/codeigniter
-- system/database
-- system/helpers
-- system/libraries
-- system/plugins
-- system/language
-
-.. note:: If you have any custom developed files in these folders please
- make copies of them first.
-
-Step 2: Add time_to_update to your config.php
-===============================================
-
-Add the following to application/config/config.php with the other
-session configuration options
-
-::
-
- $config['sess_time_to_update'] = 300;
-
-
-Step 3: Add $autoload['model']
-==============================
-
-Add the following to application/config/autoload.php
-
-::
-
- /*
- | -------------------------------------------------------------------
- | Auto-load Model files
- | -------------------------------------------------------------------
- | Prototype:
- |
- | $autoload['model'] = array('my_model');
- |
- */
-
- $autoload['model'] = array();
-
-
-Step 4: Add to your database.php
-================================
-
-Make the following changes to your application/config/database.php file:
-
-Add the following variable above the database configuration options,
-with $active_group
-
-::
-
- $active_record = TRUE;
-
-
-Remove the following from your database configuration options
-
-::
-
- $db['default']['active_r'] = TRUE;
-
-
-Add the following to your database configuration options
-
-::
-
- $db['default']['char_set'] = "utf8";
- $db['default']['dbcollat'] = "utf8_general_ci";
-
-
-Step 5: Update your user guide
-==============================
-
-Please also replace your local copy of the user guide with the new
-version.
diff --git a/user_guide_src/source/installation/upgrade_161.rst b/user_guide_src/source/installation/upgrade_161.rst
deleted file mode 100644
index 43869223f..000000000
--- a/user_guide_src/source/installation/upgrade_161.rst
+++ /dev/null
@@ -1,27 +0,0 @@
-#############################
-Upgrading from 1.6.0 to 1.6.1
-#############################
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace these files and directories in your "system" folder with the new
-versions:
-
-- system/codeigniter
-- system/database
-- system/helpers
-- system/language
-- system/libraries
-
-.. note:: If you have any custom developed files in these folders please
- make copies of them first.
-
-Step 2: Update your user guide
-==============================
-
-Please also replace your local copy of the user guide with the new
-version.
diff --git a/user_guide_src/source/installation/upgrade_162.rst b/user_guide_src/source/installation/upgrade_162.rst
deleted file mode 100644
index 6a618e4ad..000000000
--- a/user_guide_src/source/installation/upgrade_162.rst
+++ /dev/null
@@ -1,45 +0,0 @@
-#############################
-Upgrading from 1.6.1 to 1.6.2
-#############################
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace these files and directories in your "system" folder with the new
-versions:
-
-- system/codeigniter
-- system/database
-- system/helpers
-- system/language
-- system/libraries
-
-.. note:: If you have any custom developed files in these folders please
- make copies of them first.
-
-Step 2: Encryption Key
-======================
-
-If you are using sessions, open up application/config/config.php and
-verify you've set an encryption key.
-
-Step 3: Constants File
-======================
-
-Copy /application/config/constants.php to your installation, and modify
-if necessary.
-
-Step 4: Mimes File
-==================
-
-Replace /application/config/mimes.php with the dowloaded version. If
-you've added custom mime types, you'll need to re-add them.
-
-Step 5: Update your user guide
-==============================
-
-Please also replace your local copy of the user guide with the new
-version.
diff --git a/user_guide_src/source/installation/upgrade_163.rst b/user_guide_src/source/installation/upgrade_163.rst
deleted file mode 100644
index e24e20357..000000000
--- a/user_guide_src/source/installation/upgrade_163.rst
+++ /dev/null
@@ -1,27 +0,0 @@
-#############################
-Upgrading from 1.6.2 to 1.6.3
-#############################
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace these files and directories in your "system" folder with the new
-versions:
-
-- system/codeigniter
-- system/database
-- system/helpers
-- system/language
-- system/libraries
-
-.. note:: If you have any custom developed files in these folders please
- make copies of them first.
-
-Step 2: Update your user guide
-==============================
-
-Please also replace your local copy of the user guide with the new
-version.
diff --git a/user_guide_src/source/installation/upgrade_170.rst b/user_guide_src/source/installation/upgrade_170.rst
deleted file mode 100644
index fefb2ea51..000000000
--- a/user_guide_src/source/installation/upgrade_170.rst
+++ /dev/null
@@ -1,56 +0,0 @@
-#############################
-Upgrading from 1.6.3 to 1.7.0
-#############################
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace these files and directories in your "system" folder with the new
-versions:
-
-- system/codeigniter
-- system/database
-- system/helpers
-- system/language
-- system/libraries
-
-.. note:: If you have any custom developed files in these folders please
- make copies of them first.
-
-Step 2: Update your Session Table
-=================================
-
-If you are using the Session class in your application, AND if you are
-storing session data to a database, you must add a new column named
-user_data to your session table. Here is an example of what this column
-might look like for MySQL::
-
- user_data text NOT NULL
-
-To add this column you will run a query similar to this::
-
- ALTER TABLE `ci_sessions` ADD `user_data` text NOT NULL
-
-You'll find more information regarding the new Session functionality in
-the :doc:`Session class <../libraries/sessions>` page.
-
-Step 3: Update your Validation Syntax
-=====================================
-
-This is an **optional**, but recommended step, for people currently
-using the Validation class. CI 1.7 introduces a new :doc:`Form Validation
-class <../libraries/form_validation>`, which deprecates the old
-Validation library. We have left the old one in place so that existing
-applications that use it will not break, but you are encouraged to
-migrate to the new version as soon as possible. Please read the user
-guide carefully as the new library works a little differently, and has
-several new features.
-
-Step 4: Update your user guide
-==============================
-
-Please replace your local copy of the user guide with the new version,
-including the image files.
diff --git a/user_guide_src/source/installation/upgrade_171.rst b/user_guide_src/source/installation/upgrade_171.rst
deleted file mode 100644
index e791b4eba..000000000
--- a/user_guide_src/source/installation/upgrade_171.rst
+++ /dev/null
@@ -1,27 +0,0 @@
-#############################
-Upgrading from 1.7.0 to 1.7.1
-#############################
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace these files and directories in your "system" folder with the new
-versions:
-
-- system/codeigniter
-- system/database
-- system/helpers
-- system/language
-- system/libraries
-
-.. note:: If you have any custom developed files in these folders please
- make copies of them first.
-
-Step 2: Update your user guide
-==============================
-
-Please replace your local copy of the user guide with the new version,
-including the image files.
diff --git a/user_guide_src/source/installation/upgrade_172.rst b/user_guide_src/source/installation/upgrade_172.rst
deleted file mode 100644
index 16f6dec1f..000000000
--- a/user_guide_src/source/installation/upgrade_172.rst
+++ /dev/null
@@ -1,48 +0,0 @@
-#############################
-Upgrading from 1.7.1 to 1.7.2
-#############################
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace these files and directories in your "system" folder with the new
-versions:
-
-- system/codeigniter
-- system/database
-- system/helpers
-- system/language
-- system/libraries
-- index.php
-
-.. note:: If you have any custom developed files in these folders please
- make copies of them first.
-
-Step 2: Remove header() from 404 error template
-===============================================
-
-If you are using header() in your 404 error template, such as the case
-with the default error_404.php template shown below, remove that line
-of code.
-
-::
-
- <?php header("HTTP/1.1 404 Not Found"); ?>
-
-404 status headers are now properly handled in the show_404() method
-itself.
-
-Step 3: Confirm your system_path
-=================================
-
-In your updated index.php file, confirm that the $system_path variable
-is set to your application's system folder.
-
-Step 4: Update your user guide
-==============================
-
-Please replace your local copy of the user guide with the new version,
-including the image files.
diff --git a/user_guide_src/source/installation/upgrade_200.rst b/user_guide_src/source/installation/upgrade_200.rst
deleted file mode 100644
index 03b8ff4ac..000000000
--- a/user_guide_src/source/installation/upgrade_200.rst
+++ /dev/null
@@ -1,148 +0,0 @@
-#############################
-Upgrading from 1.7.2 to 2.0.0
-#############################
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-*******************
-Update Instructions
-*******************
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace all files and directories in your "system" folder **except**
-your application folder.
-
-.. note:: If you have any custom developed files in these folders please
- make copies of them first.
-
-Step 2: Adjust get_dir_file_info() where necessary
-=====================================================
-
-Version 2.0.0 brings a non-backwards compatible change to
-get_dir_file_info() in the :doc:`File
-Helper <../helpers/file_helper>`. Non-backwards compatible changes
-are extremely rare in CodeIgniter, but this one we feel was warranted
-due to how easy it was to create serious server performance issues. If
-you *need* recursiveness where you are using this helper function,
-change such instances, setting the second parameter, $top_level_only
-to FALSE::
-
- get_dir_file_info('/path/to/directory', FALSE);
-
-Step 3: Convert your Plugins to Helpers
-=======================================
-
-2.0.0 gets rid of the "Plugin" system as their functionality was
-identical to Helpers, but non-extensible. You will need to rename your
-plugin files from filename_pi.php to filename_helper.php, move them to
-your helpers folder, and change all instances of::
-
- $this->load->plugin('foo');
-
-to ::
-
- $this->load->helper('foo');
-
-
-Step 4: Update stored encrypted data
-====================================
-
-.. note:: If your application does not use the Encrypt library, does
- not store Encrypted data permanently, or is on an environment that does
- not support Mcrypt, you may skip this step.
-
-The Encrypt library has had a number of improvements, some for
-encryption strength and some for performance, that has an unavoidable
-consequence of making it no longer possible to decode encrypted data
-produced by the original version of this library. To help with the
-transition, a new method has been added, encode_from_legacy() that
-will decode the data with the original algorithm and return a re-encoded
-string using the improved methods. This will enable you to easily
-replace stale encrypted data with fresh in your applications, either on
-the fly or en masse.
-
-Please read :doc:`how to use this
-method <../libraries/encrypt>` in the Encrypt library
-documentation.
-
-Step 5: Remove loading calls for the compatibility helper.
-==========================================================
-
-The compatibility helper has been removed from the CodeIgniter core. All
-methods in it should be natively available in supported PHP versions.
-
-Step 6: Update Class extension
-==============================
-
-All core classes are now prefixed with CI\_. Update Models and
-Controllers to extend CI_Model and CI_Controller, respectively.
-
-Step 7: Update Parent Constructor calls
-=======================================
-
-All native CodeIgniter classes now use the PHP 5 \__construct()
-convention. Please update extended libraries to call
-parent::\__construct().
-
-Step 8: Move any core extensions to application/core
-====================================================
-
-Any extensions to core classes (e.g. MY_Controller.php) in your
-application/libraries folder must be moved to the new
-application/core folder.
-
-Step 9: Update your user guide
-==============================
-
-Please replace your local copy of the user guide with the new version,
-including the image files.
-
-
-************
-Update Notes
-************
-
-Please refer to the :ref:`2.0.0 Change Log <2.0.0-changelog>` for full
-details, but here are some of the larger changes that are more likely to
-impact your code:
-
-- Scaffolding has been removed.
-- The CAPTCHA plugin in now a :doc:`helper </helpers/captcha_helper>`.
-- The JavaScript calendar plugin was removed.
-- The *system/cache* and *system/logs* directories are now in the application
- directory.
-- The Validation class has been removed. Please see the
- :doc:`Form Validation library </libraries/form_validation>`
-- "default" is now a reserved name.
-- The xss_clean() function has moved to the :doc:`Security Class
- </libraries/security>`.
-- do_xss_clean() now returns FALSE if the uploaded file fails XSS checks.
-- The :doc:`Session Class </libraries/sessions>` requires now the use of an
- encryption key set in the config file.
-- The following deprecated Active Record functions have been removed:
- ``orwhere``, ``orlike``, ``groupby``, ``orhaving``, ``orderby``,
- ``getwhere``.
-- ``_drop_database()`` and ``_create_database()`` functions have been removed
- from the db utility drivers.
-- The ``dohash()`` function of the :doc:`Security helper
- </helpers/security_helper>`
- has been renamed to ``do_hash()`` for naming consistency.
-
-The config folder
-=================
-
-The following files have been changed:
-
-- config.php
-- database.php
-- mimes.php
-- routes.php
-- user_agents.php
-
-The following files have been added:
-
-- foreign_chars.php
-- profiler.php \ No newline at end of file
diff --git a/user_guide_src/source/installation/upgrade_201.rst b/user_guide_src/source/installation/upgrade_201.rst
deleted file mode 100644
index 93e1aa68d..000000000
--- a/user_guide_src/source/installation/upgrade_201.rst
+++ /dev/null
@@ -1,39 +0,0 @@
-#############################
-Upgrading from 2.0.0 to 2.0.1
-#############################
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace all files and directories in your "system" folder and replace
-your index.php file. If any modifications were made to your index.php
-they will need to be made fresh in this new one.
-
-.. note:: If you have any custom developed files in these folders please
- make copies of them first.
-
-Step 2: Replace config/mimes.php
-================================
-
-This config file has been updated to contain more mime types, please
-copy it to application/config/mimes.php.
-
-Step 3: Check for forms posting to default controller
-=====================================================
-
-The default behavior for form_open() when called with no parameters
-used to be to post to the default controller, but it will now just leave
-an empty action="" meaning the form will submit to the current URL. If
-submitting to the default controller was the expected behavior it will
-need to be changed from::
-
- echo form_open(); //<form action="" method="post" accept-charset="utf-8">
-
-to use either a / or base_url()::
-
- echo form_open('/'); //<form action="http://example.com/index.php/" method="post" accept-charset="utf-8">
- echo form_open(base_url()); //<form action="http://example.com/" method="post" accept-charset="utf-8">
-
diff --git a/user_guide_src/source/installation/upgrade_202.rst b/user_guide_src/source/installation/upgrade_202.rst
deleted file mode 100644
index 8dbd38aff..000000000
--- a/user_guide_src/source/installation/upgrade_202.rst
+++ /dev/null
@@ -1,33 +0,0 @@
-#############################
-Upgrading from 2.0.1 to 2.0.2
-#############################
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace all files and directories in your "system" folder and replace
-your index.php file. If any modifications were made to your index.php
-they will need to be made fresh in this new one.
-
-.. note:: If you have any custom developed files in these folders please
- make copies of them first.
-
-Step 2: Remove loading calls for the Security Library
-=====================================================
-
-Security has been moved to the core and is now always loaded
-automatically. Make sure you remove any loading calls as they will
-result in PHP errors.
-
-Step 3: Move MY_Security
-=========================
-
-If you are overriding or extending the Security library, you will need
-to move it to application/core.
-
-csrf_token_name and csrf_hash have changed to protected class
-properties. Please use security->get_csrf_hash() and
-security->get_csrf_token_name() to access those values.
diff --git a/user_guide_src/source/installation/upgrade_203.rst b/user_guide_src/source/installation/upgrade_203.rst
deleted file mode 100644
index 717aa3e50..000000000
--- a/user_guide_src/source/installation/upgrade_203.rst
+++ /dev/null
@@ -1,63 +0,0 @@
-#############################
-Upgrading from 2.0.2 to 2.0.3
-#############################
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace all files and directories in your "system" folder and replace
-your index.php file. If any modifications were made to your index.php
-they will need to be made fresh in this new one.
-
-.. note:: If you have any custom developed files in these folders please
- make copies of them first.
-
-Step 2: Update your main index.php file
-=======================================
-
-If you are running a stock index.php file simply replace your version
-with the new one.
-
-If your index.php file has internal modifications, please add your
-modifications to the new file and use it.
-
-Step 3: Replace config/user_agents.php
-=======================================
-
-This config file has been updated to contain more user agent types,
-please copy it to application/config/user_agents.php.
-
-Step 4: Change references of the EXT constant to ".php"
-=======================================================
-
-.. note:: The EXT Constant has been marked as deprecated, but has not
- been removed from the application. You are encouraged to make the
- changes sooner rather than later.
-
-Step 5: Remove APPPATH.'third_party' from autoload.php
-=======================================================
-
-Open application/config/autoload.php, and look for the following::
-
- $autoload['packages'] = array(APPPATH.'third_party');
-
-If you have not chosen to load any additional packages, that line can be
-changed to::
-
- $autoload['packages'] = array();
-
-Which should provide for nominal performance gains if not autoloading
-packages.
-
-Update Sessions Database Tables
-===============================
-
-If you are using database sessions with the CI Session Library, please
-update your ci_sessions database table as follows::
-
- CREATE INDEX last_activity_idx ON ci_sessions(last_activity);
- ALTER TABLE ci_sessions MODIFY user_agent VARCHAR(120);
-
diff --git a/user_guide_src/source/installation/upgrade_210.rst b/user_guide_src/source/installation/upgrade_210.rst
deleted file mode 100644
index 421435452..000000000
--- a/user_guide_src/source/installation/upgrade_210.rst
+++ /dev/null
@@ -1,26 +0,0 @@
-#############################
-Upgrading from 2.0.3 to 2.1.0
-#############################
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace all files and directories in your "system" folder.
-
-.. note:: If you have any custom developed files in these folders please
- make copies of them first.
-
-Step 2: Replace config/mimes.php
-================================
-
-This config file has been updated to contain more user agent types,
-please copy it to *application/config/mimes.php*.
-
-Step 3: Update your user guide
-==============================
-
-Please also replace your local copy of the user guide with the new
-version.
diff --git a/user_guide_src/source/installation/upgrade_211.rst b/user_guide_src/source/installation/upgrade_211.rst
deleted file mode 100644
index f0e70f6dc..000000000
--- a/user_guide_src/source/installation/upgrade_211.rst
+++ /dev/null
@@ -1,31 +0,0 @@
-#############################
-Upgrading from 2.1.0 to 2.1.1
-#############################
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace all files and directories in your "system" folder.
-
-.. note:: If you have any custom developed files in these folders please
- make copies of them first.
-
-Step 2: Replace config/mimes.php
-================================
-
-This config file has been updated to contain more user mime-types, please copy
-it to _application/config/mimes.php*.
-
-Step 3: Update your IP address tables
-=====================================
-
-This upgrade adds support for IPv6 IP addresses. In order to store them, you need
-to enlarge your ip_address columns to 45 characters. For example, CodeIgniter's
-session table will need to change
-
-::
-
- ALTER TABLE ci_sessions CHANGE ip_address ip_address varchar(45) default '0' NOT NULL \ No newline at end of file
diff --git a/user_guide_src/source/installation/upgrade_212.rst b/user_guide_src/source/installation/upgrade_212.rst
deleted file mode 100644
index 4b76482e3..000000000
--- a/user_guide_src/source/installation/upgrade_212.rst
+++ /dev/null
@@ -1,20 +0,0 @@
-#############################
-Upgrading from 2.1.1 to 2.1.2
-#############################
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace all files and directories in your "system" folder.
-
-.. note:: If you have any custom developed files in these folders please
- make copies of them first.
-
-Step 2: Update your user guide
-==============================
-
-Please also replace your local copy of the user guide with the new
-version. \ No newline at end of file
diff --git a/user_guide_src/source/installation/upgrade_213.rst b/user_guide_src/source/installation/upgrade_213.rst
deleted file mode 100644
index 3a3497ccb..000000000
--- a/user_guide_src/source/installation/upgrade_213.rst
+++ /dev/null
@@ -1,20 +0,0 @@
-#############################
-Upgrading from 2.1.2 to 2.1.3
-#############################
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace all files and directories in your "system" folder.
-
-.. note:: If you have any custom developed files in these folders please
- make copies of them first.
-
-Step 2: Update your user guide
-==============================
-
-Please also replace your local copy of the user guide with the new
-version. \ No newline at end of file
diff --git a/user_guide_src/source/installation/upgrade_214.rst b/user_guide_src/source/installation/upgrade_214.rst
deleted file mode 100644
index ba57e5976..000000000
--- a/user_guide_src/source/installation/upgrade_214.rst
+++ /dev/null
@@ -1,14 +0,0 @@
-#############################
-Upgrading from 2.1.3 to 2.1.4
-#############################
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace all files and directories in your "system" folder.
-
-.. note:: If you have any custom developed files in these folders please
- make copies of them first. \ No newline at end of file
diff --git a/user_guide_src/source/installation/upgrade_220.rst b/user_guide_src/source/installation/upgrade_220.rst
deleted file mode 100644
index 91f9e00cd..000000000
--- a/user_guide_src/source/installation/upgrade_220.rst
+++ /dev/null
@@ -1,21 +0,0 @@
-#############################
-Upgrading from 2.1.4 to 2.2.x
-#############################
-
-.. note:: The :doc:`Encrypt Class </libraries/encrypt>` now requires the
- Mcrypt extension. If you were previously using the Encrypt Class
- without Mcrypt, then this is a breaking change. You must install
- the Mcrypt extension in order to upgrade. For information on
- installing Mcrypt please see the PHP `documentation
- <http://php.net/manual/en/mcrypt.setup.php>`.
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace all files and directories in your "system" folder.
-
-.. note:: If you have any custom developed files in these folders please
- make copies of them first. \ No newline at end of file
diff --git a/user_guide_src/source/installation/upgrade_221.rst b/user_guide_src/source/installation/upgrade_221.rst
deleted file mode 100644
index 4af73867e..000000000
--- a/user_guide_src/source/installation/upgrade_221.rst
+++ /dev/null
@@ -1,14 +0,0 @@
-#############################
-Upgrading from 2.2.0 to 2.2.1
-#############################
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace all files and directories in your "system" folder.
-
-.. note:: If you have any custom developed files in these folders please
- make copies of them first. \ No newline at end of file
diff --git a/user_guide_src/source/installation/upgrade_222.rst b/user_guide_src/source/installation/upgrade_222.rst
deleted file mode 100644
index 9dcc61d0e..000000000
--- a/user_guide_src/source/installation/upgrade_222.rst
+++ /dev/null
@@ -1,14 +0,0 @@
-#############################
-Upgrading from 2.2.1 to 2.2.2
-#############################
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace all files and directories in your "system" folder.
-
-.. note:: If you have any custom developed files in these folders please
- make copies of them first. \ No newline at end of file
diff --git a/user_guide_src/source/installation/upgrade_223.rst b/user_guide_src/source/installation/upgrade_223.rst
deleted file mode 100644
index 252318ae1..000000000
--- a/user_guide_src/source/installation/upgrade_223.rst
+++ /dev/null
@@ -1,14 +0,0 @@
-#############################
-Upgrading from 2.2.2 to 2.2.3
-#############################
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace all files and directories in your "system" folder.
-
-.. note:: If you have any custom developed files in these folders please
- make copies of them first. \ No newline at end of file
diff --git a/user_guide_src/source/installation/upgrade_300.rst b/user_guide_src/source/installation/upgrade_300.rst
deleted file mode 100644
index 5b2d3947d..000000000
--- a/user_guide_src/source/installation/upgrade_300.rst
+++ /dev/null
@@ -1,891 +0,0 @@
-#############################
-Upgrading from 2.2.x to 3.0.x
-#############################
-
-Before performing an update you should take your site offline by replacing the index.php file with a static one.
-
-*************************************
-Step 1: Update your CodeIgniter files
-*************************************
-
-**Replace** all files and directories in your *system/* directory and
-replace your index.php file. If any modifications were made to your
-index.php they will need to be made fresh in this new one.
-
-.. important:: You have to delete the old *system/* directory first and
- then put the new one in its place. A simple copy-paste may cause
- issues.
-
-.. note:: If you have any custom developed files in these folders please
- make copies of them first.
-
-**************************************
-Step 2: Update your classes file names
-**************************************
-
-Starting with CodeIgniter 3.0, all class filenames (libraries, drivers, controllers
-and models) must be named in a Ucfirst-like manner or in other words - they must
-start with a capital letter.
-
-For example, if you have the following library file:
-
- application/libraries/mylibrary.php
-
-... then you'll have to rename it to:
-
- application/libraries/Mylibrary.php
-
-The same goes for driver libraries and extensions and/or overrides of CodeIgniter's
-own libraries and core classes.
-
- application/libraries/MY_email.php
- application/core/MY_log.php
-
-The above files should respectively be renamed to the following:
-
- application/libraries/MY_Email.php
- application/core/MY_Log.php
-
-Controllers:
-
- application/controllers/welcome.php -> application/controllers/Welcome.php
-
-Models:
-
- application/models/misc_model.php -> application/models/Misc_model.php
-
-Please note that this DOES NOT affect directories, configuration files, views,
-helpers, hooks and anything else - it is only applied to classes.
-
-You must now follow just one simple rule - class names in Ucfirst and everything else
-in lowercase.
-
-********************************
-Step 3: Replace config/mimes.php
-********************************
-
-This config file has been updated to contain more user mime-types, please copy
-it to *application/config/mimes.php*.
-
-**************************************************************
-Step 4: Remove $autoload['core'] from your config/autoload.php
-**************************************************************
-
-Use of the ``$autoload['core']`` config array has been deprecated as of CodeIgniter 1.4.1 and is now removed.
-Move any entries that you might have listed there to ``$autoload['libraries']`` instead.
-
-***************************************************
-Step 5: Move your Log class overrides or extensions
-***************************************************
-
-The Log Class is considered as a "core" class and is now located in the
-**system/core/** directory. Therefore, in order for your Log class overrides
-or extensions to work, you need to move them to **application/core/**:
-
- application/libraries/Log.php -> application/core/Log.php
- application/libraries/MY_Log.php -> application/core/MY_Log.php
-
-*****************************************
-Step 6: Update your Session library usage
-*****************************************
-
-The :doc:`Session Library </libraries/sessions>` has been completely
-re-written in CodeIgniter 3 and now comes with a bunch of new features,
-but that also means that there are changes that you should make ...
-
-Most notably, the library now uses separate storage drivers instead of
-always relying on (encrypted) cookies.
-In fact, cookies as storage have now been removed and you must always use
-some kind of server-side storage engine, with the file-system being the
-default option.
-
-The Session Class now utilizes PHP's own mechanisms for building custom
-session handlers, which also means that your session data is now
-accessible via the ``$_SESSION`` superglobal (though, we've kept the
-possibility to use it as "userdata", like you've done until now).
-
-A few configuration options have been removed and a few have been added.
-You should really read the whole :doc:`Session library manual
-</libraries/sessions>` for the details, but here's a short list of changes
-that you should make:
-
- - Set your ``$config['sess_driver']`` value
-
- It will default to 'files', unless you've previously used
- ``$config['sess_use_database']``, in which case it will be set to
- 'database'.
-
- - Set a ``$config['sess_save_path']`` value
-
- For the 'database' driver, a fallback to ``$config['sess_table_name']``
- is in place, but otherwise requires you to read the manual for the
- specific driver of your choice.
-
- - Update your ``ci_sessions`` table ('database' driver only)
-
- The table structure has changed a bit, and more specifically:
-
- - ``session_id`` field is renamed to ``id``
- - ``user_agent`` field is dropped
- - ``user_data`` field is renamed to ``data`` and under MySQL is now of type BLOB
- - ``last_activity`` field is renamed to ``timestamp``
-
- This is accompanied by a slight change in the table indexes too, so
- please read the manual about the `Session Database Driver
- <../libraries/sessions.html#database-driver>`_ for more information.
-
- .. important:: Only MySQL and PostgreSQL are officially supported
- now. Other databases may still work, but due to lack of advisory
- locking features, they are unsafe for concurrent requests and
- you should consider using another driver instead.
-
- - Remove ``$config['sess_match_useragent']``
-
- The user-agent string is input supplied by the user's browser, or in
- other words: client side input. As such, it is an ineffective feature
- and hence why it has been removed.
-
- - Remove ``$config['sess_encrypt_cookie']``
-
- As already noted, the library no longer uses cookies as a storage
- mechanism, which renders this option useless.
-
- - Remove ``$config['sess_expire_on_close']``
-
- This option is still usable, but only for backwards compatibility
- purposes and it should be otherwise removed. The same effect is
- achieved by setting ``$config['sess_expiration']`` to 0.
-
- - Check "flashdata" for collisions with "userdata"
-
- Flashdata is now just regular "userdata", only marked for deletion on
- the next request. In other words: you can't have both "userdata" and
- "flashdata" with the same name, because it's the same thing.
-
- - Check usage of session metadata
-
- Previously, you could access the 'session_id', 'ip_address',
- 'user_agent' and 'last_activity' metadata items as userdata.
- This is no longer possible, and you should read the notes about
- `Session Metadata <../libraries/sessions.html#accessing-session-metadata>`_
- if your application relies on those values.
-
- - Check ``unset_userdata()`` usage
-
- Previously, this method used to accept an associative array of
- ``'key' => 'dummy value'`` pairs for unsetting multiple keys. That
- however makes no sense and you now have to pass *only* the keys, as
- the elements of an array.
-
- ::
-
- // Old
- $this->session->unset_userdata(array('item' => '', 'item2' => ''));
-
- // New
- $this->session->unset_userdata(array('item', 'item2'));
-
-Finally, if you have written a Session extension, you must now move it to
-the *application/libraries/Session/* directory, although chances are that
-it will now also have to be re-factored.
-
-***************************************
-Step 7: Update your config/database.php
-***************************************
-
-Due to 3.0.0's renaming of Active Record to Query Builder, inside your
-**config/database.php**, you will need to rename the ``$active_record``
-variable to ``$query_builder``::
-
- $active_group = 'default';
- // $active_record = TRUE;
- $query_builder = TRUE;
-
-************************************
-Step 8: Replace your error templates
-************************************
-
-In CodeIgniter 3.0, the error templates are now considered as views and have been moved to the
-*application/views/errors* directory.
-
-Furthermore, we've added support for CLI error templates in plain-text format that unlike HTML,
-is suitable for the command line. This of course requires another level of separation.
-
-It is safe to move your old templates from *application/errors* to *application/views/errors/html*,
-but you'll have to copy the new *application/views/errors/cli* directory from the CodeIgniter archive.
-
-******************************************
-Step 9: Update your config/routes.php file
-******************************************
-
-Routes containing :any
-======================
-
-Historically, CodeIgniter has always provided the **:any** wildcard in
-routing, with the intention of providing a way to match any character
-**within** an URI segment.
-
-However, the **:any** wildcard is actually just an alias for a regular
-expression and used to be executed in that manner as **.+**. This is
-considered a bug, as it also matches the / (forward slash) character, which
-is the URI segment delimiter and that was never the intention.
-
-In CodeIgniter 3, the **:any** wildcard will now represent **[^/]+**, so
-that it will not match a forward slash.
-
-There are certainly many developers that have utilized this bug as an actual
-feature. If you're one of them and want to match a forward slash, please use
-the **.+** regular expression::
-
- (.+) // matches ANYTHING
- (:any) // matches any character, except for '/'
-
-Directories and 'default_controller', '404_override'
-====================================================
-
-As you should know, the ``$route['default_controller']`` and
-``$route['404_override']`` settings accept not only a controller name, but
-also *controller/method* pairs. However, a bug in the routing logic has
-made it possible for some users to use that as *directory/controller*
-instead.
-
-As already said, this behavior was incidental and was never intended, nor
-documented. If you've relied on it, your application will break with
-CodeIgniter 3.0.
-
-Another notable change in version 3 is that 'default_controller' and
-'404_override' are now applied *per directory*. To explain what this means,
-let's take the following example::
-
- $route['default_controller'] = 'main';
-
-Now, assuming that your website is located at *example.com*, you already
-know that if a user visits ``http://example.com/``, the above setting will
-cause your 'Main' controller to be loaded.
-
-However, what happens if you have an *application/controllers/admin/*
-directory and the user visits ``http://example.com/admin/``?
-In CodeIgniter 3, the router will look for a 'Main' controller under the
-admin/ directory as well. If not found, a Not Found (404) will be triggered.
-
-The same rule applies to the '404_override' setting.
-
-*************************************************************************
-Step 10: Many functions now return NULL instead of FALSE on missing items
-*************************************************************************
-
-Many methods and functions now return NULL instead of FALSE when the required items don't exist:
-
- - :doc:`Common functions <../general/common_functions>`
-
- - config_item()
-
- - :doc:`Config Class <../libraries/config>`
-
- - config->item()
- - config->slash_item()
-
- - :doc:`Input Class <../libraries/input>`
-
- - input->get()
- - input->post()
- - input->get_post()
- - input->cookie()
- - input->server()
- - input->input_stream()
- - input->get_request_header()
-
- - :doc:`Session Class <../libraries/sessions>`
-
- - session->userdata()
- - session->flashdata()
-
- - :doc:`URI Class <../libraries/uri>`
-
- - uri->segment()
- - uri->rsegment()
-
- - :doc:`Array Helper <../helpers/array_helper>`
-
- - element()
- - elements()
-
-*******************************
-Step 11: Usage of XSS filtering
-*******************************
-
-Many functions in CodeIgniter allow you to use its XSS filtering feature
-on demand by passing a boolean parameter. The default value of that
-parameter used to be boolean FALSE, but it is now changed to NULL and it
-will be dynamically determined by your ``$config['global_xss_filtering']``
-value.
-
-If you used to manually pass a boolean value for the ``$xss_filter``
-parameter or if you've always had ``$config['global_xss_filtering']`` set
-to FALSE, then this change doesn't concern you.
-
-Otherwise however, please review your usage of the following functions:
-
- - :doc:`Input Library <../libraries/input>`
-
- - input->get()
- - input->post()
- - input->get_post()
- - input->cookie()
- - input->server()
- - input->input_stream()
-
- - :doc:`Cookie Helper <../helpers/cookie_helper>` :php:func:`get_cookie()`
-
-.. important:: Another related change is that the ``$_GET``, ``$_POST``,
- ``$_COOKIE`` and ``$_SERVER`` superglobals are no longer
- automatically overwritten when global XSS filtering is turned on.
-
-*************************************************
-Step 12: Check for potential XSS issues with URIs
-*************************************************
-
-The :doc:`URI Library <../libraries/uri>` used to automatically convert
-a certain set of "programmatic characters" to HTML entities when they
-are encountered in a URI segment.
-
-This was aimed at providing some automatic XSS protection, in addition
-to the ``$config['permitted_uri_chars']`` setting, but has proven to be
-problematic and is now removed in CodeIgniter 3.0.
-
-If your application has relied on this feature, you should update it to
-filter URI segments through ``$this->security->xss_clean()`` whenever you
-output them.
-
-****************************************************************
-Step 13: Check for usage of the 'xss_clean' Form validation rule
-****************************************************************
-
-A largely unknown rule about XSS cleaning is that it should *only be
-applied to output*, as opposed to input data.
-
-We've made that mistake ourselves with our automatic and global XSS cleaning
-feature (see previous step about XSS above), so now in an effort to discourage that
-practice, we're also removing 'xss_clean' from the officially supported
-list of :doc:`form validation <../libraries/form_validation>` rules.
-
-Because the :doc:`Form Validation library <../libraries/form_validation>`
-generally validates *input* data, the 'xss_clean' rule simply doesn't
-belong in it.
-
-If you really, really need to apply that rule, you should now also load the
-:doc:`Security Helper <../helpers/security_helper>`, which contains
-``xss_clean()`` as a regular function and therefore can be also used as
-a validation rule.
-
-********************************************************
-Step 14: Update usage of Input Class's get_post() method
-********************************************************
-
-Previously, the :doc:`Input Class <../libraries/input>` method ``get_post()``
-was searching first in POST data, then in GET data. This method has been
-modified so that it searches in GET then in POST, as its name suggests.
-
-A method has been added, ``post_get()``, which searches in POST then in GET, as
-``get_post()`` was doing before.
-
-********************************************************************
-Step 15: Update usage of Directory Helper's directory_map() function
-********************************************************************
-
-In the resulting array, directories now end with a trailing directory
-separator (i.e. a slash, usually).
-
-*************************************************************
-Step 16: Update usage of Database Forge's drop_table() method
-*************************************************************
-
-Up until now, ``drop_table()`` added an IF EXISTS clause by default or it didn't work
-at all with some drivers. In CodeIgniter 3.0, the IF EXISTS condition is no longer added
-by default and has an optional second parameter that allows that instead and is set to
-FALSE by default.
-
-If your application relies on IF EXISTS, you'll have to change its usage.
-
-::
-
- // Now produces just DROP TABLE `table_name`
- $this->dbforge->drop_table('table_name');
-
- // Produces DROP TABLE IF EXISTS `table_name`
- $this->dbforge->drop_table('table_name', TRUE);
-
-.. note:: The given example uses MySQL-specific syntax, but it should work across
- all drivers with the exception of ODBC.
-
-***********************************************************
-Step 17: Change usage of Email library with multiple emails
-***********************************************************
-
-The :doc:`Email Library <../libraries/email>` will automatically clear the
-set parameters after successfully sending emails. To override this behaviour,
-pass FALSE as the first parameter in the ``send()`` method:
-
-::
-
- if ($this->email->send(FALSE))
- {
- // Parameters won't be cleared
- }
-
-***************************************************
-Step 18: Update your Form_validation language lines
-***************************************************
-
-Two improvements have been made to the :doc:`Form Validation Library
-<../libraries/form_validation>`'s :doc:`language <../libraries/language>`
-files and error messages format:
-
- - :doc:`Language Library <../libraries/language>` line keys now must be
- prefixed with **form_validation_** in order to avoid collisions::
-
- // Old
- $lang['rule'] = ...
-
- // New
- $lang['form_validation_rule'] = ...
-
- - The error messages format has been changed to use named parameters, to
- allow more flexibility than what `sprintf()` offers::
-
- // Old
- 'The %s field does not match the %s field.'
-
- // New
- 'The {field} field does not match the {param} field.'
-
-.. note:: The old formatting still works, but the non-prefixed line keys
- are DEPRECATED and scheduled for removal in CodeIgniter 3.1+.
- Therefore you're encouraged to update its usage sooner rather than
- later.
-
-************************************************************
-Step 19: Make sure your 'base_url' config value is not empty
-************************************************************
-
-When ``$config['base_url']`` is not set, CodeIgniter tries to automatically
-detect what your website's base URL is. This is done purely for convenience
-when you are starting development of a new application.
-
-Auto-detection is never reliable and also has security implications, which
-is why you should **always** have it manually configured!
-
-One of the changes in CodeIgniter 3.0.3 is how this auto-detection works,
-and more specifically it now falls back to the server's IP address instead
-of the hostname requested by the client. Therefore, if you've ever relied
-on auto-detection, it will change how your website works now.
-
-In case you need to allow e.g. multiple domains, or both http:// and
-https:// prefixes to be dynamically used depending on the request,
-remember that *application/config/config.php* is still a PHP script, in
-which you can create this logic with a few lines of code. For example::
-
- $allowed_domains = array('domain1.tld', 'domain2.tld');
- $default_domain = 'domain1.tld';
-
- if (in_array($_SERVER['HTTP_HOST'], $allowed_domains, TRUE))
- {
- $domain = $_SERVER['HTTP_HOST'];
- }
- else
- {
- $domain = $default_domain;
- }
-
- if ( ! empty($_SERVER['HTTPS']))
- {
- $config['base_url'] = 'https://'.$domain;
- }
- else
- {
- $config['base_url'] = 'http://'.$domain;
- }
-
-
-****************************************************************
-Step 20: Remove usage of (previously) deprecated functionalities
-****************************************************************
-
-In addition to the ``$autoload['core']`` configuration setting, there's a
-number of other functionalities that have been removed in CodeIgniter 3.0.0:
-
-The SHA1 library
-================
-
-The previously deprecated SHA1 library has been removed, alter your code to use PHP's native
-``sha1()`` function to generate a SHA1 hash.
-
-Additionally, the ``sha1()`` method in the :doc:`Encrypt Library <../libraries/encrypt>` has been removed.
-
-The EXT constant
-================
-
-Usage of the ``EXT`` constant has been deprecated since dropping support for PHP 4. There's no
-longer a need to maintain different filename extensions and in this new CodeIgniter version,
-the ``EXT`` constant has been removed. Use just '.php' instead.
-
-Smiley helper
-=============
-
-The :doc:`Smiley Helper <../helpers/smiley_helper>` is a legacy feature from EllisLab's
-ExpressionEngine product. However, it is too specific for a general purpose framework like
-CodeIgniter and as such it is now deprecated.
-
-Also, the previously deprecated ``js_insert_smiley()`` (since version 1.7.2) is now removed.
-
-The Encrypt library
-===================
-
-Following numerous vulnerability reports, the :doc:`Encrypt Library <../libraries/encrypt>` has
-been deprecated and a new, :doc:`Encryption Library <../libraries/encryption>` is added to take
-its place.
-
-The new library requires either the `MCrypt extension <http://php.net/mcrypt>`_ (and /dev/urandom
-availability) or PHP 5.3.3 and the `OpenSSL extension <http://php.net/openssl>`_.
-While this might be rather inconvenient, it is a requirement that allows us to have properly
-implemented cryptographic functions.
-
-.. note:: The :doc:`Encrypt Library <../libraries/encrypt>` is still available for the purpose
- of keeping backwards compatibility.
-
-.. important:: You are strongly encouraged to switch to the new :doc:`Encryption Library
- <../libraries/encryption>` as soon as possible!
-
-The Cart library
-================
-
-The :doc:`Cart Library <../libraries/cart>`, similarly to the :doc:`Smiley Helper
-<../helpers/smiley_helper>` is too specific for CodeIgniter. It is now deprecated
-and scheduled for removal in CodeIgniter 3.1+.
-
-.. note:: The library is still available, but you're strongly encouraged to remove its usage sooner
- rather than later.
-
-Database drivers 'mysql', 'sqlite', 'mssql', 'pdo/dblib'
-========================================================
-
-The **mysql** driver utilizes the old 'mysql' PHP extension, known for its aging code base and
-many low-level problems. The extension is deprecated as of PHP 5.5 and CodeIgniter deprecates
-it in version 3.0, switching the default configured MySQL driver to **mysqli**.
-
-Please use either the 'mysqli' or 'pdo/mysql' drivers for MySQL. The old 'mysql' driver will be
-removed at some point in the future.
-
-The **sqlite**, **mssql** and **pdo/dblib** (also known as pdo/mssql or pdo/sybase) drivers
-all depend on PHP extensions that for different reasons no longer exist since PHP 5.3.
-
-Therefore we are now deprecating these drivers as we will have to remove them in one of the next
-CodeIgniter versions. You should use the more advanced, **sqlite3**, **sqlsrv** or **pdo/sqlsrv**
-drivers respectively.
-
-.. note:: These drivers are still available, but you're strongly encouraged to switch to other ones
- sooner rather than later.
-
-Security helper do_hash()
-=========================
-
-:doc:`Security Helper <../helpers/security_helper>` function ``do_hash()`` is now just an alias for
-PHP's native ``hash()`` function. It is deprecated and scheduled for removal in CodeIgniter 3.1+.
-
-.. note:: This function is still available, but you're strongly encouraged to remove its usage sooner
- rather than later.
-
-The $config['global_xss_filtering'] setting
-===========================================
-
-As already explained above, XSS filtering should not be done on input data,
-but on output instead. Therefore, the ``$config['global_xss_filtering']``,
-which automatically filters *input* data, is considered a bad practice and
-is now deprecated.
-
-Instead, you should manually escape any user-provided data via the
-:php:func:`xss_clean()` function when you need to output it, or use a
-library like `HTML Purifier <http://htmlpurifier.org/>`_ that does that
-for you.
-
-.. note:: The setting is still available, but you're strongly encouraged to
- remove its usage sooner rather than later.
-
-File helper read_file()
-=======================
-
-:doc:`File Helper <../helpers/file_helper>` function ``read_file()`` is now just an alias for
-PHP's native ``file_get_contents()`` function. It is deprecated and scheduled for removal in
-CodeIgniter 3.1+.
-
-.. note:: This function is still available, but you're strongly encouraged to remove its usage sooner
- rather than later.
-
-String helper repeater()
-========================
-
-:doc:`String Helper <../helpers/string_helper>` function :php:func:`repeater()` is now just an alias for
-PHP's native ``str_repeat()`` function. It is deprecated and scheduled for removal in CodeIgniter 3.1+.
-
-.. note:: This function is still available, but you're strongly encouraged to remove its usage sooner
- rather than later.
-
-String helper trim_slashes()
-============================
-
-:doc:`String Helper <../helpers/string_helper>` function :php:func:`trim_slashes()` is now just an alias
-for PHP's native ``trim()`` function (with a slash passed as its second argument). It is deprecated and
-scheduled for removal in CodeIgniter 3.1+.
-
-.. note:: This function is still available, but you're strongly encouraged to remove its usage sooner
- rather than later.
-
-Form helper form_prep()
-=======================
-
-:doc:`Form Helper <../helpers/form_helper>` function :php:func:`form_prep()`
-is now just an alias for :doc:`common function </general/common_functions>`
-:func:`html_escape()`. It is deprecated and will be removed in the future.
-
-Please use :php:func:`html_escape()` instead.
-
-.. note:: This function is still available, but you're strongly encouraged
- to remove its usage sooner rather than later.
-
-Email helper functions
-======================
-
-:doc:`Email Helper <../helpers/email_helper>` only has two functions
-
- - :php:func:`valid_email()`
- - :php:func:`send_email()`
-
-Both of them are now aliases for PHP's native ``filter_var()`` and ``mail()`` functions, respectively.
-Therefore the :doc:`Email Helper <../helpers/email_helper>` altogether is being deprecated and
-is scheduled for removal in CodeIgniter 3.1+.
-
-.. note:: These functions are still available, but you're strongly encouraged to remove their usage
- sooner rather than later.
-
-Date helper standard_date()
-===========================
-
-:doc:`Date Helper <../helpers/date_helper>` function ``standard_date()`` is being deprecated due
-to the availability of native PHP `constants <http://php.net/manual/en/class.datetime.php#datetime.constants.types>`_,
-which when combined with ``date()`` provide the same functionality. Furthermore, they have the
-exact same names as the ones supported by ``standard_date()``. Here are examples of how to replace
-its usage:
-
-::
-
- // Old way
- standard_date(); // defaults to standard_date('DATE_RFC822', now());
-
- // Replacement
- date(DATE_RFC822, now());
-
- // Old way
- standard_date('DATE_ATOM', $time);
-
- // Replacement
- date(DATE_ATOM, $time);
-
-.. note:: This function is still available, but you're strongly encouraged to remove its usage sooner
- rather than later as it is scheduled for removal in CodeIgniter 3.1+.
-
-HTML helpers nbs(), br()
-========================
-
-:doc:`HTML Helper <../helpers/html_helper>` functions ``nbs()`` and ``br()`` are just aliases
-for the native ``str_repeat()`` function used with ``&nbsp;`` and ``<br >`` respectively.
-
-Because there's no point in just aliasing native PHP functions, they are now deprecated and
-scheduled for removal in CodeIgniter 3.1+.
-
-.. note:: These functions are still available, but you're strongly encouraged to remove their usage
- sooner rather than later.
-
-Pagination library 'anchor_class' setting
-=========================================
-
-The :doc:`Pagination Library <../libraries/pagination>` now supports adding pretty much any HTML
-attribute to your anchors via the 'attributes' configuration setting. This includes passing the
-'class' attribute and using the separate 'anchor_class' setting no longer makes sense.
-As a result of that, the 'anchor_class' setting is now deprecated and scheduled for removal in
-CodeIgniter 3.1+.
-
-.. note:: This setting is still available, but you're strongly encouraged to remove its usage sooner
- rather than later.
-
-String helper random_string() types 'unique' and 'encrypt'
-==========================================================
-
-When using the :doc:`String Helper <../helpers/string_helper>` function :php:func:`random_string()`,
-you should no longer pass the **unique** and **encrypt** randomization types. They are only
-aliases for **md5** and **sha1** respectively and are now deprecated and scheduled for removal
-in CodeIgniter 3.1+.
-
-.. note:: These options are still available, but you're strongly encouraged to remove their usage
- sooner rather than later.
-
-URL helper url_title() separators 'dash' and 'underscore'
-=========================================================
-
-When using the :doc:`URL Helper <../helpers/url_helper>` function :php:func:`url_title()`, you
-should no longer pass **dash** or **underscore** as the word separator. This function will
-now accept any character and you should just pass the chosen character directly, so you
-should write '-' instead of 'dash' and '_' instead of 'underscore'.
-
-**dash** and **underscore** now act as aliases and are deprecated and scheduled for removal
-in CodeIgniter 3.1+.
-
-.. note:: These options are still available, but you're strongly encouraged to remove their usage
- sooner rather than later.
-
-Session Library method all_userdata()
-=====================================
-
-As seen in the :doc:`Change Log <../changelog>`, :doc:`Session Library <../libraries/sessions>`
-method ``userdata()`` now allows you to fetch all userdata by simply omitting its parameter::
-
- $this->session->userdata();
-
-This makes the ``all_userdata()`` method redudant and therefore it is now just an alias for
-``userdata()`` with the above shown usage and is being deprecated and scheduled for removal
-in CodeIgniter 3.1+.
-
-.. note:: This method is still available, but you're strongly encouraged to remove its usage
- sooner rather than later.
-
-Database Forge method add_column() with an AFTER clause
-=======================================================
-
-If you have used the **third parameter** for :doc:`Database Forge <../database/forge>` method
-``add_column()`` to add a field for an AFTER clause, then you should change its usage.
-
-That third parameter has been deprecated and scheduled for removal in CodeIgniter 3.1+.
-
-You should now put AFTER clause field names in the field definition array instead::
-
- // Old usage:
- $field = array(
- 'new_field' => array('type' => 'TEXT')
- );
-
- $this->dbforge->add_column('table_name', $field, 'another_field');
-
- // New usage:
- $field = array(
- 'new_field' => array('type' => 'TEXT', 'after' => 'another_field')
- );
-
- $this->dbforge->add_column('table_name', $field);
-
-.. note:: The parameter is still available, but you're strongly encouraged to remove its usage
- sooner rather than later.
-
-.. note:: This is for MySQL and CUBRID databases only! Other drivers don't support this
- clause and will silently ignore it.
-
-URI Routing methods fetch_directory(), fetch_class(), fetch_method()
-====================================================================
-
-With properties ``CI_Router::$directory``, ``CI_Router::$class`` and ``CI_Router::$method``
-being public and their respective ``fetch_*()`` no longer doing anything else to just return
-the properties - it doesn't make sense to keep them.
-
-Those are all internal, undocumented methods, but we've opted to deprecate them for now
-in order to maintain backwards-compatibility just in case. If some of you have utilized them,
-then you can now just access the properties instead::
-
- $this->router->directory;
- $this->router->class;
- $this->router->method;
-
-.. note:: Those methods are still available, but you're strongly encouraged to remove their usage
- sooner rather than later.
-
-Input library method is_cli_request()
-=====================================
-
-Calls to the ``CI_Input::is_cli_request()`` method are necessary at many places
-in the CodeIgniter internals and this is often before the :doc:`Input Library
-<../libraries/input>` is loaded. Because of that, it is being replaced by a common
-function named :php:func:`is_cli()` and this method is now just an alias.
-
-The new function is both available at all times for you to use and shorter to type.
-
-::
-
- // Old
- $this->input->is_cli_request();
-
- // New
- is_cli();
-
-``CI_Input::is_cli_request()`` is now now deprecated and scheduled for removal in
-CodeIgniter 3.1+.
-
-.. note:: This method is still available, but you're strongly encouraged to remove its usage
- sooner rather than later.
-
-Config library method system_url()
-==================================
-
-Usage of ``CI_Config::system_url()`` encourages insecure coding practices.
-Namely, your CodeIgniter *system/* directory shouldn't be publicly accessible
-from a security point of view.
-
-Because of this, this method is now deprecated and scheduled for removal in
-CodeIgniter 3.1+.
-
-.. note:: This method is still available, but you're strongly encouraged to remove its usage
- sooner rather than later.
-
-The Javascript library
-======================
-
-The :doc:`Javascript Library <../libraries/javascript>` has always had an
-'experimental' status and was never really useful, nor a proper solution.
-
-It is now deprecated and scheduled for removal in CodeIgniter 3.1+.
-
-.. note:: This library is still available, but you're strongly encouraged to remove its usage
- sooner rather than later.
-
-Form Validation method prep_for_form()
-======================================
-
-The :doc:`Form Validation Library <../libraries/form_validation>` has a
-``prep_for_form()`` method, which is/can also be used as a rule in
-``set_rules()`` to automatically perform HTML encoding on input data.
-
-Automatically encoding input (instead of output) data is a bad practice in
-the first place, and CodeIgniter and PHP itself offer other alternatives
-to this method anyway.
-For example, :doc:`Form Helper <../helpers/form_helper>` functions will
-automatically perform HTML escaping when necessary.
-
-Therefore, the *prep_for_form* method/rule is pretty much useless and is now
-deprecated and scheduled for removal in 3.1+.
-
-.. note:: The method is still available, but you're strongly encouraged to
- remove its usage sooner rather than later.
-
-***********************************************************
-Step 21: Check your usage of Text helper highlight_phrase()
-***********************************************************
-
-The default HTML tag used by :doc:`Text Helper <../helpers/text_helper>` function
-:func:`highlight_phrase()` has been changed from ``<strong>`` to the new HTML5
-tag ``<mark>``.
-
-Unless you've used your own highlighting tags, this might cause trouble
-for your visitors who use older web browsers such as Internet Explorer 8.
-We therefore suggest that you add the following code to your CSS files
-in order to avoid backwards compatibility with old browsers::
-
- mark {
- background: #ff0;
- color: #000;
- };
diff --git a/user_guide_src/source/installation/upgrade_301.rst b/user_guide_src/source/installation/upgrade_301.rst
deleted file mode 100644
index 450cdb288..000000000
--- a/user_guide_src/source/installation/upgrade_301.rst
+++ /dev/null
@@ -1,19 +0,0 @@
-#############################
-Upgrading from 3.0.0 to 3.0.1
-#############################
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace all files and directories in your *system/* directory.
-
-.. note:: If you have any custom developed files in these directories,
- please make copies of them first.
-
-Step 2: Update your CLI error templates
-=======================================
-
-Replace all files under your *application/views/errors/cli/* directory.
diff --git a/user_guide_src/source/installation/upgrade_302.rst b/user_guide_src/source/installation/upgrade_302.rst
deleted file mode 100644
index 93d87ac41..000000000
--- a/user_guide_src/source/installation/upgrade_302.rst
+++ /dev/null
@@ -1,24 +0,0 @@
-#############################
-Upgrading from 3.0.1 to 3.0.2
-#############################
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace all files and directories in your *system/* directory.
-
-.. note:: If you have any custom developed files in these directories,
- please make copies of them first.
-
-Step 2: Update your application/config/constants.php file
-=========================================================
-
-The *application/config/constants.php* file has been updated to check
-if constants aren't already defined before doing that, making it easier
-to add an environment-specific configuration.
-
-.. note:: If you've made modifications to this file, please make a
- backup first and cross-check the differences first. \ No newline at end of file
diff --git a/user_guide_src/source/installation/upgrade_303.rst b/user_guide_src/source/installation/upgrade_303.rst
deleted file mode 100644
index d13a0fe46..000000000
--- a/user_guide_src/source/installation/upgrade_303.rst
+++ /dev/null
@@ -1,55 +0,0 @@
-#############################
-Upgrading from 3.0.2 to 3.0.3
-#############################
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace all files and directories in your *system/* directory.
-
-.. note:: If you have any custom developed files in these directories,
- please make copies of them first.
-
-Step 2: Make sure your 'base_url' config value is not empty
-===========================================================
-
-When ``$config['base_url']`` is not set, CodeIgniter tries to automatically
-detect what your website's base URL is. This is done purely for convenience
-when you are starting development of a new application.
-
-Auto-detection is never reliable and also has security implications, which
-is why you should **always** have it manually configured!
-
-One of the changes in CodeIgniter 3.0.3 is how this auto-detection works,
-and more specifically it now falls back to the server's IP address instead
-of the hostname requested by the client. Therefore, if you've ever relied
-on auto-detection, it will change how your website works now.
-
-In case you need to allow e.g. multiple domains, or both http:// and
-https:// prefixes to be dynamically used depending on the request,
-remember that *application/config/config.php* is still a PHP script, in
-which you can create this logic with a few lines of code. For example::
-
- $allowed_domains = array('domain1.tld', 'domain2.tld');
- $default_domain = 'domain1.tld';
-
- if (in_array($_SERVER['HTTP_HOST'], $allowed_domains, TRUE))
- {
- $domain = $_SERVER['HTTP_HOST'];
- }
- else
- {
- $domain = $default_domain;
- }
-
- if ( ! empty($_SERVER['HTTPS']))
- {
- $config['base_url'] = 'https://'.$domain;
- }
- else
- {
- $config['base_url'] = 'http://'.$domain;
- }
diff --git a/user_guide_src/source/installation/upgrade_304.rst b/user_guide_src/source/installation/upgrade_304.rst
deleted file mode 100644
index 4d5bd2bb0..000000000
--- a/user_guide_src/source/installation/upgrade_304.rst
+++ /dev/null
@@ -1,14 +0,0 @@
-#############################
-Upgrading from 3.0.3 to 3.0.4
-#############################
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace all files and directories in your *system/* directory.
-
-.. note:: If you have any custom developed files in these directories,
- please make copies of them first.
diff --git a/user_guide_src/source/installation/upgrade_305.rst b/user_guide_src/source/installation/upgrade_305.rst
deleted file mode 100644
index a47982481..000000000
--- a/user_guide_src/source/installation/upgrade_305.rst
+++ /dev/null
@@ -1,14 +0,0 @@
-#############################
-Upgrading from 3.0.4 to 3.0.5
-#############################
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace all files and directories in your *system/* directory.
-
-.. note:: If you have any custom developed files in these directories,
- please make copies of them first.
diff --git a/user_guide_src/source/installation/upgrade_306.rst b/user_guide_src/source/installation/upgrade_306.rst
deleted file mode 100644
index 3863e0afa..000000000
--- a/user_guide_src/source/installation/upgrade_306.rst
+++ /dev/null
@@ -1,48 +0,0 @@
-#############################
-Upgrading from 3.0.5 to 3.0.6
-#############################
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace all files and directories in your *system/* directory.
-
-.. note:: If you have any custom developed files in these directories,
- please make copies of them first.
-
-Step 2: Update your index.php file (optional)
-=============================================
-
-We've made some tweaks to the index.php file, mostly related to proper
-usage of directory separators (i.e. use the ``DIRECTORY_SEPARATOR``
-constant instead of a hard coded forward slash "/").
-
-Nothing will break if you skip this step, but if you're running Windows
-or just want to be up to date with every change - we do recommend that
-you update your index.php file.
-
-*Tip: Just copy the ``ENVIRONMENT``, ``$system_path``, ``$application_folder``
-and ``$view_folder`` declarations from the old file and put them into the
-new one, replacing the defaults.*
-
-Step 3: Remove 'prep_for_form' usage (deprecation)
-==================================================
-
-The :doc:`Form Validation Library <../libraries/form_validation>` has a
-``prep_for_form()`` method, which is/can also be used as a rule in
-``set_rules()`` to automatically perform HTML encoding on input data.
-
-Automatically encoding input (instead of output) data is a bad practice in
-the first place, and CodeIgniter and PHP itself offer other alternatives
-to this method anyway.
-For example, :doc:`Form Helper <../helpers/form_helper>` functions will
-automatically perform HTML escaping when necessary.
-
-Therefore, the *prep_for_form* method/rule is pretty much useless and is now
-deprecated and scheduled for removal in 3.1+.
-
-.. note:: The method is still available, but you're strongly encouraged to
- remove its usage sooner rather than later.
diff --git a/user_guide_src/source/installation/upgrade_310.rst b/user_guide_src/source/installation/upgrade_310.rst
deleted file mode 100644
index 9e0108691..000000000
--- a/user_guide_src/source/installation/upgrade_310.rst
+++ /dev/null
@@ -1,38 +0,0 @@
-#############################
-Upgrading from 3.0.6 to 3.1.0
-#############################
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace all files and directories in your *system/* directory.
-
-.. note:: If you have any custom developed files in these directories,
- please make copies of them first.
-
-Step 2: Check your PHP version
-==============================
-
-We recommend always running versions that are `currently supported
-<https://secure.php.net/supported-versions.php>`_, which right now is at least PHP 5.6.
-
-PHP 5.2.x versions are now officially not supported by CodeIgniter, and while 5.3.7+
-may be at least runnable, we strongly discourage you from using any PHP versions below
-the ones listed on the `PHP.net Supported Versions <https://secure.php.net/supported-versions.php>`_
-page.
-
-Step 3: If you're using the 'odbc' database driver, check for usage of Query Builder
-====================================================================================
-
-:doc:`Query Builder <../database/query_builder>` functionality and ``escape()`` can
-no longer be used with the 'odbc' database driver.
-
-This is because, due to its nature, the `ODBC extension for PHP <https://secure.php.net/odbc>`_
-does not provide a function that allows to safely escape user-supplied strings for usage
-inside an SQL query (which our :doc:`Query Builder <../database/query_builder>` relies on).
-
-Thus, user inputs MUST be bound, as shown in :doc:`Running Queries <../database/queries>`,
-under the "Query Bindings" section. \ No newline at end of file
diff --git a/user_guide_src/source/installation/upgrade_311.rst b/user_guide_src/source/installation/upgrade_311.rst
deleted file mode 100644
index a36e72323..000000000
--- a/user_guide_src/source/installation/upgrade_311.rst
+++ /dev/null
@@ -1,14 +0,0 @@
-#############################
-Upgrading from 3.1.0 to 3.1.1
-#############################
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace all files and directories in your *system/* directory.
-
-.. note:: If you have any custom developed files in these directories,
- please make copies of them first.
diff --git a/user_guide_src/source/installation/upgrade_3110.rst b/user_guide_src/source/installation/upgrade_3110.rst
deleted file mode 100644
index 0e3b7c676..000000000
--- a/user_guide_src/source/installation/upgrade_3110.rst
+++ /dev/null
@@ -1,25 +0,0 @@
-##############################
-Upgrading from 3.1.9 to 3.1.10
-##############################
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace all files and directories in your *system/* directory.
-
-.. note:: If you have any custom developed files in these directories,
- please make copies of them first.
-
-Step 2: Check for calls to is_countable()
-==========================================
-
-
-PHP 7.3 introduces a native `is_countable() <https://secure.php.net/is_countable>`_
-function, which creates a name collision with the ``is_countable()`` function
-we've had in our :doc:`Inflector Helpers <../helpers/inflector_helper>`.
-
-If you've been using the helper function in question, you should now rename
-the calls to it to :php:func:`word_is_countable()`.
diff --git a/user_guide_src/source/installation/upgrade_3111.rst b/user_guide_src/source/installation/upgrade_3111.rst
deleted file mode 100644
index 5dd02efdc..000000000
--- a/user_guide_src/source/installation/upgrade_3111.rst
+++ /dev/null
@@ -1,20 +0,0 @@
-###############################
-Upgrading from 3.1.10 to 3.1.11
-###############################
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace all files and directories in your *system/* directory.
-
-.. note:: If you have any custom developed files in these directories,
- please make copies of them first.
-
-Step 2: Replace config/mimes.php
-================================
-
-This config file has received some updates. Please copy it to
-*application/config/mimes.php*.
diff --git a/user_guide_src/source/installation/upgrade_3112.rst b/user_guide_src/source/installation/upgrade_3112.rst
deleted file mode 100644
index 93bcc43d3..000000000
--- a/user_guide_src/source/installation/upgrade_3112.rst
+++ /dev/null
@@ -1,26 +0,0 @@
-###############################
-Upgrading from 3.1.11 to 3.1.12
-###############################
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace all files and directories in your *system/* directory.
-
-.. note:: If you have any custom developed files in these directories,
- please make copies of them first.
-
-Step 2: Replace config/user_agents.php
-================================
-
-This config file has received some updates. Please copy it to
-*application/config/user_agents.php*.
-
-Step 3: Replace config/mimes.php
-================================
-
-This config file has received some updates. Please copy it to
-*application/config/mimes.php*.
diff --git a/user_guide_src/source/installation/upgrade_3113.rst b/user_guide_src/source/installation/upgrade_3113.rst
deleted file mode 100644
index 9de342fe6..000000000
--- a/user_guide_src/source/installation/upgrade_3113.rst
+++ /dev/null
@@ -1,14 +0,0 @@
-##############################
-Upgrading from 3.1.12 to 3.1.13
-##############################
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace all files and directories in your *system/* directory.
-
-.. note:: If you have any custom developed files in these directories,
- please make copies of them first.
diff --git a/user_guide_src/source/installation/upgrade_312.rst b/user_guide_src/source/installation/upgrade_312.rst
deleted file mode 100644
index e0b2191dd..000000000
--- a/user_guide_src/source/installation/upgrade_312.rst
+++ /dev/null
@@ -1,40 +0,0 @@
-#############################
-Upgrading from 3.1.1 to 3.1.2
-#############################
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace all files and directories in your *system/* directory.
-
-.. note:: If you have any custom developed files in these directories,
- please make copies of them first.
-
-Step 2: Update your "ci_sessions" database table
-================================================
-
-If you're using the :doc:`Session Library </libraries/sessions>` with the
-'database' driver, you may have to ``ALTER`` your sessions table for your
-sessions to continue to work.
-
-.. note:: The table in question is not necessarily named "ci_sessions".
- It is what you've set as your ``$config['sess_save_path']``.
-
-This will only affect you if you've changed your ``session.hash_function``
-*php.ini* setting to something like 'sha512'. Or if you've been running
-an older CodeIgniter version on PHP 7.1+.
-
-It is recommended that you do this anyway, just to avoid potential issues
-in the future if you do change your configuration.
-
-Just execute the one of the following SQL queries, depending on your
-database::
-
- // MySQL:
- ALTER TABLE ci_sessions CHANGE id id varchar(128) NOT NULL;
-
- // PostgreSQL
- ALTER TABLE ci_sessions ALTER COLUMN id SET DATA TYPE varchar(128);
diff --git a/user_guide_src/source/installation/upgrade_313.rst b/user_guide_src/source/installation/upgrade_313.rst
deleted file mode 100644
index 13af775a1..000000000
--- a/user_guide_src/source/installation/upgrade_313.rst
+++ /dev/null
@@ -1,46 +0,0 @@
-#############################
-Upgrading from 3.1.2 to 3.1.3
-#############################
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace all files and directories in your *system/* directory.
-
-.. note:: If you have any custom developed files in these directories,
- please make copies of them first.
-
-Step 2: Remove usage of nice_date() helper (deprecation)
-========================================================
-
-The :doc:`Date Helper <../helpers/date_helper>` function ``nice_date()`` is
-no longer useful since the introduction of PHP's `DateTime classes
-<https://secure.php.net/datetime>`_
-
-You can replace it with the following:
-::
-
- DateTime::createFromFormat($input_format, $input_date)->format($desired_output_format);
-
-Thus, ``nice_date()`` is now deprecated and scheduled for removal in
-CodeIgniter 3.2+.
-
-.. note:: The function is still available, but you're strongly encouraged
- to remove its usage sooner rather than later.
-
-Step 3: Remove usage of $config['standardize_newlines']
-=======================================================
-
-The :doc:`Input Library <../libraries/input>` would optionally replace
-occurrences of `\r\n`, `\r`, `\n` in input data with whatever the ``PHP_EOL``
-value is on your system - if you've set ``$config['standardize_newlines']``
-to ``TRUE`` in your *application/config/config.php*.
-
-This functionality is now deprecated and scheduled for removal in
-CodeIgniter 3.2.+.
-
-.. note:: The functionality is still available, but you're strongly
- encouraged to remove its usage sooner rather than later.
diff --git a/user_guide_src/source/installation/upgrade_314.rst b/user_guide_src/source/installation/upgrade_314.rst
deleted file mode 100644
index 3f2da6564..000000000
--- a/user_guide_src/source/installation/upgrade_314.rst
+++ /dev/null
@@ -1,14 +0,0 @@
-#############################
-Upgrading from 3.1.3 to 3.1.4
-#############################
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace all files and directories in your *system/* directory.
-
-.. note:: If you have any custom developed files in these directories,
- please make copies of them first.
diff --git a/user_guide_src/source/installation/upgrade_315.rst b/user_guide_src/source/installation/upgrade_315.rst
deleted file mode 100644
index cf673abbb..000000000
--- a/user_guide_src/source/installation/upgrade_315.rst
+++ /dev/null
@@ -1,14 +0,0 @@
-#############################
-Upgrading from 3.1.4 to 3.1.5
-#############################
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace all files and directories in your *system/* directory.
-
-.. note:: If you have any custom developed files in these directories,
- please make copies of them first.
diff --git a/user_guide_src/source/installation/upgrade_316.rst b/user_guide_src/source/installation/upgrade_316.rst
deleted file mode 100644
index 1d86b5720..000000000
--- a/user_guide_src/source/installation/upgrade_316.rst
+++ /dev/null
@@ -1,28 +0,0 @@
-#############################
-Upgrading from 3.1.5 to 3.1.6
-#############################
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace all files and directories in your *system/* directory.
-
-.. note:: If you have any custom developed files in these directories,
- please make copies of them first.
-
-Step 2: Remove usage of the APC Cache driver (deprecation)
-==========================================================
-
-The :doc:`Cache Library <../libraries/caching>` APC driver is now
-deprecated, as the APC extension is effectively dead, as explained in its
-`PHP Manual page <https://secure.php.net/manual/en/intro.apc.php>`_.
-
-If your application happens to be using it, you can switch to another
-cache driver, as APC support will be removed in a future CodeIgniter
-version.
-
-.. note:: The driver is still available, but you're strongly encouraged
- to remove its usage sooner rather than later.
diff --git a/user_guide_src/source/installation/upgrade_317.rst b/user_guide_src/source/installation/upgrade_317.rst
deleted file mode 100644
index dc1ee1868..000000000
--- a/user_guide_src/source/installation/upgrade_317.rst
+++ /dev/null
@@ -1,27 +0,0 @@
-#############################
-Upgrading from 3.1.6 to 3.1.7
-#############################
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace all files and directories in your *system/* directory.
-
-.. note:: If you have any custom developed files in these directories,
- please make copies of them first.
-
-Step 2: Remove usage of CAPTCHA helper extra parameters (deprecation)
-=====================================================================
-
-The :doc:`CAPTCHA Helper <../helpers/captcha_helper>` function
-:php:func:`create_captcha()` allows passing of its ``img_path``, ``img_url``
-and ``font_path`` options as the 2nd, 3rd and 4th parameters respectively.
-
-This kind of usage is now deprecated and you should just pass the options
-in question as part of the first parameter array.
-
-.. note:: The functionality in question is still available, but you're
- strongly encouraged to remove its usage sooner rather than later.
diff --git a/user_guide_src/source/installation/upgrade_318.rst b/user_guide_src/source/installation/upgrade_318.rst
deleted file mode 100644
index 8b13f5c50..000000000
--- a/user_guide_src/source/installation/upgrade_318.rst
+++ /dev/null
@@ -1,14 +0,0 @@
-#############################
-Upgrading from 3.1.7 to 3.1.8
-#############################
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace all files and directories in your *system/* directory.
-
-.. note:: If you have any custom developed files in these directories,
- please make copies of them first.
diff --git a/user_guide_src/source/installation/upgrade_319.rst b/user_guide_src/source/installation/upgrade_319.rst
deleted file mode 100644
index db56cac2a..000000000
--- a/user_guide_src/source/installation/upgrade_319.rst
+++ /dev/null
@@ -1,21 +0,0 @@
-#############################
-Upgrading from 3.1.8 to 3.1.9
-#############################
-
-Before performing an update you should take your site offline by
-replacing the index.php file with a static one.
-
-Step 1: Update your CodeIgniter files
-=====================================
-
-Replace all files and directories in your *system/* directory.
-
-.. note:: If you have any custom developed files in these directories,
- please make copies of them first.
-
-
-Step 2: Replace config/mimes.php
-================================
-
-This config file has received some updates. Please copy it to
-*application/config/mimes.php*.
diff --git a/user_guide_src/source/installation/upgrade_b11.rst b/user_guide_src/source/installation/upgrade_b11.rst
deleted file mode 100644
index e70759be6..000000000
--- a/user_guide_src/source/installation/upgrade_b11.rst
+++ /dev/null
@@ -1,78 +0,0 @@
-###################################
-Upgrading From Beta 1.0 to Beta 1.1
-###################################
-
-To upgrade to Beta 1.1 please perform the following steps:
-
-Step 1: Replace your index file
-===============================
-
-Replace your main index.php file with the new index.php file. Note: If
-you have renamed your "system" folder you will need to edit this info in
-the new file.
-
-Step 2: Relocate your config folder
-===================================
-
-This version of CodeIgniter now permits multiple sets of "applications"
-to all share a common set of backend files. In order to enable each
-application to have its own configuration values, the config directory
-must now reside inside of your application folder, so please move it
-there.
-
-Step 3: Replace directories
-===========================
-
-Replace the following directories with the new versions:
-
-- drivers
-- helpers
-- init
-- libraries
-- scaffolding
-
-Step 4: Add the calendar language file
-======================================
-
-There is a new language file corresponding to the new calendaring class
-which must be added to your language folder. Add the following item to
-your version: language/english/calendar_lang.php
-
-Step 5: Edit your config file
-=============================
-
-The original application/config/config.php file has a typo in it Open
-the file and look for the items related to cookies::
-
- $conf['cookie_prefix'] = "";
- $conf['cookie_domain'] = "";
- $conf['cookie_path'] = "/";
-
-Change the array name from $conf to $config, like this::
-
- $config['cookie_prefix'] = "";
- $config['cookie_domain'] = "";
- $config['cookie_path'] = "/";
-
-Lastly, add the following new item to the config file (and edit the
-option if needed)::
-
-
- /*
- |------------------------------------------------
- | URI PROTOCOL
- |------------------------------------------------
- |
- | This item determines which server global
- | should be used to retrieve the URI string. The
- | default setting of "auto" works for most servers.
- | If your links do not seem to work, try one of
- | the other delicious flavors:
- |
- | 'auto' Default - auto detects
- | 'path_info' Uses the PATH_INFO
- | 'query_string' Uses the QUERY_STRING
- */
-
- $config['uri_protocol'] = "auto";
-
diff --git a/user_guide_src/source/installation/upgrading.rst b/user_guide_src/source/installation/upgrading.rst
deleted file mode 100644
index fd5a3d482..000000000
--- a/user_guide_src/source/installation/upgrading.rst
+++ /dev/null
@@ -1,63 +0,0 @@
-#################################
-Upgrading From a Previous Version
-#################################
-
-Please read the upgrade notes corresponding to the version you are
-upgrading from.
-
-.. toctree::
- :titlesonly:
-
- Upgrading from 3.1.12 to 3.1.13 <upgrade_3113>
- Upgrading from 3.1.11 to 3.1.12 <upgrade_3112>
- Upgrading from 3.1.10 to 3.1.11 <upgrade_3111>
- Upgrading from 3.1.9 to 3.1.10 <upgrade_3110>
- Upgrading from 3.1.8 to 3.1.9 <upgrade_319>
- Upgrading from 3.1.7 to 3.1.8 <upgrade_318>
- Upgrading from 3.1.6 to 3.1.7 <upgrade_317>
- Upgrading from 3.1.5 to 3.1.6 <upgrade_316>
- Upgrading from 3.1.4 to 3.1.5 <upgrade_315>
- Upgrading from 3.1.3 to 3.1.4 <upgrade_314>
- Upgrading from 3.1.2 to 3.1.3 <upgrade_313>
- Upgrading from 3.1.1 to 3.1.2 <upgrade_312>
- Upgrading from 3.1.0 to 3.1.1 <upgrade_311>
- Upgrading from 3.0.6 to 3.1.0 <upgrade_310>
- Upgrading from 3.0.5 to 3.0.6 <upgrade_306>
- Upgrading from 3.0.4 to 3.0.5 <upgrade_305>
- Upgrading from 3.0.3 to 3.0.4 <upgrade_304>
- Upgrading from 3.0.2 to 3.0.3 <upgrade_303>
- Upgrading from 3.0.1 to 3.0.2 <upgrade_302>
- Upgrading from 3.0.0 to 3.0.1 <upgrade_301>
- Upgrading from 2.2.x to 3.0.x <upgrade_300>
- Upgrading from 2.2.2 to 2.2.3 <upgrade_223>
- Upgrading from 2.2.1 to 2.2.2 <upgrade_222>
- Upgrading from 2.2.0 to 2.2.1 <upgrade_221>
- Upgrading from 2.1.4 to 2.2.x <upgrade_220>
- Upgrading from 2.1.3 to 2.1.4 <upgrade_214>
- Upgrading from 2.1.2 to 2.1.3 <upgrade_213>
- Upgrading from 2.1.1 to 2.1.2 <upgrade_212>
- Upgrading from 2.1.0 to 2.1.1 <upgrade_211>
- Upgrading from 2.0.3 to 2.1.0 <upgrade_210>
- Upgrading from 2.0.2 to 2.0.3 <upgrade_203>
- Upgrading from 2.0.1 to 2.0.2 <upgrade_202>
- Upgrading from 2.0 to 2.0.1 <upgrade_201>
- Upgrading from 1.7.2 to 2.0 <upgrade_200>
- Upgrading from 1.7.1 to 1.7.2 <upgrade_172>
- Upgrading from 1.7.0 to 1.7.1 <upgrade_171>
- Upgrading from 1.6.3 to 1.7.0 <upgrade_170>
- Upgrading from 1.6.2 to 1.6.3 <upgrade_163>
- Upgrading from 1.6.1 to 1.6.2 <upgrade_162>
- Upgrading from 1.6.0 to 1.6.1 <upgrade_161>
- Upgrading from 1.5.4 to 1.6.0 <upgrade_160>
- Upgrading from 1.5.3 to 1.5.4 <upgrade_154>
- Upgrading from 1.5.2 to 1.5.3 <upgrade_153>
- Upgrading from 1.5.0 or 1.5.1 to 1.5.2 <upgrade_152>
- Upgrading from 1.4.1 to 1.5.0 <upgrade_150>
- Upgrading from 1.4.0 to 1.4.1 <upgrade_141>
- Upgrading from 1.3.3 to 1.4.0 <upgrade_140>
- Upgrading from 1.3.2 to 1.3.3 <upgrade_133>
- Upgrading from 1.3.1 to 1.3.2 <upgrade_132>
- Upgrading from 1.3 to 1.3.1 <upgrade_131>
- Upgrading from 1.2 to 1.3 <upgrade_130>
- Upgrading from 1.1 to 1.2 <upgrade_120>
- Upgrading from Beta 1.0 to Beta 1.1 <upgrade_b11>
diff --git a/user_guide_src/source/libraries/benchmark.rst b/user_guide_src/source/libraries/benchmark.rst
deleted file mode 100644
index 8fc06be12..000000000
--- a/user_guide_src/source/libraries/benchmark.rst
+++ /dev/null
@@ -1,168 +0,0 @@
-##################
-Benchmarking Class
-##################
-
-CodeIgniter has a Benchmarking class that is always active, enabling the
-time difference between any two marked points to be calculated.
-
-.. note:: This class is initialized automatically by the system so there
- is no need to do it manually.
-
-In addition, the benchmark is always started the moment the framework is
-invoked, and ended by the output class right before sending the final
-view to the browser, enabling a very accurate timing of the entire
-system execution to be shown.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-*************************
-Using the Benchmark Class
-*************************
-
-The Benchmark class can be used within your
-:doc:`controllers </general/controllers>`,
-:doc:`views </general/views>`, or your :doc:`models </general/models>`.
-The process for usage is this:
-
-#. Mark a start point
-#. Mark an end point
-#. Run the "elapsed time" function to view the results
-
-Here's an example using real code::
-
- $this->benchmark->mark('code_start');
-
- // Some code happens here
-
- $this->benchmark->mark('code_end');
-
- echo $this->benchmark->elapsed_time('code_start', 'code_end');
-
-.. note:: The words "code_start" and "code_end" are arbitrary. They
- are simply words used to set two markers. You can use any words you
- want, and you can set multiple sets of markers. Consider this example::
-
- $this->benchmark->mark('dog');
-
- // Some code happens here
-
- $this->benchmark->mark('cat');
-
- // More code happens here
-
- $this->benchmark->mark('bird');
-
- echo $this->benchmark->elapsed_time('dog', 'cat');
- echo $this->benchmark->elapsed_time('cat', 'bird');
- echo $this->benchmark->elapsed_time('dog', 'bird');
-
-
-Profiling Your Benchmark Points
-===============================
-
-If you want your benchmark data to be available to the
-:doc:`Profiler </general/profiling>` all of your marked points must
-be set up in pairs, and each mark point name must end with _start and
-_end. Each pair of points must otherwise be named identically. Example::
-
- $this->benchmark->mark('my_mark_start');
-
- // Some code happens here...
-
- $this->benchmark->mark('my_mark_end');
-
- $this->benchmark->mark('another_mark_start');
-
- // Some more code happens here...
-
- $this->benchmark->mark('another_mark_end');
-
-Please read the :doc:`Profiler page </general/profiling>` for more
-information.
-
-Displaying Total Execution Time
-===============================
-
-If you would like to display the total elapsed time from the moment
-CodeIgniter starts to the moment the final output is sent to the
-browser, simply place this in one of your view templates::
-
- <?php echo $this->benchmark->elapsed_time();?>
-
-You'll notice that it's the same function used in the examples above to
-calculate the time between two point, except you are **not** using any
-parameters. When the parameters are absent, CodeIgniter does not stop
-the benchmark until right before the final output is sent to the
-browser. It doesn't matter where you use the function call, the timer
-will continue to run until the very end.
-
-An alternate way to show your elapsed time in your view files is to use
-this pseudo-variable, if you prefer not to use the pure PHP::
-
- {elapsed_time}
-
-.. note:: If you want to benchmark anything within your controller
- functions you must set your own start/end points.
-
-Displaying Memory Consumption
-=============================
-
-If your PHP installation is configured with --enable-memory-limit, you
-can display the amount of memory consumed by the entire system using the
-following code in one of your view file::
-
- <?php echo $this->benchmark->memory_usage();?>
-
-.. note:: This function can only be used in your view files. The consumption
- will reflect the total memory used by the entire app.
-
-An alternate way to show your memory usage in your view files is to use
-this pseudo-variable, if you prefer not to use the pure PHP::
-
- {memory_usage}
-
-
-***************
-Class Reference
-***************
-
-.. php:class:: CI_Benchmark
-
- .. php:method:: mark($name)
-
- :param string $name: the name you wish to assign to your marker
- :rtype: void
-
- Sets a benchmark marker.
-
- .. php:method:: elapsed_time([$point1 = ''[, $point2 = ''[, $decimals = 4]]])
-
- :param string $point1: a particular marked point
- :param string $point2: a particular marked point
- :param int $decimals: number of decimal places for precision
- :returns: Elapsed time
- :rtype: string
-
- Calculates and returns the time difference between two marked points.
-
- If the first parameter is empty this function instead returns the
- ``{elapsed_time}`` pseudo-variable. This permits the full system
- execution time to be shown in a template. The output class will
- swap the real value for this variable.
-
-
- .. php:method:: memory_usage()
-
- :returns: Memory usage info
- :rtype: string
-
- Simply returns the ``{memory_usage}`` marker.
-
- This permits it to be put it anywhere in a template without the memory
- being calculated until the end. The :doc:`Output Class <output>` will
- swap the real value for this variable. \ No newline at end of file
diff --git a/user_guide_src/source/libraries/caching.rst b/user_guide_src/source/libraries/caching.rst
deleted file mode 100644
index a7081ec6b..000000000
--- a/user_guide_src/source/libraries/caching.rst
+++ /dev/null
@@ -1,279 +0,0 @@
-##############
-Caching Driver
-##############
-
-CodeIgniter features wrappers around some of the most popular forms of
-fast and dynamic caching. All but file-based caching require specific
-server requirements, and a Fatal Exception will be thrown if server
-requirements are not met.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-*************
-Example Usage
-*************
-
-The following example will load the cache driver, specify `APC <#alternative-php-cache-apc-caching>`_
-as the driver to use, and fall back to file-based caching if APC is not
-available in the hosting environment.
-
-::
-
- $this->load->driver('cache', array('adapter' => 'apc', 'backup' => 'file'));
-
- if ( ! $foo = $this->cache->get('foo'))
- {
- echo 'Saving to the cache!<br />';
- $foo = 'foobarbaz!';
-
- // Save into the cache for 5 minutes
- $this->cache->save('foo', $foo, 300);
- }
-
- echo $foo;
-
-You can also prefix cache item names via the **key_prefix** setting, which is useful
-to avoid collisions when you're running multiple applications on the same environment.
-
-::
-
- $this->load->driver('cache',
- array('adapter' => 'apc', 'backup' => 'file', 'key_prefix' => 'my_')
- );
-
- $this->cache->get('foo'); // Will get the cache entry named 'my_foo'
-
-***************
-Class Reference
-***************
-
-.. php:class:: CI_Cache
-
- .. php:method:: is_supported($driver)
-
- :param string $driver: the name of the caching driver
- :returns: TRUE if supported, FALSE if not
- :rtype: bool
-
- This method is automatically called when accessing drivers via
- ``$this->cache->get()``. However, if the individual drivers are used,
- make sure to call this method to ensure the driver is supported in the
- hosting environment.
- ::
-
- if ($this->cache->apc->is_supported())
- {
- if ($data = $this->cache->apc->get('my_cache'))
- {
- // do things.
- }
- }
-
- .. php:method:: get($id)
-
- :param string $id: Cache item name
- :returns: Item value or FALSE if not found
- :rtype: mixed
-
- This method will attempt to fetch an item from the cache store. If the
- item does not exist, the method will return FALSE.
- ::
-
- $foo = $this->cache->get('my_cached_item');
-
- .. php:method:: save($id, $data[, $ttl = 60[, $raw = FALSE]])
-
- :param string $id: Cache item name
- :param mixed $data: the data to save
- :param int $ttl: Time To Live, in seconds (default 60)
- :param bool $raw: Whether to store the raw value
- :returns: TRUE on success, FALSE on failure
- :rtype: string
-
- This method will save an item to the cache store. If saving fails, the
- method will return FALSE.
- ::
-
- $this->cache->save('cache_item_id', 'data_to_cache');
-
- .. note:: The ``$raw`` parameter is only utilized by APC and Memcache,
- in order to allow usage of ``increment()`` and ``decrement()``.
-
- .. php:method:: delete($id)
-
- :param string $id: name of cached item
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- This method will delete a specific item from the cache store. If item
- deletion fails, the method will return FALSE.
- ::
-
- $this->cache->delete('cache_item_id');
-
- .. php:method:: increment($id[, $offset = 1])
-
- :param string $id: Cache ID
- :param int $offset: Step/value to add
- :returns: New value on success, FALSE on failure
- :rtype: mixed
-
- Performs atomic incrementation of a raw stored value.
- ::
-
- // 'iterator' has a value of 2
-
- $this->cache->increment('iterator'); // 'iterator' is now 3
-
- $this->cache->increment('iterator', 3); // 'iterator' is now 6
-
- .. php:method:: decrement($id[, $offset = 1])
-
- :param string $id: Cache ID
- :param int $offset: Step/value to reduce by
- :returns: New value on success, FALSE on failure
- :rtype: mixed
-
- Performs atomic decrementation of a raw stored value.
- ::
-
- // 'iterator' has a value of 6
-
- $this->cache->decrement('iterator'); // 'iterator' is now 5
-
- $this->cache->decrement('iterator', 2); // 'iterator' is now 3
-
- .. php:method:: clean()
-
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- This method will 'clean' the entire cache. If the deletion of the
- cache files fails, the method will return FALSE.
- ::
-
- $this->cache->clean();
-
- .. php:method:: cache_info()
-
- :returns: Information on the entire cache database
- :rtype: mixed
-
- This method will return information on the entire cache.
- ::
-
- var_dump($this->cache->cache_info());
-
- .. note:: The information returned and the structure of the data is dependent
- on which adapter is being used.
-
- .. php:method:: get_metadata($id)
-
- :param string $id: Cache item name
- :returns: Metadata for the cached item
- :rtype: mixed
-
- This method will return detailed information on a specific item in the
- cache.
- ::
-
- var_dump($this->cache->get_metadata('my_cached_item'));
-
- .. note:: The information returned and the structure of the data is dependent
- on which adapter is being used.
-
-*******
-Drivers
-*******
-
-Alternative PHP Cache (APC) Caching
-===================================
-
-All of the methods listed above can be accessed without passing a
-specific adapter to the driver loader as follows::
-
- $this->load->driver('cache');
- $this->cache->apc->save('foo', 'bar', 10);
-
-For more information on APC, please see
-`http://php.net/apc <http://php.net/apc>`_.
-
-File-based Caching
-==================
-
-Unlike caching from the Output Class, the driver file-based caching
-allows for pieces of view files to be cached. Use this with care, and
-make sure to benchmark your application, as a point can come where disk
-I/O will negate positive gains by caching.
-
-All of the methods listed above can be accessed without passing a
-specific adapter to the driver loader as follows::
-
- $this->load->driver('cache');
- $this->cache->file->save('foo', 'bar', 10);
-
-Memcached Caching
-=================
-
-Multiple Memcached servers can be specified in the memcached.php
-configuration file, located in the _application/config/* directory.
-
-All of the methods listed above can be accessed without passing a
-specific adapter to the driver loader as follows::
-
- $this->load->driver('cache');
- $this->cache->memcached->save('foo', 'bar', 10);
-
-For more information on Memcached, please see
-`http://php.net/memcached <http://php.net/memcached>`_.
-
-WinCache Caching
-================
-
-Under Windows, you can also utilize the WinCache driver.
-
-All of the methods listed above can be accessed without passing a
-specific adapter to the driver loader as follows::
-
- $this->load->driver('cache');
- $this->cache->wincache->save('foo', 'bar', 10);
-
-For more information on WinCache, please see
-`http://php.net/wincache <http://php.net/wincache>`_.
-
-Redis Caching
-=============
-
-Redis is an in-memory key-value store which can operate in LRU cache mode.
-To use it, you need `Redis server and phpredis PHP extension <https://github.com/phpredis/phpredis>`_.
-
-Config options to connect to redis server must be stored in the application/config/redis.php file.
-Available options are::
-
- $config['socket_type'] = 'tcp'; //`tcp` or `unix`
- $config['socket'] = '/var/run/redis.sock'; // in case of `unix` socket type
- $config['host'] = '127.0.0.1';
- $config['password'] = NULL;
- $config['port'] = 6379;
- $config['timeout'] = 0;
-
-All of the methods listed above can be accessed without passing a
-specific adapter to the driver loader as follows::
-
- $this->load->driver('cache');
- $this->cache->redis->save('foo', 'bar', 10);
-
-For more information on Redis, please see
-`http://redis.io <http://redis.io>`_.
-
-Dummy Cache
-===========
-
-This is a caching backend that will always 'miss.' It stores no data,
-but lets you keep your caching code in place in environments that don't
-support your chosen cache. \ No newline at end of file
diff --git a/user_guide_src/source/libraries/calendar.rst b/user_guide_src/source/libraries/calendar.rst
deleted file mode 100644
index 8fdacf1d7..000000000
--- a/user_guide_src/source/libraries/calendar.rst
+++ /dev/null
@@ -1,307 +0,0 @@
-#################
-Calendaring Class
-#################
-
-The Calendar class enables you to dynamically create calendars. Your
-calendars can be formatted through the use of a calendar template,
-allowing 100% control over every aspect of its design. In addition, you
-can pass data to your calendar cells.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-***************************
-Using the Calendaring Class
-***************************
-
-Initializing the Class
-======================
-
-Like most other classes in CodeIgniter, the Calendar class is
-initialized in your controller using the $this->load->library function::
-
- $this->load->library('calendar');
-
-Once loaded, the Calendar object will be available using::
-
- $this->calendar
-
-Displaying a Calendar
-=====================
-
-Here is a very simple example showing how you can display a calendar::
-
- $this->load->library('calendar');
- echo $this->calendar->generate();
-
-The above code will generate a calendar for the current month/year based
-on your server time. To show a calendar for a specific month and year
-you will pass this information to the calendar generating function::
-
- $this->load->library('calendar');
- echo $this->calendar->generate(2006, 6);
-
-The above code will generate a calendar showing the month of June in
-2006. The first parameter specifies the year, the second parameter
-specifies the month.
-
-Passing Data to your Calendar Cells
-===================================
-
-To add data to your calendar cells involves creating an associative
-array in which the keys correspond to the days you wish to populate and
-the array value contains the data. The array is passed to the third
-parameter of the calendar generating function. Consider this example::
-
- $this->load->library('calendar');
-
- $data = array(
- 3 => 'http://example.com/news/article/2006/06/03/',
- 7 => 'http://example.com/news/article/2006/06/07/',
- 13 => 'http://example.com/news/article/2006/06/13/',
- 26 => 'http://example.com/news/article/2006/06/26/'
- );
-
- echo $this->calendar->generate(2006, 6, $data);
-
-Using the above example, day numbers 3, 7, 13, and 26 will become links
-pointing to the URLs you've provided.
-
-.. note:: By default it is assumed that your array will contain links.
- In the section that explains the calendar template below you'll see how
- you can customize how data passed to your cells is handled so you can
- pass different types of information.
-
-Setting Display Preferences
-===========================
-
-There are seven preferences you can set to control various aspects of
-the calendar. Preferences are set by passing an array of preferences in
-the second parameter of the loading function. Here is an example::
-
- $prefs = array(
- 'start_day' => 'saturday',
- 'month_type' => 'long',
- 'day_type' => 'short'
- );
-
- $this->load->library('calendar', $prefs);
-
- echo $this->calendar->generate();
-
-The above code would start the calendar on saturday, use the "long"
-month heading, and the "short" day names. More information regarding
-preferences below.
-
-====================== ================= ============================================ ===================================================================
-Preference Default Options Description
-====================== ================= ============================================ ===================================================================
-**template** None None A string or array containing your calendar template.
- See the template section below.
-**local_time** time() None A Unix timestamp corresponding to the current time.
-**start_day** sunday Any week day (sunday, monday, tuesday, etc.) Sets the day of the week the calendar should start on.
-**month_type** long long, short Determines what version of the month name to use in the header.
- long = January, short = Jan.
-**day_type** abr long, short, abr Determines what version of the weekday names to use in
- the column headers. long = Sunday, short = Sun, abr = Su.
-**show_next_prev** FALSE TRUE/FALSE (boolean) Determines whether to display links allowing you to toggle
- to next/previous months. See information on this feature below.
-**next_prev_url** controller/method A URL Sets the basepath used in the next/previous calendar links.
-**show_other_days** FALSE TRUE/FALSE (boolean) Determines whether to display days of other months that share the
- first or last week of the calendar month.
-====================== ================= ============================================ ===================================================================
-
-
-Showing Next/Previous Month Links
-=================================
-
-To allow your calendar to dynamically increment/decrement via the
-next/previous links requires that you set up your calendar code similar
-to this example::
-
- $prefs = array(
- 'show_next_prev' => TRUE,
- 'next_prev_url' => 'http://example.com/index.php/calendar/show/'
- );
-
- $this->load->library('calendar', $prefs);
-
- echo $this->calendar->generate($this->uri->segment(3), $this->uri->segment(4));
-
-You'll notice a few things about the above example:
-
-- You must set the "show_next_prev" to TRUE.
-- You must supply the URL to the controller containing your calendar in
- the "next_prev_url" preference. If you don't, it will be set to the current
- *controller/method*.
-- You must supply the "year" and "month" to the calendar generating
- function via the URI segments where they appear (Note: The calendar
- class automatically adds the year/month to the base URL you
- provide.).
-
-Creating a Calendar Template
-============================
-
-By creating a calendar template you have 100% control over the design of
-your calendar. Using the string method, each component of your calendar
-will be placed within a pair of pseudo-variables as shown here::
-
- $prefs['template'] = '
-
- {table_open}<table border="0" cellpadding="0" cellspacing="0">{/table_open}
-
- {heading_row_start}<tr>{/heading_row_start}
-
- {heading_previous_cell}<th><a href="{previous_url}">&lt;&lt;</a></th>{/heading_previous_cell}
- {heading_title_cell}<th colspan="{colspan}">{heading}</th>{/heading_title_cell}
- {heading_next_cell}<th><a href="{next_url}">&gt;&gt;</a></th>{/heading_next_cell}
-
- {heading_row_end}</tr>{/heading_row_end}
-
- {week_row_start}<tr>{/week_row_start}
- {week_day_cell}<td>{week_day}</td>{/week_day_cell}
- {week_row_end}</tr>{/week_row_end}
-
- {cal_row_start}<tr>{/cal_row_start}
- {cal_cell_start}<td>{/cal_cell_start}
- {cal_cell_start_today}<td>{/cal_cell_start_today}
- {cal_cell_start_other}<td class="other-month">{/cal_cell_start_other}
-
- {cal_cell_content}<a href="{content}">{day}</a>{/cal_cell_content}
- {cal_cell_content_today}<div class="highlight"><a href="{content}">{day}</a></div>{/cal_cell_content_today}
-
- {cal_cell_no_content}{day}{/cal_cell_no_content}
- {cal_cell_no_content_today}<div class="highlight">{day}</div>{/cal_cell_no_content_today}
-
- {cal_cell_blank}&nbsp;{/cal_cell_blank}
-
- {cal_cell_other}{day}{/cal_cel_other}
-
- {cal_cell_end}</td>{/cal_cell_end}
- {cal_cell_end_today}</td>{/cal_cell_end_today}
- {cal_cell_end_other}</td>{/cal_cell_end_other}
- {cal_row_end}</tr>{/cal_row_end}
-
- {table_close}</table>{/table_close}
- ';
-
- $this->load->library('calendar', $prefs);
-
- echo $this->calendar->generate();
-
-Using the array method, you will pass `key => value` pairs. You can pass as
-many or as few values as you'd like. Omitted keys will use the default values
-inherited in the calendar class.
-
-Example::
-
- $prefs['template'] = array(
- 'table_open' => '<table class="calendar">',
- 'cal_cell_start' => '<td class="day">',
- 'cal_cell_start_today' => '<td class="today">'
- );
-
- $this->load->library('calendar', $prefs);
-
- echo $this->calendar->generate();
-
-***************
-Class Reference
-***************
-
-.. php:class:: CI_Calendar
-
- .. php:method:: initialize([$config = array()])
-
- :param array $config: Configuration parameters
- :returns: CI_Calendar instance (method chaining)
- :rtype: CI_Calendar
-
- Initializes the Calendaring preferences. Accepts an associative array as input, containing display preferences.
-
- .. php:method:: generate([$year = ''[, $month = ''[, $data = array()]]])
-
- :param int $year: Year
- :param int $month: Month
- :param array $data: Data to be shown in the calendar cells
- :returns: HTML-formatted calendar
- :rtype: string
-
- Generate the calendar.
-
-
- .. php:method:: get_month_name($month)
-
- :param int $month: Month
- :returns: Month name
- :rtype: string
-
- Generates a textual month name based on the numeric month provided.
-
- .. php:method:: get_day_names($day_type = '')
-
- :param string $day_type: 'long', 'short', or 'abr'
- :returns: Array of day names
- :rtype: array
-
- Returns an array of day names (Sunday, Monday, etc.) based on the type
- provided. Options: long, short, abr. If no ``$day_type`` is provided (or
- if an invalid type is provided) this method will return the "abbreviated"
- style.
-
- .. php:method:: adjust_date($month, $year)
-
- :param int $month: Month
- :param int $year: Year
- :returns: An associative array containing month and year
- :rtype: array
-
- This method makes sure that you have a valid month/year. For example, if
- you submit 13 as the month, the year will increment and the month will
- become January::
-
- print_r($this->calendar->adjust_date(13, 2014));
-
- outputs::
-
- Array
- (    
- [month] => '01'
- [year] => '2015'
- )
-
- .. php:method:: get_total_days($month, $year)
-
- :param int $month: Month
- :param int $year: Year
- :returns: Count of days in the specified month
- :rtype: int
-
- Total days in a given month::
-
- echo $this->calendar->get_total_days(2, 2012);
- // 29
-
- .. note:: This method is an alias for :doc:`Date Helper
- <../helpers/date_helper>` function :php:func:`days_in_month()`.
-
- .. php:method:: default_template()
-
- :returns: An array of template values
- :rtype: array
-
- Sets the default template. This method is used when you have not created
- your own template.
-
-
- .. php:method:: parse_template()
-
- :returns: CI_Calendar instance (method chaining)
- :rtype: CI_Calendar
-
- Harvests the data within the template ``{pseudo-variables}`` used to
- display the calendar.
diff --git a/user_guide_src/source/libraries/cart.rst b/user_guide_src/source/libraries/cart.rst
deleted file mode 100644
index be343320d..000000000
--- a/user_guide_src/source/libraries/cart.rst
+++ /dev/null
@@ -1,398 +0,0 @@
-###################
-Shopping Cart Class
-###################
-
-The Cart Class permits items to be added to a session that stays active
-while a user is browsing your site. These items can be retrieved and
-displayed in a standard "shopping cart" format, allowing the user to
-update the quantity or remove items from the cart.
-
-.. important:: The Cart library is DEPRECATED and should not be used.
- It is currently only kept for backwards compatibility.
-
-Please note that the Cart Class ONLY provides the core "cart"
-functionality. It does not provide shipping, credit card authorization,
-or other processing components.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-********************
-Using the Cart Class
-********************
-
-Initializing the Shopping Cart Class
-====================================
-
-.. important:: The Cart class utilizes CodeIgniter's :doc:`Session
- Class <sessions>` to save the cart information to a database, so
- before using the Cart class you must set up a database table as
- indicated in the :doc:`Session Documentation <sessions>`, and set the
- session preferences in your application/config/config.php file to
- utilize a database.
-
-To initialize the Shopping Cart Class in your controller constructor,
-use the ``$this->load->library()`` method::
-
- $this->load->library('cart');
-
-Once loaded, the Cart object will be available using::
-
- $this->cart
-
-.. note:: The Cart Class will load and initialize the Session Class
- automatically, so unless you are using sessions elsewhere in your
- application, you do not need to load the Session class.
-
-Adding an Item to The Cart
-==========================
-
-To add an item to the shopping cart, simply pass an array with the
-product information to the ``$this->cart->insert()`` method, as shown
-below::
-
- $data = array(
- 'id' => 'sku_123ABC',
- 'qty' => 1,
- 'price' => 39.95,
- 'name' => 'T-Shirt',
- 'options' => array('Size' => 'L', 'Color' => 'Red')
- );
-
- $this->cart->insert($data);
-
-.. important:: The first four array indexes above (id, qty, price, and
- name) are **required**. If you omit any of them the data will not be
- saved to the cart. The fifth index (options) is optional. It is intended
- to be used in cases where your product has options associated with it.
- Use an array for options, as shown above.
-
-The five reserved indexes are:
-
-- **id** - Each product in your store must have a unique identifier.
- Typically this will be an "sku" or other such identifier.
-- **qty** - The quantity being purchased.
-- **price** - The price of the item.
-- **name** - The name of the item.
-- **options** - Any additional attributes that are needed to identify
- the product. These must be passed via an array.
-
-In addition to the five indexes above, there are two reserved words:
-rowid and subtotal. These are used internally by the Cart class, so
-please do NOT use those words as index names when inserting data into
-the cart.
-
-Your array may contain additional data. Anything you include in your
-array will be stored in the session. However, it is best to standardize
-your data among all your products in order to make displaying the
-information in a table easier.
-
-::
-
- $data = array(
- 'id' => 'sku_123ABC',
- 'qty' => 1,
- 'price' => 39.95,
- 'name' => 'T-Shirt',
- 'coupon' => 'XMAS-50OFF'
- );
-
- $this->cart->insert($data);
-
-The ``insert()`` method will return the $rowid if you successfully insert a
-single item.
-
-Adding Multiple Items to The Cart
-=================================
-
-By using a multi-dimensional array, as shown below, it is possible to
-add multiple products to the cart in one action. This is useful in cases
-where you wish to allow people to select from among several items on the
-same page.
-
-::
-
- $data = array(
- array(
- 'id' => 'sku_123ABC',
- 'qty' => 1,
- 'price' => 39.95,
- 'name' => 'T-Shirt',
- 'options' => array('Size' => 'L', 'Color' => 'Red')
- ),
- array(
- 'id' => 'sku_567ZYX',
- 'qty' => 1,
- 'price' => 9.95,
- 'name' => 'Coffee Mug'
- ),
- array(
- 'id' => 'sku_965QRS',
- 'qty' => 1,
- 'price' => 29.95,
- 'name' => 'Shot Glass'
- )
- );
-
- $this->cart->insert($data);
-
-Displaying the Cart
-===================
-
-To display the cart you will create a :doc:`view
-file </general/views>` with code similar to the one shown below.
-
-Please note that this example uses the :doc:`form
-helper </helpers/form_helper>`.
-
-::
-
- <?php echo form_open('path/to/controller/update/method'); ?>
-
- <table cellpadding="6" cellspacing="1" style="width:100%" border="0">
-
- <tr>
- <th>QTY</th>
- <th>Item Description</th>
- <th style="text-align:right">Item Price</th>
- <th style="text-align:right">Sub-Total</th>
- </tr>
-
- <?php $i = 1; ?>
-
- <?php foreach ($this->cart->contents() as $items): ?>
-
- <?php echo form_hidden($i.'[rowid]', $items['rowid']); ?>
-
- <tr>
- <td><?php echo form_input(array('name' => $i.'[qty]', 'value' => $items['qty'], 'maxlength' => '3', 'size' => '5')); ?></td>
- <td>
- <?php echo $items['name']; ?>
-
- <?php if ($this->cart->has_options($items['rowid']) == TRUE): ?>
-
- <p>
- <?php foreach ($this->cart->product_options($items['rowid']) as $option_name => $option_value): ?>
-
- <strong><?php echo $option_name; ?>:</strong> <?php echo $option_value; ?><br />
-
- <?php endforeach; ?>
- </p>
-
- <?php endif; ?>
-
- </td>
- <td style="text-align:right"><?php echo $this->cart->format_number($items['price']); ?></td>
- <td style="text-align:right">$<?php echo $this->cart->format_number($items['subtotal']); ?></td>
- </tr>
-
- <?php $i++; ?>
-
- <?php endforeach; ?>
-
- <tr>
- <td colspan="2"> </td>
- <td class="right"><strong>Total</strong></td>
- <td class="right">$<?php echo $this->cart->format_number($this->cart->total()); ?></td>
- </tr>
-
- </table>
-
- <p><?php echo form_submit('', 'Update your Cart'); ?></p>
-
-Updating The Cart
-=================
-
-To update the information in your cart, you must pass an array
-containing the Row ID and one or more pre-defined properties to the
-``$this->cart->update()`` method.
-
-.. note:: If the quantity is set to zero, the item will be removed from
- the cart.
-
-::
-
- $data = array(
- 'rowid' => 'b99ccdf16028f015540f341130b6d8ec',
- 'qty' => 3
- );
-
- $this->cart->update($data);
-
- // Or a multi-dimensional array
-
- $data = array(
- array(
- 'rowid' => 'b99ccdf16028f015540f341130b6d8ec',
- 'qty' => 3
- ),
- array(
- 'rowid' => 'xw82g9q3r495893iajdh473990rikw23',
- 'qty' => 4
- ),
- array(
- 'rowid' => 'fh4kdkkkaoe30njgoe92rkdkkobec333',
- 'qty' => 2
- )
- );
-
- $this->cart->update($data);
-
-You may also update any property you have previously defined when
-inserting the item such as options, price or other custom fields.
-
-::
-
- $data = array(
- 'rowid' => 'b99ccdf16028f015540f341130b6d8ec',
- 'qty' => 1,
- 'price' => 49.95,
- 'coupon' => NULL
- );
-
- $this->cart->update($data);
-
-What is a Row ID?
-*****************
-
-The row ID is a unique identifier that is generated by the cart code
-when an item is added to the cart. The reason a unique ID is created
-is so that identical products with different options can be managed
-by the cart.
-
-For example, let's say someone buys two identical t-shirts (same product
-ID), but in different sizes. The product ID (and other attributes) will
-be identical for both sizes because it's the same shirt. The only
-difference will be the size. The cart must therefore have a means of
-identifying this difference so that the two sizes of shirts can be
-managed independently. It does so by creating a unique "row ID" based on
-the product ID and any options associated with it.
-
-In nearly all cases, updating the cart will be something the user does
-via the "view cart" page, so as a developer, it is unlikely that you
-will ever have to concern yourself with the "row ID", other than making
-sure your "view cart" page contains this information in a hidden form
-field, and making sure it gets passed to the ``update()`` method when
-the update form is submitted. Please examine the construction of the
-"view cart" page above for more information.
-
-
-***************
-Class Reference
-***************
-
-.. php:class:: CI_Cart
-
- .. attribute:: $product_id_rules = '\.a-z0-9_-'
-
- These are the regular expression rules that we use to validate the product
- ID - alpha-numeric, dashes, underscores, or periods by default
-
- .. attribute:: $product_name_rules = '\w \-\.\:'
-
- These are the regular expression rules that we use to validate the product ID and product name - alpha-numeric, dashes, underscores, colons or periods by
- default
-
- .. attribute:: $product_name_safe = TRUE
-
- Whether or not to only allow safe product names. Default TRUE.
-
-
- .. php:method:: insert([$items = array()])
-
- :param array $items: Items to insert into the cart
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Insert items into the cart and save it to the session table. Returns TRUE
- on success and FALSE on failure.
-
-
- .. php:method:: update([$items = array()])
-
- :param array $items: Items to update in the cart
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- This method permits changing the properties of a given item.
- Typically it is called from the "view cart" page if a user makes changes
- to the quantity before checkout. That array must contain the rowid
- for each item.
-
- .. php:method:: remove($rowid)
-
- :param int $rowid: ID of the item to remove from the cart
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Allows you to remove an item from the shopping cart by passing it the
- ``$rowid``.
-
- .. php:method:: total()
-
- :returns: Total amount
- :rtype: int
-
- Displays the total amount in the cart.
-
-
- .. php:method:: total_items()
-
- :returns: Total amount of items in the cart
- :rtype: int
-
- Displays the total number of items in the cart.
-
-
- .. php:method:: contents([$newest_first = FALSE])
-
- :param bool $newest_first: Whether to order the array with newest items first
- :returns: An array of cart contents
- :rtype: array
-
- Returns an array containing everything in the cart. You can sort the
- order by which the array is returned by passing it TRUE where the contents
- will be sorted from newest to oldest, otherwise it is sorted from oldest
- to newest.
-
- .. php:method:: get_item($row_id)
-
- :param int $row_id: Row ID to retrieve
- :returns: Array of item data
- :rtype: array
-
- Returns an array containing data for the item matching the specified row
- ID, or FALSE if no such item exists.
-
- .. php:method:: has_options($row_id = '')
-
- :param int $row_id: Row ID to inspect
- :returns: TRUE if options exist, FALSE otherwise
- :rtype: bool
-
- Returns TRUE (boolean) if a particular row in the cart contains options.
- This method is designed to be used in a loop with ``contents()``, since
- you must pass the rowid to this method, as shown in the Displaying
- the Cart example above.
-
- .. php:method:: product_options([$row_id = ''])
-
- :param int $row_id: Row ID
- :returns: Array of product options
- :rtype: array
-
- Returns an array of options for a particular product. This method is
- designed to be used in a loop with ``contents()``, since you
- must pass the rowid to this method, as shown in the Displaying the
- Cart example above.
-
- .. php:method:: destroy()
-
- :rtype: void
-
- Permits you to destroy the cart. This method will likely be called
- when you are finished processing the customer's order. \ No newline at end of file
diff --git a/user_guide_src/source/libraries/config.rst b/user_guide_src/source/libraries/config.rst
deleted file mode 100644
index fe2e0a99d..000000000
--- a/user_guide_src/source/libraries/config.rst
+++ /dev/null
@@ -1,252 +0,0 @@
-############
-Config Class
-############
-
-The Config class provides a means to retrieve configuration preferences.
-These preferences can come from the default config file
-(application/config/config.php) or from your own custom config files.
-
-.. note:: This class is initialized automatically by the system so there
- is no need to do it manually.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-*****************************
-Working with the Config Class
-*****************************
-
-Anatomy of a Config File
-========================
-
-By default, CodeIgniter has one primary config file, located at
-application/config/config.php. If you open the file using your text
-editor you'll see that config items are stored in an array called
-$config.
-
-You can add your own config items to this file, or if you prefer to keep
-your configuration items separate (assuming you even need config items),
-simply create your own file and save it in config folder.
-
-.. note:: If you do create your own config files use the same format as
- the primary one, storing your items in an array called $config.
- CodeIgniter will intelligently manage these files so there will be no
- conflict even though the array has the same name (assuming an array
- index is not named the same as another).
-
-Loading a Config File
-=====================
-
-.. note::
- CodeIgniter automatically loads the primary config file
- (application/config/config.php), so you will only need to load a config
- file if you have created your own.
-
-There are two ways to load a config file:
-
-Manual Loading
-**************
-
-To load one of your custom config files you will use the following
-function within the :doc:`controller </general/controllers>` that
-needs it::
-
- $this->config->load('filename');
-
-Where filename is the name of your config file, without the .php file
-extension.
-
-If you need to load multiple config files normally they will be
-merged into one master config array. Name collisions can occur,
-however, if you have identically named array indexes in different
-config files. To avoid collisions you can set the second parameter to
-TRUE and each config file will be stored in an array index
-corresponding to the name of the config file. Example::
-
- // Stored in an array with this prototype: $this->config['blog_settings'] = $config
- $this->config->load('blog_settings', TRUE);
-
-Please see the section entitled Fetching Config Items below to learn
-how to retrieve config items set this way.
-
-The third parameter allows you to suppress errors in the event that a
-config file does not exist::
-
- $this->config->load('blog_settings', FALSE, TRUE);
-
-Auto-loading
-************
-
-If you find that you need a particular config file globally, you can
-have it loaded automatically by the system. To do this, open the
-**autoload.php** file, located at application/config/autoload.php,
-and add your config file as indicated in the file.
-
-
-Fetching Config Items
-=====================
-
-To retrieve an item from your config file, use the following function::
-
- $this->config->item('item_name');
-
-Where item_name is the $config array index you want to retrieve. For
-example, to fetch your language choice you'll do this::
-
- $lang = $this->config->item('language');
-
-The function returns NULL if the item you are trying to fetch
-does not exist.
-
-If you are using the second parameter of the $this->config->load
-function in order to assign your config items to a specific index you
-can retrieve it by specifying the index name in the second parameter of
-the $this->config->item() function. Example::
-
- // Loads a config file named blog_settings.php and assigns it to an index named "blog_settings"
- $this->config->load('blog_settings', TRUE);
-
- // Retrieve a config item named site_name contained within the blog_settings array
- $site_name = $this->config->item('site_name', 'blog_settings');
-
- // An alternate way to specify the same item:
- $blog_config = $this->config->item('blog_settings');
- $site_name = $blog_config['site_name'];
-
-Setting a Config Item
-=====================
-
-If you would like to dynamically set a config item or change an existing
-one, you can do so using::
-
- $this->config->set_item('item_name', 'item_value');
-
-Where item_name is the $config array index you want to change, and
-item_value is its value.
-
-.. _config-environments:
-
-Environments
-============
-
-You may load different configuration files depending on the current
-environment. The ENVIRONMENT constant is defined in index.php, and is
-described in detail in the :doc:`Handling
-Environments </general/environments>` section.
-
-To create an environment-specific configuration file, create or copy a
-configuration file in application/config/{ENVIRONMENT}/{FILENAME}.php
-
-For example, to create a production-only config.php, you would:
-
-#. Create the directory application/config/production/
-#. Copy your existing config.php into the above directory
-#. Edit application/config/production/config.php so it contains your
- production settings
-
-When you set the ENVIRONMENT constant to 'production', the settings for
-your new production-only config.php will be loaded.
-
-You can place the following configuration files in environment-specific
-folders:
-
-- Default CodeIgniter configuration files
-- Your own custom configuration files
-
-.. note::
- CodeIgniter always loads the global config file first (i.e., the one in application/config/),
- then tries to load the configuration files for the current environment.
- This means you are not obligated to place **all** of your configuration files in an
- environment folder. Only the files that change per environment. Additionally you don't
- have to copy **all** the config items in the environment config file. Only the config items
- that you wish to change for your environment. The config items declared in your environment
- folders always overwrite those in your global config files.
-
-
-***************
-Class Reference
-***************
-
-.. php:class:: CI_Config
-
- .. attribute:: $config
-
- Array of all loaded config values
-
- .. attribute:: $is_loaded
-
- Array of all loaded config files
-
-
- .. php:method:: item($item[, $index=''])
-
- :param string $item: Config item name
- :param string $index: Index name
- :returns: Config item value or NULL if not found
- :rtype: mixed
-
- Fetch a config file item.
-
- .. php:method:: set_item($item, $value)
-
- :param string $item: Config item name
- :param string $value: Config item value
- :rtype: void
-
- Sets a config file item to the specified value.
-
- .. php:method:: slash_item($item)
-
- :param string $item: config item name
- :returns: Config item value with a trailing forward slash or NULL if not found
- :rtype: mixed
-
- This method is identical to ``item()``, except it appends a forward
- slash to the end of the item, if it exists.
-
- .. php:method:: load([$file = ''[, $use_sections = FALSE[, $fail_gracefully = FALSE]]])
-
- :param string $file: Configuration file name
- :param bool $use_sections: Whether config values should be loaded into their own section (index of the main config array)
- :param bool $fail_gracefully: Whether to return FALSE or to display an error message
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Loads a configuration file.
-
- .. php:method:: site_url()
-
- :returns: Site URL
- :rtype: string
-
- This method retrieves the URL to your site, along with the "index" value
- you've specified in the config file.
-
- This method is normally accessed via the corresponding functions in the
- :doc:`URL Helper </helpers/url_helper>`.
-
- .. php:method:: base_url()
-
- :returns: Base URL
- :rtype: string
-
- This method retrieves the URL to your site, plus an optional path such
- as to a stylesheet or image.
-
- This method is normally accessed via the corresponding functions in the
- :doc:`URL Helper </helpers/url_helper>`.
-
- .. php:method:: system_url()
-
- :returns: URL pointing at your CI system/ directory
- :rtype: string
-
- This method retrieves the URL to your CodeIgniter system/ directory.
-
- .. note:: This method is DEPRECATED because it encourages usage of
- insecure coding practices. Your *system/* directory shouldn't
- be publicly accessible. \ No newline at end of file
diff --git a/user_guide_src/source/libraries/email.rst b/user_guide_src/source/libraries/email.rst
deleted file mode 100644
index 1be6e2adb..000000000
--- a/user_guide_src/source/libraries/email.rst
+++ /dev/null
@@ -1,405 +0,0 @@
-###########
-Email Class
-###########
-
-CodeIgniter's robust Email Class supports the following features:
-
-- Multiple Protocols: Mail, Sendmail, and SMTP
-- TLS and SSL Encryption for SMTP
-- Multiple recipients
-- CC and BCCs
-- HTML or Plaintext email
-- Attachments
-- Word wrapping
-- Priorities
-- BCC Batch Mode, enabling large email lists to be broken into small
- BCC batches.
-- Email Debugging tools
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-***********************
-Using the Email Library
-***********************
-
-Sending Email
-=============
-
-Sending email is not only simple, but you can configure it on the fly or
-set your preferences in a config file.
-
-Here is a basic example demonstrating how you might send email. Note:
-This example assumes you are sending the email from one of your
-:doc:`controllers <../general/controllers>`.
-
-::
-
- $this->load->library('email');
-
- $this->email->from('your@example.com', 'Your Name');
- $this->email->to('someone@example.com');
- $this->email->cc('another@another-example.com');
- $this->email->bcc('them@their-example.com');
-
- $this->email->subject('Email Test');
- $this->email->message('Testing the email class.');
-
- $this->email->send();
-
-Setting Email Preferences
-=========================
-
-There are 21 different preferences available to tailor how your email
-messages are sent. You can either set them manually as described here,
-or automatically via preferences stored in your config file, described
-below:
-
-Preferences are set by passing an array of preference values to the
-email initialize method. Here is an example of how you might set some
-preferences::
-
- $config['protocol'] = 'sendmail';
- $config['mailpath'] = '/usr/sbin/sendmail';
- $config['charset'] = 'iso-8859-1';
- $config['wordwrap'] = TRUE;
-
- $this->email->initialize($config);
-
-.. note:: Most of the preferences have default values that will be used
- if you do not set them.
-
-Setting Email Preferences in a Config File
-------------------------------------------
-
-If you prefer not to set preferences using the above method, you can
-instead put them into a config file. Simply create a new file called the
-email.php, add the $config array in that file. Then save the file at
-config/email.php and it will be used automatically. You will NOT need to
-use the ``$this->email->initialize()`` method if you save your
-preferences in a config file.
-
-Email Preferences
-=================
-
-The following is a list of all the preferences that can be set when
-sending email.
-
-=================== ====================== ============================ =======================================================================
-Preference Default Value Options Description
-=================== ====================== ============================ =======================================================================
-**useragent** CodeIgniter None The "user agent".
-**protocol** mail mail, sendmail, or smtp The mail sending protocol.
-**mailpath** /usr/sbin/sendmail None The server path to Sendmail.
-**smtp_host** No Default None SMTP Server Address.
-**smtp_user** No Default None SMTP Username.
-**smtp_pass** No Default None SMTP Password.
-**smtp_port** 25 None SMTP Port.
-**smtp_timeout** 5 None SMTP Timeout (in seconds).
-**smtp_keepalive** FALSE TRUE or FALSE (boolean) Enable persistent SMTP connections.
-**smtp_crypto** No Default tls or ssl SMTP Encryption
-**wordwrap** TRUE TRUE or FALSE (boolean) Enable word-wrap.
-**wrapchars** 76 Character count to wrap at.
-**mailtype** text text or html Type of mail. If you send HTML email you must send it as a complete web
- page. Make sure you don't have any relative links or relative image
- paths otherwise they will not work.
-**charset** ``$config['charset']`` Character set (utf-8, iso-8859-1, etc.).
-**validate** FALSE TRUE or FALSE (boolean) Whether to validate the email address.
-**priority** 3 1, 2, 3, 4, 5 Email Priority. 1 = highest. 5 = lowest. 3 = normal.
-**crlf** \\n "\\r\\n" or "\\n" or "\\r" Newline character. (Use "\\r\\n" to comply with RFC 822).
-**newline** \\n "\\r\\n" or "\\n" or "\\r" Newline character. (Use "\\r\\n" to comply with RFC 822).
-**bcc_batch_mode** FALSE TRUE or FALSE (boolean) Enable BCC Batch Mode.
-**bcc_batch_size** 200 None Number of emails in each BCC batch.
-**dsn** FALSE TRUE or FALSE (boolean) Enable notify message from server
-=================== ====================== ============================ =======================================================================
-
-Overriding Word Wrapping
-========================
-
-If you have word wrapping enabled (recommended to comply with RFC 822)
-and you have a very long link in your email it can get wrapped too,
-causing it to become un-clickable by the person receiving it.
-CodeIgniter lets you manually override word wrapping within part of your
-message like this::
-
- The text of your email that
- gets wrapped normally.
-
- {unwrap}http://example.com/a_long_link_that_should_not_be_wrapped.html{/unwrap}
-
- More text that will be
- wrapped normally.
-
-
-Place the item you do not want word-wrapped between: {unwrap} {/unwrap}
-
-***************
-Class Reference
-***************
-
-.. php:class:: CI_Email
-
- .. php:method:: from($from[, $name = ''[, $return_path = NULL]])
-
- :param string $from: "From" e-mail address
- :param string $name: "From" display name
- :param string $return_path: Optional email address to redirect undelivered e-mail to
- :returns: CI_Email instance (method chaining)
- :rtype: CI_Email
-
- Sets the email address and name of the person sending the email::
-
- $this->email->from('you@example.com', 'Your Name');
-
- You can also set a Return-Path, to help redirect undelivered mail::
-
- $this->email->from('you@example.com', 'Your Name', 'returned_emails@example.com');
-
- .. note:: Return-Path can't be used if you've configured 'smtp' as
- your protocol.
-
- .. php:method:: reply_to($replyto[, $name = ''])
-
- :param string $replyto: E-mail address for replies
- :param string $name: Display name for the reply-to e-mail address
- :returns: CI_Email instance (method chaining)
- :rtype: CI_Email
-
- Sets the reply-to address. If the information is not provided the
- information in the :meth:from method is used. Example::
-
- $this->email->reply_to('you@example.com', 'Your Name');
-
- .. php:method:: to($to)
-
- :param mixed $to: Comma-delimited string or an array of e-mail addresses
- :returns: CI_Email instance (method chaining)
- :rtype: CI_Email
-
- Sets the email address(s) of the recipient(s). Can be a single e-mail,
- a comma-delimited list or an array::
-
- $this->email->to('someone@example.com');
-
- ::
-
- $this->email->to('one@example.com, two@example.com, three@example.com');
-
- ::
-
- $this->email->to(
- array('one@example.com', 'two@example.com', 'three@example.com')
- );
-
- .. php:method:: cc($cc)
-
- :param mixed $cc: Comma-delimited string or an array of e-mail addresses
- :returns: CI_Email instance (method chaining)
- :rtype: CI_Email
-
- Sets the CC email address(s). Just like the "to", can be a single e-mail,
- a comma-delimited list or an array.
-
- .. php:method:: bcc($bcc[, $limit = ''])
-
- :param mixed $bcc: Comma-delimited string or an array of e-mail addresses
- :param int $limit: Maximum number of e-mails to send per batch
- :returns: CI_Email instance (method chaining)
- :rtype: CI_Email
-
- Sets the BCC email address(s). Just like the ``to()`` method, can be a single
- e-mail, a comma-delimited list or an array.
-
- If ``$limit`` is set, "batch mode" will be enabled, which will send
- the emails to batches, with each batch not exceeding the specified
- ``$limit``.
-
- .. php:method:: subject($subject)
-
- :param string $subject: E-mail subject line
- :returns: CI_Email instance (method chaining)
- :rtype: CI_Email
-
- Sets the email subject::
-
- $this->email->subject('This is my subject');
-
- .. php:method:: message($body)
-
- :param string $body: E-mail message body
- :returns: CI_Email instance (method chaining)
- :rtype: CI_Email
-
- Sets the e-mail message body::
-
- $this->email->message('This is my message');
-
- .. php:method:: set_alt_message($str)
-
- :param string $str: Alternative e-mail message body
- :returns: CI_Email instance (method chaining)
- :rtype: CI_Email
-
- Sets the alternative e-mail message body::
-
- $this->email->set_alt_message('This is the alternative message');
-
- This is an optional message string which can be used if you send
- HTML formatted email. It lets you specify an alternative message
- with no HTML formatting which is added to the header string for
- people who do not accept HTML email. If you do not set your own
- message CodeIgniter will extract the message from your HTML email
- and strip the tags.
-
- .. php:method:: set_header($header, $value)
-
- :param string $header: Header name
- :param string $value: Header value
- :returns: CI_Email instance (method chaining)
- :rtype: CI_Email
-
- Appends additional headers to the e-mail::
-
- $this->email->set_header('Header1', 'Value1');
- $this->email->set_header('Header2', 'Value2');
-
- .. php:method:: clear([$clear_attachments = FALSE])
-
- :param bool $clear_attachments: Whether or not to clear attachments
- :returns: CI_Email instance (method chaining)
- :rtype: CI_Email
-
- Initializes all the email variables to an empty state. This method
- is intended for use if you run the email sending method in a loop,
- permitting the data to be reset between cycles.
-
- ::
-
- foreach ($list as $name => $address)
- {
- $this->email->clear();
-
- $this->email->to($address);
- $this->email->from('your@example.com');
- $this->email->subject('Here is your info '.$name);
- $this->email->message('Hi '.$name.' Here is the info you requested.');
- $this->email->send();
- }
-
- If you set the parameter to TRUE any attachments will be cleared as
- well::
-
- $this->email->clear(TRUE);
-
- .. php:method:: send([$auto_clear = TRUE])
-
- :param bool $auto_clear: Whether to clear message data automatically
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- The e-mail sending method. Returns boolean TRUE or FALSE based on
- success or failure, enabling it to be used conditionally::
-
- if ( ! $this->email->send())
- {
- // Generate error
- }
-
- This method will automatically clear all parameters if the request was
- successful. To stop this behaviour pass FALSE::
-
- if ($this->email->send(FALSE))
- {
- // Parameters won't be cleared
- }
-
- .. note:: In order to use the ``print_debugger()`` method, you need
- to avoid clearing the email parameters.
-
- .. php:method:: attach($filename[, $disposition = ''[, $newname = NULL[, $mime = '']]])
-
- :param string $filename: File name
- :param string $disposition: 'disposition' of the attachment. Most
- email clients make their own decision regardless of the MIME
- specification used here. https://www.iana.org/assignments/cont-disp/cont-disp.xhtml
- :param string $newname: Custom file name to use in the e-mail
- :param string $mime: MIME type to use (useful for buffered data)
- :returns: CI_Email instance (method chaining)
- :rtype: CI_Email
-
- Enables you to send an attachment. Put the file path/name in the first
- parameter. For multiple attachments use the method multiple times.
- For example::
-
- $this->email->attach('/path/to/photo1.jpg');
- $this->email->attach('/path/to/photo2.jpg');
- $this->email->attach('/path/to/photo3.jpg');
-
- To use the default disposition (attachment), leave the second parameter blank,
- otherwise use a custom disposition::
-
- $this->email->attach('image.jpg', 'inline');
-
- You can also use a URL::
-
- $this->email->attach('http://example.com/filename.pdf');
-
- If you'd like to use a custom file name, you can use the third parameter::
-
- $this->email->attach('filename.pdf', 'attachment', 'report.pdf');
-
- If you need to use a buffer string instead of a real - physical - file you can
- use the first parameter as buffer, the third parameter as file name and the fourth
- parameter as mime-type::
-
- $this->email->attach($buffer, 'attachment', 'report.pdf', 'application/pdf');
-
- .. php:method:: attachment_cid($filename)
-
- :param string $filename: Existing attachment filename
- :returns: Attachment Content-ID or FALSE if not found
- :rtype: string
-
- Sets and returns an attachment's Content-ID, which enables your to embed an inline
- (picture) attachment into HTML. First parameter must be the already attached file name.
- ::
-
- $filename = '/img/photo1.jpg';
- $this->email->attach($filename);
- foreach ($list as $address)
- {
- $this->email->to($address);
- $cid = $this->email->attachment_cid($filename);
- $this->email->message('<img src="cid:'. $cid .'" alt="photo1" />');
- $this->email->send();
- }
-
- .. note:: Content-ID for each e-mail must be re-created for it to be unique.
-
- .. php:method:: print_debugger([$include = array('headers', 'subject', 'body')])
-
- :param array $include: Which parts of the message to print out
- :returns: Formatted debug data
- :rtype: string
-
- Returns a string containing any server messages, the email headers, and
- the email message. Useful for debugging.
-
- You can optionally specify which parts of the message should be printed.
- Valid options are: **headers**, **subject**, **body**.
-
- Example::
-
- // You need to pass FALSE while sending in order for the email data
- // to not be cleared - if that happens, print_debugger() would have
- // nothing to output.
- $this->email->send(FALSE);
-
- // Will only print the email headers, excluding the message subject and body
- $this->email->print_debugger(array('headers'));
-
- .. note:: By default, all of the raw data will be printed. \ No newline at end of file
diff --git a/user_guide_src/source/libraries/encrypt.rst b/user_guide_src/source/libraries/encrypt.rst
deleted file mode 100644
index 67e2a0190..000000000
--- a/user_guide_src/source/libraries/encrypt.rst
+++ /dev/null
@@ -1,198 +0,0 @@
-#############
-Encrypt Class
-#############
-
-The Encrypt Class provides two-way data encryption. It encrypted using
-the Mcrypt PHP extension, which is required for the Encrypt Class to run.
-
-.. important:: This library has been DEPRECATED and is only kept for
- backwards compatibility. Please use the new :doc:`Encryption Library
- <encryption>`.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-*************************
-Using the Encrypt Library
-*************************
-
-Setting your Key
-================
-
-A *key* is a piece of information that controls the cryptographic
-process and permits an encrypted string to be decoded. In fact, the key
-you chose will provide the **only** means to decode data that was
-encrypted with that key, so not only must you choose the key carefully,
-you must never change it if you intend use it for persistent data.
-
-It goes without saying that you should guard your key carefully. Should
-someone gain access to your key, the data will be easily decoded. If
-your server is not totally under your control it's impossible to ensure
-key security so you may want to think carefully before using it for
-anything that requires high security, like storing credit card numbers.
-
-To take maximum advantage of the encryption algorithm, your key should
-be 32 characters in length (256 bits). The key should be as random a
-string as you can concoct, with numbers and uppercase and lowercase
-letters. Your key should **not** be a simple text string. In order to be
-cryptographically secure it needs to be as random as possible.
-
-Your key can be either stored in your **application/config/config.php**, or
-you can design your own storage mechanism and pass the key dynamically
-when encoding/decoding.
-
-To save your key to your **application/config/config.php**, open the file
-and set::
-
- $config['encryption_key'] = "YOUR KEY";
-
-Message Length
-==============
-
-It's important for you to know that the encoded messages the encryption
-function generates will be approximately 2.6 times longer than the
-original message. For example, if you encrypt the string "my super
-secret data", which is 21 characters in length, you'll end up with an
-encoded string that is roughly 55 characters (we say "roughly" because
-the encoded string length increments in 64 bit clusters, so it's not
-exactly linear). Keep this information in mind when selecting your data
-storage mechanism. Cookies, for example, can only hold 4K of
-information.
-
-Initializing the Class
-======================
-
-Like most other classes in CodeIgniter, the Encrypt class is
-initialized in your controller using the ``$this->load->library()``
-method::
-
- $this->load->library('encrypt');
-
-Once loaded, the Encrypt library object will be available using::
-
- $this->encrypt
-
-***************
-Class Reference
-***************
-
-.. php:class:: CI_Encrypt
-
- .. php:method:: encode($string[, $key = ''])
-
- :param string $string: Data to encrypt
- :param string $key: Encryption key
- :returns: Encrypted string
- :rtype: string
-
- Performs the data encryption and returns it as a string. Example::
-
- $msg = 'My secret message';
-
- $encrypted_string = $this->encrypt->encode($msg);
-
- You can optionally pass your encryption key via the second parameter if
- you don't want to use the one in your config file::
-
- $msg = 'My secret message';
- $key = 'super-secret-key';
-
- $encrypted_string = $this->encrypt->encode($msg, $key);
-
- .. php:method:: decode($string[, $key = ''])
-
- :param string $string: String to decrypt
- :param string $key: Encryption key
- :returns: Plain-text string
- :rtype: string
-
- Decrypts an encoded string. Example::
-
- $encrypted_string = 'APANtByIGI1BpVXZTJgcsAG8GZl8pdwwa84';
-
- $plaintext_string = $this->encrypt->decode($encrypted_string);
-
- You can optionally pass your encryption key via the second parameter if
- you don't want to use the one in your config file::
-
- $msg = 'My secret message';
- $key = 'super-secret-key';
-
- $encrypted_string = $this->encrypt->decode($msg, $key);
-
- .. php:method:: set_cipher($cipher)
-
- :param int $cipher: Valid PHP MCrypt cypher constant
- :returns: CI_Encrypt instance (method chaining)
- :rtype: CI_Encrypt
-
- Permits you to set an Mcrypt cipher. By default it uses
- ``MCRYPT_RIJNDAEL_256``. Example::
-
- $this->encrypt->set_cipher(MCRYPT_BLOWFISH);
-
- Please visit php.net for a list of `available ciphers <http://php.net/mcrypt>`_.
-
- If you'd like to manually test whether your server supports MCrypt you
- can use::
-
- echo extension_loaded('mcrypt') ? 'Yup' : 'Nope';
-
- .. php:method:: set_mode($mode)
-
- :param int $mode: Valid PHP MCrypt mode constant
- :returns: CI_Encrypt instance (method chaining)
- :rtype: CI_Encrypt
-
- Permits you to set an Mcrypt mode. By default it uses **MCRYPT_MODE_CBC**.
- Example::
-
- $this->encrypt->set_mode(MCRYPT_MODE_CFB);
-
- Please visit php.net for a list of `available modes <http://php.net/mcrypt>`_.
-
- .. php:method:: encode_from_legacy($string[, $legacy_mode = MCRYPT_MODE_ECB[, $key = '']])
-
- :param string $string: String to encrypt
- :param int $legacy_mode: Valid PHP MCrypt cipher constant
- :param string $key: Encryption key
- :returns: Newly encrypted string
- :rtype: string
-
- Enables you to re-encode data that was originally encrypted with
- CodeIgniter 1.x to be compatible with the Encrypt library in
- CodeIgniter 2.x. It is only necessary to use this method if you have
- encrypted data stored permanently such as in a file or database and are
- on a server that supports Mcrypt. "Light" use encryption such as
- encrypted session data or transitory encrypted flashdata require no
- intervention on your part. However, existing encrypted Sessions will be
- destroyed since data encrypted prior to 2.x will not be decoded.
-
- .. important::
- **Why only a method to re-encode the data instead of maintaining legacy
- methods for both encoding and decoding?** The algorithms in the
- Encrypt library have improved in CodeIgniter 2.x both for performance
- and security, and we do not wish to encourage continued use of the older
- methods. You can of course extend the Encryption library if you wish and
- replace the new methods with the old and retain seamless compatibility
- with CodeIgniter 1.x encrypted data, but this a decision that a
- developer should make cautiously and deliberately, if at all.
-
- ::
-
- $new_data = $this->encrypt->encode_from_legacy($old_encrypted_string);
-
- ====================== =============== =======================================================================
- Parameter Default Description
- ====================== =============== =======================================================================
- **$orig_data** n/a The original encrypted data from CodeIgniter 1.x's Encryption library
- **$legacy_mode** MCRYPT_MODE_ECB The Mcrypt mode that was used to generate the original encrypted data.
- CodeIgniter 1.x's default was MCRYPT_MODE_ECB, and it will assume that
- to be the case unless overridden by this parameter.
- **$key** n/a The encryption key. This it typically specified in your config file as
- outlined above.
- ====================== =============== ======================================================================= \ No newline at end of file
diff --git a/user_guide_src/source/libraries/encryption.rst b/user_guide_src/source/libraries/encryption.rst
deleted file mode 100644
index b16511d4d..000000000
--- a/user_guide_src/source/libraries/encryption.rst
+++ /dev/null
@@ -1,585 +0,0 @@
-##################
-Encryption Library
-##################
-
-.. important:: DO NOT use this or any other *encryption* library for
- user password storage! Passwords must be *hashed* instead, and you
- should do that via PHP's own `Password Hashing extension
- <http://php.net/password>`_.
-
-The Encryption Library provides two-way data encryption. To do so in
-a cryptographically secure way, it utilizes PHP extensions that are
-unfortunately not always available on all systems.
-You must meet one of the following dependencies in order to use this
-library:
-
-- `OpenSSL <http://php.net/openssl>`_
-- `MCrypt <http://php.net/mcrypt>`_ (and `MCRYPT_DEV_URANDOM` availability)
-
-If neither of the above dependencies is met, we simply cannot offer
-you a good enough implementation to meet the high standards required
-for proper cryptography.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-****************************
-Using the Encryption Library
-****************************
-
-Initializing the Class
-======================
-
-Like most other classes in CodeIgniter, the Encryption library is
-initialized in your controller using the ``$this->load->library()``
-method::
-
- $this->load->library('encryption');
-
-Once loaded, the Encryption library object will be available using::
-
- $this->encryption
-
-Default behavior
-================
-
-By default, the Encryption Library will use the AES-128 cipher in CBC
-mode, using your configured *encryption_key* and SHA512 HMAC authentication.
-
-.. note:: AES-128 is chosen both because it is proven to be strong and
- because of its wide availability across different cryptographic
- software and programming languages' APIs.
-
-However, the *encryption_key* is not used as is.
-
-If you are somewhat familiar with cryptography, you should already know
-that a HMAC also requires a secret key and using the same key for both
-encryption and authentication is a bad practice.
-
-Because of that, two separate keys are derived from your already configured
-*encryption_key*: one for encryption and one for authentication. This is
-done via a technique called `HMAC-based Key Derivation Function
-<http://en.wikipedia.org/wiki/HKDF>`_ (HKDF).
-
-Setting your encryption_key
-===========================
-
-An *encryption key* is a piece of information that controls the
-cryptographic process and permits a plain-text string to be encrypted,
-and afterwards - decrypted. It is the secret "ingredient" in the whole
-process that allows you to be the only one who is able to decrypt data
-that you've decided to hide from the eyes of the public.
-After one key is used to encrypt data, that same key provides the **only**
-means to decrypt it, so not only must you chose one carefully, but you
-must not lose it or you will also lose access to the data.
-
-It must be noted that to ensure maximum security, such key *should* not
-only be as strong as possible, but also often changed. Such behavior
-however is rarely practical or possible to implement, and that is why
-CodeIgniter gives you the ability to configure a single key that is to be
-used (almost) every time.
-
-It goes without saying that you should guard your key carefully. Should
-someone gain access to your key, the data will be easily decrypted. If
-your server is not totally under your control it's impossible to ensure
-key security so you may want to think carefully before using it for
-anything that requires high security, like storing credit card numbers.
-
-Your encryption key **must** be as long as the encyption algorithm in use
-allows. For AES-128, that's 128 bits or 16 bytes (charcters) long.
-You will find a table below that shows the supported key lengths of
-different ciphers.
-
-The key should be as random as possible and it **must not** be a regular
-text string, nor the output of a hashing function, etc. In order to create
-a proper key, you must use the Encryption library's ``create_key()`` method
-::
-
- // $key will be assigned a 16-byte (128-bit) random key
- $key = $this->encryption->create_key(16);
-
-The key can be either stored in your *application/config/config.php*, or
-you can design your own storage mechanism and pass the key dynamically
-when encrypting/decrypting.
-
-To save your key to your *application/config/config.php*, open the file
-and set::
-
- $config['encryption_key'] = 'YOUR KEY';
-
-You'll notice that the ``create_key()`` method outputs binary data, which
-is hard to deal with (i.e. a copy-paste may damage it), so you may use
-``bin2hex()``, ``hex2bin()`` or Base64-encoding to work with the key in
-a more friendly manner. For example::
-
- // Get a hex-encoded representation of the key:
- $key = bin2hex($this->encryption->create_key(16));
-
- // Put the same value in your config with hex2bin(),
- // so that it is still passed as binary to the library:
- $config['encryption_key'] = hex2bin(<your hex-encoded key>);
-
-.. _ciphers-and-modes:
-
-Supported encryption ciphers and modes
-======================================
-
-.. note:: The terms 'cipher' and 'encryption algorithm' are interchangeable.
-
-Portable ciphers
-----------------
-
-Because MCrypt and OpenSSL (also called drivers throughout this document)
-each support different sets of encryption algorithms and often implement
-them in different ways, our Encryption library is designed to use them in
-a portable fashion, or in other words - it enables you to use them
-interchangeably, at least for the ciphers supported by both drivers.
-
-It is also implemented in a way that aims to match the standard
-implementations in other programming languages and libraries.
-
-Here's a list of the so called "portable" ciphers, where
-"CodeIgniter name" is the string value that you'd have to pass to the
-Encryption library to use that cipher:
-
-======================== ================== ============================ ===============================
-Cipher name CodeIgniter name Key lengths (bits / bytes) Supported modes
-======================== ================== ============================ ===============================
-AES-128 / Rijndael-128 aes-128 128 / 16 CBC, CTR, CFB, CFB8, OFB, ECB
-AES-192 aes-192 192 / 24 CBC, CTR, CFB, CFB8, OFB, ECB
-AES-256 aes-256 256 / 32 CBC, CTR, CFB, CFB8, OFB, ECB
-DES des 56 / 7 CBC, CFB, CFB8, OFB, ECB
-TripleDES tripledes 56 / 7, 112 / 14, 168 / 21 CBC, CFB, CFB8, OFB
-Blowfish blowfish 128-448 / 16-56 CBC, CFB, OFB, ECB
-CAST5 / CAST-128 cast5 88-128 / 11-16 CBC, CFB, OFB, ECB
-RC4 / ARCFour rc4 40-2048 / 5-256 Stream
-======================== ================== ============================ ===============================
-
-.. important:: Because of how MCrypt works, if you fail to provide a key
- with the appropriate length, you might end up using a different
- algorithm than the one configured, so be really careful with that!
-
-.. note:: In case it isn't clear from the above table, Blowfish, CAST5
- and RC4 support variable length keys. That is, any number in the
- shown ranges is valid, although in bit terms that only happens
- in 8-bit increments.
-
-.. note:: Even though CAST5 supports key lengths lower than 128 bits
- (16 bytes), in fact they will just be zero-padded to the
- maximum length, as specified in `RFC 2144
- <http://tools.ietf.org/rfc/rfc2144.txt>`_.
-
-.. note:: Blowfish supports key lengths as small as 32 bits (4 bytes), but
- our tests have shown that only lengths of 128 bits (16 bytes) or
- higher are properly supported by both MCrypt and OpenSSL. It is
- also a bad practice to use such low-length keys anyway.
-
-Driver-specific ciphers
------------------------
-
-As noted above, MCrypt and OpenSSL support different sets of encryption
-ciphers. For portability reasons and because we haven't tested them
-properly, we do not advise you to use the ones that are driver-specific,
-but regardless, here's a list of most of them:
-
-
-============== ========= ============================== =========================================
-Cipher name Driver Key lengths (bits / bytes) Supported modes
-============== ========= ============================== =========================================
-AES-128 OpenSSL 128 / 16 CBC, CTR, CFB, CFB8, OFB, ECB, XTS
-AES-192 OpenSSL 192 / 24 CBC, CTR, CFB, CFB8, OFB, ECB, XTS
-AES-256 OpenSSL 256 / 32 CBC, CTR, CFB, CFB8, OFB, ECB, XTS
-Rijndael-128 MCrypt 128 / 16, 192 / 24, 256 / 32 CBC, CTR, CFB, CFB8, OFB, OFB8, ECB
-Rijndael-192 MCrypt 128 / 16, 192 / 24, 256 / 32 CBC, CTR, CFB, CFB8, OFB, OFB8, ECB
-Rijndael-256 MCrypt 128 / 16, 192 / 24, 256 / 32 CBC, CTR, CFB, CFB8, OFB, OFB8, ECB
-GOST MCrypt 256 / 32 CBC, CTR, CFB, CFB8, OFB, OFB8, ECB
-Twofish MCrypt 128 / 16, 192 / 24, 256 / 32 CBC, CTR, CFB, CFB8, OFB, OFB8, ECB
-CAST-128 MCrypt 40-128 / 5-16 CBC, CTR, CFB, CFB8, OFB, OFB8, ECB
-CAST-256 MCrypt 128 / 16, 192 / 24, 256 / 32 CBC, CTR, CFB, CFB8, OFB, OFB8, ECB
-Loki97 MCrypt 128 / 16, 192 / 24, 256 / 32 CBC, CTR, CFB, CFB8, OFB, OFB8, ECB
-SaferPlus MCrypt 128 / 16, 192 / 24, 256 / 32 CBC, CTR, CFB, CFB8, OFB, OFB8, ECB
-Serpent MCrypt 128 / 16, 192 / 24, 256 / 32 CBC, CTR, CFB, CFB8, OFB, OFB8, ECB
-XTEA MCrypt 128 / 16 CBC, CTR, CFB, CFB8, OFB, OFB8, ECB
-RC2 MCrypt 8-1024 / 1-128 CBC, CTR, CFB, CFB8, OFB, OFB8, ECB
-RC2 OpenSSL 8-1024 / 1-128 CBC, CFB, OFB, ECB
-Camellia-128 OpenSSL 128 / 16 CBC, CFB, CFB8, OFB, ECB
-Camellia-192 OpenSSL 192 / 24 CBC, CFB, CFB8, OFB, ECB
-Camellia-256 OpenSSL 256 / 32 CBC, CFB, CFB8, OFB, ECB
-Seed OpenSSL 128 / 16 CBC, CFB, OFB, ECB
-============== ========= ============================== =========================================
-
-.. note:: If you wish to use one of those ciphers, you'd have to pass
- its name in lower-case to the Encryption library.
-
-.. note:: You've probably noticed that all AES cipers (and Rijndael-128)
- are also listed in the portable ciphers list. This is because
- drivers support different modes for these ciphers. Also, it is
- important to note that AES-128 and Rijndael-128 are actually
- the same cipher, but **only** when used with a 128-bit key.
-
-.. note:: CAST-128 / CAST-5 is also listed in both the portable and
- driver-specific ciphers list. This is because OpenSSL's
- implementation doesn't appear to be working correctly with
- key sizes of 80 bits and lower.
-
-.. note:: RC2 is listed as supported by both MCrypt and OpenSSL.
- However, both drivers implement them differently and they
- are not portable. It is probably worth noting that we only
- found one obscure source confirming that it is MCrypt that
- is not properly implementing it.
-
-.. _encryption-modes:
-
-Encryption modes
-----------------
-
-Different modes of encryption have different characteristics and serve
-for different purposes. Some are stronger than others, some are faster
-and some offer extra features.
-We are not going in depth into that here, we'll leave that to the
-cryptography experts. The table below is to provide brief informational
-reference to our more experienced users. If you are a beginner, just
-stick to the CBC mode - it is widely accepted as strong and secure for
-general purposes.
-
-=========== ================== ================= ===================================================================================================================================================
-Mode name CodeIgniter name Driver support Additional info
-=========== ================== ================= ===================================================================================================================================================
-CBC cbc MCrypt, OpenSSL A safe default choice
-CTR ctr MCrypt, OpenSSL Considered as theoretically better than CBC, but not as widely available
-CFB cfb MCrypt, OpenSSL N/A
-CFB8 cfb8 MCrypt, OpenSSL Same as CFB, but operates in 8-bit mode (not recommended).
-OFB ofb MCrypt, OpenSSL N/A
-OFB8 ofb8 MCrypt Same as OFB, but operates in 8-bit mode (not recommended).
-ECB ecb MCrypt, OpenSSL Ignores IV (not recommended).
-XTS xts OpenSSL Usually used for encrypting random access data such as RAM or hard-disk storage.
-Stream stream MCrypt, OpenSSL This is not actually a mode, it just says that a stream cipher is being used. Required because of the general cipher+mode initialization process.
-=========== ================== ================= ===================================================================================================================================================
-
-Message Length
-==============
-
-It's probably important for you to know that an encrypted string is usually
-longer than the original, plain-text string (depending on the cipher).
-
-This is influenced by the cipher algorithm itself, the IV prepended to the
-cipher-text and the HMAC authentication message that is also prepended.
-Furthermore, the encrypted message is also Base64-encoded so that it is safe
-for storage and transmission, regardless of a possible character set in use.
-
-Keep this information in mind when selecting your data storage mechanism.
-Cookies, for example, can only hold 4K of information.
-
-.. _configuration:
-
-Configuring the library
-=======================
-
-For usability, performance, but also historical reasons tied to our old
-:doc:`Encrypt Class <encrypt>`, the Encryption library is designed to
-use repeatedly the same driver, encryption cipher, mode and key.
-
-As noted in the "Default behavior" section above, this means using an
-auto-detected driver (OpenSSL has a higher priority), the AES-128 ciper
-in CBC mode, and your ``$config['encryption_key']`` value.
-
-If you wish to change that however, you need to use the ``initialize()``
-method. It accepts an associative array of parameters, all of which are
-optional:
-
-======== ===============================================
-Option Possible values
-======== ===============================================
-driver 'mcrypt', 'openssl'
-cipher Cipher name (see :ref:`ciphers-and-modes`)
-mode Encryption mode (see :ref:`encryption-modes`)
-key Encryption key
-======== ===============================================
-
-For example, if you were to change the encryption algorithm and
-mode to AES-256 in CTR mode, this is what you should do::
-
- $this->encryption->initialize(
- array(
- 'cipher' => 'aes-256',
- 'mode' => 'ctr',
- 'key' => '<a 32-character random string>'
- )
- );
-
-Note that we only mentioned that you want to change the ciper and mode,
-but we also included a key in the example. As previously noted, it is
-important that you choose a key with a proper size for the used algorithm.
-
-There's also the ability to change the driver, if for some reason you
-have both, but want to use MCrypt instead of OpenSSL::
-
- // Switch to the MCrypt driver
- $this->encryption->initialize(array('driver' => 'mcrypt'));
-
- // Switch back to the OpenSSL driver
- $this->encryption->initialize(array('driver' => 'openssl'));
-
-Encrypting and decrypting data
-==============================
-
-Encrypting and decrypting data with the already configured library
-settings is simple. As simple as just passing the string to the
-``encrypt()`` and/or ``decrypt()`` methods::
-
- $plain_text = 'This is a plain-text message!';
- $ciphertext = $this->encryption->encrypt($plain_text);
-
- // Outputs: This is a plain-text message!
- echo $this->encryption->decrypt($ciphertext);
-
-And that's it! The Encryption library will do everything necessary
-for the whole process to be cryptographically secure out-of-the-box.
-You don't need to worry about it.
-
-.. important:: Both methods will return FALSE in case of an error.
- While for ``encrypt()`` this can only mean incorrect
- configuration, you should always check the return value
- of ``decrypt()`` in production code.
-
-How it works
-------------
-
-If you must know how the process works, here's what happens under
-the hood:
-
-- ``$this->encryption->encrypt($plain_text)``
-
- #. Derive an encryption key and a HMAC key from your configured
- *encryption_key* via HKDF, using the SHA-512 digest algorithm.
-
- #. Generate a random initialization vector (IV).
-
- #. Encrypt the data via AES-128 in CBC mode (or another previously
- configured cipher and mode), using the above-mentioned derived
- encryption key and IV.
-
- #. Prepend said IV to the resulting cipher-text.
-
- #. Base64-encode the resulting string, so that it can be safely
- stored or transferred without worrying about character sets.
-
- #. Create a SHA-512 HMAC authentication message using the derived
- HMAC key to ensure data integrity and prepend it to the Base64
- string.
-
-- ``$this->encryption->decrypt($ciphertext)``
-
- #. Derive an encryption key and a HMAC key from your configured
- *encryption_key* via HKDF, using the SHA-512 digest algorithm.
- Because your configured *encryption_key* is the same, this
- will produce the same result as in the ``encrypt()`` method
- above - otherwise you won't be able to decrypt it.
-
- #. Check if the string is long enough, separate the HMAC out of
- it and validate if it is correct (this is done in a way that
- prevents timing attacks against it). Return FALSE if either of
- the checks fails.
-
- #. Base64-decode the string.
-
- #. Separate the IV out of the cipher-text and decrypt the said
- cipher-text using that IV and the derived encryption key.
-
-.. _custom-parameters:
-
-Using custom parameters
------------------------
-
-Let's say you have to interact with another system that is out
-of your control and uses another method to encrypt data. A
-method that will most certainly not match the above-described
-sequence and probably not use all of the steps either.
-
-The Encryption library allows you to change how its encryption
-and decryption processes work, so that you can easily tailor a
-custom solution for such situations.
-
-.. note:: It is possible to use the library in this way, without
- setting an *encryption_key* in your configuration file.
-
-All you have to do is to pass an associative array with a few
-parameters to either the ``encrypt()`` or ``decrypt()`` method.
-Here's an example::
-
- // Assume that we have $ciphertext, $key and $hmac_key
- // from on outside source
-
- $message = $this->encryption->decrypt(
- $ciphertext,
- array(
- 'cipher' => 'blowfish',
- 'mode' => 'cbc',
- 'key' => $key,
- 'hmac_digest' => 'sha256',
- 'hmac_key' => $hmac_key
- )
- );
-
-In the above example, we are decrypting a message that was encrypted
-using the Blowfish cipher in CBC mode and authenticated via a SHA-256
-HMAC.
-
-.. important:: Note that both 'key' and 'hmac_key' are used in this
- example. When using custom parameters, encryption and HMAC keys
- are not derived like the default behavior of the library is.
-
-Below is a list of the available options.
-
-However, unless you really need to and you know what you are doing,
-we advise you to not change the encryption process as this could
-impact security, so please do so with caution.
-
-============= =============== ============================= ======================================================
-Option Default value Mandatory / Optional Description
-============= =============== ============================= ======================================================
-cipher N/A Yes Encryption algorithm (see :ref:`ciphers-and-modes`).
-mode N/A Yes Encryption mode (see :ref:`encryption-modes`).
-key N/A Yes Encryption key.
-hmac TRUE No Whether to use a HMAC.
- Boolean. If set to FALSE, then *hmac_digest* and
- *hmac_key* will be ignored.
-hmac_digest sha512 No HMAC message digest algorithm (see :ref:`digests`).
-hmac_key N/A Yes, unless *hmac* is FALSE HMAC key.
-raw_data FALSE No Whether the cipher-text should be raw.
- Boolean. If set to TRUE, then Base64 encoding and
- decoding will not be performed and HMAC will not
- be a hexadecimal string.
-============= =============== ============================= ======================================================
-
-.. important:: ``encrypt()`` and ``decrypt()`` will return FALSE if
- a mandatory parameter is not provided or if a provided
- value is incorrect. This includes *hmac_key*, unless *hmac*
- is set to FALSE.
-
-.. _digests:
-
-Supported HMAC authentication algorithms
-----------------------------------------
-
-For HMAC message authentication, the Encryption library supports
-usage of the SHA-2 family of algorithms:
-
-=========== ==================== ============================
-Algorithm Raw length (bytes) Hex-encoded length (bytes)
-=========== ==================== ============================
-sha512 64 128
-sha384 48 96
-sha256 32 64
-sha224 28 56
-=========== ==================== ============================
-
-The reason for not including other popular algorithms, such as
-MD5 or SHA1 is that they are no longer considered secure enough
-and as such, we don't want to encourage their usage.
-If you absolutely need to use them, it is easy to do so via PHP's
-native `hash_hmac() <http://php.net/manual/en/function.hash-hmac.php>`_ function.
-
-Stronger algorithms of course will be added in the future as they
-appear and become widely available.
-
-***************
-Class Reference
-***************
-
-.. php:class:: CI_Encryption
-
- .. php:method:: initialize($params)
-
- :param array $params: Configuration parameters
- :returns: CI_Encryption instance (method chaining)
- :rtype: CI_Encryption
-
- Initializes (configures) the library to use a different
- driver, cipher, mode or key.
-
- Example::
-
- $this->encryption->initialize(
- array('mode' => 'ctr')
- );
-
- Please refer to the :ref:`configuration` section for detailed info.
-
- .. php:method:: encrypt($data[, $params = NULL])
-
- :param string $data: Data to encrypt
- :param array $params: Optional parameters
- :returns: Encrypted data or FALSE on failure
- :rtype: string
-
- Encrypts the input data and returns its ciphertext.
-
- Example::
-
- $ciphertext = $this->encryption->encrypt('My secret message');
-
- Please refer to the :ref:`custom-parameters` section for information
- on the optional parameters.
-
- .. php:method:: decrypt($data[, $params = NULL])
-
- :param string $data: Data to decrypt
- :param array $params: Optional parameters
- :returns: Decrypted data or FALSE on failure
- :rtype: string
-
- Decrypts the input data and returns it in plain-text.
-
- Example::
-
- echo $this->encryption->decrypt($ciphertext);
-
- Please refer to the :ref:`custom-parameters` secrion for information
- on the optional parameters.
-
- .. php:method:: create_key($length)
-
- :param int $length: Output length
- :returns: A pseudo-random cryptographic key with the specified length, or FALSE on failure
- :rtype: string
-
- Creates a cryptographic key by fetching random data from
- the operating system's sources (i.e. /dev/urandom).
-
- .. php:method:: hkdf($key[, $digest = 'sha512'[, $salt = NULL[, $length = NULL[, $info = '']]]])
-
- :param string $key: Input key material
- :param string $digest: A SHA-2 family digest algorithm
- :param string $salt: Optional salt
- :param int $length: Optional output length
- :param string $info: Optional context/application-specific info
- :returns: A pseudo-random key or FALSE on failure
- :rtype: string
-
- Derives a key from another, presumably weaker key.
-
- This method is used internally to derive an encryption and HMAC key
- from your configured *encryption_key*.
-
- It is publicly available due to its otherwise general purpose. It is
- described in `RFC 5869 <https://tools.ietf.org/rfc/rfc5869.txt>`_.
-
- However, as opposed to the description in RFC 5869, this implementation
- doesn't support SHA1.
-
- Example::
-
- $hmac_key = $this->encryption->hkdf(
- $key,
- 'sha512',
- NULL,
- NULL,
- 'authentication'
- );
-
- // $hmac_key is a pseudo-random key with a length of 64 bytes \ No newline at end of file
diff --git a/user_guide_src/source/libraries/file_uploading.rst b/user_guide_src/source/libraries/file_uploading.rst
deleted file mode 100644
index babdc04f9..000000000
--- a/user_guide_src/source/libraries/file_uploading.rst
+++ /dev/null
@@ -1,355 +0,0 @@
-####################
-File Uploading Class
-####################
-
-CodeIgniter's File Uploading Class permits files to be uploaded. You can
-set various preferences, restricting the type and size of the files.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-***********
-The Process
-***********
-
-Uploading a file involves the following general process:
-
-- An upload form is displayed, allowing a user to select a file and
- upload it.
-- When the form is submitted, the file is uploaded to the destination
- you specify.
-- Along the way, the file is validated to make sure it is allowed to be
- uploaded based on the preferences you set.
-- Once uploaded, the user will be shown a success message.
-
-To demonstrate this process here is brief tutorial. Afterward you'll
-find reference information.
-
-Creating the Upload Form
-========================
-
-Using a text editor, create a form called upload_form.php. In it, place
-this code and save it to your **application/views/** directory::
-
- <html>
- <head>
- <title>Upload Form</title>
- </head>
- <body>
-
- <?php echo $error;?>
-
- <?php echo form_open_multipart('upload/do_upload');?>
-
- <input type="file" name="userfile" size="20" />
-
- <br /><br />
-
- <input type="submit" value="upload" />
-
- </form>
-
- </body>
- </html>
-
-You'll notice we are using a form helper to create the opening form tag.
-File uploads require a multipart form, so the helper creates the proper
-syntax for you. You'll also notice we have an $error variable. This is
-so we can show error messages in the event the user does something
-wrong.
-
-The Success Page
-================
-
-Using a text editor, create a form called upload_success.php. In it,
-place this code and save it to your **application/views/** directory::
-
- <html>
- <head>
- <title>Upload Form</title>
- </head>
- <body>
-
- <h3>Your file was successfully uploaded!</h3>
-
- <ul>
- <?php foreach ($upload_data as $item => $value):?>
- <li><?php echo $item;?>: <?php echo $value;?></li>
- <?php endforeach; ?>
- </ul>
-
- <p><?php echo anchor('upload', 'Upload Another File!'); ?></p>
-
- </body>
- </html>
-
-The Controller
-==============
-
-Using a text editor, create a controller called Upload.php. In it, place
-this code and save it to your **application/controllers/** directory::
-
- <?php
-
- class Upload extends CI_Controller {
-
- public function __construct()
- {
- parent::__construct();
- $this->load->helper(array('form', 'url'));
- }
-
- public function index()
- {
- $this->load->view('upload_form', array('error' => ' ' ));
- }
-
- public function do_upload()
- {
- $config['upload_path'] = './uploads/';
- $config['allowed_types'] = 'gif|jpg|png';
- $config['max_size'] = 100;
- $config['max_width'] = 1024;
- $config['max_height'] = 768;
-
- $this->load->library('upload', $config);
-
- if ( ! $this->upload->do_upload('userfile'))
- {
- $error = array('error' => $this->upload->display_errors());
-
- $this->load->view('upload_form', $error);
- }
- else
- {
- $data = array('upload_data' => $this->upload->data());
-
- $this->load->view('upload_success', $data);
- }
- }
- }
- ?>
-
-The Upload Directory
-====================
-
-You'll need a destination directory for your uploaded images. Create a
-directory at the root of your CodeIgniter installation called uploads
-and set its file permissions to 777.
-
-Try it!
-=======
-
-To try your form, visit your site using a URL similar to this one::
-
- example.com/index.php/upload/
-
-You should see an upload form. Try uploading an image file (either a
-jpg, gif, or png). If the path in your controller is correct it should
-work.
-
-***************
-Reference Guide
-***************
-
-Initializing the Upload Class
-=============================
-
-Like most other classes in CodeIgniter, the Upload class is initialized
-in your controller using the ``$this->load->library()`` method::
-
- $this->load->library('upload');
-
-Once the Upload class is loaded, the object will be available using:
-$this->upload
-
-Setting Preferences
-===================
-
-Similar to other libraries, you'll control what is allowed to be upload
-based on your preferences. In the controller you built above you set the
-following preferences::
-
- $config['upload_path'] = './uploads/';
- $config['allowed_types'] = 'gif|jpg|png';
- $config['max_size'] = '100';
- $config['max_width'] = '1024';
- $config['max_height'] = '768';
-
- $this->load->library('upload', $config);
-
- // Alternately you can set preferences by calling the ``initialize()`` method. Useful if you auto-load the class:
- $this->upload->initialize($config);
-
-The above preferences should be fairly self-explanatory. Below is a
-table describing all available preferences.
-
-Preferences
-===========
-
-The following preferences are available. The default value indicates
-what will be used if you do not specify that preference.
-
-============================ ================= ======================= ======================================================================
-Preference Default Value Options Description
-============================ ================= ======================= ======================================================================
-**upload_path** None None The path to the directory where the upload should be placed. The
- directory must be writable and the path can be absolute or relative.
-**allowed_types** None None The mime types corresponding to the types of files you allow to be
- uploaded. Usually the file extension can be used as the mime type.
- Can be either an array or a pipe-separated string.
-**file_name** None Desired file name If set CodeIgniter will rename the uploaded file to this name. The
- extension provided in the file name must also be an allowed file type.
- If no extension is provided in the original file_name will be used.
-**file_ext_tolower** FALSE TRUE/FALSE (boolean) If set to TRUE, the file extension will be forced to lower case
-**overwrite** FALSE TRUE/FALSE (boolean) If set to true, if a file with the same name as the one you are
- uploading exists, it will be overwritten. If set to false, a number will
- be appended to the filename if another with the same name exists.
-**max_size** 0 None The maximum size (in kilobytes) that the file can be. Set to zero for no
- limit. Note: Most PHP installations have their own limit, as specified
- in the php.ini file. Usually 2 MB (or 2048 KB) by default.
-**max_width** 0 None The maximum width (in pixels) that the image can be. Set to zero for no
- limit.
-**max_height** 0 None The maximum height (in pixels) that the image can be. Set to zero for no
- limit.
-**min_width** 0 None The minimum width (in pixels) that the image can be. Set to zero for no
- limit.
-**min_height** 0 None The minimum height (in pixels) that the image can be. Set to zero for no
- limit.
-**max_filename** 0 None The maximum length that a file name can be. Set to zero for no limit.
-**max_filename_increment** 100 None When overwrite is set to FALSE, use this to set the maximum filename
- increment for CodeIgniter to append to the filename.
-**encrypt_name** FALSE TRUE/FALSE (boolean) If set to TRUE the file name will be converted to a random encrypted
- string. This can be useful if you would like the file saved with a name
- that can not be discerned by the person uploading it.
-**remove_spaces** TRUE TRUE/FALSE (boolean) If set to TRUE, any spaces in the file name will be converted to
- underscores. This is recommended.
-**detect_mime** TRUE TRUE/FALSE (boolean) If set to TRUE, a server side detection of the file type will be
- performed to avoid code injection attacks. DO NOT disable this option
- unless you have no other option as that would cause a security risk.
-**mod_mime_fix** TRUE TRUE/FALSE (boolean) If set to TRUE, multiple filename extensions will be suffixed with an
- underscore in order to avoid triggering `Apache mod_mime
- <http://httpd.apache.org/docs/2.0/mod/mod_mime.html#multipleext>`_.
- DO NOT turn off this option if your upload directory is public, as this
- is a security risk.
-============================ ================= ======================= ======================================================================
-
-Setting preferences in a config file
-====================================
-
-If you prefer not to set preferences using the above method, you can
-instead put them into a config file. Simply create a new file called the
-upload.php, add the $config array in that file. Then save the file in:
-**config/upload.php** and it will be used automatically. You will NOT
-need to use the ``$this->upload->initialize()`` method if you save your
-preferences in a config file.
-
-***************
-Class Reference
-***************
-
-.. php:class:: CI_Upload
-
- .. php:method:: initialize([array $config = array()[, $reset = TRUE]])
-
- :param array $config: Preferences
- :param bool $reset: Whether to reset preferences (that are not provided in $config) to their defaults
- :returns: CI_Upload instance (method chaining)
- :rtype: CI_Upload
-
- .. php:method:: do_upload([$field = 'userfile'])
-
- :param string $field: Name of the form field
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Performs the upload based on the preferences you've set.
-
- .. note:: By default the upload routine expects the file to come from
- a form field called userfile, and the form must be of type
- "multipart".
-
- ::
-
- <form method="post" action="some_action" enctype="multipart/form-data" />
-
- If you would like to set your own field name simply pass its value to
- the ``do_upload()`` method::
-
- $field_name = "some_field_name";
- $this->upload->do_upload($field_name);
-
- .. php:method:: display_errors([$open = '<p>'[, $close = '</p>']])
-
- :param string $open: Opening markup
- :param string $close: Closing markup
- :returns: Formatted error message(s)
- :rtype: string
-
- Retrieves any error messages if the ``do_upload()`` method returned
- false. The method does not echo automatically, it returns the data so
- you can assign it however you need.
-
- **Formatting Errors**
-
- By default the above method wraps any errors within <p> tags. You can
- set your own delimiters like this::
-
- $this->upload->display_errors('<p>', '</p>');
-
-
- .. php:method:: data([$index = NULL])
-
- :param string $data: Element to return instead of the full array
- :returns: Information about the uploaded file
- :rtype: mixed
-
- This is a helper method that returns an array containing all of the
- data related to the file you uploaded. Here is the array prototype::
-
- Array
- (
- [file_name] => mypic.jpg
- [file_type] => image/jpeg
- [file_path] => /path/to/your/upload/
- [full_path] => /path/to/your/upload/jpg.jpg
- [raw_name] => mypic
- [orig_name] => mypic.jpg
- [client_name] => mypic.jpg
- [file_ext] => .jpg
- [file_size] => 22.2
- [is_image] => 1
- [image_width] => 800
- [image_height] => 600
- [image_type] => jpeg
- [image_size_str] => width="800" height="200"
- )
-
- To return one element from the array::
-
- $this->upload->data('file_name'); // Returns: mypic.jpg
-
- Here's a table explaining the above-displayed array items:
-
- ================ ====================================================================================================
- Item Description
- ================ ====================================================================================================
- file_name Name of the file that was uploaded, including the filename extension
- file_type File MIME type identifier
- file_path Absolute server path to the file
- full_path Absolute server path, including the file name
- raw_name File name, without the extension
- orig_name Original file name. This is only useful if you use the encrypted name option.
- client_name File name supplied by the client user agent, but possibly sanitized
- file_ext Filename extension, period included
- file_size File size in kilobytes
- is_image Whether the file is an image or not. 1 = image. 0 = not.
- image_width Image width
- image_height Image height
- image_type Image type (usually the file name extension without the period)
- image_size_str A string containing the width and height (useful to put into an image tag)
- ================ ====================================================================================================
diff --git a/user_guide_src/source/libraries/form_validation.rst b/user_guide_src/source/libraries/form_validation.rst
deleted file mode 100644
index 16de42338..000000000
--- a/user_guide_src/source/libraries/form_validation.rst
+++ /dev/null
@@ -1,1143 +0,0 @@
-###############
-Form Validation
-###############
-
-CodeIgniter provides a comprehensive form validation and data prepping
-class that helps minimize the amount of code you'll write.
-
-.. contents:: Page Contents
-
-********
-Overview
-********
-
-Before explaining CodeIgniter's approach to data validation, let's
-describe the ideal scenario:
-
-#. A form is displayed.
-#. You fill it in and submit it.
-#. If you submitted something invalid, or perhaps missed a required
- item, the form is redisplayed containing your data along with an
- error message describing the problem.
-#. This process continues until you have submitted a valid form.
-
-On the receiving end, the script must:
-
-#. Check for required data.
-#. Verify that the data is of the correct type, and meets the correct
- criteria. For example, if a username is submitted it must be
- validated to contain only permitted characters. It must be of a
- minimum length, and not exceed a maximum length. The username can't
- be someone else's existing username, or perhaps even a reserved word.
- Etc.
-#. Sanitize the data for security.
-#. Pre-format the data if needed (Does the data need to be trimmed? HTML
- encoded? Etc.)
-#. Prep the data for insertion in the database.
-
-Although there is nothing terribly complex about the above process, it
-usually requires a significant amount of code, and to display error
-messages, various control structures are usually placed within the form
-HTML. Form validation, while simple to create, is generally very messy
-and tedious to implement.
-
-************************
-Form Validation Tutorial
-************************
-
-What follows is a "hands on" tutorial for implementing CodeIgniter's Form
-Validation.
-
-In order to implement form validation you'll need three things:
-
-#. A :doc:`View <../general/views>` file containing a form.
-#. A View file containing a "success" message to be displayed upon
- successful submission.
-#. A :doc:`controller <../general/controllers>` method to receive and
- process the submitted data.
-
-Let's create those three things, using a member sign-up form as the
-example.
-
-The Form
-========
-
-Using a text editor, create a form called myform.php. In it, place this
-code and save it to your application/views/ folder::
-
- <html>
- <head>
- <title>My Form</title>
- </head>
- <body>
-
- <?php echo validation_errors(); ?>
-
- <?php echo form_open('form'); ?>
-
- <h5>Username</h5>
- <input type="text" name="username" value="" size="50" />
-
- <h5>Password</h5>
- <input type="text" name="password" value="" size="50" />
-
- <h5>Password Confirm</h5>
- <input type="text" name="passconf" value="" size="50" />
-
- <h5>Email Address</h5>
- <input type="text" name="email" value="" size="50" />
-
- <div><input type="submit" value="Submit" /></div>
-
- </form>
-
- </body>
- </html>
-
-The Success Page
-================
-
-Using a text editor, create a form called formsuccess.php. In it, place
-this code and save it to your application/views/ folder::
-
- <html>
- <head>
- <title>My Form</title>
- </head>
- <body>
-
- <h3>Your form was successfully submitted!</h3>
-
- <p><?php echo anchor('form', 'Try it again!'); ?></p>
-
- </body>
- </html>
-
-The Controller
-==============
-
-Using a text editor, create a controller called Form.php. In it, place
-this code and save it to your application/controllers/ folder::
-
- <?php
-
- class Form extends CI_Controller {
-
- public function index()
- {
- $this->load->helper(array('form', 'url'));
-
- $this->load->library('form_validation');
-
- if ($this->form_validation->run() == FALSE)
- {
- $this->load->view('myform');
- }
- else
- {
- $this->load->view('formsuccess');
- }
- }
- }
-
-Try it!
-=======
-
-To try your form, visit your site using a URL similar to this one::
-
- example.com/index.php/form/
-
-If you submit the form you should simply see the form reload. That's
-because you haven't set up any validation rules yet.
-
-**Since you haven't told the Form Validation class to validate anything
-yet, it returns FALSE (boolean false) by default. ``The run()`` method
-only returns TRUE if it has successfully applied your rules without any
-of them failing.**
-
-Explanation
-===========
-
-You'll notice several things about the above pages:
-
-The form (myform.php) is a standard web form with a couple exceptions:
-
-#. It uses a form helper to create the form opening. Technically, this
- isn't necessary. You could create the form using standard HTML.
- However, the benefit of using the helper is that it generates the
- action URL for you, based on the URL in your config file. This makes
- your application more portable in the event your URLs change.
-#. At the top of the form you'll notice the following function call:
- ::
-
- <?php echo validation_errors(); ?>
-
- This function will return any error messages sent back by the
- validator. If there are no messages it returns an empty string.
-
-The controller (Form.php) has one method: ``index()``. This method
-initializes the validation class and loads the form helper and URL
-helper used by your view files. It also runs the validation routine.
-Based on whether the validation was successful it either presents the
-form or the success page.
-
-.. _setting-validation-rules:
-
-Setting Validation Rules
-========================
-
-CodeIgniter lets you set as many validation rules as you need for a
-given field, cascading them in order, and it even lets you prep and
-pre-process the field data at the same time. To set validation rules you
-will use the ``set_rules()`` method::
-
- $this->form_validation->set_rules();
-
-The above method takes **three** parameters as input:
-
-#. The field name - the exact name you've given the form field.
-#. A "human" name for this field, which will be inserted into the error
- message. For example, if your field is named "user" you might give it
- a human name of "Username".
-#. The validation rules for this form field.
-#. (optional) Set custom error messages on any rules given for current field. If not provided will use the default one.
-
-.. note:: If you would like the field name to be stored in a language
- file, please see :ref:`translating-field-names`.
-
-Here is an example. In your controller (Form.php), add this code just
-below the validation initialization method::
-
- $this->form_validation->set_rules('username', 'Username', 'required');
- $this->form_validation->set_rules('password', 'Password', 'required');
- $this->form_validation->set_rules('passconf', 'Password Confirmation', 'required');
- $this->form_validation->set_rules('email', 'Email', 'required');
-
-Your controller should now look like this::
-
- <?php
-
- class Form extends CI_Controller {
-
- public function index()
- {
- $this->load->helper(array('form', 'url'));
-
- $this->load->library('form_validation');
-
- $this->form_validation->set_rules('username', 'Username', 'required');
- $this->form_validation->set_rules('password', 'Password', 'required',
- array('required' => 'You must provide a %s.')
- );
- $this->form_validation->set_rules('passconf', 'Password Confirmation', 'required');
- $this->form_validation->set_rules('email', 'Email', 'required');
-
- if ($this->form_validation->run() == FALSE)
- {
- $this->load->view('myform');
- }
- else
- {
- $this->load->view('formsuccess');
- }
- }
- }
-
-Now submit the form with the fields blank and you should see the error
-messages. If you submit the form with all the fields populated you'll
-see your success page.
-
-.. note:: The form fields are not yet being re-populated with the data
- when there is an error. We'll get to that shortly.
-
-Setting Rules Using an Array
-============================
-
-Before moving on it should be noted that the rule setting method can
-be passed an array if you prefer to set all your rules in one action. If
-you use this approach, you must name your array keys as indicated::
-
- $config = array(
- array(
- 'field' => 'username',
- 'label' => 'Username',
- 'rules' => 'required'
- ),
- array(
- 'field' => 'password',
- 'label' => 'Password',
- 'rules' => 'required',
- 'errors' => array(
- 'required' => 'You must provide a %s.',
- ),
- ),
- array(
- 'field' => 'passconf',
- 'label' => 'Password Confirmation',
- 'rules' => 'required'
- ),
- array(
- 'field' => 'email',
- 'label' => 'Email',
- 'rules' => 'required'
- )
- );
-
- $this->form_validation->set_rules($config);
-
-Cascading Rules
-===============
-
-CodeIgniter lets you pipe multiple rules together. Let's try it. Change
-your rules in the third parameter of rule setting method, like this::
-
- $this->form_validation->set_rules(
- 'username', 'Username',
- 'required|min_length[5]|max_length[12]|is_unique[users.username]',
- array(
- 'required' => 'You have not provided %s.',
- 'is_unique' => 'This %s already exists.'
- )
- );
- $this->form_validation->set_rules('password', 'Password', 'required');
- $this->form_validation->set_rules('passconf', 'Password Confirmation', 'required|matches[password]');
- $this->form_validation->set_rules('email', 'Email', 'required|valid_email|is_unique[users.email]');
-
-The above code sets the following rules:
-
-#. The username field be no shorter than 5 characters and no longer than
- 12.
-#. The password field must match the password confirmation field.
-#. The email field must contain a valid email address.
-
-Give it a try! Submit your form without the proper data and you'll see
-new error messages that correspond to your new rules. There are numerous
-rules available which you can read about in the validation reference.
-
-.. note:: You can also pass an array of rules to ``set_rules()``,
- instead of a string. Example::
-
- $this->form_validation->set_rules('username', 'Username', array('required', 'min_length[5]'));
-
-Prepping Data
-=============
-
-In addition to the validation method like the ones we used above, you
-can also prep your data in various ways. For example, you can set up
-rules like this::
-
- $this->form_validation->set_rules('username', 'Username', 'trim|required|min_length[5]|max_length[12]');
- $this->form_validation->set_rules('password', 'Password', 'trim|required|min_length[8]');
- $this->form_validation->set_rules('passconf', 'Password Confirmation', 'trim|required|matches[password]');
- $this->form_validation->set_rules('email', 'Email', 'trim|required|valid_email');
-
-In the above example, we are "trimming" the fields, checking for length
-where necessary and making sure that both password fields match.
-
-**Any native PHP function that accepts one parameter can be used as a
-rule, like ``htmlspecialchars()``, ``trim()``, etc.**
-
-.. note:: You will generally want to use the prepping functions
- **after** the validation rules so if there is an error, the
- original data will be shown in the form.
-
-Re-populating the form
-======================
-
-Thus far we have only been dealing with errors. It's time to repopulate
-the form field with the submitted data. CodeIgniter offers several
-helper functions that permit you to do this. The one you will use most
-commonly is::
-
- set_value('field name')
-
-Open your myform.php view file and update the **value** in each field
-using the :php:func:`set_value()` function:
-
-**Don't forget to include each field name in the :php:func:`set_value()`
-function calls!**
-
-::
-
- <html>
- <head>
- <title>My Form</title>
- </head>
- <body>
-
- <?php echo validation_errors(); ?>
-
- <?php echo form_open('form'); ?>
-
- <h5>Username</h5>
- <input type="text" name="username" value="<?php echo set_value('username'); ?>" size="50" />
-
- <h5>Password</h5>
- <input type="text" name="password" value="<?php echo set_value('password'); ?>" size="50" />
-
- <h5>Password Confirm</h5>
- <input type="text" name="passconf" value="<?php echo set_value('passconf'); ?>" size="50" />
-
- <h5>Email Address</h5>
- <input type="text" name="email" value="<?php echo set_value('email'); ?>" size="50" />
-
- <div><input type="submit" value="Submit" /></div>
-
- </form>
-
- </body>
- </html>
-
-Now reload your page and submit the form so that it triggers an error.
-Your form fields should now be re-populated
-
-.. note:: The :ref:`class-reference` section below
- contains methods that permit you to re-populate <select> menus,
- radio buttons, and checkboxes.
-
-.. important:: If you use an array as the name of a form field, you
- must supply it as an array to the function. Example::
-
- <input type="text" name="colors[]" value="<?php echo set_value('colors[]'); ?>" size="50" />
-
-For more info please see the :ref:`using-arrays-as-field-names` section below.
-
-Callbacks: Your own Validation Methods
-======================================
-
-The validation system supports callbacks to your own validation
-methods. This permits you to extend the validation class to meet your
-needs. For example, if you need to run a database query to see if the
-user is choosing a unique username, you can create a callback method
-that does that. Let's create an example of this.
-
-In your controller, change the "username" rule to this::
-
- $this->form_validation->set_rules('username', 'Username', 'callback_username_check');
-
-Then add a new method called ``username_check()`` to your controller.
-Here's how your controller should now look::
-
- <?php
-
- class Form extends CI_Controller {
-
- public function index()
- {
- $this->load->helper(array('form', 'url'));
-
- $this->load->library('form_validation');
-
- $this->form_validation->set_rules('username', 'Username', 'callback_username_check');
- $this->form_validation->set_rules('password', 'Password', 'required');
- $this->form_validation->set_rules('passconf', 'Password Confirmation', 'required');
- $this->form_validation->set_rules('email', 'Email', 'required|is_unique[users.email]');
-
- if ($this->form_validation->run() == FALSE)
- {
- $this->load->view('myform');
- }
- else
- {
- $this->load->view('formsuccess');
- }
- }
-
- public function username_check($str)
- {
- if ($str == 'test')
- {
- $this->form_validation->set_message('username_check', 'The {field} field can not be the word "test"');
- return FALSE;
- }
- else
- {
- return TRUE;
- }
- }
-
- }
-
-Reload your form and submit it with the word "test" as the username. You
-can see that the form field data was passed to your callback method
-for you to process.
-
-To invoke a callback just put the method name in a rule, with
-"callback\_" as the rule **prefix**. If you need to receive an extra
-parameter in your callback method, just add it normally after the
-method name between square brackets, as in: ``callback_foo[bar]``,
-then it will be passed as the second argument of your callback method.
-
-.. note:: You can also process the form data that is passed to your
- callback and return it. If your callback returns anything other than a
- boolean TRUE/FALSE it is assumed that the data is your newly processed
- form data.
-
-Callable: Use anything as a rule
-================================
-
-If callback rules aren't good enough for you (for example, because they are
-limited to your controller), don't get disappointed, there's one more way
-to create custom rules: anything that ``is_callable()`` would return TRUE for.
-
-Consider the following example::
-
- $this->form_validation->set_rules(
- 'username', 'Username',
- array(
- 'required',
- array($this->users_model, 'valid_username')
- )
- );
-
-The above code would use the ``valid_username()`` method from your
-``Users_model`` object.
-
-This is just an example of course, and callbacks aren't limited to models.
-You can use any object/method that accepts the field value as its' first
-parameter. You can also use an anonymous function::
-
- $this->form_validation->set_rules(
- 'username', 'Username',
- array(
- 'required',
- function($value)
- {
- // Check $value
- }
- )
- );
-
-Of course, since a Callable rule by itself is not a string, it isn't
-a rule name either. That is a problem when you want to set error messages
-for them. In order to get around that problem, you can put such rules as
-the second element of an array, with the first one being the rule name::
-
- $this->form_validation->set_rules(
- 'username', 'Username',
- array(
- 'required',
- array('username_callable', array($this->users_model, 'valid_username'))
- )
- );
-
-Anonymous function version::
-
- $this->form_validation->set_rules(
- 'username', 'Username',
- array(
- 'required',
- array(
- 'username_callable',
- function($str)
- {
- // Check validity of $str and return TRUE or FALSE
- }
- )
- )
- );
-
-.. _setting-error-messages:
-
-Setting Error Messages
-======================
-
-All of the native error messages are located in the following language
-file: **system/language/english/form_validation_lang.php**
-
-To set your own global custom message for a rule, you can either
-extend/override the language file by creating your own in
-**application/language/english/form_validation_lang.php** (read more
-about this in the :doc:`Language Class <language>` documentation),
-or use the following method::
-
- $this->form_validation->set_message('rule', 'Error Message');
-
-If you need to set a custom error message for a particular field on
-some particular rule, use the set_rules() method::
-
- $this->form_validation->set_rules('field_name', 'Field Label', 'rule1|rule2|rule3',
- array('rule2' => 'Error Message on rule2 for this field_name')
- );
-
-Where rule corresponds to the name of a particular rule, and Error
-Message is the text you would like displayed.
-
-If you'd like to include a field's "human" name, or the optional
-parameter some rules allow for (such as max_length), you can add the
-**{field}** and **{param}** tags to your message, respectively::
-
- $this->form_validation->set_message('min_length', '{field} must have at least {param} characters.');
-
-On a field with the human name Username and a rule of min_length[5], an
-error would display: "Username must have at least 5 characters."
-
-.. note:: The old `sprintf()` method of using **%s** in your error messages
- will still work, however it will override the tags above. You should
- use one or the other.
-
-In the callback rule example above, the error message was set by passing
-the name of the method (without the "callback\_" prefix)::
-
- $this->form_validation->set_message('username_check')
-
-.. _translating-field-names:
-
-Translating Field Names
-=======================
-
-If you would like to store the "human" name you passed to the
-``set_rules()`` method in a language file, and therefore make the name
-able to be translated, here's how:
-
-First, prefix your "human" name with **lang:**, as in this example::
-
- $this->form_validation->set_rules('first_name', 'lang:first_name', 'required');
-
-Then, store the name in one of your language file arrays (without the
-prefix)::
-
- $lang['first_name'] = 'First Name';
-
-.. note:: If you store your array item in a language file that is not
- loaded automatically by CI, you'll need to remember to load it in your
- controller using::
-
- $this->lang->load('file_name');
-
-See the :doc:`Language Class <language>` page for more info regarding
-language files.
-
-.. _changing-delimiters:
-
-Changing the Error Delimiters
-=============================
-
-By default, the Form Validation class adds a paragraph tag (<p>) around
-each error message shown. You can either change these delimiters
-globally, individually, or change the defaults in a config file.
-
-#. **Changing delimiters Globally**
- To globally change the error delimiters, in your controller method,
- just after loading the Form Validation class, add this::
-
- $this->form_validation->set_error_delimiters('<div class="error">', '</div>');
-
- In this example, we've switched to using div tags.
-
-#. **Changing delimiters Individually**
- Each of the two error generating functions shown in this tutorial can
- be supplied their own delimiters as follows::
-
- <?php echo form_error('field name', '<div class="error">', '</div>'); ?>
-
- Or::
-
- <?php echo validation_errors('<div class="error">', '</div>'); ?>
-
-#. **Set delimiters in a config file**
- You can add your error delimiters in application/config/form_validation.php as follows::
-
- $config['error_prefix'] = '<div class="error_prefix">';
- $config['error_suffix'] = '</div>';
-
-Showing Errors Individually
-===========================
-
-If you prefer to show an error message next to each form field, rather
-than as a list, you can use the :php:func:`form_error()` function.
-
-Try it! Change your form so that it looks like this::
-
- <h5>Username</h5>
- <?php echo form_error('username'); ?>
- <input type="text" name="username" value="<?php echo set_value('username'); ?>" size="50" />
-
- <h5>Password</h5>
- <?php echo form_error('password'); ?>
- <input type="text" name="password" value="<?php echo set_value('password'); ?>" size="50" />
-
- <h5>Password Confirm</h5>
- <?php echo form_error('passconf'); ?>
- <input type="text" name="passconf" value="<?php echo set_value('passconf'); ?>" size="50" />
-
- <h5>Email Address</h5>
- <?php echo form_error('email'); ?>
- <input type="text" name="email" value="<?php echo set_value('email'); ?>" size="50" />
-
-If there are no errors, nothing will be shown. If there is an error, the
-message will appear.
-
-.. important:: If you use an array as the name of a form field, you
- must supply it as an array to the function. Example::
-
- <?php echo form_error('options[size]'); ?>
- <input type="text" name="options[size]" value="<?php echo set_value("options[size]"); ?>" size="50" />
-
-For more info please see the :ref:`using-arrays-as-field-names` section below.
-
-Validating an Array (other than $_POST)
-=======================================
-
-Sometimes you may want to validate an array that does not originate from ``$_POST`` data.
-
-In this case, you can specify the array to be validated::
-
- $data = array(
- 'username' => 'johndoe',
- 'password' => 'mypassword',
- 'passconf' => 'mypassword'
- );
-
- $this->form_validation->set_data($data);
-
-Creating validation rules, running the validation, and retrieving error
-messages works the same whether you are validating ``$_POST`` data or
-another array of your choice.
-
-.. important:: You have to call the ``set_data()`` method *before* defining
- any validation rules.
-
-.. important:: If you want to validate more than one array during a single
- execution, then you should call the ``reset_validation()`` method
- before setting up rules and validating the new array.
-
-For more info please see the :ref:`class-reference` section below.
-
-.. _saving-groups:
-
-************************************************
-Saving Sets of Validation Rules to a Config File
-************************************************
-
-A nice feature of the Form Validation class is that it permits you to
-store all your validation rules for your entire application in a config
-file. You can organize these rules into "groups". These groups can
-either be loaded automatically when a matching controller/method is
-called, or you can manually call each set as needed.
-
-How to save your rules
-======================
-
-To store your validation rules, simply create a file named
-form_validation.php in your application/config/ folder. In that file
-you will place an array named $config with your rules. As shown earlier,
-the validation array will have this prototype::
-
- $config = array(
- array(
- 'field' => 'username',
- 'label' => 'Username',
- 'rules' => 'required'
- ),
- array(
- 'field' => 'password',
- 'label' => 'Password',
- 'rules' => 'required'
- ),
- array(
- 'field' => 'passconf',
- 'label' => 'Password Confirmation',
- 'rules' => 'required'
- ),
- array(
- 'field' => 'email',
- 'label' => 'Email',
- 'rules' => 'required'
- )
- );
-
-Your validation rule file will be loaded automatically and used when you
-call the ``run()`` method.
-
-Please note that you MUST name your ``$config`` array.
-
-Creating Sets of Rules
-======================
-
-In order to organize your rules into "sets" requires that you place them
-into "sub arrays". Consider the following example, showing two sets of
-rules. We've arbitrarily called these two rules "signup" and "email".
-You can name your rules anything you want::
-
- $config = array(
- 'signup' => array(
- array(
- 'field' => 'username',
- 'label' => 'Username',
- 'rules' => 'required'
- ),
- array(
- 'field' => 'password',
- 'label' => 'Password',
- 'rules' => 'required'
- ),
- array(
- 'field' => 'passconf',
- 'label' => 'Password Confirmation',
- 'rules' => 'required'
- ),
- array(
- 'field' => 'email',
- 'label' => 'Email',
- 'rules' => 'required'
- )
- ),
- 'email' => array(
- array(
- 'field' => 'emailaddress',
- 'label' => 'EmailAddress',
- 'rules' => 'required|valid_email'
- ),
- array(
- 'field' => 'name',
- 'label' => 'Name',
- 'rules' => 'required|alpha'
- ),
- array(
- 'field' => 'title',
- 'label' => 'Title',
- 'rules' => 'required'
- ),
- array(
- 'field' => 'message',
- 'label' => 'MessageBody',
- 'rules' => 'required'
- )
- )
- );
-
-Calling a Specific Rule Group
-=============================
-
-In order to call a specific group, you will pass its name to the ``run()``
-method. For example, to call the signup rule you will do this::
-
- if ($this->form_validation->run('signup') == FALSE)
- {
- $this->load->view('myform');
- }
- else
- {
- $this->load->view('formsuccess');
- }
-
-Associating a Controller Method with a Rule Group
-=================================================
-
-An alternate (and more automatic) method of calling a rule group is to
-name it according to the controller class/method you intend to use it
-with. For example, let's say you have a controller named Member and a
-method named signup. Here's what your class might look like::
-
- <?php
-
- class Member extends CI_Controller {
-
- public function signup()
- {
- $this->load->library('form_validation');
-
- if ($this->form_validation->run() == FALSE)
- {
- $this->load->view('myform');
- }
- else
- {
- $this->load->view('formsuccess');
- }
- }
- }
-
-In your validation config file, you will name your rule group
-member/signup::
-
- $config = array(
- 'member/signup' => array(
- array(
- 'field' => 'username',
- 'label' => 'Username',
- 'rules' => 'required'
- ),
- array(
- 'field' => 'password',
- 'label' => 'Password',
- 'rules' => 'required'
- ),
- array(
- 'field' => 'passconf',
- 'label' => 'PasswordConfirmation',
- 'rules' => 'required'
- ),
- array(
- 'field' => 'email',
- 'label' => 'Email',
- 'rules' => 'required'
- )
- )
- );
-
-When a rule group is named identically to a controller class/method it
-will be used automatically when the ``run()`` method is invoked from that
-class/method.
-
-.. _using-arrays-as-field-names:
-
-***************************
-Using Arrays as Field Names
-***************************
-
-The Form Validation class supports the use of arrays as field names.
-Consider this example::
-
- <input type="text" name="options[]" value="" size="50" />
-
-If you do use an array as a field name, you must use the EXACT array
-name in the :ref:`Helper Functions <helper-functions>` that require the
-field name, and as your Validation Rule field name.
-
-For example, to set a rule for the above field you would use::
-
- $this->form_validation->set_rules('options[]', 'Options', 'required');
-
-Or, to show an error for the above field you would use::
-
- <?php echo form_error('options[]'); ?>
-
-Or to re-populate the field you would use::
-
- <input type="text" name="options[]" value="<?php echo set_value('options[]'); ?>" size="50" />
-
-You can use multidimensional arrays as field names as well. For example::
-
- <input type="text" name="options[size]" value="" size="50" />
-
-Or even::
-
- <input type="text" name="sports[nba][basketball]" value="" size="50" />
-
-As with our first example, you must use the exact array name in the
-helper functions::
-
- <?php echo form_error('sports[nba][basketball]'); ?>
-
-If you are using checkboxes (or other fields) that have multiple
-options, don't forget to leave an empty bracket after each option, so
-that all selections will be added to the POST array::
-
- <input type="checkbox" name="options[]" value="red" />
- <input type="checkbox" name="options[]" value="blue" />
- <input type="checkbox" name="options[]" value="green" />
-
-Or if you use a multidimensional array::
-
- <input type="checkbox" name="options[color][]" value="red" />
- <input type="checkbox" name="options[color][]" value="blue" />
- <input type="checkbox" name="options[color][]" value="green" />
-
-When you use a helper function you'll include the bracket as well::
-
- <?php echo form_error('options[color][]'); ?>
-
-
-**************
-Rule Reference
-**************
-
-The following is a list of all the native rules that are available to
-use:
-
-========================= ========== ============================================================================================= =======================
-Rule Parameter Description Example
-========================= ========== ============================================================================================= =======================
-**required** No Returns FALSE if the form element is empty.
-**matches** Yes Returns FALSE if the form element does not match the one in the parameter. matches[form_item]
-**regex_match** Yes Returns FALSE if the form element does not match the regular expression. regex_match[/regex/]
-**differs** Yes Returns FALSE if the form element does not differ from the one in the parameter. differs[form_item]
-**is_unique** Yes Returns FALSE if the form element is not unique to the table and field name in the is_unique[table.field]
- parameter. Note: This rule requires :doc:`Query Builder <../database/query_builder>` to be
- enabled in order to work.
-**min_length** Yes Returns FALSE if the form element is shorter than the parameter value. min_length[3]
-**max_length** Yes Returns FALSE if the form element is longer than the parameter value. max_length[12]
-**exact_length** Yes Returns FALSE if the form element is not exactly the parameter value. exact_length[8]
-**greater_than** Yes Returns FALSE if the form element is less than or equal to the parameter value or not greater_than[8]
- numeric.
-**greater_than_equal_to** Yes Returns FALSE if the form element is less than the parameter value, greater_than_equal_to[8]
- or not numeric.
-**less_than** Yes Returns FALSE if the form element is greater than or equal to the parameter value or less_than[8]
- not numeric.
-**less_than_equal_to** Yes Returns FALSE if the form element is greater than the parameter value, less_than_equal_to[8]
- or not numeric.
-**in_list** Yes Returns FALSE if the form element is not within a predetermined list. in_list[red,blue,green]
-**alpha** No Returns FALSE if the form element contains anything other than alphabetical characters.
-**alpha_numeric** No Returns FALSE if the form element contains anything other than alpha-numeric characters.
-**alpha_numeric_spaces** No Returns FALSE if the form element contains anything other than alpha-numeric characters
- or spaces. Should be used after trim to avoid spaces at the beginning or end.
-**alpha_dash** No Returns FALSE if the form element contains anything other than alpha-numeric characters,
- underscores or dashes.
-**numeric** No Returns FALSE if the form element contains anything other than numeric characters.
-**integer** No Returns FALSE if the form element contains anything other than an integer.
-**decimal** No Returns FALSE if the form element contains anything other than a decimal number.
-**is_natural** No Returns FALSE if the form element contains anything other than a natural number:
- 0, 1, 2, 3, etc.
-**is_natural_no_zero** No Returns FALSE if the form element contains anything other than a natural
- number, but not zero: 1, 2, 3, etc.
-**valid_url** No Returns FALSE if the form element does not contain a valid URL.
-**valid_email** No Returns FALSE if the form element does not contain a valid email address.
-**valid_emails** No Returns FALSE if any value provided in a comma separated list is not a valid email.
-**valid_ip** Yes Returns FALSE if the supplied IP address is not valid.
- Accepts an optional parameter of 'ipv4' or 'ipv6' to specify an IP format.
-**valid_base64** No Returns FALSE if the supplied string contains anything other than valid Base64 characters.
-========================= ========== ============================================================================================= =======================
-
-.. note:: These rules can also be called as discrete methods. For
- example::
-
- $this->form_validation->required($string);
-
-.. note:: You can also use any native PHP functions that permit up
- to two parameters, where at least one is required (to pass
- the field data).
-
-******************
-Prepping Reference
-******************
-
-The following is a list of all the prepping methods that are available
-to use:
-
-==================== ========= ==============================================================================================================
-Name Parameter Description
-==================== ========= ==============================================================================================================
-**prep_for_form** No DEPRECATED: Converts special characters so that HTML data can be shown in a form field without breaking it.
-**prep_url** No Adds "\http://" to URLs if missing.
-**strip_image_tags** No Strips the HTML from image tags leaving the raw URL.
-**encode_php_tags** No Converts PHP tags to entities.
-==================== ========= ==============================================================================================================
-
-.. note:: You can also use any native PHP functions that permits one
- parameter, like ``trim()``, ``htmlspecialchars()``, ``urldecode()``,
- etc.
-
-.. _class-reference:
-
-***************
-Class Reference
-***************
-
-.. php:class:: CI_Form_validation
-
- .. php:method:: set_rules($field[, $label = ''[, $rules = ''[, $errors = array()]]])
-
- :param string $field: Field name
- :param string $label: Field label
- :param mixed $rules: Validation rules, as a string list separated by a pipe "|", or as an array or rules
- :param array $errors: A list of custom error messages
- :returns: CI_Form_validation instance (method chaining)
- :rtype: CI_Form_validation
-
- Permits you to set validation rules, as described in the tutorial
- sections above:
-
- - :ref:`setting-validation-rules`
- - :ref:`saving-groups`
-
- .. php:method:: run([$group = ''])
-
- :param string $group: The name of the validation group to run
- :returns: TRUE on success, FALSE if validation failed
- :rtype: bool
-
- Runs the validation routines. Returns boolean TRUE on success and FALSE
- on failure. You can optionally pass the name of the validation group via
- the method, as described in: :ref:`saving-groups`
-
- .. php:method:: set_message($lang[, $val = ''])
-
- :param string $lang: The rule the message is for
- :param string $val: The message
- :returns: CI_Form_validation instance (method chaining)
- :rtype: CI_Form_validation
-
- Permits you to set custom error messages. See :ref:`setting-error-messages`
-
- .. php:method:: set_error_delimiters([$prefix = '<p>'[, $suffix = '</p>']])
-
- :param string $prefix: Error message prefix
- :param string $suffix: Error message suffix
- :returns: CI_Form_validation instance (method chaining)
- :rtype: CI_Form_validation
-
- Sets the default prefix and suffix for error messages.
-
- .. php:method:: set_data($data)
-
- :param array $data: Array of data validate
- :returns: CI_Form_validation instance (method chaining)
- :rtype: CI_Form_validation
-
- Permits you to set an array for validation, instead of using the default
- ``$_POST`` array.
-
- .. php:method:: reset_validation()
-
- :returns: CI_Form_validation instance (method chaining)
- :rtype: CI_Form_validation
-
- Permits you to reset the validation when you validate more than one array.
- This method should be called before validating each new array.
-
- .. php:method:: error_array()
-
- :returns: Array of error messages
- :rtype: array
-
- Returns the error messages as an array.
-
- .. php:method:: error_string([$prefix = ''[, $suffix = '']])
-
- :param string $prefix: Error message prefix
- :param string $suffix: Error message suffix
- :returns: Error messages as a string
- :rtype: string
-
- Returns all error messages (as returned from error_array()) formatted as a
- string and separated by a newline character.
-
- .. php:method:: error($field[, $prefix = ''[, $suffix = '']])
-
- :param string $field: Field name
- :param string $prefix: Optional prefix
- :param string $suffix: Optional suffix
- :returns: Error message string
- :rtype: string
-
- Returns the error message for a specific field, optionally adding a
- prefix and/or suffix to it (usually HTML tags).
-
- .. php:method:: has_rule($field)
-
- :param string $field: Field name
- :returns: TRUE if the field has rules set, FALSE if not
- :rtype: bool
-
- Checks to see if there is a rule set for the specified field.
-
-.. _helper-functions:
-
-****************
-Helper Reference
-****************
-
-Please refer to the :doc:`Form Helper <../helpers/form_helper>` manual for
-the following functions:
-
-- :php:func:`form_error()`
-- :php:func:`validation_errors()`
-- :php:func:`set_value()`
-- :php:func:`set_select()`
-- :php:func:`set_checkbox()`
-- :php:func:`set_radio()`
-
-Note that these are procedural functions, so they **do not** require you
-to prepend them with ``$this->form_validation``.
diff --git a/user_guide_src/source/libraries/ftp.rst b/user_guide_src/source/libraries/ftp.rst
deleted file mode 100644
index 2a015256d..000000000
--- a/user_guide_src/source/libraries/ftp.rst
+++ /dev/null
@@ -1,306 +0,0 @@
-#########
-FTP Class
-#########
-
-CodeIgniter's FTP Class permits files to be transferred to a remote
-server. Remote files can also be moved, renamed, and deleted. The FTP
-class also includes a "mirroring" function that permits an entire local
-directory to be recreated remotely via FTP.
-
-.. note:: SFTP and SSL FTP protocols are not supported, only standard
- FTP.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-**************************
-Working with the FTP Class
-**************************
-
-Initializing the Class
-======================
-
-Like most other classes in CodeIgniter, the FTP class is initialized in
-your controller using the $this->load->library function::
-
- $this->load->library('ftp');
-
-Once loaded, the FTP object will be available using: $this->ftp
-
-Usage Examples
-==============
-
-In this example a connection is opened to the FTP server, and a local
-file is read and uploaded in ASCII mode. The file permissions are set to
-755.
-::
-
- $this->load->library('ftp');
-
- $config['hostname'] = 'ftp.example.com';
- $config['username'] = 'your-username';
- $config['password'] = 'your-password';
- $config['debug'] = TRUE;
-
- $this->ftp->connect($config);
-
- $this->ftp->upload('/local/path/to/myfile.html', '/public_html/myfile.html', 'ascii', 0775);
-
- $this->ftp->close();
-
-In this example a list of files is retrieved from the server.
-::
-
- $this->load->library('ftp');
-
- $config['hostname'] = 'ftp.example.com';
- $config['username'] = 'your-username';
- $config['password'] = 'your-password';
- $config['debug'] = TRUE;
-
- $this->ftp->connect($config);
-
- $list = $this->ftp->list_files('/public_html/');
-
- print_r($list);
-
- $this->ftp->close();
-
-In this example a local directory is mirrored on the server.
-::
-
- $this->load->library('ftp');
-
- $config['hostname'] = 'ftp.example.com';
- $config['username'] = 'your-username';
- $config['password'] = 'your-password';
- $config['debug'] = TRUE;
-
- $this->ftp->connect($config);
-
- $this->ftp->mirror('/path/to/myfolder/', '/public_html/myfolder/');
-
- $this->ftp->close();
-
-***************
-Class Reference
-***************
-
-.. php:class:: CI_FTP
-
- .. php:method:: connect([$config = array()])
-
- :param array $config: Connection values
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Connects and logs into to the FTP server. Connection preferences are set
- by passing an array to the function, or you can store them in a config
- file.
-
- Here is an example showing how you set preferences manually::
-
- $this->load->library('ftp');
-
- $config['hostname'] = 'ftp.example.com';
- $config['username'] = 'your-username';
- $config['password'] = 'your-password';
- $config['port'] = 21;
- $config['passive'] = FALSE;
- $config['debug'] = TRUE;
-
- $this->ftp->connect($config);
-
- **Setting FTP Preferences in a Config File**
-
- If you prefer you can store your FTP preferences in a config file.
- Simply create a new file called the ftp.php, add the $config array in
- that file. Then save the file at *application/config/ftp.php* and it
- will be used automatically.
-
- **Available connection options**
-
- ============== =============== =============================================================================
- Option name Default value Description
- ============== =============== =============================================================================
- **hostname** n/a FTP hostname (usually something like: ftp.example.com)
- **username** n/a FTP username
- **password** n/a FTP password
- **port** 21 FTP server port number
- **debug** FALSE TRUE/FALSE (boolean): Whether to enable debugging to display error messages
- **passive** TRUE TRUE/FALSE (boolean): Whether to use passive mode
- ============== =============== =============================================================================
-
- .. php:method:: upload($locpath, $rempath[, $mode = 'auto'[, $permissions = NULL]])
-
- :param string $locpath: Local file path
- :param string $rempath: Remote file path
- :param string $mode: FTP mode, defaults to 'auto' (options are: 'auto', 'binary', 'ascii')
- :param int $permissions: File permissions (octal)
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Uploads a file to your server. You must supply the local path and the
- remote path, and you can optionally set the mode and permissions.
- Example::
-
- $this->ftp->upload('/local/path/to/myfile.html', '/public_html/myfile.html', 'ascii', 0775);
-
- If 'auto' mode is used it will base the mode on the file extension of the source file.
-
- If set, permissions have to be passed as an octal value.
-
- .. php:method:: download($rempath, $locpath[, $mode = 'auto'])
-
- :param string $rempath: Remote file path
- :param string $locpath: Local file path
- :param string $mode: FTP mode, defaults to 'auto' (options are: 'auto', 'binary', 'ascii')
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Downloads a file from your server. You must supply the remote path and
- the local path, and you can optionally set the mode. Example::
-
- $this->ftp->download('/public_html/myfile.html', '/local/path/to/myfile.html', 'ascii');
-
- If 'auto' mode is used it will base the mode on the file extension of the source file.
-
- Returns FALSE if the download does not execute successfully
- (including if PHP does not have permission to write the local file).
-
- .. php:method:: rename($old_file, $new_file[, $move = FALSE])
-
- :param string $old_file: Old file name
- :param string $new_file: New file name
- :param bool $move: Whether a move is being performed
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Permits you to rename a file. Supply the source file name/path and the new file name/path.
- ::
-
- // Renames green.html to blue.html
- $this->ftp->rename('/public_html/foo/green.html', '/public_html/foo/blue.html');
-
- .. php:method:: move($old_file, $new_file)
-
- :param string $old_file: Old file name
- :param string $new_file: New file name
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Lets you move a file. Supply the source and destination paths::
-
- // Moves blog.html from "joe" to "fred"
- $this->ftp->move('/public_html/joe/blog.html', '/public_html/fred/blog.html');
-
- .. note:: If the destination file name is different the file will be renamed.
-
- .. php:method:: delete_file($filepath)
-
- :param string $filepath: Path to file to delete
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Lets you delete a file. Supply the source path with the file name.
- ::
-
- $this->ftp->delete_file('/public_html/joe/blog.html');
-
- .. php:method:: delete_dir($filepath)
-
- :param string $filepath: Path to directory to delete
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Lets you delete a directory and everything it contains. Supply the
- source path to the directory with a trailing slash.
-
- .. important:: Be VERY careful with this method!
- It will recursively delete **everything** within the supplied path,
- including sub-folders and all files. Make absolutely sure your path
- is correct. Try using ``list_files()`` first to verify that your path is correct.
-
- ::
-
- $this->ftp->delete_dir('/public_html/path/to/folder/');
-
- .. php:method:: list_files([$path = '.'])
-
- :param string $path: Directory path
- :returns: An array list of files or FALSE on failure
- :rtype: array
-
- Permits you to retrieve a list of files on your server returned as an
- array. You must supply the path to the desired directory.
- ::
-
- $list = $this->ftp->list_files('/public_html/');
- print_r($list);
-
- .. php:method:: mirror($locpath, $rempath)
-
- :param string $locpath: Local path
- :param string $rempath: Remote path
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Recursively reads a local folder and everything it contains (including
- sub-folders) and creates a mirror via FTP based on it. Whatever the
- directory structure of the original file path will be recreated on the
- server. You must supply a source path and a destination path::
-
- $this->ftp->mirror('/path/to/myfolder/', '/public_html/myfolder/');
-
- .. php:method:: mkdir($path[, $permissions = NULL])
-
- :param string $path: Path to directory to create
- :param int $permissions: Permissions (octal)
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Lets you create a directory on your server. Supply the path ending in
- the folder name you wish to create, with a trailing slash.
-
- Permissions can be set by passing an octal value in the second parameter.
- ::
-
- // Creates a folder named "bar"
- $this->ftp->mkdir('/public_html/foo/bar/', 0755);
-
- .. php:method:: chmod($path, $perm)
-
- :param string $path: Path to alter permissions for
- :param int $perm: Permissions (octal)
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Permits you to set file permissions. Supply the path to the file or
- directory you wish to alter permissions on::
-
- // Chmod "bar" to 755
- $this->ftp->chmod('/public_html/foo/bar/', 0755);
-
- .. php:method:: changedir($path[, $suppress_debug = FALSE])
-
- :param string $path: Directory path
- :param bool $suppress_debug: Whether to turn off debug messages for this command
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Changes the current working directory to the specified path.
-
- The ``$suppress_debug`` parameter is useful in case you want to use this method
- as an ``is_dir()`` alternative for FTP.
-
- .. php:method:: close()
-
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Closes the connection to your server. It's recommended that you use this
- when you are finished uploading. \ No newline at end of file
diff --git a/user_guide_src/source/libraries/image_lib.rst b/user_guide_src/source/libraries/image_lib.rst
deleted file mode 100644
index 22407962f..000000000
--- a/user_guide_src/source/libraries/image_lib.rst
+++ /dev/null
@@ -1,475 +0,0 @@
-########################
-Image Manipulation Class
-########################
-
-CodeIgniter's Image Manipulation class lets you perform the following
-actions:
-
-- Image Resizing
-- Thumbnail Creation
-- Image Cropping
-- Image Rotating
-- Image Watermarking
-
-All three major image libraries are supported: GD/GD2, NetPBM, and
-ImageMagick
-
-.. note:: Watermarking is only available using the GD/GD2 library. In
- addition, even though other libraries are supported, GD is required in
- order for the script to calculate the image properties. The image
- processing, however, will be performed with the library you specify.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-**********************
-Initializing the Class
-**********************
-
-Like most other classes in CodeIgniter, the image class is initialized
-in your controller using the $this->load->library function::
-
- $this->load->library('image_lib');
-
-Once the library is loaded it will be ready for use. The image library
-object you will use to call all functions is: ``$this->image_lib``
-
-Processing an Image
-===================
-
-Regardless of the type of processing you would like to perform
-(resizing, cropping, rotation, or watermarking), the general process is
-identical. You will set some preferences corresponding to the action you
-intend to perform, then call one of four available processing functions.
-For example, to create an image thumbnail you'll do this::
-
- $config['image_library'] = 'gd2';
- $config['source_image'] = '/path/to/image/mypic.jpg';
- $config['create_thumb'] = TRUE;
- $config['maintain_ratio'] = TRUE;
- $config['width'] = 75;
- $config['height'] = 50;
-
- $this->load->library('image_lib', $config);
-
- $this->image_lib->resize();
-
-The above code tells the image_resize function to look for an image
-called *mypic.jpg* located in the source_image folder, then create a
-thumbnail that is 75 X 50 pixels using the GD2 image_library. Since the
-maintain_ratio option is enabled, the thumb will be as close to the
-target width and height as possible while preserving the original aspect
-ratio. The thumbnail will be called *mypic_thumb.jpg* and located at
-the same level as *source_image*.
-
-.. note:: In order for the image class to be allowed to do any
- processing, the folder containing the image files must have write
- permissions.
-
-.. note:: Image processing can require a considerable amount of server
- memory for some operations. If you are experiencing out of memory errors
- while processing images you may need to limit their maximum size, and/or
- adjust PHP memory limits.
-
-Processing Methods
-==================
-
-There are four available processing methods:
-
-- $this->image_lib->resize()
-- $this->image_lib->crop()
-- $this->image_lib->rotate()
-- $this->image_lib->watermark()
-
-These methods return boolean TRUE upon success and FALSE for failure.
-If they fail you can retrieve the error message using this function::
-
- echo $this->image_lib->display_errors();
-
-A good practice is to use the processing function conditionally, showing an
-error upon failure, like this::
-
- if ( ! $this->image_lib->resize())
- {
- echo $this->image_lib->display_errors();
- }
-
-.. note:: You can optionally specify the HTML formatting to be applied to
- the errors, by submitting the opening/closing tags in the function,
- like this::
-
- $this->image_lib->display_errors('<p>', '</p>');
-
-.. _processing-preferences:
-
-Preferences
-===========
-
-The preferences described below allow you to tailor the image processing
-to suit your needs.
-
-Note that not all preferences are available for every function. For
-example, the x/y axis preferences are only available for image cropping.
-Likewise, the width and height preferences have no effect on cropping.
-The "availability" column indicates which functions support a given
-preference.
-
-Availability Legend:
-
-- R - Image Resizing
-- C - Image Cropping
-- X - Image Rotation
-- W - Image Watermarking
-
-======================= ======================= =============================== =========================================================================== =============
-Preference Default Value Options Description Availability
-======================= ======================= =============================== =========================================================================== =============
-**image_library** GD2 GD, GD2, ImageMagick, NetPBM Sets the image library to be used. R, C, X, W
-**library_path** None None Sets the server path to your ImageMagick or NetPBM library. If you use R, C, X
- either of those libraries you must supply the path. R, C, S, W
-**source_image** None None Sets the source image name/path. The path must be a relative or absolute
- server path, not a URL.
-**dynamic_output** FALSE TRUE/FALSE (boolean) Determines whether the new image file should be written to disk or R, C, X, W
- generated dynamically. Note: If you choose the dynamic setting, only one
- image can be shown at a time, and it can't be positioned on the page. It
- simply outputs the raw image dynamically to your browser, along with
- image headers.
-**file_permissions** 0644 (integer) File system permissions to apply on the resulting image file, R, C, X, W
- writing it to the disk. WARNING: Use octal integer notation!
-**quality** 90% 1 - 100% Sets the quality of the image. The higher the quality the larger the R, C, X, W
- file size.
-**new_image** None None Sets the destination image name/path. You'll use this preference when R, C, X, W
- creating an image copy. The path must be a relative or absolute server
- path, not a URL.
-**width** None None Sets the width you would like the image set to. R, C
-**height** None None Sets the height you would like the image set to. R, C
-**create_thumb** FALSE TRUE/FALSE (boolean) Tells the image processing function to create a thumb. R
-**thumb_marker** _thumb None Specifies the thumbnail indicator. It will be inserted just before the R
- file extension, so mypic.jpg would become mypic_thumb.jpg
-**maintain_ratio** TRUE TRUE/FALSE (boolean) Specifies whether to maintain the original aspect ratio when resizing or R, C
- use hard values.
-**master_dim** auto auto, width, height Specifies what to use as the master axis when resizing or creating R
- thumbs. For example, let's say you want to resize an image to 100 X 75
- pixels. If the source image size does not allow perfect resizing to
- those dimensions, this setting determines which axis should be used as
- the hard value. "auto" sets the axis automatically based on whether the
- image is taller than wider, or vice versa.
-**rotation_angle** None 90, 180, 270, vrt, hor Specifies the angle of rotation when rotating images. Note that PHP X
- rotates counter-clockwise, so a 90 degree rotation to the right must be
- specified as 270.
-**x_axis** None None Sets the X coordinate in pixels for image cropping. For example, a C
- setting of 30 will crop an image 30 pixels from the left.
-**y_axis** None None Sets the Y coordinate in pixels for image cropping. For example, a C
- setting of 30 will crop an image 30 pixels from the top.
-======================= ======================= =============================== =========================================================================== =============
-
-Setting preferences in a config file
-====================================
-
-If you prefer not to set preferences using the above method, you can
-instead put them into a config file. Simply create a new file called
-image_lib.php, add the $config array in that file. Then save the file
-in *config/image_lib.php* and it will be used automatically. You will
-NOT need to use the ``$this->image_lib->initialize()`` method if you save
-your preferences in a config file.
-
-******************
-Image Watermarking
-******************
-
-The Watermarking feature requires the GD/GD2 library.
-
-Two Types of Watermarking
-=========================
-
-There are two types of watermarking that you can use:
-
-- **Text**: The watermark message will be generated using text, either
- with a True Type font that you specify, or using the native text
- output that the GD library supports. If you use the True Type version
- your GD installation must be compiled with True Type support (most
- are, but not all).
-- **Overlay**: The watermark message will be generated by overlaying an
- image (usually a transparent PNG or GIF) containing your watermark
- over the source image.
-
-.. _watermarking:
-
-Watermarking an Image
-=====================
-
-Just as with the other methods (resizing, cropping, and rotating) the
-general process for watermarking involves setting the preferences
-corresponding to the action you intend to perform, then calling the
-watermark function. Here is an example::
-
- $config['source_image'] = '/path/to/image/mypic.jpg';
- $config['wm_text'] = 'Copyright 2006 - John Doe';
- $config['wm_type'] = 'text';
- $config['wm_font_path'] = './system/fonts/texb.ttf';
- $config['wm_font_size'] = '16';
- $config['wm_font_color'] = 'ffffff';
- $config['wm_vrt_alignment'] = 'bottom';
- $config['wm_hor_alignment'] = 'center';
- $config['wm_padding'] = '20';
-
- $this->image_lib->initialize($config);
-
- $this->image_lib->watermark();
-
-The above example will use a 16 pixel True Type font to create the text
-"Copyright 2006 - John Doe". The watermark will be positioned at the
-bottom/center of the image, 20 pixels from the bottom of the image.
-
-.. note:: In order for the image class to be allowed to do any
- processing, the image file must have "write" file permissions
- For example, 777.
-
-Watermarking Preferences
-========================
-
-This table shows the preferences that are available for both types of
-watermarking (text or overlay)
-
-======================= =================== ======================= ==========================================================================
-Preference Default Value Options Description
-======================= =================== ======================= ==========================================================================
-**wm_type** text text, overlay Sets the type of watermarking that should be used.
-**source_image** None None Sets the source image name/path. The path must be a relative or absolute
- server path, not a URL.
-**dynamic_output** FALSE TRUE/FALSE (boolean) Determines whether the new image file should be written to disk or
- generated dynamically. Note: If you choose the dynamic setting, only one
- image can be shown at a time, and it can't be positioned on the page. It
- simply outputs the raw image dynamically to your browser, along with
- image headers.
-**quality** 90% 1 - 100% Sets the quality of the image. The higher the quality the larger the
- file size.
-**wm_padding** None A number The amount of padding, set in pixels, that will be applied to the
- watermark to set it away from the edge of your images.
-**wm_vrt_alignment** bottom top, middle, bottom Sets the vertical alignment for the watermark image.
-**wm_hor_alignment** center left, center, right Sets the horizontal alignment for the watermark image.
-**wm_hor_offset** None None You may specify a horizontal offset (in pixels) to apply to the
- watermark position. The offset normally moves the watermark to the
- right, except if you have your alignment set to "right" then your offset
- value will move the watermark toward the left of the image.
-**wm_vrt_offset** None None You may specify a vertical offset (in pixels) to apply to the watermark
- position. The offset normally moves the watermark down, except if you
- have your alignment set to "bottom" then your offset value will move the
- watermark toward the top of the image.
-======================= =================== ======================= ==========================================================================
-
-Text Preferences
-----------------
-
-This table shows the preferences that are available for the text type of
-watermarking.
-
-======================= =================== =================== ==========================================================================
-Preference Default Value Options Description
-======================= =================== =================== ==========================================================================
-**wm_text** None None The text you would like shown as the watermark. Typically this will be a
- copyright notice.
-**wm_font_path** None None The server path to the True Type Font you would like to use. If you do
- not use this option, the native GD font will be used.
-**wm_font_size** 16 None The size of the text. Note: If you are not using the True Type option
- above, the number is set using a range of 1 - 5. Otherwise, you can use
- any valid pixel size for the font you're using.
-**wm_font_color** ffffff None The font color, specified in hex. Both the full 6-length (ie, 993300) and
- the short three character abbreviated version (ie, fff) are supported.
-**wm_shadow_color** None None The color of the drop shadow, specified in hex. If you leave this blank
- a drop shadow will not be used. Both the full 6-length (ie, 993300) and
- the short three character abbreviated version (ie, fff) are supported.
-**wm_shadow_distance** 3 None The distance (in pixels) from the font that the drop shadow should
- appear.
-======================= =================== =================== ==========================================================================
-
-Overlay Preferences
--------------------
-
-This table shows the preferences that are available for the overlay type
-of watermarking.
-
-======================= =================== =================== ==========================================================================
-Preference Default Value Options Description
-======================= =================== =================== ==========================================================================
-**wm_overlay_path** None None The server path to the image you wish to use as your watermark. Required
- only if you are using the overlay method.
-**wm_opacity** 50 1 - 100 Image opacity. You may specify the opacity (i.e. transparency) of your
- watermark image. This allows the watermark to be faint and not
- completely obscure the details from the original image behind it. A 50%
- opacity is typical.
-**wm_x_transp** 4 A number If your watermark image is a PNG or GIF image, you may specify a color
- on the image to be "transparent". This setting (along with the next)
- will allow you to specify that color. This works by specifying the "X"
- and "Y" coordinate pixel (measured from the upper left) within the image
- that corresponds to a pixel representative of the color you want to be
- transparent.
-**wm_y_transp** 4 A number Along with the previous setting, this allows you to specify the
- coordinate to a pixel representative of the color you want to be
- transparent.
-======================= =================== =================== ==========================================================================
-
-***************
-Class Reference
-***************
-
-.. php:class:: CI_Image_lib
-
- .. php:method:: initialize([$props = array()])
-
- :param array $props: Image processing preferences
- :returns: TRUE on success, FALSE in case of invalid settings
- :rtype: bool
-
- Initializes the class for processing an image.
-
- .. php:method:: resize()
-
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- The image resizing method lets you resize the original image, create a
- copy (with or without resizing), or create a thumbnail image.
-
- For practical purposes there is no difference between creating a copy
- and creating a thumbnail except a thumb will have the thumbnail marker
- as part of the name (i.e. mypic_thumb.jpg).
-
- All preferences listed in the :ref:`processing-preferences` table are available for this
- method except these three: *rotation_angle*, *x_axis* and *y_axis*.
-
- **Creating a Thumbnail**
-
- The resizing method will create a thumbnail file (and preserve the
- original) if you set this preference to TRUE::
-
- $config['create_thumb'] = TRUE;
-
- This single preference determines whether a thumbnail is created or not.
-
- **Creating a Copy**
-
- The resizing method will create a copy of the image file (and preserve
- the original) if you set a path and/or a new filename using this
- preference::
-
- $config['new_image'] = '/path/to/new_image.jpg';
-
- Notes regarding this preference:
-
- - If only the new image name is specified it will be placed in the same
- folder as the original
- - If only the path is specified, the new image will be placed in the
- destination with the same name as the original.
- - If both the path and image name are specified it will placed in its
- own destination and given the new name.
-
- **Resizing the Original Image**
-
- If neither of the two preferences listed above (create_thumb, and
- new_image) are used, the resizing method will instead target the
- original image for processing.
-
- .. php:method:: crop()
-
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- The cropping method works nearly identically to the resizing function
- except it requires that you set preferences for the X and Y axis (in
- pixels) specifying where to crop, like this::
-
- $config['x_axis'] = 100;
- $config['y_axis'] = 40;
-
- All preferences listed in the :ref:`processing-preferences` table are available for this
- method except these: *rotation_angle*, *create_thumb* and *new_image*.
-
- Here's an example showing how you might crop an image::
-
- $config['image_library'] = 'imagemagick';
- $config['library_path'] = '/usr/X11R6/bin/';
- $config['source_image'] = '/path/to/image/mypic.jpg';
- $config['x_axis'] = 100;
- $config['y_axis'] = 60;
-
- $this->image_lib->initialize($config);
-
- if ( ! $this->image_lib->crop())
- {
- echo $this->image_lib->display_errors();
- }
-
- .. note:: Without a visual interface it is difficult to crop images, so this
- method is not very useful unless you intend to build such an
- interface. That's exactly what we did using for the photo gallery module
- in ExpressionEngine, the CMS we develop. We added a JavaScript UI that
- lets the cropping area be selected.
-
- .. php:method:: rotate()
-
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- The image rotation method requires that the angle of rotation be set
- via its preference::
-
- $config['rotation_angle'] = '90';
-
- There are 5 rotation options:
-
- #. 90 - rotates counter-clockwise by 90 degrees.
- #. 180 - rotates counter-clockwise by 180 degrees.
- #. 270 - rotates counter-clockwise by 270 degrees.
- #. hor - flips the image horizontally.
- #. vrt - flips the image vertically.
-
- Here's an example showing how you might rotate an image::
-
- $config['image_library'] = 'netpbm';
- $config['library_path'] = '/usr/bin/';
- $config['source_image'] = '/path/to/image/mypic.jpg';
- $config['rotation_angle'] = 'hor';
-
- $this->image_lib->initialize($config);
-
- if ( ! $this->image_lib->rotate())
- {
- echo $this->image_lib->display_errors();
- }
-
- .. php:method:: watermark()
-
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Creates a watermark over an image, please refer to the :ref:`watermarking`
- section for more info.
-
- .. php:method:: clear()
-
- :rtype: void
-
- The clear method resets all of the values used when processing an
- image. You will want to call this if you are processing images in a
- loop.
-
- ::
-
- $this->image_lib->clear();
-
- .. php:method:: display_errors([$open = '<p>[, $close = '</p>']])
-
- :param string $open: Error message opening tag
- :param string $close: Error message closing tag
- :returns: Error messages
- :rtype: string
-
- Returns all detected errors formatted as a string.
- ::
-
- echo $this->image_lib->display_errors();
diff --git a/user_guide_src/source/libraries/index.rst b/user_guide_src/source/libraries/index.rst
deleted file mode 100644
index 678b633dd..000000000
--- a/user_guide_src/source/libraries/index.rst
+++ /dev/null
@@ -1,9 +0,0 @@
-#########
-Libraries
-#########
-
-.. toctree::
- :glob:
- :titlesonly:
-
- * \ No newline at end of file
diff --git a/user_guide_src/source/libraries/input.rst b/user_guide_src/source/libraries/input.rst
deleted file mode 100644
index 3dc734c12..000000000
--- a/user_guide_src/source/libraries/input.rst
+++ /dev/null
@@ -1,477 +0,0 @@
-###########
-Input Class
-###########
-
-The Input Class serves two purposes:
-
-#. It pre-processes global input data for security.
-#. It provides some helper methods for fetching input data and pre-processing it.
-
-.. note:: This class is initialized automatically by the system so there
- is no need to do it manually.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-***************
-Input Filtering
-***************
-
-Security Filtering
-==================
-
-The security filtering method is called automatically when a new
-:doc:`controller <../general/controllers>` is invoked. It does the
-following:
-
-- If ``$config['allow_get_array']`` is FALSE (default is TRUE), destroys
- the global GET array.
-- Destroys all global variables in the event register_globals is
- turned on.
-- Filters the GET/POST/COOKIE array keys, permitting only alpha-numeric
- (and a few other) characters.
-- Provides XSS (Cross-site Scripting Hacks) filtering. This can be
- enabled globally, or upon request.
-- Standardizes newline characters to ``PHP_EOL`` (\\n in UNIX-based OSes,
- \\r\\n under Windows). This is configurable.
-
-XSS Filtering
-=============
-
-The Input class has the ability to filter input automatically to prevent
-cross-site scripting attacks. If you want the filter to run
-automatically every time it encounters POST or COOKIE data you can
-enable it by opening your *application/config/config.php* file and setting
-this::
-
- $config['global_xss_filtering'] = TRUE;
-
-Please refer to the :doc:`Security class <security>` documentation for
-information on using XSS Filtering in your application.
-
-.. important:: The 'global_xss_filtering' setting is DEPRECATED and kept
- solely for backwards-compatibility purposes. XSS escaping should
- be performed on *output*, not *input*!
-
-*******************
-Accessing form data
-*******************
-
-Using POST, GET, COOKIE, or SERVER Data
-=======================================
-
-CodeIgniter comes with helper methods that let you fetch POST, GET,
-COOKIE or SERVER items. The main advantage of using the provided
-methods rather than fetching an item directly (``$_POST['something']``)
-is that the methods will check to see if the item is set and return
-NULL if not. This lets you conveniently use data without
-having to test whether an item exists first. In other words, normally
-you might do something like this::
-
- $something = isset($_POST['something']) ? $_POST['something'] : NULL;
-
-With CodeIgniter's built in methods you can simply do this::
-
- $something = $this->input->post('something');
-
-The main methods are:
-
-- ``$this->input->post()``
-- ``$this->input->get()``
-- ``$this->input->cookie()``
-- ``$this->input->server()``
-
-Using the php://input stream
-============================
-
-If you want to utilize the PUT, DELETE, PATCH or other exotic request
-methods, they can only be accessed via a special input stream, that
-can only be read once. This isn't as easy as just reading from e.g.
-the ``$_POST`` array, because it will always exist and you can try
-and access multiple variables without caring that you might only have
-one shot at all of the POST data.
-
-CodeIgniter will take care of that for you, and you can read the data
-from the **php://input** stream at any time, just by using the
-``$raw_input_stream`` property::
-
- $this->input->raw_input_stream;
-
-Additionally if the input stream is form-encoded like $_POST you can
-access its values by calling the
-``input_stream()`` method::
-
- $this->input->input_stream('key');
-
-Similar to other methods such as ``get()`` and ``post()``, if the
-requested data is not found, it will return NULL and you can also
-decide whether to run the data through ``xss_clean()`` by passing
-a boolean value as the second parameter::
-
- $this->input->input_stream('key', TRUE); // XSS Clean
- $this->input->input_stream('key', FALSE); // No XSS filter
-
-.. note:: You can utilize ``method()`` in order to know if you're reading
- PUT, DELETE or PATCH data.
-
-***************
-Class Reference
-***************
-
-.. php:class:: CI_Input
-
- .. attribute:: $raw_input_stream
-
- Read only property that will return php://input data as is.
-
- The property can be read multiple times.
-
- .. php:method:: post([$index = NULL[, $xss_clean = NULL]])
-
- :param mixed $index: POST parameter name
- :param bool $xss_clean: Whether to apply XSS filtering
- :returns: $_POST if no parameters supplied, otherwise the POST value if found or NULL if not
- :rtype: mixed
-
- The first parameter will contain the name of the POST item you are
- looking for::
-
- $this->input->post('some_data');
-
- The method returns NULL if the item you are attempting to retrieve
- does not exist.
-
- The second optional parameter lets you run the data through the XSS
- filter. It's enabled by setting the second parameter to boolean TRUE
- or by setting your ``$config['global_xss_filtering']`` to TRUE.
- ::
-
- $this->input->post('some_data', TRUE);
-
- To return an array of all POST items call without any parameters.
-
- To return all POST items and pass them through the XSS filter set the
- first parameter NULL while setting the second parameter to boolean TRUE.
- ::
-
- $this->input->post(NULL, TRUE); // returns all POST items with XSS filter
- $this->input->post(NULL, FALSE); // returns all POST items without XSS filter
-
- To return an array of multiple POST parameters, pass all the required keys
- as an array.
- ::
-
- $this->input->post(array('field1', 'field2'));
-
- Same rule applied here, to retrieve the parameters with XSS filtering enabled, set the
- second parameter to boolean TRUE.
- ::
-
- $this->input->post(array('field1', 'field2'), TRUE);
-
- .. php:method:: get([$index = NULL[, $xss_clean = NULL]])
-
- :param mixed $index: GET parameter name
- :param bool $xss_clean: Whether to apply XSS filtering
- :returns: $_GET if no parameters supplied, otherwise the GET value if found or NULL if not
- :rtype: mixed
-
- This method is identical to ``post()``, only it fetches GET data.
- ::
-
- $this->input->get('some_data', TRUE);
-
- To return an array of all GET items call without any parameters.
-
- To return all GET items and pass them through the XSS filter set the
- first parameter NULL while setting the second parameter to boolean TRUE.
- ::
-
- $this->input->get(NULL, TRUE); // returns all GET items with XSS filter
- $this->input->get(NULL, FALSE); // returns all GET items without XSS filtering
-
- To return an array of multiple GET parameters, pass all the required keys
- as an array.
- ::
-
- $this->input->get(array('field1', 'field2'));
-
- Same rule applied here, to retrieve the parameters with XSS filtering enabled, set the
- second parameter to boolean TRUE.
- ::
-
- $this->input->get(array('field1', 'field2'), TRUE);
-
- .. php:method:: post_get($index[, $xss_clean = NULL])
-
- :param string $index: POST/GET parameter name
- :param bool $xss_clean: Whether to apply XSS filtering
- :returns: POST/GET value if found, NULL if not
- :rtype: mixed
-
- This method works pretty much the same way as ``post()`` and ``get()``,
- only combined. It will search through both POST and GET streams for data,
- looking in POST first, and then in GET::
-
- $this->input->post_get('some_data', TRUE);
-
- .. php:method:: get_post($index[, $xss_clean = NULL])
-
- :param string $index: GET/POST parameter name
- :param bool $xss_clean: Whether to apply XSS filtering
- :returns: GET/POST value if found, NULL if not
- :rtype: mixed
-
- This method works the same way as ``post_get()`` only it looks for GET
- data first.
-
- $this->input->get_post('some_data', TRUE);
-
- .. note:: This method used to act EXACTLY like ``post_get()``, but it's
- behavior has changed in CodeIgniter 3.0.
-
- .. php:method:: cookie([$index = NULL[, $xss_clean = NULL]])
-
- :param mixed $index: COOKIE name
- :param bool $xss_clean: Whether to apply XSS filtering
- :returns: $_COOKIE if no parameters supplied, otherwise the COOKIE value if found or NULL if not
- :rtype: mixed
-
- This method is identical to ``post()`` and ``get()``, only it fetches cookie
- data::
-
- $this->input->cookie('some_cookie');
- $this->input->cookie('some_cookie', TRUE); // with XSS filter
-
- To return an array of multiple cookie values, pass all the required keys
- as an array.
- ::
-
- $this->input->cookie(array('some_cookie', 'some_cookie2'));
-
- .. note:: Unlike the :doc:`Cookie Helper <../helpers/cookie_helper>`
- function :php:func:`get_cookie()`, this method does NOT prepend
- your configured ``$config['cookie_prefix']`` value.
-
- .. php:method:: server($index[, $xss_clean = NULL])
-
- :param mixed $index: Value name
- :param bool $xss_clean: Whether to apply XSS filtering
- :returns: $_SERVER item value if found, NULL if not
- :rtype: mixed
-
- This method is identical to the ``post()``, ``get()`` and ``cookie()``
- methods, only it fetches server data (``$_SERVER``)::
-
- $this->input->server('some_data');
-
- To return an array of multiple ``$_SERVER`` values, pass all the required keys
- as an array.
- ::
-
- $this->input->server(array('SERVER_PROTOCOL', 'REQUEST_URI'));
-
- .. php:method:: input_stream([$index = NULL[, $xss_clean = NULL]])
-
- :param mixed $index: Key name
- :param bool $xss_clean: Whether to apply XSS filtering
- :returns: Input stream array if no parameters supplied, otherwise the specified value if found or NULL if not
- :rtype: mixed
-
- This method is identical to ``get()``, ``post()`` and ``cookie()``,
- only it fetches the *php://input* stream data.
-
- .. php:method:: set_cookie($name = ''[, $value = ''[, $expire = ''[, $domain = ''[, $path = '/'[, $prefix = ''[, $secure = NULL[, $httponly = NULL[, $samesite = NULL]]]]]]]])
-
- :param mixed $name: Cookie name or an array of parameters
- :param string $value: Cookie value
- :param int $expire: Cookie expiration time in seconds
- :param string $domain: Cookie domain
- :param string $path: Cookie path
- :param string $prefix: Cookie name prefix
- :param bool $secure: Whether to only transfer the cookie through HTTPS
- :param bool $httponly: Whether to only make the cookie accessible for HTTP requests (no JavaScript)
- :param string $samesite: SameSite attribute ('Lax', 'Strict', 'None')
- :rtype: void
-
-
- Sets a cookie containing the values you specify. There are two ways to
- pass information to this method so that a cookie can be set: Array
- Method, and Discrete Parameters:
-
- **Array Method**
-
- Using this method, an associative array is passed to the first
- parameter::
-
- $cookie = array(
- 'name' => 'The Cookie Name',
- 'value' => 'The Value',
- 'expire' => 86500,
- 'domain' => '.some-domain.com',
- 'path' => '/',
- 'prefix' => 'myprefix_',
- 'secure' => TRUE,
- 'samesite' => 'Strict'
- );
-
- $this->input->set_cookie($cookie);
-
- **Notes**
-
- Only the name and value are required. To delete a cookie set it with the
- expiration blank.
-
- The expiration is set in **seconds**, which will be added to the current
- time. Do not include the time, but rather only the number of seconds
- from *now* that you wish the cookie to be valid. If the expiration is
- set to zero the cookie will only last as long as the browser is open.
-
- For site-wide cookies regardless of how your site is requested, add your
- URL to the **domain** starting with a period, like this:
- .your-domain.com
-
- The path is usually not needed since the method sets a root path.
-
- The prefix is only needed if you need to avoid name collisions with
- other identically named cookies for your server.
-
- The *httponly* and *secure* flags, when omitted, will default to your
- ``$config['cookie_httponly']`` and ``$config['cookie_secure']`` settings.
- The *samesite* parameter can be ``'Lax'``, ``'Strict'`` or ``'None'``. If not set, the same-site cookie attribute will default to ``'Lax'``.
-
- **Discrete Parameters**
-
- If you prefer, you can set the cookie by passing data using individual
- parameters::
-
- $this->input->set_cookie($name, $value, $expire, $domain, $path, $prefix, $secure, $samesite);
-
- .. php:method:: ip_address()
-
- :returns: Visitor's IP address or '0.0.0.0' if not valid
- :rtype: string
-
- Returns the IP address for the current user. If the IP address is not
- valid, the method will return '0.0.0.0'::
-
- echo $this->input->ip_address();
-
- .. important:: This method takes into account the ``$config['proxy_ips']``
- setting and will return the reported HTTP_X_FORWARDED_FOR,
- HTTP_CLIENT_IP, HTTP_X_CLIENT_IP or HTTP_X_CLUSTER_CLIENT_IP
- address for the allowed IP addresses.
-
- .. php:method:: valid_ip($ip[, $which = ''])
-
- :param string $ip: IP address
- :param string $which: IP protocol ('ipv4' or 'ipv6')
- :returns: TRUE if the address is valid, FALSE if not
- :rtype: bool
-
- Takes an IP address as input and returns TRUE or FALSE (boolean) depending
- on whether it is valid or not.
-
- .. note:: The $this->input->ip_address() method above automatically
- validates the IP address.
-
- ::
-
- if ( ! $this->input->valid_ip($ip))
- {
- echo 'Not Valid';
- }
- else
- {
- echo 'Valid';
- }
-
- Accepts an optional second string parameter of 'ipv4' or 'ipv6' to specify
- an IP format. The default checks for both formats.
-
- .. php:method:: user_agent([$xss_clean = NULL])
-
- :returns: User agent string or NULL if not set
- :param bool $xss_clean: Whether to apply XSS filtering
- :rtype: mixed
-
- Returns the user agent string (web browser) being used by the current user,
- or NULL if it's not available.
- ::
-
- echo $this->input->user_agent();
-
- See the :doc:`User Agent Class <user_agent>` for methods which extract
- information from the user agent string.
-
- .. php:method:: request_headers([$xss_clean = FALSE])
-
- :param bool $xss_clean: Whether to apply XSS filtering
- :returns: An array of HTTP request headers
- :rtype: array
-
- Returns an array of HTTP request headers.
- Useful if running in a non-Apache environment where
- `apache_request_headers() <http://php.net/apache_request_headers>`_
- will not be supported.
- ::
-
- $headers = $this->input->request_headers();
-
- .. php:method:: get_request_header($index[, $xss_clean = FALSE])
-
- :param string $index: HTTP request header name
- :param bool $xss_clean: Whether to apply XSS filtering
- :returns: An HTTP request header or NULL if not found
- :rtype: string
-
- Returns a single member of the request headers array or NULL
- if the searched header is not found.
- ::
-
- $this->input->get_request_header('some-header', TRUE);
-
- .. php:method:: is_ajax_request()
-
- :returns: TRUE if it is an Ajax request, FALSE if not
- :rtype: bool
-
- Checks to see if the HTTP_X_REQUESTED_WITH server header has been
- set, and returns boolean TRUE if it is or FALSE if not.
-
- .. php:method:: is_cli_request()
-
- :returns: TRUE if it is a CLI request, FALSE if not
- :rtype: bool
-
- Checks to see if the application was run from the command-line
- interface.
-
- .. note:: This method checks both the PHP SAPI name currently in use
- and if the ``STDIN`` constant is defined, which is usually a
- failsafe way to see if PHP is being run via the command line.
-
- ::
-
- $this->input->is_cli_request()
-
- .. note:: This method is DEPRECATED and is now just an alias for the
- :func:`is_cli()` function.
-
- .. php:method:: method([$upper = FALSE])
-
- :param bool $upper: Whether to return the request method name in upper or lower case
- :returns: HTTP request method
- :rtype: string
-
- Returns the ``$_SERVER['REQUEST_METHOD']``, with the option to set it
- in uppercase or lowercase.
- ::
-
- echo $this->input->method(TRUE); // Outputs: POST
- echo $this->input->method(FALSE); // Outputs: post
- echo $this->input->method(); // Outputs: post
diff --git a/user_guide_src/source/libraries/javascript.rst b/user_guide_src/source/libraries/javascript.rst
deleted file mode 100644
index e91b9ad78..000000000
--- a/user_guide_src/source/libraries/javascript.rst
+++ /dev/null
@@ -1,322 +0,0 @@
-################
-Javascript Class
-################
-
-CodeIgniter provides a library to help you with certain common functions
-that you may want to use with Javascript. Please note that CodeIgniter
-does not require the jQuery library to run, and that any scripting
-library will work equally well. The jQuery library is simply presented
-as a convenience if you choose to use it.
-
-.. important:: This library is DEPRECATED and should not be used. It has always
- been with an 'experimental' status and is now no longer supported.
- Currently only kept for backwards compatibility.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-**************************
-Using the Javascript Class
-**************************
-
-Initializing the Class
-======================
-
-To initialize the Javascript class manually in your controller
-constructor, use the ``$this->load->library()`` method. Currently,
-the only available library is jQuery, which will automatically be
-loaded like this::
-
- $this->load->library('javascript');
-
-The Javascript class also accepts parameters:
-
-- js_library_driver (string) *default: 'jquery'*
-- autoload (bool) *default: TRUE*
-
-You may override the defaults by sending an associative array::
-
- $this->load->library(
- 'javascript',
- array(
- 'js_library_driver' => 'scripto',
- 'autoload' => FALSE
- )
- );
-
-Again, presently only 'jquery' is available. You may wish to set
-autoload to FALSE, though, if you do not want the jQuery library to
-automatically include a script tag for the main jQuery script file. This
-is useful if you are loading it from a location outside of CodeIgniter,
-or already have the script tag in your markup.
-
-Once loaded, the jQuery library object will be available using:
-
- $this->javascript
-
-Setup and Configuration
-=======================
-
-Set these variables in your view
---------------------------------
-
-As a Javascript library, your files must be available to your
-application.
-
-As Javascript is a client side language, the library must be able to
-write content into your final output. This generally means a view.
-You'll need to include the following variables in the ``<head>``
-sections of your output.
-
-::
-
- <?php echo $library_src;?>
- <?php echo $script_head;?>
-
-
-``$library_src``, is where the actual library file will be loaded, as
-well as any subsequent plugin script calls; $script_head is where
-specific events, functions and other commands will be rendered.
-
-Set the path to the librarys with config items
-----------------------------------------------
-
-There are some configuration items in Javascript library. These can
-either be set in *application/config.php*, within its own
-*config/javascript.php* file, or within any controller usings the
-``set_item()`` function.
-
-An image to be used as an "ajax loader", or progress indicator. Without
-one, the simple text message of "loading" will appear when Ajax calls
-need to be made.
-
-::
-
- $config['javascript_location'] = 'http://localhost/codeigniter/themes/js/jquery/';
- $config['javascript_ajax_img'] = 'images/ajax-loader.gif';
-
-If you keep your files in the same directories they were downloaded
-from, then you need not set this configuration items.
-
-The jQuery Class
-================
-
-To initialize the jQuery class manually in your controller constructor,
-use the ``$this->load->library()`` method::
-
- $this->load->library('javascript/jquery');
-
-You may send an optional parameter to determine whether or not a script
-tag for the main jQuery file will be automatically included when loading
-the library. It will be created by default. To prevent this, load the
-library as follows::
-
- $this->load->library('javascript/jquery', FALSE);
-
-Once loaded, the jQuery library object will be available using:
-
- $this->jquery
-
-jQuery Events
-=============
-
-Events are set using the following syntax.
-::
-
- $this->jquery->event('element_path', code_to_run());
-
-In the above example:
-
-- "event" is any of blur, change, click, dblclick, error, focus, hover,
- keydown, keyup, load, mousedown, mouseup, mouseover, mouseup, resize,
- scroll, or unload.
-- "element_path" is any valid `jQuery selector
- <http://api.jquery.com/category/selectors/>`_. Due to jQuery's unique
- selector syntax, this is usually an element id, or CSS selector. For
- example "#notice_area" would effect ``<div id="notice_area">``, and
- "#content a.notice" would effect all anchors with a class of "notice"
- in the div with id "content".
-- "``code_to_run()``" is script your write yourself, or an action such as
- an effect from the jQuery library below.
-
-Effects
-=======
-
-The query library supports a powerful
-`Effects <http://api.jquery.com/category/effects/>`_ repertoire. Before an effect
-can be used, it must be loaded::
-
- $this->jquery->effect([optional path] plugin name); // for example $this->jquery->effect('bounce');
-
-
-hide() / show()
----------------
-
-Each of this functions will affect the visibility of an item on your
-page. hide() will set an item invisible, show() will reveal it.
-
-::
-
- $this->jquery->hide(target, optional speed, optional extra information);
- $this->jquery->show(target, optional speed, optional extra information);
-
-
-- "target" will be any valid jQuery selector or selectors.
-- "speed" is optional, and is set to either slow, normal, fast, or
- alternatively a number of milliseconds.
-- "extra information" is optional, and could include a callback, or
- other additional information.
-
-toggle()
---------
-
-toggle() will change the visibility of an item to the opposite of its
-current state, hiding visible elements, and revealing hidden ones.
-
-::
-
- $this->jquery->toggle(target);
-
-
-- "target" will be any valid jQuery selector or selectors.
-
-animate()
----------
-
-::
-
- $this->jquery->animate(target, parameters, optional speed, optional extra information);
-
-
-- "target" will be any valid jQuery selector or selectors.
-- "parameters" in jQuery would generally include a series of CSS
- properties that you wish to change.
-- "speed" is optional, and is set to either slow, normal, fast, or
- alternatively a number of milliseconds.
-- "extra information" is optional, and could include a callback, or
- other additional information.
-
-For a full summary, see
-`http://api.jquery.com/animate/ <http://api.jquery.com/animate/>`_
-
-Here is an example of an animate() called on a div with an id of "note",
-and triggered by a click using the jQuery library's click() event.
-
-::
-
- $params = array(
- 'height' => 80,
- 'width' => '50%',
- 'marginLeft' => 125
- );
- $this->jquery->click('#trigger', $this->jquery->animate('#note', $params, 'normal'));
-
-fadeIn() / fadeOut()
---------------------
-
-::
-
- $this->jquery->fadeIn(target, optional speed, optional extra information);
- $this->jquery->fadeOut(target, optional speed, optional extra information);
-
-
-- "target" will be any valid jQuery selector or selectors.
-- "speed" is optional, and is set to either slow, normal, fast, or
- alternatively a number of milliseconds.
-- "extra information" is optional, and could include a callback, or
- other additional information.
-
-toggleClass()
--------------
-
-This function will add or remove a CSS class to its target.
-
-::
-
- $this->jquery->toggleClass(target, class)
-
-
-- "target" will be any valid jQuery selector or selectors.
-- "class" is any CSS classname. Note that this class must be defined
- and available in a CSS that is already loaded.
-
-fadeIn() / fadeOut()
---------------------
-
-These effects cause an element(s) to disappear or reappear over time.
-
-::
-
- $this->jquery->fadeIn(target, optional speed, optional extra information);
- $this->jquery->fadeOut(target, optional speed, optional extra information);
-
-
-- "target" will be any valid jQuery selector or selectors.
-- "speed" is optional, and is set to either slow, normal, fast, or
- alternatively a number of milliseconds.
-- "extra information" is optional, and could include a callback, or
- other additional information.
-
-slideUp() / slideDown() / slideToggle()
----------------------------------------
-
-These effects cause an element(s) to slide.
-
-::
-
- $this->jquery->slideUp(target, optional speed, optional extra information);
- $this->jquery->slideDown(target, optional speed, optional extra information);
- $this->jquery->slideToggle(target, optional speed, optional extra information);
-
-
-- "target" will be any valid jQuery selector or selectors.
-- "speed" is optional, and is set to either slow, normal, fast, or
- alternatively a number of milliseconds.
-- "extra information" is optional, and could include a callback, or
- other additional information.
-
-Plugins
-=======
-
-Some select jQuery plugins are made available using this library.
-
-corner()
---------
-
-Used to add distinct corners to page elements. For full details see
-`http://malsup.com/jquery/corner/ <http://malsup.com/jquery/corner/>`_
-
-::
-
- $this->jquery->corner(target, corner_style);
-
-
-- "target" will be any valid jQuery selector or selectors.
-- "corner_style" is optional, and can be set to any valid style such
- as round, sharp, bevel, bite, dog, etc. Individual corners can be set
- by following the style with a space and using "tl" (top left), "tr"
- (top right), "bl" (bottom left), or "br" (bottom right).
-
-::
-
- $this->jquery->corner("#note", "cool tl br");
-
-
-tablesorter()
--------------
-
-description to come
-
-modal()
--------
-
-description to come
-
-calendar()
-----------
-
-description to come \ No newline at end of file
diff --git a/user_guide_src/source/libraries/language.rst b/user_guide_src/source/libraries/language.rst
deleted file mode 100644
index de17c8288..000000000
--- a/user_guide_src/source/libraries/language.rst
+++ /dev/null
@@ -1,210 +0,0 @@
-##############
-Language Class
-##############
-
-The Language Class provides functions to retrieve language files and
-lines of text for purposes of internationalization.
-
-In your CodeIgniter **system** folder, you will find a **language** sub-directory
-containing a set of language files for the **english** idiom.
-The files in this directory (**system/language/english/**) define the regular messages,
-error messages, and other generally output terms or expressions, for the different parts
-of the CodeIgniter framework.
-
-You can create or incorporate your own language files, as needed, in order to provide
-application-specific error and other messages, or to provide translations of the core
-messages into other languages. These translations or additional messages would go inside
-your **application/language/** directory, with separate sub-directories for each idiom
-(for instance, 'french' or 'german').
-
-The CodeIgniter framework comes with a set of language files for the "english" idiom.
-Additional approved translations for different idioms may be found in the
-`CodeIgniter 3 Translations repositories <https://github.com/bcit-ci/codeigniter3-translations>`_.
-Each repository deals with a single idiom.
-
-When CodeIgniter loads language files, it will load the one in **system/language/**
-first and will then look for an override in your **application/language/** directory.
-
-.. note:: Each language should be stored in its own folder. For example,
- the English files are located at: system/language/english
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-***************************
-Handling Multiple Languages
-***************************
-
-If you want to support multiple languages in your application, you would provide folders inside
-your **application/language/** directory for each of them, and you would specify the default
-language in your **application/config/config.php**.
-
-The **application/language/english/** directory would contain any additional language files
-needed by your application, for instance for error messages.
-
-Each of the other idiom-specific directories would contain the core language files that you
-obtained from the translations repositories, or that you translated yourself, as well as
-any additional ones needed by your application.
-
-You would store the language you are currently using, for instance in a session variable.
-
-Sample Language Files
-=====================
-
-::
-
- system/
- language/
- english/
- ...
- email_lang.php
- form_validation_lang.php
- ...
-
- application/
- language/
- english/
- error_messages_lang.php
- french/
- ...
- email_lang.php
- error_messages_lang.php
- form_validation_lang.php
- ...
-
-Example of switching languages
-==============================
-
-::
-
- $idiom = $this->session->get_userdata('language');
- $this->lang->load('error_messages', $idiom);
- $oops = $this->lang->line('message_key');
-
-********************
-Internationalization
-********************
-
-The Language class in CodeIgniter is meant to provide an easy and lightweight
-way to support multiplelanguages in your application. It is not meant to be a
-full implementation of what is commonly called `internationalization and localization
-<http://en.wikipedia.org/wiki/Internationalization_and_localization>`_.
-
-We use the term "idiom" to refer to a language using its common name,
-rather than using any of the international standards, such as "en", "en-US",
-or "en-CA-x-ca" for English and some of its variants.
-
-.. note:: There is nothing to prevent you from using those abbreviations in your application!
-
-************************
-Using the Language Class
-************************
-
-Creating Language Files
-=======================
-
-Language files must be named with **_lang.php** as the filename extension.
-For example, let's say you want to create a file containing error messages.
-You might name it: error_lang.php
-
-Within the file you will assign each line of text to an array called
-``$lang`` with this prototype::
-
- $lang['language_key'] = 'The actual message to be shown';
-
-.. note:: It's a good practice to use a common prefix for all messages
- in a given file to avoid collisions with similarly named items in other
- files. For example, if you are creating error messages you might prefix
- them with error\_
-
-::
-
- $lang['error_email_missing'] = 'You must submit an email address';
- $lang['error_url_missing'] = 'You must submit a URL';
- $lang['error_username_missing'] = 'You must submit a username';
-
-Loading A Language File
-=======================
-
-In order to fetch a line from a particular file you must load the file
-first. Loading a language file is done with the following code::
-
- $this->lang->load('filename', 'language');
-
-Where filename is the name of the file you wish to load (without the
-file extension), and language is the language set containing it (ie,
-english). If the second parameter is missing, the default language set
-in your **application/config/config.php** file will be used.
-
-You can also load multiple language files at the same time by passing an array of language files as first parameter.
-::
-
- $this->lang->load(array('filename1', 'filename2'));
-
-.. note:: The *language* parameter can only consist of letters.
-
-Fetching a Line of Text
-=======================
-
-Once your desired language file is loaded you can access any line of
-text using this function::
-
- $this->lang->line('language_key');
-
-Where *language_key* is the array key corresponding to the line you wish
-to show.
-
-You can optionally pass FALSE as the second argument of that method to
-disable error logging, in case you're not sure if the line exists::
-
- $this->lang->line('misc_key', FALSE);
-
-.. note:: This method simply returns the line. It does not echo it.
-
-Using language lines as form labels
------------------------------------
-
-This feature has been deprecated from the language library and moved to
-the :php:func:`lang()` function of the :doc:`Language Helper
-<../helpers/language_helper>`.
-
-Auto-loading Languages
-======================
-
-If you find that you need a particular language globally throughout your
-application, you can tell CodeIgniter to :doc:`auto-load
-<../general/autoloader>` it during system initialization. This is done
-by opening the **application/config/autoload.php** file and adding the
-language(s) to the autoload array.
-
-***************
-Class Reference
-***************
-
-.. php:class:: CI_Lang
-
- .. php:method:: load($langfile[, $idiom = ''[, $return = FALSE[, $add_suffix = TRUE[, $alt_path = '']]]])
-
- :param mixed $langfile: Language file to load or array with multiple files
- :param string $idiom: Language name (i.e. 'english')
- :param bool $return: Whether to return the loaded array of translations
- :param bool $add_suffix: Whether to add the '_lang' suffix to the language file name
- :param string $alt_path: An alternative path to look in for the language file
- :returns: Array of language lines if $return is set to TRUE, otherwise void
- :rtype: mixed
-
- Loads a language file.
-
- .. php:method:: line($line[, $log_errors = TRUE])
-
- :param string $line: Language line key name
- :param bool $log_errors: Whether to log an error if the line isn't found
- :returns: Language line string or FALSE on failure
- :rtype: string
-
- Fetches a single translation line from the already loaded language files,
- based on the line's name. \ No newline at end of file
diff --git a/user_guide_src/source/libraries/loader.rst b/user_guide_src/source/libraries/loader.rst
deleted file mode 100644
index 22abb4586..000000000
--- a/user_guide_src/source/libraries/loader.rst
+++ /dev/null
@@ -1,461 +0,0 @@
-############
-Loader Class
-############
-
-Loader, as the name suggests, is used to load elements. These elements
-can be libraries (classes) :doc:`View files <../general/views>`,
-:doc:`Drivers <../general/drivers>`,
-:doc:`Helpers <../general/helpers>`,
-:doc:`Models <../general/models>`, or your own files.
-
-.. note:: This class is initialized automatically by the system so there
- is no need to do it manually.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-**********************
-Application "Packages"
-**********************
-
-An application package allows for the easy distribution of complete sets
-of resources in a single directory, complete with its own libraries,
-models, helpers, config, and language files. It is recommended that
-these packages be placed in the application/third_party directory. Below
-is a sample map of an package directory.
-
-The following is an example of a directory for an application package
-named "Foo Bar".
-
-::
-
- /application/third_party/foo_bar
-
- config/
- helpers/
- language/
- libraries/
- models/
-
-Whatever the purpose of the "Foo Bar" application package, it has its
-own config files, helpers, language files, libraries, and models. To use
-these resources in your controllers, you first need to tell the Loader
-that you are going to be loading resources from a package, by adding the
-package path via the ``add_package_path()`` method.
-
-Package view files
-------------------
-
-By Default, package view files paths are set when ``add_package_path()``
-is called. View paths are looped through, and once a match is
-encountered that view is loaded.
-
-In this instance, it is possible for view naming collisions within
-packages to occur, and possibly the incorrect package being loaded. To
-ensure against this, set an optional second parameter of FALSE when
-calling ``add_package_path()``.
-
-::
-
- $this->load->add_package_path(APPPATH.'my_app', FALSE);
- $this->load->view('my_app_index'); // Loads
- $this->load->view('welcome_message'); // Will not load the default welcome_message b/c the second param to add_package_path is FALSE
-
- // Reset things
- $this->load->remove_package_path(APPPATH.'my_app');
-
- // Again without the second parameter:
- $this->load->add_package_path(APPPATH.'my_app');
- $this->load->view('my_app_index'); // Loads
- $this->load->view('welcome_message'); // Loads
-
-***************
-Class Reference
-***************
-
-.. php:class:: CI_Loader
-
- .. php:method:: library($library[, $params = NULL[, $object_name = NULL]])
-
- :param mixed $library: Library name as a string or an array with multiple libraries
- :param array $params: Optional array of parameters to pass to the loaded library's constructor
- :param string $object_name: Optional object name to assign the library to
- :returns: CI_Loader instance (method chaining)
- :rtype: CI_Loader
-
- This method is used to load core classes.
-
- .. note:: We use the terms "class" and "library" interchangeably.
-
- For example, if you would like to send email with CodeIgniter, the first
- step is to load the email class within your controller::
-
- $this->load->library('email');
-
- Once loaded, the library will be ready for use, using ``$this->email``.
-
- Library files can be stored in subdirectories within the main
- "libraries" directory, or within your personal *application/libraries*
- directory. To load a file located in a subdirectory, simply include the
- path, relative to the "libraries" directory. For example, if you have
- file located at::
-
- libraries/flavors/Chocolate.php
-
- You will load it using::
-
- $this->load->library('flavors/chocolate');
-
- You may nest the file in as many subdirectories as you want.
-
- Additionally, multiple libraries can be loaded at the same time by
- passing an array of libraries to the load method.
- ::
-
- $this->load->library(array('email', 'table'));
-
- **Setting options**
-
- The second (optional) parameter allows you to optionally pass
- configuration setting. You will typically pass these as an array::
-
- $config = array (
- 'mailtype' => 'html',
- 'charset' => 'utf-8',
- 'priority' => '1'
- );
-
- $this->load->library('email', $config);
-
- Config options can usually also be set via a config file. Each library
- is explained in detail in its own page, so please read the information
- regarding each one you would like to use.
-
- Please take note, when multiple libraries are supplied in an array for
- the first parameter, each will receive the same parameter information.
-
- **Assigning a Library to a different object name**
-
- If the third (optional) parameter is blank, the library will usually be
- assigned to an object with the same name as the library. For example, if
- the library is named Calendar, it will be assigned to a variable named
- ``$this->calendar``.
-
- If you prefer to set your own class names you can pass its value to the
- third parameter::
-
- $this->load->library('calendar', NULL, 'my_calendar');
-
- // Calendar class is now accessed using:
- $this->my_calendar
-
- Please take note, when multiple libraries are supplied in an array for
- the first parameter, this parameter is discarded.
-
- .. php:method:: driver($library[, $params = NULL[, $object_name]])
-
- :param mixed $library: Library name as a string or an array with multiple libraries
- :param array $params: Optional array of parameters to pass to the loaded library's constructor
- :param string $object_name: Optional object name to assign the library to
- :returns: CI_Loader instance (method chaining)
- :rtype: CI_Loader
-
- This method is used to load driver libraries, acts very much like the
- ``library()`` method.
-
- As an example, if you would like to use sessions with CodeIgniter, the first
- step is to load the session driver within your controller::
-
- $this->load->driver('session');
-
- Once loaded, the library will be ready for use, using ``$this->session``.
-
- Driver files must be stored in a subdirectory within the main
- "libraries" directory, or within your personal *application/libraries*
- directory. The subdirectory must match the parent class name. Read the
- :doc:`Drivers <../general/drivers>` description for details.
-
- Additionally, multiple driver libraries can be loaded at the same time by
- passing an array of drivers to the load method.
- ::
-
- $this->load->driver(array('session', 'cache'));
-
- **Setting options**
-
- The second (optional) parameter allows you to optionally pass
- configuration settings. You will typically pass these as an array::
-
- $config = array(
- 'sess_driver' => 'cookie',
- 'sess_encrypt_cookie' => true,
- 'encryption_key' => 'mysecretkey'
- );
-
- $this->load->driver('session', $config);
-
- Config options can usually also be set via a config file. Each library
- is explained in detail in its own page, so please read the information
- regarding each one you would like to use.
-
- **Assigning a Driver to a different object name**
-
- If the third (optional) parameter is blank, the library will be assigned
- to an object with the same name as the parent class. For example, if
- the library is named Session, it will be assigned to a variable named
- ``$this->session``.
-
- If you prefer to set your own class names you can pass its value to the
- third parameter::
-
- $this->load->library('session', '', 'my_session');
-
- // Session class is now accessed using:
- $this->my_session
-
- .. php:method:: view($view[, $vars = array()[, return = FALSE]])
-
- :param string $view: View name
- :param array $vars: An associative array of variables
- :param bool $return: Whether to return the loaded view
- :returns: View content string if $return is set to TRUE, otherwise CI_Loader instance (method chaining)
- :rtype: mixed
-
- This method is used to load your View files. If you haven't read the
- :doc:`Views <../general/views>` section of the user guide it is
- recommended that you do since it shows you how this method is
- typically used.
-
- The first parameter is required. It is the name of the view file you
- would like to load.
-
- .. note:: The .php file extension does not need to be specified unless
- you use something other than .php.
-
- The second **optional** parameter can take an associative array or an
- object as input, which it runs through the PHP
- `extract() <http://php.net/extract>`_ function to convert to variables
- that can be used in your view files. Again, read the
- :doc:`Views <../general/views>` page to learn how this might be useful.
-
- The third **optional** parameter lets you change the behavior of the
- method so that it returns data as a string rather than sending it to
- your browser. This can be useful if you want to process the data in some
- way. If you set the parameter to TRUE (boolean) it will return data. The
- default behavior is FALSE, which sends it to your browser. Remember to
- assign it to a variable if you want the data returned::
-
- $string = $this->load->view('myfile', '', TRUE);
-
- .. php:method:: vars($vars[, $val = ''])
-
- :param mixed $vars: An array of variables or a single variable name
- :param mixed $val: Optional variable value
- :returns: CI_Loader instance (method chaining)
- :rtype: CI_Loader
-
- This method takes an associative array as input and generates
- variables using the PHP `extract() <http://php.net/extract>`_
- function. This method produces the same result as using the second
- parameter of the ``$this->load->view()`` method above. The reason you
- might want to use this method independently is if you would like to
- set some global variables in the constructor of your controller and have
- them become available in any view file loaded from any method. You can
- have multiple calls to this method. The data get cached and merged
- into one array for conversion to variables.
-
- .. php:method:: get_var($key)
-
- :param string $key: Variable name key
- :returns: Value if key is found, NULL if not
- :rtype: mixed
-
- This method checks the associative array of variables available to
- your views. This is useful if for any reason a var is set in a library
- or another controller method using ``$this->load->vars()``.
-
- .. php:method:: get_vars()
-
- :returns: An array of all assigned view variables
- :rtype: array
-
- This method retrieves all variables available to your views.
-
- .. php:method:: clear_vars()
-
- :returns: CI_Loader instance (method chaining)
- :rtype: CI_Loader
-
- Clears cached view variables.
-
- .. php:method:: model($model[, $name = ''[, $db_conn = FALSE]])
-
- :param mixed $model: Model name or an array containing multiple models
- :param string $name: Optional object name to assign the model to
- :param string $db_conn: Optional database configuration group to load
- :returns: CI_Loader instance (method chaining)
- :rtype: CI_Loader
-
- ::
-
- $this->load->model('model_name');
-
-
- If your model is located in a subdirectory, include the relative path
- from your models directory. For example, if you have a model located at
- *application/models/blog/Queries.php* you'll load it using::
-
- $this->load->model('blog/queries');
-
- If you would like your model assigned to a different object name you can
- specify it via the second parameter of the loading method::
-
- $this->load->model('model_name', 'fubar');
- $this->fubar->method();
-
- .. php:method:: database([$params = ''[, $return = FALSE[, $query_builder = NULL]]])
-
- :param mixed $params: Database group name or configuration options
- :param bool $return: Whether to return the loaded database object
- :param bool $query_builder: Whether to load the Query Builder
- :returns: Loaded CI_DB instance or FALSE on failure if $return is set to TRUE, otherwise CI_Loader instance (method chaining)
- :rtype: mixed
-
- This method lets you load the database class. The two parameters are
- **optional**. Please see the :doc:`database <../database/index>`
- section for more info.
-
- .. php:method:: dbforge([$db = NULL[, $return = FALSE]])
-
- :param object $db: Database object
- :param bool $return: Whether to return the Database Forge instance
- :returns: Loaded CI_DB_forge instance if $return is set to TRUE, otherwise CI_Loader instance (method chaining)
- :rtype: mixed
-
- Loads the :doc:`Database Forge <../database/forge>` class, please refer
- to that manual for more info.
-
- .. php:method:: dbutil([$db = NULL[, $return = FALSE]])
-
- :param object $db: Database object
- :param bool $return: Whether to return the Database Utilities instance
- :returns: Loaded CI_DB_utility instance if $return is set to TRUE, otherwise CI_Loader instance (method chaining)
- :rtype: mixed
-
- Loads the :doc:`Database Utilities <../database/utilities>` class, please
- refer to that manual for more info.
-
- .. php:method:: helper($helpers)
-
- :param mixed $helpers: Helper name as a string or an array containing multiple helpers
- :returns: CI_Loader instance (method chaining)
- :rtype: CI_Loader
-
- This method loads helper files, where file_name is the name of the
- file, without the _helper.php extension.
-
- .. php:method:: file($path[, $return = FALSE])
-
- :param string $path: File path
- :param bool $return: Whether to return the loaded file
- :returns: File contents if $return is set to TRUE, otherwise CI_Loader instance (method chaining)
- :rtype: mixed
-
- This is a generic file loading method. Supply the filepath and name in
- the first parameter and it will open and read the file. By default the
- data is sent to your browser, just like a View file, but if you set the
- second parameter to boolean TRUE it will instead return the data as a
- string.
-
- .. php:method:: language($files[, $lang = ''])
-
- :param mixed $files: Language file name or an array of multiple language files
- :param string $lang: Language name
- :returns: CI_Loader instance (method chaining)
- :rtype: CI_Loader
-
- This method is an alias of the :doc:`language loading
- method <language>`: ``$this->lang->load()``.
-
- .. php:method:: config($file[, $use_sections = FALSE[, $fail_gracefully = FALSE]])
-
- :param string $file: Configuration file name
- :param bool $use_sections: Whether configuration values should be loaded into their own section
- :param bool $fail_gracefully: Whether to just return FALSE in case of failure
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- This method is an alias of the :doc:`config file loading
- method <config>`: ``$this->config->load()``
-
- .. php:method:: is_loaded($class)
-
- :param string $class: Class name
- :returns: Singleton property name if found, FALSE if not
- :rtype: mixed
-
- Allows you to check if a class has already been loaded or not.
-
- .. note:: The word "class" here refers to libraries and drivers.
-
- If the requested class has been loaded, the method returns its assigned
- name in the CI Super-object and FALSE if it's not::
-
- $this->load->library('form_validation');
- $this->load->is_loaded('Form_validation'); // returns 'form_validation'
-
- $this->load->is_loaded('Nonexistent_library'); // returns FALSE
-
- .. important:: If you have more than one instance of a class (assigned to
- different properties), then the first one will be returned.
-
- ::
-
- $this->load->library('form_validation', $config, 'fv');
- $this->load->library('form_validation');
-
- $this->load->is_loaded('Form_validation'); // returns 'fv'
-
- .. php:method:: add_package_path($path[, $view_cascade = TRUE])
-
- :param string $path: Path to add
- :param bool $view_cascade: Whether to use cascading views
- :returns: CI_Loader instance (method chaining)
- :rtype: CI_Loader
-
- Adding a package path instructs the Loader class to prepend a given path
- for subsequent requests for resources. As an example, the "Foo Bar"
- application package above has a library named Foo_bar.php. In our
- controller, we'd do the following::
-
- $this->load->add_package_path(APPPATH.'third_party/foo_bar/')
- ->library('foo_bar');
-
- .. php:method:: remove_package_path([$path = ''])
-
- :param string $path: Path to remove
- :returns: CI_Loader instance (method chaining)
- :rtype: CI_Loader
-
- When your controller is finished using resources from an application
- package, and particularly if you have other application packages you
- want to work with, you may wish to remove the package path so the Loader
- no longer looks in that directory for resources. To remove the last path
- added, simply call the method with no parameters.
-
- Or to remove a specific package path, specify the same path previously
- given to ``add_package_path()`` for a package.::
-
- $this->load->remove_package_path(APPPATH.'third_party/foo_bar/');
-
- .. php:method:: get_package_paths([$include_base = TRUE])
-
- :param bool $include_base: Whether to include BASEPATH
- :returns: An array of package paths
- :rtype: array
-
- Returns all currently available package paths. \ No newline at end of file
diff --git a/user_guide_src/source/libraries/migration.rst b/user_guide_src/source/libraries/migration.rst
deleted file mode 100644
index 97c72303c..000000000
--- a/user_guide_src/source/libraries/migration.rst
+++ /dev/null
@@ -1,184 +0,0 @@
-################
-Migrations Class
-################
-
-Migrations are a convenient way for you to alter your database in a
-structured and organized manner. You could edit fragments of SQL by hand
-but you would then be responsible for telling other developers that they
-need to go and run them. You would also have to keep track of which changes
-need to be run against the production machines next time you deploy.
-
-The database table **migration** tracks which migrations have already been
-run so all you have to do is update your application files and
-call ``$this->migration->current()`` to work out which migrations should be run.
-The current version is found in **application/config/migration.php**.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-********************
-Migration file names
-********************
-
-Each Migration is run in numeric order forward or backwards depending on the
-method taken. Two numbering styles are available:
-
-* **Sequential:** each migration is numbered in sequence, starting with **001**.
- Each number must be three digits, and there must not be any gaps in the
- sequence. (This was the numbering scheme prior to CodeIgniter 3.0.)
-* **Timestamp:** each migration is numbered using the timestamp when the migration
- was created, in **YYYYMMDDHHIISS** format (e.g. **20121031100537**). This
- helps prevent numbering conflicts when working in a team environment, and is
- the preferred scheme in CodeIgniter 3.0 and later.
-
-The desired style may be selected using the ``$config['migration_type']``
-setting in your *application/config/migration.php* file.
-
-Regardless of which numbering style you choose to use, prefix your migration
-files with the migration number followed by an underscore and a descriptive
-name for the migration. For example:
-
-* 001_add_blog.php (sequential numbering)
-* 20121031100537_add_blog.php (timestamp numbering)
-
-******************
-Create a Migration
-******************
-
-This will be the first migration for a new site which has a blog. All
-migrations go in the **application/migrations/** directory and have names such
-as *20121031100537_add_blog.php*.
-::
-
- <?php
-
- defined('BASEPATH') OR exit('No direct script access allowed');
-
- class Migration_Add_blog extends CI_Migration {
-
- public function up()
- {
- $this->dbforge->add_field(array(
- 'blog_id' => array(
- 'type' => 'INT',
- 'constraint' => 5,
- 'unsigned' => TRUE,
- 'auto_increment' => TRUE
- ),
- 'blog_title' => array(
- 'type' => 'VARCHAR',
- 'constraint' => '100',
- ),
- 'blog_description' => array(
- 'type' => 'TEXT',
- 'null' => TRUE,
- ),
- ));
- $this->dbforge->add_key('blog_id', TRUE);
- $this->dbforge->create_table('blog');
- }
-
- public function down()
- {
- $this->dbforge->drop_table('blog');
- }
- }
-
-Then in **application/config/migration.php** set ``$config['migration_version'] = 20121031100537;``.
-
-*************
-Usage Example
-*************
-
-In this example some simple code is placed in **application/controllers/Migrate.php**
-to update the schema.::
-
- <?php
-
- class Migrate extends CI_Controller
- {
-
- public function index()
- {
- $this->load->library('migration');
-
- if ($this->migration->current() === FALSE)
- {
- show_error($this->migration->error_string());
- }
- }
-
- }
-
-*********************
-Migration Preferences
-*********************
-
-The following is a table of all the config options for migrations.
-
-========================== ====================== ========================== =============================================
-Preference Default Options Description
-========================== ====================== ========================== =============================================
-**migration_enabled** FALSE TRUE / FALSE Enable or disable migrations.
-**migration_path** APPPATH.'migrations/' None The path to your migrations folder.
-**migration_version** 0 None The current version your database should use.
-**migration_table** migrations None The table name for storing the schema
- version number.
-**migration_auto_latest** FALSE TRUE / FALSE Enable or disable automatically
- running migrations.
-**migration_type** 'timestamp' 'timestamp' / 'sequential' The type of numeric identifier used to name
- migration files.
-========================== ====================== ========================== =============================================
-
-***************
-Class Reference
-***************
-
-.. php:class:: CI_Migration
-
- .. php:method:: current()
-
- :returns: TRUE if no migrations are found, current version string on success, FALSE on failure
- :rtype: mixed
-
- Migrates up to the current version (whatever is set for
- ``$config['migration_version']`` in *application/config/migration.php*).
-
- .. php:method:: error_string()
-
- :returns: Error messages
- :rtype: string
-
- This returns a string of errors that were detected while performing a migration.
-
- .. php:method:: find_migrations()
-
- :returns: An array of migration files
- :rtype: array
-
- An array of migration filenames are returned that are found in the **migration_path** property.
-
- .. php:method:: latest()
-
- :returns: Current version string on success, FALSE on failure
- :rtype: mixed
-
- This works much the same way as ``current()`` but instead of looking for
- the ``$config['migration_version']`` the Migration class will use the very
- newest migration found in the filesystem.
-
- .. php:method:: version($target_version)
-
- :param mixed $target_version: Migration version to process
- :returns: TRUE if no migrations are found, current version string on success, FALSE on failure
- :rtype: mixed
-
- Version can be used to roll back changes or step forwards programmatically to
- specific versions. It works just like ``current()`` but ignores ``$config['migration_version']``.
- ::
-
- $this->migration->version(5);
diff --git a/user_guide_src/source/libraries/output.rst b/user_guide_src/source/libraries/output.rst
deleted file mode 100644
index 92060f66a..000000000
--- a/user_guide_src/source/libraries/output.rst
+++ /dev/null
@@ -1,233 +0,0 @@
-############
-Output Class
-############
-
-The Output class is a core class with one main function: To send the
-finalized web page to the requesting browser. It is also responsible for
-:doc:`caching <../general/caching>` your web pages, if you use that
-feature.
-
-.. note:: This class is initialized automatically by the system so there
- is no need to do it manually.
-
-Under normal circumstances you won't even notice the Output class since
-it works transparently without your intervention. For example, when you
-use the :doc:`Loader <../libraries/loader>` class to load a view file,
-it's automatically passed to the Output class, which will be called
-automatically by CodeIgniter at the end of system execution. It is
-possible, however, for you to manually intervene with the output if you
-need to.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-***************
-Class Reference
-***************
-
-.. php:class:: CI_Output
-
- .. attribute:: $parse_exec_vars = TRUE;
-
- Enables/disables parsing of the {elapsed_time} and {memory_usage} pseudo-variables.
-
- CodeIgniter will parse those tokens in your output by default. To disable this, set
- this property to FALSE in your controller.
- ::
-
- $this->output->parse_exec_vars = FALSE;
-
- .. php:method:: set_output($output)
-
- :param string $output: String to set the output to
- :returns: CI_Output instance (method chaining)
- :rtype: CI_Output
-
- Permits you to manually set the final output string. Usage example::
-
- $this->output->set_output($data);
-
- .. important:: If you do set your output manually, it must be the last thing done
- in the function you call it from. For example, if you build a page in one
- of your controller methods, don't set the output until the end.
-
- .. php:method:: set_content_type($mime_type[, $charset = NULL])
-
- :param string $mime_type: MIME Type idenitifer string
- :param string $charset: Character set
- :returns: CI_Output instance (method chaining)
- :rtype: CI_Output
-
- Permits you to set the mime-type of your page so you can serve JSON data, JPEG's, XML, etc easily.
- ::
-
- $this->output
- ->set_content_type('application/json')
- ->set_output(json_encode(array('foo' => 'bar')));
-
- $this->output
- ->set_content_type('jpeg') // You could also use ".jpeg" which will have the full stop removed before looking in config/mimes.php
- ->set_output(file_get_contents('files/something.jpg'));
-
- .. important:: Make sure any non-mime string you pass to this method
- exists in *application/config/mimes.php* or it will have no effect.
-
- You can also set the character set of the document, by passing a second argument::
-
- $this->output->set_content_type('css', 'utf-8');
-
- .. php:method:: get_content_type()
-
- :returns: Content-Type string
- :rtype: string
-
- Returns the Content-Type HTTP header that's currently in use, excluding the character set value.
- ::
-
- $mime = $this->output->get_content_type();
-
- .. note:: If not set, the default return value is 'text/html'.
-
- .. php:method:: get_header($header)
-
- :param string $header: HTTP header name
- :returns: HTTP response header or NULL if not found
- :rtype: mixed
-
- Returns the requested HTTP header value, or NULL if the requested header is not set.
- Example::
-
- $this->output->set_content_type('text/plain', 'UTF-8');
- echo $this->output->get_header('content-type');
- // Outputs: text/plain; charset=utf-8
-
- .. note:: The header name is compared in a case-insensitive manner.
-
- .. note:: Raw headers sent via PHP's native ``header()`` function are also detected.
-
- .. php:method:: get_output()
-
- :returns: Output string
- :rtype: string
-
- Permits you to manually retrieve any output that has been sent for
- storage in the output class. Usage example::
-
- $string = $this->output->get_output();
-
- Note that data will only be retrievable from this function if it has
- been previously sent to the output class by one of the CodeIgniter
- functions like ``$this->load->view()``.
-
- .. php:method:: append_output($output)
-
- :param string $output: Additional output data to append
- :returns: CI_Output instance (method chaining)
- :rtype: CI_Output
-
- Appends data onto the output string.
- ::
-
- $this->output->append_output($data);
-
- .. php:method:: set_header($header[, $replace = TRUE])
-
- :param string $header: HTTP response header
- :param bool $replace: Whether to replace the old header value, if it is already set
- :returns: CI_Output instance (method chaining)
- :rtype: CI_Output
-
- Permits you to manually set server headers, which the output class will
- send for you when outputting the final rendered display. Example::
-
- $this->output->set_header('HTTP/1.0 200 OK');
- $this->output->set_header('HTTP/1.1 200 OK');
- $this->output->set_header('Last-Modified: '.gmdate('D, d M Y H:i:s', $last_update).' GMT');
- $this->output->set_header('Cache-Control: no-store, no-cache, must-revalidate');
- $this->output->set_header('Cache-Control: post-check=0, pre-check=0');
- $this->output->set_header('Pragma: no-cache');
-
- .. php:method:: set_status_header([$code = 200[, $text = '']])
-
- :param int $code: HTTP status code
- :param string $text: Optional message
- :returns: CI_Output instance (method chaining)
- :rtype: CI_Output
-
- Permits you to manually set a server status header. Example::
-
- $this->output->set_status_header(401);
- // Sets the header as: Unauthorized
-
- `See here <http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html>`_ for a full list of headers.
-
- .. note:: This method is an alias for :doc:`Common function <../general/common_functions>`
- :func:`set_status_header()`.
-
- .. php:method:: enable_profiler([$val = TRUE])
-
- :param bool $val: Whether to enable or disable the Profiler
- :returns: CI_Output instance (method chaining)
- :rtype: CI_Output
-
- Permits you to enable/disable the :doc:`Profiler <../general/profiling>`, which will display benchmark
- and other data at the bottom of your pages for debugging and optimization purposes.
-
- To enable the profiler place the following line anywhere within your
- :doc:`Controller <../general/controllers>` methods::
-
- $this->output->enable_profiler(TRUE);
-
- When enabled a report will be generated and inserted at the bottom of your pages.
-
- To disable the profiler you would use::
-
- $this->output->enable_profiler(FALSE);
-
- .. php:method:: set_profiler_sections($sections)
-
- :param array $sections: Profiler sections
- :returns: CI_Output instance (method chaining)
- :rtype: CI_Output
-
- Permits you to enable/disable specific sections of the Profiler when it is enabled.
- Please refer to the :doc:`Profiler <../general/profiling>` documentation for further information.
-
- .. php:method:: cache($time)
-
- :param int $time: Cache expiration time in minutes
- :returns: CI_Output instance (method chaining)
- :rtype: CI_Output
-
- Caches the current page for the specified amount of minutes.
-
- For more information, please see the :doc:`caching documentation <../general/caching>`.
-
- .. php:method:: _display([$output = ''])
-
- :param string $output: Output data override
- :returns: void
- :rtype: void
-
- Sends finalized output data to the browser along with any server headers. It also stops benchmark
- timers.
-
- .. note:: This method is called automatically at the end of script execution, you won't need to
- call it manually unless you are aborting script execution using ``exit()`` or ``die()`` in your code.
-
- Example::
-
- $response = array('status' => 'OK');
-
- $this->output
- ->set_status_header(200)
- ->set_content_type('application/json', 'utf-8')
- ->set_output(json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES))
- ->_display();
- exit;
-
- .. note:: Calling this method manually without aborting script execution will result in duplicated output.
diff --git a/user_guide_src/source/libraries/pagination.rst b/user_guide_src/source/libraries/pagination.rst
deleted file mode 100644
index fbc75ea56..000000000
--- a/user_guide_src/source/libraries/pagination.rst
+++ /dev/null
@@ -1,314 +0,0 @@
-################
-Pagination Class
-################
-
-CodeIgniter's Pagination class is very easy to use, and it is 100%
-customizable, either dynamically or via stored preferences.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-If you are not familiar with the term "pagination", it refers to links
-that allows you to navigate from page to page, like this::
-
- « First  < 1 2 3 4 5 >  Last »
-
-*******
-Example
-*******
-
-Here is a simple example showing how to create pagination in one of your
-:doc:`controller <../general/controllers>` methods::
-
- $this->load->library('pagination');
-
- $config['base_url'] = 'http://example.com/index.php/test/page/';
- $config['total_rows'] = 200;
- $config['per_page'] = 20;
-
- $this->pagination->initialize($config);
-
- echo $this->pagination->create_links();
-
-Notes
-=====
-
-The ``$config`` array contains your configuration variables. It is passed to
-the ``$this->pagination->initialize()`` method as shown above. Although
-there are some twenty items you can configure, at minimum you need the
-three shown. Here is a description of what those items represent:
-
-- **base_url** This is the full URL to the controller class/function
- containing your pagination. In the example above, it is pointing to a
- controller called "Test" and a function called "page". Keep in mind
- that you can :doc:`re-route your URI <../general/routing>` if you
- need a different structure.
-- **total_rows** This number represents the total rows in the result
- set you are creating pagination for. Typically this number will be
- the total rows that your database query returned.
-- **per_page** The number of items you intend to show per page. In the
- above example, you would be showing 20 items per page.
-
-The ``create_links()`` method returns an empty string when there is no
-pagination to show.
-
-Setting preferences in a config file
-====================================
-
-If you prefer not to set preferences using the above method, you can
-instead put them into a config file. Simply create a new file called
-pagination.php, add the ``$config`` array in that file. Then save the file
-in *application/config/pagination.php* and it will be used automatically.
-You will NOT need to use ``$this->pagination->initialize()`` if you save
-your preferences in a config file.
-
-**************************
-Customizing the Pagination
-**************************
-
-The following is a list of all the preferences you can pass to the
-initialization function to tailor the display.
-
-**$config['uri_segment'] = 3;**
-
-The pagination function automatically determines which segment of your
-URI contains the page number. If you need something different you can
-specify it.
-
-**$config['num_links'] = 2;**
-
-The number of "digit" links you would like before and after the selected
-page number. For example, the number 2 will place two digits on either
-side, as in the example links at the very top of this page.
-
-**$config['use_page_numbers'] = TRUE;**
-
-By default, the URI segment will use the starting index for the items
-you are paginating. If you prefer to show the the actual page number,
-set this to TRUE.
-
-**$config['page_query_string'] = TRUE;**
-
-By default, the pagination library assume you are using :doc:`URI
-Segments <../general/urls>`, and constructs your links something
-like::
-
- http://example.com/index.php/test/page/20
-
-If you have ``$config['enable_query_strings']`` set to TRUE your links
-will automatically be re-written using Query Strings. This option can
-also be explicitly set. Using ``$config['page_query_string']`` set to TRUE,
-the pagination link will become::
-
- http://example.com/index.php?c=test&m=page&per_page=20
-
-Note that "per_page" is the default query string passed, however can be
-configured using ``$config['query_string_segment'] = 'your_string'``
-
-**$config['reuse_query_string'] = FALSE;**
-
-By default your Query String arguments (nothing to do with other
-query string options) will be ignored. Setting this config to
-TRUE will add existing query string arguments back into the
-URL after the URI segment and before the suffix.::
-
- http://example.com/index.php/test/page/20?query=search%term
-
-This helps you mix together normal :doc:`URI Segments <../general/urls>`
-as well as query string arguments, which until 3.0 was not possible.
-
-**$config['prefix'] = '';**
-
-A custom prefix added to the path. The prefix value will be right before
-the offset segment.
-
-**$config['suffix'] = '';**
-
-A custom suffix added to the path. The suffix value will be right after
-the offset segment.
-
-**$config['use_global_url_suffix'] = FALSE;**
-
-When set to TRUE, it will **override** the ``$config['suffix']`` value and
-instead set it to the one that you have in ``$config['url_suffix']`` in
-your **application/config/config.php** file.
-
-***********************
-Adding Enclosing Markup
-***********************
-
-If you would like to surround the entire pagination with some markup you
-can do it with these two preferences:
-
-**$config['full_tag_open'] = '<p>';**
-
-The opening tag placed on the left side of the entire result.
-
-**$config['full_tag_close'] = '</p>';**
-
-The closing tag placed on the right side of the entire result.
-
-**************************
-Customizing the First Link
-**************************
-
-**$config['first_link'] = 'First';**
-
-The text you would like shown in the "first" link on the left. If you do
-not want this link rendered, you can set its value to FALSE.
-
-.. note:: This value can also be translated via a language file.
-
-**$config['first_tag_open'] = '<div>';**
-
-The opening tag for the "first" link.
-
-**$config['first_tag_close'] = '</div>';**
-
-The closing tag for the "first" link.
-
-**$config['first_url'] = '';**
-
-An alternative URL to use for the "first page" link.
-
-*************************
-Customizing the Last Link
-*************************
-
-**$config['last_link'] = 'Last';**
-
-The text you would like shown in the "last" link on the right. If you do
-not want this link rendered, you can set its value to FALSE.
-
-.. note:: This value can also be translated via a language file.
-
-**$config['last_tag_open'] = '<div>';**
-
-The opening tag for the "last" link.
-
-**$config['last_tag_close'] = '</div>';**
-
-The closing tag for the "last" link.
-
-***************************
-Customizing the "Next" Link
-***************************
-
-**$config['next_link'] = '&gt;';**
-
-The text you would like shown in the "next" page link. If you do not
-want this link rendered, you can set its value to FALSE.
-
-.. note:: This value can also be translated via a language file.
-
-**$config['next_tag_open'] = '<div>';**
-
-The opening tag for the "next" link.
-
-**$config['next_tag_close'] = '</div>';**
-
-The closing tag for the "next" link.
-
-*******************************
-Customizing the "Previous" Link
-*******************************
-
-**$config['prev_link'] = '&lt;';**
-
-The text you would like shown in the "previous" page link. If you do not
-want this link rendered, you can set its value to FALSE.
-
-.. note:: This value can also be translated via a language file.
-
-**$config['prev_tag_open'] = '<div>';**
-
-The opening tag for the "previous" link.
-
-**$config['prev_tag_close'] = '</div>';**
-
-The closing tag for the "previous" link.
-
-***********************************
-Customizing the "Current Page" Link
-***********************************
-
-**$config['cur_tag_open'] = '<b>';**
-
-The opening tag for the "current" link.
-
-**$config['cur_tag_close'] = '</b>';**
-
-The closing tag for the "current" link.
-
-****************************
-Customizing the "Digit" Link
-****************************
-
-**$config['num_tag_open'] = '<div>';**
-
-The opening tag for the "digit" link.
-
-**$config['num_tag_close'] = '</div>';**
-
-The closing tag for the "digit" link.
-
-****************
-Hiding the Pages
-****************
-
-If you wanted to not list the specific pages (for example, you only want
-"next" and "previous" links), you can suppress their rendering by
-adding::
-
- $config['display_pages'] = FALSE;
-
-****************************
-Adding attributes to anchors
-****************************
-
-If you want to add an extra attribute to be added to every link rendered
-by the pagination class, you can set them as key/value pairs in the
-"attributes" config::
-
- // Produces: class="myclass"
- $config['attributes'] = array('class' => 'myclass');
-
-.. note:: Usage of the old method of setting classes via "anchor_class"
- is deprecated.
-
-*****************************
-Disabling the "rel" attribute
-*****************************
-
-By default the rel attribute is dynamically generated and appended to
-the appropriate anchors. If for some reason you want to turn it off,
-you can pass boolean FALSE as a regular attribute
-
-::
-
- $config['attributes']['rel'] = FALSE;
-
-***************
-Class Reference
-***************
-
-.. php:class:: CI_Pagination
-
- .. php:method:: initialize([$params = array()])
-
- :param array $params: Configuration parameters
- :returns: CI_Pagination instance (method chaining)
- :rtype: CI_Pagination
-
- Initializes the Pagination class with your preferred options.
-
- .. php:method:: create_links()
-
- :returns: HTML-formatted pagination
- :rtype: string
-
- Returns a "pagination" bar, containing the generated links or an empty string if there's just a single page.
diff --git a/user_guide_src/source/libraries/parser.rst b/user_guide_src/source/libraries/parser.rst
deleted file mode 100644
index 0b0d41740..000000000
--- a/user_guide_src/source/libraries/parser.rst
+++ /dev/null
@@ -1,309 +0,0 @@
-#####################
-Template Parser Class
-#####################
-
-The Template Parser Class can perform simple text substitution for
-pseudo-variables contained within your view files.
-It can parse simple variables or variable tag pairs.
-
-If you've never used a template engine,
-pseudo-variable names are enclosed in braces, like this::
-
- <html>
- <head>
- <title>{blog_title}</title>
- </head>
- <body>
- <h3>{blog_heading}</h3>
-
- {blog_entries}
- <h5>{title}</h5>
- <p>{body}</p>
- {/blog_entries}
-
- </body>
- </html>
-
-These variables are not actual PHP variables, but rather plain text
-representations that allow you to eliminate PHP from your templates
-(view files).
-
-.. note:: CodeIgniter does **not** require you to use this class since
- using pure PHP in your view pages lets them run a little faster.
- However, some developers prefer to use a template engine if
- they work with designers who they feel would find some
- confusion working with PHP.
-
-.. important:: The Template Parser Class is **not** a full-blown
- template parsing solution. We've kept it very lean on purpose in order
- to maintain maximum performance.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-*******************************
-Using the Template Parser Class
-*******************************
-
-Initializing the Class
-======================
-
-Like most other classes in CodeIgniter, the Parser class is initialized
-in your controller using the ``$this->load->library()`` method::
-
- $this->load->library('parser');
-
-Once loaded, the Parser library object will be available using:
-$this->parser
-
-Parsing templates
-=================
-
-You can use the ``parse()`` method to parse (or render) simple templates,
-like this::
-
- $data = array(
- 'blog_title' => 'My Blog Title',
- 'blog_heading' => 'My Blog Heading'
- );
-
- $this->parser->parse('blog_template', $data);
-
-The first parameter contains the name of the :doc:`view
-file <../general/views>` (in this example the file would be called
-blog_template.php), and the second parameter contains an associative
-array of data to be replaced in the template. In the above example, the
-template would contain two variables: {blog_title} and {blog_heading}
-
-There is no need to "echo" or do something with the data returned by
-$this->parser->parse(). It is automatically passed to the output class
-to be sent to the browser. However, if you do want the data returned
-instead of sent to the output class you can pass TRUE (boolean) as the
-third parameter::
-
- $string = $this->parser->parse('blog_template', $data, TRUE);
-
-Variable Pairs
-==============
-
-The above example code allows simple variables to be replaced. What if
-you would like an entire block of variables to be repeated, with each
-iteration containing new values? Consider the template example we showed
-at the top of the page::
-
- <html>
- <head>
- <title>{blog_title}</title>
- </head>
- <body>
- <h3>{blog_heading}</h3>
-
- {blog_entries}
- <h5>{title}</h5>
- <p>{body}</p>
- {/blog_entries}
-
- </body>
- </html>
-
-In the above code you'll notice a pair of variables: {blog_entries}
-data... {/blog_entries}. In a case like this, the entire chunk of data
-between these pairs would be repeated multiple times, corresponding to
-the number of rows in the "blog_entries" element of the parameters array.
-
-Parsing variable pairs is done using the identical code shown above to
-parse single variables, except, you will add a multi-dimensional array
-corresponding to your variable pair data. Consider this example::
-
- $this->load->library('parser');
-
- $data = array(
- 'blog_title' => 'My Blog Title',
- 'blog_heading' => 'My Blog Heading',
- 'blog_entries' => array(
- array('title' => 'Title 1', 'body' => 'Body 1'),
- array('title' => 'Title 2', 'body' => 'Body 2'),
- array('title' => 'Title 3', 'body' => 'Body 3'),
- array('title' => 'Title 4', 'body' => 'Body 4'),
- array('title' => 'Title 5', 'body' => 'Body 5')
- )
- );
-
- $this->parser->parse('blog_template', $data);
-
-If your "pair" data is coming from a database result, which is already a
-multi-dimensional array, you can simply use the database ``result_array()``
-method::
-
- $query = $this->db->query("SELECT * FROM blog");
-
- $this->load->library('parser');
-
- $data = array(
- 'blog_title' => 'My Blog Title',
- 'blog_heading' => 'My Blog Heading',
- 'blog_entries' => $query->result_array()
- );
-
- $this->parser->parse('blog_template', $data);
-
-Usage Notes
-===========
-
-If you include substitution parameters that are not referenced in your
-template, they are ignored::
-
- $template = 'Hello, {firstname} {lastname}';
- $data = array(
- 'title' => 'Mr',
- 'firstname' => 'John',
- 'lastname' => 'Doe'
- );
- $this->parser->parse_string($template, $data);
-
- // Result: Hello, John Doe
-
-If you do not include a substitution parameter that is referenced in your
-template, the original pseudo-variable is shown in the result::
-
- $template = 'Hello, {firstname} {initials} {lastname}';
- $data = array(
- 'title' => 'Mr',
- 'firstname' => 'John',
- 'lastname' => 'Doe'
- );
- $this->parser->parse_string($template, $data);
-
- // Result: Hello, John {initials} Doe
-
-If you provide a string substitution parameter when an array is expected,
-i.e. for a variable pair, the substitution is done for the opening variable
-pair tag, but the closing variable pair tag is not rendered properly::
-
- $template = 'Hello, {firstname} {lastname} ({degrees}{degree} {/degrees})';
- $data = array(
- 'degrees' => 'Mr',
- 'firstname' => 'John',
- 'lastname' => 'Doe',
- 'titles' => array(
- array('degree' => 'BSc'),
- array('degree' => 'PhD')
- )
- );
- $this->parser->parse_string($template, $data);
-
- // Result: Hello, John Doe (Mr{degree} {/degrees})
-
-If you name one of your individual substitution parameters the same as one
-used inside a variable pair, the results may not be as expected::
-
- $template = 'Hello, {firstname} {lastname} ({degrees}{degree} {/degrees})';
- $data = array(
- 'degree' => 'Mr',
- 'firstname' => 'John',
- 'lastname' => 'Doe',
- 'degrees' => array(
- array('degree' => 'BSc'),
- array('degree' => 'PhD')
- )
- );
- $this->parser->parse_string($template, $data);
-
- // Result: Hello, John Doe (Mr Mr )
-
-View Fragments
-==============
-
-You do not have to use variable pairs to get the effect of iteration in
-your views. It is possible to use a view fragment for what would be inside
-a variable pair, and to control the iteration in your controller instead
-of in the view.
-
-An example with the iteration controlled in the view::
-
- $template = '<ul>{menuitems}
- <li><a href="{link}">{title}</a></li>
- {/menuitems}</ul>';
-
- $data = array(
- 'menuitems' => array(
- array('title' => 'First Link', 'link' => '/first'),
- array('title' => 'Second Link', 'link' => '/second'),
- )
- );
- $this->parser->parse_string($template, $data);
-
-Result::
-
- <ul>
- <li><a href="/first">First Link</a></li>
- <li><a href="/second">Second Link</a></li>
- </ul>
-
-An example with the iteration controlled in the controller,
-using a view fragment::
-
- $temp = '';
- $template1 = '<li><a href="{link}">{title}</a></li>';
- $data1 = array(
- array('title' => 'First Link', 'link' => '/first'),
- array('title' => 'Second Link', 'link' => '/second'),
- );
-
- foreach ($data1 as $menuitem)
- {
- $temp .= $this->parser->parse_string($template1, $menuitem, TRUE);
- }
-
- $template = '<ul>{menuitems}</ul>';
- $data = array(
- 'menuitems' => $temp
- );
- $this->parser->parse_string($template, $data);
-
-Result::
-
- <ul>
- <li><a href="/first">First Link</a></li>
- <li><a href="/second">Second Link</a></li>
- </ul>
-
-***************
-Class Reference
-***************
-
-.. php:class:: CI_Parser
-
- .. php:method:: parse($template, $data[, $return = FALSE])
-
- :param string $template: Path to view file
- :param array $data: Variable data
- :param bool $return: Whether to only return the parsed template
- :returns: Parsed template string
- :rtype: string
-
- Parses a template from the provided path and variables.
-
- .. php:method:: parse_string($template, $data[, $return = FALSE])
-
- :param string $template: Content to parse
- :param array $data: Variable data
- :param bool $return: Whether to only return the parsed template
- :returns: Parsed template string
- :rtype: string
-
- This method works exactly like ``parse()``, only it accepts
- the template as a string instead of loading a view file.
-
- .. php:method:: set_delimiters([$l = '{'[, $r = '}']])
-
- :param string $l: Left delimiter
- :param string $r: Right delimiter
- :rtype: void
-
- Sets the delimiters (opening and closing) for a
- pseudo-variable "tag" in a template.
diff --git a/user_guide_src/source/libraries/security.rst b/user_guide_src/source/libraries/security.rst
deleted file mode 100644
index 868112684..000000000
--- a/user_guide_src/source/libraries/security.rst
+++ /dev/null
@@ -1,172 +0,0 @@
-##############
-Security Class
-##############
-
-The Security Class contains methods that help you create a secure
-application, processing input data for security.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-*************
-XSS Filtering
-*************
-
-CodeIgniter comes with a Cross Site Scripting prevention filter, which
-looks for commonly used techniques to trigger JavaScript or other types
-of code that attempt to hijack cookies or do other malicious things.
-If anything disallowed is encountered it is rendered safe by converting
-the data to character entities.
-
-To filter data through the XSS filter use the ``xss_clean()`` method::
-
- $data = $this->security->xss_clean($data);
-
-An optional second parameter, *is_image*, allows this function to be used
-to test images for potential XSS attacks, useful for file upload
-security. When this second parameter is set to TRUE, instead of
-returning an altered string, the function returns TRUE if the image is
-safe, and FALSE if it contained potentially malicious information that a
-browser may attempt to execute.
-
-::
-
- if ($this->security->xss_clean($file, TRUE) === FALSE)
- {
- // file failed the XSS test
- }
-
-.. important:: If you want to filter HTML attribute values, use
- :php:func:`html_escape()` instead!
-
-*********************************
-Cross-site request forgery (CSRF)
-*********************************
-
-You can enable CSRF protection by altering your **application/config/config.php**
-file in the following way::
-
- $config['csrf_protection'] = TRUE;
-
-If you use the :doc:`form helper <../helpers/form_helper>`, then
-:func:`form_open()` will automatically insert a hidden csrf field in
-your forms. If not, then you can use ``get_csrf_token_name()``
-and ``get_csrf_hash()``
-::
-
- $csrf = array(
- 'name' => $this->security->get_csrf_token_name(),
- 'hash' => $this->security->get_csrf_hash()
- );
-
- ...
-
- <input type="hidden" name="<?=$csrf['name'];?>" value="<?=$csrf['hash'];?>" />
-
-Tokens may be either regenerated on every submission (default) or
-kept the same throughout the life of the CSRF cookie. The default
-regeneration of tokens provides stricter security, but may result
-in usability concerns as other tokens become invalid (back/forward
-navigation, multiple tabs/windows, asynchronous actions, etc). You
-may alter this behavior by editing the following config parameter
-
-::
-
- $config['csrf_regenerate'] = TRUE;
-
-Select URIs can be whitelisted from csrf protection (for example API
-endpoints expecting externally POSTed content). You can add these URIs
-by editing the 'csrf_exclude_uris' config parameter::
-
- $config['csrf_exclude_uris'] = array('api/person/add');
-
-Regular expressions are also supported (case-insensitive)::
-
- $config['csrf_exclude_uris'] = array(
- 'api/record/[0-9]+',
- 'api/title/[a-z]+'
- );
-
-***************
-Class Reference
-***************
-
-.. php:class:: CI_Security
-
- .. php:method:: xss_clean($str[, $is_image = FALSE])
-
- :param mixed $str: Input string or an array of strings
- :returns: XSS-clean data
- :rtype: mixed
-
- Tries to remove XSS exploits from the input data and returns the cleaned string.
- If the optional second parameter is set to true, it will return boolean TRUE if
- the image is safe to use and FALSE if malicious data was detected in it.
-
- .. important:: This method is not suitable for filtering HTML attribute values!
- Use :php:func:`html_escape()` for that instead.
-
- .. php:method:: sanitize_filename($str[, $relative_path = FALSE])
-
- :param string $str: File name/path
- :param bool $relative_path: Whether to preserve any directories in the file path
- :returns: Sanitized file name/path
- :rtype: string
-
- Tries to sanitize filenames in order to prevent directory traversal attempts
- and other security threats, which is particularly useful for files that were supplied via user input.
- ::
-
- $filename = $this->security->sanitize_filename($this->input->post('filename'));
-
- If it is acceptable for the user input to include relative paths, e.g.
- *file/in/some/approved/folder.txt*, you can set the second optional parameter, ``$relative_path`` to TRUE.
- ::
-
- $filename = $this->security->sanitize_filename($this->input->post('filename'), TRUE);
-
- .. php:method:: get_csrf_token_name()
-
- :returns: CSRF token name
- :rtype: string
-
- Returns the CSRF token name (the ``$config['csrf_token_name']`` value).
-
- .. php:method:: get_csrf_hash()
-
- :returns: CSRF hash
- :rtype: string
-
- Returns the CSRF hash value. Useful in combination with ``get_csrf_token_name()``
- for manually building forms or sending valid AJAX POST requests.
-
- .. php:method:: entity_decode($str[, $charset = NULL])
-
- :param string $str: Input string
- :param string $charset: Character set of the input string
- :returns: Entity-decoded string
- :rtype: string
-
- This method acts a lot like PHP's own native ``html_entity_decode()`` function in ENT_COMPAT mode, only
- it tries to detect HTML entities that don't end in a semicolon because some browsers allow that.
-
- If the ``$charset`` parameter is left empty, then your configured ``$config['charset']`` value will be used.
-
- .. php:method:: get_random_bytes($length)
-
- :param int $length: Output length
- :returns: A binary stream of random bytes or FALSE on failure
- :rtype: string
-
- A convenience method for getting proper random bytes via ``mcrypt_create_iv()``,
- ``/dev/urandom`` or ``openssl_random_pseudo_bytes()`` (in that order), if one
- of them is available.
-
- Used for generating CSRF and XSS tokens.
-
- .. note:: The output is NOT guaranteed to be cryptographically secure,
- just the best attempt at that.
diff --git a/user_guide_src/source/libraries/sessions.rst b/user_guide_src/source/libraries/sessions.rst
deleted file mode 100644
index ced4463d0..000000000
--- a/user_guide_src/source/libraries/sessions.rst
+++ /dev/null
@@ -1,1064 +0,0 @@
-###############
-Session Library
-###############
-
-The Session class permits you maintain a user's "state" and track their
-activity while they browse your site.
-
-CodeIgniter comes with a few session storage drivers:
-
- - files (default; file-system based)
- - database
- - redis
- - memcached
-
-In addition, you may create your own, custom session drivers based on other
-kinds of storage, while still taking advantage of the features of the
-Session class.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-***********************
-Using the Session Class
-***********************
-
-Initializing a Session
-======================
-
-Sessions will typically run globally with each page load, so the Session
-class should either be initialized in your :doc:`controller
-<../general/controllers>` constructors, or it can be :doc:`auto-loaded
-<../general/autoloader>` by the system.
-For the most part the session class will run unattended in the background,
-so simply initializing the class will cause it to read, create, and update
-sessions when necessary.
-
-To initialize the Session class manually in your controller constructor,
-use the ``$this->load->library()`` method::
-
- $this->load->library('session');
-
-Once loaded, the Sessions library object will be available using::
-
- $this->session
-
-.. important:: Because the :doc:`Loader Class </libraries/loader>` is instantiated
- by CodeIgniter's base controller, make sure to call
- ``parent::__construct()`` before trying to load a library from
- inside a controller constructor.
-
-How do Sessions work?
-=====================
-
-When a page is loaded, the session class will check to see if valid
-session cookie is sent by the user's browser. If a sessions cookie does
-**not** exist (or if it doesn't match one stored on the server or has
-expired) a new session will be created and saved.
-
-If a valid session does exist, its information will be updated. With each
-update, the session ID may be regenerated if configured to do so.
-
-It's important for you to understand that once initialized, the Session
-class runs automatically. There is nothing you need to do to cause the
-above behavior to happen. You can, as you'll see below, work with session
-data, but the process of reading, writing, and updating a session is
-automatic.
-
-.. note:: Under CLI, the Session library will automatically halt itself,
- as this is a concept based entirely on the HTTP protocol.
-
-A note about concurrency
-------------------------
-
-Unless you're developing a website with heavy AJAX usage, you can skip this
-section. If you are, however, and if you're experiencing performance
-issues, then this note is exactly what you're looking for.
-
-Sessions in previous versions of CodeIgniter didn't implement locking,
-which meant that two HTTP requests using the same session could run exactly
-at the same time. To use a more appropriate technical term - requests were
-non-blocking.
-
-However, non-blocking requests in the context of sessions also means
-unsafe, because modifications to session data (or session ID regeneration)
-in one request can interfere with the execution of a second, concurrent
-request. This detail was at the root of many issues and the main reason why
-CodeIgniter 3.0 has a completely re-written Session library.
-
-Why are we telling you this? Because it is likely that after trying to
-find the reason for your performance issues, you may conclude that locking
-is the issue and therefore look into how to remove the locks ...
-
-DO NOT DO THAT! Removing locks would be **wrong** and it will cause you
-more problems!
-
-Locking is not the issue, it is a solution. Your issue is that you still
-have the session open, while you've already processed it and therefore no
-longer need it. So, what you need is to close the session for the
-current request after you no longer need it.
-
-Long story short - call ``session_write_close()`` once you no longer need
-anything to do with session variables.
-
-What is Session Data?
-=====================
-
-Session data is simply an array associated with a particular session ID
-(cookie).
-
-If you've used sessions in PHP before, you should be familiar with PHP's
-`$_SESSION superglobal <http://php.net/manual/en/reserved.variables.session.php>`_
-(if not, please read the content on that link).
-
-CodeIgniter gives access to its session data through the same means, as it
-uses the session handlers' mechanism provided by PHP. Using session data is
-as simple as manipulating (read, set and unset values) the ``$_SESSION``
-array.
-
-In addition, CodeIgniter also provides 2 special types of session data
-that are further explained below: flashdata and tempdata.
-
-.. note:: In previous versions, regular session data in CodeIgniter was
- referred to as 'userdata'. Have this in mind if that term is used
- elsewhere in the manual. Most of it is written to explain how
- the custom 'userdata' methods work.
-
-Retrieving Session Data
-=======================
-
-Any piece of information from the session array is available through the
-``$_SESSION`` superglobal::
-
- $_SESSION['item']
-
-Or through the magic getter::
-
- $this->session->item
-
-And for backwards compatibility, through the ``userdata()`` method::
-
- $this->session->userdata('item');
-
-Where item is the array key corresponding to the item you wish to fetch.
-For example, to assign a previously stored 'name' item to the ``$name``
-variable, you will do this::
-
- $name = $_SESSION['name'];
-
- // or:
-
- $name = $this->session->name
-
- // or:
-
- $name = $this->session->userdata('name');
-
-.. note:: The ``userdata()`` method returns NULL if the item you are trying
- to access does not exist.
-
-If you want to retrieve all of the existing userdata, you can simply
-omit the item key (magic getter only works for properties)::
-
- $_SESSION
-
- // or:
-
- $this->session->userdata();
-
-Adding Session Data
-===================
-
-Let's say a particular user logs into your site. Once authenticated, you
-could add their username and e-mail address to the session, making that
-data globally available to you without having to run a database query when
-you need it.
-
-You can simply assign data to the ``$_SESSION`` array, as with any other
-variable. Or as a property of ``$this->session``.
-
-Alternatively, the old method of assigning it as "userdata" is also
-available. That however passing an array containing your new data to the
-``set_userdata()`` method::
-
- $this->session->set_userdata($array);
-
-Where ``$array`` is an associative array containing your new data. Here's
-an example::
-
- $newdata = array(
- 'username' => 'johndoe',
- 'email' => 'johndoe@some-site.com',
- 'logged_in' => TRUE
- );
-
- $this->session->set_userdata($newdata);
-
-If you want to add userdata one value at a time, ``set_userdata()`` also
-supports this syntax::
-
- $this->session->set_userdata('some_name', 'some_value');
-
-If you want to verify that a session value exists, simply check with
-``isset()``::
-
- // returns FALSE if the 'some_name' item doesn't exist or is NULL,
- // TRUE otherwise:
- isset($_SESSION['some_name'])
-
-Or you can call ``has_userdata()``::
-
- $this->session->has_userdata('some_name');
-
-Removing Session Data
-=====================
-
-Just as with any other variable, unsetting a value in ``$_SESSION`` can be
-done through ``unset()``::
-
- unset($_SESSION['some_name']);
-
- // or multiple values:
-
- unset(
- $_SESSION['some_name'],
- $_SESSION['another_name']
- );
-
-Also, just as ``set_userdata()`` can be used to add information to a
-session, ``unset_userdata()`` can be used to remove it, by passing the
-session key. For example, if you wanted to remove 'some_name' from your
-session data array::
-
- $this->session->unset_userdata('some_name');
-
-This method also accepts an array of item keys to unset::
-
- $array_items = array('username', 'email');
-
- $this->session->unset_userdata($array_items);
-
-.. note:: In previous versions, the ``unset_userdata()`` method used
- to accept an associative array of ``key => 'dummy value'``
- pairs. This is no longer supported.
-
-Flashdata
-=========
-
-CodeIgniter supports "flashdata", or session data that will only be
-available for the next request, and is then automatically cleared.
-
-This can be very useful, especially for one-time informational, error or
-status messages (for example: "Record 2 deleted").
-
-It should be noted that flashdata variables are regular session vars,
-only marked in a specific way under the '__ci_vars' key (please don't touch
-that one, you've been warned).
-
-To mark an existing item as "flashdata"::
-
- $this->session->mark_as_flash('item');
-
-If you want to mark multiple items as flashdata, simply pass the keys as an
-array::
-
- $this->session->mark_as_flash(array('item', 'item2'));
-
-To add flashdata::
-
- $_SESSION['item'] = 'value';
- $this->session->mark_as_flash('item');
-
-Or alternatively, using the ``set_flashdata()`` method::
-
- $this->session->set_flashdata('item', 'value');
-
-You can also pass an array to ``set_flashdata()``, in the same manner as
-``set_userdata()``.
-
-Reading flashdata variables is the same as reading regular session data
-through ``$_SESSION``::
-
- $_SESSION['item']
-
-.. important:: The ``userdata()`` method will NOT return flashdata items.
-
-However, if you want to be sure that you're reading "flashdata" (and not
-any other kind), you can also use the ``flashdata()`` method::
-
- $this->session->flashdata('item');
-
-Or to get an array with all flashdata, simply omit the key parameter::
-
- $this->session->flashdata();
-
-.. note:: The ``flashdata()`` method returns NULL if the item cannot be
- found.
-
-If you find that you need to preserve a flashdata variable through an
-additional request, you can do so using the ``keep_flashdata()`` method.
-You can either pass a single item or an array of flashdata items to keep.
-
-::
-
- $this->session->keep_flashdata('item');
- $this->session->keep_flashdata(array('item1', 'item2', 'item3'));
-
-Tempdata
-========
-
-CodeIgniter also supports "tempdata", or session data with a specific
-expiration time. After the value expires, or the session expires or is
-deleted, the value is automatically removed.
-
-Similarly to flashdata, tempdata variables are regular session vars that
-are marked in a specific way under the '__ci_vars' key (again, don't touch
-that one).
-
-To mark an existing item as "tempdata", simply pass its key and expiry time
-(in seconds!) to the ``mark_as_temp()`` method::
-
- // 'item' will be erased after 300 seconds
- $this->session->mark_as_temp('item', 300);
-
-You can mark multiple items as tempdata in two ways, depending on whether
-you want them all to have the same expiry time or not::
-
- // Both 'item' and 'item2' will expire after 300 seconds
- $this->session->mark_as_temp(array('item', 'item2'), 300);
-
- // 'item' will be erased after 300 seconds, while 'item2'
- // will do so after only 240 seconds
- $this->session->mark_as_temp(array(
- 'item' => 300,
- 'item2' => 240
- ));
-
-To add tempdata::
-
- $_SESSION['item'] = 'value';
- $this->session->mark_as_temp('item', 300); // Expire in 5 minutes
-
-Or alternatively, using the ``set_tempdata()`` method::
-
- $this->session->set_tempdata('item', 'value', 300);
-
-You can also pass an array to ``set_tempdata()``::
-
- $tempdata = array('newuser' => TRUE, 'message' => 'Thanks for joining!');
-
- $this->session->set_tempdata($tempdata, NULL, $expire);
-
-.. note:: If the expiration is omitted or set to 0, the default
- time-to-live value of 300 seconds (or 5 minutes) will be used.
-
-To read a tempdata variable, again you can just access it through the
-``$_SESSION`` superglobal array::
-
- $_SESSION['item']
-
-.. important:: The ``userdata()`` method will NOT return tempdata items.
-
-Or if you want to be sure that you're reading "tempdata" (and not any
-other kind), you can also use the ``tempdata()`` method::
-
- $this->session->tempdata('item');
-
-And of course, if you want to retrieve all existing tempdata::
-
- $this->session->tempdata();
-
-.. note:: The ``tempdata()`` method returns NULL if the item cannot be
- found.
-
-If you need to remove a tempdata value before it expires, you can directly
-unset it from the ``$_SESSION`` array::
-
- unset($_SESSION['item']);
-
-However, this won't remove the marker that makes this specific item to be
-tempdata (it will be invalidated on the next HTTP request), so if you
-intend to reuse that same key in the same request, you'd want to use
-``unset_tempdata()``::
-
- $this->session->unset_tempdata('item');
-
-Destroying a Session
-====================
-
-To clear the current session (for example, during a logout), you may
-simply use either PHP's `session_destroy() <http://php.net/session_destroy>`_
-function, or the ``sess_destroy()`` method. Both will work in exactly the
-same way::
-
- session_destroy();
-
- // or
-
- $this->session->sess_destroy();
-
-.. note:: This must be the last session-related operation that you do
- during the same request. All session data (including flashdata and
- tempdata) will be destroyed permanently and functions will be
- unusable during the same request after you destroy the session.
-
-Accessing session metadata
-==========================
-
-In previous CodeIgniter versions, the session data array included 4 items
-by default: 'session_id', 'ip_address', 'user_agent', 'last_activity'.
-
-This was due to the specifics of how sessions worked, but is now no longer
-necessary with our new implementation. However, it may happen that your
-application relied on these values, so here are alternative methods of
-accessing them:
-
- - session_id: ``session_id()``
- - ip_address: ``$_SERVER['REMOTE_ADDR']``
- - user_agent: ``$this->input->user_agent()`` (unused by sessions)
- - last_activity: Depends on the storage, no straightforward way. Sorry!
-
-Session Preferences
-===================
-
-CodeIgniter will usually make everything work out of the box. However,
-Sessions are a very sensitive component of any application, so some
-careful configuration must be done. Please take your time to consider
-all of the options and their effects.
-
-You'll find the following Session related preferences in your
-**application/config/config.php** file:
-
-============================ =============== ======================================== ============================================================================================
-Preference Default Options Description
-============================ =============== ======================================== ============================================================================================
-**sess_driver** files files/database/redis/memcached/*custom* The session storage driver to use.
-**sess_cookie_name** ci_session [A-Za-z\_-] characters only The name used for the session cookie.
-**sess_samesite** ci_session 'Lax', 'Strict' or 'None' SameSite attribute value for session cookies.
- Defaults to ``session.cookie_samesite`` on PHP 7.3+ or 'Lax' if not present at all.
-**sess_expiration** 7200 (2 hours) Time in seconds (integer) The number of seconds you would like the session to last.
- If you would like a non-expiring session (until browser is closed) set the value to zero: 0
-**sess_save_path** NULL None Specifies the storage location, depends on the driver being used.
-**sess_match_ip** FALSE TRUE/FALSE (boolean) Whether to validate the user's IP address when reading the session cookie.
- Note that some ISPs dynamically changes the IP, so if you want a non-expiring session you
- will likely set this to FALSE.
-**sess_time_to_update** 300 Time in seconds (integer) This option controls how often the session class will regenerate itself and create a new
- session ID. Setting it to 0 will disable session ID regeneration.
-**sess_regenerate_destroy** FALSE TRUE/FALSE (boolean) Whether to destroy session data associated with the old session ID when auto-regenerating
- the session ID. When set to FALSE, the data will be later deleted by the garbage collector.
-============================ =============== ======================================== ============================================================================================
-
-.. note:: As a last resort, the Session library will try to fetch PHP's
- session related INI settings, as well as legacy CI settings such as
- 'sess_expire_on_close' when any of the above is not configured.
- However, you should never rely on this behavior as it can cause
- unexpected results or be changed in the future. Please configure
- everything properly.
-
-In addition to the values above, the cookie and native drivers apply the
-following configuration values shared by the :doc:`Input <input>` and
-:doc:`Security <security>` classes:
-
-================== =============== ===========================================================================
-Preference Default Description
-================== =============== ===========================================================================
-**cookie_domain** '' The domain for which the session is applicable
-**cookie_path** / The path to which the session is applicable
-**cookie_secure** FALSE Whether to create the session cookie only on encrypted (HTTPS) connections
-================== =============== ===========================================================================
-
-.. note:: The 'cookie_httponly' setting doesn't have an effect on sessions.
- Instead the HttpOnly parameter is always enabled, for security
- reasons. Additionally, the 'cookie_prefix' setting is completely
- ignored.
-
-Session Drivers
-===============
-
-As already mentioned, the Session library comes with 4 drivers, or storage
-engines, that you can use:
-
- - files
- - database
- - redis
- - memcached
-
-By default, the `Files Driver`_ will be used when a session is initialized,
-because it is the most safe choice and is expected to work everywhere
-(virtually every environment has a file system).
-
-However, any other driver may be selected via the ``$config['sess_driver']``
-line in your **application/config/config.php** file, if you chose to do so.
-Have it in mind though, every driver has different caveats, so be sure to
-get yourself familiar with them (below) before you make that choice.
-
-In addition, you may also create and use `Custom Drivers`_, if the ones
-provided by default don't satisfy your use case.
-
-.. note:: In previous CodeIgniter versions, a different, "cookie driver"
- was the only option and we have received negative feedback on not
- providing that option. While we do listen to feedback from the
- community, we want to warn you that it was dropped because it is
- **unsafe** and we advise you NOT to try to replicate it via a
- custom driver.
-
-Files Driver
-------------
-
-The 'files' driver uses your file system for storing session data.
-
-It can safely be said that it works exactly like PHP's own default session
-implementation, but in case this is an important detail for you, have it
-mind that it is in fact not the same code and it has some limitations
-(and advantages).
-
-To be more specific, it doesn't support PHP's `directory level and mode
-formats used in session.save_path
-<http://php.net/manual/en/session.configuration.php#ini.session.save-path>`_,
-and it has most of the options hard-coded for safety. Instead, only
-absolute paths are supported for ``$config['sess_save_path']``.
-
-Another important thing that you should know, is to make sure that you
-don't use a publicly-readable or shared directory for storing your session
-files. Make sure that *only you* have access to see the contents of your
-chosen *sess_save_path* directory. Otherwise, anybody who can do that, can
-also steal any of the current sessions (also known as "session fixation"
-attack).
-
-On UNIX-like operating systems, this is usually achieved by setting the
-0700 mode permissions on that directory via the `chmod` command, which
-allows only the directory's owner to perform read and write operations on
-it. But be careful because the system user *running* the script is usually
-not your own, but something like 'www-data' instead, so only setting those
-permissions will probable break your application.
-
-Instead, you should do something like this, depending on your environment
-::
-
- mkdir /<path to your application directory>/sessions/
- chmod 0700 /<path to your application directory>/sessions/
- chown www-data /<path to your application directory>/sessions/
-
-Bonus Tip
-^^^^^^^^^
-
-Some of you will probably opt to choose another session driver because
-file storage is usually slower. This is only half true.
-
-A very basic test will probably trick you into believing that an SQL
-database is faster, but in 99% of the cases, this is only true while you
-only have a few current sessions. As the sessions count and server loads
-increase - which is the time when it matters - the file system will
-consistently outperform almost all relational database setups.
-
-In addition, if performance is your only concern, you may want to look
-into using `tmpfs <http://eddmann.com/posts/storing-php-sessions-file-caches-in-memory-using-tmpfs/>`_,
-(warning: external resource), which can make your sessions blazing fast.
-
-Database Driver
----------------
-
-The 'database' driver uses a relational database such as MySQL or
-PostgreSQL to store sessions. This is a popular choice among many users,
-because it allows the developer easy access to the session data within
-an application - it is just another table in your database.
-
-However, there are some conditions that must be met:
-
- - Only your **default** database connection (or the one that you access
- as ``$this->db`` from your controllers) can be used.
- - You must have the :doc:`Query Builder </database/query_builder>`
- enabled.
- - You can NOT use a persistent connection.
- - You can NOT use a connection with the *cache_on* setting enabled.
-
-In order to use the 'database' session driver, you must also create this
-table that we already mentioned and then set it as your
-``$config['sess_save_path']`` value.
-For example, if you would like to use 'ci_sessions' as your table name,
-you would do this::
-
- $config['sess_driver'] = 'database';
- $config['sess_save_path'] = 'ci_sessions';
-
-.. note:: If you've upgraded from a previous version of CodeIgniter and
- you don't have 'sess_save_path' configured, then the Session
- library will look for the old 'sess_table_name' setting and use
- it instead. Please don't rely on this behavior as it will get
- removed in the future.
-
-And then of course, create the database table ...
-
-For MySQL::
-
- CREATE TABLE IF NOT EXISTS `ci_sessions` (
- `id` varchar(128) NOT NULL,
- `ip_address` varchar(45) NOT NULL,
- `timestamp` int(10) unsigned DEFAULT 0 NOT NULL,
- `data` blob NOT NULL,
- KEY `ci_sessions_timestamp` (`timestamp`)
- );
-
-For PostgreSQL::
-
- CREATE TABLE "ci_sessions" (
- "id" varchar(128) NOT NULL,
- "ip_address" varchar(45) NOT NULL,
- "timestamp" bigint DEFAULT 0 NOT NULL,
- "data" text DEFAULT '' NOT NULL
- );
-
- CREATE INDEX "ci_sessions_timestamp" ON "ci_sessions" ("timestamp");
-
-You will also need to add a PRIMARY KEY **depending on your 'sess_match_ip'
-setting**. The examples below work both on MySQL and PostgreSQL::
-
- // When sess_match_ip = TRUE
- ALTER TABLE ci_sessions ADD PRIMARY KEY (id, ip_address);
-
- // When sess_match_ip = FALSE
- ALTER TABLE ci_sessions ADD PRIMARY KEY (id);
-
- // To drop a previously created primary key (use when changing the setting)
- ALTER TABLE ci_sessions DROP PRIMARY KEY;
-
-
-.. important:: Only MySQL and PostgreSQL databases are officially
- supported, due to lack of advisory locking mechanisms on other
- platforms. Using sessions without locks can cause all sorts of
- problems, especially with heavy usage of AJAX, and we will not
- support such cases. Use ``session_write_close()`` after you've
- done processing session data if you're having performance
- issues.
-
-Redis Driver
-------------
-
-.. note:: Since Redis doesn't have a locking mechanism exposed, locks for
- this driver are emulated by a separate value that is kept for up
- to 300 seconds.
-
-Redis is a storage engine typically used for caching and popular because
-of its high performance, which is also probably your reason to use the
-'redis' session driver.
-
-The downside is that it is not as ubiquitous as relational databases and
-requires the `phpredis <https://github.com/phpredis/phpredis>`_ PHP
-extension to be installed on your system, and that one doesn't come
-bundled with PHP.
-Chances are, you're only be using the 'redis' driver only if you're already
-both familiar with Redis and using it for other purposes.
-
-Just as with the 'files' and 'database' drivers, you must also configure
-the storage location for your sessions via the
-``$config['sess_save_path']`` setting.
-The format here is a bit different and complicated at the same time. It is
-best explained by the *phpredis* extension's README file, so we'll simply
-link you to it:
-
- https://github.com/phpredis/phpredis#php-session-handler
-
-.. warning:: CodeIgniter's Session library does NOT use the actual 'redis'
- ``session.save_handler``. Take note **only** of the path format in
- the link above.
-
-For the most common case however, a simple ``host:port`` pair should be
-sufficient::
-
- $config['sess_driver'] = 'redis';
- $config['sess_save_path'] = 'tcp://localhost:6379';
-
-Memcached Driver
-----------------
-
-.. note:: Since Memcache doesn't have a locking mechanism exposed, locks
- for this driver are emulated by a separate value that is kept for
- up to 300 seconds.
-
-The 'memcached' driver is very similar to the 'redis' one in all of its
-properties, except perhaps for availability, because PHP's `Memcached
-<http://php.net/memcached>`_ extension is distributed via PECL and some
-Linux distrubutions make it available as an easy to install package.
-
-Other than that, and without any intentional bias towards Redis, there's
-not much different to be said about Memcached - it is also a popular
-product that is usually used for caching and famed for its speed.
-
-However, it is worth noting that the only guarantee given by Memcached
-is that setting value X to expire after Y seconds will result in it being
-deleted after Y seconds have passed (but not necessarily that it won't
-expire earlier than that time). This happens very rarely, but should be
-considered as it may result in loss of sessions.
-
-The ``$config['sess_save_path']`` format is fairly straightforward here,
-being just a ``host:port`` pair::
-
- $config['sess_driver'] = 'memcached';
- $config['sess_save_path'] = 'localhost:11211';
-
-Bonus Tip
-^^^^^^^^^
-
-Multi-server configuration with an optional *weight* parameter as the
-third colon-separated (``:weight``) value is also supported, but we have
-to note that we haven't tested if that is reliable.
-
-If you want to experiment with this feature (on your own risk), simply
-separate the multiple server paths with commas::
-
- // localhost will be given higher priority (5) here,
- // compared to 192.0.2.1 with a weight of 1.
- $config['sess_save_path'] = 'localhost:11211:5,192.0.2.1:11211:1';
-
-Custom Drivers
---------------
-
-You may also create your own, custom session drivers. However, have it in
-mind that this is typically not an easy task, as it takes a lot of
-knowledge to do it properly.
-
-You need to know not only how sessions work in general, but also how they
-work specifically in PHP, how the underlying storage mechanism works, how
-to handle concurrency, avoid deadlocks (but NOT through lack of locks) and
-last but not least - how to handle the potential security issues, which
-is far from trivial.
-
-Long story short - if you don't know how to do that already in raw PHP,
-you shouldn't be trying to do it within CodeIgniter either. You've been
-warned.
-
-If you only want to add some extra functionality to your sessions, just
-extend the base Session class, which is a lot more easier. Read the
-:doc:`Creating Libraries <../general/creating_libraries>` article to
-learn how to do that.
-
-Now, to the point - there are three general rules that you must follow
-when creating a session driver for CodeIgniter:
-
- - Put your driver's file under **application/libraries/Session/drivers/**
- and follow the naming conventions used by the Session class.
-
- For example, if you were to create a 'dummy' driver, you would have
- a ``Session_dummy_driver`` class name, that is declared in
- *application/libraries/Session/drivers/Session_dummy_driver.php*.
-
- - Extend the ``CI_Session_driver`` class.
-
- This is just a basic class with a few internal helper methods. It is
- also extendable like any other library, if you really need to do that,
- but we are not going to explain how ... if you're familiar with how
- class extensions/overrides work in CI, then you already know how to do
- it. If not, well, you shouldn't be doing it in the first place.
-
-
- - Implement the `SessionHandlerInterface
- <http://php.net/sessionhandlerinterface>`_ interface.
-
- .. note:: You may notice that ``SessionHandlerInterface`` is provided
- by PHP since version 5.4.0. CodeIgniter will automatically declare
- the same interface if you're running an older PHP version.
-
- The link will explain why and how.
-
-So, based on our 'dummy' driver example above, you'd end up with something
-like this::
-
- // application/libraries/Session/drivers/Session_dummy_driver.php:
-
- class CI_Session_dummy_driver extends CI_Session_driver implements SessionHandlerInterface
- {
-
- public function __construct(&$params)
- {
- // DO NOT forget this
- parent::__construct($params);
-
- // Configuration & other initializations
- }
-
- public function open($save_path, $name)
- {
- // Initialize storage mechanism (connection)
- }
-
- public function read($session_id)
- {
- // Read session data (if exists), acquire locks
- }
-
- public function write($session_id, $session_data)
- {
- // Create / update session data (it might not exist!)
- }
-
- public function close()
- {
- // Free locks, close connections / streams / etc.
- }
-
- public function destroy($session_id)
- {
- // Call close() method & destroy data for current session (order may differ)
- }
-
- public function gc($maxlifetime)
- {
- // Erase data for expired sessions
- }
-
- }
-
-If you've done everything properly, you can now set your *sess_driver*
-configuration value to 'dummy' and use your own driver. Congratulations!
-
-***************
-Class Reference
-***************
-
-.. php:class:: CI_Session
-
- .. php:method:: userdata([$key = NULL])
-
- :param mixed $key: Session item key or NULL
- :returns: Value of the specified item key, or an array of all userdata
- :rtype: mixed
-
- Gets the value for a specific ``$_SESSION`` item, or an
- array of all "userdata" items if not key was specified.
-
- .. note:: This is a legacy method kept only for backwards
- compatibility with older applications. You should
- directly access ``$_SESSION`` instead.
-
- .. php:method:: all_userdata()
-
- :returns: An array of all userdata
- :rtype: array
-
- Returns an array containing all "userdata" items.
-
- .. note:: This method is DEPRECATED. Use ``userdata()``
- with no parameters instead.
-
- .. php:method:: &get_userdata()
-
- :returns: A reference to ``$_SESSION``
- :rtype: array
-
- Returns a reference to the ``$_SESSION`` array.
-
- .. note:: This is a legacy method kept only for backwards
- compatibility with older applications.
-
- .. php:method:: has_userdata($key)
-
- :param string $key: Session item key
- :returns: TRUE if the specified key exists, FALSE if not
- :rtype: bool
-
- Checks if an item exists in ``$_SESSION``.
-
- .. note:: This is a legacy method kept only for backwards
- compatibility with older applications. It is just
- an alias for ``isset($_SESSION[$key])`` - please
- use that instead.
-
- .. php:method:: set_userdata($data[, $value = NULL])
-
- :param mixed $data: An array of key/value pairs to set as session data, or the key for a single item
- :param mixed $value: The value to set for a specific session item, if $data is a key
- :rtype: void
-
- Assigns data to the ``$_SESSION`` superglobal.
-
- .. note:: This is a legacy method kept only for backwards
- compatibility with older applications.
-
- .. php:method:: unset_userdata($key)
-
- :param mixed $key: Key for the session data item to unset, or an array of multiple keys
- :rtype: void
-
- Unsets the specified key(s) from the ``$_SESSION``
- superglobal.
-
- .. note:: This is a legacy method kept only for backwards
- compatibility with older applications. It is just
- an alias for ``unset($_SESSION[$key])`` - please
- use that instead.
-
- .. php:method:: mark_as_flash($key)
-
- :param mixed $key: Key to mark as flashdata, or an array of multiple keys
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Marks a ``$_SESSION`` item key (or multiple ones) as
- "flashdata".
-
- .. php:method:: get_flash_keys()
-
- :returns: Array containing the keys of all "flashdata" items.
- :rtype: array
-
- Gets a list of all ``$_SESSION`` that have been marked as
- "flashdata".
-
- .. php:method:: unmark_flash($key)
-
- :param mixed $key: Key to be un-marked as flashdata, or an array of multiple keys
- :rtype: void
-
- Unmarks a ``$_SESSION`` item key (or multiple ones) as
- "flashdata".
-
- .. php:method:: flashdata([$key = NULL])
-
- :param mixed $key: Flashdata item key or NULL
- :returns: Value of the specified item key, or an array of all flashdata
- :rtype: mixed
-
- Gets the value for a specific ``$_SESSION`` item that has
- been marked as "flashdata", or an array of all "flashdata"
- items if no key was specified.
-
- .. note:: This is a legacy method kept only for backwards
- compatibility with older applications. You should
- directly access ``$_SESSION`` instead.
-
- .. php:method:: keep_flashdata($key)
-
- :param mixed $key: Flashdata key to keep, or an array of multiple keys
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Retains the specified session data key(s) as "flashdata"
- through the next request.
-
- .. note:: This is a legacy method kept only for backwards
- compatibility with older applications. It is just
- an alias for the ``mark_as_flash()`` method.
-
- .. php:method:: set_flashdata($data[, $value = NULL])
-
- :param mixed $data: An array of key/value pairs to set as flashdata, or the key for a single item
- :param mixed $value: The value to set for a specific session item, if $data is a key
- :rtype: void
-
- Assigns data to the ``$_SESSION`` superglobal and marks it
- as "flashdata".
-
- .. note:: This is a legacy method kept only for backwards
- compatibility with older applications.
-
- .. php:method:: mark_as_temp($key[, $ttl = 300])
-
- :param mixed $key: Key to mark as tempdata, or an array of multiple keys
- :param int $ttl: Time-to-live value for the tempdata, in seconds
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Marks a ``$_SESSION`` item key (or multiple ones) as
- "tempdata".
-
- .. php:method:: get_temp_keys()
-
- :returns: Array containing the keys of all "tempdata" items.
- :rtype: array
-
- Gets a list of all ``$_SESSION`` that have been marked as
- "tempdata".
-
- .. php:method:: unmark_temp($key)
-
- :param mixed $key: Key to be un-marked as tempdata, or an array of multiple keys
- :rtype: void
-
- Unmarks a ``$_SESSION`` item key (or multiple ones) as
- "tempdata".
-
- .. php:method:: tempdata([$key = NULL])
-
- :param mixed $key: Tempdata item key or NULL
- :returns: Value of the specified item key, or an array of all tempdata
- :rtype: mixed
-
- Gets the value for a specific ``$_SESSION`` item that has
- been marked as "tempdata", or an array of all "tempdata"
- items if no key was specified.
-
- .. note:: This is a legacy method kept only for backwards
- compatibility with older applications. You should
- directly access ``$_SESSION`` instead.
-
- .. php:method:: set_tempdata($data[, $value = NULL])
-
- :param mixed $data: An array of key/value pairs to set as tempdata, or the key for a single item
- :param mixed $value: The value to set for a specific session item, if $data is a key
- :param int $ttl: Time-to-live value for the tempdata item(s), in seconds
- :rtype: void
-
- Assigns data to the ``$_SESSION`` superglobal and marks it
- as "tempdata".
-
- .. note:: This is a legacy method kept only for backwards
- compatibility with older applications.
-
- .. php:method:: sess_regenerate([$destroy = FALSE])
-
- :param bool $destroy: Whether to destroy session data
- :rtype: void
-
- Regenerate session ID, optionally destroying the current
- session's data.
-
- .. note:: This method is just an alias for PHP's native
- `session_regenerate_id()
- <http://php.net/session_regenerate_id>`_ function.
-
- .. php:method:: sess_destroy()
-
- :rtype: void
-
- Destroys the current session.
-
- .. note:: This must be the *last* session-related function
- that you call. All session data will be lost after
- you do that.
-
- .. note:: This method is just an alias for PHP's native
- `session_destroy()
- <http://php.net/session_destroy>`_ function.
-
- .. php:method:: __get($key)
-
- :param string $key: Session item key
- :returns: The requested session data item, or NULL if it doesn't exist
- :rtype: mixed
-
- A magic method that allows you to use
- ``$this->session->item`` instead of ``$_SESSION['item']``,
- if that's what you prefer.
-
- It will also return the session ID by calling
- ``session_id()`` if you try to access
- ``$this->session->session_id``.
-
- .. php:method:: __set($key, $value)
-
- :param string $key: Session item key
- :param mixed $value: Value to assign to the session item key
- :returns: void
-
- A magic method that allows you to assign items to
- ``$_SESSION`` by accessing them as ``$this->session``
- properties::
-
- $this->session->foo = 'bar';
-
- // Results in:
- // $_SESSION['foo'] = 'bar';
diff --git a/user_guide_src/source/libraries/table.rst b/user_guide_src/source/libraries/table.rst
deleted file mode 100644
index 91ae1ae8d..000000000
--- a/user_guide_src/source/libraries/table.rst
+++ /dev/null
@@ -1,297 +0,0 @@
-################
-HTML Table Class
-################
-
-The Table Class provides functions that enable you to auto-generate HTML
-tables from arrays or database result sets.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-*********************
-Using the Table Class
-*********************
-
-Initializing the Class
-======================
-
-Like most other classes in CodeIgniter, the Table class is initialized
-in your controller using the ``$this->load->library()`` method::
-
- $this->load->library('table');
-
-Once loaded, the Table library object will be available using::
-
- $this->table
-
-Examples
-========
-
-Here is an example showing how you can create a table from a
-multi-dimensional array. Note that the first array index will become the
-table heading (or you can set your own headings using the ``set_heading()``
-method described in the function reference below).
-
-::
-
- $this->load->library('table');
-
- $data = array(
- array('Name', 'Color', 'Size'),
- array('Fred', 'Blue', 'Small'),
- array('Mary', 'Red', 'Large'),
- array('John', 'Green', 'Medium')
- );
-
- echo $this->table->generate($data);
-
-Here is an example of a table created from a database query result. The
-table class will automatically generate the headings based on the table
-names (or you can set your own headings using the ``set_heading()``
-method described in the class reference below).
-
-::
-
- $this->load->library('table');
-
- $query = $this->db->query('SELECT * FROM my_table');
-
- echo $this->table->generate($query);
-
-Here is an example showing how you might create a table using discrete
-parameters::
-
- $this->load->library('table');
-
- $this->table->set_heading('Name', 'Color', 'Size');
-
- $this->table->add_row('Fred', 'Blue', 'Small');
- $this->table->add_row('Mary', 'Red', 'Large');
- $this->table->add_row('John', 'Green', 'Medium');
-
- echo $this->table->generate();
-
-Here is the same example, except instead of individual parameters,
-arrays are used::
-
- $this->load->library('table');
-
- $this->table->set_heading(array('Name', 'Color', 'Size'));
-
- $this->table->add_row(array('Fred', 'Blue', 'Small'));
- $this->table->add_row(array('Mary', 'Red', 'Large'));
- $this->table->add_row(array('John', 'Green', 'Medium'));
-
- echo $this->table->generate();
-
-Changing the Look of Your Table
-===============================
-
-The Table Class permits you to set a table template with which you can
-specify the design of your layout. Here is the template prototype::
-
- $template = array(
- 'table_open' => '<table border="0" cellpadding="4" cellspacing="0">',
-
- 'thead_open' => '<thead>',
- 'thead_close' => '</thead>',
-
- 'heading_row_start' => '<tr>',
- 'heading_row_end' => '</tr>',
- 'heading_cell_start' => '<th>',
- 'heading_cell_end' => '</th>',
-
- 'tbody_open' => '<tbody>',
- 'tbody_close' => '</tbody>',
-
- 'row_start' => '<tr>',
- 'row_end' => '</tr>',
- 'cell_start' => '<td>',
- 'cell_end' => '</td>',
-
- 'row_alt_start' => '<tr>',
- 'row_alt_end' => '</tr>',
- 'cell_alt_start' => '<td>',
- 'cell_alt_end' => '</td>',
-
- 'table_close' => '</table>'
- );
-
- $this->table->set_template($template);
-
-.. note:: You'll notice there are two sets of "row" blocks in the
- template. These permit you to create alternating row colors or design
- elements that alternate with each iteration of the row data.
-
-You are NOT required to submit a complete template. If you only need to
-change parts of the layout you can simply submit those elements. In this
-example, only the table opening tag is being changed::
-
- $template = array(
- 'table_open' => '<table border="1" cellpadding="2" cellspacing="1" class="mytable">'
- );
-
- $this->table->set_template($template);
-
-You can also set defaults for these in a config file.
-
-***************
-Class Reference
-***************
-
-.. php:class:: CI_Table
-
- .. attribute:: $function = NULL
-
- Allows you to specify a native PHP function or a valid function array object to be applied to all cell data.
- ::
-
- $this->load->library('table');
-
- $this->table->set_heading('Name', 'Color', 'Size');
- $this->table->add_row('Fred', '<strong>Blue</strong>', 'Small');
-
- $this->table->function = 'htmlspecialchars';
- echo $this->table->generate();
-
- In the above example, all cell data would be ran through PHP's :php:func:`htmlspecialchars()` function, resulting in::
-
- <td>Fred</td><td>&lt;strong&gt;Blue&lt;/strong&gt;</td><td>Small</td>
-
- .. php:method:: generate([$table_data = NULL])
-
- :param mixed $table_data: Data to populate the table rows with
- :returns: HTML table
- :rtype: string
-
- Returns a string containing the generated table. Accepts an optional parameter which can be an array or a database result object.
-
- .. php:method:: set_caption($caption)
-
- :param string $caption: Table caption
- :returns: CI_Table instance (method chaining)
- :rtype: CI_Table
-
- Permits you to add a caption to the table.
- ::
-
- $this->table->set_caption('Colors');
-
- .. php:method:: set_heading([$args = array()[, ...]])
-
- :param mixed $args: An array or multiple strings containing the table column titles
- :returns: CI_Table instance (method chaining)
- :rtype: CI_Table
-
- Permits you to set the table heading. You can submit an array or discrete params::
-
- $this->table->set_heading('Name', 'Color', 'Size');
-
- $this->table->set_heading(array('Name', 'Color', 'Size'));
-
- .. php:method:: add_row([$args = array()[, ...]])
-
- :param mixed $args: An array or multiple strings containing the row values
- :returns: CI_Table instance (method chaining)
- :rtype: CI_Table
-
- Permits you to add a row to your table. You can submit an array or discrete params::
-
- $this->table->add_row('Blue', 'Red', 'Green');
-
- $this->table->add_row(array('Blue', 'Red', 'Green'));
-
- If you would like to set an individual cell's tag attributes, you can use an associative array for that cell.
- The associative key **data** defines the cell's data. Any other key => val pairs are added as key='val' attributes to the tag::
-
- $cell = array('data' => 'Blue', 'class' => 'highlight', 'colspan' => 2);
- $this->table->add_row($cell, 'Red', 'Green');
-
- // generates
- // <td class='highlight' colspan='2'>Blue</td><td>Red</td><td>Green</td>
-
- .. php:method:: make_columns([$array = array()[, $col_limit = 0]])
-
- :param array $array: An array containing multiple rows' data
- :param int $col_limit: Count of columns in the table
- :returns: An array of HTML table columns
- :rtype: array
-
- This method takes a one-dimensional array as input and creates a multi-dimensional array with a depth equal to the number of columns desired.
- This allows a single array with many elements to be displayed in a table that has a fixed column count. Consider this example::
-
- $list = array('one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve');
-
- $new_list = $this->table->make_columns($list, 3);
-
- $this->table->generate($new_list);
-
- // Generates a table with this prototype
-
- <table border="0" cellpadding="4" cellspacing="0">
- <tr>
- <td>one</td><td>two</td><td>three</td>
- </tr><tr>
- <td>four</td><td>five</td><td>six</td>
- </tr><tr>
- <td>seven</td><td>eight</td><td>nine</td>
- </tr><tr>
- <td>ten</td><td>eleven</td><td>twelve</td></tr>
- </table>
-
-
- .. php:method:: set_template($template)
-
- :param array $template: An associative array containing template values
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Permits you to set your template. You can submit a full or partial template.
- ::
-
- $template = array(
- 'table_open' => '<table border="1" cellpadding="2" cellspacing="1" class="mytable">'
- );
-
- $this->table->set_template($template);
-
- .. php:method:: set_empty($value)
-
- :param mixed $value: Value to put in empty cells
- :returns: CI_Table instance (method chaining)
- :rtype: CI_Table
-
- Lets you set a default value for use in any table cells that are empty.
- You might, for example, set a non-breaking space::
-
- $this->table->set_empty("&nbsp;");
-
- .. php:method:: clear()
-
- :returns: CI_Table instance (method chaining)
- :rtype: CI_Table
-
- Lets you clear the table heading and row data. If you need to show multiple tables with different data you should to call this method
- after each table has been generated to clear the previous table information. Example::
-
- $this->load->library('table');
-
- $this->table->set_heading('Name', 'Color', 'Size');
- $this->table->add_row('Fred', 'Blue', 'Small');
- $this->table->add_row('Mary', 'Red', 'Large');
- $this->table->add_row('John', 'Green', 'Medium');
-
- echo $this->table->generate();
-
- $this->table->clear();
-
- $this->table->set_heading('Name', 'Day', 'Delivery');
- $this->table->add_row('Fred', 'Wednesday', 'Express');
- $this->table->add_row('Mary', 'Monday', 'Air');
- $this->table->add_row('John', 'Saturday', 'Overnight');
-
- echo $this->table->generate();
diff --git a/user_guide_src/source/libraries/trackback.rst b/user_guide_src/source/libraries/trackback.rst
deleted file mode 100644
index dc4477e9f..000000000
--- a/user_guide_src/source/libraries/trackback.rst
+++ /dev/null
@@ -1,339 +0,0 @@
-###############
-Trackback Class
-###############
-
-The Trackback Class provides functions that enable you to send and
-receive Trackback data.
-
-If you are not familiar with Trackbacks you'll find more information
-`here <http://en.wikipedia.org/wiki/Trackback>`_.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-*************************
-Using the Trackback Class
-*************************
-
-Initializing the Class
-======================
-
-Like most other classes in CodeIgniter, the Trackback class is
-initialized in your controller using the ``$this->load->library()`` method::
-
- $this->load->library('trackback');
-
-Once loaded, the Trackback library object will be available using::
-
- $this->trackback
-
-Sending Trackbacks
-==================
-
-A Trackback can be sent from any of your controller functions using code
-similar to this example::
-
- $this->load->library('trackback');
-
- $tb_data = array(
- 'ping_url' => 'http://example.com/trackback/456',
- 'url' => 'http://www.my-example.com/blog/entry/123',
- 'title' => 'The Title of My Entry',
- 'excerpt' => 'The entry content.',
- 'blog_name' => 'My Blog Name',
- 'charset' => 'utf-8'
- );
-
- if ( ! $this->trackback->send($tb_data))
- {
- echo $this->trackback->display_errors();
- }
- else
- {
- echo 'Trackback was sent!';
- }
-
-Description of array data:
-
-- **ping_url** - The URL of the site you are sending the Trackback to.
- You can send Trackbacks to multiple URLs by separating each URL with a comma.
-- **url** - The URL to YOUR site where the weblog entry can be seen.
-- **title** - The title of your weblog entry.
-- **excerpt** - The content of your weblog entry.
-- **blog_name** - The name of your weblog.
-- **charset** - The character encoding your weblog is written in. If omitted, UTF-8 will be used.
-
-.. note:: The Trackback class will automatically send only the first 500 characters of your
- entry. It will also strip all HTML.
-
-The Trackback sending method returns TRUE/FALSE (boolean) on success
-or failure. If it fails, you can retrieve the error message using::
-
- $this->trackback->display_errors();
-
-Receiving Trackbacks
-====================
-
-Before you can receive Trackbacks you must create a weblog. If you don't
-have a blog yet there's no point in continuing.
-
-Receiving Trackbacks is a little more complex than sending them, only
-because you will need a database table in which to store them, and you
-will need to validate the incoming trackback data. You are encouraged to
-implement a thorough validation process to guard against spam and
-duplicate data. You may also want to limit the number of Trackbacks you
-allow from a particular IP within a given span of time to further
-curtail spam. The process of receiving a Trackback is quite simple; the
-validation is what takes most of the effort.
-
-Your Ping URL
-=============
-
-In order to accept Trackbacks you must display a Trackback URL next to
-each one of your weblog entries. This will be the URL that people will
-use to send you Trackbacks (we will refer to this as your "Ping URL").
-
-Your Ping URL must point to a controller function where your Trackback
-receiving code is located, and the URL must contain the ID number for
-each particular entry, so that when the Trackback is received you'll be
-able to associate it with a particular entry.
-
-For example, if your controller class is called Trackback, and the
-receiving function is called receive, your Ping URLs will look something
-like this::
-
- http://example.com/index.php/trackback/receive/entry_id
-
-Where entry_id represents the individual ID number for each of your
-entries.
-
-Creating a Trackback Table
-==========================
-
-Before you can receive Trackbacks you must create a table in which to
-store them. Here is a basic prototype for such a table::
-
- CREATE TABLE trackbacks (
- tb_id int(10) unsigned NOT NULL auto_increment,
- entry_id int(10) unsigned NOT NULL default 0,
- url varchar(200) NOT NULL,
- title varchar(100) NOT NULL,
- excerpt text NOT NULL,
- blog_name varchar(100) NOT NULL,
- tb_date int(10) NOT NULL,
- ip_address varchar(45) NOT NULL,
- PRIMARY KEY `tb_id` (`tb_id`),
- KEY `entry_id` (`entry_id`)
- );
-
-The Trackback specification only requires four pieces of information to
-be sent in a Trackback (url, title, excerpt, blog_name), but to make
-the data more useful we've added a few more fields in the above table
-schema (date, IP address, etc.).
-
-Processing a Trackback
-======================
-
-Here is an example showing how you will receive and process a Trackback.
-The following code is intended for use within the controller function
-where you expect to receive Trackbacks.::
-
- $this->load->library('trackback');
- $this->load->database();
-
- if ($this->uri->segment(3) == FALSE)
- {
- $this->trackback->send_error('Unable to determine the entry ID');
- }
-
- if ( ! $this->trackback->receive())
- {
- $this->trackback->send_error('The Trackback did not contain valid data');
- }
-
- $data = array(
- 'tb_id' => '',
- 'entry_id' => $this->uri->segment(3),
- 'url' => $this->trackback->data('url'),
- 'title' => $this->trackback->data('title'),
- 'excerpt' => $this->trackback->data('excerpt'),
- 'blog_name' => $this->trackback->data('blog_name'),
- 'tb_date' => time(),
- 'ip_address' => $this->input->ip_address()
- );
-
- $sql = $this->db->insert_string('trackbacks', $data);
- $this->db->query($sql);
-
- $this->trackback->send_success();
-
-Notes:
-^^^^^^
-
-The entry ID number is expected in the third segment of your URL. This
-is based on the URI example we gave earlier::
-
- http://example.com/index.php/trackback/receive/entry_id
-
-Notice the entry_id is in the third URI segment, which you can retrieve
-using::
-
- $this->uri->segment(3);
-
-In our Trackback receiving code above, if the third segment is missing,
-we will issue an error. Without a valid entry ID, there's no reason to
-continue.
-
-The $this->trackback->receive() function is simply a validation function
-that looks at the incoming data and makes sure it contains the four
-pieces of data that are required (url, title, excerpt, blog_name). It
-returns TRUE on success and FALSE on failure. If it fails you will issue
-an error message.
-
-The incoming Trackback data can be retrieved using this function::
-
- $this->trackback->data('item')
-
-Where item represents one of these four pieces of info: url, title,
-excerpt, or blog_name
-
-If the Trackback data is successfully received, you will issue a success
-message using::
-
- $this->trackback->send_success();
-
-.. note:: The above code contains no data validation, which you are
- encouraged to add.
-
-***************
-Class Reference
-***************
-
-.. php:class:: CI_Trackback
-
- .. attribute:: $data = array('url' => '', 'title' => '', 'excerpt' => '', 'blog_name' => '', 'charset' => '')
-
- Trackback data array.
-
- .. attribute:: $convert_ascii = TRUE
-
- Whether to convert high ASCII and MS Word characters to HTML entities.
-
- .. php:method:: send($tb_data)
-
- :param array $tb_data: Trackback data
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Send trackback.
-
- .. php:method:: receive()
-
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- This method simply validates the incoming TB data, returning TRUE on success and FALSE on failure.
- If the data is valid it is set to the ``$this->data`` array so that it can be inserted into a database.
-
- .. php:method:: send_error([$message = 'Incomplete information'])
-
- :param string $message: Error message
- :rtype: void
-
- Responses to a trackback request with an error message.
-
- .. note:: This method will terminate script execution.
-
- .. php:method:: send_success()
-
- :rtype: void
-
- Responses to a trackback request with a success message.
-
- .. note:: This method will terminate script execution.
-
- .. php:method:: data($item)
-
- :param string $item: Data key
- :returns: Data value or empty string if not found
- :rtype: string
-
- Returns a single item from the response data array.
-
- .. php:method:: process($url, $data)
-
- :param string $url: Target url
- :param string $data: Raw POST data
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Opens a socket connection and passes the data to the server, returning TRUE on success and FALSE on failure.
-
- .. php:method:: extract_urls($urls)
-
- :param string $urls: Comma-separated URL list
- :returns: Array of URLs
- :rtype: array
-
- This method lets multiple trackbacks to be sent. It takes a string of URLs (separated by comma or space) and puts each URL into an array.
-
- .. php:method:: validate_url(&$url)
-
- :param string $url: Trackback URL
- :rtype: void
-
- Simply adds the *http://* prefix it it's not already present in the URL.
-
- .. php:method:: get_id($url)
-
- :param string $url: Trackback URL
- :returns: URL ID or FALSE on failure
- :rtype: string
-
- Find and return a trackback URL's ID or FALSE on failure.
-
- .. php:method:: convert_xml($str)
-
- :param string $str: Input string
- :returns: Converted string
- :rtype: string
-
- Converts reserved XML characters to entities.
-
- .. php:method:: limit_characters($str[, $n = 500[, $end_char = '&#8230;']])
-
- :param string $str: Input string
- :param int $n: Max characters number
- :param string $end_char: Character to put at end of string
- :returns: Shortened string
- :rtype: string
-
- Limits the string based on the character count. Will preserve complete words.
-
- .. php:method:: convert_ascii($str)
-
- :param string $str: Input string
- :returns: Converted string
- :rtype: string
-
- Converts high ASCII text and MS Word special characterss to HTML entities.
-
- .. php:method:: set_error($msg)
-
- :param string $msg: Error message
- :rtype: void
-
- Set an log an error message.
-
- .. php:method:: display_errors([$open = '<p>'[, $close = '</p>']])
-
- :param string $open: Open tag
- :param string $close: Close tag
- :returns: HTML formatted error messages
- :rtype: string
-
- Returns error messages formatted in HTML or an empty string if there are no errors. \ No newline at end of file
diff --git a/user_guide_src/source/libraries/typography.rst b/user_guide_src/source/libraries/typography.rst
deleted file mode 100644
index 321b064ba..000000000
--- a/user_guide_src/source/libraries/typography.rst
+++ /dev/null
@@ -1,107 +0,0 @@
-################
-Typography Class
-################
-
-The Typography Class provides methods that help you format text.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-**************************
-Using the Typography Class
-**************************
-
-Initializing the Class
-======================
-
-Like most other classes in CodeIgniter, the Typography class is
-initialized in your controller using the ``$this->load->library()`` method::
-
- $this->load->library('typography');
-
-Once loaded, the Typography library object will be available using::
-
- $this->typography
-
-***************
-Class Reference
-***************
-
-.. php:class:: CI_Typography
-
- .. attribute:: $protect_braced_quotes = FALSE
-
- When using the Typography library in conjunction with the :doc:`Template Parser library <parser>`
- it can often be desirable to protect single and double quotes within curly braces.
- To enable this, set the ``protect_braced_quotes`` class property to TRUE.
-
- Usage example::
-
- $this->load->library('typography');
- $this->typography->protect_braced_quotes = TRUE;
-
- .. php:method:: auto_typography($str[, $reduce_linebreaks = FALSE])
-
- :param string $str: Input string
- :param bool $reduce_linebreaks: Whether to reduce consecutive linebreaks
- :returns: HTML typography-safe string
- :rtype: string
-
- Formats text so that it is semantically and typographically correct HTML.
- Takes a string as input and returns it with the following formatting:
-
- - Surrounds paragraphs within <p></p> (looks for double line breaks to identify paragraphs).
- - Single line breaks are converted to <br />, except those that appear within <pre> tags.
- - Block level elements, like <div> tags, are not wrapped within paragraphs, but their contained text is if it contains paragraphs.
- - Quotes are converted to correctly facing curly quote entities, except those that appear within tags.
- - Apostrophes are converted to curly apostrophe entities.
- - Double dashes (either like -- this or like--this) are converted to em—dashes.
- - Three consecutive periods either preceding or following a word are converted to ellipsis (…).
- - Double spaces following sentences are converted to non-breaking spaces to mimic double spacing.
-
- Usage example::
-
- $string = $this->typography->auto_typography($string);
-
- There is one optional parameter that determines whether the parser should reduce more than two consecutive line breaks down to two.
- Pass boolean TRUE to enable reducing line breaks::
-
- $string = $this->typography->auto_typography($string, TRUE);
-
- .. note:: Typographic formatting can be processor intensive, particularly if you have a lot of content being formatted.
- If you choose to use this method you may want to consider :doc:`caching <../general/caching>` your pages.
-
- .. php:method:: format_characters($str)
-
- :param string $str: Input string
- :returns: Formatted string
- :rtype: string
-
- This method is similar to ``auto_typography()`` above, except that it only does character conversion:
-
- - Quotes are converted to correctly facing curly quote entities, except those that appear within tags.
- - Apostrophes are converted to curly apostrophe entities.
- - Double dashes (either like -- this or like--this) are converted to em—dashes.
- - Three consecutive periods either preceding or following a word are converted to ellipsis (…).
- - Double spaces following sentences are converted to non-breaking spaces to mimic double spacing.
-
- Usage example::
-
- $string = $this->typography->format_characters($string);
-
- .. php:method:: nl2br_except_pre($str)
-
- :param string $str: Input string
- :returns: Formatted string
- :rtype: string
-
- Converts newlines to <br /> tags unless they appear within <pre> tags.
- This method is identical to the native PHP :php:func:`nl2br()` function, except that it ignores <pre> tags.
-
- Usage example::
-
- $string = $this->typography->nl2br_except_pre($string);
diff --git a/user_guide_src/source/libraries/unit_testing.rst b/user_guide_src/source/libraries/unit_testing.rst
deleted file mode 100644
index 57934cba3..000000000
--- a/user_guide_src/source/libraries/unit_testing.rst
+++ /dev/null
@@ -1,245 +0,0 @@
-##################
-Unit Testing Class
-##################
-
-Unit testing is an approach to software development in which tests are
-written for each function in your application. If you are not familiar
-with the concept you might do a little googling on the subject.
-
-CodeIgniter's Unit Test class is quite simple, consisting of an
-evaluation function and two result functions. It's not intended to be a
-full-blown test suite but rather a simple mechanism to evaluate your
-code to determine if it is producing the correct data type and result.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-******************************
-Using the Unit Testing Library
-******************************
-
-Initializing the Class
-======================
-
-Like most other classes in CodeIgniter, the Unit Test class is
-initialized in your controller using the $this->load->library function::
-
- $this->load->library('unit_test');
-
-Once loaded, the Unit Test object will be available using ``$this->unit``
-
-Running Tests
-=============
-
-Running a test involves supplying a test and an expected result in the
-following way:
-
- $this->unit->run('test', 'expected result', 'test name', 'notes');
-
-Where test is the result of the code you wish to test, expected result
-is the data type you expect, test name is an optional name you can give
-your test, and notes are optional notes. Example::
-
- $test = 1 + 1;
-
- $expected_result = 2;
-
- $test_name = 'Adds one plus one';
-
- $this->unit->run($test, $expected_result, $test_name);
-
-The expected result you supply can either be a literal match, or a data
-type match. Here's an example of a literal::
-
- $this->unit->run('Foo', 'Foo');
-
-Here is an example of a data type match::
-
- $this->unit->run('Foo', 'is_string');
-
-Notice the use of "is_string" in the second parameter? This tells the
-function to evaluate whether your test is producing a string as the
-result. Here is a list of allowed comparison types:
-
-- is_object
-- is_string
-- is_bool
-- is_true
-- is_false
-- is_int
-- is_numeric
-- is_float
-- is_double
-- is_array
-- is_null
-- is_resource
-
-Generating Reports
-==================
-
-You can either display results after each test, or your can run several
-tests and generate a report at the end. To show a report directly simply
-echo or return the run function::
-
- echo $this->unit->run($test, $expected_result);
-
-To run a full report of all tests, use this::
-
- echo $this->unit->report();
-
-The report will be formatted in an HTML table for viewing. If you prefer
-the raw data you can retrieve an array using::
-
- echo $this->unit->result();
-
-Strict Mode
-===========
-
-By default the unit test class evaluates literal matches loosely.
-Consider this example::
-
- $this->unit->run(1, TRUE);
-
-The test is evaluating an integer, but the expected result is a boolean.
-PHP, however, due to it's loose data-typing will evaluate the above code
-as TRUE using a normal equality test::
-
- if (1 == TRUE) echo 'This evaluates as true';
-
-If you prefer, you can put the unit test class in to strict mode, which
-will compare the data type as well as the value::
-
- if (1 === TRUE) echo 'This evaluates as FALSE';
-
-To enable strict mode use this::
-
- $this->unit->use_strict(TRUE);
-
-Enabling/Disabling Unit Testing
-===============================
-
-If you would like to leave some testing in place in your scripts, but
-not have it run unless you need it, you can disable unit testing using::
-
- $this->unit->active(FALSE);
-
-Unit Test Display
-=================
-
-When your unit test results display, the following items show by
-default:
-
-- Test Name (test_name)
-- Test Datatype (test_datatype)
-- Expected Datatype (res_datatype)
-- Result (result)
-- File Name (file)
-- Line Number (line)
-- Any notes you entered for the test (notes)
-
-You can customize which of these items get displayed by using
-$this->unit->set_test_items(). For example, if you only wanted the test name
-and the result displayed:
-
-Customizing displayed tests
----------------------------
-
-::
-
- $this->unit->set_test_items(array('test_name', 'result'));
-
-Creating a Template
--------------------
-
-If you would like your test results formatted differently then the
-default you can set your own template. Here is an example of a simple
-template. Note the required pseudo-variables::
-
- $str = '
- <table border="0" cellpadding="4" cellspacing="1">
- {rows}
- <tr>
- <td>{item}</td>
- <td>{result}</td>
- </tr>
- {/rows}
- </table>';
-
- $this->unit->set_template($str);
-
-.. note:: Your template must be declared **before** running the unit
- test process.
-
-***************
-Class Reference
-***************
-
-.. php:class:: CI_Unit_test
-
- .. php:method:: set_test_items($items)
-
- :param array $items: List of visible test items
- :returns: void
-
- Sets a list of items that should be visible in tests.
- Valid options are:
-
- - test_name
- - test_datatype
- - res_datatype
- - result
- - file
- - line
- - notes
-
- .. php:method:: run($test[, $expected = TRUE[, $test_name = 'undefined'[, $notes = '']]])
-
- :param mixed $test: Test data
- :param mixed $expected: Expected result
- :param string $test_name: Test name
- :param string $notes: Any notes to be attached to the test
- :returns: Test report
- :rtype: string
-
- Runs unit tests.
-
- .. php:method:: report([$result = array()])
-
- :param array $result: Array containing tests results
- :returns: Test report
- :rtype: string
-
- Generates a report about already complete tests.
-
- .. php:method:: use_strict([$state = TRUE])
-
- :param bool $state: Strict state flag
- :rtype: void
-
- Enables/disables strict type comparison in tests.
-
- .. php:method:: active([$state = TRUE])
-
- :param bool $state: Whether to enable testing
- :rtype: void
-
- Enables/disables unit testing.
-
- .. php:method:: result([$results = array()])
-
- :param array $results: Tests results list
- :returns: Array of raw result data
- :rtype: array
-
- Returns raw tests results data.
-
- .. php:method:: set_template($template)
-
- :param string $template: Test result template
- :rtype: void
-
- Sets the template for displaying tests results. \ No newline at end of file
diff --git a/user_guide_src/source/libraries/uri.rst b/user_guide_src/source/libraries/uri.rst
deleted file mode 100644
index 4d38c1d22..000000000
--- a/user_guide_src/source/libraries/uri.rst
+++ /dev/null
@@ -1,233 +0,0 @@
-#########
-URI Class
-#########
-
-The URI Class provides methods that help you retrieve information from
-your URI strings. If you use URI routing, you can also retrieve
-information about the re-routed segments.
-
-.. note:: This class is initialized automatically by the system so there
- is no need to do it manually.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-***************
-Class Reference
-***************
-
-.. php:class:: CI_URI
-
- .. php:method:: segment($n[, $no_result = NULL])
-
- :param int $n: Segment index number
- :param mixed $no_result: What to return if the searched segment is not found
- :returns: Segment value or $no_result value if not found
- :rtype: mixed
-
- Permits you to retrieve a specific segment. Where n is the segment
- number you wish to retrieve. Segments are numbered from left to right.
- For example, if your full URL is this::
-
- http://example.com/index.php/news/local/metro/crime_is_up
-
- The segment numbers would be this:
-
- #. news
- #. local
- #. metro
- #. crime_is_up
-
- The optional second parameter defaults to NULL and allows you to set the return value
- of this method when the requested URI segment is missing.
- For example, this would tell the method to return the number zero in the event of failure::
-
- $product_id = $this->uri->segment(3, 0);
-
- It helps avoid having to write code like this::
-
- if ($this->uri->segment(3) === FALSE)
- {
- $product_id = 0;
- }
- else
- {
- $product_id = $this->uri->segment(3);
- }
-
- .. php:method:: rsegment($n[, $no_result = NULL])
-
- :param int $n: Segment index number
- :param mixed $no_result: What to return if the searched segment is not found
- :returns: Routed segment value or $no_result value if not found
- :rtype: mixed
-
- This method is identical to ``segment()``, except that it lets you retrieve
- a specific segment from your re-routed URI in the event you are
- using CodeIgniter's :doc:`URI Routing <../general/routing>` feature.
-
- .. php:method:: slash_segment($n[, $where = 'trailing'])
-
- :param int $n: Segment index number
- :param string $where: Where to add the slash ('trailing' or 'leading')
- :returns: Segment value, prepended/suffixed with a forward slash, or a slash if not found
- :rtype: string
-
- This method is almost identical to ``segment()``, except it
- adds a trailing and/or leading slash based on the second parameter.
- If the parameter is not used, a trailing slash added. Examples::
-
- $this->uri->slash_segment(3);
- $this->uri->slash_segment(3, 'leading');
- $this->uri->slash_segment(3, 'both');
-
- Returns:
-
- #. segment/
- #. /segment
- #. /segment/
-
- .. php:method:: slash_rsegment($n[, $where = 'trailing'])
-
- :param int $n: Segment index number
- :param string $where: Where to add the slash ('trailing' or 'leading')
- :returns: Routed segment value, prepended/suffixed with a forward slash, or a slash if not found
- :rtype: string
-
- This method is identical to ``slash_segment()``, except that it lets you
- add slashes a specific segment from your re-routed URI in the event you
- are using CodeIgniter's :doc:`URI Routing <../general/routing>`
- feature.
-
- .. php:method:: uri_to_assoc([$n = 3[, $default = array()]])
-
- :param int $n: Segment index number
- :param array $default: Default values
- :returns: Associative URI segments array
- :rtype: array
-
- This method lets you turn URI segments into an associative array of
- key/value pairs. Consider this URI::
-
- index.php/user/search/name/joe/location/UK/gender/male
-
- Using this method you can turn the URI into an associative array with
- this prototype::
-
- [array]
- (
- 'name' => 'joe'
- 'location' => 'UK'
- 'gender' => 'male'
- )
-
- The first parameter lets you set an offset, which defaults to 3 since your
- URI will normally contain a controller/method pair in the first and second segments.
- Example::
-
- $array = $this->uri->uri_to_assoc(3);
- echo $array['name'];
-
- The second parameter lets you set default key names, so that the array
- returned will always contain expected indexes, even if missing from the URI.
- Example::
-
- $default = array('name', 'gender', 'location', 'type', 'sort');
- $array = $this->uri->uri_to_assoc(3, $default);
-
- If the URI does not contain a value in your default, an array index will
- be set to that name, with a value of NULL.
-
- Lastly, if a corresponding value is not found for a given key (if there
- is an odd number of URI segments) the value will be set to NULL.
-
- .. php:method:: ruri_to_assoc([$n = 3[, $default = array()]])
-
- :param int $n: Segment index number
- :param array $default: Default values
- :returns: Associative routed URI segments array
- :rtype: array
-
- This method is identical to ``uri_to_assoc()``, except that it creates
- an associative array using the re-routed URI in the event you are using
- CodeIgniter's :doc:`URI Routing <../general/routing>` feature.
-
- .. php:method:: assoc_to_uri($array)
-
- :param array $array: Input array of key/value pairs
- :returns: URI string
- :rtype: string
-
- Takes an associative array as input and generates a URI string from it.
- The array keys will be included in the string. Example::
-
- $array = array('product' => 'shoes', 'size' => 'large', 'color' => 'red');
- $str = $this->uri->assoc_to_uri($array);
-
- // Produces: product/shoes/size/large/color/red
-
- .. php:method:: uri_string()
-
- :returns: URI string
- :rtype: string
-
- Returns a string with the complete URI. For example, if this is your full URL::
-
- http://example.com/index.php/news/local/345
-
- The method would return this::
-
- news/local/345
-
- .. php:method:: ruri_string()
-
- :returns: Routed URI string
- :rtype: string
-
- This method is identical to ``uri_string()``, except that it returns
- the re-routed URI in the event you are using CodeIgniter's :doc:`URI
- Routing <../general/routing>` feature.
-
- .. php:method:: total_segments()
-
- :returns: Count of URI segments
- :rtype: int
-
- Returns the total number of segments.
-
- .. php:method:: total_rsegments()
-
- :returns: Count of routed URI segments
- :rtype: int
-
- This method is identical to ``total_segments()``, except that it returns
- the total number of segments in your re-routed URI in the event you are
- using CodeIgniter's :doc:`URI Routing <../general/routing>` feature.
-
- .. php:method:: segment_array()
-
- :returns: URI segments array
- :rtype: array
-
- Returns an array containing the URI segments. For example::
-
- $segs = $this->uri->segment_array();
-
- foreach ($segs as $segment)
- {
- echo $segment;
- echo '<br />';
- }
-
- .. php:method:: rsegment_array()
-
- :returns: Routed URI segments array
- :rtype: array
-
- This method is identical to ``segment_array()``, except that it returns
- the array of segments in your re-routed URI in the event you are using
- CodeIgniter's :doc:`URI Routing <../general/routing>` feature.
diff --git a/user_guide_src/source/libraries/user_agent.rst b/user_guide_src/source/libraries/user_agent.rst
deleted file mode 100644
index a1d969abf..000000000
--- a/user_guide_src/source/libraries/user_agent.rst
+++ /dev/null
@@ -1,248 +0,0 @@
-################
-User Agent Class
-################
-
-The User Agent Class provides functions that help identify information
-about the browser, mobile device, or robot visiting your site. In
-addition you can get referrer information as well as language and
-supported character-set information.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-**************************
-Using the User Agent Class
-**************************
-
-Initializing the Class
-======================
-
-Like most other classes in CodeIgniter, the User Agent class is
-initialized in your controller using the $this->load->library function::
-
- $this->load->library('user_agent');
-
-Once loaded, the object will be available using: ``$this->agent``
-
-User Agent Definitions
-======================
-
-The user agent name definitions are located in a config file located at:
-application/config/user_agents.php. You may add items to the various
-user agent arrays if needed.
-
-Example
-=======
-
-When the User Agent class is initialized it will attempt to determine
-whether the user agent browsing your site is a web browser, a mobile
-device, or a robot. It will also gather the platform information if it
-is available.
-
-::
-
- $this->load->library('user_agent');
-
- if ($this->agent->is_browser())
- {
- $agent = $this->agent->browser().' '.$this->agent->version();
- }
- elseif ($this->agent->is_robot())
- {
- $agent = $this->agent->robot();
- }
- elseif ($this->agent->is_mobile())
- {
- $agent = $this->agent->mobile();
- }
- else
- {
- $agent = 'Unidentified User Agent';
- }
-
- echo $agent;
-
- echo $this->agent->platform(); // Platform info (Windows, Linux, Mac, etc.)
-
-***************
-Class Reference
-***************
-
-.. php:class:: CI_User_agent
-
- .. php:method:: is_browser([$key = NULL])
-
- :param string $key: Optional browser name
- :returns: TRUE if the user agent is a (specified) browser, FALSE if not
- :rtype: bool
-
- Returns TRUE/FALSE (boolean) if the user agent is a known web browser.
- ::
-
- if ($this->agent->is_browser('Safari'))
- {
- echo 'You are using Safari.';
- }
- elseif ($this->agent->is_browser())
- {
- echo 'You are using a browser.';
- }
-
- .. note:: The string "Safari" in this example is an array key in the list of browser definitions.
- You can find this list in **application/config/user_agents.php** if you want to add new
- browsers or change the stings.
-
- .. php:method:: is_mobile([$key = NULL])
-
- :param string $key: Optional mobile device name
- :returns: TRUE if the user agent is a (specified) mobile device, FALSE if not
- :rtype: bool
-
- Returns TRUE/FALSE (boolean) if the user agent is a known mobile device.
- ::
-
- if ($this->agent->is_mobile('iphone'))
- {
- $this->load->view('iphone/home');
- }
- elseif ($this->agent->is_mobile())
- {
- $this->load->view('mobile/home');
- }
- else
- {
- $this->load->view('web/home');
- }
-
- .. php:method:: is_robot([$key = NULL])
-
- :param string $key: Optional robot name
- :returns: TRUE if the user agent is a (specified) robot, FALSE if not
- :rtype: bool
-
- Returns TRUE/FALSE (boolean) if the user agent is a known robot.
-
- .. note:: The user agent library only contains the most common robot definitions. It is not a complete list of bots.
- There are hundreds of them so searching for each one would not be very efficient. If you find that some bots
- that commonly visit your site are missing from the list you can add them to your
- **application/config/user_agents.php** file.
-
- .. php:method:: is_referral()
-
- :returns: TRUE if the user agent is a referral, FALSE if not
- :rtype: bool
-
- Returns TRUE/FALSE (boolean) if the user agent was referred from another site.
-
- .. php:method:: browser()
-
- :returns: Detected browser or an empty string
- :rtype: string
-
- Returns a string containing the name of the web browser viewing your site.
-
- .. php:method:: version()
-
- :returns: Detected browser version or an empty string
- :rtype: string
-
- Returns a string containing the version number of the web browser viewing your site.
-
- .. php:method:: mobile()
-
- :returns: Detected mobile device brand or an empty string
- :rtype: string
-
- Returns a string containing the name of the mobile device viewing your site.
-
- .. php:method:: robot()
-
- :returns: Detected robot name or an empty string
- :rtype: string
-
- Returns a string containing the name of the robot viewing your site.
-
- .. php:method:: platform()
-
- :returns: Detected operating system or an empty string
- :rtype: string
-
- Returns a string containing the platform viewing your site (Linux, Windows, OS X, etc.).
-
- .. php:method:: referrer()
-
- :returns: Detected referrer or an empty string
- :rtype: string
-
- The referrer, if the user agent was referred from another site. Typically you'll test for this as follows::
-
- if ($this->agent->is_referral())
- {
- echo $this->agent->referrer();
- }
-
- .. php:method:: agent_string()
-
- :returns: Full user agent string or an empty string
- :rtype: string
-
- Returns a string containing the full user agent string. Typically it will be something like this::
-
- Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.0.4) Gecko/20060613 Camino/1.0.2
-
- .. php:method:: accept_lang([$lang = 'en'])
-
- :param string $lang: Language key
- :returns: TRUE if provided language is accepted, FALSE if not
- :rtype: bool
-
- Lets you determine if the user agent accepts a particular language. Example::
-
- if ($this->agent->accept_lang('en'))
- {
- echo 'You accept English!';
- }
-
- .. note:: This method is not typically very reliable since some browsers do not provide language info,
- and even among those that do, it is not always accurate.
-
- .. php:method:: languages()
-
- :returns: An array list of accepted languages
- :rtype: array
-
- Returns an array of languages supported by the user agent.
-
- .. php:method:: accept_charset([$charset = 'utf-8'])
-
- :param string $charset: Character set
- :returns: TRUE if the character set is accepted, FALSE if not
- :rtype: bool
-
- Lets you determine if the user agent accepts a particular character set. Example::
-
- if ($this->agent->accept_charset('utf-8'))
- {
- echo 'You browser supports UTF-8!';
- }
-
- .. note:: This method is not typically very reliable since some browsers do not provide character-set info,
- and even among those that do, it is not always accurate.
-
- .. php:method:: charsets()
-
- :returns: An array list of accepted character sets
- :rtype: array
-
- Returns an array of character sets accepted by the user agent.
-
- .. php:method:: parse($string)
-
- :param string $string: A custom user-agent string
- :rtype: void
-
- Parses a custom user-agent string, different from the one reported by the current visitor. \ No newline at end of file
diff --git a/user_guide_src/source/libraries/xmlrpc.rst b/user_guide_src/source/libraries/xmlrpc.rst
deleted file mode 100644
index 2fe07c49d..000000000
--- a/user_guide_src/source/libraries/xmlrpc.rst
+++ /dev/null
@@ -1,582 +0,0 @@
-##################################
-XML-RPC and XML-RPC Server Classes
-##################################
-
-CodeIgniter's XML-RPC classes permit you to send requests to another
-server, or set up your own XML-RPC server to receive requests.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-****************
-What is XML-RPC?
-****************
-
-Quite simply it is a way for two computers to communicate over the
-internet using XML. One computer, which we will call the client, sends
-an XML-RPC **request** to another computer, which we will call the
-server. Once the server receives and processes the request it will send
-back a **response** to the client.
-
-For example, using the MetaWeblog API, an XML-RPC Client (usually a
-desktop publishing tool) will send a request to an XML-RPC Server
-running on your site. This request might be a new weblog entry being
-sent for publication, or it could be a request for an existing entry for
-editing. When the XML-RPC Server receives this request it will examine
-it to determine which class/method should be called to process the
-request. Once processed, the server will then send back a response
-message.
-
-For detailed specifications, you can visit the `XML-RPC <http://www.xmlrpc.com/>`_ site.
-
-***********************
-Using the XML-RPC Class
-***********************
-
-Initializing the Class
-======================
-
-Like most other classes in CodeIgniter, the XML-RPC and XML-RPCS classes
-are initialized in your controller using the $this->load->library
-function:
-
-To load the XML-RPC class you will use::
-
- $this->load->library('xmlrpc');
-
-Once loaded, the xml-rpc library object will be available using:
-$this->xmlrpc
-
-To load the XML-RPC Server class you will use::
-
- $this->load->library('xmlrpc');
- $this->load->library('xmlrpcs');
-
-Once loaded, the xml-rpcs library object will be available using:
-$this->xmlrpcs
-
-.. note:: When using the XML-RPC Server class you must load BOTH the
- XML-RPC class and the XML-RPC Server class.
-
-Sending XML-RPC Requests
-========================
-
-To send a request to an XML-RPC server you must specify the following
-information:
-
-- The URL of the server
-- The method on the server you wish to call
-- The *request* data (explained below).
-
-Here is a basic example that sends a simple Weblogs.com ping to the
-`Ping-o-Matic <http://pingomatic.com/>`_
-
-::
-
- $this->load->library('xmlrpc');
-
- $this->xmlrpc->server('http://rpc.pingomatic.com/', 80);
- $this->xmlrpc->method('weblogUpdates.ping');
-
- $request = array('My Photoblog', 'http://www.my-site.com/photoblog/');
- $this->xmlrpc->request($request);
-
- if ( ! $this->xmlrpc->send_request())
- {
- echo $this->xmlrpc->display_error();
- }
-
-Explanation
------------
-
-The above code initializes the XML-RPC class, sets the server URL and
-method to be called (weblogUpdates.ping). The request (in this case, the
-title and URL of your site) is placed into an array for transportation,
-and compiled using the request() function. Lastly, the full request is
-sent. If the send_request() method returns false we will display the
-error message sent back from the XML-RPC Server.
-
-Anatomy of a Request
-====================
-
-An XML-RPC request is simply the data you are sending to the XML-RPC
-server. Each piece of data in a request is referred to as a request
-parameter. The above example has two parameters: The URL and title of
-your site. When the XML-RPC server receives your request, it will look
-for parameters it requires.
-
-Request parameters must be placed into an array for transportation, and
-each parameter can be one of seven data types (strings, numbers, dates,
-etc.). If your parameters are something other than strings you will have
-to include the data type in the request array.
-
-Here is an example of a simple array with three parameters::
-
- $request = array('John', 'Doe', 'www.some-site.com');
- $this->xmlrpc->request($request);
-
-If you use data types other than strings, or if you have several
-different data types, you will place each parameter into its own array,
-with the data type in the second position::
-
- $request = array(
- array('John', 'string'),
- array('Doe', 'string'),
- array(FALSE, 'boolean'),
- array(12345, 'int')
- );
- $this->xmlrpc->request($request);
-
-The `Data Types <#datatypes>`_ section below has a full list of data
-types.
-
-Creating an XML-RPC Server
-==========================
-
-An XML-RPC Server acts as a traffic cop of sorts, waiting for incoming
-requests and redirecting them to the appropriate functions for
-processing.
-
-To create your own XML-RPC server involves initializing the XML-RPC
-Server class in your controller where you expect the incoming request to
-appear, then setting up an array with mapping instructions so that
-incoming requests can be sent to the appropriate class and method for
-processing.
-
-Here is an example to illustrate::
-
- $this->load->library('xmlrpc');
- $this->load->library('xmlrpcs');
-
- $config['functions']['new_post'] = array('function' => 'My_blog.new_entry');
- $config['functions']['update_post'] = array('function' => 'My_blog.update_entry');
- $config['object'] = $this;
-
- $this->xmlrpcs->initialize($config);
- $this->xmlrpcs->serve();
-
-The above example contains an array specifying two method requests that
-the Server allows. The allowed methods are on the left side of the
-array. When either of those are received, they will be mapped to the
-class and method on the right.
-
-The 'object' key is a special key that you pass an instantiated class
-object with, which is necessary when the method you are mapping to is
-not part of the CodeIgniter super object.
-
-In other words, if an XML-RPC Client sends a request for the new_post
-method, your server will load the My_blog class and call the new_entry
-function. If the request is for the update_post method, your server
-will load the My_blog class and call the ``update_entry()`` method.
-
-The function names in the above example are arbitrary. You'll decide
-what they should be called on your server, or if you are using
-standardized APIs, like the Blogger or MetaWeblog API, you'll use their
-function names.
-
-There are two additional configuration keys you may make use of when
-initializing the server class: debug can be set to TRUE in order to
-enable debugging, and xss_clean may be set to FALSE to prevent sending
-data through the Security library's ``xss_clean()`` method.
-
-Processing Server Requests
-==========================
-
-When the XML-RPC Server receives a request and loads the class/method
-for processing, it will pass an object to that method containing the
-data sent by the client.
-
-Using the above example, if the new_post method is requested, the
-server will expect a class to exist with this prototype::
-
- class My_blog extends CI_Controller {
-
- public function new_post($request)
- {
-
- }
- }
-
-The $request variable is an object compiled by the Server, which
-contains the data sent by the XML-RPC Client. Using this object you will
-have access to the *request parameters* enabling you to process the
-request. When you are done you will send a Response back to the Client.
-
-Below is a real-world example, using the Blogger API. One of the methods
-in the Blogger API is ``getUserInfo()``. Using this method, an XML-RPC
-Client can send the Server a username and password, in return the Server
-sends back information about that particular user (nickname, user ID,
-email address, etc.). Here is how the processing function might look::
-
- class My_blog extends CI_Controller {
-
- public function getUserInfo($request)
- {
- $username = 'smitty';
- $password = 'secretsmittypass';
-
- $this->load->library('xmlrpc');
-
- $parameters = $request->output_parameters();
-
- if ($parameters[1] != $username && $parameters[2] != $password)
- {
- return $this->xmlrpc->send_error_message('100', 'Invalid Access');
- }
-
- $response = array(
- array(
- 'nickname' => array('Smitty', 'string'),
- 'userid' => array('99', 'string'),
- 'url' => array('http://yoursite.com', 'string'),
- 'email' => array('jsmith@yoursite.com', 'string'),
- 'lastname' => array('Smith', 'string'),
- 'firstname' => array('John', 'string')
- ),
- 'struct'
- );
-
- return $this->xmlrpc->send_response($response);
- }
- }
-
-Notes:
-------
-
-The ``output_parameters()`` method retrieves an indexed array
-corresponding to the request parameters sent by the client. In the above
-example, the output parameters will be the username and password.
-
-If the username and password sent by the client were not valid, and
-error message is returned using ``send_error_message()``.
-
-If the operation was successful, the client will be sent back a response
-array containing the user's info.
-
-Formatting a Response
-=====================
-
-Similar to *Requests*, *Responses* must be formatted as an array.
-However, unlike requests, a response is an array **that contains a
-single item**. This item can be an array with several additional arrays,
-but there can be only one primary array index. In other words, the basic
-prototype is this::
-
- $response = array('Response data', 'array');
-
-Responses, however, usually contain multiple pieces of information. In
-order to accomplish this we must put the response into its own array so
-that the primary array continues to contain a single piece of data.
-Here's an example showing how this might be accomplished::
-
- $response = array(
- array(
- 'first_name' => array('John', 'string'),
- 'last_name' => array('Doe', 'string'),
- 'member_id' => array(123435, 'int'),
- 'todo_list' => array(array('clean house', 'call mom', 'water plants'), 'array'),
- ),
- 'struct'
- );
-
-Notice that the above array is formatted as a struct. This is the most
-common data type for responses.
-
-As with Requests, a response can be one of the seven data types listed
-in the `Data Types <#datatypes>`_ section.
-
-Sending an Error Response
-=========================
-
-If you need to send the client an error response you will use the
-following::
-
- return $this->xmlrpc->send_error_message('123', 'Requested data not available');
-
-The first parameter is the error number while the second parameter is
-the error message.
-
-Creating Your Own Client and Server
-===================================
-
-To help you understand everything we've covered thus far, let's create a
-couple controllers that act as XML-RPC Client and Server. You'll use the
-Client to send a request to the Server and receive a response.
-
-The Client
-----------
-
-Using a text editor, create a controller called Xmlrpc_client.php. In
-it, place this code and save it to your application/controllers/
-folder::
-
- <?php
-
- class Xmlrpc_client extends CI_Controller {
-
- public function index()
- {
- $this->load->helper('url');
- $server_url = site_url('xmlrpc_server');
-
- $this->load->library('xmlrpc');
-
- $this->xmlrpc->server($server_url, 80);
- $this->xmlrpc->method('Greetings');
-
- $request = array('How is it going?');
- $this->xmlrpc->request($request);
-
- if ( ! $this->xmlrpc->send_request())
- {
- echo $this->xmlrpc->display_error();
- }
- else
- {
- echo '<pre>';
- print_r($this->xmlrpc->display_response());
- echo '</pre>';
- }
- }
- }
- ?>
-
-.. note:: In the above code we are using a "url helper". You can find more
- information in the :doc:`Helpers Functions <../general/helpers>` page.
-
-The Server
-----------
-
-Using a text editor, create a controller called Xmlrpc_server.php. In
-it, place this code and save it to your application/controllers/
-folder::
-
- <?php
-
- class Xmlrpc_server extends CI_Controller {
-
- public function index()
- {
- $this->load->library('xmlrpc');
- $this->load->library('xmlrpcs');
-
- $config['functions']['Greetings'] = array('function' => 'Xmlrpc_server.process');
-
- $this->xmlrpcs->initialize($config);
- $this->xmlrpcs->serve();
- }
-
-
- public function process($request)
- {
- $parameters = $request->output_parameters();
-
- $response = array(
- array(
- 'you_said' => $parameters[0],
- 'i_respond' => 'Not bad at all.'
- ),
- 'struct'
- );
-
- return $this->xmlrpc->send_response($response);
- }
- }
-
-
-Try it!
--------
-
-Now visit the your site using a URL similar to this::
-
- example.com/index.php/xmlrpc_client/
-
-You should now see the message you sent to the server, and its response
-back to you.
-
-The client you created sends a message ("How's is going?") to the
-server, along with a request for the "Greetings" method. The Server
-receives the request and maps it to the ``process()`` method, where a
-response is sent back.
-
-Using Associative Arrays In a Request Parameter
-===============================================
-
-If you wish to use an associative array in your method parameters you
-will need to use a struct datatype::
-
- $request = array(
- array(
- // Param 0
- array('name' => 'John'),
- 'struct'
- ),
- array(
- // Param 1
- array(
- 'size' => 'large',
- 'shape'=>'round'
- ),
- 'struct'
- )
- );
-
- $this->xmlrpc->request($request);
-
-You can retrieve the associative array when processing the request in
-the Server.
-
-::
-
- $parameters = $request->output_parameters();
- $name = $parameters[0]['name'];
- $size = $parameters[1]['size'];
- $shape = $parameters[1]['shape'];
-
-Data Types
-==========
-
-According to the `XML-RPC spec <http://www.xmlrpc.com/spec>`_ there are
-seven types of values that you can send via XML-RPC:
-
-- *int* or *i4*
-- *boolean*
-- *string*
-- *double*
-- *dateTime.iso8601*
-- *base64*
-- *struct* (contains array of values)
-- *array* (contains array of values)
-
-***************
-Class Reference
-***************
-
-.. php:class:: CI_Xmlrpc
-
- .. php:method:: initialize([$config = array()])
-
- :param array $config: Configuration data
- :rtype: void
-
- Initializes the XML-RPC library. Accepts an associative array containing your settings.
-
- .. php:method:: server($url[, $port = 80[, $proxy = FALSE[, $proxy_port = 8080]]])
-
- :param string $url: XML-RPC server URL
- :param int $port: Server port
- :param string $proxy: Optional proxy
- :param int $proxy_port: Proxy listening port
- :rtype: void
-
- Sets the URL and port number of the server to which a request is to be sent::
-
- $this->xmlrpc->server('http://www.sometimes.com/pings.php', 80);
-
- Basic HTTP authentication is also supported, simply add it to the server URL::
-
- $this->xmlrpc->server('http://user:pass@localhost/', 80);
-
- .. php:method:: timeout($seconds = 5)
-
- :param int $seconds: Timeout in seconds
- :rtype: void
-
- Set a time out period (in seconds) after which the request will be canceled::
-
- $this->xmlrpc->timeout(6);
-
- This timeout period will be used both for an initial connection to
- the remote server, as well as for getting a response from it.
- Make sure you set the timeout before calling ``send_request()``.
-
- .. php:method:: method($function)
-
- :param string $function: Method name
- :rtype: void
-
- Sets the method that will be requested from the XML-RPC server::
-
- $this->xmlrpc->method('method');
-
- Where method is the name of the method.
-
- .. php:method:: request($incoming)
-
- :param array $incoming: Request data
- :rtype: void
-
- Takes an array of data and builds request to be sent to XML-RPC server::
-
- $request = array(array('My Photoblog', 'string'), 'http://www.yoursite.com/photoblog/');
- $this->xmlrpc->request($request);
-
- .. php:method:: send_request()
-
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- The request sending method. Returns boolean TRUE or FALSE based on success for failure, enabling it to be used conditionally.
-
- .. method set_debug($flag = TRUE)
-
- :param bool $flag: Debug status flag
- :rtype: void
-
- Enables or disables debugging, which will display a variety of information and error data helpful during development.
-
- .. php:method:: display_error()
-
- :returns: Error message string
- :rtype: string
-
- Returns an error message as a string if your request failed for some reason.
- ::
-
- echo $this->xmlrpc->display_error();
-
- .. php:method:: display_response()
-
- :returns: Response
- :rtype: mixed
-
- Returns the response from the remote server once request is received. The response will typically be an associative array.
- ::
-
- $this->xmlrpc->display_response();
-
- .. php:method:: send_error_message($number, $message)
-
- :param int $number: Error number
- :param string $message: Error message
- :returns: XML_RPC_Response instance
- :rtype: XML_RPC_Response
-
- This method lets you send an error message from your server to the client.
- First parameter is the error number while the second parameter is the error message.
- ::
-
- return $this->xmlrpc->send_error_message(123, 'Requested data not available');
-
- .. method send_response($response)
-
- :param array $response: Response data
- :returns: XML_RPC_Response instance
- :rtype: XML_RPC_Response
-
- Lets you send the response from your server to the client. An array of valid data values must be sent with this method.
- ::
-
- $response = array(
- array(
- 'flerror' => array(FALSE, 'boolean'),
- 'message' => "Thanks for the ping!"
- ),
- 'struct'
- );
-
- return $this->xmlrpc->send_response($response);
diff --git a/user_guide_src/source/libraries/zip.rst b/user_guide_src/source/libraries/zip.rst
deleted file mode 100644
index 9704d5b1d..000000000
--- a/user_guide_src/source/libraries/zip.rst
+++ /dev/null
@@ -1,243 +0,0 @@
-##################
-Zip Encoding Class
-##################
-
-CodeIgniter's Zip Encoding Class permits you to create Zip archives.
-Archives can be downloaded to your desktop or saved to a directory.
-
-.. contents::
- :local:
-
-.. raw:: html
-
- <div class="custom-index container"></div>
-
-****************************
-Using the Zip Encoding Class
-****************************
-
-Initializing the Class
-======================
-
-Like most other classes in CodeIgniter, the Zip class is initialized in
-your controller using the $this->load->library function::
-
- $this->load->library('zip');
-
-Once loaded, the Zip library object will be available using::
-
- $this->zip
-
-Usage Example
-=============
-
-This example demonstrates how to compress a file, save it to a folder on
-your server, and download it to your desktop.
-
-::
-
- $name = 'mydata1.txt';
- $data = 'A Data String!';
-
- $this->zip->add_data($name, $data);
-
- // Write the zip file to a folder on your server. Name it "my_backup.zip"
- $this->zip->archive('/path/to/directory/my_backup.zip');
-
- // Download the file to your desktop. Name it "my_backup.zip"
- $this->zip->download('my_backup.zip');
-
-***************
-Class Reference
-***************
-
-.. php:class:: CI_Zip
-
- .. attribute:: $compression_level = 2
-
- The compression level to use.
-
- It can range from 0 to 9, with 9 being the highest and 0 effectively disabling compression::
-
- $this->zip->compression_level = 0;
-
- .. php:method:: add_data($filepath[, $data = NULL])
-
- :param mixed $filepath: A single file path or an array of file => data pairs
- :param array $data: File contents (ignored if $filepath is an array)
- :rtype: void
-
- Adds data to the Zip archive. Can work both in single and multiple files mode.
-
- When adding a single file, the first parameter must contain the name you would
- like given to the file and the second must contain the file contents::
-
- $name = 'mydata1.txt';
- $data = 'A Data String!';
- $this->zip->add_data($name, $data);
-
- $name = 'mydata2.txt';
- $data = 'Another Data String!';
- $this->zip->add_data($name, $data);
-
- When adding multiple files, the first parameter must contain *file => contents* pairs
- and the second parameter is ignored::
-
- $data = array(
- 'mydata1.txt' => 'A Data String!',
- 'mydata2.txt' => 'Another Data String!'
- );
-
- $this->zip->add_data($data);
-
- If you would like your compressed data organized into sub-directories, simply include
- the path as part of the filename(s)::
-
- $name = 'personal/my_bio.txt';
- $data = 'I was born in an elevator...';
-
- $this->zip->add_data($name, $data);
-
- The above example will place my_bio.txt inside a folder called personal.
-
- .. php:method:: add_dir($directory)
-
- :param mixed $directory: Directory name string or an array of multiple directories
- :rtype: void
-
- Permits you to add a directory. Usually this method is unnecessary since you can place
- your data into directories when using ``$this->zip->add_data()``, but if you would like
- to create an empty directory you can do so::
-
- $this->zip->add_dir('myfolder'); // Creates a directory called "myfolder"
-
- .. php:method:: read_file($path[, $archive_filepath = FALSE])
-
- :param string $path: Path to file
- :param mixed $archive_filepath: New file name/path (string) or (boolean) whether to maintain the original filepath
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Permits you to compress a file that already exists somewhere on your server.
- Supply a file path and the zip class will read it and add it to the archive::
-
- $path = '/path/to/photo.jpg';
-
- $this->zip->read_file($path);
-
- // Download the file to your desktop. Name it "my_backup.zip"
- $this->zip->download('my_backup.zip');
-
- If you would like the Zip archive to maintain the directory structure of
- the file in it, pass TRUE (boolean) in the second parameter. Example::
-
- $path = '/path/to/photo.jpg';
-
- $this->zip->read_file($path, TRUE);
-
- // Download the file to your desktop. Name it "my_backup.zip"
- $this->zip->download('my_backup.zip');
-
- In the above example, photo.jpg will be placed into the *path/to/* directory.
-
- You can also specify a new name (path included) for the added file on the fly::
-
- $path = '/path/to/photo.jpg';
- $new_path = '/new/path/some_photo.jpg';
-
- $this->zip->read_file($path, $new_path);
-
- // Download ZIP archive containing /new/path/some_photo.jpg
- $this->zip->download('my_archive.zip');
-
- .. php:method:: read_dir($path[, $preserve_filepath = TRUE[, $root_path = NULL]])
-
- :param string $path: Path to directory
- :param bool $preserve_filepath: Whether to maintain the original path
- :param string $root_path: Part of the path to exclude from the archive directory
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Permits you to compress a directory (and its contents) that already exists somewhere on your server.
- Supply a path to the directory and the zip class will recursively read and recreate it as a Zip archive.
- All files contained within the supplied path will be encoded, as will any sub-directories contained within it. Example::
-
- $path = '/path/to/your/directory/';
-
- $this->zip->read_dir($path);
-
- // Download the file to your desktop. Name it "my_backup.zip"
- $this->zip->download('my_backup.zip');
-
- By default the Zip archive will place all directories listed in the first parameter
- inside the zip. If you want the tree preceding the target directory to be ignored,
- you can pass FALSE (boolean) in the second parameter. Example::
-
- $path = '/path/to/your/directory/';
-
- $this->zip->read_dir($path, FALSE);
-
- This will create a ZIP with a directory named "directory" inside, then all sub-directories
- stored correctly inside that, but will not include the */path/to/your* part of the path.
-
- .. php:method:: archive($filepath)
-
- :param string $filepath: Path to target zip archive
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Writes the Zip-encoded file to a directory on your server. Submit a valid server path
- ending in the file name. Make sure the directory is writable (755 is usually OK).
- Example::
-
- $this->zip->archive('/path/to/folder/myarchive.zip'); // Creates a file named myarchive.zip
-
- .. php:method:: download($filename = 'backup.zip')
-
- :param string $filename: Archive file name
- :rtype: void
-
- Causes the Zip file to be downloaded from your server.
- You must pass the name you would like the zip file called. Example::
-
- $this->zip->download('latest_stuff.zip'); // File will be named "latest_stuff.zip"
-
- .. note:: Do not display any data in the controller in which you call
- this method since it sends various server headers that cause the
- download to happen and the file to be treated as binary.
-
- .. php:method:: get_zip()
-
- :returns: Zip file content
- :rtype: string
-
- Returns the Zip-compressed file data. Generally you will not need this method unless you
- want to do something unique with the data. Example::
-
- $name = 'my_bio.txt';
- $data = 'I was born in an elevator...';
-
- $this->zip->add_data($name, $data);
-
- $zip_file = $this->zip->get_zip();
-
- .. php:method:: clear_data()
-
- :rtype: void
-
- The Zip class caches your zip data so that it doesn't need to recompile the Zip archive
- for each method you use above. If, however, you need to create multiple Zip archives,
- each with different data, you can clear the cache between calls. Example::
-
- $name = 'my_bio.txt';
- $data = 'I was born in an elevator...';
-
- $this->zip->add_data($name, $data);
- $zip_file = $this->zip->get_zip();
-
- $this->zip->clear_data();
-
- $name = 'photo.jpg';
- $this->zip->read_file("/path/to/photo.jpg"); // Read the file's contents
-
- $this->zip->download('myphotos.zip');
diff --git a/user_guide_src/source/license.rst b/user_guide_src/source/license.rst
deleted file mode 100644
index 9894cf2b1..000000000
--- a/user_guide_src/source/license.rst
+++ /dev/null
@@ -1,23 +0,0 @@
-#####################
-The MIT License (MIT)
-#####################
-
-Copyright (c) 2019 - 2022, CodeIgniter Foundation
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/user_guide_src/source/overview/appflow.rst b/user_guide_src/source/overview/appflow.rst
deleted file mode 100644
index bb15130d2..000000000
--- a/user_guide_src/source/overview/appflow.rst
+++ /dev/null
@@ -1,23 +0,0 @@
-######################
-Application Flow Chart
-######################
-
-The following graphic illustrates how data flows throughout the system:
-
-|CodeIgniter application flow|
-
-#. The index.php serves as the front controller, initializing the base
- resources needed to run CodeIgniter.
-#. The Router examines the HTTP request to determine what should be done
- with it.
-#. If a cache file exists, it is sent directly to the browser, bypassing
- the normal system execution.
-#. Security. Before the application controller is loaded, the HTTP
- request and any user submitted data is filtered for security.
-#. The Controller loads the model, core libraries, helpers, and any
- other resources needed to process the specific request.
-#. The finalized View is rendered then sent to the web browser to be
- seen. If caching is enabled, the view is cached first so that on
- subsequent requests it can be served.
-
-.. |CodeIgniter application flow| image:: ../images/appflowchart.gif
diff --git a/user_guide_src/source/overview/at_a_glance.rst b/user_guide_src/source/overview/at_a_glance.rst
deleted file mode 100644
index 742d7bd0e..000000000
--- a/user_guide_src/source/overview/at_a_glance.rst
+++ /dev/null
@@ -1,114 +0,0 @@
-#######################
-CodeIgniter at a Glance
-#######################
-
-CodeIgniter is an Application Framework
-=======================================
-
-CodeIgniter is a toolkit for people who build web applications using
-PHP. Its goal is to enable you to develop projects much faster than you
-could if you were writing code from scratch, by providing a rich set of
-libraries for commonly needed tasks, as well as a simple interface and
-logical structure to access these libraries. CodeIgniter lets you
-creatively focus on your project by minimizing the amount of code needed
-for a given task.
-
-CodeIgniter is Free
-===================
-
-CodeIgniter is licensed under the MIT license so you can use it however
-you please. For more information please read the
-:doc:`license agreement <../license>`.
-
-CodeIgniter is Light Weight
-===========================
-
-Truly light weight. The core system requires only a few very small
-libraries. This is in stark contrast to many frameworks that require
-significantly more resources. Additional libraries are loaded
-dynamically upon request, based on your needs for a given process, so
-the base system is very lean and quite fast.
-
-CodeIgniter is Fast
-===================
-
-Really fast. We challenge you to find a framework that has better
-performance than CodeIgniter.
-
-CodeIgniter Uses M-V-C
-======================
-
-CodeIgniter uses the Model-View-Controller approach, which allows great
-separation between logic and presentation. This is particularly good for
-projects in which designers are working with your template files, as the
-code these files contain will be minimized. We describe MVC in more
-detail on its own page.
-
-CodeIgniter Generates Clean URLs
-================================
-
-The URLs generated by CodeIgniter are clean and search-engine friendly.
-Rather than using the standard "query string" approach to URLs that is
-synonymous with dynamic systems, CodeIgniter uses a segment-based
-approach::
-
- example.com/news/article/345
-
-.. note:: By default the *index.php* file is included in the URL but it can
- be removed using a simple *.htaccess* file.
-
-CodeIgniter Packs a Punch
-=========================
-
-CodeIgniter comes with full-range of libraries that enable the most
-commonly needed web development tasks, like accessing a database,
-sending email, validating form data, maintaining sessions, manipulating
-images, working with XML-RPC data and much more.
-
-CodeIgniter is Extensible
-=========================
-
-The system can be easily extended through the use of your own libraries,
-helpers, or through class extensions or system hooks.
-
-CodeIgniter Does Not Require a Template Engine
-==============================================
-
-Although CodeIgniter *does* come with a simple template parser that can
-be optionally used, it does not force you to use one. Template engines
-simply can not match the performance of native PHP, and the syntax that
-must be learned to use a template engine is usually only marginally
-easier than learning the basics of PHP. Consider this block of PHP code::
-
- <ul>
- <?php foreach ($addressbook as $name):?>
- <li><?=$name?></li>
- <?php endforeach; ?>
- </ul>
-
-Contrast this with the pseudo-code used by a template engine::
-
- <ul>
- {foreach from=$addressbook item="name"}
- <li>{$name}</li>
- {/foreach}
- </ul>
-
-Yes, the template engine example is a bit cleaner, but it comes at the
-price of performance, as the pseudo-code must be converted back into PHP
-to run. Since one of our goals is *maximum performance*, we opted to not
-require the use of a template engine.
-
-CodeIgniter is Thoroughly Documented
-====================================
-
-Programmers love to code and hate to write documentation. We're no
-different, of course, but since documentation is **as important** as the
-code itself, we are committed to doing it. Our source code is extremely
-clean and well commented as well.
-
-CodeIgniter has a Friendly Community of Users
-=============================================
-
-Our growing community of users can be seen actively participating in our
-`Community Forums <http://forum.codeigniter.com/>`_.
diff --git a/user_guide_src/source/overview/features.rst b/user_guide_src/source/overview/features.rst
deleted file mode 100644
index f62546b61..000000000
--- a/user_guide_src/source/overview/features.rst
+++ /dev/null
@@ -1,46 +0,0 @@
-####################
-CodeIgniter Features
-####################
-
-Features in and of themselves are a very poor way to judge an
-application since they tell you nothing about the user experience, or
-how intuitively or intelligently it is designed. Features don't reveal
-anything about the quality of the code, or the performance, or the
-attention to detail, or security practices. The only way to really judge
-an app is to try it and get to know the code.
-:doc:`Installing <../installation/index>` CodeIgniter is child's play so
-we encourage you to do just that. In the mean time here's a list of
-CodeIgniter's main features.
-
-- Model-View-Controller Based System
-- Extremely Light Weight
-- Full Featured database classes with support for several platforms.
-- Query Builder Database Support
-- Form and Data Validation
-- Security and XSS Filtering
-- Session Management
-- Email Sending Class. Supports Attachments, HTML/Text email, multiple
- protocols (sendmail, SMTP, and Mail) and more.
-- Image Manipulation Library (cropping, resizing, rotating, etc.).
- Supports GD, ImageMagick, and NetPBM
-- File Uploading Class
-- FTP Class
-- Localization
-- Pagination
-- Data Encryption
-- Benchmarking
-- Full Page Caching
-- Error Logging
-- Application Profiling
-- Calendaring Class
-- User Agent Class
-- Zip Encoding Class
-- Template Engine Class
-- Trackback Class
-- XML-RPC Library
-- Unit Testing Class
-- Search-engine Friendly URLs
-- Flexible URI Routing
-- Support for Hooks and Class Extensions
-- Large library of "helper" functions
-
diff --git a/user_guide_src/source/overview/getting_started.rst b/user_guide_src/source/overview/getting_started.rst
deleted file mode 100644
index 04ee50df7..000000000
--- a/user_guide_src/source/overview/getting_started.rst
+++ /dev/null
@@ -1,24 +0,0 @@
-################################
-Getting Started With CodeIgniter
-################################
-
-Any software application requires some effort to learn. We've done our
-best to minimize the learning curve while making the process as
-enjoyable as possible.
-
-The first step is to :doc:`install <../installation/index>`
-CodeIgniter, then read all the topics in the **Introduction** section of
-the Table of Contents.
-
-Next, read each of the **General Topics** pages in order. Each topic
-builds on the previous one, and includes code examples that you are
-encouraged to try.
-
-Once you understand the basics you'll be ready to explore the **Class
-Reference** and **Helper Reference** pages to learn to utilize the
-native libraries and helper files.
-
-Feel free to take advantage of our `Community
-Forums <http://forum.codeigniter.com/>`_ if you have questions or
-problems, and our `Wiki <https://github.com/bcit-ci/CodeIgniter/wiki>`_ to see code
-examples posted by other users.
diff --git a/user_guide_src/source/overview/goals.rst b/user_guide_src/source/overview/goals.rst
deleted file mode 100644
index ac581807f..000000000
--- a/user_guide_src/source/overview/goals.rst
+++ /dev/null
@@ -1,32 +0,0 @@
-##############################
-Design and Architectural Goals
-##############################
-
-Our goal for CodeIgniter is maximum performance, capability, and
-flexibility in the smallest, lightest possible package.
-
-To meet this goal we are committed to benchmarking, re-factoring, and
-simplifying at every step of the development process, rejecting anything
-that doesn't further the stated objective.
-
-From a technical and architectural standpoint, CodeIgniter was created
-with the following objectives:
-
-- **Dynamic Instantiation.** In CodeIgniter, components are loaded and
- routines executed only when requested, rather than globally. No
- assumptions are made by the system regarding what may be needed
- beyond the minimal core resources, so the system is very light-weight
- by default. The events, as triggered by the HTTP request, and the
- controllers and views you design will determine what is invoked.
-- **Loose Coupling.** Coupling is the degree to which components of a
- system rely on each other. The less components depend on each other
- the more reusable and flexible the system becomes. Our goal was a
- very loosely coupled system.
-- **Component Singularity.** Singularity is the degree to which
- components have a narrowly focused purpose. In CodeIgniter, each
- class and its functions are highly autonomous in order to allow
- maximum usefulness.
-
-CodeIgniter is a dynamically instantiated, loosely coupled system with
-high component singularity. It strives for simplicity, flexibility, and
-high performance in a small footprint package.
diff --git a/user_guide_src/source/overview/index.rst b/user_guide_src/source/overview/index.rst
deleted file mode 100644
index d48a0bbe4..000000000
--- a/user_guide_src/source/overview/index.rst
+++ /dev/null
@@ -1,15 +0,0 @@
-####################
-CodeIgniter Overview
-####################
-
-The following pages describe the broad concepts behind CodeIgniter:
-
-.. toctree::
- :titlesonly:
-
- Getting Started <getting_started>
- CodeIgniter at a Glance <at_a_glance>
- Supported Features <features>
- Application Flow Chart <appflow>
- Model-View-Controller <mvc>
- Architectural Goals <goals> \ No newline at end of file
diff --git a/user_guide_src/source/overview/mvc.rst b/user_guide_src/source/overview/mvc.rst
deleted file mode 100644
index 996745d65..000000000
--- a/user_guide_src/source/overview/mvc.rst
+++ /dev/null
@@ -1,27 +0,0 @@
-#####################
-Model-View-Controller
-#####################
-
-CodeIgniter is based on the Model-View-Controller development pattern.
-MVC is a software approach that separates application logic from
-presentation. In practice, it permits your web pages to contain minimal
-scripting since the presentation is separate from the PHP scripting.
-
-- The **Model** represents your data structures. Typically your model
- classes will contain functions that help you retrieve, insert, and
- update information in your database.
-- The **View** is the information that is being presented to a user. A
- View will normally be a web page, but in CodeIgniter, a view can also
- be a page fragment like a header or footer. It can also be an RSS
- page, or any other type of "page".
-- The **Controller** serves as an *intermediary* between the Model, the
- View, and any other resources needed to process the HTTP request and
- generate a web page.
-
-CodeIgniter has a fairly loose approach to MVC since Models are not
-required. If you don't need the added separation, or find that
-maintaining models requires more complexity than you want, you can
-ignore them and build your application minimally using Controllers and
-Views. CodeIgniter also enables you to incorporate your own existing
-scripts, or even develop core libraries for the system, enabling you to
-work in a way that makes the most sense to you.
diff --git a/user_guide_src/source/tutorial/conclusion.rst b/user_guide_src/source/tutorial/conclusion.rst
deleted file mode 100644
index 0d90cde6f..000000000
--- a/user_guide_src/source/tutorial/conclusion.rst
+++ /dev/null
@@ -1,26 +0,0 @@
-##########
-Conclusion
-##########
-
-This tutorial did not cover all of the things you might expect of a
-full-fledged content management system, but it introduced you to the
-more important topics of routing, writing controllers, and models. We
-hope this tutorial gave you an insight into some of CodeIgniter's basic
-design patterns, which you can expand upon.
-
-Now that you've completed this tutorial, we recommend you check out the
-rest of the documentation. CodeIgniter is often praised because of its
-comprehensive documentation. Use this to your advantage and read the
-"Introduction" and "General Topics" sections thoroughly. You should read
-the class and helper references when needed.
-
-Every intermediate PHP programmer should be able to get the hang of
-CodeIgniter within a few days.
-
-If you still have questions about the framework or your own CodeIgniter
-code, you can:
-
-- Check out our `forums <http://forum.codeigniter.com/>`_
-- Visit our `IRC chatroom <https://github.com/bcit-ci/CodeIgniter/wiki/IRC>`_
-- Explore the `Wiki <https://github.com/bcit-ci/CodeIgniter/wiki/>`_
-
diff --git a/user_guide_src/source/tutorial/create_news_items.rst b/user_guide_src/source/tutorial/create_news_items.rst
deleted file mode 100644
index b53ef2d68..000000000
--- a/user_guide_src/source/tutorial/create_news_items.rst
+++ /dev/null
@@ -1,153 +0,0 @@
-#################
-Create news items
-#################
-
-You now know how you can read data from a database using CodeIgniter, but
-you haven't written any information to the database yet. In this section
-you'll expand your news controller and model created earlier to include
-this functionality.
-
-Create a form
--------------
-
-To input data into the database you need to create a form where you can
-input the information to be stored. This means you'll be needing a form
-with two fields, one for the title and one for the text. You'll derive
-the slug from our title in the model. Create the new view at
-*application/views/news/create.php*.
-
-::
-
- <h2><?php echo $title; ?></h2>
-
- <?php echo validation_errors(); ?>
-
- <?php echo form_open('news/create'); ?>
-
- <label for="title">Title</label>
- <input type="text" name="title" /><br />
-
- <label for="text">Text</label>
- <textarea name="text"></textarea><br />
-
- <input type="submit" name="submit" value="Create news item" />
-
- </form>
-
-There are only two things here that probably look unfamiliar to you: the
-``form_open()`` function and the ``validation_errors()`` function.
-
-The first function is provided by the :doc:`form
-helper <../helpers/form_helper>` and renders the form element and
-adds extra functionality, like adding a hidden :doc:`CSRF prevention
-field <../libraries/security>`. The latter is used to report
-errors related to form validation.
-
-Go back to your news controller. You're going to do two things here,
-check whether the form was submitted and whether the submitted data
-passed the validation rules. You'll use the :doc:`form
-validation <../libraries/form_validation>` library to do this.
-
-::
-
- public function create()
- {
- $this->load->helper('form');
- $this->load->library('form_validation');
-
- $data['title'] = 'Create a news item';
-
- $this->form_validation->set_rules('title', 'Title', 'required');
- $this->form_validation->set_rules('text', 'Text', 'required');
-
- if ($this->form_validation->run() === FALSE)
- {
- $this->load->view('templates/header', $data);
- $this->load->view('news/create');
- $this->load->view('templates/footer');
-
- }
- else
- {
- $this->news_model->set_news();
- $this->load->view('news/success');
- }
- }
-
-The code above adds a lot of functionality. The first few lines load the
-form helper and the form validation library. After that, rules for the
-form validation are set. The ``set_rules()`` method takes three arguments;
-the name of the input field, the name to be used in error messages, and
-the rule. In this case the title and text fields are required.
-
-CodeIgniter has a powerful form validation library as demonstrated
-above. You can read :doc:`more about this library
-here <../libraries/form_validation>`.
-
-Continuing down, you can see a condition that checks whether the form
-validation ran successfully. If it did not, the form is displayed, if it
-was submitted **and** passed all the rules, the model is called. After
-this, a view is loaded to display a success message. Create a view at
-*application/views/news/success.php* and write a success message.
-
-Model
------
-
-The only thing that remains is writing a method that writes the data to
-the database. You'll use the Query Builder class to insert the
-information and use the input library to get the posted data. Open up
-the model created earlier and add the following:
-
-::
-
- public function set_news()
- {
- $this->load->helper('url');
-
- $slug = url_title($this->input->post('title'), 'dash', TRUE);
-
- $data = array(
- 'title' => $this->input->post('title'),
- 'slug' => $slug,
- 'text' => $this->input->post('text')
- );
-
- return $this->db->insert('news', $data);
- }
-
-This new method takes care of inserting the news item into the database.
-The third line contains a new function, url\_title(). This function -
-provided by the :doc:`URL helper <../helpers/url_helper>` - strips down
-the string you pass it, replacing all spaces by dashes (-) and makes
-sure everything is in lowercase characters. This leaves you with a nice
-slug, perfect for creating URIs.
-
-Let's continue with preparing the record that is going to be inserted
-later, inside the ``$data`` array. Each element corresponds with a column in
-the database table created earlier. You might notice a new method here,
-namely the ``post()`` method from the :doc:`input
-library <../libraries/input>`. This method makes sure the data is
-sanitized, protecting you from nasty attacks from others. The input
-library is loaded by default. At last, you insert our ``$data`` array into
-our database.
-
-Routing
--------
-
-Before you can start adding news items into your CodeIgniter application
-you have to add an extra rule to *config/routes.php* file. Make sure your
-file contains the following. This makes sure CodeIgniter sees 'create'
-as a method instead of a news item's slug.
-
-::
-
- $route['news/create'] = 'news/create';
- $route['news/(:any)'] = 'news/view/$1';
- $route['news'] = 'news';
- $route['(:any)'] = 'pages/view/$1';
- $route['default_controller'] = 'pages/view';
-
-Now point your browser to your local development environment where you
-installed CodeIgniter and add index.php/news/create to the URL.
-Congratulations, you just created your first CodeIgniter application!
-Add some news and check out the different pages you made.
diff --git a/user_guide_src/source/tutorial/index.rst b/user_guide_src/source/tutorial/index.rst
deleted file mode 100644
index 91f99c7cd..000000000
--- a/user_guide_src/source/tutorial/index.rst
+++ /dev/null
@@ -1,46 +0,0 @@
-########
-Tutorial
-########
-
-This tutorial is intended to introduce you to the CodeIgniter framework
-and the basic principles of MVC architecture. It will show you how a
-basic CodeIgniter application is constructed in step-by-step fashion.
-
-In this tutorial, you will be creating a **basic news application**. You
-will begin by writing the code that can load static pages. Next, you
-will create a news section that reads news items from a database.
-Finally, you'll add a form to create news items in the database.
-
-This tutorial will primarily focus on:
-
-- Model-View-Controller basics
-- Routing basics
-- Form validation
-- Performing basic database queries using "Query Builder"
-
-The entire tutorial is split up over several pages, each explaining a
-small part of the functionality of the CodeIgniter framework. You'll go
-through the following pages:
-
-- Introduction, this page, which gives you an overview of what to
- expect.
-- :doc:`Static pages <static_pages>`, which will teach you the basics
- of controllers, views and routing.
-- :doc:`News section <news_section>`, where you'll start using models
- and will be doing some basic database operations.
-- :doc:`Create news items <create_news_items>`, which will introduce
- more advanced database operations and form validation.
-- :doc:`Conclusion <conclusion>`, which will give you some pointers on
- further reading and other resources.
-
-Enjoy your exploration of the CodeIgniter framework.
-
-.. toctree::
- :glob:
- :hidden:
- :titlesonly:
-
- static_pages
- news_section
- create_news_items
- conclusion \ No newline at end of file
diff --git a/user_guide_src/source/tutorial/news_section.rst b/user_guide_src/source/tutorial/news_section.rst
deleted file mode 100644
index 286d620dc..000000000
--- a/user_guide_src/source/tutorial/news_section.rst
+++ /dev/null
@@ -1,218 +0,0 @@
-############
-News section
-############
-
-In the last section, we went over some basic concepts of the framework
-by writing a class that includes static pages. We cleaned up the URI by
-adding custom routing rules. Now it's time to introduce dynamic content
-and start using a database.
-
-Setting up your model
----------------------
-
-Instead of writing database operations right in the controller, queries
-should be placed in a model, so they can easily be reused later. Models
-are the place where you retrieve, insert, and update information in your
-database or other data stores. They represent your data.
-
-Open up the *application/models/* directory and create a new file called
-*News_model.php* and add the following code. Make sure you've configured
-your database properly as described :doc:`here <../database/configuration>`.
-
-::
-
- <?php
- class News_model extends CI_Model {
-
- public function __construct()
- {
- $this->load->database();
- }
- }
-
-This code looks similar to the controller code that was used earlier. It
-creates a new model by extending ``CI_Model`` and loads the database
-library. This will make the database class available through the
-``$this->db`` object.
-
-Before querying the database, a database schema has to be created.
-Connect to your database and run the SQL command below (MySQL).
-Also add some seed records.
-
-::
-
- CREATE TABLE news (
- id int(11) NOT NULL AUTO_INCREMENT,
- title varchar(128) NOT NULL,
- slug varchar(128) NOT NULL,
- text text NOT NULL,
- PRIMARY KEY (id),
- KEY slug (slug)
- );
-
-Now that the database and a model have been set up, you'll need a method
-to get all of our posts from our database. To do this, the database
-abstraction layer that is included with CodeIgniter —
-:doc:`Query Builder <../database/query_builder>` — is used. This makes it
-possible to write your 'queries' once and make them work on :doc:`all
-supported database systems <../general/requirements>`. Add the
-following code to your model.
-
-::
-
- public function get_news($slug = FALSE)
- {
- if ($slug === FALSE)
- {
- $query = $this->db->get('news');
- return $query->result_array();
- }
-
- $query = $this->db->get_where('news', array('slug' => $slug));
- return $query->row_array();
- }
-
-With this code you can perform two different queries. You can get all
-news records, or get a news item by its `slug <#>`_. You might have
-noticed that the ``$slug`` variable wasn't sanitized before running the
-query; :doc:`Query Builder <../database/query_builder>` does this for you.
-
-Display the news
-----------------
-
-Now that the queries are written, the model should be tied to the views
-that are going to display the news items to the user. This could be done
-in our ``Pages`` controller created earlier, but for the sake of clarity,
-a new ``News`` controller is defined. Create the new controller at
-*application/controllers/News.php*.
-
-::
-
- <?php
- class News extends CI_Controller {
-
- public function __construct()
- {
- parent::__construct();
- $this->load->model('news_model');
- $this->load->helper('url_helper');
- }
-
- public function index()
- {
- $data['news'] = $this->news_model->get_news();
- }
-
- public function view($slug = NULL)
- {
- $data['news_item'] = $this->news_model->get_news($slug);
- }
- }
-
-Looking at the code, you may see some similarity with the files we
-created earlier. First, the ``__construct()`` method: it calls the
-constructor of its parent class (``CI_Controller``) and loads the model,
-so it can be used in all other methods in this controller.
-It also loads a collection of :doc:`URL Helper <../helpers/url_helper>`
-functions, because we'll use one of them in a view later.
-
-Next, there are two methods to view all news items and one for a specific
-news item. You can see that the ``$slug`` variable is passed to the model's
-method in the second method. The model is using this slug to identify the
-news item to be returned.
-
-Now the data is retrieved by the controller through our model, but
-nothing is displayed yet. The next thing to do is passing this data to
-the views.
-
-::
-
- public function index()
- {
- $data['news'] = $this->news_model->get_news();
- $data['title'] = 'News archive';
-
- $this->load->view('templates/header', $data);
- $this->load->view('news/index', $data);
- $this->load->view('templates/footer');
- }
-
-The code above gets all news records from the model and assigns it to a
-variable. The value for the title is also assigned to the ``$data['title']``
-element and all data is passed to the views. You now need to create a
-view to render the news items. Create *application/views/news/index.php*
-and add the next piece of code.
-
-::
-
- <h2><?php echo $title; ?></h2>
-
- <?php foreach ($news as $news_item): ?>
-
- <h3><?php echo $news_item['title']; ?></h3>
- <div class="main">
- <?php echo $news_item['text']; ?>
- </div>
- <p><a href="<?php echo site_url('news/'.$news_item['slug']); ?>">View article</a></p>
-
- <?php endforeach; ?>
-
-Here, each news item is looped and displayed to the user. You can see we
-wrote our template in PHP mixed with HTML. If you prefer to use a template
-language, you can use CodeIgniter's :doc:`Template
-Parser <../libraries/parser>` class or a third party parser.
-
-The news overview page is now done, but a page to display individual
-news items is still absent. The model created earlier is made in such
-way that it can easily be used for this functionality. You only need to
-add some code to the controller and create a new view. Go back to the
-``News`` controller and update ``view()`` with the following:
-
-::
-
- public function view($slug = NULL)
- {
- $data['news_item'] = $this->news_model->get_news($slug);
-
- if (empty($data['news_item']))
- {
- show_404();
- }
-
- $data['title'] = $data['news_item']['title'];
-
- $this->load->view('templates/header', $data);
- $this->load->view('news/view', $data);
- $this->load->view('templates/footer');
- }
-
-Instead of calling the ``get_news()`` method without a parameter, the
-``$slug`` variable is passed, so it will return the specific news item.
-The only things left to do is create the corresponding view at
-*application/views/news/view.php*. Put the following code in this file.
-
-::
-
- <?php
- echo '<h2>'.$news_item['title'].'</h2>';
- echo $news_item['text'];
-
-Routing
--------
-
-Because of the wildcard routing rule created earlier, you need an extra
-route to view the controller that you just made. Modify your routing file
-(*application/config/routes.php*) so it looks as follows.
-This makes sure the requests reaches the ``News`` controller instead of
-going directly to the ``Pages`` controller. The first line routes URI's
-with a slug to the ``view()`` method in the ``News`` controller.
-
-::
-
- $route['news/(:any)'] = 'news/view/$1';
- $route['news'] = 'news';
- $route['(:any)'] = 'pages/view/$1';
- $route['default_controller'] = 'pages/view';
-
-Point your browser to your document root, followed by index.php/news and
-watch your news page.
diff --git a/user_guide_src/source/tutorial/static_pages.rst b/user_guide_src/source/tutorial/static_pages.rst
deleted file mode 100644
index 561082a48..000000000
--- a/user_guide_src/source/tutorial/static_pages.rst
+++ /dev/null
@@ -1,170 +0,0 @@
-############
-Static pages
-############
-
-**Note:** This tutorial assumes you've downloaded CodeIgniter and
-:doc:`installed the framework <../installation/index>` in your
-development environment.
-
-The first thing you're going to do is set up a **controller** to handle
-static pages. A controller is simply a class that helps delegate work.
-It is the glue of your web application.
-
-For example, when a call is made to:
-
- http://example.com/news/latest/10
-
-We might imagine that there is a controller named "news". The method
-being called on news would be "latest". The news method's job could be to
-grab 10 news items, and render them on the page. Very often in MVC,
-you'll see URL patterns that match:
-
- http://example.com/[controller-class]/[controller-method]/[arguments]
-
-As URL schemes become more complex, this may change. But for now, this
-is all we will need to know.
-
-Create a file at *application/controllers/Pages.php* with the following
-code.
-
-::
-
- <?php
- class Pages extends CI_Controller {
-
- public function view($page = 'home')
- {
- }
- }
-
-You have created a class named ``Pages``, with a view method that accepts
-one argument named ``$page``. The ``Pages`` class is extending the
-``CI_Controller`` class. This means that the new pages class can access the
-methods and variables defined in the ``CI_Controller`` class
-(*system/core/Controller.php*).
-
-The **controller is what will become the center of every request** to
-your web application. In very technical CodeIgniter discussions, it may
-be referred to as the *super object*. Like any php class, you refer to
-it within your controllers as ``$this``. Referring to ``$this`` is how
-you will load libraries, views, and generally command the framework.
-
-Now you've created your first method, it's time to make some basic page
-templates. We will be creating two "views" (page templates) that act as
-our page footer and header.
-
-Create the header at *application/views/templates/header.php* and add
-the following code:
-
-::
-
- <html>
- <head>
- <title>CodeIgniter Tutorial</title>
- </head>
- <body>
-
- <h1><?php echo $title; ?></h1>
-
-The header contains the basic HTML code that you'll want to display
-before loading the main view, together with a heading. It will also
-output the ``$title`` variable, which we'll define later in the controller.
-Now, create a footer at *application/views/templates/footer.php* that
-includes the following code:
-
-::
-
- <em>&copy; 2015</em>
- </body>
- </html>
-
-Adding logic to the controller
-------------------------------
-
-Earlier you set up a controller with a ``view()`` method. The method
-accepts one parameter, which is the name of the page to be loaded. The
-static page templates will be located in the *application/views/pages/*
-directory.
-
-In that directory, create two files named *home.php* and *about.php*.
-Within those files, type some text − anything you'd like − and save them.
-If you like to be particularly un-original, try "Hello World!".
-
-In order to load those pages, you'll have to check whether the requested
-page actually exists:
-
-::
-
- public function view($page = 'home')
- {
- if ( ! file_exists(APPPATH.'views/pages/'.$page.'.php'))
- {
- // Whoops, we don't have a page for that!
- show_404();
- }
-
- $data['title'] = ucfirst($page); // Capitalize the first letter
-
- $this->load->view('templates/header', $data);
- $this->load->view('pages/'.$page, $data);
- $this->load->view('templates/footer', $data);
- }
-
-Now, when the page does exist, it is loaded, including the header and
-footer, and displayed to the user. If the page doesn't exist, a "404
-Page not found" error is shown.
-
-The first line in this method checks whether the page actually exists.
-PHP's native ``file_exists()`` function is used to check whether the file
-is where it's expected to be. ``show_404()`` is a built-in CodeIgniter
-function that renders the default error page.
-
-In the header template, the ``$title`` variable was used to customize the
-page title. The value of title is defined in this method, but instead of
-assigning the value to a variable, it is assigned to the title element
-in the ``$data`` array.
-
-The last thing that has to be done is loading the views in the order
-they should be displayed. The second parameter in the ``view()`` method is
-used to pass values to the view. Each value in the ``$data`` array is
-assigned to a variable with the name of its key. So the value of
-``$data['title']`` in the controller is equivalent to ``$title`` in the
-view.
-
-Routing
--------
-
-The controller is now functioning! Point your browser to
-``[your-site-url]index.php/pages/view`` to see your page. When you visit
-``index.php/pages/view/about`` you'll see the about page, again including
-the header and footer.
-
-Using custom routing rules, you have the power to map any URI to any
-controller and method, and break free from the normal convention:
-``http://example.com/[controller-class]/[controller-method]/[arguments]``
-
-Let's do that. Open the routing file located at
-*application/config/routes.php* and add the following two lines.
-Remove all other code that sets any element in the ``$route`` array.
-
-::
-
- $route['default_controller'] = 'pages/view';
- $route['(:any)'] = 'pages/view/$1';
-
-CodeIgniter reads its routing rules from top to bottom and routes the
-request to the first matching rule. Each rule is a regular expression
-(left-side) mapped to a controller and method name separated by slashes
-(right-side). When a request comes in, CodeIgniter looks for the first
-match, and calls the appropriate controller and method, possibly with
-arguments.
-
-More information about routing can be found in the URI Routing
-:doc:`documentation <../general/routing>`.
-
-Here, the second rule in the ``$route`` array matches **any** request
-using the wildcard string ``(:any)``. and passes the parameter to the
-``view()`` method of the ``Pages`` class.
-
-Now visit ``index.php/about``. Did it get routed correctly to the ``view()``
-method in the pages controller? Awesome!