Simple Calendar – Google Calendar Plugin - Version 3.0.15

Version Description

  • March 19, 2016 =

  • Fix: Timezone issues with event source option should now work correctly.

  • Fix: Tooltips should no longer be empty after a resize.

  • Tweak: Removed event source option for grouped calendars.

  • Tweak: Allow other plugin or theme shortcodes to be used in the event template.

  • Dev: Removed Browser.php from composer so we can use it standalone with customizations.

  • Dev: Constructor for Browser.php now compatible with future versions of PHP.

  • Dev: Removed PHP 5.2 compatibility code.

Download this release

Release Info

Developer nickyoung87
Plugin Icon 128x128 Simple Calendar – Google Calendar Plugin
Version 3.0.15
Comparing to
See all releases

Code changes from version 3.0.14 to 3.0.15

Files changed (42) hide show
  1. assets/css/admin-activation.min.css +1 -1
  2. assets/css/admin-add-calendar.min.css +1 -1
  3. assets/css/admin.min.css +1 -1
  4. assets/css/default-calendar-grid.min.css +1 -1
  5. assets/css/default-calendar-list.min.css +1 -1
  6. assets/css/vendor/select2.min.css +1 -1
  7. assets/js/admin-add-calendar.min.js +1 -1
  8. assets/js/admin.js +12 -2
  9. assets/js/admin.min.js +2 -2
  10. assets/js/default-calendar.js +7 -2
  11. assets/js/default-calendar.min.js +2 -2
  12. assets/js/vendor/select2.js +25 -15
  13. assets/js/vendor/select2.min.js +2 -2
  14. google-calendar-events.php +5 -10
  15. includes/abstracts/calendar.php +6 -1
  16. includes/admin/metaboxes/settings.php +19 -13
  17. includes/admin/pages/system-status.php +1 -1
  18. includes/browser.php +1255 -0
  19. includes/calendars/admin/default-calendar-admin.php +0 -12
  20. includes/calendars/views/default-calendar-grid.php +10 -1
  21. includes/calendars/views/default-calendar-list.php +11 -1
  22. includes/events/event-builder.php +1 -1
  23. includes/feeds/google.php +42 -2
  24. includes/functions/admin.php +2 -60
  25. readme.txt +13 -3
  26. vendor/autoload_52.php +1 -1
  27. vendor/cbschuld/browser.php/LICENSE.md +0 -7
  28. vendor/cbschuld/browser.php/README.md +0 -147
  29. vendor/cbschuld/browser.php/composer.json +0 -18
  30. vendor/cbschuld/browser.php/lib/Browser.php +0 -1282
  31. vendor/cbschuld/browser.php/phpunit.xml.dist +0 -29
  32. vendor/composer/autoload_files.php +0 -1
  33. vendor/composer/autoload_namespaces.php +0 -1
  34. vendor/composer/autoload_real_52.php +3 -4
  35. vendor/composer/installed.json +4 -79
  36. vendor/symfony/translation/Tests/Writer/TranslationWriterTest.php +47 -0
  37. vendor/xrstf/composer-php52/LICENSE +0 -19
  38. vendor/xrstf/composer-php52/README.md +0 -29
  39. vendor/xrstf/composer-php52/composer.json +0 -27
  40. vendor/xrstf/composer-php52/lib/xrstf/Composer52/AutoloadGenerator.php +0 -346
  41. vendor/xrstf/composer-php52/lib/xrstf/Composer52/ClassLoader.php +0 -271
  42. vendor/xrstf/composer-php52/lib/xrstf/Composer52/Generator.php +0 -39
assets/css/admin-activation.min.css CHANGED
@@ -1,4 +1,4 @@
1
- /*! Simple Calendar - 3.0.14
2
  * https://simplecalendar.io
3
  * Copyright (c) Moonstone Media 2016
4
  * Licensed GPLv2+ */
1
+ /*! Simple Calendar - 3.0.15
2
  * https://simplecalendar.io
3
  * Copyright (c) Moonstone Media 2016
4
  * Licensed GPLv2+ */
assets/css/admin-add-calendar.min.css CHANGED
@@ -1,4 +1,4 @@
1
- /*! Simple Calendar - 3.0.14
2
  * https://simplecalendar.io
3
  * Copyright (c) Moonstone Media 2016
4
  * Licensed GPLv2+ */
1
+ /*! Simple Calendar - 3.0.15
2
  * https://simplecalendar.io
3
  * Copyright (c) Moonstone Media 2016
4
  * Licensed GPLv2+ */
assets/css/admin.min.css CHANGED
@@ -1,4 +1,4 @@
1
- /*! Simple Calendar - 3.0.14
2
  * https://simplecalendar.io
3
  * Copyright (c) Moonstone Media 2016
4
  * Licensed GPLv2+ */
1
+ /*! Simple Calendar - 3.0.15
2
  * https://simplecalendar.io
3
  * Copyright (c) Moonstone Media 2016
4
  * Licensed GPLv2+ */
assets/css/default-calendar-grid.min.css CHANGED
@@ -1,4 +1,4 @@
1
- /*! Simple Calendar - 3.0.14
2
  * https://simplecalendar.io
3
  * Copyright (c) Moonstone Media 2016
4
  * Licensed GPLv2+ */
1
+ /*! Simple Calendar - 3.0.15
2
  * https://simplecalendar.io
3
  * Copyright (c) Moonstone Media 2016
4
  * Licensed GPLv2+ */
assets/css/default-calendar-list.min.css CHANGED
@@ -1,4 +1,4 @@
1
- /*! Simple Calendar - 3.0.14
2
  * https://simplecalendar.io
3
  * Copyright (c) Moonstone Media 2016
4
  * Licensed GPLv2+ */
1
+ /*! Simple Calendar - 3.0.15
2
  * https://simplecalendar.io
3
  * Copyright (c) Moonstone Media 2016
4
  * Licensed GPLv2+ */
assets/css/vendor/select2.min.css CHANGED
@@ -1 +1 @@
1
- .select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:white;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none}.select2-results__option[aria-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0 !important;clip:rect(0 0 0 0) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--default .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__placeholder{color:#999;margin-top:5px;float:left}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline{float:right}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid #000 1px;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:white}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, #fff 50%, #eee 100%);background-image:-o-linear-gradient(top, #fff 50%, #eee 100%);background-image:linear-gradient(to bottom, #fff 50%, #eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eee 50%, #ccc 100%);background-image:-o-linear-gradient(top, #eee 50%, #ccc 100%);background-image:linear-gradient(to bottom, #eee 50%, #ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, #fff 0%, #eee 50%);background-image:-o-linear-gradient(top, #fff 0%, #eee 50%);background-image:linear-gradient(to bottom, #fff 0%, #eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eee 50%, #fff 100%);background-image:-o-linear-gradient(top, #eee 50%, #fff 100%);background-image:linear-gradient(to bottom, #eee 50%, #fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{float:right}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[aria-selected]{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb}
1
+ .select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:white;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none}.select2-results__option[aria-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0 !important;clip:rect(0 0 0 0) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--default .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__placeholder{color:#999;margin-top:5px;float:left}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline{float:right}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid black 1px;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:white}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, #fff 50%, #eee 100%);background-image:-o-linear-gradient(top, #fff 50%, #eee 100%);background-image:linear-gradient(to bottom, #fff 50%, #eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eee 50%, #ccc 100%);background-image:-o-linear-gradient(top, #eee 50%, #ccc 100%);background-image:linear-gradient(to bottom, #eee 50%, #ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, #fff 0%, #eee 50%);background-image:-o-linear-gradient(top, #fff 0%, #eee 50%);background-image:linear-gradient(to bottom, #fff 0%, #eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eee 50%, #fff 100%);background-image:-o-linear-gradient(top, #eee 50%, #fff 100%);background-image:linear-gradient(to bottom, #eee 50%, #fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{float:right}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[aria-selected]{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb}
assets/js/admin-add-calendar.min.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! Simple Calendar - 3.0.14
2
  * https://simplecalendar.io
3
  * Copyright (c) Moonstone Media 2016
4
  * Licensed GPLv2+ */
1
+ /*! Simple Calendar - 3.0.15
2
  * https://simplecalendar.io
3
  * Copyright (c) Moonstone Media 2016
4
  * Licensed GPLv2+ */
assets/js/admin.js CHANGED
@@ -310,8 +310,8 @@
310
  options.each( function( e, option ) {
311
 
312
  var id = $( option ).data( 'show-field' ),
313
- field = id.length ? $( '#' + id ) : '',
314
- next = id.length ? field.next() : '';
315
 
316
  if ( field.length ) {
317
  if ( $( option ).is( ':selected' ) ) {
@@ -427,6 +427,16 @@
427
 
428
  } );
429
 
 
 
 
 
 
 
 
 
 
 
430
  /* ========================= *
431
  * Add-on License Management *
432
  * ========================= */
310
  options.each( function( e, option ) {
311
 
312
  var id = $( option ).data( 'show-field' ),
313
+ field = typeof id !== 'undefined' && id.length ? $( '#' + id ) : '',
314
+ next = typeof id !== 'undefined' && id.length ? field.next() : '';
315
 
316
  if ( field.length ) {
317
  if ( $( option ).is( ':selected' ) ) {
427
 
428
  } );
429
 
430
+ // Hide the timezone option for "event source" when a grouped calendar is selected.
431
+ $( '#_feed_type').on( 'change', function( e ) {
432
+ if( $(this).val() === 'grouped-calendars' ) {
433
+ $('#use_calendar').remove();
434
+ } else {
435
+ var html = '<option id="use_calendar" value="use_calendar" data-show-field="_use_calendar_warning">Event source default</option>';
436
+ $('#_feed_timezone_setting').append( html );
437
+ }
438
+ });
439
+
440
  /* ========================= *
441
  * Add-on License Management *
442
  * ========================= */
assets/js/admin.min.js CHANGED
@@ -1,6 +1,6 @@
1
- /*! Simple Calendar - 3.0.14
2
  * https://simplecalendar.io
3
  * Copyright (c) Moonstone Media 2016
4
  * Licensed GPLv2+ */
5
 
6
- !function(a,b){"use strict";jQuery(function(a){function b(b){var c=a(b).find("input"),d=a(b).find("> div select"),e=a(b).find("code"),f="",g="";d.each(function(b,c){var d=a(c).val(),e=a(c).find("> option:selected");d.length&&(e.data("trim")?(f=f.trim()+a(c).val(),g=g.trim()+e.data("preview")):(f+=a(c).val()+" ",g+=e.data("preview")+" "))}),c.val(f),e.text(g)}a(".simcal-help-tip").tipTip({attribute:"data-tip",delay:200,fadeIn:50,fadeOut:50}),a(".simcal-shortcode-tip").tipTip({activation:"click",defaultPosition:"top",delay:200,fadeIn:50,fadeOut:50});var c=a("#simcal-calendar-settings"),d=c.find(".simcal-box-handle"),e=c.find(".hndle");a(d).appendTo(e),a(function(){a(e).unbind("click.postboxes"),c.on("click","h3.hndle",function(b){a(b.target).filter("input, option, label, select").length||c.toggleClass("closed")})}),a(document.body).on("simcal-init-tabbed-panels",function(){a(".simcal-tabs").show(),a(".simcal-tabs a").click(function(){var b=a(this).closest("div.simcal-panels-wrap");return a("ul.simcal-tabs li",b).removeClass("active"),a(this).parent().addClass("active"),a("div.simcal-panel",b).hide(),a(a(this).attr("href")).show(),!1}),a("div.simcal-panels-wrap").each(function(){a(this).find("ul.simcal-tabs > li").eq(0).find("a").click()})}).trigger("simcal-init-tabbed-panels"),a("#_feed_type").on("change",function(){var b=a(this).find("option:selected"),c=b.val(),d=a(".simcal-tabs"),e=d.find("> .simcal-feed-type"),f=d.find("> .simcal-feed-type-"+c),g=d.find("> li:first-child > a");e.each(function(){a(this).hide()}),f.show(),g.trigger("click")}).trigger("change"),c.show();var f=a("#_calendar_view_default-calendar"),g=a("#default-calendar-settings"),h=g.find(".simcal-default-calendar-grid"),i=g.find(".simcal-default-calendar-list"),j=g.find(".simcal-default-calendar-list-grouped");f.on("change",function(){var b=a(this).val();"grid"==b?(i.hide(),j.hide(),h.show()):"list"==b?(h.hide(),j.hide(),i.show()):"list-grouped"==b&&(h.hide(),i.hide(),j.show())}).trigger("change"),a(".simcal-field-color-picker").wpColorPicker(),a(".simcal-field-select-enhanced").each(function(b,c){var d=a(c),e=d.data("noresults"),f=d.data("allowclear");d.select2({allowClear:"undefined"!=f?f:!1,placeholder:{id:"",placeholder:""},dir:"undefined"!=simcal_admin.text_dir?simcal_admin.text_dir:"ltr",tokenSeparators:[","],width:"100%",language:{noResults:function(){return"undefined"!=e?e:""}}})});var k=a(".simcal-field-date-picker");k.each(function(b,c){var d=a(c).find("input"),e={autoSize:!0,changeMonth:!0,changeYear:!0,dateFormat:"yy-mm-dd",firstDay:1,prevText:'<i class="simcal-icon-left"></i>',nextText:'<i class="simcal-icon-right"></i>',yearRange:"1900:2050",beforeShow:function(b,c){a("#ui-datepicker-div").addClass("simcal-date-picker")}};a(d).datepicker(e),a(d).datepicker("option",a.datepicker.regional[simcal_admin.locale])});var l=a(".simcal-field-datetime-format");l.sortable({items:"> div",stop:function(){b(a(this))}}),l.each(function(c,d){var e=a(d).find("> div select");e.each(function(c,d){a(d).on("change",function(){b(a(this).closest("div.simcal-field-datetime-format"))})}),b(d)}),a(".simcal-field-datetime-format-php").each(function(b,c){var d=a(c).find("input"),e=a(c).find("code");a(d).on("keyup",function(){var b={action:"simcal_date_i18n_input_preview",value:d.val()};a.post(simcal_admin.ajax_url,b,function(b){a(e).text(b.data)})})}),a('input[type="number"].simcal-field').each(function(b,c){var d=a(c),e=d.attr("min"),f=d.attr("max");d.on("change",function(){var b=parseInt(a(this).val());e&&e>b&&a(this).val(e),f&&b>f&&a(this).val(f)})}),a(".simcal-field-switch-other").on("change",function(){var b=a(this).find("option");b.each(function(b,c){var d=a(c).data("show-field"),e=a(c).data("show-fields"),f=a(c).data("hide-field"),g=a(c).data("hide-fields"),h=d?a("#"+d):"",i=f?a("#"+f):"";if(a(c).is(":selected")){if(h&&h.show(),i&&i.hide(),e){var j=g.split(",");a(j).each(function(b,c){a("#"+c).hide()})}if(g){var k=g.split(",");a(k).each(function(b,c){a("#"+c).hide()})}}})}).trigger("change"),a(".simcal-field-show-other").on("change",function(){var b=a(this).find("option");b.each(function(b,c){var d=a(c).data("show-field"),e=d.length?a("#"+d):"",f=d.length?e.next():"";e.length&&(a(c).is(":selected")?(e.show(),f.hasClass("select2")&&f.show()):(e.hide(),f.hasClass("select2")&&f.hide()))})}).trigger("change"),a(".simcal-field-show-next").on("change",function(){var b,c,d,e;a(this).is(":checkbox")?(d=a(this).parent().next(),a(this).is(":checked")?d.show():d.hide()):(b=a(this).val(),c=a(this).data("show-next-if-value"),d=a(this).nextUntil().not("i"),e=d.length?d.next():"",b==c?(d.show(),e.hasClass("select2")&&e.show()):(d.hide(),e.hasClass("select2")&&e.hide()))}).trigger("change"),a("#simcal-clear-cache").on("click",function(b){b.preventDefault();var c=a(this).find("i");a.ajax({url:simcal_admin.ajax_url,method:"POST",data:{action:"simcal_clear_cache",id:a(this).data("id")},beforeSend:function(){c.fadeToggle()},success:function(){c.fadeToggle()},error:function(a){console.log(a)}})}),a("#simcal-drip-signup").on("click",function(b){b.preventDefault();var c=a("#simcal-drip"),d=c.find(".signup"),e=c.find(".thank-you"),f=a("#simcal-drip-form"),g=c.find("#simcal-drip-field-first_name"),h=f.find("#simcal-drip-real-field-first_name"),i=c.find("#simcal-drip-field-email"),j=f.find("#simcal-drip-real-field-email");h.val(g.val()),j.val(i.val()),d.hide(),e.show(),f.submit()}),a(".simcal-addon-manage-license").on("click",function(b){b.preventDefault();var c="",d=a(this),e=d.closest(".simcal-addon-manage-license-buttons"),f=d.closest(".simcal-addon-manage-license-field").find("> input"),g=e.find(".error"),h=d.find("i");if(a(this).hasClass("activate"))c="activate_license";else{if(!a(this).hasClass("deactivate"))return;c="deactivate_license"}a.ajax({url:simcal_admin.ajax_url,method:"POST",data:{action:"simcal_manage_add_on_license",add_on:a(this).data("add-on"),license_key:f.val(),license_action:c,nonce:a("#simcal_license_manager").val()},beforeSend:function(){h.fadeToggle()},success:function(b){h.fadeToggle(),"activate_license"==c?"valid"==b.data?(d.hide(),f.attr("disabled","disabled"),a(e).find(".label").show(),a(e).find(".deactivate").show(),g.hide()):g.show().text(b.data):"deactivated"==b.data?(d.hide(),f.removeAttr("disabled"),a(e).find(".label").hide(),a(e).find(".activate").show(),g.hide()):g.show().text(b.data)},error:function(a){console.log(a),h.fadeToggle()}})}),a("#simcal-reset-licenses").on("click",function(b){b.preventDefault();var c=a(this).find("i"),d=a(this).data("dialog"),e=confirm(d);!0===e&&a.ajax({url:simcal_admin.ajax_url,method:"POST",data:{action:"simcal_reset_add_ons_licenses",nonce:a("#simcal_license_manager").val()},beforeSend:function(){c.toggle()},success:function(a){"success"==a.data?location.reload():console.log(a)},error:function(a){console.log(a)}})})})}(this);
1
+ /*! Simple Calendar - 3.0.15
2
  * https://simplecalendar.io
3
  * Copyright (c) Moonstone Media 2016
4
  * Licensed GPLv2+ */
5
 
6
+ !function(a,b){"use strict";jQuery(function(a){function b(b){var c=a(b).find("input"),d=a(b).find("> div select"),e=a(b).find("code"),f="",g="";d.each(function(b,c){var d=a(c).val(),e=a(c).find("> option:selected");d.length&&(e.data("trim")?(f=f.trim()+a(c).val(),g=g.trim()+e.data("preview")):(f+=a(c).val()+" ",g+=e.data("preview")+" "))}),c.val(f),e.text(g)}a(".simcal-help-tip").tipTip({attribute:"data-tip",delay:200,fadeIn:50,fadeOut:50}),a(".simcal-shortcode-tip").tipTip({activation:"click",defaultPosition:"top",delay:200,fadeIn:50,fadeOut:50});var c=a("#simcal-calendar-settings"),d=c.find(".simcal-box-handle"),e=c.find(".hndle");a(d).appendTo(e),a(function(){a(e).unbind("click.postboxes"),c.on("click","h3.hndle",function(b){a(b.target).filter("input, option, label, select").length||c.toggleClass("closed")})}),a(document.body).on("simcal-init-tabbed-panels",function(){a(".simcal-tabs").show(),a(".simcal-tabs a").click(function(){var b=a(this).closest("div.simcal-panels-wrap");return a("ul.simcal-tabs li",b).removeClass("active"),a(this).parent().addClass("active"),a("div.simcal-panel",b).hide(),a(a(this).attr("href")).show(),!1}),a("div.simcal-panels-wrap").each(function(){a(this).find("ul.simcal-tabs > li").eq(0).find("a").click()})}).trigger("simcal-init-tabbed-panels"),a("#_feed_type").on("change",function(){var b=a(this).find("option:selected"),c=b.val(),d=a(".simcal-tabs"),e=d.find("> .simcal-feed-type"),f=d.find("> .simcal-feed-type-"+c),g=d.find("> li:first-child > a");e.each(function(){a(this).hide()}),f.show(),g.trigger("click")}).trigger("change"),c.show();var f=a("#_calendar_view_default-calendar"),g=a("#default-calendar-settings"),h=g.find(".simcal-default-calendar-grid"),i=g.find(".simcal-default-calendar-list"),j=g.find(".simcal-default-calendar-list-grouped");f.on("change",function(){var b=a(this).val();"grid"==b?(i.hide(),j.hide(),h.show()):"list"==b?(h.hide(),j.hide(),i.show()):"list-grouped"==b&&(h.hide(),i.hide(),j.show())}).trigger("change"),a(".simcal-field-color-picker").wpColorPicker(),a(".simcal-field-select-enhanced").each(function(b,c){var d=a(c),e=d.data("noresults"),f=d.data("allowclear");d.select2({allowClear:"undefined"!=f?f:!1,placeholder:{id:"",placeholder:""},dir:"undefined"!=simcal_admin.text_dir?simcal_admin.text_dir:"ltr",tokenSeparators:[","],width:"100%",language:{noResults:function(){return"undefined"!=e?e:""}}})});var k=a(".simcal-field-date-picker");k.each(function(b,c){var d=a(c).find("input"),e={autoSize:!0,changeMonth:!0,changeYear:!0,dateFormat:"yy-mm-dd",firstDay:1,prevText:'<i class="simcal-icon-left"></i>',nextText:'<i class="simcal-icon-right"></i>',yearRange:"1900:2050",beforeShow:function(b,c){a("#ui-datepicker-div").addClass("simcal-date-picker")}};a(d).datepicker(e),a(d).datepicker("option",a.datepicker.regional[simcal_admin.locale])});var l=a(".simcal-field-datetime-format");l.sortable({items:"> div",stop:function(){b(a(this))}}),l.each(function(c,d){var e=a(d).find("> div select");e.each(function(c,d){a(d).on("change",function(){b(a(this).closest("div.simcal-field-datetime-format"))})}),b(d)}),a(".simcal-field-datetime-format-php").each(function(b,c){var d=a(c).find("input"),e=a(c).find("code");a(d).on("keyup",function(){var b={action:"simcal_date_i18n_input_preview",value:d.val()};a.post(simcal_admin.ajax_url,b,function(b){a(e).text(b.data)})})}),a('input[type="number"].simcal-field').each(function(b,c){var d=a(c),e=d.attr("min"),f=d.attr("max");d.on("change",function(){var b=parseInt(a(this).val());e&&e>b&&a(this).val(e),f&&b>f&&a(this).val(f)})}),a(".simcal-field-switch-other").on("change",function(){var b=a(this).find("option");b.each(function(b,c){var d=a(c).data("show-field"),e=a(c).data("show-fields"),f=a(c).data("hide-field"),g=a(c).data("hide-fields"),h=d?a("#"+d):"",i=f?a("#"+f):"";if(a(c).is(":selected")){if(h&&h.show(),i&&i.hide(),e){var j=g.split(",");a(j).each(function(b,c){a("#"+c).hide()})}if(g){var k=g.split(",");a(k).each(function(b,c){a("#"+c).hide()})}}})}).trigger("change"),a(".simcal-field-show-other").on("change",function(){var b=a(this).find("option");b.each(function(b,c){var d=a(c).data("show-field"),e="undefined"!=typeof d&&d.length?a("#"+d):"",f="undefined"!=typeof d&&d.length?e.next():"";e.length&&(a(c).is(":selected")?(e.show(),f.hasClass("select2")&&f.show()):(e.hide(),f.hasClass("select2")&&f.hide()))})}).trigger("change"),a(".simcal-field-show-next").on("change",function(){var b,c,d,e;a(this).is(":checkbox")?(d=a(this).parent().next(),a(this).is(":checked")?d.show():d.hide()):(b=a(this).val(),c=a(this).data("show-next-if-value"),d=a(this).nextUntil().not("i"),e=d.length?d.next():"",b==c?(d.show(),e.hasClass("select2")&&e.show()):(d.hide(),e.hasClass("select2")&&e.hide()))}).trigger("change"),a("#simcal-clear-cache").on("click",function(b){b.preventDefault();var c=a(this).find("i");a.ajax({url:simcal_admin.ajax_url,method:"POST",data:{action:"simcal_clear_cache",id:a(this).data("id")},beforeSend:function(){c.fadeToggle()},success:function(){c.fadeToggle()},error:function(a){console.log(a)}})}),a("#simcal-drip-signup").on("click",function(b){b.preventDefault();var c=a("#simcal-drip"),d=c.find(".signup"),e=c.find(".thank-you"),f=a("#simcal-drip-form"),g=c.find("#simcal-drip-field-first_name"),h=f.find("#simcal-drip-real-field-first_name"),i=c.find("#simcal-drip-field-email"),j=f.find("#simcal-drip-real-field-email");h.val(g.val()),j.val(i.val()),d.hide(),e.show(),f.submit()}),a("#_feed_type").on("change",function(b){if("grouped-calendars"===a(this).val())a("#use_calendar").remove();else{var c='<option id="use_calendar" value="use_calendar" data-show-field="_use_calendar_warning">Event source default</option>';a("#_feed_timezone_setting").append(c)}}),a(".simcal-addon-manage-license").on("click",function(b){b.preventDefault();var c="",d=a(this),e=d.closest(".simcal-addon-manage-license-buttons"),f=d.closest(".simcal-addon-manage-license-field").find("> input"),g=e.find(".error"),h=d.find("i");if(a(this).hasClass("activate"))c="activate_license";else{if(!a(this).hasClass("deactivate"))return;c="deactivate_license"}a.ajax({url:simcal_admin.ajax_url,method:"POST",data:{action:"simcal_manage_add_on_license",add_on:a(this).data("add-on"),license_key:f.val(),license_action:c,nonce:a("#simcal_license_manager").val()},beforeSend:function(){h.fadeToggle()},success:function(b){h.fadeToggle(),"activate_license"==c?"valid"==b.data?(d.hide(),f.attr("disabled","disabled"),a(e).find(".label").show(),a(e).find(".deactivate").show(),g.hide()):g.show().text(b.data):"deactivated"==b.data?(d.hide(),f.removeAttr("disabled"),a(e).find(".label").hide(),a(e).find(".activate").show(),g.hide()):g.show().text(b.data)},error:function(a){console.log(a),h.fadeToggle()}})}),a("#simcal-reset-licenses").on("click",function(b){b.preventDefault();var c=a(this).find("i"),d=a(this).data("dialog"),e=confirm(d);!0===e&&a.ajax({url:simcal_admin.ajax_url,method:"POST",data:{action:"simcal_reset_add_ons_licenses",nonce:a("#simcal_license_manager").val()},beforeSend:function(){c.toggle()},success:function(a){"success"==a.data?location.reload():console.log(a)},error:function(a){console.log(a)}})})})}(this);
assets/js/default-calendar.js CHANGED
@@ -235,7 +235,9 @@
235
  tooltips = $( cell ).find( '.simcal-tooltip' ),
236
  eventBubbles,
237
  content,
238
- last;
 
 
239
 
240
  // Mobile mode.
241
  if ( width < 60 ) {
@@ -249,8 +251,11 @@
249
  }
250
 
251
  eventBubbles.each( function( e, i ) {
 
 
 
252
  $( i ).qtip( {
253
- content : width < 60 ? $( cell ).find( 'ul.simcal-events' ) : $( i ).find( '> .simcal-tooltip-content' ),
254
  position: {
255
  my : 'top center',
256
  at : 'bottom center',
235
  tooltips = $( cell ).find( '.simcal-tooltip' ),
236
  eventBubbles,
237
  content,
238
+ last,
239
+ dotsContent,
240
+ regContent;
241
 
242
  // Mobile mode.
243
  if ( width < 60 ) {
251
  }
252
 
253
  eventBubbles.each( function( e, i ) {
254
+
255
+ dotsContent = '<ul class="simcal-events">' + $( cell ).find( 'ul.simcal-events').html() + '</ul></div>';
256
+ regContent = '<div class="simcal-event-details simcal-tooltip-content">' + $( i ).find( '> .simcal-tooltip-content').html() + '</div>';
257
  $( i ).qtip( {
258
+ content : width < 60 ? dotsContent : regContent,
259
  position: {
260
  my : 'top center',
261
  at : 'bottom center',
assets/js/default-calendar.min.js CHANGED
@@ -1,6 +1,6 @@
1
- /*! Simple Calendar - 3.0.14
2
  * https://simplecalendar.io
3
  * Copyright (c) Moonstone Media 2016
4
  * Licensed GPLv2+ */
5
 
6
- !function(a,b){"use strict";jQuery(function(b){function c(a){var c=b(a).find(".simcal-current"),d=b(a).find(".simcal-events-list-container"),e=d.data("heading-small"),f=d.data("heading-large");a.width()<400?c.html("<h3>"+e+"</h3>"):c.html("<h3>"+f+"</h3>")}function d(c){var d=b(c).find("> table"),e=d.find("thead"),f=e.find("th.simcal-week-day"),g=d.find("td.simcal-day > div"),h=d.find("ul.simcal-events"),i=h.find("> li > .simcal-event-title"),j=d.find(".simcal-events-toggle"),k=d.find("span.simcal-events-dots"),l=d.find(".simcal-tooltip-content"),m=d.find(".simcal-event-toggled"),n=d.data("event-bubble-trigger"),o=g.first().width();if(60>o){f.each(function(a,c){b(c).text(b(c).data("screen-small"))}),h.hide(),i.hide(),"undefined"!=j&&(j.hide(),"undefined"!=m&&m.show()),k.show();var p=o-10+"px";g.css("min-height",p),d.find("span.simcal-events-dots:not(:empty)").css("min-height",p)}else 240>=o?f.each(function(a,c){b(c).text(b(c).data("screen-medium"))}):f.each(function(a,c){b(c).text(b(c).data("screen-large"))}),h.show(),i.show(),"undefined"!=j&&(j.show(),"undefined"!=m&&m.hide()),k.hide(),g.css("min-height",o+"px");g.each(function(c,d){var e,f,g=b(d).find("span.simcal-events-dots"),h=b(d).find(".simcal-tooltip");60>o?(l.show(),e=g):(l.hide(),e=h),e.each(function(c,e){b(e).qtip({content:60>o?b(d).find("ul.simcal-events"):b(e).find("> .simcal-tooltip-content"),position:{my:"top center",at:"bottom center",target:b(e),viewport:60>o?b(a):!0,adjust:{method:"shift",scroll:!1}},style:{def:!1,classes:"simcal-default-calendar simcal-event-bubble"},show:{solo:!0,effect:!1,event:"hover"==n?"mouseenter":"click"},hide:{fixed:!0,effect:!1,event:"click"==n?"unfocus":"mouseleave",delay:100},events:{show:function(a,b){f&&f.id&&f.id!=b.id&&f.hide(),f=b}}})})})}function e(){b(".simcal-events-toggle").each(function(a,c){var d=b(c).prev(".simcal-events"),e=d.find(".simcal-event-toggled"),f=b(c).find("i");b(c).on("click",function(){f.toggleClass("simcal-icon-rotate-180"),e.slideToggle()})})}b(".simcal-default-calendar").each(function(a,f){var g,h,i=b(f),j=i.data("calendar-id"),k=i.data("offset"),l=(i.data("events-first"),i.data("calendar-end"),i.find(".simcal-calendar-head")),m=l.find(".simcal-nav-button"),n=i.find(".simcal-ajax-loader"),o=l.find(".simcal-current"),p=o.data("calendar-current"),q=o.find("span.simcal-current-month"),r=o.find("span.simcal-current-year"),s=new Date(1e3*(p+86400));i.hasClass("simcal-default-calendar-grid")?(h="simcal_default_calendar_draw_grid",g=new Date(s.getFullYear(),s.getMonth(),1)):(h="simcal_default_calendar_draw_list",c(i)),m.on("click",function(){var a=b(this).hasClass("simcal-next")?"next":"prev";if("simcal_default_calendar_draw_grid"==h){var f,l,m,p=i.find(".simcal-month");"prev"==a?f=new Date(g.setMonth(g.getMonth()-1,1)):(f=new Date(g.setMonth(g.getMonth()+2,1)),f.setDate(0),f.setHours(23),f.setMinutes(59),f.setSeconds(59)),l=f.getMonth(),m=f.getFullYear(),b.ajax({url:simcal_default_calendar.ajax_url,method:"POST",dataType:"json",cache:!1,data:{action:h,month:l+1,year:m,id:j},beforeSend:function(){n.fadeToggle()},success:function(a){q.text(simcal_default_calendar.months.full[l]),r.text(m),o.attr("data-calendar-current",f.getTime()/1e3+k+1),n.fadeToggle(),g=f,p.replaceWith(a.data),d(i,s),e()},error:function(a){console.log(a)}})}else{var s=i.find(".simcal-events-list-container"),t=s.data("prev"),u=s.data("next"),v="prev"==a?t:u;b.ajax({url:simcal_default_calendar.ajax_url,method:"POST",dataType:"json",cache:!1,data:{action:h,ts:v,id:j},beforeSend:function(){n.fadeToggle()},success:function(a){s.replaceWith(a.data),o.attr("data-calendar-current",v),c(i),n.fadeToggle(),e()},error:function(a){console.log(a)}})}})});var f=b(".simcal-default-calendar-grid");f.each(function(a,c){d(c),b(c).on("change",function(){d(this)})}),a.onresize=function(){f.each(function(a,b){d(b)})},e()})}(this);
1
+ /*! Simple Calendar - 3.0.15
2
  * https://simplecalendar.io
3
  * Copyright (c) Moonstone Media 2016
4
  * Licensed GPLv2+ */
5
 
6
+ !function(a,b){"use strict";jQuery(function(b){function c(a){var c=b(a).find(".simcal-current"),d=b(a).find(".simcal-events-list-container"),e=d.data("heading-small"),f=d.data("heading-large");a.width()<400?c.html("<h3>"+e+"</h3>"):c.html("<h3>"+f+"</h3>")}function d(c){var d=b(c).find("> table"),e=d.find("thead"),f=e.find("th.simcal-week-day"),g=d.find("td.simcal-day > div"),h=d.find("ul.simcal-events"),i=h.find("> li > .simcal-event-title"),j=d.find(".simcal-events-toggle"),k=d.find("span.simcal-events-dots"),l=d.find(".simcal-tooltip-content"),m=d.find(".simcal-event-toggled"),n=d.data("event-bubble-trigger"),o=g.first().width();if(60>o){f.each(function(a,c){b(c).text(b(c).data("screen-small"))}),h.hide(),i.hide(),"undefined"!=j&&(j.hide(),"undefined"!=m&&m.show()),k.show();var p=o-10+"px";g.css("min-height",p),d.find("span.simcal-events-dots:not(:empty)").css("min-height",p)}else 240>=o?f.each(function(a,c){b(c).text(b(c).data("screen-medium"))}):f.each(function(a,c){b(c).text(b(c).data("screen-large"))}),h.show(),i.show(),"undefined"!=j&&(j.show(),"undefined"!=m&&m.hide()),k.hide(),g.css("min-height",o+"px");g.each(function(c,d){var e,f,g,h,i=b(d).find("span.simcal-events-dots"),j=b(d).find(".simcal-tooltip");60>o?(l.show(),e=i):(l.hide(),e=j),e.each(function(c,e){g='<ul class="simcal-events">'+b(d).find("ul.simcal-events").html()+"</ul></div>",h='<div class="simcal-event-details simcal-tooltip-content">'+b(e).find("> .simcal-tooltip-content").html()+"</div>",b(e).qtip({content:60>o?g:h,position:{my:"top center",at:"bottom center",target:b(e),viewport:60>o?b(a):!0,adjust:{method:"shift",scroll:!1}},style:{def:!1,classes:"simcal-default-calendar simcal-event-bubble"},show:{solo:!0,effect:!1,event:"hover"==n?"mouseenter":"click"},hide:{fixed:!0,effect:!1,event:"click"==n?"unfocus":"mouseleave",delay:100},events:{show:function(a,b){f&&f.id&&f.id!=b.id&&f.hide(),f=b}}})})})}function e(){b(".simcal-events-toggle").each(function(a,c){var d=b(c).prev(".simcal-events"),e=d.find(".simcal-event-toggled"),f=b(c).find("i");b(c).on("click",function(){f.toggleClass("simcal-icon-rotate-180"),e.slideToggle()})})}b(".simcal-default-calendar").each(function(a,f){var g,h,i=b(f),j=i.data("calendar-id"),k=i.data("offset"),l=(i.data("events-first"),i.data("calendar-end"),i.find(".simcal-calendar-head")),m=l.find(".simcal-nav-button"),n=i.find(".simcal-ajax-loader"),o=l.find(".simcal-current"),p=o.data("calendar-current"),q=o.find("span.simcal-current-month"),r=o.find("span.simcal-current-year"),s=new Date(1e3*(p+86400));i.hasClass("simcal-default-calendar-grid")?(h="simcal_default_calendar_draw_grid",g=new Date(s.getFullYear(),s.getMonth(),1)):(h="simcal_default_calendar_draw_list",c(i)),m.on("click",function(){var a=b(this).hasClass("simcal-next")?"next":"prev";if("simcal_default_calendar_draw_grid"==h){var f,l,m,p=i.find(".simcal-month");"prev"==a?f=new Date(g.setMonth(g.getMonth()-1,1)):(f=new Date(g.setMonth(g.getMonth()+2,1)),f.setDate(0),f.setHours(23),f.setMinutes(59),f.setSeconds(59)),l=f.getMonth(),m=f.getFullYear(),b.ajax({url:simcal_default_calendar.ajax_url,method:"POST",dataType:"json",cache:!1,data:{action:h,month:l+1,year:m,id:j},beforeSend:function(){n.fadeToggle()},success:function(a){q.text(simcal_default_calendar.months.full[l]),r.text(m),o.attr("data-calendar-current",f.getTime()/1e3+k+1),n.fadeToggle(),g=f,p.replaceWith(a.data),d(i,s),e()},error:function(a){console.log(a)}})}else{var s=i.find(".simcal-events-list-container"),t=s.data("prev"),u=s.data("next"),v="prev"==a?t:u;b.ajax({url:simcal_default_calendar.ajax_url,method:"POST",dataType:"json",cache:!1,data:{action:h,ts:v,id:j},beforeSend:function(){n.fadeToggle()},success:function(a){s.replaceWith(a.data),o.attr("data-calendar-current",v),c(i),n.fadeToggle(),e()},error:function(a){console.log(a)}})}})});var f=b(".simcal-default-calendar-grid");f.each(function(a,c){d(c),b(c).on("change",function(){d(this)})}),a.onresize=function(){f.each(function(a,b){d(b)})},e()})}(this);
assets/js/vendor/select2.js CHANGED
@@ -1,5 +1,5 @@
1
  /*!
2
- * Select2 4.0.1
3
  * https://select2.github.io
4
  *
5
  * Released under the MIT license
@@ -1142,11 +1142,7 @@ S2.define('select2/results',[
1142
  this.$results.on('mousewheel', function (e) {
1143
  var top = self.$results.scrollTop();
1144
 
1145
- var bottom = (
1146
- self.$results.get(0).scrollHeight -
1147
- self.$results.scrollTop() +
1148
- e.deltaY
1149
- );
1150
 
1151
  var isAtTop = e.deltaY > 0 && top - e.deltaY <= 0;
1152
  var isAtBottom = e.deltaY < 0 && bottom <= self.$results.height();
@@ -3332,7 +3328,7 @@ S2.define('select2/data/array',[
3332
  var $existingOption = $existing.filter(onlyItem(item));
3333
 
3334
  var existingData = this.item($existingOption);
3335
- var newData = $.extend(true, {}, existingData, item);
3336
 
3337
  var $newOption = this.option(newData);
3338
 
@@ -3440,7 +3436,9 @@ S2.define('select2/data/ajax',[
3440
 
3441
  callback(results);
3442
  }, function () {
3443
- // TODO: Handle AJAX errors
 
 
3444
  });
3445
 
3446
  self._request = $request;
@@ -3472,6 +3470,12 @@ S2.define('select2/data/tags',[
3472
  this.createTag = createTag;
3473
  }
3474
 
 
 
 
 
 
 
3475
  decorated.call(this, $element, options);
3476
 
3477
  if ($.isArray(tags)) {
@@ -4171,7 +4175,6 @@ S2.define('select2/dropdown/attachBody',[
4171
 
4172
  var newDirection = null;
4173
 
4174
- var position = this.$container.position();
4175
  var offset = this.$container.offset();
4176
 
4177
  offset.bottom = offset.top + this.$container.outerHeight(false);
@@ -4200,14 +4203,20 @@ S2.define('select2/dropdown/attachBody',[
4200
  top: container.bottom
4201
  };
4202
 
4203
- // Fix positioning with static parents
4204
- if (this.$dropdownParent[0].style.position !== 'static') {
4205
- var parentOffset = this.$dropdownParent.offset();
4206
 
4207
- css.top -= parentOffset.top;
4208
- css.left -= parentOffset.left;
 
 
4209
  }
4210
 
 
 
 
 
 
4211
  if (!isCurrentlyAbove && !isCurrentlyBelow) {
4212
  newDirection = 'below';
4213
  }
@@ -4474,7 +4483,7 @@ S2.define('select2/defaults',[
4474
  }
4475
 
4476
  Defaults.prototype.apply = function (options) {
4477
- options = $.extend({}, this.defaults, options);
4478
 
4479
  if (options.dataAdapter == null) {
4480
  if (options.ajax != null) {
@@ -5038,6 +5047,7 @@ S2.define('select2/core',[
5038
  id = Utils.generateChars(4);
5039
  }
5040
 
 
5041
  id = 'select2-' + id;
5042
 
5043
  return id;
1
  /*!
2
+ * Select2 4.0.2
3
  * https://select2.github.io
4
  *
5
  * Released under the MIT license
1142
  this.$results.on('mousewheel', function (e) {
1143
  var top = self.$results.scrollTop();
1144
 
1145
+ var bottom = self.$results.get(0).scrollHeight - top + e.deltaY;
 
 
 
 
1146
 
1147
  var isAtTop = e.deltaY > 0 && top - e.deltaY <= 0;
1148
  var isAtBottom = e.deltaY < 0 && bottom <= self.$results.height();
3328
  var $existingOption = $existing.filter(onlyItem(item));
3329
 
3330
  var existingData = this.item($existingOption);
3331
+ var newData = $.extend(true, {}, item, existingData);
3332
 
3333
  var $newOption = this.option(newData);
3334
 
3436
 
3437
  callback(results);
3438
  }, function () {
3439
+ self.trigger('results:message', {
3440
+ message: 'errorLoading'
3441
+ });
3442
  });
3443
 
3444
  self._request = $request;
3470
  this.createTag = createTag;
3471
  }
3472
 
3473
+ var insertTag = options.get('insertTag');
3474
+
3475
+ if (insertTag !== undefined) {
3476
+ this.insertTag = insertTag;
3477
+ }
3478
+
3479
  decorated.call(this, $element, options);
3480
 
3481
  if ($.isArray(tags)) {
4175
 
4176
  var newDirection = null;
4177
 
 
4178
  var offset = this.$container.offset();
4179
 
4180
  offset.bottom = offset.top + this.$container.outerHeight(false);
4203
  top: container.bottom
4204
  };
4205
 
4206
+ // Determine what the parent element is to use for calciulating the offset
4207
+ var $offsetParent = this.$dropdownParent;
 
4208
 
4209
+ // For statically positoned elements, we need to get the element
4210
+ // that is determining the offset
4211
+ if ($offsetParent.css('position') === 'static') {
4212
+ $offsetParent = $offsetParent.offsetParent();
4213
  }
4214
 
4215
+ var parentOffset = $offsetParent.offset();
4216
+
4217
+ css.top -= parentOffset.top;
4218
+ css.left -= parentOffset.left;
4219
+
4220
  if (!isCurrentlyAbove && !isCurrentlyBelow) {
4221
  newDirection = 'below';
4222
  }
4483
  }
4484
 
4485
  Defaults.prototype.apply = function (options) {
4486
+ options = $.extend(true, {}, this.defaults, options);
4487
 
4488
  if (options.dataAdapter == null) {
4489
  if (options.ajax != null) {
5047
  id = Utils.generateChars(4);
5048
  }
5049
 
5050
+ id = id.replace(/(:|\.|\[|\]|,)/g, '');
5051
  id = 'select2-' + id;
5052
 
5053
  return id;
assets/js/vendor/select2.min.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! Select2 4.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return u.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=b&&b.split("/"),o=s.map,p=o&&o["*"]||{};if(a&&"."===a.charAt(0))if(b){for(a=a.split("/"),g=a.length-1,s.nodeIdCompat&&w.test(a[g])&&(a[g]=a[g].replace(w,"")),a=n.slice(0,n.length-1).concat(a),k=0;k<a.length;k+=1)if(m=a[k],"."===m)a.splice(k,1),k-=1;else if(".."===m){if(1===k&&(".."===a[2]||".."===a[0]))break;k>0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((n||p)&&o){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),n)for(l=n.length;l>0;l-=1)if(e=o[n.slice(0,l).join("/")],e&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&p&&p[d]&&(i=p[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=v.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),n.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){q[a]=b}}function j(a){if(e(r,a)){var c=r[a];delete r[a],t[a]=!0,m.apply(b,c)}if(!e(q,a)&&!e(t,a))throw new Error("No "+a);return q[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return function(){return s&&s.config&&s.config[a]||{}}}var m,n,o,p,q={},r={},s={},t={},u=Object.prototype.hasOwnProperty,v=[].slice,w=/\.js$/;o=function(a,b){var c,d=k(a),e=d[0];return a=d[1],e&&(e=f(e,b),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(b)):f(a,b):(a=f(a,b),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},p={require:function(a){return g(a)},exports:function(a){var b=q[a];return"undefined"!=typeof b?b:q[a]={}},module:function(a){return{id:a,uri:"",exports:q[a],config:l(a)}}},m=function(a,c,d,f){var h,k,l,m,n,s,u=[],v=typeof d;if(f=f||a,"undefined"===v||"function"===v){for(c=!c.length&&d.length?["require","exports","module"]:c,n=0;n<c.length;n+=1)if(m=o(c[n],f),k=m.f,"require"===k)u[n]=p.require(a);else if("exports"===k)u[n]=p.exports(a),s=!0;else if("module"===k)h=u[n]=p.module(a);else if(e(q,k)||e(r,k)||e(t,k))u[n]=j(k);else{if(!m.p)throw new Error(a+" missing "+k);m.p.load(m.n,g(f,!0),i(k),{}),u[n]=q[k]}l=d?d.apply(q[a],u):void 0,a&&(h&&h.exports!==b&&h.exports!==q[a]?q[a]=h.exports:l===b&&s||(q[a]=l))}else a&&(q[a]=d)},a=c=n=function(a,c,d,e,f){if("string"==typeof a)return p[a]?p[a](c):j(o(a,c).f);if(!a.splice){if(s=a,s.deps&&n(s.deps,s.callback),!c)return;c.splice?(a=c,c=d,d=null):a=b}return c=c||function(){},"function"==typeof d&&(d=e,e=f),e?m(b,a,c,d):setTimeout(function(){m(b,a,c,d)},4),n},n.config=function(a){return n(a)},a._defined=q,d=function(a,b,c){if("string"!=typeof a)throw new Error("See almond README: incorrect module build, no module name");b.splice||(c=b,b=[]),e(q,a)||e(r,a)||(r[a]=[a,b,c])},d.amd={jQuery:!0}}(),b.requirejs=a,b.require=c,b.define=d}}(),b.define("almond",function(){}),b.define("jquery",[],function(){var b=a||$;return null==b&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),b}),b.define("select2/utils",["jquery"],function(a){function b(a){var b=a.prototype,c=[];for(var d in b){var e=b[d];"function"==typeof e&&"constructor"!==d&&c.push(d)}return c}var c={};c.Extend=function(a,b){function c(){this.constructor=a}var d={}.hasOwnProperty;for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},c.Decorate=function(a,c){function d(){var b=Array.prototype.unshift,d=c.prototype.constructor.length,e=a.prototype.constructor;d>0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h<g.length;h++){var i=g[h];d.prototype[i]=a.prototype[i]}for(var j=(function(a){var b=function(){};a in d.prototype&&(b=d.prototype[a]);var e=c.prototype[a];return function(){var a=Array.prototype.unshift;return a.call(arguments,b),e.apply(this,arguments)}}),k=0;k<f.length;k++){var l=f[k];d.prototype[l]=j(l)}return d};var d=function(){this.listeners={}};return d.prototype.on=function(a,b){this.listeners=this.listeners||{},a in this.listeners?this.listeners[a].push(b):this.listeners[a]=[b]},d.prototype.trigger=function(a){var b=Array.prototype.slice;this.listeners=this.listeners||{},a in this.listeners&&this.invoke(this.listeners[a],b.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},d.prototype.invoke=function(a,b){for(var c=0,d=a.length;d>c;c++)a[c].apply(this,b)},c.Observable=d,c.generateChars=function(a){for(var b="",c=0;a>c;c++){var d=Math.floor(36*Math.random());b+=d.toString(36)}return b},c.bind=function(a,b){return function(){a.apply(b,arguments)}},c._convertData=function(a){for(var b in a){var c=b.split("-"),d=a;if(1!==c.length){for(var e=0;e<c.length;e++){var f=c[e];f=f.substring(0,1).toLowerCase()+f.substring(1),f in d||(d[f]={}),e==c.length-1&&(d[f]=a[b]),d=d[f]}delete a[b]}}return a},c.hasScroll=function(b,c){var d=a(c),e=c.style.overflowX,f=c.style.overflowY;return e!==f||"hidden"!==f&&"visible"!==f?"scroll"===e||"scroll"===f?!0:d.innerHeight()<c.scrollHeight||d.innerWidth()<c.scrollWidth:!1},c.escapeMarkup=function(a){var b={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<ul class="select2-results__options" role="tree"></ul>');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a('<li role="treeitem" aria-live="assertive" class="select2-results__option"></li>'),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c<a.results.length;c++){var d=a.results[c],e=this.option(d);b.push(e)}this.$results.append(b)},c.prototype.position=function(a,b){var c=b.find(".select2-results");c.append(a)},c.prototype.sort=function(a){var b=this.options.get("sorter");return b(a)},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()}),e=b.$results.find(".select2-results__option[aria-selected]");e.each(function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("aria-selected","true"):b.attr("aria-selected","false")});var f=e.filter("[aria-selected=true]");f.length>0?f.first().trigger("mouseenter"):e.first().trigger("mouseenter")})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"treeitem","aria-selected":"false"};b.disabled&&(delete d["aria-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["aria-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d.role="group",d["aria-label"]=b.text,delete d["aria-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";a(h);this.template(b,h);for(var i=[],j=0;j<b.children.length;j++){var k=b.children[j],l=this.option(k);i.push(l)}var m=a("<ul></ul>",{"class":"select2-results__options select2-results__options--nested"});m.append(i),g.append(h),g.append(m)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("results:append",function(a){d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("query",function(a){d.hideMessages(),d.showLoading(a)}),b.on("select",function(){b.isOpen()&&d.setClasses()}),b.on("unselect",function(){b.isOpen()&&d.setClasses()}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("aria-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):0>h-g&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted")}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-d.$results.scrollTop()+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(b){var c=a(this),e=c.data("data");return"true"===c.attr("aria-selected")?void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{})):void d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){var a=this.$results.find(".select2-results__option--highlighted");return a},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[aria-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),2>=c?this.$results.scrollTop(0):(g>this.$results.outerHeight()||0>g)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){var a={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46};return a}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a('<span class="select2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id+"-container",a.id+"-results");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),d.$selection.focus(),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2"),e=a(".select2.select2-container--open");e.each(function(){var b=a(this);if(this!=d[0]){var c=b.data("element");c.select2("close")}})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){var c=b.find(".selection");c.append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d),this.$selection.attr("aria-labelledby",d),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("blur",function(a){}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection"),d=this.options.get("escapeMarkup");return d(c(a,b))},e.prototype.selectionContainer=function(){return a("<span></span>")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.prop("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('<ul class="select2-selection__rendered"></ul>'),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection"),d=this.options.get("escapeMarkup");return d(c(a,b))},d.prototype.selectionContainer=function(){var b=a('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">&times;</span></li>');return b},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d<a.length;d++){var e=a[d],f=this.selectionContainer(),g=this.display(e,f);f.append(g),f.prop("title",e.title||e.text),f.data("data",e),b.push(f)}var h=this.$selection.find(".select2-selection__rendered");c.appendMany(h,b)}},d}),b.define("select2/selection/placeholder",["../utils"],function(a){function b(a,b,c){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c)}return b.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},b.prototype.createPlaceholder=function(a,b){var c=this.selectionContainer();return c.html(this.display(b)),c.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),c},b.prototype.update=function(a,b){var c=1==b.length&&b[0].id!=this.placeholder.id,d=b.length>1;if(d||c)return a.call(this,b);this.clear();var e=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(e)},b}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e<d.length;e++){var f={data:d[e]};if(this.trigger("unselect",f),f.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle",{})}}},c.prototype._handleKeyboardClear=function(a,c,d){d.isOpen()||(c.which==b.DELETE||c.which==b.BACKSPACE)&&this._handleClear(c)},c.prototype.update=function(b,c){if(b.call(this,c),!(this.$selection.find(".select2-selection__placeholder").length>0||0===c.length)){var d=a('<span class="select2-selection__clear">&times;</span>');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this;a.call(this,b,d),b.on("open",function(){e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.id)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented();var b=a.which;if(b===c.BACKSPACE&&""===e.$search.val()){var d=e.$searchContainer.prev(".select2-selection__choice");if(d.length>0){var f=d.data("data");e.searchRemoveChoice(f),a.preventDefault()}}});var f=document.documentMode,g=f&&11>=f;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){return g?void e.$selection.off("input.search input.searchcheck"):void e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(g&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{var b=this.$search.val().length+1;a=.75*b+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){var a={"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"};return a}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),d+=null!=c.id?"-"+c.id.toString():"-"+a.generateChars(4)},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f<a.length;f++){var g=a[f].id;-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")});else{var d=a.id;this.$element.val(d),this.$element.trigger("change")}},d.prototype.unselect=function(a){
2
- var b=this;if(this.$element.prop("multiple"))return a.selected=!1,c(a.element).is("option")?(a.element.selected=!1,void this.$element.trigger("change")):void this.current(function(d){for(var e=[],f=0;f<d.length;f++){var g=d[f].id;g!==a.id&&-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")})},d.prototype.bind=function(a,b){var c=this;this.container=a,a.on("select",function(a){c.select(a.data)}),a.on("unselect",function(a){c.unselect(a.data)})},d.prototype.destroy=function(){this.$element.find("*").each(function(){c.removeData(this,"data")})},d.prototype.query=function(a,b){var d=[],e=this,f=this.$element.children();f.each(function(){var b=c(this);if(b.is("option")||b.is("optgroup")){var f=e.item(b),g=e.matches(a,f);null!==g&&d.push(g)}}),b({results:d})},d.prototype.addOptions=function(a){b.appendMany(this.$element,a)},d.prototype.option=function(a){var b;a.children?(b=document.createElement("optgroup"),b.label=a.text):(b=document.createElement("option"),void 0!==b.textContent?b.textContent=a.text:b.innerText=a.text),a.id&&(b.value=a.id),a.disabled&&(b.disabled=!0),a.selected&&(b.selected=!0),a.title&&(b.title=a.title);var d=c(b),e=this._normalizeItem(a);return e.element=b,c.data(b,"data",e),d},d.prototype.item=function(a){var b={};if(b=c.data(a[0],"data"),null!=b)return b;if(a.is("option"))b={id:a.val(),text:a.text(),disabled:a.prop("disabled"),selected:a.prop("selected"),title:a.prop("title")};else if(a.is("optgroup")){b={text:a.prop("label"),children:[],title:a.prop("title")};for(var d=a.children("option"),e=[],f=0;f<d.length;f++){var g=c(d[f]),h=this.item(g);e.push(h)}b.children=e}return b=this._normalizeItem(b),b.element=a[0],c.data(a[0],"data",b),b},d.prototype._normalizeItem=function(a){c.isPlainObject(a)||(a={id:a,text:a}),a=c.extend({},{text:""},a);var b={selected:!1,disabled:!1};return null!=a.id&&(a.id=a.id.toString()),null!=a.text&&(a.text=a.text.toString()),null==a._resultId&&a.id&&null!=this.container&&(a._resultId=this.generateResultId(this.container,a)),c.extend({},b,a)},d.prototype.matches=function(a,b){var c=this.options.get("matcher");return c(a,b)},d}),b.define("select2/data/array",["./select","../utils","jquery"],function(a,b,c){function d(a,b){var c=b.get("data")||[];d.__super__.constructor.call(this,a,b),this.addOptions(this.convertToOptions(c))}return b.Extend(d,a),d.prototype.select=function(a){var b=this.$element.find("option").filter(function(b,c){return c.value==a.id.toString()});0===b.length&&(b=this.option(a),this.addOptions(b)),d.__super__.select.call(this,a)},d.prototype.convertToOptions=function(a){function d(a){return function(){return c(this).val()==a.id}}for(var e=this,f=this.$element.find("option"),g=f.map(function(){return e.item(c(this)).id}).get(),h=[],i=0;i<a.length;i++){var j=this._normalizeItem(a[i]);if(c.inArray(j.id,g)>=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},l,j),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f)},function(){});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&""!==a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");if(void 0!==f&&(this.createTag=f),b.call(this,c,d),a.isArray(e))for(var g=0;g<e.length;g++){var h=e[g],i=this._normalizeItem(h),j=this.option(i);this.$element.append(j)}}return b.prototype.query=function(a,b,c){function d(a,f){for(var g=a.results,h=0;h<g.length;h++){var i=g[h],j=null!=i.children&&!d({results:i.children},!0),k=i.text===b.term;if(k||j)return f?!1:(a.data=g,void c(a))}if(f)return!0;var l=e.createTag(b);if(null!=l){var m=e.option(l);m.attr("data-select2-tag",!0),e.addOptions([m]),e.insertTag(g,l)}a.results=g,c(a)}var e=this;return this._removeOldTags(),null==b.term||null!=b.page?void a.call(this,b,c):void a.call(this,b,d)},b.prototype.createTag=function(b,c){var d=a.trim(c.term);return""===d?null:{id:d,text:d}},b.prototype.insertTag=function(a,b,c){b.unshift(c)},b.prototype._removeOldTags=function(b){var c=(this._lastTag,this.$element.find("option[data-select2-tag]"));c.each(function(){this.selected||a(this).remove()})},b}),b.define("select2/data/tokenizer",["jquery"],function(a){function b(a,b,c){var d=c.get("tokenizer");void 0!==d&&(this.tokenizer=d),a.call(this,b,c)}return b.prototype.bind=function(a,b,c){a.call(this,b,c),this.$search=b.dropdown.$search||b.selection.$search||c.find(".select2-search__field")},b.prototype.query=function(a,b,c){function d(a){e.trigger("select",{data:a})}var e=this;b.term=b.term||"";var f=this.tokenizer(b,this.options,d);f.term!==b.term&&(this.$search.length&&(this.$search.val(f.term),this.$search.focus()),b.term=f.term),a.call(this,b,c)},b.prototype.tokenizer=function(b,c,d,e){for(var f=d.get("tokenSeparators")||[],g=c.term,h=0,i=this.createTag||function(a){return{id:a.term,text:a.term}};h<g.length;){var j=g[h];if(-1!==a.inArray(j,f)){var k=g.substr(0,h),l=a.extend({},c,{term:k}),m=i(l);null!=m?(e(m),g=g.substr(h+1)||"",h=0):h++}else h++}return{term:g}},b}),b.define("select2/data/minimumInputLength",[],function(){function a(a,b,c){this.minimumInputLength=c.get("minimumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){return b.term=b.term||"",b.term.length<this.minimumInputLength?void this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:b.term,params:b}}):void a.call(this,b,c)},a}),b.define("select2/data/maximumInputLength",[],function(){function a(a,b,c){this.maximumInputLength=c.get("maximumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){return b.term=b.term||"",this.maximumInputLength>0&&b.term.length>this.maximumInputLength?void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}}):void a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;return d.maximumSelectionLength>0&&f>=d.maximumSelectionLength?void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}}):void a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<span class="select2-dropdown"><span class="select2-results"></span></span>');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" /></span>');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val("")}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){var b=e.showSearch(a);b?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){var c=e.$results.offset().top+e.$results.outerHeight(!1),d=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1);c+50>=d&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('<li class="select2-results__option select2-results__option--load-more"role="treeitem" aria-disabled="true"></li>'),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a("<span></span>"),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id,h=this.$container.parents().filter(b.hasScroll);h.off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=(this.$container.position(),this.$container.offset());f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.top<f.top-h.height,k=i.bottom>f.bottom+h.height,l={left:f.left,top:g.bottom};if("static"!==this.$dropdownParent[0].style.position){var m=this.$dropdownParent.offset();l.top-=m.top,l.left-=m.left}c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d<b.length;d++){var e=b[d];e.children?c+=a(e.children):c++}return c}function b(a,b,c,d){this.minimumResultsForSearch=c.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),a.call(this,b,c,d)}return b.prototype.showSearch=function(b,c){return a(c.data.results)<this.minimumResultsForSearch?!1:b.call(this,c)},b}),b.define("select2/dropdown/selectOnClose",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("close",function(){d._handleSelectOnClose()})},a.prototype._handleSelectOnClose=function(){var a=this.getHighlightedResults();if(!(a.length<1)){var b=a.data("data");null!=b.element&&b.element.selected||null==b.element&&b.selected||this.trigger("select",{data:b})}},a}),b.define("select2/dropdown/closeOnSelect",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("select",function(a){d._selectTriggered(a)}),b.on("unselect",function(a){d._selectTriggered(a)})},a.prototype._selectTriggered=function(a,b){var c=b.originalEvent;c&&c.ctrlKey||this.trigger("close",{})},a}),b.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(a){var b=a.input.length-a.maximum,c="Please delete "+b+" character";return 1!=b&&(c+="s"),c},inputTooShort:function(a){var b=a.minimum-a.input.length,c="Please enter "+b+" or more characters";return c},loadingMore:function(){return"Loading more results…"},maximumSelected:function(a){var b="You can only select "+a.maximum+" item";return 1!=a.maximum&&(b+="s"),b},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),b.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C){function D(){this.reset()}D.prototype.apply=function(l){if(l=a.extend({},this.defaults,l),null==l.dataAdapter){if(null!=l.ajax?l.dataAdapter=o:null!=l.data?l.dataAdapter=n:l.dataAdapter=m,l.minimumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),(null!=l.tokenSeparators||null!=l.tokenizer)&&(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L<K.length;L++){var M=K[L],N={};try{N=k.loadPath(M)}catch(O){try{M=this.defaults.amdLanguageBase+M,N=k.loadPath(M)}catch(P){l.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+M+'" could not be automatically loaded. A fallback will be used instead.');continue}}J.extend(N)}l.translations=J}else{var Q=k.loadPath(this.defaults.amdLanguageBase+"en"),R=new k(l.language);R.extend(Q),l.translations=R}return l},D.prototype.reset=function(){function b(a){function b(a){return l[a]||a}return a.replace(/[^\u0000-\u007E]/g,b)}function c(d,e){if(""===a.trim(d.term))return e;if(e.children&&e.children.length>0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){var h=e.children[g],i=c(d,h);null==i&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var j=b(e.text).toUpperCase(),k=b(d.term).toUpperCase();return j.indexOf(k)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)};var E=new D;return E}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return 0>=e?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;i>h;h+=1){var j=g[h].replace(/\s/g,""),k=j.match(c);if(null!==k&&k.length>=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this._sync=c.bind(this._syncAttributes,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._sync);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._sync)}),this._observer.observe(this.$element[0],{attributes:!0,subtree:!1})):this.$element[0].addEventListener&&this.$element[0].addEventListener("DOMAttrModified",b._sync,!1)},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var a=this;this.on("open",function(){a.$container.addClass("select2-container--open")}),this.on("close",function(){a.$container.removeClass("select2-container--open")}),this.on("enable",function(){a.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){a.$container.addClass("select2-container--disabled")}),this.on("blur",function(){a.$container.removeClass("select2-container--focus")}),this.on("query",function(b){a.isOpen()||a.trigger("open",{}),this.dataAdapter.query(b,function(c){a.trigger("results:all",{data:c,query:b})})}),this.on("query:append",function(b){this.dataAdapter.query(b,function(c){a.trigger("results:append",{data:c,query:b})})}),this.on("keypress",function(b){var c=b.which;a.isOpen()?c===d.ESC||c===d.TAB||c===d.UP&&b.altKey?(a.close(),b.preventDefault()):c===d.ENTER?(a.trigger("results:select",{}),b.preventDefault()):c===d.SPACE&&b.ctrlKey?(a.trigger("results:toggle",{}),b.preventDefault()):c===d.UP?(a.trigger("results:previous",{}),b.preventDefault()):c===d.DOWN&&(a.trigger("results:next",{}),b.preventDefault()):(c===d.ENTER||c===d.SPACE||c===d.DOWN&&b.altKey)&&(a.open(),b.preventDefault())})},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),(null==a||0===a.length)&&(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._sync),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&this.$element[0].removeEventListener("DOMAttrModified",this._sync,!1),this._sync=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("jquery-mousewheel",["jquery"],function(a){return a}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(a,b,c,d){if(null==a.fn.select2){var e=["open","close","destroy"];a.fn.select2=function(b){if(b=b||{},"object"==typeof b)return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d;return this.each(function(){var c=a(this).data("select2");null==c&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2.");var e=Array.prototype.slice.call(arguments,1);d=c[b].apply(c,e)}),a.inArray(b,e)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null==a.fn.select2.defaults&&(a.fn.select2.defaults=d),c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,c});
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return u.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=b&&b.split("/"),o=s.map,p=o&&o["*"]||{};if(a&&"."===a.charAt(0))if(b){for(a=a.split("/"),g=a.length-1,s.nodeIdCompat&&w.test(a[g])&&(a[g]=a[g].replace(w,"")),a=n.slice(0,n.length-1).concat(a),k=0;k<a.length;k+=1)if(m=a[k],"."===m)a.splice(k,1),k-=1;else if(".."===m){if(1===k&&(".."===a[2]||".."===a[0]))break;k>0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((n||p)&&o){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),n)for(l=n.length;l>0;l-=1)if(e=o[n.slice(0,l).join("/")],e&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&p&&p[d]&&(i=p[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=v.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),n.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){q[a]=b}}function j(a){if(e(r,a)){var c=r[a];delete r[a],t[a]=!0,m.apply(b,c)}if(!e(q,a)&&!e(t,a))throw new Error("No "+a);return q[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return function(){return s&&s.config&&s.config[a]||{}}}var m,n,o,p,q={},r={},s={},t={},u=Object.prototype.hasOwnProperty,v=[].slice,w=/\.js$/;o=function(a,b){var c,d=k(a),e=d[0];return a=d[1],e&&(e=f(e,b),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(b)):f(a,b):(a=f(a,b),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},p={require:function(a){return g(a)},exports:function(a){var b=q[a];return"undefined"!=typeof b?b:q[a]={}},module:function(a){return{id:a,uri:"",exports:q[a],config:l(a)}}},m=function(a,c,d,f){var h,k,l,m,n,s,u=[],v=typeof d;if(f=f||a,"undefined"===v||"function"===v){for(c=!c.length&&d.length?["require","exports","module"]:c,n=0;n<c.length;n+=1)if(m=o(c[n],f),k=m.f,"require"===k)u[n]=p.require(a);else if("exports"===k)u[n]=p.exports(a),s=!0;else if("module"===k)h=u[n]=p.module(a);else if(e(q,k)||e(r,k)||e(t,k))u[n]=j(k);else{if(!m.p)throw new Error(a+" missing "+k);m.p.load(m.n,g(f,!0),i(k),{}),u[n]=q[k]}l=d?d.apply(q[a],u):void 0,a&&(h&&h.exports!==b&&h.exports!==q[a]?q[a]=h.exports:l===b&&s||(q[a]=l))}else a&&(q[a]=d)},a=c=n=function(a,c,d,e,f){if("string"==typeof a)return p[a]?p[a](c):j(o(a,c).f);if(!a.splice){if(s=a,s.deps&&n(s.deps,s.callback),!c)return;c.splice?(a=c,c=d,d=null):a=b}return c=c||function(){},"function"==typeof d&&(d=e,e=f),e?m(b,a,c,d):setTimeout(function(){m(b,a,c,d)},4),n},n.config=function(a){return n(a)},a._defined=q,d=function(a,b,c){if("string"!=typeof a)throw new Error("See almond README: incorrect module build, no module name");b.splice||(c=b,b=[]),e(q,a)||e(r,a)||(r[a]=[a,b,c])},d.amd={jQuery:!0}}(),b.requirejs=a,b.require=c,b.define=d}}(),b.define("almond",function(){}),b.define("jquery",[],function(){var b=a||$;return null==b&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),b}),b.define("select2/utils",["jquery"],function(a){function b(a){var b=a.prototype,c=[];for(var d in b){var e=b[d];"function"==typeof e&&"constructor"!==d&&c.push(d)}return c}var c={};c.Extend=function(a,b){function c(){this.constructor=a}var d={}.hasOwnProperty;for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},c.Decorate=function(a,c){function d(){var b=Array.prototype.unshift,d=c.prototype.constructor.length,e=a.prototype.constructor;d>0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h<g.length;h++){var i=g[h];d.prototype[i]=a.prototype[i]}for(var j=(function(a){var b=function(){};a in d.prototype&&(b=d.prototype[a]);var e=c.prototype[a];return function(){var a=Array.prototype.unshift;return a.call(arguments,b),e.apply(this,arguments)}}),k=0;k<f.length;k++){var l=f[k];d.prototype[l]=j(l)}return d};var d=function(){this.listeners={}};return d.prototype.on=function(a,b){this.listeners=this.listeners||{},a in this.listeners?this.listeners[a].push(b):this.listeners[a]=[b]},d.prototype.trigger=function(a){var b=Array.prototype.slice;this.listeners=this.listeners||{},a in this.listeners&&this.invoke(this.listeners[a],b.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},d.prototype.invoke=function(a,b){for(var c=0,d=a.length;d>c;c++)a[c].apply(this,b)},c.Observable=d,c.generateChars=function(a){for(var b="",c=0;a>c;c++){var d=Math.floor(36*Math.random());b+=d.toString(36)}return b},c.bind=function(a,b){return function(){a.apply(b,arguments)}},c._convertData=function(a){for(var b in a){var c=b.split("-"),d=a;if(1!==c.length){for(var e=0;e<c.length;e++){var f=c[e];f=f.substring(0,1).toLowerCase()+f.substring(1),f in d||(d[f]={}),e==c.length-1&&(d[f]=a[b]),d=d[f]}delete a[b]}}return a},c.hasScroll=function(b,c){var d=a(c),e=c.style.overflowX,f=c.style.overflowY;return e!==f||"hidden"!==f&&"visible"!==f?"scroll"===e||"scroll"===f?!0:d.innerHeight()<c.scrollHeight||d.innerWidth()<c.scrollWidth:!1},c.escapeMarkup=function(a){var b={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<ul class="select2-results__options" role="tree"></ul>');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a('<li role="treeitem" aria-live="assertive" class="select2-results__option"></li>'),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c<a.results.length;c++){var d=a.results[c],e=this.option(d);b.push(e)}this.$results.append(b)},c.prototype.position=function(a,b){var c=b.find(".select2-results");c.append(a)},c.prototype.sort=function(a){var b=this.options.get("sorter");return b(a)},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()}),e=b.$results.find(".select2-results__option[aria-selected]");e.each(function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("aria-selected","true"):b.attr("aria-selected","false")});var f=e.filter("[aria-selected=true]");f.length>0?f.first().trigger("mouseenter"):e.first().trigger("mouseenter")})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"treeitem","aria-selected":"false"};b.disabled&&(delete d["aria-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["aria-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d.role="group",d["aria-label"]=b.text,delete d["aria-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";a(h);this.template(b,h);for(var i=[],j=0;j<b.children.length;j++){var k=b.children[j],l=this.option(k);i.push(l)}var m=a("<ul></ul>",{"class":"select2-results__options select2-results__options--nested"});m.append(i),g.append(h),g.append(m)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("results:append",function(a){d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("query",function(a){d.hideMessages(),d.showLoading(a)}),b.on("select",function(){b.isOpen()&&d.setClasses()}),b.on("unselect",function(){b.isOpen()&&d.setClasses()}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("aria-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):0>h-g&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted")}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(b){var c=a(this),e=c.data("data");return"true"===c.attr("aria-selected")?void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{})):void d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){var a=this.$results.find(".select2-results__option--highlighted");return a},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[aria-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),2>=c?this.$results.scrollTop(0):(g>this.$results.outerHeight()||0>g)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){var a={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46};return a}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a('<span class="select2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id+"-container",a.id+"-results");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),d.$selection.focus(),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2"),e=a(".select2.select2-container--open");e.each(function(){var b=a(this);if(this!=d[0]){var c=b.data("element");c.select2("close")}})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){var c=b.find(".selection");c.append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d),this.$selection.attr("aria-labelledby",d),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("blur",function(a){}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection"),d=this.options.get("escapeMarkup");return d(c(a,b))},e.prototype.selectionContainer=function(){return a("<span></span>")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.prop("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('<ul class="select2-selection__rendered"></ul>'),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection"),d=this.options.get("escapeMarkup");return d(c(a,b))},d.prototype.selectionContainer=function(){var b=a('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">&times;</span></li>');return b},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d<a.length;d++){var e=a[d],f=this.selectionContainer(),g=this.display(e,f);f.append(g),f.prop("title",e.title||e.text),f.data("data",e),b.push(f)}var h=this.$selection.find(".select2-selection__rendered");c.appendMany(h,b)}},d}),b.define("select2/selection/placeholder",["../utils"],function(a){function b(a,b,c){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c)}return b.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},b.prototype.createPlaceholder=function(a,b){var c=this.selectionContainer();return c.html(this.display(b)),c.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),c},b.prototype.update=function(a,b){var c=1==b.length&&b[0].id!=this.placeholder.id,d=b.length>1;if(d||c)return a.call(this,b);this.clear();var e=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(e)},b}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e<d.length;e++){var f={data:d[e]};if(this.trigger("unselect",f),f.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle",{})}}},c.prototype._handleKeyboardClear=function(a,c,d){d.isOpen()||(c.which==b.DELETE||c.which==b.BACKSPACE)&&this._handleClear(c)},c.prototype.update=function(b,c){if(b.call(this,c),!(this.$selection.find(".select2-selection__placeholder").length>0||0===c.length)){var d=a('<span class="select2-selection__clear">&times;</span>');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this;a.call(this,b,d),b.on("open",function(){e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.id)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented();var b=a.which;if(b===c.BACKSPACE&&""===e.$search.val()){var d=e.$searchContainer.prev(".select2-selection__choice");if(d.length>0){var f=d.data("data");e.searchRemoveChoice(f),a.preventDefault()}}});var f=document.documentMode,g=f&&11>=f;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){return g?void e.$selection.off("input.search input.searchcheck"):void e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(g&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{var b=this.$search.val().length+1;a=.75*b+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){var a={"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"};return a}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),d+=null!=c.id?"-"+c.id.toString():"-"+a.generateChars(4)},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f<a.length;f++){var g=a[f].id;-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")});else{var d=a.id;this.$element.val(d),this.$element.trigger("change")}},d.prototype.unselect=function(a){var b=this;if(this.$element.prop("multiple"))return a.selected=!1,
2
+ c(a.element).is("option")?(a.element.selected=!1,void this.$element.trigger("change")):void this.current(function(d){for(var e=[],f=0;f<d.length;f++){var g=d[f].id;g!==a.id&&-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")})},d.prototype.bind=function(a,b){var c=this;this.container=a,a.on("select",function(a){c.select(a.data)}),a.on("unselect",function(a){c.unselect(a.data)})},d.prototype.destroy=function(){this.$element.find("*").each(function(){c.removeData(this,"data")})},d.prototype.query=function(a,b){var d=[],e=this,f=this.$element.children();f.each(function(){var b=c(this);if(b.is("option")||b.is("optgroup")){var f=e.item(b),g=e.matches(a,f);null!==g&&d.push(g)}}),b({results:d})},d.prototype.addOptions=function(a){b.appendMany(this.$element,a)},d.prototype.option=function(a){var b;a.children?(b=document.createElement("optgroup"),b.label=a.text):(b=document.createElement("option"),void 0!==b.textContent?b.textContent=a.text:b.innerText=a.text),a.id&&(b.value=a.id),a.disabled&&(b.disabled=!0),a.selected&&(b.selected=!0),a.title&&(b.title=a.title);var d=c(b),e=this._normalizeItem(a);return e.element=b,c.data(b,"data",e),d},d.prototype.item=function(a){var b={};if(b=c.data(a[0],"data"),null!=b)return b;if(a.is("option"))b={id:a.val(),text:a.text(),disabled:a.prop("disabled"),selected:a.prop("selected"),title:a.prop("title")};else if(a.is("optgroup")){b={text:a.prop("label"),children:[],title:a.prop("title")};for(var d=a.children("option"),e=[],f=0;f<d.length;f++){var g=c(d[f]),h=this.item(g);e.push(h)}b.children=e}return b=this._normalizeItem(b),b.element=a[0],c.data(a[0],"data",b),b},d.prototype._normalizeItem=function(a){c.isPlainObject(a)||(a={id:a,text:a}),a=c.extend({},{text:""},a);var b={selected:!1,disabled:!1};return null!=a.id&&(a.id=a.id.toString()),null!=a.text&&(a.text=a.text.toString()),null==a._resultId&&a.id&&null!=this.container&&(a._resultId=this.generateResultId(this.container,a)),c.extend({},b,a)},d.prototype.matches=function(a,b){var c=this.options.get("matcher");return c(a,b)},d}),b.define("select2/data/array",["./select","../utils","jquery"],function(a,b,c){function d(a,b){var c=b.get("data")||[];d.__super__.constructor.call(this,a,b),this.addOptions(this.convertToOptions(c))}return b.Extend(d,a),d.prototype.select=function(a){var b=this.$element.find("option").filter(function(b,c){return c.value==a.id.toString()});0===b.length&&(b=this.option(a),this.addOptions(b)),d.__super__.select.call(this,a)},d.prototype.convertToOptions=function(a){function d(a){return function(){return c(this).val()==a.id}}for(var e=this,f=this.$element.find("option"),g=f.map(function(){return e.item(c(this)).id}).get(),h=[],i=0;i<a.length;i++){var j=this._normalizeItem(a[i]);if(c.inArray(j.id,g)>=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f)},function(){e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&""!==a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h<e.length;h++){var i=e[h],j=this._normalizeItem(i),k=this.option(j);this.$element.append(k)}}return b.prototype.query=function(a,b,c){function d(a,f){for(var g=a.results,h=0;h<g.length;h++){var i=g[h],j=null!=i.children&&!d({results:i.children},!0),k=i.text===b.term;if(k||j)return f?!1:(a.data=g,void c(a))}if(f)return!0;var l=e.createTag(b);if(null!=l){var m=e.option(l);m.attr("data-select2-tag",!0),e.addOptions([m]),e.insertTag(g,l)}a.results=g,c(a)}var e=this;return this._removeOldTags(),null==b.term||null!=b.page?void a.call(this,b,c):void a.call(this,b,d)},b.prototype.createTag=function(b,c){var d=a.trim(c.term);return""===d?null:{id:d,text:d}},b.prototype.insertTag=function(a,b,c){b.unshift(c)},b.prototype._removeOldTags=function(b){var c=(this._lastTag,this.$element.find("option[data-select2-tag]"));c.each(function(){this.selected||a(this).remove()})},b}),b.define("select2/data/tokenizer",["jquery"],function(a){function b(a,b,c){var d=c.get("tokenizer");void 0!==d&&(this.tokenizer=d),a.call(this,b,c)}return b.prototype.bind=function(a,b,c){a.call(this,b,c),this.$search=b.dropdown.$search||b.selection.$search||c.find(".select2-search__field")},b.prototype.query=function(a,b,c){function d(a){e.trigger("select",{data:a})}var e=this;b.term=b.term||"";var f=this.tokenizer(b,this.options,d);f.term!==b.term&&(this.$search.length&&(this.$search.val(f.term),this.$search.focus()),b.term=f.term),a.call(this,b,c)},b.prototype.tokenizer=function(b,c,d,e){for(var f=d.get("tokenSeparators")||[],g=c.term,h=0,i=this.createTag||function(a){return{id:a.term,text:a.term}};h<g.length;){var j=g[h];if(-1!==a.inArray(j,f)){var k=g.substr(0,h),l=a.extend({},c,{term:k}),m=i(l);null!=m?(e(m),g=g.substr(h+1)||"",h=0):h++}else h++}return{term:g}},b}),b.define("select2/data/minimumInputLength",[],function(){function a(a,b,c){this.minimumInputLength=c.get("minimumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){return b.term=b.term||"",b.term.length<this.minimumInputLength?void this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:b.term,params:b}}):void a.call(this,b,c)},a}),b.define("select2/data/maximumInputLength",[],function(){function a(a,b,c){this.maximumInputLength=c.get("maximumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){return b.term=b.term||"",this.maximumInputLength>0&&b.term.length>this.maximumInputLength?void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}}):void a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;return d.maximumSelectionLength>0&&f>=d.maximumSelectionLength?void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}}):void a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<span class="select2-dropdown"><span class="select2-results"></span></span>');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" /></span>');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val("")}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){var b=e.showSearch(a);b?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){var c=e.$results.offset().top+e.$results.outerHeight(!1),d=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1);c+50>=d&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('<li class="select2-results__option select2-results__option--load-more"role="treeitem" aria-disabled="true"></li>'),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a("<span></span>"),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id,h=this.$container.parents().filter(b.hasScroll);h.off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.top<f.top-h.height,k=i.bottom>f.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d<b.length;d++){var e=b[d];e.children?c+=a(e.children):c++}return c}function b(a,b,c,d){this.minimumResultsForSearch=c.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),a.call(this,b,c,d)}return b.prototype.showSearch=function(b,c){return a(c.data.results)<this.minimumResultsForSearch?!1:b.call(this,c)},b}),b.define("select2/dropdown/selectOnClose",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("close",function(){d._handleSelectOnClose()})},a.prototype._handleSelectOnClose=function(){var a=this.getHighlightedResults();if(!(a.length<1)){var b=a.data("data");null!=b.element&&b.element.selected||null==b.element&&b.selected||this.trigger("select",{data:b})}},a}),b.define("select2/dropdown/closeOnSelect",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("select",function(a){d._selectTriggered(a)}),b.on("unselect",function(a){d._selectTriggered(a)})},a.prototype._selectTriggered=function(a,b){var c=b.originalEvent;c&&c.ctrlKey||this.trigger("close",{})},a}),b.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(a){var b=a.input.length-a.maximum,c="Please delete "+b+" character";return 1!=b&&(c+="s"),c},inputTooShort:function(a){var b=a.minimum-a.input.length,c="Please enter "+b+" or more characters";return c},loadingMore:function(){return"Loading more results…"},maximumSelected:function(a){var b="You can only select "+a.maximum+" item";return 1!=a.maximum&&(b+="s"),b},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),b.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C){function D(){this.reset()}D.prototype.apply=function(l){if(l=a.extend(!0,{},this.defaults,l),null==l.dataAdapter){if(null!=l.ajax?l.dataAdapter=o:null!=l.data?l.dataAdapter=n:l.dataAdapter=m,l.minimumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),(null!=l.tokenSeparators||null!=l.tokenizer)&&(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L<K.length;L++){var M=K[L],N={};try{N=k.loadPath(M)}catch(O){try{M=this.defaults.amdLanguageBase+M,N=k.loadPath(M)}catch(P){l.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+M+'" could not be automatically loaded. A fallback will be used instead.');continue}}J.extend(N)}l.translations=J}else{var Q=k.loadPath(this.defaults.amdLanguageBase+"en"),R=new k(l.language);R.extend(Q),l.translations=R}return l},D.prototype.reset=function(){function b(a){function b(a){return l[a]||a}return a.replace(/[^\u0000-\u007E]/g,b)}function c(d,e){if(""===a.trim(d.term))return e;if(e.children&&e.children.length>0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){var h=e.children[g],i=c(d,h);null==i&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var j=b(e.text).toUpperCase(),k=b(d.term).toUpperCase();return j.indexOf(k)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)};var E=new D;return E}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return 0>=e?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;i>h;h+=1){var j=g[h].replace(/\s/g,""),k=j.match(c);if(null!==k&&k.length>=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this._sync=c.bind(this._syncAttributes,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._sync);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._sync)}),this._observer.observe(this.$element[0],{attributes:!0,subtree:!1})):this.$element[0].addEventListener&&this.$element[0].addEventListener("DOMAttrModified",b._sync,!1)},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var a=this;this.on("open",function(){a.$container.addClass("select2-container--open")}),this.on("close",function(){a.$container.removeClass("select2-container--open")}),this.on("enable",function(){a.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){a.$container.addClass("select2-container--disabled")}),this.on("blur",function(){a.$container.removeClass("select2-container--focus")}),this.on("query",function(b){a.isOpen()||a.trigger("open",{}),this.dataAdapter.query(b,function(c){a.trigger("results:all",{data:c,query:b})})}),this.on("query:append",function(b){this.dataAdapter.query(b,function(c){a.trigger("results:append",{data:c,query:b})})}),this.on("keypress",function(b){var c=b.which;a.isOpen()?c===d.ESC||c===d.TAB||c===d.UP&&b.altKey?(a.close(),b.preventDefault()):c===d.ENTER?(a.trigger("results:select",{}),b.preventDefault()):c===d.SPACE&&b.ctrlKey?(a.trigger("results:toggle",{}),b.preventDefault()):c===d.UP?(a.trigger("results:previous",{}),b.preventDefault()):c===d.DOWN&&(a.trigger("results:next",{}),b.preventDefault()):(c===d.ENTER||c===d.SPACE||c===d.DOWN&&b.altKey)&&(a.open(),b.preventDefault())})},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),(null==a||0===a.length)&&(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._sync),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&this.$element[0].removeEventListener("DOMAttrModified",this._sync,!1),this._sync=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("jquery-mousewheel",["jquery"],function(a){return a}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(a,b,c,d){if(null==a.fn.select2){var e=["open","close","destroy"];a.fn.select2=function(b){if(b=b||{},"object"==typeof b)return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d;return this.each(function(){var c=a(this).data("select2");null==c&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2.");var e=Array.prototype.slice.call(arguments,1);d=c[b].apply(c,e)}),a.inArray(b,e)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null==a.fn.select2.defaults&&(a.fn.select2.defaults=d),c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,c});
google-calendar-events.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Simple Calendar
4
  * Plugin URI: https://simplecalendar.io
5
  * Description: Add Google Calendar events to your WordPress site in minutes. Beautiful calendar displays. Fully responsive.
6
- * Version: 3.0.14
7
  * Author: Moonstone Media
8
  * Author URI: https://simplecalendar.io
9
  * Text Domain: google-calendar-events
@@ -18,18 +18,11 @@ if ( ! defined( 'ABSPATH' ) ) {
18
  exit;
19
  }
20
 
21
- // Composer fallback for PHP < 5.3.0.
22
- if ( version_compare( PHP_VERSION, '5.3.0' ) === -1 ) {
23
- include_once 'vendor/autoload_52.php';
24
- } else {
25
- include_once 'vendor/autoload.php';
26
- }
27
-
28
  // Plugin constants.
29
  $this_plugin_path = trailingslashit( dirname( __FILE__ ) );
30
  $this_plugin_dir = plugin_dir_url( __FILE__ );
31
  $this_plugin_constants = array(
32
- 'SIMPLE_CALENDAR_VERSION' => '3.0.14',
33
  'SIMPLE_CALENDAR_MAIN_FILE' => __FILE__,
34
  'SIMPLE_CALENDAR_URL' => $this_plugin_dir,
35
  'SIMPLE_CALENDAR_ASSETS' => $this_plugin_dir . 'assets/',
@@ -49,7 +42,7 @@ include_once 'includes/wp-requirements.php';
49
  // Check plugin requirements before loading plugin.
50
  $this_plugin_checks = new SimCal_WP_Requirements( 'Simple Calendar', plugin_basename( __FILE__ ), array(
51
  'PHP' => '5.3.3',
52
- 'WordPress' => '4.0.0',
53
  'Extensions' => array(
54
  'curl',
55
  'iconv',
@@ -63,5 +56,7 @@ if ( $this_plugin_checks->pass() === false ) {
63
  return;
64
  }
65
 
 
 
66
  // Load plugin.
67
  include_once 'includes/main.php';
3
  * Plugin Name: Simple Calendar
4
  * Plugin URI: https://simplecalendar.io
5
  * Description: Add Google Calendar events to your WordPress site in minutes. Beautiful calendar displays. Fully responsive.
6
+ * Version: 3.0.15
7
  * Author: Moonstone Media
8
  * Author URI: https://simplecalendar.io
9
  * Text Domain: google-calendar-events
18
  exit;
19
  }
20
 
 
 
 
 
 
 
 
21
  // Plugin constants.
22
  $this_plugin_path = trailingslashit( dirname( __FILE__ ) );
23
  $this_plugin_dir = plugin_dir_url( __FILE__ );
24
  $this_plugin_constants = array(
25
+ 'SIMPLE_CALENDAR_VERSION' => '3.0.15',
26
  'SIMPLE_CALENDAR_MAIN_FILE' => __FILE__,
27
  'SIMPLE_CALENDAR_URL' => $this_plugin_dir,
28
  'SIMPLE_CALENDAR_ASSETS' => $this_plugin_dir . 'assets/',
42
  // Check plugin requirements before loading plugin.
43
  $this_plugin_checks = new SimCal_WP_Requirements( 'Simple Calendar', plugin_basename( __FILE__ ), array(
44
  'PHP' => '5.3.3',
45
+ 'WordPress' => '4.1',
46
  'Extensions' => array(
47
  'curl',
48
  'iconv',
56
  return;
57
  }
58
 
59
+ include_once 'vendor/autoload.php';
60
+
61
  // Load plugin.
62
  include_once 'includes/main.php';
includes/abstracts/calendar.php CHANGED
@@ -263,7 +263,7 @@ abstract class Calendar {
263
  $this->set_events( $feed->events );
264
  if ( 'use_calendar' == get_post_meta( $this->id, '_feed_timezone_setting', true ) ) {
265
  $this->timezone = $feed->timezone;
266
- $this->set_start( $feed->timezone );
267
  }
268
  } elseif ( is_string( $feed->events ) ) {
269
  $this->errors[] = $feed->events;
@@ -478,6 +478,11 @@ abstract class Calendar {
478
 
479
  $site_tz = esc_attr( simcal_get_wp_timezone() );
480
 
 
 
 
 
 
481
  if ( empty( $tz ) ) {
482
 
483
  $timezone_setting = get_post_meta( $this->id, '_feed_timezone_setting', true );
263
  $this->set_events( $feed->events );
264
  if ( 'use_calendar' == get_post_meta( $this->id, '_feed_timezone_setting', true ) ) {
265
  $this->timezone = $feed->timezone;
266
+ $this->set_start();
267
  }
268
  } elseif ( is_string( $feed->events ) ) {
269
  $this->errors[] = $feed->events;
478
 
479
  $site_tz = esc_attr( simcal_get_wp_timezone() );
480
 
481
+ if ( $this->feed === 'grouped-calendars' ) {
482
+ $this->timezone = $site_tz;
483
+ return;
484
+ }
485
+
486
  if ( empty( $tz ) ) {
487
 
488
  $timezone_setting = get_post_meta( $this->id, '_feed_timezone_setting', true );
includes/admin/metaboxes/settings.php CHANGED
@@ -279,7 +279,7 @@ class Settings implements Meta_Box {
279
  <select name="_calendar_begins"
280
  id="_calendar_begins"
281
  class="simcal-field simcal-field-select simcal-field-inline simcal-field-switch-other">
282
- <optgroup label="<?php _e( 'Days range', 'google-calendar-events' ); ?>">
283
  <option value="today"
284
  data-hide-fields="_calendar_begins_custom_date,_calendar_begins_nth"
285
  <?php selected( 'today', $calendar_begins, true ); ?>><?php _e( 'Today', 'google-calendar-events' ); ?></option>
@@ -293,7 +293,7 @@ class Settings implements Meta_Box {
293
  data-hide-field="_calendar_begins_custom_date"
294
  data-show-field="_calendar_begins_nth" <?php selected( 'days_after', $calendar_begins, true ); ?>><?php _e( 'Day(s) after today', 'google-calendar-events' ); ?></option>
295
  </optgroup>
296
- <optgroup label="<?php _e( 'Weeks range', 'google-calendar-events' ); ?>">
297
  <option value="this_week"
298
  data-hide-fields="_calendar_begins_custom_date,_calendar_begins_nth"
299
  <?php selected( 'this_week', $calendar_begins, true ); ?>><?php _e( 'This week', 'google-calendar-events' ); ?></option>
@@ -304,7 +304,7 @@ class Settings implements Meta_Box {
304
  data-hide-field="_calendar_begins_custom_date"
305
  data-show-field="_calendar_begins_nth" <?php selected( 'weeks_after', $calendar_begins, true ); ?>><?php _e( 'Week(s) after current', 'google-calendar-events' ); ?></option>
306
  </optgroup>
307
- <optgroup label="<?php _e( 'Months range', 'google-calendar-events' ); ?>">
308
  <option value="this_month"
309
  data-hide-fields="_calendar_begins_custom_date,_calendar_begins_nth"
310
  <?php selected( 'this_month', $calendar_begins, true ); ?>><?php _e( 'This month', 'google-calendar-events' ); ?></option>
@@ -315,7 +315,7 @@ class Settings implements Meta_Box {
315
  data-hide-field="_calendar_begins_custom_date"
316
  data-show-field="_calendar_begins_nth" <?php selected( 'months_after', $calendar_begins, true ); ?>><?php _e( 'Month(s) after current', 'google-calendar-events' ); ?></option>
317
  </optgroup>
318
- <optgroup label="<?php _e( 'Years range', 'google-calendar-events' ); ?>">
319
  <option value="this_year"
320
  data-hide-fields="_calendar_begins_custom_date,_calendar_begins_nth"
321
  <?php selected( 'this_year', $calendar_begins, true ); ?>><?php _e( 'This year', 'google-calendar-events' ); ?></option>
@@ -533,19 +533,22 @@ class Settings implements Meta_Box {
533
  <?php
534
 
535
  $timezone_wordpress = simcal_get_wp_timezone();
536
- $timezone_default = $timezone_wordpress ? $timezone_wordpress : 'UTC';
537
- $timezone_setting = esc_attr( get_post_meta( $post->ID, '_feed_timezone_setting', true ) );
538
- $timezone = esc_attr( get_post_meta( $post->ID, '_feed_timezone', true ) );
539
- $timezone = $timezone ? $timezone : $timezone_default;
 
540
 
541
  ?>
542
  <select name="_feed_timezone_setting"
543
  id="_feed_timezone_setting"
544
- class="simcal-field simcal-field-select simcal-field-inline simcal-field-show-next"
545
- data-show-next-if-value="use_custom">
546
- <option value="use_calendar" <?php selected( 'use_calendar', $timezone_setting, true ); ?>><?php _ex( 'Events source default', 'Use the calendar default setting', 'google-calendar-events' ); ?></option>
547
  <option value="use_site" <?php selected( 'use_site', $timezone_setting, true ); ?>><?php printf( _x( 'Site default', 'Use this site default setting', 'google-calendar-events' ) . ' (%s)', $timezone_default ); ?></option>
548
- <option value="use_custom" <?php selected( 'use_custom', $timezone_setting, true ); ?>><?php _ex( 'Custom', 'Use a custom setting', 'google-calendar-events' ); ?></option>
 
 
 
549
  </select>
550
  <select name="_feed_timezone"
551
  id="_feed_timezone"
@@ -553,7 +556,10 @@ class Settings implements Meta_Box {
553
  <?php echo 'use_custom' != $timezone_setting ? 'style="display: none;"' : ''; ?>>
554
  <?php echo wp_timezone_choice( $timezone ); ?>
555
  </select>
556
- <i class="simcal-icon-help simcal-help-tip" data-tip="<?php _e( 'Using a different timezone may alter the date and time display of your calendar events. It is recommended to keep the calendar default timezone.', 'google-calendar-events' ); ?>"></i>
 
 
 
557
  </td>
558
  </tr>
559
  <tr class="simcal-panel-field">
279
  <select name="_calendar_begins"
280
  id="_calendar_begins"
281
  class="simcal-field simcal-field-select simcal-field-inline simcal-field-switch-other">
282
+ <optgroup label="<?php _e( 'Days', 'google-calendar-events' ); ?>">
283
  <option value="today"
284
  data-hide-fields="_calendar_begins_custom_date,_calendar_begins_nth"
285
  <?php selected( 'today', $calendar_begins, true ); ?>><?php _e( 'Today', 'google-calendar-events' ); ?></option>
293
  data-hide-field="_calendar_begins_custom_date"
294
  data-show-field="_calendar_begins_nth" <?php selected( 'days_after', $calendar_begins, true ); ?>><?php _e( 'Day(s) after today', 'google-calendar-events' ); ?></option>
295
  </optgroup>
296
+ <optgroup label="<?php _e( 'Weeks', 'google-calendar-events' ); ?>">
297
  <option value="this_week"
298
  data-hide-fields="_calendar_begins_custom_date,_calendar_begins_nth"
299
  <?php selected( 'this_week', $calendar_begins, true ); ?>><?php _e( 'This week', 'google-calendar-events' ); ?></option>
304
  data-hide-field="_calendar_begins_custom_date"
305
  data-show-field="_calendar_begins_nth" <?php selected( 'weeks_after', $calendar_begins, true ); ?>><?php _e( 'Week(s) after current', 'google-calendar-events' ); ?></option>
306
  </optgroup>
307
+ <optgroup label="<?php _e( 'Months', 'google-calendar-events' ); ?>">
308
  <option value="this_month"
309
  data-hide-fields="_calendar_begins_custom_date,_calendar_begins_nth"
310
  <?php selected( 'this_month', $calendar_begins, true ); ?>><?php _e( 'This month', 'google-calendar-events' ); ?></option>
315
  data-hide-field="_calendar_begins_custom_date"
316
  data-show-field="_calendar_begins_nth" <?php selected( 'months_after', $calendar_begins, true ); ?>><?php _e( 'Month(s) after current', 'google-calendar-events' ); ?></option>
317
  </optgroup>
318
+ <optgroup label="<?php _e( 'Years', 'google-calendar-events' ); ?>">
319
  <option value="this_year"
320
  data-hide-fields="_calendar_begins_custom_date,_calendar_begins_nth"
321
  <?php selected( 'this_year', $calendar_begins, true ); ?>><?php _e( 'This year', 'google-calendar-events' ); ?></option>
533
  <?php
534
 
535
  $timezone_wordpress = simcal_get_wp_timezone();
536
+ $timezone_default = $timezone_wordpress ? $timezone_wordpress : 'UTC';
537
+ $timezone_setting = esc_attr( get_post_meta( $post->ID, '_feed_timezone_setting', true ) );
538
+ $timezone = esc_attr( get_post_meta( $post->ID, '_feed_timezone', true ) );
539
+ $timezone = $timezone ? $timezone : $timezone_default;
540
+ $show_use_calendar = simcal_get_feed( $post )->type !== 'grouped-calendars';
541
 
542
  ?>
543
  <select name="_feed_timezone_setting"
544
  id="_feed_timezone_setting"
545
+ class="simcal-field simcal-field-select simcal-field-inline simcal-field-show-other"
546
+ data-show-field-on-choice="true">
 
547
  <option value="use_site" <?php selected( 'use_site', $timezone_setting, true ); ?>><?php printf( _x( 'Site default', 'Use this site default setting', 'google-calendar-events' ) . ' (%s)', $timezone_default ); ?></option>
548
+ <?php if ( $show_use_calendar ) { ?>
549
+ <option id="use_calendar" value="use_calendar" <?php selected( 'use_calendar', $timezone_setting, true ); ?>><?php _ex( 'Event source default', 'Use the calendar default setting', 'google-calendar-events' ); ?></option>
550
+ <?php } ?>
551
+ <option value="use_custom" data-show-field="_feed_timezone" <?php selected( 'use_custom', $timezone_setting, true ); ?>><?php _ex( 'Custom', 'Use a custom setting', 'google-calendar-events' ); ?></option>
552
  </select>
553
  <select name="_feed_timezone"
554
  id="_feed_timezone"
556
  <?php echo 'use_custom' != $timezone_setting ? 'style="display: none;"' : ''; ?>>
557
  <?php echo wp_timezone_choice( $timezone ); ?>
558
  </select>
559
+ <i class="simcal-icon-help simcal-help-tip" data-tip="<?php _e( 'Using a different timezone may alter the date and time display of your calendar events. It is recommended to use the site default option.', 'google-calendar-events' ); ?>"></i>
560
+ <p id="_use_calendar_warning" class="simcal-field">
561
+ <?php printf( __( '<strong>Note:</strong> Timezone settings can be changed in several places within your Google calendars. <a href="%s" target="_blank">See details here</a>', 'google-calendar-events' ), 'http://docs.simplecalendar.io/timezone-settings/' ); ?>
562
+ </p>
563
  </td>
564
  </tr>
565
  <tr class="simcal-panel-field">
includes/admin/pages/system-status.php CHANGED
@@ -503,7 +503,7 @@ class System_Status extends Admin_Page {
503
  * ==================
504
  */
505
 
506
- $user_client = new \Browser();
507
 
508
  $browser = '<dl>';
509
  $browser .= '<dt>' . __( 'Name:', 'google-calendar-events' ) . '</dt>';
503
  * ==================
504
  */
505
 
506
+ $user_client = new \SimpleCalendar\Browser();
507
 
508
  $browser = '<dl>';
509
  $browser .= '<dt>' . __( 'Name:', 'google-calendar-events' ) . '</dt>';
includes/browser.php ADDED
@@ -0,0 +1,1255 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace SimpleCalendar;
3
+ /**
4
+ * File: Browser.php
5
+ * Author: Chris Schuld (http://chrisschuld.com/)
6
+ * Last Modified: July 4th, 2014
7
+ * @version 1.9
8
+ * @package PegasusPHP
9
+ *
10
+ * Copyright (C) 2008-2010 Chris Schuld (chris@chrisschuld.com)
11
+ *
12
+ * This program is free software; you can redistribute it and/or
13
+ * modify it under the terms of the GNU General Public License as
14
+ * published by the Free Software Foundation; either version 2 of
15
+ * the License, or (at your option) any later version.
16
+ *
17
+ * This program is distributed in the hope that it will be useful,
18
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
19
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
+ * GNU General Public License for more details at:
21
+ * http://www.gnu.org/copyleft/gpl.html
22
+ *
23
+ *
24
+ * Typical Usage:
25
+ *
26
+ * $browser = new Browser();
27
+ * if( $browser->getBrowser() == Browser::BROWSER_FIREFOX && $browser->getVersion() >= 2 ) {
28
+ * echo 'You have FireFox version 2 or greater';
29
+ * }
30
+ *
31
+ * User Agents Sampled from: http://www.useragentstring.com/
32
+ *
33
+ * This implementation is based on the original work from Gary White
34
+ * http://apptools.com/phptools/browser/
35
+ *
36
+ *
37
+ * Modified Version by Moonstone Media
38
+ *
39
+ * Changelog:
40
+ * - Changed class constructor from Browser() to __construct()
41
+ */
42
+
43
+
44
+
45
+ class Browser
46
+ {
47
+ private $_agent = '';
48
+ private $_browser_name = '';
49
+ private $_version = '';
50
+ private $_platform = '';
51
+ private $_os = '';
52
+ private $_is_aol = false;
53
+ private $_is_mobile = false;
54
+ private $_is_tablet = false;
55
+ private $_is_robot = false;
56
+ private $_is_facebook = false;
57
+ private $_aol_version = '';
58
+
59
+ const BROWSER_UNKNOWN = 'unknown';
60
+ const VERSION_UNKNOWN = 'unknown';
61
+
62
+ const BROWSER_OPERA = 'Opera'; // http://www.opera.com/
63
+ const BROWSER_OPERA_MINI = 'Opera Mini'; // http://www.opera.com/mini/
64
+ const BROWSER_WEBTV = 'WebTV'; // http://www.webtv.net/pc/
65
+ const BROWSER_IE = 'Internet Explorer'; // http://www.microsoft.com/ie/
66
+ const BROWSER_POCKET_IE = 'Pocket Internet Explorer'; // http://en.wikipedia.org/wiki/Internet_Explorer_Mobile
67
+ const BROWSER_KONQUEROR = 'Konqueror'; // http://www.konqueror.org/
68
+ const BROWSER_ICAB = 'iCab'; // http://www.icab.de/
69
+ const BROWSER_OMNIWEB = 'OmniWeb'; // http://www.omnigroup.com/applications/omniweb/
70
+ const BROWSER_FIREBIRD = 'Firebird'; // http://www.ibphoenix.com/
71
+ const BROWSER_FIREFOX = 'Firefox'; // http://www.mozilla.com/en-US/firefox/firefox.html
72
+ const BROWSER_ICEWEASEL = 'Iceweasel'; // http://www.geticeweasel.org/
73
+ const BROWSER_SHIRETOKO = 'Shiretoko'; // http://wiki.mozilla.org/Projects/shiretoko
74
+ const BROWSER_MOZILLA = 'Mozilla'; // http://www.mozilla.com/en-US/
75
+ const BROWSER_AMAYA = 'Amaya'; // http://www.w3.org/Amaya/
76
+ const BROWSER_LYNX = 'Lynx'; // http://en.wikipedia.org/wiki/Lynx
77
+ const BROWSER_SAFARI = 'Safari'; // http://apple.com
78
+ const BROWSER_IPHONE = 'iPhone'; // http://apple.com
79
+ const BROWSER_IPOD = 'iPod'; // http://apple.com
80
+ const BROWSER_IPAD = 'iPad'; // http://apple.com
81
+ const BROWSER_CHROME = 'Chrome'; // http://www.google.com/chrome
82
+ const BROWSER_ANDROID = 'Android'; // http://www.android.com/
83
+ const BROWSER_GOOGLEBOT = 'GoogleBot'; // http://en.wikipedia.org/wiki/Googlebot
84
+ const BROWSER_SLURP = 'Yahoo! Slurp'; // http://en.wikipedia.org/wiki/Yahoo!_Slurp
85
+ const BROWSER_W3CVALIDATOR = 'W3C Validator'; // http://validator.w3.org/
86
+ const BROWSER_BLACKBERRY = 'BlackBerry'; // http://www.blackberry.com/
87
+ const BROWSER_ICECAT = 'IceCat'; // http://en.wikipedia.org/wiki/GNU_IceCat
88
+ const BROWSER_NOKIA_S60 = 'Nokia S60 OSS Browser'; // http://en.wikipedia.org/wiki/Web_Browser_for_S60
89
+ const BROWSER_NOKIA = 'Nokia Browser'; // * all other WAP-based browsers on the Nokia Platform
90
+ const BROWSER_MSN = 'MSN Browser'; // http://explorer.msn.com/
91
+ const BROWSER_MSNBOT = 'MSN Bot'; // http://search.msn.com/msnbot.htm
92
+ const BROWSER_BINGBOT = 'Bing Bot'; // http://en.wikipedia.org/wiki/Bingbot
93
+
94
+ const BROWSER_NETSCAPE_NAVIGATOR = 'Netscape Navigator'; // http://browser.netscape.com/ (DEPRECATED)
95
+ const BROWSER_GALEON = 'Galeon'; // http://galeon.sourceforge.net/ (DEPRECATED)
96
+ const BROWSER_NETPOSITIVE = 'NetPositive'; // http://en.wikipedia.org/wiki/NetPositive (DEPRECATED)
97
+ const BROWSER_PHOENIX = 'Phoenix'; // http://en.wikipedia.org/wiki/History_of_Mozilla_Firefox (DEPRECATED)
98
+
99
+ const PLATFORM_UNKNOWN = 'unknown';
100
+ const PLATFORM_WINDOWS = 'Windows';
101
+ const PLATFORM_WINDOWS_CE = 'Windows CE';
102
+ const PLATFORM_APPLE = 'Apple';
103
+ const PLATFORM_LINUX = 'Linux';
104
+ const PLATFORM_OS2 = 'OS/2';
105
+ const PLATFORM_BEOS = 'BeOS';
106
+ const PLATFORM_IPHONE = 'iPhone';
107
+ const PLATFORM_IPOD = 'iPod';
108
+ const PLATFORM_IPAD = 'iPad';
109
+ const PLATFORM_BLACKBERRY = 'BlackBerry';
110
+ const PLATFORM_NOKIA = 'Nokia';
111
+ const PLATFORM_FREEBSD = 'FreeBSD';
112
+ const PLATFORM_OPENBSD = 'OpenBSD';
113
+ const PLATFORM_NETBSD = 'NetBSD';
114
+ const PLATFORM_SUNOS = 'SunOS';
115
+ const PLATFORM_OPENSOLARIS = 'OpenSolaris';
116
+ const PLATFORM_ANDROID = 'Android';
117
+
118
+ const OPERATING_SYSTEM_UNKNOWN = 'unknown';
119
+
120
+ public function __construct($userAgent = "")
121
+ {
122
+ $this->reset();
123
+ if ($userAgent != "") {
124
+ $this->setUserAgent($userAgent);
125
+ } else {
126
+ $this->determine();
127
+ }
128
+ }
129
+
130
+ /**
131
+ * Reset all properties
132
+ */
133
+ public function reset()
134
+ {
135
+ $this->_agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : "";
136
+ $this->_browser_name = self::BROWSER_UNKNOWN;
137
+ $this->_version = self::VERSION_UNKNOWN;
138
+ $this->_platform = self::PLATFORM_UNKNOWN;
139
+ $this->_os = self::OPERATING_SYSTEM_UNKNOWN;
140
+ $this->_is_aol = false;
141
+ $this->_is_mobile = false;
142
+ $this->_is_tablet = false;
143
+ $this->_is_robot = false;
144
+ $this->_is_facebook = false;
145
+ $this->_aol_version = self::VERSION_UNKNOWN;
146
+ }
147
+
148
+ /**
149
+ * Check to see if the specific browser is valid
150
+ * @param string $browserName
151
+ * @return bool True if the browser is the specified browser
152
+ */
153
+ function isBrowser($browserName)
154
+ {
155
+ return (0 == strcasecmp($this->_browser_name, trim($browserName)));
156
+ }
157
+
158
+ /**
159
+ * The name of the browser. All return types are from the class contants
160
+ * @return string Name of the browser
161
+ */
162
+ public function getBrowser()
163
+ {
164
+ return $this->_browser_name;
165
+ }
166
+
167
+ /**
168
+ * Set the name of the browser
169
+ * @param $browser string The name of the Browser
170
+ */
171
+ public function setBrowser($browser)
172
+ {
173
+ $this->_browser_name = $browser;
174
+ }
175
+
176
+ /**
177
+ * The name of the platform. All return types are from the class contants
178
+ * @return string Name of the browser
179
+ */
180
+ public function getPlatform()
181
+ {
182
+ return $this->_platform;
183
+ }
184
+
185
+ /**
186
+ * Set the name of the platform
187
+ * @param string $platform The name of the Platform
188
+ */
189
+ public function setPlatform($platform)
190
+ {
191
+ $this->_platform = $platform;
192
+ }
193
+
194
+ /**
195
+ * The version of the browser.
196
+ * @return string Version of the browser (will only contain alpha-numeric characters and a period)
197
+ */
198
+ public function getVersion()
199
+ {
200
+ return $this->_version;
201
+ }
202
+
203
+ /**
204
+ * Set the version of the browser
205
+ * @param string $version The version of the Browser
206
+ */
207
+ public function setVersion($version)
208
+ {
209
+ $this->_version = preg_replace('/[^0-9,.,a-z,A-Z-]/', '', $version);
210
+ }
211
+
212
+ /**
213
+ * The version of AOL.
214
+ * @return string Version of AOL (will only contain alpha-numeric characters and a period)
215
+ */
216
+ public function getAolVersion()
217
+ {
218
+ return $this->_aol_version;
219
+ }
220
+
221
+ /**
222
+ * Set the version of AOL
223
+ * @param string $version The version of AOL
224
+ */
225
+ public function setAolVersion($version)
226
+ {
227
+ $this->_aol_version = preg_replace('/[^0-9,.,a-z,A-Z]/', '', $version);
228
+ }
229
+
230
+ /**
231
+ * Is the browser from AOL?
232
+ * @return boolean True if the browser is from AOL otherwise false
233
+ */
234
+ public function isAol()
235
+ {
236
+ return $this->_is_aol;
237
+ }
238
+
239
+ /**
240
+ * Is the browser from a mobile device?
241
+ * @return boolean True if the browser is from a mobile device otherwise false
242
+ */
243
+ public function isMobile()
244
+ {
245
+ return $this->_is_mobile;
246
+ }
247
+
248
+ /**
249
+ * Is the browser from a tablet device?
250
+ * @return boolean True if the browser is from a tablet device otherwise false
251
+ */
252
+ public function isTablet()
253
+ {
254
+ return $this->_is_tablet;
255
+ }
256
+
257
+ /**
258
+ * Is the browser from a robot (ex Slurp,GoogleBot)?
259
+ * @return boolean True if the browser is from a robot otherwise false
260
+ */
261
+ public function isRobot()
262
+ {
263
+ return $this->_is_robot;
264
+ }
265
+
266
+ /**
267
+ * Is the browser from facebook?
268
+ * @return boolean True if the browser is from facebook otherwise false
269
+ */
270
+ public function isFacebook()
271
+ {
272
+ return $this->_is_facebook;
273
+ }
274
+
275
+ /**
276
+ * Set the browser to be from AOL
277
+ * @param $isAol
278
+ */
279
+ public function setAol($isAol)
280
+ {
281
+ $this->_is_aol = $isAol;
282
+ }
283
+
284
+ /**
285
+ * Set the Browser to be mobile
286
+ * @param boolean $value is the browser a mobile browser or not
287
+ */
288
+ protected function setMobile($value = true)
289
+ {
290
+ $this->_is_mobile = $value;
291
+ }
292
+
293
+ /**
294
+ * Set the Browser to be tablet
295
+ * @param boolean $value is the browser a tablet browser or not
296
+ */
297
+ protected function setTablet($value = true)
298
+ {
299
+ $this->_is_tablet = $value;
300
+ }
301
+
302
+ /**
303
+ * Set the Browser to be a robot
304
+ * @param boolean $value is the browser a robot or not
305
+ */
306
+ protected function setRobot($value = true)
307
+ {
308
+ $this->_is_robot = $value;
309
+ }
310
+
311
+ /**
312
+ * Set the Browser to be a Facebook request
313
+ * @param boolean $value is the browser a robot or not
314
+ */
315
+ protected function setFacebook($value = true)
316
+ {
317
+ $this->_is_facebook = $value;
318
+ }
319
+
320
+ /**
321
+ * Get the user agent value in use to determine the browser
322
+ * @return string The user agent from the HTTP header
323
+ */
324
+ public function getUserAgent()
325
+ {
326
+ return $this->_agent;
327
+ }
328
+
329
+ /**
330
+ * Set the user agent value (the construction will use the HTTP header value - this will overwrite it)
331
+ * @param string $agent_string The value for the User Agent
332
+ */
333
+ public function setUserAgent($agent_string)
334
+ {
335
+ $this->reset();
336
+ $this->_agent = $agent_string;
337
+ $this->determine();
338
+ }
339
+
340
+ /**
341
+ * Used to determine if the browser is actually "chromeframe"
342
+ * @since 1.7
343
+ * @return boolean True if the browser is using chromeframe
344
+ */
345
+ public function isChromeFrame()
346
+ {
347
+ return (strpos($this->_agent, "chromeframe") !== false);
348
+ }
349
+
350
+ /**
351
+ * Returns a formatted string with a summary of the details of the browser.
352
+ * @return string formatted string with a summary of the browser
353
+ */
354
+ public function __toString()
355
+ {
356
+ return "<strong>Browser Name:</strong> {$this->getBrowser()}<br/>\n" .
357
+ "<strong>Browser Version:</strong> {$this->getVersion()}<br/>\n" .
358
+ "<strong>Browser User Agent String:</strong> {$this->getUserAgent()}<br/>\n" .
359
+ "<strong>Platform:</strong> {$this->getPlatform()}<br/>";
360
+ }
361
+
362
+ /**
363
+ * Protected routine to calculate and determine what the browser is in use (including platform)
364
+ */
365
+ protected function determine()
366
+ {
367
+ $this->checkPlatform();
368
+ $this->checkBrowsers();
369
+ $this->checkForAol();
370
+ }
371
+
372
+ /**
373
+ * Protected routine to determine the browser type
374
+ * @return boolean True if the browser was detected otherwise false
375
+ */
376
+ protected function checkBrowsers()
377
+ {
378
+ return (
379
+ // well-known, well-used
380
+ // Special Notes:
381
+ // (1) Opera must be checked before FireFox due to the odd
382
+ // user agents used in some older versions of Opera
383
+ // (2) WebTV is strapped onto Internet Explorer so we must
384
+ // check for WebTV before IE
385
+ // (3) (deprecated) Galeon is based on Firefox and needs to be
386
+ // tested before Firefox is tested
387
+ // (4) OmniWeb is based on Safari so OmniWeb check must occur
388
+ // before Safari
389
+ // (5) Netscape 9+ is based on Firefox so Netscape checks
390
+ // before FireFox are necessary
391
+ $this->checkBrowserWebTv() ||
392
+ $this->checkBrowserInternetExplorer() ||
393
+ $this->checkBrowserOpera() ||
394
+ $this->checkBrowserGaleon() ||
395
+ $this->checkBrowserNetscapeNavigator9Plus() ||
396
+ $this->checkBrowserFirefox() ||
397
+ $this->checkBrowserChrome() ||
398
+ $this->checkBrowserOmniWeb() ||
399
+
400
+ // common mobile
401
+ $this->checkBrowserAndroid() ||
402
+ $this->checkBrowseriPad() ||
403
+ $this->checkBrowseriPod() ||
404
+ $this->checkBrowseriPhone() ||
405
+ $this->checkBrowserBlackBerry() ||
406
+ $this->checkBrowserNokia() ||
407
+
408
+ // common bots
409
+ $this->checkBrowserGoogleBot() ||
410
+ $this->checkBrowserMSNBot() ||
411
+ $this->checkBrowserBingBot() ||
412
+ $this->checkBrowserSlurp() ||
413
+
414
+ // check for facebook external hit when loading URL
415
+ $this->checkFacebookExternalHit() ||
416
+
417
+ // WebKit base check (post mobile and others)
418
+ $this->checkBrowserSafari() ||
419
+
420
+ // everyone else
421
+ $this->checkBrowserNetPositive() ||
422
+ $this->checkBrowserFirebird() ||
423
+ $this->checkBrowserKonqueror() ||
424
+ $this->checkBrowserIcab() ||
425
+ $this->checkBrowserPhoenix() ||
426
+ $this->checkBrowserAmaya() ||
427
+ $this->checkBrowserLynx() ||
428
+ $this->checkBrowserShiretoko() ||
429
+ $this->checkBrowserIceCat() ||
430
+ $this->checkBrowserIceweasel() ||
431
+ $this->checkBrowserW3CValidator() ||
432
+ $this->checkBrowserMozilla() /* Mozilla is such an open standard that you must check it last */
433
+ );
434
+ }
435
+
436
+ /**
437
+ * Determine if the user is using a BlackBerry (last updated 1.7)
438
+ * @return boolean True if the browser is the BlackBerry browser otherwise false
439
+ */
440
+ protected function checkBrowserBlackBerry()
441
+ {
442
+ if (stripos($this->_agent, 'blackberry') !== false) {
443
+ $aresult = explode("/", stristr($this->_agent, "BlackBerry"));
444
+ if (isset($aresult[1])) {
445
+ $aversion = explode(' ', $aresult[1]);
446
+ $this->setVersion($aversion[0]);
447
+ $this->_browser_name = self::BROWSER_BLACKBERRY;
448
+ $this->setMobile(true);
449
+ return true;
450
+ }
451
+ }
452
+ return false;
453
+ }
454
+
455
+ /**
456
+ * Determine if the user is using an AOL User Agent (last updated 1.7)
457
+ * @return boolean True if the browser is from AOL otherwise false
458
+ */
459
+ protected function checkForAol()
460
+ {
461
+ $this->setAol(false);
462
+ $this->setAolVersion(self::VERSION_UNKNOWN);
463
+
464
+ if (stripos($this->_agent, 'aol') !== false) {
465
+ $aversion = explode(' ', stristr($this->_agent, 'AOL'));
466
+ if (isset($aversion[1])) {
467
+ $this->setAol(true);
468
+ $this->setAolVersion(preg_replace('/[^0-9\.a-z]/i', '', $aversion[1]));
469
+ return true;
470
+ }
471
+ }
472
+ return false;
473
+ }
474
+
475
+ /**
476
+ * Determine if the browser is the GoogleBot or not (last updated 1.7)
477
+ * @return boolean True if the browser is the GoogletBot otherwise false
478
+ */
479
+ protected function checkBrowserGoogleBot()
480
+ {
481
+ if (stripos($this->_agent, 'googlebot') !== false) {
482
+ $aresult = explode('/', stristr($this->_agent, 'googlebot'));
483
+ if (isset($aresult[1])) {
484
+ $aversion = explode(' ', $aresult[1]);
485
+ $this->setVersion(str_replace(';', '', $aversion[0]));
486
+ $this->_browser_name = self::BROWSER_GOOGLEBOT;
487
+ $this->setRobot(true);
488
+ return true;
489
+ }
490
+ }
491
+ return false;
492
+ }
493
+
494
+ /**
495
+ * Determine if the browser is the MSNBot or not (last updated 1.9)
496
+ * @return boolean True if the browser is the MSNBot otherwise false
497
+ */
498
+ protected function checkBrowserMSNBot()
499
+ {
500
+ if (stripos($this->_agent, "msnbot") !== false) {
501
+ $aresult = explode("/", stristr($this->_agent, "msnbot"));
502
+ if (isset($aresult[1])) {
503
+ $aversion = explode(" ", $aresult[1]);
504
+ $this->setVersion(str_replace(";", "", $aversion[0]));
505
+ $this->_browser_name = self::BROWSER_MSNBOT;
506
+ $this->setRobot(true);
507
+ return true;
508
+ }
509
+ }
510
+ return false;
511
+ }
512
+
513
+ /**
514
+ * Determine if the browser is the BingBot or not (last updated 1.9)
515
+ * @return boolean True if the browser is the BingBot otherwise false
516
+ */
517
+ protected function checkBrowserBingBot()
518
+ {
519
+ if (stripos($this->_agent, "bingbot") !== false) {
520
+ $aresult = explode("/", stristr($this->_agent, "bingbot"));
521
+ if (isset($aresult[1])) {
522
+ $aversion = explode(" ", $aresult[1]);
523
+ $this->setVersion(str_replace(";", "", $aversion[0]));
524
+ $this->_browser_name = self::BROWSER_BINGBOT;
525
+ $this->setRobot(true);
526
+ return true;
527
+ }
528
+ }
529
+ return false;
530
+ }
531
+
532
+ /**
533
+ * Determine if the browser is the W3C Validator or not (last updated 1.7)
534
+ * @return boolean True if the browser is the W3C Validator otherwise false
535
+ */
536
+ protected function checkBrowserW3CValidator()
537
+ {
538
+ if (stripos($this->_agent, 'W3C-checklink') !== false) {
539
+ $aresult = explode('/', stristr($this->_agent, 'W3C-checklink'));
540
+ if (isset($aresult[1])) {
541
+ $aversion = explode(' ', $aresult[1]);
542
+ $this->setVersion($aversion[0]);
543
+ $this->_browser_name = self::BROWSER_W3CVALIDATOR;
544
+ return true;
545
+ }
546
+ } else if (stripos($this->_agent, 'W3C_Validator') !== false) {
547
+ // Some of the Validator versions do not delineate w/ a slash - add it back in
548
+ $ua = str_replace("W3C_Validator ", "W3C_Validator/", $this->_agent);
549
+ $aresult = explode('/', stristr($ua, 'W3C_Validator'));
550
+ if (isset($aresult[1])) {
551
+ $aversion = explode(' ', $aresult[1]);
552
+ $this->setVersion($aversion[0]);
553
+ $this->_browser_name = self::BROWSER_W3CVALIDATOR;
554
+ return true;
555
+ }
556
+ } else if (stripos($this->_agent, 'W3C-mobileOK') !== false) {
557
+ $this->_browser_name = self::BROWSER_W3CVALIDATOR;
558
+ $this->setMobile(true);
559
+ return true;
560
+ }
561
+ return false;
562
+ }
563
+
564
+ /**
565
+ * Determine if the browser is the Yahoo! Slurp Robot or not (last updated 1.7)
566
+ * @return boolean True if the browser is the Yahoo! Slurp Robot otherwise false
567
+ */
568
+ protected function checkBrowserSlurp()
569
+ {
570
+ if (stripos($this->_agent, 'slurp') !== false) {
571
+ $aresult = explode('/', stristr($this->_agent, 'Slurp'));
572
+ if (isset($aresult[1])) {
573
+ $aversion = explode(' ', $aresult[1]);
574
+ $this->setVersion($aversion[0]);
575
+ $this->_browser_name = self::BROWSER_SLURP;
576
+ $this->setRobot(true);
577
+ $this->setMobile(false);
578
+ return true;
579
+ }
580
+ }
581
+ return false;
582
+ }
583
+
584
+ /**
585
+ * Determine if the browser is Internet Explorer or not (last updated 1.7)
586
+ * @return boolean True if the browser is Internet Explorer otherwise false
587
+ */
588
+ protected function checkBrowserInternetExplorer()
589
+ {
590
+ // Test for IE11
591
+ if (stripos($this->_agent, 'Trident/7.0; rv:11.0') !== false) {
592
+ $this->setBrowser(self::BROWSER_IE);
593
+ $this->setVersion('11.0');
594
+ return true;
595
+ } // Test for v1 - v1.5 IE
596
+ else if (stripos($this->_agent, 'microsoft internet explorer') !== false) {
597
+ $this->setBrowser(self::BROWSER_IE);
598
+ $this->setVersion('1.0');
599
+ $aresult = stristr($this->_agent, '/');
600
+ if (preg_match('/308|425|426|474|0b1/i', $aresult)) {
601
+ $this->setVersion('1.5');
602
+ }
603
+ return true;
604
+ } // Test for versions > 1.5
605
+ else if (stripos($this->_agent, 'msie') !== false && stripos($this->_agent, 'opera') === false) {
606
+ // See if the browser is the odd MSN Explorer
607
+ if (stripos($this->_agent, 'msnb') !== false) {
608
+ $aresult = explode(' ', stristr(str_replace(';', '; ', $this->_agent), 'MSN'));
609
+ if (isset($aresult[1])) {
610
+ $this->setBrowser(self::BROWSER_MSN);
611
+ $this->setVersion(str_replace(array('(', ')', ';'), '', $aresult[1]));
612
+ return true;
613
+ }
614
+ }
615
+ $aresult = explode(' ', stristr(str_replace(';', '; ', $this->_agent), 'msie'));
616
+ if (isset($aresult[1])) {
617
+ $this->setBrowser(self::BROWSER_IE);
618
+ $this->setVersion(str_replace(array('(', ')', ';'), '', $aresult[1]));
619
+ if (stripos($this->_agent, 'IEMobile') !== false) {
620
+ $this->setBrowser(self::BROWSER_POCKET_IE);
621
+ $this->setMobile(true);
622
+ }
623
+ return true;
624
+ }
625
+ } // Test for versions > IE 10
626
+ else if (stripos($this->_agent, 'trident') !== false) {
627
+ $this->setBrowser(self::BROWSER_IE);
628
+ $result = explode('rv:', $this->_agent);
629
+ if (isset($result[1])) {
630
+ $this->setVersion(preg_replace('/[^0-9.]+/', '', $result[1]));
631
+ $this->_agent = str_replace(array("Mozilla", "Gecko"), "MSIE", $this->_agent);
632
+ }
633
+ } // Test for Pocket IE
634
+ else if (stripos($this->_agent, 'mspie') !== false || stripos($this->_agent, 'pocket') !== false) {
635
+ $aresult = explode(' ', stristr($this->_agent, 'mspie'));
636
+ if (isset($aresult[1])) {
637
+ $this->setPlatform(self::PLATFORM_WINDOWS_CE);
638
+ $this->setBrowser(self::BROWSER_POCKET_IE);
639
+ $this->setMobile(true);
640
+
641
+ if (stripos($this->_agent, 'mspie') !== false) {
642
+ $this->setVersion($aresult[1]);
643
+ } else {
644
+ $aversion = explode('/', $this->_agent);
645
+ if (isset($aversion[1])) {
646
+ $this->setVersion($aversion[1]);
647
+ }
648
+ }
649
+ return true;
650
+ }
651
+ }
652
+ return false;
653
+ }
654
+
655
+ /**
656
+ * Determine if the browser is Opera or not (last updated 1.7)
657
+ * @return boolean True if the browser is Opera otherwise false
658
+ */
659
+ protected function checkBrowserOpera()
660
+ {
661
+ if (stripos($this->_agent, 'opera mini') !== false) {
662
+ $resultant = stristr($this->_agent, 'opera mini');
663
+ if (preg_match('/\//', $resultant)) {
664
+ $aresult = explode('/', $resultant);
665
+ if (isset($aresult[1])) {
666
+ $aversion = explode(' ', $aresult[1]);
667
+ $this->setVersion($aversion[0]);
668
+ }
669
+ } else {
670
+ $aversion = explode(' ', stristr($resultant, 'opera mini'));
671
+ if (isset($aversion[1])) {
672
+ $this->setVersion($aversion[1]);
673
+ }
674
+ }
675
+ $this->_browser_name = self::BROWSER_OPERA_MINI;
676
+ $this->setMobile(true);
677
+ return true;
678
+ } else if (stripos($this->_agent, 'opera') !== false) {
679
+ $resultant = stristr($this->_agent, 'opera');
680
+ if (preg_match('/Version\/(1*.*)$/', $resultant, $matches)) {
681
+ $this->setVersion($matches[1]);
682
+ } else if (preg_match('/\//', $resultant)) {
683
+ $aresult = explode('/', str_replace("(", " ", $resultant));
684
+ if (isset($aresult[1])) {
685
+ $aversion = explode(' ', $aresult[1]);
686
+ $this->setVersion($aversion[0]);
687
+ }
688
+ } else {
689
+ $aversion = explode(' ', stristr($resultant, 'opera'));
690
+ $this->setVersion(isset($aversion[1]) ? $aversion[1] : "");
691
+ }
692
+ if (stripos($this->_agent, 'Opera Mobi') !== false) {
693
+ $this->setMobile(true);
694
+ }
695
+ $this->_browser_name = self::BROWSER_OPERA;
696
+ return true;
697
+ } else if (stripos($this->_agent, 'OPR') !== false) {
698
+ $resultant = stristr($this->_agent, 'OPR');
699
+ if (preg_match('/\//', $resultant)) {
700
+ $aresult = explode('/', str_replace("(", " ", $resultant));
701
+ if (isset($aresult[1])) {
702
+ $aversion = explode(' ', $aresult[1]);
703
+ $this->setVersion($aversion[0]);
704
+ }
705
+ }
706
+ if (stripos($this->_agent, 'Mobile') !== false) {
707
+ $this->setMobile(true);
708
+ }
709
+ $this->_browser_name = self::BROWSER_OPERA;
710
+ return true;
711
+ }
712
+ return false;
713
+ }
714
+
715
+ /**
716
+ * Determine if the browser is Chrome or not (last updated 1.7)
717
+ * @return boolean True if the browser is Chrome otherwise false
718
+ */
719
+ protected function checkBrowserChrome()
720
+ {
721
+ if (stripos($this->_agent, 'Chrome') !== false) {
722
+ $aresult = explode('/', stristr($this->_agent, 'Chrome'));
723
+ if (isset($aresult[1])) {
724
+ $aversion = explode(' ', $aresult[1]);
725
+ $this->setVersion($aversion[0]);
726
+ $this->setBrowser(self::BROWSER_CHROME);
727
+ //Chrome on Android
728
+ if (stripos($this->_agent, 'Android') !== false) {
729
+ if (stripos($this->_agent, 'Mobile') !== false) {
730
+ $this->setMobile(true);
731
+ } else {
732
+ $this->setTablet(true);
733
+ }
734
+ }
735
+ return true;
736
+ }
737
+ }
738
+ return false;
739
+ }
740
+
741
+
742
+ /**
743
+ * Determine if the browser is WebTv or not (last updated 1.7)
744
+ * @return boolean True if the browser is WebTv otherwise false
745
+ */
746
+ protected function checkBrowserWebTv()
747
+ {
748
+ if (stripos($this->_agent, 'webtv') !== false) {
749
+ $aresult = explode('/', stristr($this->_agent, 'webtv'));
750
+ if (isset($aresult[1])) {
751
+ $aversion = explode(' ', $aresult[1]);
752
+ $this->setVersion($aversion[0]);
753
+ $this->setBrowser(self::BROWSER_WEBTV);
754
+ return true;
755
+ }
756
+ }
757
+ return false;
758
+ }
759
+
760
+ /**
761
+ * Determine if the browser is NetPositive or not (last updated 1.7)
762
+ * @return boolean True if the browser is NetPositive otherwise false
763
+ */
764
+ protected function checkBrowserNetPositive()
765
+ {
766
+ if (stripos($this->_agent, 'NetPositive') !== false) {
767
+ $aresult = explode('/', stristr($this->_agent, 'NetPositive'));
768
+ if (isset($aresult[1])) {
769
+ $aversion = explode(' ', $aresult[1]);
770
+ $this->setVersion(str_replace(array('(', ')', ';'), '', $aversion[0]));
771
+ $this->setBrowser(self::BROWSER_NETPOSITIVE);
772
+ return true;
773
+ }
774
+ }
775
+ return false;
776
+ }
777
+
778
+ /**
779
+ * Determine if the browser is Galeon or not (last updated 1.7)
780
+ * @return boolean True if the browser is Galeon otherwise false
781
+ */
782
+ protected function checkBrowserGaleon()
783
+ {
784
+ if (stripos($this->_agent, 'galeon') !== false) {
785
+ $aresult = explode(' ', stristr($this->_agent, 'galeon'));
786
+ $aversion = explode('/', $aresult[0]);
787
+ if (isset($aversion[1])) {
788
+ $this->setVersion($aversion[1]);
789
+ $this->setBrowser(self::BROWSER_GALEON);
790
+ return true;
791
+ }
792
+ }
793
+ return false;
794
+ }
795
+
796
+ /**
797
+ * Determine if the browser is Konqueror or not (last updated 1.7)
798
+ * @return boolean True if the browser is Konqueror otherwise false
799
+ */
800
+ protected function checkBrowserKonqueror()
801
+ {
802
+ if (stripos($this->_agent, 'Konqueror') !== false) {
803
+ $aresult = explode(' ', stristr($this->_agent, 'Konqueror'));
804
+ $aversion = explode('/', $aresult[0]);
805
+ if (isset($aversion[1])) {
806
+ $this->setVersion($aversion[1]);
807
+ $this->setBrowser(self::BROWSER_KONQUEROR);
808
+ return true;
809
+ }
810
+ }
811
+ return false;
812
+ }
813
+
814
+ /**
815
+ * Determine if the browser is iCab or not (last updated 1.7)
816
+ * @return boolean True if the browser is iCab otherwise false
817
+ */
818
+ protected function checkBrowserIcab()
819
+ {
820
+ if (stripos($this->_agent, 'icab') !== false) {
821
+ $aversion = explode(' ', stristr(str_replace('/', ' ', $this->_agent), 'icab'));
822
+ if (isset($aversion[1])) {
823
+ $this->setVersion($aversion[1]);
824
+ $this->setBrowser(self::BROWSER_ICAB);
825
+ return true;
826
+ }
827
+ }
828
+ return false;
829
+ }
830
+
831
+ /**
832
+ * Determine if the browser is OmniWeb or not (last updated 1.7)
833
+ * @return boolean True if the browser is OmniWeb otherwise false
834
+ */
835
+ protected function checkBrowserOmniWeb()
836
+ {
837
+ if (stripos($this->_agent, 'omniweb') !== false) {
838
+ $aresult = explode('/', stristr($this->_agent, 'omniweb'));
839
+ $aversion = explode(' ', isset($aresult[1]) ? $aresult[1] : "");
840
+ $this->setVersion($aversion[0]);
841
+ $this->setBrowser(self::BROWSER_OMNIWEB);
842
+ return true;
843
+ }
844
+ return false;
845
+ }
846
+
847
+ /**
848
+ * Determine if the browser is Phoenix or not (last updated 1.7)
849
+ * @return boolean True if the browser is Phoenix otherwise false
850
+ */
851
+ protected function checkBrowserPhoenix()
852
+ {
853
+ if (stripos($this->_agent, 'Phoenix') !== false) {
854
+ $aversion = explode('/', stristr($this->_agent, 'Phoenix'));
855
+ if (isset($aversion[1])) {
856
+ $this->setVersion($aversion[1]);
857
+ $this->setBrowser(self::BROWSER_PHOENIX);
858
+ return true;
859
+ }
860
+ }
861
+ return false;
862
+ }
863
+
864
+ /**
865
+ * Determine if the browser is Firebird or not (last updated 1.7)
866
+ * @return boolean True if the browser is Firebird otherwise false
867
+ */
868
+ protected function checkBrowserFirebird()
869
+ {
870
+ if (stripos($this->_agent, 'Firebird') !== false) {
871
+ $aversion = explode('/', stristr($this->_agent, 'Firebird'));
872
+ if (isset($aversion[1])) {
873
+ $this->setVersion($aversion[1]);
874
+ $this->setBrowser(self::BROWSER_FIREBIRD);
875
+ return true;
876
+ }
877
+ }
878
+ return false;
879
+ }
880
+
881
+ /**
882
+ * Determine if the browser is Netscape Navigator 9+ or not (last updated 1.7)
883
+ * NOTE: (http://browser.netscape.com/ - Official support ended on March 1st, 2008)
884
+ * @return boolean True if the browser is Netscape Navigator 9+ otherwise false
885
+ */
886
+ protected function checkBrowserNetscapeNavigator9Plus()
887
+ {
888
+ if (stripos($this->_agent, 'Firefox') !== false && preg_match('/Navigator\/([^ ]*)/i', $this->_agent, $matches)) {
889
+ $this->setVersion($matches[1]);
890
+ $this->setBrowser(self::BROWSER_NETSCAPE_NAVIGATOR);
891
+ return true;
892
+ } else if (stripos($this->_agent, 'Firefox') === false && preg_match('/Netscape6?\/([^ ]*)/i', $this->_agent, $matches)) {
893
+ $this->setVersion($matches[1]);
894
+ $this->setBrowser(self::BROWSER_NETSCAPE_NAVIGATOR);
895
+ return true;
896
+ }
897
+ return false;
898
+ }
899
+
900
+ /**
901
+ * Determine if the browser is Shiretoko or not (https://wiki.mozilla.org/Projects/shiretoko) (last updated 1.7)
902
+ * @return boolean True if the browser is Shiretoko otherwise false
903
+ */
904
+ protected function checkBrowserShiretoko()
905
+ {
906
+ if (stripos($this->_agent, 'Mozilla') !== false && preg_match('/Shiretoko\/([^ ]*)/i', $this->_agent, $matches)) {
907
+ $this->setVersion($matches[1]);
908
+ $this->setBrowser(self::BROWSER_SHIRETOKO);
909
+ return true;
910
+ }
911
+ return false;
912
+ }
913
+
914
+ /**
915
+ * Determine if the browser is Ice Cat or not (http://en.wikipedia.org/wiki/GNU_IceCat) (last updated 1.7)
916
+ * @return boolean True if the browser is Ice Cat otherwise false
917
+ */
918
+ protected function checkBrowserIceCat()
919
+ {
920
+ if (stripos($this->_agent, 'Mozilla') !== false && preg_match('/IceCat\/([^ ]*)/i', $this->_agent, $matches)) {
921
+ $this->setVersion($matches[1]);
922
+ $this->setBrowser(self::BROWSER_ICECAT);
923
+ return true;
924
+ }
925
+ return false;
926
+ }
927
+
928
+ /**
929
+ * Determine if the browser is Nokia or not (last updated 1.7)
930
+ * @return boolean True if the browser is Nokia otherwise false
931
+ */
932
+ protected function checkBrowserNokia()
933
+ {
934
+ if (preg_match("/Nokia([^\/]+)\/([^ SP]+)/i", $this->_agent, $matches)) {
935
+ $this->setVersion($matches[2]);
936
+ if (stripos($this->_agent, 'Series60') !== false || strpos($this->_agent, 'S60') !== false) {
937
+ $this->setBrowser(self::BROWSER_NOKIA_S60);
938
+ } else {
939
+ $this->setBrowser(self::BROWSER_NOKIA);
940
+ }
941
+ $this->setMobile(true);
942
+ return true;
943
+ }
944
+ return false;
945
+ }
946
+
947
+ /**
948
+ * Determine if the browser is Firefox or not (last updated 1.7)
949
+ * @return boolean True if the browser is Firefox otherwise false
950
+ */
951
+ protected function checkBrowserFirefox()
952
+ {
953
+ if (stripos($this->_agent, 'safari') === false) {
954
+ if (preg_match("/Firefox[\/ \(]([^ ;\)]+)/i", $this->_agent, $matches)) {
955
+ $this->setVersion($matches[1]);
956
+ $this->setBrowser(self::BROWSER_FIREFOX);
957
+ //Firefox on Android
958
+ if (stripos($this->_agent, 'Android') !== false) {
959
+ if (stripos($this->_agent, 'Mobile') !== false) {
960
+ $this->setMobile(true);
961
+ } else {
962
+ $this->setTablet(true);
963
+ }
964
+ }
965
+ return true;
966
+ } else if (preg_match("/Firefox$/i", $this->_agent, $matches)) {
967
+ $this->setVersion("");
968
+ $this->setBrowser(self::BROWSER_FIREFOX);
969
+ return true;
970
+ }
971
+ }
972
+ return false;
973
+ }
974
+
975
+ /**
976
+ * Determine if the browser is Firefox or not (last updated 1.7)
977
+ * @return boolean True if the browser is Firefox otherwise false
978
+ */
979
+ protected function checkBrowserIceweasel()
980
+ {
981
+ if (stripos($this->_agent, 'Iceweasel') !== false) {
982
+ $aresult = explode('/', stristr($this->_agent, 'Iceweasel'));
983
+ if (isset($aresult[1])) {
984
+ $aversion = explode(' ', $aresult[1]);
985
+ $this->setVersion($aversion[0]);
986
+ $this->setBrowser(self::BROWSER_ICEWEASEL);
987
+ return true;
988
+ }
989
+ }
990
+ return false;
991
+ }
992
+
993
+ /**
994
+ * Determine if the browser is Mozilla or not (last updated 1.7)
995
+ * @return boolean True if the browser is Mozilla otherwise false
996
+ */
997
+ protected function checkBrowserMozilla()
998
+ {
999
+ if (stripos($this->_agent, 'mozilla') !== false && preg_match('/rv:[0-9].[0-9][a-b]?/i', $this->_agent) && stripos($this->_agent, 'netscape') === false) {
1000
+ $aversion = explode(' ', stristr($this->_agent, 'rv:'));
1001
+ preg_match('/rv:[0-9].[0-9][a-b]?/i', $this->_agent, $aversion);
1002
+ $this->setVersion(str_replace('rv:', '', $aversion[0]));
1003
+ $this->setBrowser(self::BROWSER_MOZILLA);
1004
+ return true;
1005
+ } else if (stripos($this->_agent, 'mozilla') !== false && preg_match('/rv:[0-9]\.[0-9]/i', $this->_agent) && stripos($this->_agent, 'netscape') === false) {
1006
+ $aversion = explode('', stristr($this->_agent, 'rv:'));
1007
+ $this->setVersion(str_replace('rv:', '', $aversion[0]));
1008
+ $this->setBrowser(self::BROWSER_MOZILLA);
1009
+ return true;
1010
+ } else if (stripos($this->_agent, 'mozilla') !== false && preg_match('/mozilla\/([^ ]*)/i', $this->_agent, $matches) && stripos($this->_agent, 'netscape') === false) {
1011
+ $this->setVersion($matches[1]);
1012
+ $this->setBrowser(self::BROWSER_MOZILLA);
1013
+ return true;
1014
+ }
1015
+ return false;
1016
+ }
1017
+
1018
+ /**
1019
+ * Determine if the browser is Lynx or not (last updated 1.7)
1020
+ * @return boolean True if the browser is Lynx otherwise false
1021
+ */
1022
+ protected function checkBrowserLynx()
1023
+ {
1024
+ if (stripos($this->_agent, 'lynx') !== false) {
1025
+ $aresult = explode('/', stristr($this->_agent, 'Lynx'));
1026
+ $aversion = explode(' ', (isset($aresult[1]) ? $aresult[1] : ""));
1027
+ $this->setVersion($aversion[0]);
1028
+ $this->setBrowser(self::BROWSER_LYNX);
1029
+ return true;
1030
+ }
1031
+ return false;
1032
+ }
1033
+
1034
+ /**
1035
+ * Determine if the browser is Amaya or not (last updated 1.7)
1036
+ * @return boolean True if the browser is Amaya otherwise false
1037
+ */
1038
+ protected function checkBrowserAmaya()
1039
+ {
1040
+ if (stripos($this->_agent, 'amaya') !== false) {
1041
+ $aresult = explode('/', stristr($this->_agent, 'Amaya'));
1042
+ if (isset($aresult[1])) {
1043
+ $aversion = explode(' ', $aresult[1]);
1044
+ $this->setVersion($aversion[0]);
1045
+ $this->setBrowser(self::BROWSER_AMAYA);
1046
+ return true;
1047
+ }
1048
+ }
1049
+ return false;
1050
+ }
1051
+
1052
+ /**
1053
+ * Determine if the browser is Safari or not (last updated 1.7)
1054
+ * @return boolean True if the browser is Safari otherwise false
1055
+ */
1056
+ protected function checkBrowserSafari()
1057
+ {
1058
+ if (stripos($this->_agent, 'Safari') !== false
1059
+ && stripos($this->_agent, 'iPhone') === false
1060
+ && stripos($this->_agent, 'iPod') === false
1061
+ ) {
1062
+
1063
+ $aresult = explode('/', stristr($this->_agent, 'Version'));
1064
+ if (isset($aresult[1])) {
1065
+ $aversion = explode(' ', $aresult[1]);
1066
+ $this->setVersion($aversion[0]);
1067
+ } else {
1068
+ $this->setVersion(self::VERSION_UNKNOWN);
1069
+ }
1070
+ $this->setBrowser(self::BROWSER_SAFARI);
1071
+ return true;
1072
+ }
1073
+ return false;
1074
+ }
1075
+
1076
+ /**
1077
+ * Detect if URL is loaded from FacebookExternalHit
1078
+ * @return boolean True if it detects FacebookExternalHit otherwise false
1079
+ */
1080
+ protected function checkFacebookExternalHit()
1081
+ {
1082
+ if (stristr($this->_agent, 'FacebookExternalHit')) {
1083
+ $this->setRobot(true);
1084
+ $this->setFacebook(true);
1085
+ return true;
1086
+ }
1087
+ return false;
1088
+ }
1089
+
1090
+ /**
1091
+ * Detect if URL is being loaded from internal Facebook browser
1092
+ * @return boolean True if it detects internal Facebook browser otherwise false
1093
+ */
1094
+ protected function checkForFacebookIos()
1095
+ {
1096
+ if (stristr($this->_agent, 'FBIOS')) {
1097
+ $this->setFacebook(true);
1098
+ return true;
1099
+ }
1100
+ return false;
1101
+ }
1102
+
1103
+ /**
1104
+ * Detect Version for the Safari browser on iOS devices
1105
+ * @return boolean True if it detects the version correctly otherwise false
1106
+ */
1107
+ protected function getSafariVersionOnIos()
1108
+ {
1109
+ $aresult = explode('/', stristr($this->_agent, 'Version'));
1110
+ if (isset($aresult[1])) {
1111
+ $aversion = explode(' ', $aresult[1]);
1112
+ $this->setVersion($aversion[0]);
1113
+ return true;
1114
+ }
1115
+ return false;
1116
+ }
1117
+
1118
+ /**
1119
+ * Detect Version for the Chrome browser on iOS devices
1120
+ * @return boolean True if it detects the version correctly otherwise false
1121
+ */
1122
+ protected function getChromeVersionOnIos()
1123
+ {
1124
+ $aresult = explode('/', stristr($this->_agent, 'CriOS'));
1125
+ if (isset($aresult[1])) {
1126
+ $aversion = explode(' ', $aresult[1]);
1127
+ $this->setVersion($aversion[0]);
1128
+ $this->setBrowser(self::BROWSER_CHROME);
1129
+ return true;
1130
+ }
1131
+ return false;
1132
+ }
1133
+
1134
+ /**
1135
+ * Determine if the browser is iPhone or not (last updated 1.7)
1136
+ * @return boolean True if the browser is iPhone otherwise false
1137
+ */
1138
+ protected function checkBrowseriPhone()
1139
+ {
1140
+ if (stripos($this->_agent, 'iPhone') !== false) {
1141
+ $this->setVersion(self::VERSION_UNKNOWN);
1142
+ $this->setBrowser(self::BROWSER_IPHONE);
1143
+ $this->getSafariVersionOnIos();
1144
+ $this->getChromeVersionOnIos();
1145
+ $this->checkForFacebookIos();
1146
+ $this->setMobile(true);
1147
+ return true;
1148
+ }
1149
+ return false;
1150
+ }
1151
+
1152
+ /**
1153
+ * Determine if the browser is iPad or not (last updated 1.7)
1154
+ * @return boolean True if the browser is iPad otherwise false
1155
+ */
1156
+ protected function checkBrowseriPad()
1157
+ {
1158
+ if (stripos($this->_agent, 'iPad') !== false) {
1159
+ $this->setVersion(self::VERSION_UNKNOWN);
1160
+ $this->setBrowser(self::BROWSER_IPAD);
1161
+ $this->getSafariVersionOnIos();
1162
+ $this->getChromeVersionOnIos();
1163
+ $this->checkForFacebookIos();
1164
+ $this->setTablet(true);
1165
+ return true;
1166
+ }
1167
+ return false;
1168
+ }
1169
+
1170
+ /**
1171
+ * Determine if the browser is iPod or not (last updated 1.7)
1172
+ * @return boolean True if the browser is iPod otherwise false
1173
+ */
1174
+ protected function checkBrowseriPod()
1175
+ {
1176
+ if (stripos($this->_agent, 'iPod') !== false) {
1177
+ $this->setVersion(self::VERSION_UNKNOWN);
1178
+ $this->setBrowser(self::BROWSER_IPOD);
1179
+ $this->getSafariVersionOnIos();
1180
+ $this->getChromeVersionOnIos();
1181
+ $this->checkForFacebookIos();
1182
+ $this->setMobile(true);
1183
+ return true;
1184
+ }
1185
+ return false;
1186
+ }
1187
+
1188
+ /**
1189
+ * Determine if the browser is Android or not (last updated 1.7)
1190
+ * @return boolean True if the browser is Android otherwise false
1191
+ */
1192
+ protected function checkBrowserAndroid()
1193
+ {
1194
+ if (stripos($this->_agent, 'Android') !== false) {
1195
+ $aresult = explode(' ', stristr($this->_agent, 'Android'));
1196
+ if (isset($aresult[1])) {
1197
+ $aversion = explode(' ', $aresult[1]);
1198
+ $this->setVersion($aversion[0]);
1199
+ } else {
1200
+ $this->setVersion(self::VERSION_UNKNOWN);
1201
+ }
1202
+ if (stripos($this->_agent, 'Mobile') !== false) {
1203
+ $this->setMobile(true);
1204
+ } else {
1205
+ $this->setTablet(true);
1206
+ }
1207
+ $this->setBrowser(self::BROWSER_ANDROID);
1208
+ return true;
1209
+ }
1210
+ return false;
1211
+ }
1212
+
1213
+ /**
1214
+ * Determine the user's platform (last updated 1.7)
1215
+ */
1216
+ protected function checkPlatform()
1217
+ {
1218
+ if (stripos($this->_agent, 'windows') !== false) {
1219
+ $this->_platform = self::PLATFORM_WINDOWS;
1220
+ } else if (stripos($this->_agent, 'iPad') !== false) {
1221
+ $this->_platform = self::PLATFORM_IPAD;
1222
+ } else if (stripos($this->_agent, 'iPod') !== false) {
1223
+ $this->_platform = self::PLATFORM_IPOD;
1224
+ } else if (stripos($this->_agent, 'iPhone') !== false) {
1225
+ $this->_platform = self::PLATFORM_IPHONE;
1226
+ } elseif (stripos($this->_agent, 'mac') !== false) {
1227
+ $this->_platform = self::PLATFORM_APPLE;
1228
+ } elseif (stripos($this->_agent, 'android') !== false) {
1229
+ $this->_platform = self::PLATFORM_ANDROID;
1230
+ } elseif (stripos($this->_agent, 'linux') !== false) {
1231
+ $this->_platform = self::PLATFORM_LINUX;
1232
+ } else if (stripos($this->_agent, 'Nokia') !== false) {
1233
+ $this->_platform = self::PLATFORM_NOKIA;
1234
+ } else if (stripos($this->_agent, 'BlackBerry') !== false) {
1235
+ $this->_platform = self::PLATFORM_BLACKBERRY;
1236
+ } elseif (stripos($this->_agent, 'FreeBSD') !== false) {
1237
+ $this->_platform = self::PLATFORM_FREEBSD;
1238
+ } elseif (stripos($this->_agent, 'OpenBSD') !== false) {
1239
+ $this->_platform = self::PLATFORM_OPENBSD;
1240
+ } elseif (stripos($this->_agent, 'NetBSD') !== false) {
1241
+ $this->_platform = self::PLATFORM_NETBSD;
1242
+ } elseif (stripos($this->_agent, 'OpenSolaris') !== false) {
1243
+ $this->_platform = self::PLATFORM_OPENSOLARIS;
1244
+ } elseif (stripos($this->_agent, 'SunOS') !== false) {
1245
+ $this->_platform = self::PLATFORM_SUNOS;
1246
+ } elseif (stripos($this->_agent, 'OS\/2') !== false) {
1247
+ $this->_platform = self::PLATFORM_OS2;
1248
+ } elseif (stripos($this->_agent, 'BeOS') !== false) {
1249
+ $this->_platform = self::PLATFORM_BEOS;
1250
+ } elseif (stripos($this->_agent, 'win') !== false) {
1251
+ $this->_platform = self::PLATFORM_WINDOWS;
1252
+ }
1253
+
1254
+ }
1255
+ }
includes/calendars/admin/default-calendar-admin.php CHANGED
@@ -85,18 +85,6 @@ class Default_Calendar_Admin {
85
  </thead>
86
  <tbody class="simcal-panel-section">
87
 
88
- <tr class="simcal-panel-field simcal-default-calendar-grid simcal-default-calendar-list" style="display: none;">
89
- <th></th>
90
- <td>
91
- <p class="description">
92
- <?php _e( "Tip: If calendar styles appear to be missing and/or navigation isn't working, try going to", 'google-calendar-events' ); ?>
93
- <a href="<?php echo esc_url( add_query_arg( array ( 'page' => 'simple-calendar_settings', 'tab' => 'advanced' ), admin_url( 'admin.php' ) ) ); ?>">
94
- <?php _e( 'Calendars &rarr; Settings &rarr; Advanced', 'google-calendar-events' ); ?></a>
95
- <?php _e( 'and enable', 'google-calendar-events' ); ?> <strong><?php _e( 'Always Enqueue', 'google-calendar-events' ); ?></strong>.
96
- </p>
97
- </td>
98
- </tr>
99
-
100
  <tr class="simcal-panel-field simcal-default-calendar-grid" style="display: none;">
101
  <th><label for="_default_calendar_event_bubbles_action"><?php _e( 'Event bubbles', 'google-calendar-events' ); ?></label></th>
102
  <td>
85
  </thead>
86
  <tbody class="simcal-panel-section">
87
 
 
 
 
 
 
 
 
 
 
 
 
 
88
  <tr class="simcal-panel-field simcal-default-calendar-grid" style="display: none;">
89
  <th><label for="_default_calendar_event_bubbles_action"><?php _e( 'Event bubbles', 'google-calendar-events' ); ?></label></th>
90
  <td>
includes/calendars/views/default-calendar-grid.php CHANGED
@@ -293,9 +293,12 @@ class Default_Calendar_Grid implements Calendar_View {
293
  return '';
294
  }
295
  }
296
- date_default_timezone_set( $calendar->timezone );
297
  $events = $calendar->events;
298
 
 
 
 
299
  // Variables to cycle days in current month and find today in calendar.
300
  $now = $calendar->now;
301
  $current = Carbon::create( $year, $month, 1, 0, 0, 0, $calendar->timezone );
@@ -401,6 +404,12 @@ class Default_Calendar_Grid implements Calendar_View {
401
 
402
  if ( $event instanceof Event ) :
403
 
 
 
 
 
 
 
404
  // Store the calendar id where the event belongs (useful in grouped calendar feeds)
405
  $calendar_class = 'simcal-events-calendar-' . strval( $event->calendar );
406
  $calendar_classes[] = $calendar_class ;
293
  return '';
294
  }
295
  }
296
+
297
  $events = $calendar->events;
298
 
299
+ $feed = simcal_get_feed( $calendar );
300
+ $feed_timezone = get_post_meta( $feed->post_id, '_feed_timezone', true );
301
+
302
  // Variables to cycle days in current month and find today in calendar.
303
  $now = $calendar->now;
304
  $current = Carbon::create( $year, $month, 1, 0, 0, 0, $calendar->timezone );
404
 
405
  if ( $event instanceof Event ) :
406
 
407
+ if ( $feed->type == 'grouped-calendars' ) {
408
+ date_default_timezone_set( $feed_timezone );
409
+ } else {
410
+ date_default_timezone_set( $event->timezone );
411
+ }
412
+
413
  // Store the calendar id where the event belongs (useful in grouped calendar feeds)
414
  $calendar_class = 'simcal-events-calendar-' . strval( $event->calendar );
415
  $calendar_classes[] = $calendar_class ;
includes/calendars/views/default-calendar-list.php CHANGED
@@ -444,7 +444,8 @@ class Default_Calendar_List implements Calendar_View {
444
  }
445
  }
446
 
447
- date_default_timezone_set( $calendar->timezone );
 
448
 
449
  $now = $calendar->now;
450
  $current_events = $this->get_events( $timestamp );
@@ -471,6 +472,8 @@ class Default_Calendar_List implements Calendar_View {
471
 
472
  foreach ( $current_events as $ymd => $events ) :
473
 
 
 
474
  // This is where we can find out if an event is a multi-day event and if it needs to be shown.
475
  // Since this is for list view we are showing the event on the day viewed if it is part of that day even when
476
  // expand multi-day events are turned off.
@@ -536,8 +539,15 @@ class Default_Calendar_List implements Calendar_View {
536
 
537
  foreach ( $events as $day_events ) :
538
  foreach ( $day_events as $event ) :
 
539
  if ( $event instanceof Event ) :
540
 
 
 
 
 
 
 
541
  $event_classes = $event_visibility = '';
542
 
543
  $calendar_class = 'simcal-events-calendar-' . strval( $event->calendar );
444
  }
445
  }
446
 
447
+ $feed = simcal_get_feed( $calendar );
448
+ $feed_timezone = get_post_meta( $feed->post_id, '_feed_timezone', true );
449
 
450
  $now = $calendar->now;
451
  $current_events = $this->get_events( $timestamp );
472
 
473
  foreach ( $current_events as $ymd => $events ) :
474
 
475
+
476
+
477
  // This is where we can find out if an event is a multi-day event and if it needs to be shown.
478
  // Since this is for list view we are showing the event on the day viewed if it is part of that day even when
479
  // expand multi-day events are turned off.
539
 
540
  foreach ( $events as $day_events ) :
541
  foreach ( $day_events as $event ) :
542
+
543
  if ( $event instanceof Event ) :
544
 
545
+ if ( $feed->type == 'grouped-calendars' ) {
546
+ date_default_timezone_set( $feed_timezone );
547
+ } else {
548
+ date_default_timezone_set( $event->timezone );
549
+ }
550
+
551
  $event_classes = $event_visibility = '';
552
 
553
  $calendar_class = 'simcal-events-calendar-' . strval( $event->calendar );
includes/events/event-builder.php CHANGED
@@ -177,7 +177,7 @@ class Event_Builder {
177
  // Removes extra consecutive <br> tags.
178
  // TODO: Doesn't seem to work but going to remove it to allow multiple <br> tags in the editor
179
  /*return preg_replace( '#(<br *//*?>\s*)+#i', '<br />', trim( $result ) );*/
180
- return trim( $result );
181
  }
182
 
183
  /**
177
  // Removes extra consecutive <br> tags.
178
  // TODO: Doesn't seem to work but going to remove it to allow multiple <br> tags in the editor
179
  /*return preg_replace( '#(<br *//*?>\s*)+#i', '<br />', trim( $result ) );*/
180
+ return do_shortcode( trim( $result ) );
181
  }
182
 
183
  /**
includes/feeds/google.php CHANGED
@@ -205,8 +205,29 @@ class Google extends Feed {
205
  $whole_day = true;
206
  } else {
207
  $date = Carbon::parse( $event->getStart()->dateTime );
208
- $google_start = Carbon::create( $date->year, $date->month, $date->day, $date->hour, $date->minute, $date->second, $start_timezone );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
209
  $google_start_utc = Carbon::create( $date->year, $date->month, $date->day, $date->hour, $date->minute, $date->second, 'UTC' );
 
 
210
  }
211
  // Start.
212
  $start = $google_start->getTimestamp();
@@ -230,7 +251,26 @@ class Google extends Feed {
230
  $google_end = Carbon::createFromDate( $date->year, $date->month, $date->day, $end_timezone )->startOfDay()->subSeconds( 59 );
231
  $google_end_utc = Carbon::createFromDate( $date->year, $date->month, $date->day, 'UTC' )->startOfDay()->subSeconds( 59 );
232
  } else {
233
- $date = Carbon::parse( $event->getEnd()->dateTime );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
234
  $google_end = Carbon::create( $date->year, $date->month, $date->day, $date->hour, $date->minute, $date->second, $end_timezone );
235
  $google_end_utc = Carbon::create( $date->year, $date->month, $date->day, $date->hour, $date->minute, $date->second, 'UTC' );
236
  }
205
  $whole_day = true;
206
  } else {
207
  $date = Carbon::parse( $event->getStart()->dateTime );
208
+
209
+ // Check if there is an event level timezone
210
+ if( $event->getStart()->timeZone && 'use_calendar' == $this->timezone_setting ) {
211
+
212
+ // Get the two different times with the separate timezones so we can check the offsets next
213
+ $google_start1 = Carbon::create( $date->year, $date->month, $date->day, $date->hour, $date->minute, $date->second, $date->timezone );
214
+ $google_start2 = Carbon::create( $date->year, $date->month, $date->day, $date->hour, $date->minute, $date->second, $event->getStart()->timeZone );
215
+
216
+ // Get the offset in hours
217
+ $offset1 = $google_start1->offsetHours;
218
+ $offset2 = $google_start2->offsetHours;
219
+
220
+ // Get the difference between the two timezones
221
+ $total_offset = ( $offset2 - $offset1 );
222
+
223
+ // Add the hours offset to the date hour
224
+ $date->hour += $total_offset;
225
+ }
226
+
227
+ $google_start = Carbon::create( $date->year, $date->month, $date->day, $date->hour, $date->minute, $date->second, $start_timezone );
228
  $google_start_utc = Carbon::create( $date->year, $date->month, $date->day, $date->hour, $date->minute, $date->second, 'UTC' );
229
+
230
+ $this->timezone = $start_timezone;
231
  }
232
  // Start.
233
  $start = $google_start->getTimestamp();
251
  $google_end = Carbon::createFromDate( $date->year, $date->month, $date->day, $end_timezone )->startOfDay()->subSeconds( 59 );
252
  $google_end_utc = Carbon::createFromDate( $date->year, $date->month, $date->day, 'UTC' )->startOfDay()->subSeconds( 59 );
253
  } else {
254
+ $date = Carbon::parse( $event->getEnd()->dateTime );
255
+
256
+ // Check if there is an event level timezone
257
+ if( $event->getEnd()->timeZone && 'use_calendar' == $this->timezone_setting ) {
258
+
259
+ // Get the two different times with the separate timezones so we can check the offsets next
260
+ $google_start1 = Carbon::create( $date->year, $date->month, $date->day, $date->hour, $date->minute, $date->second, $date->timezone );
261
+ $google_start2 = Carbon::create( $date->year, $date->month, $date->day, $date->hour, $date->minute, $date->second, $event->getEnd()->timeZone );
262
+
263
+ // Get the offset in hours
264
+ $offset1 = $google_start1->offsetHours;
265
+ $offset2 = $google_start2->offsetHours;
266
+
267
+ // Get the difference between the two timezones
268
+ $total_offset = ( $offset2 - $offset1 );
269
+
270
+ // Add the hours offset to the date hour
271
+ $date->hour += $total_offset;
272
+ }
273
+
274
  $google_end = Carbon::create( $date->year, $date->month, $date->day, $date->hour, $date->minute, $date->second, $end_timezone );
275
  $google_end_utc = Carbon::create( $date->year, $date->month, $date->day, $date->hour, $date->minute, $date->second, 'UTC' );
276
  }
includes/functions/admin.php CHANGED
@@ -233,7 +233,7 @@ function simcal_delete_admin_notices() {
233
  */
234
  function simcal_print_shortcode_tip( $post_id ) {
235
 
236
- $browser = new \Browser();
237
  if ( $browser::PLATFORM_APPLE == $browser->getPlatform() ) {
238
  $cmd = '&#8984;&#43;C';
239
  } else {
@@ -289,7 +289,7 @@ function simcal_newsletter_signup() {
289
  if ( $screen = simcal_is_admin_screen() ) {
290
 
291
  global $current_user;
292
- get_currentuserinfo();
293
 
294
  $name = $current_user->user_firstname ? $current_user->user_firstname : '';
295
 
@@ -334,62 +334,4 @@ function simcal_newsletter_signup() {
334
  <?php
335
 
336
  }
337
-
338
- }
339
-
340
- if ( ! function_exists( 'mb_detect_encoding' ) ) {
341
-
342
- /**
343
- * Fallback function for `mb_detect_encoding()`,
344
- * php_mbstring module in the php.ini could be missing.
345
- *
346
- * @since 3.0.0
347
- *
348
- * @param string $string
349
- * @param null $enc
350
- * @param null $ret
351
- *
352
- * @return bool
353
- */
354
- function mb_detect_encoding( $string, $enc = null, $ret = null ) {
355
-
356
- static $enclist = array(
357
- 'UTF-8',
358
- 'ASCII',
359
- 'ISO-8859-1',
360
- 'ISO-8859-2',
361
- 'ISO-8859-3',
362
- 'ISO-8859-4',
363
- 'ISO-8859-5',
364
- 'ISO-8859-6',
365
- 'ISO-8859-7',
366
- 'ISO-8859-8',
367
- 'ISO-8859-9',
368
- 'ISO-8859-10',
369
- 'ISO-8859-13',
370
- 'ISO-8859-14',
371
- 'ISO-8859-15',
372
- 'ISO-8859-16',
373
- 'Windows-1251',
374
- 'Windows-1252',
375
- 'Windows-1254',
376
- );
377
-
378
- $result = false;
379
-
380
- foreach ( $enclist as $item ) {
381
- $sample = iconv( $item, $item, $string );
382
- if ( md5( $sample ) == md5( $string ) ) {
383
- if ( $ret === null ) {
384
- $result = $item;
385
- } else {
386
- $result = true;
387
- }
388
- break;
389
- }
390
- }
391
-
392
- return $result;
393
- }
394
-
395
  }
233
  */
234
  function simcal_print_shortcode_tip( $post_id ) {
235
 
236
+ $browser = new \SimpleCalendar\Browser();
237
  if ( $browser::PLATFORM_APPLE == $browser->getPlatform() ) {
238
  $cmd = '&#8984;&#43;C';
239
  } else {
289
  if ( $screen = simcal_is_admin_screen() ) {
290
 
291
  global $current_user;
292
+ wp_get_current_user();
293
 
294
  $name = $current_user->user_firstname ? $current_user->user_firstname : '';
295
 
334
  <?php
335
 
336
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
337
  }
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === Simple Calendar - Google Calendar Plugin ===
2
  Contributors: moonstonemedia, pderksen, nickyoung87, nekojira, rosshanney
3
  Tags: calendar, calendars, calendar manager, custom calendar, custom calendars, event, events, events feed, google calendar, google
4
- Requires at least: 4.0
5
- Tested up to: 4.4
6
- Stable tag: 3.0.14
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -82,6 +82,16 @@ We'd love your help! Here's a few things you can do:
82
 
83
  == Changelog ==
84
 
 
 
 
 
 
 
 
 
 
 
85
  = 3.0.14 - February 10, 2016 =
86
 
87
  * Fix: Updated schema to pass W3C validation. Props [@martinburchell](https://github.com/martinburchell)
1
  === Simple Calendar - Google Calendar Plugin ===
2
  Contributors: moonstonemedia, pderksen, nickyoung87, nekojira, rosshanney
3
  Tags: calendar, calendars, calendar manager, custom calendar, custom calendars, event, events, events feed, google calendar, google
4
+ Requires at least: 4.1
5
+ Tested up to: 4.5
6
+ Stable tag: 3.0.15
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
82
 
83
  == Changelog ==
84
 
85
+ = 3.0.15 - March 19, 2016 =
86
+
87
+ * Fix: Timezone issues with event source option should now work correctly.
88
+ * Fix: Tooltips should no longer be empty after a resize.
89
+ * Tweak: Removed event source option for grouped calendars.
90
+ * Tweak: Allow other plugin or theme shortcodes to be used in the event template.
91
+ * Dev: Removed Browser.php from composer so we can use it standalone with customizations.
92
+ * Dev: Constructor for Browser.php now compatible with future versions of PHP.
93
+ * Dev: Removed PHP 5.2 compatibility code.
94
+
95
  = 3.0.14 - February 10, 2016 =
96
 
97
  * Fix: Updated schema to pass W3C validation. Props [@martinburchell](https://github.com/martinburchell)
vendor/autoload_52.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
 
7
- return ComposerAutoloaderInit8a66826007d5643bdcfe624684800d5a::getLoader();
4
 
5
  require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
 
7
+ return ComposerAutoloaderInit52f18c863cfacef7cbaf78b5fc45c210::getLoader();
vendor/cbschuld/browser.php/LICENSE.md DELETED
@@ -1,7 +0,0 @@
1
- Copyright (c) 2013 Chris Schuld
2
-
3
- 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:
4
-
5
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
-
7
- 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.
 
 
 
 
 
 
 
vendor/cbschuld/browser.php/README.md DELETED
@@ -1,147 +0,0 @@
1
- Browser.php
2
- =============
3
-
4
- [![Build Status](https://travis-ci.org/cbschuld/Browser.php.png?branch=master)](https://travis-ci.org/cbschuld/Browser.php)
5
-
6
- Helps detect the user's browser and platform at the PHP level via the user agent
7
-
8
-
9
- Installation
10
- ============
11
-
12
- To install, simply `require` the `Browser.php` file under `lib`.
13
-
14
- You can also install it via `Composer` by using the [Packagist archive](https://packagist.org/packages/cbschuld/browser.php).
15
-
16
-
17
- Background
18
- ============
19
-
20
- Detecting the user's browser type and version is helpful in web applications that harness some of the newer bleeding edge concepts. With the browser type and version you can notify users about challenges they may experience and suggest they upgrade before using such application. Not a great idea on a large scale public site; but on a private application this type of check can be helpful.
21
-
22
- In an active project of mine we have a pretty graphically intensive and visually appealing user interface which leverages a lot of transparent PNG files. Because we all know how great IE6 supports PNG files it was necessary for us to tell our users the lack of power their browser has in a kind way.
23
-
24
- Searching for a way to do this at the PHP layer and not at the client layer was more of a challenge than I would have guessed; the only script available was written by Gary White and Gary no longer maintains this script because of reliability. I do agree 100% with Gary about the readability; however, there are realistic reasons to desire the user.s browser and browser version and if your visitor is not echoing a false user agent we can take an educated guess.
25
-
26
- I based this solution off of Gary White.s original solution but added a few things:
27
-
28
- I added the ability to view the return values as class constants to increase the readability
29
-
30
- * Updated the version detection for Amaya
31
- * Updated the version detection for Firefox
32
- * Updated the version detection for Lynx
33
- * Updated the version detection for WebTV
34
- * Updated the version detection for NetPositive
35
- * Updated the version detection for IE
36
- * Updated the version detection for OmniWeb
37
- * Updated the version detection for iCab
38
- * Updated the version detection for Safari
39
- * Added detection for Chrome
40
- * Added detection for iPhone
41
- * Added detection for robots
42
- * Added detection for mobile devices
43
- * Added detection for BlackBerry
44
- * Added detection for iPhone
45
- * Added detection for iPad
46
- * Added detection for Android
47
- * Removed Netscape checks
48
- * Updated Safari to remove mobile devices (iPhone)
49
-
50
- **This solution identifies the following Operating Systems:**
51
-
52
- * Windows (Browser::PLATFORM_WINDOWS)
53
- * Windows CE (Browser::PLATFORM_WINDOWS_CE)
54
- * Apple (Browser::PLATFORM_APPLE)
55
- * Linux (Browser::PLATFORM_LINUX)
56
- * Android (Browser::PLATFORM_ANDROID)
57
- * OS/2 (Browser::PLATFORM_OS2)
58
- * BeOS (Browser::PLATFORM_BEOS)
59
- * iPhone (Browser::PLATFORM_IPHONE)
60
- * iPod (Browser::PLATFORM_IPOD)
61
- * BlackBerry (Browser::PLATFORM_BLACKBERRY)
62
- * FreeBSD (Browser::PLATFORM_FREEBSD)
63
- * OpenBSD (Browser::PLATFORM_OPENBSD)
64
- * NetBSD (Browser::PLATFORM_NETBSD)
65
- * SunOS (Browser::PLATFORM_SUNOS)
66
- * OpenSolaris (Browser::PLATFORM_OPENSOLARIS)
67
- * iPad (Browser::PLATFORM_IPAD)
68
-
69
- **This solution identifies the following Browsers and does a best-guess on the version:**
70
-
71
- * Opera (Browser::BROWSER_OPERA)
72
- * WebTV (Browser::BROWSER_WEBTV)
73
- * NetPositive (Browser::BROWSER_NETPOSITIVE)
74
- * Internet Explorer (Browser::BROWSER_IE)
75
- * Pocket Internet Explorer (Browser::BROWSER_POCKET_IE)
76
- * Galeon (Browser::BROWSER_GALEON)
77
- * Konqueror (Browser::BROWSER_KONQUEROR)
78
- * iCab (Browser::BROWSER_ICAB)
79
- * OmniWeb (Browser::BROWSER_OMNIWEB)
80
- * Phoenix (Browser::BROWSER_PHOENIX)
81
- * Firebird (Browser::BROWSER_FIREBIRD)
82
- * Firefox (Browser::BROWSER_FIREFOX)
83
- * Mozilla (Browser::BROWSER_MOZILLA)
84
- * Amaya (Browser::BROWSER_AMAYA)
85
- * Lynx (Browser::BROWSER_LYNX)
86
- * Safari (Browser::BROWSER_SAFARI)
87
- * iPhone (Browser::BROWSER_IPHONE)
88
- * iPod (Browser::BROWSER_IPOD)
89
- * Google.s Android(Browser::BROWSER_ANDROID)
90
- * Google.s Chrome(Browser::BROWSER_CHROME)
91
- * GoogleBot(Browser::BROWSER_GOOGLEBOT)
92
- * Yahoo!.s Slurp(Browser::BROWSER_SLURP)
93
- * W3C.s Validator(Browser::BROWSER_W3CVALIDATOR)
94
- * BlackBerry(Browser::BROWSER_BLACKBERRY)
95
-
96
- **Typical Usage:**
97
-
98
- ```php
99
- $browser = new Browser();
100
- if( $browser->getBrowser() == Browser::BROWSER_FIREFOX && $browser->getVersion() >= 2 ) {
101
- echo 'You have FireFox version 2 or greater';
102
- }
103
- ```
104
-
105
- 12/9/2008 Update
106
- * removed an unused constant and renamed the constructor to use the PHP magic method __construct (thanks to Robin for locating the legacy constant and suggesting the use of the magic method).
107
-
108
- 2/19/2009 Update
109
- * updated typical usage to show a correct example! (thanks David!)
110
-
111
- 2/24/2009 Update
112
- * fixed typo in the usage! (thanks Adam!)
113
-
114
- 3/14/2009 Update
115
- * added support for the iPod; added iPod and iPhone as platforms; added Google.s Android
116
-
117
- 4/22/2009 Update
118
- * added support for GoogleBot, the W3C Validator and Yahoo! Slurp
119
-
120
- 4/27/2009 Update
121
- * John pointed out a terrible typo (see below) . removed the typo
122
-
123
- 11/08/2009 Update
124
- * A lot of changes to the script, thank you to everyone for the suggestions and emails. This release should add all of the requested features. Added BlackBerry, mobile detection, Opera Mini support, robot detection, Opera 10.s UserAgent .mess., detection for IceCat and Shiretoko!
125
-
126
- 3/7/2010 Update
127
- * Version 1.7 was a *MAJOR* Rebuild (preg_match and other .slow. routine removal(s)) included the following changes:
128
- * Almost allof Gary.s original code has been replaced
129
- * Large PHPUNIT testing environment created to validate new releases and additions
130
- * Added FreeBSD Platform
131
- * Added OpenBSD Platform
132
- * Added NetBSD Platform
133
- * Added SunOS Platform
134
- * Added OpenSolaris Platform
135
- * Added support of the Iceweazel Browser
136
- * Added isChromeFrame() call to check if chromeframe is in use
137
- * Moved the Opera check in front of the Firefox check due to legacy Opera User Agents
138
- * Added the __toString() method (Thanks Deano)
139
-
140
- 4/27/2010: Update (Version 1.8)
141
- * Added iPad support
142
-
143
- 8/20/2010: Update (Version 1.9)
144
- * Added MSN Explorer Browser
145
- * Added Bing/MSN Robot
146
- * Added the Android Platform
147
- * Fixed issue with Android 1.6/2.2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/cbschuld/browser.php/composer.json DELETED
@@ -1,18 +0,0 @@
1
- {
2
- "name": "cbschuld/browser.php",
3
- "description": "",
4
- "version": "1.0.0",
5
- "keywords": ["browser", "user agent", "detection"],
6
- "homepage": "http://chrisschuld.com/projects/browser-php-detecting-a-users-browser-from-php.html",
7
- "license": "MIT",
8
- "authors": [
9
- {
10
- "name": "Chris Schuld",
11
- "email": "chris@chrisschuld.com",
12
- "homepage": "http://chrisschuld.com"
13
- }
14
- ],
15
- "autoload": {
16
- "files": ["lib/Browser.php"]
17
- }
18
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/cbschuld/browser.php/lib/Browser.php DELETED
@@ -1,1282 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * File: Browser.php
5
- * Author: Chris Schuld (http://chrisschuld.com/)
6
- * Last Modified: July 4th, 2014
7
- * @version 1.9
8
- * @package PegasusPHP
9
- *
10
- * Copyright (C) 2008-2010 Chris Schuld (chris@chrisschuld.com)
11
- *
12
- * This program is free software; you can redistribute it and/or
13
- * modify it under the terms of the GNU General Public License as
14
- * published by the Free Software Foundation; either version 2 of
15
- * the License, or (at your option) any later version.
16
- *
17
- * This program is distributed in the hope that it will be useful,
18
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
19
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
- * GNU General Public License for more details at:
21
- * http://www.gnu.org/copyleft/gpl.html
22
- *
23
- *
24
- * Typical Usage:
25
- *
26
- * $browser = new Browser();
27
- * if( $browser->getBrowser() == Browser::BROWSER_FIREFOX && $browser->getVersion() >= 2 ) {
28
- * echo 'You have FireFox version 2 or greater';
29
- * }
30
- *
31
- * User Agents Sampled from: http://www.useragentstring.com/
32
- *
33
- * This implementation is based on the original work from Gary White
34
- * http://apptools.com/phptools/browser/
35
- *
36
- */
37
-
38
- class Browser
39
- {
40
- private $_agent = '';
41
- private $_browser_name = '';
42
- private $_version = '';
43
- private $_platform = '';
44
- private $_os = '';
45
- private $_is_aol = false;
46
- private $_is_mobile = false;
47
- private $_is_tablet = false;
48
- private $_is_robot = false;
49
- private $_is_facebook = false;
50
- private $_aol_version = '';
51
-
52
- const BROWSER_UNKNOWN = 'unknown';
53
- const VERSION_UNKNOWN = 'unknown';
54
-
55
- const BROWSER_OPERA = 'Opera'; // http://www.opera.com/
56
- const BROWSER_OPERA_MINI = 'Opera Mini'; // http://www.opera.com/mini/
57
- const BROWSER_WEBTV = 'WebTV'; // http://www.webtv.net/pc/
58
- const BROWSER_IE = 'Internet Explorer'; // http://www.microsoft.com/ie/
59
- const BROWSER_POCKET_IE = 'Pocket Internet Explorer'; // http://en.wikipedia.org/wiki/Internet_Explorer_Mobile
60
- const BROWSER_KONQUEROR = 'Konqueror'; // http://www.konqueror.org/
61
- const BROWSER_ICAB = 'iCab'; // http://www.icab.de/
62
- const BROWSER_OMNIWEB = 'OmniWeb'; // http://www.omnigroup.com/applications/omniweb/
63
- const BROWSER_FIREBIRD = 'Firebird'; // http://www.ibphoenix.com/
64
- const BROWSER_FIREFOX = 'Firefox'; // http://www.mozilla.com/en-US/firefox/firefox.html
65
- const BROWSER_ICEWEASEL = 'Iceweasel'; // http://www.geticeweasel.org/
66
- const BROWSER_SHIRETOKO = 'Shiretoko'; // http://wiki.mozilla.org/Projects/shiretoko
67
- const BROWSER_MOZILLA = 'Mozilla'; // http://www.mozilla.com/en-US/
68
- const BROWSER_AMAYA = 'Amaya'; // http://www.w3.org/Amaya/
69
- const BROWSER_LYNX = 'Lynx'; // http://en.wikipedia.org/wiki/Lynx
70
- const BROWSER_SAFARI = 'Safari'; // http://apple.com
71
- const BROWSER_IPHONE = 'iPhone'; // http://apple.com
72
- const BROWSER_IPOD = 'iPod'; // http://apple.com
73
- const BROWSER_IPAD = 'iPad'; // http://apple.com
74
- const BROWSER_CHROME = 'Chrome'; // http://www.google.com/chrome
75
- const BROWSER_ANDROID = 'Android'; // http://www.android.com/
76
- const BROWSER_GOOGLEBOT = 'GoogleBot'; // http://en.wikipedia.org/wiki/Googlebot
77
- const BROWSER_SLURP = 'Yahoo! Slurp'; // http://en.wikipedia.org/wiki/Yahoo!_Slurp
78
- const BROWSER_W3CVALIDATOR = 'W3C Validator'; // http://validator.w3.org/
79
- const BROWSER_BLACKBERRY = 'BlackBerry'; // http://www.blackberry.com/
80
- const BROWSER_ICECAT = 'IceCat'; // http://en.wikipedia.org/wiki/GNU_IceCat
81
- const BROWSER_NOKIA_S60 = 'Nokia S60 OSS Browser'; // http://en.wikipedia.org/wiki/Web_Browser_for_S60
82
- const BROWSER_NOKIA = 'Nokia Browser'; // * all other WAP-based browsers on the Nokia Platform
83
- const BROWSER_MSN = 'MSN Browser'; // http://explorer.msn.com/
84
- const BROWSER_MSNBOT = 'MSN Bot'; // http://search.msn.com/msnbot.htm
85
- const BROWSER_BINGBOT = 'Bing Bot'; // http://en.wikipedia.org/wiki/Bingbot
86
-
87
- const BROWSER_NETSCAPE_NAVIGATOR = 'Netscape Navigator'; // http://browser.netscape.com/ (DEPRECATED)
88
- const BROWSER_GALEON = 'Galeon'; // http://galeon.sourceforge.net/ (DEPRECATED)
89
- const BROWSER_NETPOSITIVE = 'NetPositive'; // http://en.wikipedia.org/wiki/NetPositive (DEPRECATED)
90
- const BROWSER_PHOENIX = 'Phoenix'; // http://en.wikipedia.org/wiki/History_of_Mozilla_Firefox (DEPRECATED)
91
-
92
- const PLATFORM_UNKNOWN = 'unknown';
93
- const PLATFORM_WINDOWS = 'Windows';
94
- const PLATFORM_WINDOWS_CE = 'Windows CE';
95
- const PLATFORM_APPLE = 'Apple';
96
- const PLATFORM_LINUX = 'Linux';
97
- const PLATFORM_OS2 = 'OS/2';
98
- const PLATFORM_BEOS = 'BeOS';
99
- const PLATFORM_IPHONE = 'iPhone';
100
- const PLATFORM_IPOD = 'iPod';
101
- const PLATFORM_IPAD = 'iPad';
102
- const PLATFORM_BLACKBERRY = 'BlackBerry';
103
- const PLATFORM_NOKIA = 'Nokia';
104
- const PLATFORM_FREEBSD = 'FreeBSD';
105
- const PLATFORM_OPENBSD = 'OpenBSD';
106
- const PLATFORM_NETBSD = 'NetBSD';
107
- const PLATFORM_SUNOS = 'SunOS';
108
- const PLATFORM_OPENSOLARIS = 'OpenSolaris';
109
- const PLATFORM_ANDROID = 'Android';
110
-
111
- const OPERATING_SYSTEM_UNKNOWN = 'unknown';
112
-
113
- public function Browser($userAgent = "")
114
- {
115
- $this->reset();
116
- if ($userAgent != "") {
117
- $this->setUserAgent($userAgent);
118
- } else {
119
- $this->determine();
120
- }
121
- }
122
-
123
- /**
124
- * Reset all properties
125
- */
126
- public function reset()
127
- {
128
- $this->_agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : "";
129
- $this->_browser_name = self::BROWSER_UNKNOWN;
130
- $this->_version = self::VERSION_UNKNOWN;
131
- $this->_platform = self::PLATFORM_UNKNOWN;
132
- $this->_os = self::OPERATING_SYSTEM_UNKNOWN;
133
- $this->_is_aol = false;
134
- $this->_is_mobile = false;
135
- $this->_is_tablet = false;
136
- $this->_is_robot = false;
137
- $this->_is_facebook = false;
138
- $this->_aol_version = self::VERSION_UNKNOWN;
139
- }
140
-
141
- /**
142
- * Check to see if the specific browser is valid
143
- * @param string $browserName
144
- * @return bool True if the browser is the specified browser
145
- */
146
- function isBrowser($browserName)
147
- {
148
- return (0 == strcasecmp($this->_browser_name, trim($browserName)));
149
- }
150
-
151
- /**
152
- * The name of the browser. All return types are from the class contants
153
- * @return string Name of the browser
154
- */
155
- public function getBrowser()
156
- {
157
- return $this->_browser_name;
158
- }
159
-
160
- /**
161
- * Set the name of the browser
162
- * @param $browser string The name of the Browser
163
- */
164
- public function setBrowser($browser)
165
- {
166
- $this->_browser_name = $browser;
167
- }
168
-
169
- /**
170
- * The name of the platform. All return types are from the class contants
171
- * @return string Name of the browser
172
- */
173
- public function getPlatform()
174
- {
175
- return $this->_platform;
176
- }
177
-
178
- /**
179
- * Set the name of the platform
180
- * @param string $platform The name of the Platform
181
- */
182
- public function setPlatform($platform)
183
- {
184
- $this->_platform = $platform;
185
- }
186
-
187
- /**
188
- * The version of the browser.
189
- * @return string Version of the browser (will only contain alpha-numeric characters and a period)
190
- */
191
- public function getVersion()
192
- {
193
- return $this->_version;
194
- }
195
-
196
- /**
197
- * Set the version of the browser
198
- * @param string $version The version of the Browser
199
- */
200
- public function setVersion($version)
201
- {
202
- $this->_version = preg_replace('/[^0-9,.,a-z,A-Z-]/', '', $version);
203
- }
204
-
205
- /**
206
- * The version of AOL.
207
- * @return string Version of AOL (will only contain alpha-numeric characters and a period)
208
- */
209
- public function getAolVersion()
210
- {
211
- return $this->_aol_version;
212
- }
213
-
214
- /**
215
- * Set the version of AOL
216
- * @param string $version The version of AOL
217
- */
218
- public function setAolVersion($version)
219
- {
220
- $this->_aol_version = preg_replace('/[^0-9,.,a-z,A-Z]/', '', $version);
221
- }
222
-
223
- /**
224
- * Is the browser from AOL?
225
- * @return boolean True if the browser is from AOL otherwise false
226
- */
227
- public function isAol()
228
- {
229
- return $this->_is_aol;
230
- }
231
-
232
- /**
233
- * Is the browser from a mobile device?
234
- * @return boolean True if the browser is from a mobile device otherwise false
235
- */
236
- public function isMobile()
237
- {
238
- return $this->_is_mobile;
239
- }
240
-
241
- /**
242
- * Is the browser from a tablet device?
243
- * @return boolean True if the browser is from a tablet device otherwise false
244
- */
245
- public function isTablet()
246
- {
247
- return $this->_is_tablet;
248
- }
249
-
250
- /**
251
- * Is the browser from a robot (ex Slurp,GoogleBot)?
252
- * @return boolean True if the browser is from a robot otherwise false
253
- */
254
- public function isRobot()
255
- {
256
- return $this->_is_robot;
257
- }
258
-
259
- /**
260
- * Is the browser from facebook?
261
- * @return boolean True if the browser is from facebook otherwise false
262
- */
263
- public function isFacebook()
264
- {
265
- return $this->_is_facebook;
266
- }
267
-
268
- /**
269
- * Set the browser to be from AOL
270
- * @param $isAol
271
- */
272
- public function setAol($isAol)
273
- {
274
- $this->_is_aol = $isAol;
275
- }
276
-
277
- /**
278
- * Set the Browser to be mobile
279
- * @param boolean $value is the browser a mobile browser or not
280
- */
281
- protected function setMobile($value = true)
282
- {
283
- $this->_is_mobile = $value;
284
- }
285
-
286
- /**
287
- * Set the Browser to be tablet
288
- * @param boolean $value is the browser a tablet browser or not
289
- */
290
- protected function setTablet($value = true)
291
- {
292
- $this->_is_tablet = $value;
293
- }
294
-
295
- /**
296
- * Set the Browser to be a robot
297
- * @param boolean $value is the browser a robot or not
298
- */
299
- protected function setRobot($value = true)
300
- {
301
- $this->_is_robot = $value;
302
- }
303
-
304
- /**
305
- * Set the Browser to be a Facebook request
306
- * @param boolean $value is the browser a robot or not
307
- */
308
- protected function setFacebook($value = true)
309
- {
310
- $this->_is_facebook = $value;
311
- }
312
-
313
- /**
314
- * Get the user agent value in use to determine the browser
315
- * @return string The user agent from the HTTP header
316
- */
317
- public function getUserAgent()
318
- {
319
- return $this->_agent;
320
- }
321
-
322
- /**
323
- * Set the user agent value (the construction will use the HTTP header value - this will overwrite it)
324
- * @param string $agent_string The value for the User Agent
325
- */
326
- public function setUserAgent($agent_string)
327
- {
328
- $this->reset();
329
- $this->_agent = $agent_string;
330
- $this->determine();
331
- }
332
-
333
- /**
334
- * Used to determine if the browser is actually "chromeframe"
335
- * @since 1.7
336
- * @return boolean True if the browser is using chromeframe
337
- */
338
- public function isChromeFrame()
339
- {
340
- return (strpos($this->_agent, "chromeframe") !== false);
341
- }
342
-
343
- /**
344
- * Returns a formatted string with a summary of the details of the browser.
345
- * @return string formatted string with a summary of the browser
346
- */
347
- public function __toString()
348
- {
349
- return "<strong>Browser Name:</strong> {$this->getBrowser()}<br/>\n" .
350
- "<strong>Browser Version:</strong> {$this->getVersion()}<br/>\n" .
351
- "<strong>Browser User Agent String:</strong> {$this->getUserAgent()}<br/>\n" .
352
- "<strong>Platform:</strong> {$this->getPlatform()}<br/>";
353
- }
354
-
355
- /**
356
- * Protected routine to calculate and determine what the browser is in use (including platform)
357
- */
358
- protected function determine()
359
- {
360
- $this->checkPlatform();
361
- $this->checkBrowsers();
362
- $this->checkForAol();
363
- }
364
-
365
- /**
366
- * Protected routine to determine the browser type
367
- * @return boolean True if the browser was detected otherwise false
368
- */
369
- protected function checkBrowsers()
370
- {
371
- return (
372
- // well-known, well-used
373
- // Special Notes:
374
- // (1) Opera must be checked before FireFox due to the odd
375
- // user agents used in some older versions of Opera
376
- // (2) WebTV is strapped onto Internet Explorer so we must
377
- // check for WebTV before IE
378
- // (3) (deprecated) Galeon is based on Firefox and needs to be
379
- // tested before Firefox is tested
380
- // (4) OmniWeb is based on Safari so OmniWeb check must occur
381
- // before Safari
382
- // (5) Netscape 9+ is based on Firefox so Netscape checks
383
- // before FireFox are necessary
384
- $this->checkBrowserWebTv() ||
385
- $this->checkBrowserInternetExplorer() ||
386
- $this->checkBrowserOpera() ||
387
- $this->checkBrowserGaleon() ||
388
- $this->checkBrowserNetscapeNavigator9Plus() ||
389
- $this->checkBrowserFirefox() ||
390
- $this->checkBrowserChrome() ||
391
- $this->checkBrowserOmniWeb() ||
392
-
393
- // common mobile
394
- $this->checkBrowserAndroid() ||
395
- $this->checkBrowseriPad() ||
396
- $this->checkBrowseriPod() ||
397
- $this->checkBrowseriPhone() ||
398
- $this->checkBrowserBlackBerry() ||
399
- $this->checkBrowserNokia() ||
400
-
401
- // common bots
402
- $this->checkBrowserGoogleBot() ||
403
- $this->checkBrowserMSNBot() ||
404
- $this->checkBrowserBingBot() ||
405
- $this->checkBrowserSlurp() ||
406
-
407
- // check for facebook external hit when loading URL
408
- $this->checkFacebookExternalHit() ||
409
-
410
- // WebKit base check (post mobile and others)
411
- $this->checkBrowserSafari() ||
412
-
413
- // everyone else
414
- $this->checkBrowserNetPositive() ||
415
- $this->checkBrowserFirebird() ||
416
- $this->checkBrowserKonqueror() ||
417
- $this->checkBrowserIcab() ||
418
- $this->checkBrowserPhoenix() ||
419
- $this->checkBrowserAmaya() ||
420
- $this->checkBrowserLynx() ||
421
- $this->checkBrowserShiretoko() ||
422
- $this->checkBrowserIceCat() ||
423
- $this->checkBrowserIceweasel() ||
424
- $this->checkBrowserW3CValidator() ||
425
- $this->checkBrowserMozilla() /* Mozilla is such an open standard that you must check it last */
426
- );
427
- }
428
-
429
- /**
430
- * Determine if the user is using a BlackBerry (last updated 1.7)
431
- * @return boolean True if the browser is the BlackBerry browser otherwise false
432
- */
433
- protected function checkBrowserBlackBerry()
434
- {
435
- if (stripos($this->_agent, 'blackberry') !== false) {
436
- $aresult = explode("/", stristr($this->_agent, "BlackBerry"));
437
- if (isset($aresult[1])) {
438
- $aversion = explode(' ', $aresult[1]);
439
- $this->setVersion($aversion[0]);
440
- $this->_browser_name = self::BROWSER_BLACKBERRY;
441
- $this->setMobile(true);
442
- return true;
443
- }
444
- }
445
- return false;
446
- }
447
-
448
- /**
449
- * Determine if the user is using an AOL User Agent (last updated 1.7)
450
- * @return boolean True if the browser is from AOL otherwise false
451
- */
452
- protected function checkForAol()
453
- {
454
- $this->setAol(false);
455
- $this->setAolVersion(self::VERSION_UNKNOWN);
456
-
457
- if (stripos($this->_agent, 'aol') !== false) {
458
- $aversion = explode(' ', stristr($this->_agent, 'AOL'));
459
- if (isset($aversion[1])) {
460
- $this->setAol(true);
461
- $this->setAolVersion(preg_replace('/[^0-9\.a-z]/i', '', $aversion[1]));
462
- return true;
463
- }
464
- }
465
- return false;
466
- }
467
-
468
- /**
469
- * Determine if the browser is the GoogleBot or not (last updated 1.7)
470
- * @return boolean True if the browser is the GoogletBot otherwise false
471
- */
472
- protected function checkBrowserGoogleBot()
473
- {
474
- if (stripos($this->_agent, 'googlebot') !== false) {
475
- $aresult = explode('/', stristr($this->_agent, 'googlebot'));
476
- if (isset($aresult[1])) {
477
- $aversion = explode(' ', $aresult[1]);
478
- $this->setVersion(str_replace(';', '', $aversion[0]));
479
- $this->_browser_name = self::BROWSER_GOOGLEBOT;
480
- $this->setRobot(true);
481
- return true;
482
- }
483
- }
484
- return false;
485
- }
486
-
487
- /**
488
- * Determine if the browser is the MSNBot or not (last updated 1.9)
489
- * @return boolean True if the browser is the MSNBot otherwise false
490
- */
491
- protected function checkBrowserMSNBot()
492
- {
493
- if (stripos($this->_agent, "msnbot") !== false) {
494
- $aresult = explode("/", stristr($this->_agent, "msnbot"));
495
- if (isset($aresult[1])) {
496
- $aversion = explode(" ", $aresult[1]);
497
- $this->setVersion(str_replace(";", "", $aversion[0]));
498
- $this->_browser_name = self::BROWSER_MSNBOT;
499
- $this->setRobot(true);
500
- return true;
501
- }
502
- }
503
- return false;
504
- }
505
-
506
- /**
507
- * Determine if the browser is the BingBot or not (last updated 1.9)
508
- * @return boolean True if the browser is the BingBot otherwise false
509
- */
510
- protected function checkBrowserBingBot()
511
- {
512
- if (stripos($this->_agent, "bingbot") !== false) {
513
- $aresult = explode("/", stristr($this->_agent, "bingbot"));
514
- if (isset($aresult[1])) {
515
- $aversion = explode(" ", $aresult[1]);
516
- $this->setVersion(str_replace(";", "", $aversion[0]));
517
- $this->_browser_name = self::BROWSER_BINGBOT;
518
- $this->setRobot(true);
519
- return true;
520
- }
521
- }
522
- return false;
523
- }
524
-
525
- /**
526
- * Determine if the browser is the W3C Validator or not (last updated 1.7)
527
- * @return boolean True if the browser is the W3C Validator otherwise false
528
- */
529
- protected function checkBrowserW3CValidator()
530
- {
531
- if (stripos($this->_agent, 'W3C-checklink') !== false) {
532
- $aresult = explode('/', stristr($this->_agent, 'W3C-checklink'));
533
- if (isset($aresult[1])) {
534
- $aversion = explode(' ', $aresult[1]);
535
- $this->setVersion($aversion[0]);
536
- $this->_browser_name = self::BROWSER_W3CVALIDATOR;
537
- return true;
538
- }
539
- } else if (stripos($this->_agent, 'W3C_Validator') !== false) {
540
- // Some of the Validator versions do not delineate w/ a slash - add it back in
541
- $ua = str_replace("W3C_Validator ", "W3C_Validator/", $this->_agent);
542
- $aresult = explode('/', stristr($ua, 'W3C_Validator'));
543
- if (isset($aresult[1])) {
544
- $aversion = explode(' ', $aresult[1]);
545
- $this->setVersion($aversion[0]);
546
- $this->_browser_name = self::BROWSER_W3CVALIDATOR;
547
- return true;
548
- }
549
- } else if (stripos($this->_agent, 'W3C-mobileOK') !== false) {
550
- $this->_browser_name = self::BROWSER_W3CVALIDATOR;
551
- $this->setMobile(true);
552
- return true;
553
- }
554
- return false;
555
- }
556
-
557
- /**
558
- * Determine if the browser is the Yahoo! Slurp Robot or not (last updated 1.7)
559
- * @return boolean True if the browser is the Yahoo! Slurp Robot otherwise false
560
- */
561
- protected function checkBrowserSlurp()
562
- {
563
- if (stripos($this->_agent, 'slurp') !== false) {
564
- $aresult = explode('/', stristr($this->_agent, 'Slurp'));
565
- if (isset($aresult[1])) {
566
- $aversion = explode(' ', $aresult[1]);
567
- $this->setVersion($aversion[0]);
568
- $this->_browser_name = self::BROWSER_SLURP;
569
- $this->setRobot(true);
570
- $this->setMobile(false);
571
- return true;
572
- }
573
- }
574
- return false;
575
- }
576
-
577
- /**
578
- * Determine if the browser is Internet Explorer or not (last updated 1.7)
579
- * @return boolean True if the browser is Internet Explorer otherwise false
580
- */
581
- protected function checkBrowserInternetExplorer()
582
- {
583
- // Test for IE11
584
- if( stripos($this->_agent,'Trident/7.0; rv:11.0') !== false ) {
585
- $this->setBrowser(self::BROWSER_IE);
586
- $this->setVersion('11.0');
587
- return true;
588
- }
589
- // Test for v1 - v1.5 IE
590
- else if (stripos($this->_agent, 'microsoft internet explorer') !== false) {
591
- $this->setBrowser(self::BROWSER_IE);
592
- $this->setVersion('1.0');
593
- $aresult = stristr($this->_agent, '/');
594
- if (preg_match('/308|425|426|474|0b1/i', $aresult)) {
595
- $this->setVersion('1.5');
596
- }
597
- return true;
598
- } // Test for versions > 1.5
599
- else if (stripos($this->_agent, 'msie') !== false && stripos($this->_agent, 'opera') === false) {
600
- // See if the browser is the odd MSN Explorer
601
- if (stripos($this->_agent, 'msnb') !== false) {
602
- $aresult = explode(' ', stristr(str_replace(';', '; ', $this->_agent), 'MSN'));
603
- if (isset($aresult[1])) {
604
- $this->setBrowser(self::BROWSER_MSN);
605
- $this->setVersion(str_replace(array('(', ')', ';'), '', $aresult[1]));
606
- return true;
607
- }
608
- }
609
- $aresult = explode(' ', stristr(str_replace(';', '; ', $this->_agent), 'msie'));
610
- if (isset($aresult[1])) {
611
- $this->setBrowser(self::BROWSER_IE);
612
- $this->setVersion(str_replace(array('(', ')', ';'), '', $aresult[1]));
613
- if(stripos($this->_agent, 'IEMobile') !== false) {
614
- $this->setBrowser(self::BROWSER_POCKET_IE);
615
- $this->setMobile(true);
616
- }
617
- return true;
618
- }
619
- } // Test for versions > IE 10
620
- else if(stripos($this->_agent, 'trident') !== false) {
621
- $this->setBrowser(self::BROWSER_IE);
622
- $result = explode('rv:', $this->_agent);
623
- if (isset($result[1])) {
624
- $this->setVersion(preg_replace('/[^0-9.]+/', '', $result[1]));
625
- $this->_agent = str_replace(array("Mozilla", "Gecko"), "MSIE", $this->_agent);
626
- }
627
- } // Test for Pocket IE
628
- else if (stripos($this->_agent, 'mspie') !== false || stripos($this->_agent, 'pocket') !== false) {
629
- $aresult = explode(' ', stristr($this->_agent, 'mspie'));
630
- if (isset($aresult[1])) {
631
- $this->setPlatform(self::PLATFORM_WINDOWS_CE);
632
- $this->setBrowser(self::BROWSER_POCKET_IE);
633
- $this->setMobile(true);
634
-
635
- if (stripos($this->_agent, 'mspie') !== false) {
636
- $this->setVersion($aresult[1]);
637
- } else {
638
- $aversion = explode('/', $this->_agent);
639
- if (isset($aversion[1])) {
640
- $this->setVersion($aversion[1]);
641
- }
642
- }
643
- return true;
644
- }
645
- }
646
- return false;
647
- }
648
-
649
- /**
650
- * Determine if the browser is Opera or not (last updated 1.7)
651
- * @return boolean True if the browser is Opera otherwise false
652
- */
653
- protected function checkBrowserOpera()
654
- {
655
- if (stripos($this->_agent, 'opera mini') !== false) {
656
- $resultant = stristr($this->_agent, 'opera mini');
657
- if (preg_match('/\//', $resultant)) {
658
- $aresult = explode('/', $resultant);
659
- if (isset($aresult[1])) {
660
- $aversion = explode(' ', $aresult[1]);
661
- $this->setVersion($aversion[0]);
662
- }
663
- } else {
664
- $aversion = explode(' ', stristr($resultant, 'opera mini'));
665
- if (isset($aversion[1])) {
666
- $this->setVersion($aversion[1]);
667
- }
668
- }
669
- $this->_browser_name = self::BROWSER_OPERA_MINI;
670
- $this->setMobile(true);
671
- return true;
672
- } else if (stripos($this->_agent, 'opera') !== false) {
673
- $resultant = stristr($this->_agent, 'opera');
674
- if (preg_match('/Version\/(1*.*)$/', $resultant, $matches)) {
675
- $this->setVersion($matches[1]);
676
- } else if (preg_match('/\//', $resultant)) {
677
- $aresult = explode('/', str_replace("(", " ", $resultant));
678
- if (isset($aresult[1])) {
679
- $aversion = explode(' ', $aresult[1]);
680
- $this->setVersion($aversion[0]);
681
- }
682
- } else {
683
- $aversion = explode(' ', stristr($resultant, 'opera'));
684
- $this->setVersion(isset($aversion[1]) ? $aversion[1] : "");
685
- }
686
- if (stripos($this->_agent, 'Opera Mobi') !== false) {
687
- $this->setMobile(true);
688
- }
689
- $this->_browser_name = self::BROWSER_OPERA;
690
- return true;
691
- } else if (stripos($this->_agent, 'OPR') !== false) {
692
- $resultant = stristr($this->_agent, 'OPR');
693
- if (preg_match('/\//', $resultant)) {
694
- $aresult = explode('/', str_replace("(", " ", $resultant));
695
- if (isset($aresult[1])) {
696
- $aversion = explode(' ', $aresult[1]);
697
- $this->setVersion($aversion[0]);
698
- }
699
- }
700
- if (stripos($this->_agent, 'Mobile') !== false) {
701
- $this->setMobile(true);
702
- }
703
- $this->_browser_name = self::BROWSER_OPERA;
704
- return true;
705
- }
706
- return false;
707
- }
708
-
709
- /**
710
- * Determine if the browser is Chrome or not (last updated 1.7)
711
- * @return boolean True if the browser is Chrome otherwise false
712
- */
713
- protected function checkBrowserChrome()
714
- {
715
- if (stripos($this->_agent, 'Chrome') !== false) {
716
- $aresult = explode('/', stristr($this->_agent, 'Chrome'));
717
- if (isset($aresult[1])) {
718
- $aversion = explode(' ', $aresult[1]);
719
- $this->setVersion($aversion[0]);
720
- $this->setBrowser(self::BROWSER_CHROME);
721
- //Chrome on Android
722
- if (stripos($this->_agent, 'Android') !== false) {
723
- if (stripos($this->_agent, 'Mobile') !== false) {
724
- $this->setMobile(true);
725
- } else {
726
- $this->setTablet(true);
727
- }
728
- }
729
- return true;
730
- }
731
- }
732
- return false;
733
- }
734
-
735
-
736
- /**
737
- * Determine if the browser is WebTv or not (last updated 1.7)
738
- * @return boolean True if the browser is WebTv otherwise false
739
- */
740
- protected function checkBrowserWebTv()
741
- {
742
- if (stripos($this->_agent, 'webtv') !== false) {
743
- $aresult = explode('/', stristr($this->_agent, 'webtv'));
744
- if (isset($aresult[1])) {
745
- $aversion = explode(' ', $aresult[1]);
746
- $this->setVersion($aversion[0]);
747
- $this->setBrowser(self::BROWSER_WEBTV);
748
- return true;
749
- }
750
- }
751
- return false;
752
- }
753
-
754
- /**
755
- * Determine if the browser is NetPositive or not (last updated 1.7)
756
- * @return boolean True if the browser is NetPositive otherwise false
757
- */
758
- protected function checkBrowserNetPositive()
759
- {
760
- if (stripos($this->_agent, 'NetPositive') !== false) {
761
- $aresult = explode('/', stristr($this->_agent, 'NetPositive'));
762
- if (isset($aresult[1])) {
763
- $aversion = explode(' ', $aresult[1]);
764
- $this->setVersion(str_replace(array('(', ')', ';'), '', $aversion[0]));
765
- $this->setBrowser(self::BROWSER_NETPOSITIVE);
766
- return true;
767
- }
768
- }
769
- return false;
770
- }
771
-
772
- /**
773
- * Determine if the browser is Galeon or not (last updated 1.7)
774
- * @return boolean True if the browser is Galeon otherwise false
775
- */
776
- protected function checkBrowserGaleon()
777
- {
778
- if (stripos($this->_agent, 'galeon') !== false) {
779
- $aresult = explode(' ', stristr($this->_agent, 'galeon'));
780
- $aversion = explode('/', $aresult[0]);
781
- if (isset($aversion[1])) {
782
- $this->setVersion($aversion[1]);
783
- $this->setBrowser(self::BROWSER_GALEON);
784
- return true;
785
- }
786
- }
787
- return false;
788
- }
789
-
790
- /**
791
- * Determine if the browser is Konqueror or not (last updated 1.7)
792
- * @return boolean True if the browser is Konqueror otherwise false
793
- */
794
- protected function checkBrowserKonqueror()
795
- {
796
- if (stripos($this->_agent, 'Konqueror') !== false) {
797
- $aresult = explode(' ', stristr($this->_agent, 'Konqueror'));
798
- $aversion = explode('/', $aresult[0]);
799
- if (isset($aversion[1])) {
800
- $this->setVersion($aversion[1]);
801
- $this->setBrowser(self::BROWSER_KONQUEROR);
802
- return true;
803
- }
804
- }
805
- return false;
806
- }
807
-
808
- /**
809
- * Determine if the browser is iCab or not (last updated 1.7)
810
- * @return boolean True if the browser is iCab otherwise false
811
- */
812
- protected function checkBrowserIcab()
813
- {
814
- if (stripos($this->_agent, 'icab') !== false) {
815
- $aversion = explode(' ', stristr(str_replace('/', ' ', $this->_agent), 'icab'));
816
- if (isset($aversion[1])) {
817
- $this->setVersion($aversion[1]);
818
- $this->setBrowser(self::BROWSER_ICAB);
819
- return true;
820
- }
821
- }
822
- return false;
823
- }
824
-
825
- /**
826
- * Determine if the browser is OmniWeb or not (last updated 1.7)
827
- * @return boolean True if the browser is OmniWeb otherwise false
828
- */
829
- protected function checkBrowserOmniWeb()
830
- {
831
- if (stripos($this->_agent, 'omniweb') !== false) {
832
- $aresult = explode('/', stristr($this->_agent, 'omniweb'));
833
- $aversion = explode(' ', isset($aresult[1]) ? $aresult[1] : "");
834
- $this->setVersion($aversion[0]);
835
- $this->setBrowser(self::BROWSER_OMNIWEB);
836
- return true;
837
- }
838
- return false;
839
- }
840
-
841
- /**
842
- * Determine if the browser is Phoenix or not (last updated 1.7)
843
- * @return boolean True if the browser is Phoenix otherwise false
844
- */
845
- protected function checkBrowserPhoenix()
846
- {
847
- if (stripos($this->_agent, 'Phoenix') !== false) {
848
- $aversion = explode('/', stristr($this->_agent, 'Phoenix'));
849
- if (isset($aversion[1])) {
850
- $this->setVersion($aversion[1]);
851
- $this->setBrowser(self::BROWSER_PHOENIX);
852
- return true;
853
- }
854
- }
855
- return false;
856
- }
857
-
858
- /**
859
- * Determine if the browser is Firebird or not (last updated 1.7)
860
- * @return boolean True if the browser is Firebird otherwise false
861
- */
862
- protected function checkBrowserFirebird()
863
- {
864
- if (stripos($this->_agent, 'Firebird') !== false) {
865
- $aversion = explode('/', stristr($this->_agent, 'Firebird'));
866
- if (isset($aversion[1])) {
867
- $this->setVersion($aversion[1]);
868
- $this->setBrowser(self::BROWSER_FIREBIRD);
869
- return true;
870
- }
871
- }
872
- return false;
873
- }
874
-
875
- /**
876
- * Determine if the browser is Netscape Navigator 9+ or not (last updated 1.7)
877
- * NOTE: (http://browser.netscape.com/ - Official support ended on March 1st, 2008)
878
- * @return boolean True if the browser is Netscape Navigator 9+ otherwise false
879
- */
880
- protected function checkBrowserNetscapeNavigator9Plus()
881
- {
882
- if (stripos($this->_agent, 'Firefox') !== false && preg_match('/Navigator\/([^ ]*)/i', $this->_agent, $matches)) {
883
- $this->setVersion($matches[1]);
884
- $this->setBrowser(self::BROWSER_NETSCAPE_NAVIGATOR);
885
- return true;
886
- } else if (stripos($this->_agent, 'Firefox') === false && preg_match('/Netscape6?\/([^ ]*)/i', $this->_agent, $matches)) {
887
- $this->setVersion($matches[1]);
888
- $this->setBrowser(self::BROWSER_NETSCAPE_NAVIGATOR);
889
- return true;
890
- }
891
- return false;
892
- }
893
-
894
- /**
895
- * Determine if the browser is Shiretoko or not (https://wiki.mozilla.org/Projects/shiretoko) (last updated 1.7)
896
- * @return boolean True if the browser is Shiretoko otherwise false
897
- */
898
- protected function checkBrowserShiretoko()
899
- {
900
- if (stripos($this->_agent, 'Mozilla') !== false && preg_match('/Shiretoko\/([^ ]*)/i', $this->_agent, $matches)) {
901
- $this->setVersion($matches[1]);
902
- $this->setBrowser(self::BROWSER_SHIRETOKO);
903
- return true;
904
- }
905
- return false;
906
- }
907
-
908
- /**
909
- * Determine if the browser is Ice Cat or not (http://en.wikipedia.org/wiki/GNU_IceCat) (last updated 1.7)
910
- * @return boolean True if the browser is Ice Cat otherwise false
911
- */
912
- protected function checkBrowserIceCat()
913
- {
914
- if (stripos($this->_agent, 'Mozilla') !== false && preg_match('/IceCat\/([^ ]*)/i', $this->_agent, $matches)) {
915
- $this->setVersion($matches[1]);
916
- $this->setBrowser(self::BROWSER_ICECAT);
917
- return true;
918
- }
919
- return false;
920
- }
921
-
922
- /**
923
- * Determine if the browser is Nokia or not (last updated 1.7)
924
- * @return boolean True if the browser is Nokia otherwise false
925
- */
926
- protected function checkBrowserNokia()
927
- {
928
- if (preg_match("/Nokia([^\/]+)\/([^ SP]+)/i", $this->_agent, $matches)) {
929
- $this->setVersion($matches[2]);
930
- if (stripos($this->_agent, 'Series60') !== false || strpos($this->_agent, 'S60') !== false) {
931
- $this->setBrowser(self::BROWSER_NOKIA_S60);
932
- } else {
933
- $this->setBrowser(self::BROWSER_NOKIA);
934
- }
935
- $this->setMobile(true);
936
- return true;
937
- }
938
- return false;
939
- }
940
-
941
- /**
942
- * Determine if the browser is Firefox or not (last updated 1.7)
943
- * @return boolean True if the browser is Firefox otherwise false
944
- */
945
- protected function checkBrowserFirefox()
946
- {
947
- if (stripos($this->_agent, 'safari') === false) {
948
- if (preg_match("/Firefox[\/ \(]([^ ;\)]+)/i", $this->_agent, $matches)) {
949
- $this->setVersion($matches[1]);
950
- $this->setBrowser(self::BROWSER_FIREFOX);
951
- //Firefox on Android
952
- if (stripos($this->_agent, 'Android') !== false) {
953
- if (stripos($this->_agent, 'Mobile') !== false) {
954
- $this->setMobile(true);
955
- } else {
956
- $this->setTablet(true);
957
- }
958
- }
959
- return true;
960
- } else if (preg_match("/Firefox$/i", $this->_agent, $matches)) {
961
- $this->setVersion("");
962
- $this->setBrowser(self::BROWSER_FIREFOX);
963
- return true;
964
- }
965
- }
966
- return false;
967
- }
968
-
969
- /**
970
- * Determine if the browser is Firefox or not (last updated 1.7)
971
- * @return boolean True if the browser is Firefox otherwise false
972
- */
973
- protected function checkBrowserIceweasel()
974
- {
975
- if (stripos($this->_agent, 'Iceweasel') !== false) {
976
- $aresult = explode('/', stristr($this->_agent, 'Iceweasel'));
977
- if (isset($aresult[1])) {
978
- $aversion = explode(' ', $aresult[1]);
979
- $this->setVersion($aversion[0]);
980
- $this->setBrowser(self::BROWSER_ICEWEASEL);
981
- return true;
982
- }
983
- }
984
- return false;
985
- }
986
-
987
- /**
988
- * Determine if the browser is Mozilla or not (last updated 1.7)
989
- * @return boolean True if the browser is Mozilla otherwise false
990
- */
991
- protected function checkBrowserMozilla()
992
- {
993
- if (stripos($this->_agent, 'mozilla') !== false && preg_match('/rv:[0-9].[0-9][a-b]?/i', $this->_agent) && stripos($this->_agent, 'netscape') === false) {
994
- $aversion = explode(' ', stristr($this->_agent, 'rv:'));
995
- preg_match('/rv:[0-9].[0-9][a-b]?/i', $this->_agent, $aversion);
996
- $this->setVersion(str_replace('rv:', '', $aversion[0]));
997
- $this->setBrowser(self::BROWSER_MOZILLA);
998
- return true;
999
- } else if (stripos($this->_agent, 'mozilla') !== false && preg_match('/rv:[0-9]\.[0-9]/i', $this->_agent) && stripos($this->_agent, 'netscape') === false) {
1000
- $aversion = explode('', stristr($this->_agent, 'rv:'));
1001
- $this->setVersion(str_replace('rv:', '', $aversion[0]));
1002
- $this->setBrowser(self::BROWSER_MOZILLA);
1003
- return true;
1004
- } else if (stripos($this->_agent, 'mozilla') !== false && preg_match('/mozilla\/([^ ]*)/i', $this->_agent, $matches) && stripos($this->_agent, 'netscape') === false) {
1005
- $this->setVersion($matches[1]);
1006
- $this->setBrowser(self::BROWSER_MOZILLA);
1007
- return true;
1008
- }
1009
- return false;
1010
- }
1011
-
1012
- /**
1013
- * Determine if the browser is Lynx or not (last updated 1.7)
1014
- * @return boolean True if the browser is Lynx otherwise false
1015
- */
1016
- protected function checkBrowserLynx()
1017
- {
1018
- if (stripos($this->_agent, 'lynx') !== false) {
1019
- $aresult = explode('/', stristr($this->_agent, 'Lynx'));
1020
- $aversion = explode(' ', (isset($aresult[1]) ? $aresult[1] : ""));
1021
- $this->setVersion($aversion[0]);
1022
- $this->setBrowser(self::BROWSER_LYNX);
1023
- return true;
1024
- }
1025
- return false;
1026
- }
1027
-
1028
- /**
1029
- * Determine if the browser is Amaya or not (last updated 1.7)
1030
- * @return boolean True if the browser is Amaya otherwise false
1031
- */
1032
- protected function checkBrowserAmaya()
1033
- {
1034
- if (stripos($this->_agent, 'amaya') !== false) {
1035
- $aresult = explode('/', stristr($this->_agent, 'Amaya'));
1036
- if (isset($aresult[1])) {
1037
- $aversion = explode(' ', $aresult[1]);
1038
- $this->setVersion($aversion[0]);
1039
- $this->setBrowser(self::BROWSER_AMAYA);
1040
- return true;
1041
- }
1042
- }
1043
- return false;
1044
- }
1045
-
1046
- /**
1047
- * Determine if the browser is Safari or not (last updated 1.7)
1048
- * @return boolean True if the browser is Safari otherwise false
1049
- */
1050
- protected function checkBrowserSafari()
1051
- {
1052
- if (stripos($this->_agent, 'Safari') !== false
1053
- && stripos($this->_agent, 'iPhone') === false
1054
- && stripos($this->_agent, 'iPod') === false) {
1055
-
1056
- $aresult = explode('/', stristr($this->_agent, 'Version'));
1057
- if (isset($aresult[1])) {
1058
- $aversion = explode(' ', $aresult[1]);
1059
- $this->setVersion($aversion[0]);
1060
- } else {
1061
- $this->setVersion(self::VERSION_UNKNOWN);
1062
- }
1063
- $this->setBrowser(self::BROWSER_SAFARI);
1064
- return true;
1065
- }
1066
- return false;
1067
- }
1068
-
1069
- /**
1070
- * Detect if URL is loaded from FacebookExternalHit
1071
- * @return boolean True if it detects FacebookExternalHit otherwise false
1072
- */
1073
- protected function checkFacebookExternalHit()
1074
- {
1075
- if(stristr($this->_agent,'FacebookExternalHit'))
1076
- {
1077
- $this->setRobot(true);
1078
- $this->setFacebook(true);
1079
- return true;
1080
- }
1081
- return false;
1082
- }
1083
-
1084
- /**
1085
- * Detect if URL is being loaded from internal Facebook browser
1086
- * @return boolean True if it detects internal Facebook browser otherwise false
1087
- */
1088
- protected function checkForFacebookIos()
1089
- {
1090
- if(stristr($this->_agent,'FBIOS'))
1091
- {
1092
- $this->setFacebook(true);
1093
- return true;
1094
- }
1095
- return false;
1096
- }
1097
-
1098
- /**
1099
- * Detect Version for the Safari browser on iOS devices
1100
- * @return boolean True if it detects the version correctly otherwise false
1101
- */
1102
- protected function getSafariVersionOnIos()
1103
- {
1104
- $aresult = explode('/',stristr($this->_agent,'Version'));
1105
- if( isset($aresult[1]) )
1106
- {
1107
- $aversion = explode(' ',$aresult[1]);
1108
- $this->setVersion($aversion[0]);
1109
- return true;
1110
- }
1111
- return false;
1112
- }
1113
-
1114
- /**
1115
- * Detect Version for the Chrome browser on iOS devices
1116
- * @return boolean True if it detects the version correctly otherwise false
1117
- */
1118
- protected function getChromeVersionOnIos()
1119
- {
1120
- $aresult = explode('/',stristr($this->_agent,'CriOS'));
1121
- if( isset($aresult[1]) )
1122
- {
1123
- $aversion = explode(' ',$aresult[1]);
1124
- $this->setVersion($aversion[0]);
1125
- $this->setBrowser(self::BROWSER_CHROME);
1126
- return true;
1127
- }
1128
- return false;
1129
- }
1130
-
1131
- /**
1132
- * Determine if the browser is iPhone or not (last updated 1.7)
1133
- * @return boolean True if the browser is iPhone otherwise false
1134
- */
1135
- protected function checkBrowseriPhone() {
1136
- if( stripos($this->_agent,'iPhone') !== false ) {
1137
- $this->setVersion(self::VERSION_UNKNOWN);
1138
- $this->setBrowser(self::BROWSER_IPHONE);
1139
- $this->getSafariVersionOnIos();
1140
- $this->getChromeVersionOnIos();
1141
- $this->checkForFacebookIos();
1142
- $this->setMobile(true);
1143
- return true;
1144
- }
1145
- return false;
1146
- }
1147
-
1148
- /**
1149
- * Determine if the browser is iPad or not (last updated 1.7)
1150
- * @return boolean True if the browser is iPad otherwise false
1151
- */
1152
- protected function checkBrowseriPad() {
1153
- if( stripos($this->_agent,'iPad') !== false ) {
1154
- $this->setVersion(self::VERSION_UNKNOWN);
1155
- $this->setBrowser(self::BROWSER_IPAD);
1156
- $this->getSafariVersionOnIos();
1157
- $this->getChromeVersionOnIos();
1158
- $this->checkForFacebookIos();
1159
- $this->setTablet(true);
1160
- return true;
1161
- }
1162
- return false;
1163
- }
1164
-
1165
- /**
1166
- * Determine if the browser is iPod or not (last updated 1.7)
1167
- * @return boolean True if the browser is iPod otherwise false
1168
- */
1169
- protected function checkBrowseriPod() {
1170
- if( stripos($this->_agent,'iPod') !== false ) {
1171
- $this->setVersion(self::VERSION_UNKNOWN);
1172
- $this->setBrowser(self::BROWSER_IPOD);
1173
- $this->getSafariVersionOnIos();
1174
- $this->getChromeVersionOnIos();
1175
- $this->checkForFacebookIos();
1176
- $this->setMobile(true);
1177
- return true;
1178
- }
1179
- return false;
1180
- }
1181
-
1182
- /**
1183
- * Determine if the browser is Android or not (last updated 1.7)
1184
- * @return boolean True if the browser is Android otherwise false
1185
- */
1186
- protected function checkBrowserAndroid()
1187
- {
1188
- if (stripos($this->_agent, 'Android') !== false) {
1189
- $aresult = explode(' ', stristr($this->_agent, 'Android'));
1190
- if (isset($aresult[1])) {
1191
- $aversion = explode(' ', $aresult[1]);
1192
- $this->setVersion($aversion[0]);
1193
- } else {
1194
- $this->setVersion(self::VERSION_UNKNOWN);
1195
- }
1196
- if (stripos($this->_agent, 'Mobile') !== false) {
1197
- $this->setMobile(true);
1198
- } else {
1199
- $this->setTablet(true);
1200
- }
1201
- $this->setBrowser(self::BROWSER_ANDROID);
1202
- return true;
1203
- }
1204
- return false;
1205
- }
1206
-
1207
- /**
1208
- * Determine the user's platform (last updated 1.7)
1209
- */
1210
- protected function checkPlatform()
1211
- {
1212
- if (stripos($this->_agent, 'windows') !== false)
1213
- {
1214
- $this->_platform = self::PLATFORM_WINDOWS;
1215
- }
1216
- else if (stripos($this->_agent, 'iPad') !== false)
1217
- {
1218
- $this->_platform = self::PLATFORM_IPAD;
1219
- }
1220
- else if (stripos($this->_agent, 'iPod') !== false)
1221
- {
1222
- $this->_platform = self::PLATFORM_IPOD;
1223
- }
1224
- else if (stripos($this->_agent, 'iPhone') !== false)
1225
- {
1226
- $this->_platform = self::PLATFORM_IPHONE;
1227
- }
1228
- elseif (stripos($this->_agent, 'mac') !== false)
1229
- {
1230
- $this->_platform = self::PLATFORM_APPLE;
1231
- }
1232
- elseif (stripos($this->_agent, 'android') !== false)
1233
- {
1234
- $this->_platform = self::PLATFORM_ANDROID;
1235
- }
1236
- elseif (stripos($this->_agent, 'linux') !== false)
1237
- {
1238
- $this->_platform = self::PLATFORM_LINUX;
1239
- }
1240
- else if (stripos($this->_agent, 'Nokia') !== false)
1241
- {
1242
- $this->_platform = self::PLATFORM_NOKIA;
1243
- }
1244
- else if (stripos($this->_agent, 'BlackBerry') !== false)
1245
- {
1246
- $this->_platform = self::PLATFORM_BLACKBERRY;
1247
- }
1248
- elseif (stripos($this->_agent, 'FreeBSD') !== false)
1249
- {
1250
- $this->_platform = self::PLATFORM_FREEBSD;
1251
- }
1252
- elseif (stripos($this->_agent, 'OpenBSD') !== false)
1253
- {
1254
- $this->_platform = self::PLATFORM_OPENBSD;
1255
- }
1256
- elseif (stripos($this->_agent, 'NetBSD') !== false)
1257
- {
1258
- $this->_platform = self::PLATFORM_NETBSD;
1259
- }
1260
- elseif (stripos($this->_agent, 'OpenSolaris') !== false)
1261
- {
1262
- $this->_platform = self::PLATFORM_OPENSOLARIS;
1263
- }
1264
- elseif (stripos($this->_agent, 'SunOS') !== false)
1265
- {
1266
- $this->_platform = self::PLATFORM_SUNOS;
1267
- }
1268
- elseif (stripos($this->_agent, 'OS\/2') !== false)
1269
- {
1270
- $this->_platform = self::PLATFORM_OS2;
1271
- }
1272
- elseif (stripos($this->_agent, 'BeOS') !== false)
1273
- {
1274
- $this->_platform = self::PLATFORM_BEOS;
1275
- }
1276
- elseif (stripos($this->_agent, 'win') !== false)
1277
- {
1278
- $this->_platform = self::PLATFORM_WINDOWS;
1279
- }
1280
-
1281
- }
1282
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/cbschuld/browser.php/phpunit.xml.dist DELETED
@@ -1,29 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <phpunit backupGlobals="true"
3
- backupStaticAttributes="false"
4
- bootstrap="lib/Browser.php"
5
- colors="false"
6
- convertErrorsToExceptions="true"
7
- convertNoticesToExceptions="true"
8
- convertWarningsToExceptions="true"
9
- forceCoversAnnotation="false"
10
- mapTestClassNameToCoveredClassName="false"
11
- processIsolation="false"
12
- stopOnError="false"
13
- stopOnFailure="false"
14
- stopOnIncomplete="false"
15
- stopOnSkipped="false"
16
- testSuiteLoaderClass="PHPUnit_Runner_StandardTestSuiteLoader"
17
- strict="false"
18
- verbose="false">
19
- <testsuites>
20
- <testsuite name="Unit">
21
- <directory>test/Unit</directory>
22
- </testsuite>
23
- </testsuites>
24
- <filter>
25
- <whitelist>
26
- <directory suffix=".php">lib/</directory>
27
- </whitelist>
28
- </filter>
29
- </phpunit>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/autoload_files.php CHANGED
@@ -7,5 +7,4 @@ $baseDir = dirname($vendorDir);
7
 
8
  return array(
9
  '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
10
- 'f15d016d70663d5e96ccd2b863511eb8' => $vendorDir . '/cbschuld/browser.php/lib/Browser.php',
11
  );
7
 
8
  return array(
9
  '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
 
10
  );
vendor/composer/autoload_namespaces.php CHANGED
@@ -6,7 +6,6 @@ $vendorDir = dirname(dirname(__FILE__));
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
9
- 'xrstf\\Composer52' => array($vendorDir . '/xrstf/composer-php52/lib'),
10
  'Parsedown' => array($vendorDir . '/erusev/parsedown'),
11
  'Composer\\Installers\\' => array($vendorDir . '/composer/installers/src'),
12
  );
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
 
9
  'Parsedown' => array($vendorDir . '/erusev/parsedown'),
10
  'Composer\\Installers\\' => array($vendorDir . '/composer/installers/src'),
11
  );
vendor/composer/autoload_real_52.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real_52.php generated by xrstf/composer-php52
4
 
5
- class ComposerAutoloaderInit8a66826007d5643bdcfe624684800d5a {
6
  private static $loader;
7
 
8
  public static function loadClassLoader($class) {
@@ -19,9 +19,9 @@ class ComposerAutoloaderInit8a66826007d5643bdcfe624684800d5a {
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit8a66826007d5643bdcfe624684800d5a', 'loadClassLoader'), true /*, true */);
23
  self::$loader = $loader = new xrstf_Composer52_ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit8a66826007d5643bdcfe624684800d5a', 'loadClassLoader'));
25
 
26
  $vendorDir = dirname(dirname(__FILE__));
27
  $baseDir = dirname($vendorDir);
@@ -40,7 +40,6 @@ class ComposerAutoloaderInit8a66826007d5643bdcfe624684800d5a {
40
  $loader->register(true);
41
 
42
  // require $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php'; // disabled because of PHP 5.3 syntax
43
- require $vendorDir . '/cbschuld/browser.php/lib/Browser.php';
44
 
45
  return $loader;
46
  }
2
 
3
  // autoload_real_52.php generated by xrstf/composer-php52
4
 
5
+ class ComposerAutoloaderInit52f18c863cfacef7cbaf78b5fc45c210 {
6
  private static $loader;
7
 
8
  public static function loadClassLoader($class) {
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit52f18c863cfacef7cbaf78b5fc45c210', 'loadClassLoader'), true /*, true */);
23
  self::$loader = $loader = new xrstf_Composer52_ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit52f18c863cfacef7cbaf78b5fc45c210', 'loadClassLoader'));
25
 
26
  $vendorDir = dirname(dirname(__FILE__));
27
  $baseDir = dirname($vendorDir);
40
  $loader->register(true);
41
 
42
  // require $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php'; // disabled because of PHP 5.3 syntax
 
43
 
44
  return $loader;
45
  }
vendor/composer/installed.json CHANGED
@@ -1,45 +1,4 @@
1
  [
2
- {
3
- "name": "cbschuld/browser.php",
4
- "version": "dev-master",
5
- "version_normalized": "9999999-dev",
6
- "source": {
7
- "type": "git",
8
- "url": "https://github.com/cbschuld/Browser.php.git",
9
- "reference": "45f4e96082c1b63357088f2204cc544574c713cf"
10
- },
11
- "dist": {
12
- "type": "zip",
13
- "url": "https://api.github.com/repos/cbschuld/Browser.php/zipball/45f4e96082c1b63357088f2204cc544574c713cf",
14
- "reference": "45f4e96082c1b63357088f2204cc544574c713cf",
15
- "shasum": ""
16
- },
17
- "time": "2015-02-09 13:43:55",
18
- "type": "library",
19
- "installation-source": "source",
20
- "autoload": {
21
- "files": [
22
- "lib/Browser.php"
23
- ]
24
- },
25
- "notification-url": "https://packagist.org/downloads/",
26
- "license": [
27
- "MIT"
28
- ],
29
- "authors": [
30
- {
31
- "name": "Chris Schuld",
32
- "email": "chris@chrisschuld.com",
33
- "homepage": "http://chrisschuld.com"
34
- }
35
- ],
36
- "homepage": "http://chrisschuld.com/projects/browser-php-detecting-a-users-browser-from-php.html",
37
- "keywords": [
38
- "browser",
39
- "detection",
40
- "user agent"
41
- ]
42
- },
43
  {
44
  "name": "erusev/parsedown",
45
  "version": "1.6.0",
@@ -81,40 +40,6 @@
81
  "parser"
82
  ]
83
  },
84
- {
85
- "name": "xrstf/composer-php52",
86
- "version": "v1.0.19",
87
- "version_normalized": "1.0.19.0",
88
- "source": {
89
- "type": "hg",
90
- "url": "https://bitbucket.org/xrstf/composer-php52",
91
- "reference": "9a4a9c46d0347b39bf9159815301dc66fc25324e"
92
- },
93
- "dist": {
94
- "type": "zip",
95
- "url": "https://bitbucket.org/xrstf/composer-php52/get/9a4a9c46d0347b39bf9159815301dc66fc25324e.zip",
96
- "reference": "9a4a9c46d0347b39bf9159815301dc66fc25324e",
97
- "shasum": ""
98
- },
99
- "time": "2015-10-01 14:11:58",
100
- "type": "library",
101
- "extra": {
102
- "branch-alias": {
103
- "dev-default": "1.x-dev"
104
- }
105
- },
106
- "installation-source": "dist",
107
- "autoload": {
108
- "psr-0": {
109
- "xrstf\\Composer52": "lib/"
110
- }
111
- },
112
- "notification-url": "https://packagist.org/downloads/",
113
- "license": [
114
- "MIT"
115
- ],
116
- "homepage": "http://www.xrstf.de/"
117
- },
118
  {
119
  "name": "nesbot/carbon",
120
  "version": "1.21.0",
@@ -361,8 +286,8 @@
361
  },
362
  {
363
  "name": "symfony/polyfill-mbstring",
364
- "version": "v1.1.0",
365
- "version_normalized": "1.1.0.0",
366
  "source": {
367
  "type": "git",
368
  "url": "https://github.com/symfony/polyfill-mbstring.git",
@@ -422,8 +347,8 @@
422
  },
423
  {
424
  "name": "symfony/translation",
425
- "version": "v3.0.2",
426
- "version_normalized": "3.0.2.0",
427
  "source": {
428
  "type": "git",
429
  "url": "https://github.com/symfony/translation.git",
1
  [
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  {
3
  "name": "erusev/parsedown",
4
  "version": "1.6.0",
40
  "parser"
41
  ]
42
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  {
44
  "name": "nesbot/carbon",
45
  "version": "1.21.0",
286
  },
287
  {
288
  "name": "symfony/polyfill-mbstring",
289
+ "version": "v1.1.1",
290
+ "version_normalized": "1.1.1.0",
291
  "source": {
292
  "type": "git",
293
  "url": "https://github.com/symfony/polyfill-mbstring.git",
347
  },
348
  {
349
  "name": "symfony/translation",
350
+ "version": "v3.0.3",
351
+ "version_normalized": "3.0.3.0",
352
  "source": {
353
  "type": "git",
354
  "url": "https://github.com/symfony/translation.git",
vendor/symfony/translation/Tests/Writer/TranslationWriterTest.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of the Symfony package.
5
+ *
6
+ * (c) Fabien Potencier <fabien@symfony.com>
7
+ *
8
+ * For the full copyright and license information, please view the LICENSE
9
+ * file that was distributed with this source code.
10
+ */
11
+
12
+ namespace Symfony\Component\Translation\Tests\Writer;
13
+
14
+ use Symfony\Component\Translation\MessageCatalogue;
15
+ use Symfony\Component\Translation\Writer\TranslationWriter;
16
+
17
+ class TranslationWriterTest extends \PHPUnit_Framework_TestCase
18
+ {
19
+ public function testWriteTranslations()
20
+ {
21
+ $dumper = $this->getMock('Symfony\Component\Translation\Dumper\DumperInterface');
22
+ $dumper
23
+ ->expects($this->once())
24
+ ->method('dump');
25
+
26
+ $writer = new TranslationWriter();
27
+ $writer->addDumper('test', $dumper);
28
+ $writer->writeTranslations(new MessageCatalogue(array()), 'test');
29
+ }
30
+
31
+ public function testDisableBackup()
32
+ {
33
+ $dumper = $this->getMock('Symfony\Component\Translation\Dumper\DumperInterface');
34
+ $dumper
35
+ ->expects($this->never())
36
+ ->method('setBackup');
37
+ $phpDumper = $this->getMock('Symfony\Component\Translation\Dumper\PhpFileDumper');
38
+ $phpDumper
39
+ ->expects($this->once())
40
+ ->method('setBackup');
41
+
42
+ $writer = new TranslationWriter();
43
+ $writer->addDumper('test', $dumper);
44
+ $writer->addDumper('php', $phpDumper);
45
+ $writer->disableBackup();
46
+ }
47
+ }
vendor/xrstf/composer-php52/LICENSE DELETED
@@ -1,19 +0,0 @@
1
- Copyright (c) 2013 Christoph Mewes
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy
4
- of this software and associated documentation files (the "Software"), to deal
5
- in the Software without restriction, including without limitation the rights
6
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- copies of the Software, and to permit persons to whom the Software is furnished
8
- to do so, subject to the following conditions:
9
-
10
- The above copyright notice and this permission notice shall be included in all
11
- copies or substantial portions of the Software.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- THE SOFTWARE.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/xrstf/composer-php52/README.md DELETED
@@ -1,29 +0,0 @@
1
- PHP 5.2 Autoloading for Composer
2
- ================================
3
-
4
- This package provides an easy way to get a PHP 5.2 compatible autoloader out of Composer. The generated autoloader is fully compatible to the original and is written into separate files, each ending with `_52.php`.
5
-
6
- Usage
7
- -----
8
-
9
- In your project's `composer.json`, add the following lines:
10
-
11
- :::json
12
- {
13
- "require": {
14
- "xrstf/composer-php52": "1.*"
15
- },
16
- "scripts": {
17
- "post-install-cmd": [
18
- "xrstf\\Composer52\\Generator::onPostInstallCmd"
19
- ],
20
- "post-update-cmd": [
21
- "xrstf\\Composer52\\Generator::onPostInstallCmd"
22
- ],
23
- "post-autoload-dump": [
24
- "xrstf\\Composer52\\Generator::onPostInstallCmd"
25
- ]
26
- }
27
- }
28
-
29
- After the next update/install, you will have a `vendor/autoload_52.php` file, that you can simply include and use in PHP 5.2 projects.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/xrstf/composer-php52/composer.json DELETED
@@ -1,27 +0,0 @@
1
- {
2
- "name": "xrstf/composer-php52",
3
- "license": "MIT",
4
- "homepage": "http://www.xrstf.de/",
5
- "support": {
6
- "source": "https://bitbucket.org/xrstf/composer-php52",
7
- "issues": "https://bitbucket.org/xrstf/composer-php52/issues"
8
- },
9
- "autoload": {
10
- "psr-0": {
11
- "xrstf\\Composer52": "lib/"
12
- }
13
- },
14
- "scripts": {
15
- "post-install-cmd": [
16
- "xrstf\\Composer52\\Generator::onPostInstallCmd"
17
- ],
18
- "post-update-cmd": [
19
- "xrstf\\Composer52\\Generator::onPostInstallCmd"
20
- ]
21
- },
22
- "extra": {
23
- "branch-alias": {
24
- "dev-default": "1.x-dev"
25
- }
26
- }
27
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/xrstf/composer-php52/lib/xrstf/Composer52/AutoloadGenerator.php DELETED
@@ -1,346 +0,0 @@
1
- <?php
2
- /*
3
- * Copyright (c) 2013, Christoph Mewes, http://www.xrstf.de
4
- *
5
- * This file is released under the terms of the MIT license. You can find the
6
- * complete text in the attached LICENSE file or online at:
7
- *
8
- * http://www.opensource.org/licenses/mit-license.php
9
- *
10
- * --------------------------------------------------------------------------
11
- *
12
- * 99% of this is copied as-is from the original Composer source code and is
13
- * released under MIT license as well. Copyright goes to:
14
- *
15
- * - Igor Wiedler <igor@wiedler.ch>
16
- * - Jordi Boggiano <j.boggiano@seld.be>
17
- */
18
-
19
- namespace xrstf\Composer52;
20
-
21
- use Composer\Autoload\AutoloadGenerator as BaseGenerator;
22
- use Composer\Autoload\ClassMapGenerator;
23
- use Composer\Config;
24
- use Composer\Installer\InstallationManager;
25
- use Composer\Package\AliasPackage;
26
- use Composer\Package\PackageInterface;
27
- use Composer\Repository\InstalledRepositoryInterface;
28
- use Composer\Util\Filesystem;
29
-
30
- class AutoloadGenerator extends BaseGenerator {
31
-
32
- /**
33
- * @var bool
34
- */
35
- private $classMapAuthoritative = false;
36
-
37
- public function __construct() {
38
- // do nothing (but keep this constructor so we can build an instance without the need for an event dispatcher)
39
- }
40
-
41
- /**
42
- * Whether or not generated autoloader considers the class map
43
- * authoritative.
44
- *
45
- * @param bool $classMapAuthoritative
46
- */
47
- public function setClassMapAuthoritative($classMapAuthoritative)
48
- {
49
- $this->classMapAuthoritative = (boolean) $classMapAuthoritative;
50
- }
51
-
52
- public function dump(Config $config, InstalledRepositoryInterface $localRepo, PackageInterface $mainPackage, InstallationManager $installationManager, $targetDir, $scanPsr0Packages = false, $suffix = '') {
53
- if ($this->classMapAuthoritative) {
54
- // Force scanPsr0Packages when classmap is authoritative
55
- $scanPsr0Packages = true;
56
- }
57
-
58
- $filesystem = new Filesystem();
59
- $filesystem->ensureDirectoryExists($config->get('vendor-dir'));
60
-
61
- $cwd = getcwd();
62
- $basePath = $filesystem->normalizePath($cwd);
63
- $vendorPath = $filesystem->normalizePath(realpath($config->get('vendor-dir')));
64
- $targetDir = $vendorPath.'/'.$targetDir;
65
- $filesystem->ensureDirectoryExists($targetDir);
66
-
67
- $useGlobalIncludePath = (bool) $config->get('use-include-path');
68
- $prependAutoloader = $config->get('prepend-autoloader') === false ? 'false' : 'true';
69
- $classMapAuthoritative = $config->get('classmap-authoritative');
70
-
71
- $vendorPathCode = $filesystem->findShortestPathCode(realpath($targetDir), $vendorPath, true);
72
- $vendorPathToTargetDirCode = $filesystem->findShortestPathCode($vendorPath, realpath($targetDir), true);
73
-
74
- $appBaseDirCode = $filesystem->findShortestPathCode($vendorPath, $basePath, true);
75
- $appBaseDirCode = str_replace('__DIR__', '$vendorDir', $appBaseDirCode);
76
-
77
- // add 5.2 compat
78
- $vendorPathCode = str_replace('__DIR__', 'dirname(__FILE__)', $vendorPathCode);
79
- $vendorPathToTargetDirCode = str_replace('__DIR__', 'dirname(__FILE__)', $vendorPathToTargetDirCode);
80
-
81
- $packageMap = $this->buildPackageMap($installationManager, $mainPackage, $localRepo->getCanonicalPackages());
82
- $autoloads = $this->parseAutoloads($packageMap, $mainPackage);
83
-
84
- // add custom psr-0 autoloading if the root package has a target dir
85
- $targetDirLoader = null;
86
- $mainAutoload = $mainPackage->getAutoload();
87
- if ($mainPackage->getTargetDir() && !empty($mainAutoload['psr-0'])) {
88
- $levels = count(explode('/', $filesystem->normalizePath($mainPackage->getTargetDir())));
89
- $prefixes = implode(', ', array_map(function ($prefix) {
90
- return var_export($prefix, true);
91
- }, array_keys($mainAutoload['psr-0'])));
92
-
93
- $baseDirFromTargetDirCode = $filesystem->findShortestPathCode($targetDir, $basePath, true);
94
-
95
- $targetDirLoader = <<<EOF
96
-
97
- public static function autoload(\$class) {
98
- \$dir = $baseDirFromTargetDirCode.'/';
99
- \$prefixes = array($prefixes);
100
-
101
- foreach (\$prefixes as \$prefix) {
102
- if (0 !== strpos(\$class, \$prefix)) {
103
- continue;
104
- }
105
-
106
- \$path = explode(DIRECTORY_SEPARATOR, self::getClassPath(\$class));
107
- \$path = \$dir.implode('/', array_slice(\$path, $levels));
108
-
109
- if (!\$path = self::resolveIncludePath(\$path)) {
110
- return false;
111
- }
112
-
113
- require \$path;
114
- return true;
115
- }
116
- }
117
-
118
- EOF;
119
- }
120
-
121
- $filesCode = "";
122
- $autoloads['files'] = new \RecursiveIteratorIterator(new \RecursiveArrayIterator($autoloads['files']));
123
- foreach ($autoloads['files'] as $functionFile) {
124
- // don't include file if it is using PHP 5.3+ syntax
125
- // https://bitbucket.org/xrstf/composer-php52/issue/4
126
- if ($this->isPHP53($functionFile)) {
127
- $filesCode .= '// require '.$this->getPathCode($filesystem, $basePath, $vendorPath, $functionFile)."; // disabled because of PHP 5.3 syntax\n";
128
- }
129
- else {
130
- $filesCode .= ' require '.$this->getPathCode($filesystem, $basePath, $vendorPath, $functionFile).";\n";
131
- }
132
- }
133
-
134
- if (!$suffix) {
135
- $suffix = md5(uniqid('', true));
136
- }
137
-
138
- $includePathFile = $this->getIncludePathsFile($packageMap, $filesystem, $basePath, $vendorPath, $vendorPathCode, $appBaseDirCode);
139
-
140
- file_put_contents($vendorPath.'/autoload_52.php', $this->getAutoloadFile($vendorPathToTargetDirCode, $suffix));
141
- file_put_contents($targetDir.'/autoload_real_52.php', $this->getAutoloadRealFile(true, (bool) $includePathFile, $targetDirLoader, $filesCode, $vendorPathCode, $appBaseDirCode, $suffix, $useGlobalIncludePath, $prependAutoloader));
142
-
143
- // use stream_copy_to_stream instead of copy
144
- // to work around https://bugs.php.net/bug.php?id=64634
145
- $sourceLoader = fopen(__DIR__.'/ClassLoader.php', 'r');
146
- $targetLoader = fopen($targetDir.'/ClassLoader52.php', 'w+');
147
- stream_copy_to_stream($sourceLoader, $targetLoader);
148
- fclose($sourceLoader);
149
- fclose($targetLoader);
150
- unset($sourceLoader, $targetLoader);
151
- }
152
-
153
- protected function isPHP53($file) {
154
- $tokens = token_get_all(file_get_contents($file));
155
- $php53 = array(T_DIR, T_GOTO, T_NAMESPACE, T_NS_C, T_NS_SEPARATOR, T_USE);
156
-
157
- // PHP 5.4+
158
- if (defined('T_TRAIT')) {
159
- $php53[] = T_TRAIT;
160
- $php53[] = T_TRAIT_C;
161
- $php53[] = T_TRAIT_C;
162
- }
163
-
164
- // PHP 5.5+
165
- if (defined('T_FINALLY')) {
166
- $php53[] = T_FINALLY;
167
- $php53[] = T_YIELD;
168
- }
169
-
170
- foreach ($tokens as $token) {
171
- if (is_array($token) && in_array($token[0], $php53)) {
172
- return true;
173
- }
174
- }
175
-
176
- return false;
177
- }
178
-
179
- protected function getIncludePathsFile(array $packageMap, Filesystem $filesystem, $basePath, $vendorPath, $vendorPathCode, $appBaseDirCode) {
180
- $includePaths = array();
181
-
182
- foreach ($packageMap as $item) {
183
- list($package, $installPath) = $item;
184
-
185
- if (null !== $package->getTargetDir() && strlen($package->getTargetDir()) > 0) {
186
- $installPath = substr($installPath, 0, -strlen('/'.$package->getTargetDir()));
187
- }
188
-
189
- foreach ($package->getIncludePaths() as $includePath) {
190
- $includePath = trim($includePath, '/');
191
- $includePaths[] = empty($installPath) ? $includePath : $installPath.'/'.$includePath;
192
- }
193
- }
194
-
195
- if (!$includePaths) {
196
- return;
197
- }
198
-
199
- $includePathsFile = <<<EOF
200
- <?php
201
-
202
- // include_paths_52.php generated by xrstf/composer-php52
203
-
204
- \$vendorDir = $vendorPathCode;
205
- \$baseDir = $appBaseDirCode;
206
-
207
- return array(
208
-
209
- EOF;
210
-
211
- foreach ($includePaths as $path) {
212
- $includePathsFile .= "\t" . $this->getPathCode($filesystem, $basePath, $vendorPath, $path) . ",\n";
213
- }
214
-
215
- return $includePathsFile . ");\n";
216
- }
217
-
218
- protected function getAutoloadFile($vendorPathToTargetDirCode, $suffix) {
219
- return <<<AUTOLOAD
220
- <?php
221
-
222
- // autoload_52.php generated by xrstf/composer-php52
223
-
224
- require_once $vendorPathToTargetDirCode.'/autoload_real_52.php';
225
-
226
- return ComposerAutoloaderInit$suffix::getLoader();
227
-
228
- AUTOLOAD;
229
- }
230
-
231
- protected function getAutoloadRealFile($useClassMap, $useIncludePath, $targetDirLoader, $filesCode, $vendorPathCode, $appBaseDirCode, $suffix, $useGlobalIncludePath, $prependAutoloader) {
232
- // TODO the class ComposerAutoloaderInit should be revert to a closure
233
- // when APC has been fixed:
234
- // - https://github.com/composer/composer/issues/959
235
- // - https://bugs.php.net/bug.php?id=52144
236
- // - https://bugs.php.net/bug.php?id=61576
237
- // - https://bugs.php.net/bug.php?id=59298
238
-
239
- if ($filesCode) {
240
- $filesCode = "\n\n".rtrim($filesCode);
241
- }
242
-
243
- $file = <<<HEADER
244
- <?php
245
-
246
- // autoload_real_52.php generated by xrstf/composer-php52
247
-
248
- class ComposerAutoloaderInit$suffix {
249
- private static \$loader;
250
-
251
- public static function loadClassLoader(\$class) {
252
- if ('xrstf_Composer52_ClassLoader' === \$class) {
253
- require dirname(__FILE__).'/ClassLoader52.php';
254
- }
255
- }
256
-
257
- /**
258
- * @return xrstf_Composer52_ClassLoader
259
- */
260
- public static function getLoader() {
261
- if (null !== self::\$loader) {
262
- return self::\$loader;
263
- }
264
-
265
- spl_autoload_register(array('ComposerAutoloaderInit$suffix', 'loadClassLoader'), true /*, true */);
266
- self::\$loader = \$loader = new xrstf_Composer52_ClassLoader();
267
- spl_autoload_unregister(array('ComposerAutoloaderInit$suffix', 'loadClassLoader'));
268
-
269
- \$vendorDir = $vendorPathCode;
270
- \$baseDir = $appBaseDirCode;
271
- \$dir = dirname(__FILE__);
272
-
273
-
274
- HEADER;
275
-
276
- if ($useIncludePath) {
277
- $file .= <<<'INCLUDE_PATH'
278
- $includePaths = require $dir.'/include_paths.php';
279
- array_push($includePaths, get_include_path());
280
- set_include_path(implode(PATH_SEPARATOR, $includePaths));
281
-
282
-
283
- INCLUDE_PATH;
284
- }
285
-
286
- $file .= <<<'PSR0'
287
- $map = require $dir.'/autoload_namespaces.php';
288
- foreach ($map as $namespace => $path) {
289
- $loader->add($namespace, $path);
290
- }
291
-
292
-
293
- PSR0;
294
-
295
- if ($useClassMap) {
296
- $file .= <<<'CLASSMAP'
297
- $classMap = require $dir.'/autoload_classmap.php';
298
- if ($classMap) {
299
- $loader->addClassMap($classMap);
300
- }
301
-
302
-
303
- CLASSMAP;
304
- }
305
-
306
- if ($this->classMapAuthoritative) {
307
- $file .= <<<'CLASSMAPAUTHORITATIVE'
308
- $loader->setClassMapAuthoritative(true);
309
-
310
- CLASSMAPAUTHORITATIVE;
311
- }
312
-
313
- if ($useGlobalIncludePath) {
314
- $file .= <<<'INCLUDEPATH'
315
- $loader->setUseIncludePath(true);
316
-
317
-
318
- INCLUDEPATH;
319
- }
320
-
321
- if ($targetDirLoader) {
322
- $file .= <<<REGISTER_AUTOLOAD
323
- spl_autoload_register(array('ComposerAutoloaderInit$suffix', 'autoload'), true);
324
-
325
-
326
- REGISTER_AUTOLOAD;
327
-
328
- }
329
-
330
- $file .= <<<METHOD_FOOTER
331
- \$loader->register($prependAutoloader);{$filesCode}
332
-
333
- return \$loader;
334
- }
335
-
336
- METHOD_FOOTER;
337
-
338
- $file .= $targetDirLoader;
339
-
340
- return $file . <<<FOOTER
341
- }
342
-
343
- FOOTER;
344
-
345
- }
346
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/xrstf/composer-php52/lib/xrstf/Composer52/ClassLoader.php DELETED
@@ -1,271 +0,0 @@
1
- <?php
2
- /*
3
- * Copyright (c) 2013, Christoph Mewes, http://www.xrstf.de
4
- *
5
- * This file is released under the terms of the MIT license. You can find the
6
- * complete text in the attached LICENSE file or online at:
7
- *
8
- * http://www.opensource.org/licenses/mit-license.php
9
- *
10
- * --------------------------------------------------------------------------
11
- *
12
- * 99% of this is copied as-is from the original Composer source code and is
13
- * released under MIT license as well. Copyright goes to:
14
- *
15
- * - Fabien Potencier <fabien@symfony.com>
16
- * - Jordi Boggiano <j.boggiano@seld.be>
17
- */
18
-
19
- class xrstf_Composer52_ClassLoader {
20
- private $prefixes = array();
21
- private $fallbackDirs = array();
22
- private $useIncludePath = false;
23
- private $classMap = array();
24
- private $classMapAuthoratative = false;
25
- private $allowUnderscore = false;
26
-
27
- /**
28
- * @param boolean $flag true to allow class names with a leading underscore, false to disable
29
- */
30
- public function setAllowUnderscore($flag) {
31
- $this->allowUnderscore = (boolean) $flag;
32
- }
33
-
34
- /**
35
- * @return array
36
- */
37
- public function getPrefixes() {
38
- return $this->prefixes;
39
- }
40
-
41
- /**
42
- * Turns off searching the prefix and fallback directories for classes
43
- * that have not been registered with the class map.
44
- *
45
- * @param bool $classMapAuthoratative
46
- */
47
- public function setClassMapAuthoritative($classMapAuthoratative) {
48
- $this->classMapAuthoratative = $classMapAuthoratative;
49
- }
50
-
51
- /**
52
- * Should class lookup fail if not found in the current class map?
53
- *
54
- * @return bool
55
- */
56
- public function getClassMapAuthoratative() {
57
- return $this->classMapAuthoratative;
58
- }
59
-
60
- /**
61
- * @return array
62
- */
63
- public function getFallbackDirs() {
64
- return $this->fallbackDirs;
65
- }
66
-
67
- /**
68
- * @return array
69
- */
70
- public function getClassMap() {
71
- return $this->classMap;
72
- }
73
-
74
- /**
75
- * @param array $classMap class to filename map
76
- */
77
- public function addClassMap(array $classMap) {
78
- if ($this->classMap) {
79
- $this->classMap = array_merge($this->classMap, $classMap);
80
- }
81
- else {
82
- $this->classMap = $classMap;
83
- }
84
- }
85
-
86
- /**
87
- * Registers a set of classes, merging with any others previously set.
88
- *
89
- * @param string $prefix the classes prefix
90
- * @param array|string $paths the location(s) of the classes
91
- * @param bool $prepend prepend the location(s)
92
- */
93
- public function add($prefix, $paths, $prepend = false) {
94
- if (!$prefix) {
95
- if ($prepend) {
96
- $this->fallbackDirs = array_merge(
97
- (array) $paths,
98
- $this->fallbackDirs
99
- );
100
- }
101
- else {
102
- $this->fallbackDirs = array_merge(
103
- $this->fallbackDirs,
104
- (array) $paths
105
- );
106
- }
107
-
108
- return;
109
- }
110
-
111
- if (!isset($this->prefixes[$prefix])) {
112
- $this->prefixes[$prefix] = (array) $paths;
113
- return;
114
- }
115
-
116
- if ($prepend) {
117
- $this->prefixes[$prefix] = array_merge(
118
- (array) $paths,
119
- $this->prefixes[$prefix]
120
- );
121
- }
122
- else {
123
- $this->prefixes[$prefix] = array_merge(
124
- $this->prefixes[$prefix],
125
- (array) $paths
126
- );
127
- }
128
- }
129
-
130
- /**
131
- * Registers a set of classes, replacing any others previously set.
132
- *
133
- * @param string $prefix the classes prefix
134
- * @param array|string $paths the location(s) of the classes
135
- */
136
- public function set($prefix, $paths) {
137
- if (!$prefix) {
138
- $this->fallbackDirs = (array) $paths;
139
- return;
140
- }
141
-
142
- $this->prefixes[$prefix] = (array) $paths;
143
- }
144
-
145
- /**
146
- * Turns on searching the include path for class files.
147
- *
148
- * @param bool $useIncludePath
149
- */
150
- public function setUseIncludePath($useIncludePath) {
151
- $this->useIncludePath = $useIncludePath;
152
- }
153
-
154
- /**
155
- * Can be used to check if the autoloader uses the include path to check
156
- * for classes.
157
- *
158
- * @return bool
159
- */
160
- public function getUseIncludePath() {
161
- return $this->useIncludePath;
162
- }
163
-
164
- /**
165
- * Registers this instance as an autoloader.
166
- */
167
- public function register() {
168
- spl_autoload_register(array($this, 'loadClass'), true);
169
- }
170
-
171
- /**
172
- * Unregisters this instance as an autoloader.
173
- */
174
- public function unregister() {
175
- spl_autoload_unregister(array($this, 'loadClass'));
176
- }
177
-
178
- /**
179
- * Loads the given class or interface.
180
- *
181
- * @param string $class the name of the class
182
- * @return bool|null true, if loaded
183
- */
184
- public function loadClass($class) {
185
- if ($file = $this->findFile($class)) {
186
- include $file;
187
- return true;
188
- }
189
- }
190
-
191
- /**
192
- * Finds the path to the file where the class is defined.
193
- *
194
- * @param string $class the name of the class
195
- * @return string|null the path, if found
196
- */
197
- public function findFile($class) {
198
- if ('\\' === $class[0]) {
199
- $class = substr($class, 1);
200
- }
201
-
202
- if (isset($this->classMap[$class])) {
203
- return $this->classMap[$class];
204
- }
205
- elseif ($this->classMapAuthoratative) {
206
- return false;
207
- }
208
-
209
- $classPath = $this->getClassPath($class);
210
-
211
- foreach ($this->prefixes as $prefix => $dirs) {
212
- if (0 === strpos($class, $prefix)) {
213
- foreach ($dirs as $dir) {
214
- if (file_exists($dir.DIRECTORY_SEPARATOR.$classPath)) {
215
- return $dir.DIRECTORY_SEPARATOR.$classPath;
216
- }
217
- }
218
- }
219
- }
220
-
221
- foreach ($this->fallbackDirs as $dir) {
222
- if (file_exists($dir.DIRECTORY_SEPARATOR.$classPath)) {
223
- return $dir.DIRECTORY_SEPARATOR.$classPath;
224
- }
225
- }
226
-
227
- if ($this->useIncludePath && $file = self::resolveIncludePath($classPath)) {
228
- return $file;
229
- }
230
-
231
- return $this->classMap[$class] = false;
232
- }
233
-
234
- private function getClassPath($class) {
235
- if (false !== $pos = strrpos($class, '\\')) {
236
- // namespaced class name
237
- $classPath = str_replace('\\', DIRECTORY_SEPARATOR, substr($class, 0, $pos)).DIRECTORY_SEPARATOR;
238
- $className = substr($class, $pos + 1);
239
- }
240
- else {
241
- // PEAR-like class name
242
- $classPath = null;
243
- $className = $class;
244
- }
245
-
246
- $className = str_replace('_', DIRECTORY_SEPARATOR, $className);
247
-
248
- // restore the prefix
249
- if ($this->allowUnderscore && DIRECTORY_SEPARATOR === $className[0]) {
250
- $className[0] = '_';
251
- }
252
-
253
- $classPath .= $className.'.php';
254
-
255
- return $classPath;
256
- }
257
-
258
- public static function resolveIncludePath($classPath) {
259
- $paths = explode(PATH_SEPARATOR, get_include_path());
260
-
261
- foreach ($paths as $path) {
262
- $path = rtrim($path, '/\\');
263
-
264
- if ($file = file_exists($path.DIRECTORY_SEPARATOR.$file)) {
265
- return $file;
266
- }
267
- }
268
-
269
- return false;
270
- }
271
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/xrstf/composer-php52/lib/xrstf/Composer52/Generator.php DELETED
@@ -1,39 +0,0 @@
1
- <?php
2
- /*
3
- * Copyright (c) 2013, Christoph Mewes, http://www.xrstf.de
4
- *
5
- * This file is released under the terms of the MIT license. You can find the
6
- * complete text in the attached LICENSE file or online at:
7
- *
8
- * http://www.opensource.org/licenses/mit-license.php
9
- */
10
-
11
- namespace xrstf\Composer52;
12
-
13
- use Composer\Repository\CompositeRepository;
14
- use Composer\Script\Event;
15
-
16
- class Generator {
17
- public static function onPostInstallCmd(Event $event) {
18
- $composer = $event->getComposer();
19
- $installationManager = $composer->getInstallationManager();
20
- $repoManager = $composer->getRepositoryManager();
21
- $localRepo = $repoManager->getLocalRepository();
22
- $package = $composer->getPackage();
23
- $config = $composer->getConfig();
24
-
25
- // We can't gain access to the Command's input object, so we have to look
26
- // for -o / --optimize-autoloader ourselves. Sadly, neither getopt() works
27
- // (always returns an empty array), nor does Symfony's Console Input, as
28
- // it expects a full definition of the current command line and we can't
29
- // provide that.
30
-
31
- $args = $_SERVER['argv'];
32
- $optimize = in_array('-o', $args) || in_array('--optimize-autoloader', $args) || in_array('--optimize', $args);
33
-
34
- $suffix = $config->get('autoloader-suffix');
35
-
36
- $generator = new AutoloadGenerator();
37
- $generator->dump($config, $localRepo, $package, $installationManager, 'composer', $optimize, $suffix);
38
- }
39
- }